Revert incorrect RCL_3 drop: RCL_3 PDK_3.0.2
authorPat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:27:42 +0100
branchRCL_3
changeset 26 19bba8228ff0
parent 25 b183ec05bd8c
child 27 5cc2995847ea
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
dcmofw/dcmoclient/group/dcmoclient.mmp
dcmofw/dcmocustcmd/group/dcmostartupcustcmd.mmp
dcmofw/dcmoserver/group/bld.inf
dcmofw/dcmoserver/group/dcmoserver.mmp
dcmofw/dcmoserver/inc/amsmlhelper.h
dcmofw/dcmoserver/inc/dcmomessagebox.h
dcmofw/dcmoserver/inc/dcmonotifieraob.h
dcmofw/dcmoserver/inc/dcmoserver.h
dcmofw/dcmoserver/src/AMSmlHelper.cpp
dcmofw/dcmoserver/src/dcmomessagebox.cpp
dcmofw/dcmoserver/src/dcmonotifieraob.cpp
dcmofw/dcmoserver/src/dcmoserver.cpp
dcmofw/dcmoserver/src/dcmosession.cpp
dcmofw/group/bld.inf
dcmofw/inc/dcmoclientserver.h
dcmofw/inc/lawmodebug.h
dcmofw/lawmoclient/bwins/lawmoclientu.def
dcmofw/lawmoclient/eabi/lawmoclientu.def
dcmofw/lawmoclient/group/bld.inf
dcmofw/lawmoclient/group/lawmoclient.mmp
dcmofw/lawmoclient/src/lawmoclient.cpp
dcmofw/rom/dcmofw.iby
dcmofw/rom/dcmofwresources.iby
devicediagnosticsfw/diagframework/bwins/diagframework.def
devicediagnosticsfw/diagframework/cenrep_files/clean_cenrep.bat
devicediagnosticsfw/diagframework/cenrep_files/keys_diagnosticsfw.xls
devicediagnosticsfw/diagframework/cenrep_files/make_cenrep.bat
devicediagnosticsfw/diagframework/cenrep_files/output/inifiles/2000B16B.txt
devicediagnosticsfw/diagframework/cenrep_files/output/key_sheets_info.storable
devicediagnosticsfw/diagframework/cenrep_files/output/rfs/cenrep_rfs.txt
devicediagnosticsfw/diagframework/conf/diagnosticsfw.confml
devicediagnosticsfw/diagframework/conf/diagnosticsfw_2000B16B.crml
devicediagnosticsfw/diagframework/eabi/diagframework.def
devicediagnosticsfw/diagframework/group/bld.inf
devicediagnosticsfw/diagframework/group/diagframework.mmp
devicediagnosticsfw/diagframework/group/diagframework_uid_.cpp
devicediagnosticsfw/diagframework/inc/diagappcommand.h
devicediagnosticsfw/diagframework/inc/diagcleanupresetanddestroy.h
devicediagnosticsfw/diagframework/inc/diagcleanupresetanddestroy.inl
devicediagnosticsfw/diagframework/inc/diagcommondialog.h
devicediagnosticsfw/diagframework/inc/diagengine.h
devicediagnosticsfw/diagframework/inc/diagenginecallhandler.h
devicediagnosticsfw/diagframework/inc/diagenginecallhandlerobserver.h
devicediagnosticsfw/diagframework/inc/diagenginecallhandlerstates.h
devicediagnosticsfw/diagframework/inc/diagenginecommon.h
devicediagnosticsfw/diagframework/inc/diagengineconfig.h
devicediagnosticsfw/diagframework/inc/diagengineeventbasic.h
devicediagnosticsfw/diagframework/inc/diagengineevents.h
devicediagnosticsfw/diagframework/inc/diagengineeventtestprogress.h
devicediagnosticsfw/diagframework/inc/diagengineimpl.h
devicediagnosticsfw/diagframework/inc/diagengineobserver.h
devicediagnosticsfw/diagframework/inc/diagenginestatemachine.h
devicediagnosticsfw/diagframework/inc/diagenginestatemachineobserver.h
devicediagnosticsfw/diagframework/inc/diagenginestates.h
devicediagnosticsfw/diagframework/inc/diagenginewatchdogtypes.h
devicediagnosticsfw/diagframework/inc/diagexecplanentry.h
devicediagnosticsfw/diagframework/inc/diagexecplanentryimpl.h
devicediagnosticsfw/diagframework/inc/diagexecplanentryimplobserver.h
devicediagnosticsfw/diagframework/inc/diagexecplanentryimplsuite.h
devicediagnosticsfw/diagframework/inc/diagexecplanentryimpltest.h
devicediagnosticsfw/diagframework/inc/diagframework.pan
devicediagnosticsfw/diagframework/inc/diagframeworkdebug.h
devicediagnosticsfw/diagframework/inc/diaglogeventeraser.h
devicediagnosticsfw/diagframework/inc/diaglogeventeraserobserver.h
devicediagnosticsfw/diagframework/inc/diagnetworkregstatusobserver.h
devicediagnosticsfw/diagframework/inc/diagnetworkregstatuswatcher.h
devicediagnosticsfw/diagframework/inc/diagnosticsfwprivatecrkeys.h
devicediagnosticsfw/diagframework/inc/diagplugin.h
devicediagnosticsfw/diagframework/inc/diagpluginconstructionparam.h
devicediagnosticsfw/diagframework/inc/diagpluginexecplan.h
devicediagnosticsfw/diagframework/inc/diagpluginexecplanimpl.h
devicediagnosticsfw/diagframework/inc/diagpluginloaderdependencyparser.h
devicediagnosticsfw/diagframework/inc/diagpluginpool.h
devicediagnosticsfw/diagframework/inc/diagpluginpoolimpl.h
devicediagnosticsfw/diagframework/inc/diagpluginpoolobserver.h
devicediagnosticsfw/diagframework/inc/diagresultdetail.h
devicediagnosticsfw/diagframework/inc/diagresultsdbItembuilder.h
devicediagnosticsfw/diagframework/inc/diagrootsuite.h
devicediagnosticsfw/diagframework/inc/diagsuiteexecparam.h
devicediagnosticsfw/diagframework/inc/diagsuiteobserver.h
devicediagnosticsfw/diagframework/inc/diagsuiteplugin.h
devicediagnosticsfw/diagframework/inc/diagtestexecparam.h
devicediagnosticsfw/diagframework/inc/diagtestobserver.h
devicediagnosticsfw/diagframework/inc/diagtestplugin.h
devicediagnosticsfw/diagframework/src/DiagTestExecParam.cpp
devicediagnosticsfw/diagframework/src/diagengine.cpp
devicediagnosticsfw/diagframework/src/diagenginecallhandler.cpp
devicediagnosticsfw/diagframework/src/diagengineconfig.cpp
devicediagnosticsfw/diagframework/src/diagengineeventbasic.cpp
devicediagnosticsfw/diagframework/src/diagengineeventtestprogress.cpp
devicediagnosticsfw/diagframework/src/diagengineimpl.cpp
devicediagnosticsfw/diagframework/src/diagenginestatemachine.cpp
devicediagnosticsfw/diagframework/src/diagexecplanentryimpl.cpp
devicediagnosticsfw/diagframework/src/diagexecplanentryimplsuite.cpp
devicediagnosticsfw/diagframework/src/diagexecplanentryimpltest.cpp
devicediagnosticsfw/diagframework/src/diaglogeventeraser.cpp
devicediagnosticsfw/diagframework/src/diagnetworkregstatuswatcher.cpp
devicediagnosticsfw/diagframework/src/diagpluginconstructionparam.cpp
devicediagnosticsfw/diagframework/src/diagpluginexecplanimpl.cpp
devicediagnosticsfw/diagframework/src/diagpluginloaderdependencyparser.cpp
devicediagnosticsfw/diagframework/src/diagpluginpool.cpp
devicediagnosticsfw/diagframework/src/diagpluginpoolimpl.cpp
devicediagnosticsfw/diagframework/src/diagresultsdbitembuilder.cpp
devicediagnosticsfw/diagframework/src/diagrootsuite.cpp
devicediagnosticsfw/diagframework/src/diagsuiteexecparam.cpp
devicediagnosticsfw/diagpluginbase/bwins/diagpluginbase.def
devicediagnosticsfw/diagpluginbase/eabi/diagpluginbase.def
devicediagnosticsfw/diagpluginbase/group/bld.inf
devicediagnosticsfw/diagpluginbase/group/diagpluginbase.mmp
devicediagnosticsfw/diagpluginbase/group/diagpluginbase_uid_.cpp
devicediagnosticsfw/diagpluginbase/inc/diagpluginbase.pan
devicediagnosticsfw/diagpluginbase/inc/diagpluginbaseutils.h
devicediagnosticsfw/diagpluginbase/inc/diagplugincommon.loc
devicediagnosticsfw/diagpluginbase/inc/diagpluginwaitingdialogwrapper.h
devicediagnosticsfw/diagpluginbase/inc/diagresultdetailbasic.h
devicediagnosticsfw/diagpluginbase/inc/diagresultdetailbasicitem.h
devicediagnosticsfw/diagpluginbase/inc/diagsuitepluginbase.h
devicediagnosticsfw/diagpluginbase/inc/diagtestpluginbase.h
devicediagnosticsfw/diagpluginbase/src/diagpluginbaseutils.cpp
devicediagnosticsfw/diagpluginbase/src/diagpluginwaitingdialogwrapper.cpp
devicediagnosticsfw/diagpluginbase/src/diagresultdetailbasic.cpp
devicediagnosticsfw/diagpluginbase/src/diagresultdetailbasicitem.cpp
devicediagnosticsfw/diagpluginbase/src/diagsuitepluginbase.cpp
devicediagnosticsfw/diagpluginbase/src/diagtestpluginbase.cpp
devicediagnosticsfw/diagresultsdb/client/bwins/diagresultsdatabase.def
devicediagnosticsfw/diagresultsdb/client/eabi/diagresultsdatabase.def
devicediagnosticsfw/diagresultsdb/client/group/bld.inf
devicediagnosticsfw/diagresultsdb/client/group/diagresultsdatabase.mmp
devicediagnosticsfw/diagresultsdb/client/group/diagresultsdatabase.xml
devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdatabase.h
devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdatabaseitem.h
devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdatabasetestrecordinfo.h
devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdbrecordengineparam.h
devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdbrecordinfoarraypacked.h
devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabase.cpp
devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabaseItem.cpp
devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabasetestrecordInfo.cpp
devicediagnosticsfw/diagresultsdb/client/src/diagresultsdbrecordengineparam.cpp
devicediagnosticsfw/diagresultsdb/client/src/diagresultsdbrecordinfoarraypacked.cpp
devicediagnosticsfw/diagresultsdb/common/diagresultsdatabasecommon.h
devicediagnosticsfw/diagresultsdb/common/diagresultsdbprivatecrkeys.h
devicediagnosticsfw/diagresultsdb/server/cenrep_files/clean_cenrep.bat
devicediagnosticsfw/diagresultsdb/server/cenrep_files/keys_diagresultsdb.xls
devicediagnosticsfw/diagresultsdb/server/cenrep_files/make_cenrep.bat
devicediagnosticsfw/diagresultsdb/server/cenrep_files/output/inifiles/2000B45D.txt
devicediagnosticsfw/diagresultsdb/server/cenrep_files/output/key_sheets_info.storable
devicediagnosticsfw/diagresultsdb/server/cenrep_files/output/rfs/cenrep_rfs.txt
devicediagnosticsfw/diagresultsdb/server/conf/diagresultsdb.confml
devicediagnosticsfw/diagresultsdb/server/conf/diagresultsdb_2000B45d.crml
devicediagnosticsfw/diagresultsdb/server/group/bld.inf
devicediagnosticsfw/diagresultsdb/server/group/diagresultsdbserver.mmp
devicediagnosticsfw/diagresultsdb/server/group/diagresultsdbserver.xml
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbcrdc.h
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbserver.h
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbsession.h
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbstore.h
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbtestrecord.h
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbtestrecordhandle.h
devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbtestrecordsubsession.h
devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbserver.cpp
devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbsession.cpp
devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbstore.cpp
devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbtestrecord.cpp
devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbtestrecordhandle.cpp
devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbtestrecordsubsession.cpp
devicediagnosticsfw/group/bld.inf
devicediagnosticsfw/rom_files/diagframework.iby
devicediagnosticsfw/rom_files/diagpluginbase.iby
devicediagnosticsfw/rom_files/diagresultsdatabase.iby
devicediagnosticsfw/rom_files/diagresultsdatabaseserver.iby
devicemgmtnotifications/dmdevdialogclient/bld/bld.inf
devicemgmtnotifications/dmdevdialogclient/bld/dmdevdialogclient.mmp
devicemgmtnotifications/dmdevdialogclient/bwins/dmdevdialogclientu.def
devicemgmtnotifications/dmdevdialogclient/eabi/dmdevdialogclientu.def
devicemgmtnotifications/dmdevdialogclient/inc/dmdevdialogclientdebug.h
devicemgmtnotifications/dmdevdialogclient/src/dmdevdialogclient.cpp
devicemgmtnotifications/dmdevdialogserver/bld/bld.inf
devicemgmtnotifications/dmdevdialogserver/bld/dmdevicedialog.mmp
devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogdebug.h
devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogserver.h
devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogsession.h
devicemgmtnotifications/dmdevdialogserver/src/dmdevicedialogserver.cpp
devicemgmtnotifications/dmdevdialogserver/src/dmdevicedialogsession.cpp
devicemgmtnotifications/group/bld.inf
devicemgmtnotifications/inc/dmdevdialogclientserver.h
devicemgmtnotifications/rom/devicemgmtnotifications.iby
fotaapplication/FotaEngine/BWINS/fotaengineu.def
fotaapplication/FotaEngine/INC/fotaenginedebug.h
fotaapplication/FotaEngine/SRC/fotaengine.cpp
fotaapplication/FotaEngine/eabi/fotaengineu.def
fotaapplication/FotaEngine/group/fotaengine.mmp
fotaapplication/FotaScheduleHandler/group/fotaschedulehandler.mmp
fotaapplication/FotaScheduleHandler/inc/FotaSchedDebug.h
fotaapplication/FotaScheduleHandler/src/fotaschedulehandler.cpp
fotaapplication/cenrep/fotadiskstoragePrivateCRKeys.h
fotaapplication/cenrep/fotaserverPrivateCRKeys.h
fotaapplication/conf/CI_fotadiskstorage.confml
fotaapplication/conf/CI_fotaserver.confml
fotaapplication/conf/fotadiskstorage.confml
fotaapplication/conf/fotadiskstorage_102072C6.crml
fotaapplication/conf/fotaserver.confml
fotaapplication/conf/fotaserver_102072C4.crml
fotaapplication/fmsclient/bwins/fmsclientu.def
fotaapplication/fmsclient/eabi/fmsclientu.def
fotaapplication/fmsclient/group/bld.inf
fotaapplication/fmsclient/group/fmsclient.mmp
fotaapplication/fmsclient/inc/fmsclient.h
fotaapplication/fmsclient/inc/fmsclientdebug.h
fotaapplication/fmsclient/src/fmsclient.cpp
fotaapplication/fmserver/group/bld.inf
fotaapplication/fmserver/group/fmsserver.mmp
fotaapplication/fmserver/inc/fmsdebug.h
fotaapplication/fmserver/inc/fmsinterruptaob.h
fotaapplication/fmserver/inc/fmsserver.h
fotaapplication/fmserver/inc/fmsserversession.h
fotaapplication/fmserver/src/fmsinterruptaob.cpp
fotaapplication/fmserver/src/fmsserver.cpp
fotaapplication/fmserver/src/fmsserversession.cpp
fotaapplication/fotaapplication.pro
fotaapplication/fotacustcmds/bwins/fotacustcmdsu.def
fotaapplication/fotacustcmds/eabi/fotacustcmdsu.def
fotaapplication/fotacustcmds/group/bld.inf
fotaapplication/fotacustcmds/group/fotacustcmds.mmp
fotaapplication/fotacustcmds/inc/fotacustcmdallreasons.h
fotaapplication/fotacustcmds/inc/fotacustcmdfirmwareupdate.h
fotaapplication/fotacustcmds/inc/fotacustcmdfirstboot.h
fotaapplication/fotacustcmds/inc/fotacustcmdsfactory.h
fotaapplication/fotacustcmds/inc/fotastartupDebug.h
fotaapplication/fotacustcmds/src/fotacustcmdallreasons.cpp
fotaapplication/fotacustcmds/src/fotacustcmdfirmwareupdate.cpp
fotaapplication/fotacustcmds/src/fotacustcmdfirstboot.cpp
fotaapplication/fotacustcmds/src/fotacustcmdsfactory.cpp
fotaapplication/fotaserver/FotaEngine/BWINS/fotaengineu.def
fotaapplication/fotaserver/FotaEngine/INC/fotaenginedebug.h
fotaapplication/fotaserver/FotaEngine/SRC/fotaengine.cpp
fotaapplication/fotaserver/FotaEngine/SRC/fotaengstream.cpp
fotaapplication/fotaserver/FotaEngine/eabi/fotaengineu.def
fotaapplication/fotaserver/FotaEngine/group/fotaengine.mmp
fotaapplication/fotaserver/FotaRfsPlugin/group/RfsFotaPlugin.mmp
fotaapplication/fotaserver/FotaRfsPlugin/group/bld.inf
fotaapplication/fotaserver/FotaRfsPlugin/inc/RfsFotaPlugin.h
fotaapplication/fotaserver/FotaRfsPlugin/inc/fotadebug.h
fotaapplication/fotaserver/FotaRfsPlugin/src/10281873.rss
fotaapplication/fotaserver/FotaRfsPlugin/src/Proxy.cpp
fotaapplication/fotaserver/FotaRfsPlugin/src/RfsFotaPlugin.cpp
fotaapplication/fotaserver/FotaScheduleHandler/group/fotaschedulehandler.mmp
fotaapplication/fotaserver/FotaScheduleHandler/inc/FotaSchedDebug.h
fotaapplication/fotaserver/FotaScheduleHandler/src/fotaschedulehandler.cpp
fotaapplication/fotaserver/FotaServer/data/fotaserver.rss
fotaapplication/fotaserver/FotaServer/data/fotaserver_reg.rss
fotaapplication/fotaserver/FotaServer/group/fotaserver.mmp
fotaapplication/fotaserver/FotaServer/inc/DevEncController.h
fotaapplication/fotaserver/FotaServer/inc/DevEncProgressDlg.h
fotaapplication/fotaserver/FotaServer/inc/DevEncProgressObserver.h
fotaapplication/fotaserver/FotaServer/inc/FotaDB.h
fotaapplication/fotaserver/FotaServer/inc/FotaDLProgressDlg.h
fotaapplication/fotaserver/FotaServer/inc/FotaNetworkRegStatus.h
fotaapplication/fotaserver/FotaServer/inc/FotaReminderDlg.h
fotaapplication/fotaserver/FotaServer/inc/FotaServer.h
fotaapplication/fotaserver/FotaServer/inc/FotaSrvApp.h
fotaapplication/fotaserver/FotaServer/inc/FotaSrvDebug.h
fotaapplication/fotaserver/FotaServer/inc/FotaSrvDocument.h
fotaapplication/fotaserver/FotaServer/inc/FotaSrvUI.h
fotaapplication/fotaserver/FotaServer/inc/FotasrvSession.h
fotaapplication/fotaserver/FotaServer/inc/fotaUpdateAgentComms.h
fotaapplication/fotaserver/FotaServer/inc/fotadownload.h
fotaapplication/fotaserver/FotaServer/inc/fotaserverPrivatePSKeys.h
fotaapplication/fotaserver/FotaServer/inc/fotaserver_service.rh
fotaapplication/fotaserver/FotaServer/inc/fotaupdate.h
fotaapplication/fotaserver/FotaServer/loc/fotaserver.loc
fotaapplication/fotaserver/FotaServer/src/DevEncController.cpp
fotaapplication/fotaserver/FotaServer/src/DevEncProgressDlg.cpp
fotaapplication/fotaserver/FotaServer/src/DevEncProgressObserver.cpp
fotaapplication/fotaserver/FotaServer/src/FotaDB.cpp
fotaapplication/fotaserver/FotaServer/src/FotaDLProgressDlg.cpp
fotaapplication/fotaserver/FotaServer/src/FotaNetworkRegStatus.cpp
fotaapplication/fotaserver/FotaServer/src/FotaReminderDlg.cpp
fotaapplication/fotaserver/FotaServer/src/FotaServer.cpp
fotaapplication/fotaserver/FotaServer/src/FotaSrvApp.cpp
fotaapplication/fotaserver/FotaServer/src/FotaSrvDocument.cpp
fotaapplication/fotaserver/FotaServer/src/FotaSrvUi.cpp
fotaapplication/fotaserver/FotaServer/src/fotaSrvSession.cpp
fotaapplication/fotaserver/FotaServer/src/fotadownload.cpp
fotaapplication/fotaserver/FotaServer/src/fotaupdate.cpp
fotaapplication/fotaserver/FotaStorage/BWINS/fotadiskstorageu.def
fotaapplication/fotaserver/FotaStorage/data/102072C6.rss
fotaapplication/fotaserver/FotaStorage/group/fotadiskstorage.mmp
fotaapplication/fotaserver/FotaStorage/group/fotastorage.mmp
fotaapplication/fotaserver/FotaStorage/inc/fotaDiskStorage.h
fotaapplication/fotaserver/FotaStorage/inc/fotadebug.h
fotaapplication/fotaserver/FotaStorage/src/fotaDiskStorage.cpp
fotaapplication/fotaserver/FotaStorage/src/fotastorage.cpp
fotaapplication/fotaserver/cenrep/fotadiskstoragePrivateCRKeys.h
fotaapplication/fotaserver/cenrep/fotaserverPrivateCRKeys.h
fotaapplication/fotaserver/cenrep/keys_fotadiskstorage.xls
fotaapplication/fotaserver/cenrep/keys_fotaserver.xls
fotaapplication/fotaserver/conf/fotadiskstorage.confml
fotaapplication/fotaserver/conf/fotadiskstorage_102072C6.crml
fotaapplication/fotaserver/conf/fotaserver.confml
fotaapplication/fotaserver/conf/fotaserver_102072C4.crml
fotaapplication/fotaserver/data/fullscreendialog.docml
fotaapplication/fotaserver/fmsclient/bwins/fmsclientu.def
fotaapplication/fotaserver/fmsclient/eabi/fmsclientu.def
fotaapplication/fotaserver/fmsclient/group/bld.inf
fotaapplication/fotaserver/fmsclient/group/fmsclient.mmp
fotaapplication/fotaserver/fmsclient/inc/fmsclient.h
fotaapplication/fotaserver/fmsclient/inc/fmsclientdebug.h
fotaapplication/fotaserver/fmsclient/src/fmsclient.cpp
fotaapplication/fotaserver/fmserver/group/bld.inf
fotaapplication/fotaserver/fmserver/group/fmsserver.mmp
fotaapplication/fotaserver/fmserver/inc/fmsdebug.h
fotaapplication/fotaserver/fmserver/inc/fmsinterruptaob.h
fotaapplication/fotaserver/fmserver/inc/fmsserver.h
fotaapplication/fotaserver/fmserver/inc/fmsserversession.h
fotaapplication/fotaserver/fmserver/src/fmsinterruptaob.cpp
fotaapplication/fotaserver/fmserver/src/fmsserver.cpp
fotaapplication/fotaserver/fmserver/src/fmsserversession.cpp
fotaapplication/fotaserver/fotacustcmds/bwins/fotacustcmdsu.def
fotaapplication/fotaserver/fotacustcmds/eabi/fotacustcmdsu.def
fotaapplication/fotaserver/fotacustcmds/group/bld.inf
fotaapplication/fotaserver/fotacustcmds/group/fotacustcmds.mmp
fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdallreasons.h
fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdfirmwareupdate.h
fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdfirstboot.h
fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdsfactory.h
fotaapplication/fotaserver/fotacustcmds/inc/fotastartupDebug.h
fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdallreasons.cpp
fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdfirmwareupdate.cpp
fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdfirstboot.cpp
fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdsfactory.cpp
fotaapplication/fotaserver/fotaserver.pro
fotaapplication/fotaserver/fotaservernotifier.qrc
fotaapplication/fotaserver/group/bld.inf
fotaapplication/fotaserver/group/fota_icons_aif_scalable_dc.mk
fotaapplication/fotaserver/group/fota_icons_dc.mk
fotaapplication/fotaserver/inc/FotaDB.h
fotaapplication/fotaserver/inc/FotaDlClient.h
fotaapplication/fotaserver/inc/FotaDlMgrClient.h
fotaapplication/fotaserver/inc/FotaIPCTypes.cpp
fotaapplication/fotaserver/inc/FotaIPCTypes.h
fotaapplication/fotaserver/inc/FotaNetworkRegStatus.h
fotaapplication/fotaserver/inc/FotaServer.h
fotaapplication/fotaserver/inc/FotaSrvDebug.h
fotaapplication/fotaserver/inc/FotasrvSession.h
fotaapplication/fotaserver/inc/fmsclientserver.h
fotaapplication/fotaserver/inc/fotaUpdateAgentComms.h
fotaapplication/fotaserver/inc/fotadevicedialogobserver.h
fotaapplication/fotaserver/inc/fotafullscreendialog.h
fotaapplication/fotaserver/inc/fotanotifiers.h
fotaapplication/fotaserver/inc/fotaserverPrivatePSKeys.h
fotaapplication/fotaserver/inc/fotaupdate.h
fotaapplication/fotaserver/inc/fsview.h
fotaapplication/fotaserver/rom/fotaserver.iby
fotaapplication/fotaserver/rom/fotaserverresources.iby
fotaapplication/fotaserver/src/FotaDB.cpp
fotaapplication/fotaserver/src/FotaDlClient.cpp
fotaapplication/fotaserver/src/FotaDlMgrClient.cpp
fotaapplication/fotaserver/src/FotaNetworkRegStatus.cpp
fotaapplication/fotaserver/src/FotaServer.cpp
fotaapplication/fotaserver/src/fotaSrvSession.cpp
fotaapplication/fotaserver/src/fotafullscreendialog.cpp
fotaapplication/fotaserver/src/fotanotifiers.cpp
fotaapplication/fotaserver/src/fotaupdate.cpp
fotaapplication/fotaserver/src/fsview.cpp
fotaapplication/fotaserver/src/main.cpp
fotaapplication/group/bld.inf
fotaapplication/inc/FotaIPCTypes.cpp
fotaapplication/inc/FotaIPCTypes.h
fotaapplication/inc/fmsclientserver.h
fotaapplication/rom/fotaserver.iby
fotaapplication/rom/fotaserverresources.iby
group/bld.inf
layers.sysdef.xml
omaprovisioning/pnputil/src/PnpProvUtil.cpp
omaprovisioning/pnputil/src/PnpUtilImpl.cpp
omaprovisioning/pnputil/tsrc/ModuleTest/group/TestPnpUtil.mmp
omaprovisioning/provisioning/AuthTypePlugin/Group/Authtypeplugin.mmp
omaprovisioning/provisioning/Group/bld.inf
omaprovisioning/provisioning/IMAdapter/Group/IMAdapter.mmp
omaprovisioning/provisioning/IMAdapter/Inc/CWPIMAdapter.h
omaprovisioning/provisioning/IMAdapter/Inc/CWPPecAdapter.h
omaprovisioning/provisioning/IMAdapter/Inc/WPIMUtil.h
omaprovisioning/provisioning/IMAdapter/Src/CWPIMAdapter.cpp
omaprovisioning/provisioning/IMAdapter/Src/CWPPecAdapter.cpp
omaprovisioning/provisioning/IMAdapter/Src/WPIMUtil.cpp
omaprovisioning/provisioning/MbxNbrAdapter/Data/10207281.rss
omaprovisioning/provisioning/MbxNbrAdapter/Data/WPMbxNbrAdapterResource.rss
omaprovisioning/provisioning/MbxNbrAdapter/Group/MbxNbrAdapter.mmp
omaprovisioning/provisioning/MbxNbrAdapter/Inc/MbxNbrAdapter.h
omaprovisioning/provisioning/MbxNbrAdapter/Src/MbxNbrAdapter.cpp
omaprovisioning/provisioning/MbxNbrAdapter/Src/MbxNbrAdapterGroupProxy.cpp
omaprovisioning/provisioning/MbxNbrAdapter/loc/MailboxAdapter.loc
omaprovisioning/provisioning/ProvisioningBC/BWINS/ProvisioningBCu.def
omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif.mk
omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif.rss
omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif_dc.mk
omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.lnt
omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.mmp
omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.rss
omaprovisioning/provisioning/ProvisioningBC/Inc/CWPBioControl.h
omaprovisioning/provisioning/ProvisioningBC/Inc/CWPCodeQueryDialog.h
omaprovisioning/provisioning/ProvisioningBC/Inc/CWPNameValue.h
omaprovisioning/provisioning/ProvisioningBC/Inc/CWPSaver.h
omaprovisioning/provisioning/ProvisioningBC/Inc/CWPStringPair.h
omaprovisioning/provisioning/ProvisioningBC/Src/CWPBioControl.cpp
omaprovisioning/provisioning/ProvisioningBC/Src/CWPCodeQueryDialog.cpp
omaprovisioning/provisioning/ProvisioningBC/Src/CWPNameValue.cpp
omaprovisioning/provisioning/ProvisioningBC/Src/CWPSaver.cpp
omaprovisioning/provisioning/ProvisioningBC/Src/CWPStringPair.cpp
omaprovisioning/provisioning/ProvisioningBC/eabi/ProvisioningBCu.def
omaprovisioning/provisioning/ProvisioningBC/loc/ProvisioningBC.loc
omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxApp.h
omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxAppUi.h
omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxContainer.h
omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxDeleter.h
omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxDocument.h
omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxView.h
omaprovisioning/provisioning/ProvisioningCx/Inc/ProvisioningCx.hrh
omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx.rss
omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx_Caption.rss
omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx_reg.rss
omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxApp.cpp
omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxAppUi.cpp
omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxContainer.cpp
omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxDeleter.cpp
omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxDocument.cpp
omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxView.cpp
omaprovisioning/provisioning/ProvisioningCx/aif/ProvisioningCxaif.rss
omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_bitmaps.mk
omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_scalable.mk
omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_scalable_dc.mk
omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifbitmaps.mk
omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifbitmapsdc.mk
omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifscalable.mk
omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifscalabledc.mk
omaprovisioning/provisioning/ProvisioningCx/group/ProvisioningCx.lnt
omaprovisioning/provisioning/ProvisioningCx/group/ProvisioningCx.mmp
omaprovisioning/provisioning/ProvisioningCx/group/icons.mk
omaprovisioning/provisioning/ProvisioningCx/group/iconscxdc.mk
omaprovisioning/provisioning/ProvisioningCx/loc/ProvisioningCx.loc
omaprovisioning/provisioning/ProvisioningEngine/Group/ProvisioningEngine.mmp
omaprovisioning/provisioning/ProvisioningEngine/Src/CWPAdapterManager.cpp
omaprovisioning/provisioning/ProvisioningEngine/Src/CWPInternetAPDB.cpp
omaprovisioning/provisioning/ProvisioningEngine/Src/CWPMultiContextManager.cpp
omaprovisioning/provisioning/ProvisioningEngine/Src/WPAdapterUtil.cpp
omaprovisioning/provisioning/ProvisioningHandler/Group/ProvisioningHandler.mmp
omaprovisioning/provisioning/ProvisioningHandler/Src/CWPMessage.cpp
omaprovisioning/provisioning/ProvisioningParser/Src/CWPWbxmlParser.cpp
omaprovisioning/provisioning/ProvisioningParser/Src/OMAProvisioningDictionary.c
omaprovisioning/provisioning/ProvisioningSC/Src/CWPSimHandler.cpp
omaprovisioning/provisioning/ProvisioningSC/Src/CWPWimHandler.cpp
omaprovisioning/provisioning/Rom/Provisioning.iby
omaprovisioning/provisioning/Rom/ProvisioningResources.iby
omaprovisioning/provisioning/StreamingAdapter/Data/101F85CB.rss
omaprovisioning/provisioning/StreamingAdapter/Data/WPStreamingAdapterResource.rss
omaprovisioning/provisioning/StreamingAdapter/Group/StreamingAdapter.mmp
omaprovisioning/provisioning/StreamingAdapter/Inc/StreamingAdapter.h
omaprovisioning/provisioning/StreamingAdapter/Src/Streamingadapter.cpp
omaprovisioning/provisioning/StreamingAdapter/Src/StreamingadapterGroupProxy.cpp
omaprovisioning/provisioning/StreamingAdapter/loc/StreamingAdapter.loc
omaprovisioning/provisioning/WAPAdapter/Data/101F84DC.rss
omaprovisioning/provisioning/WAPAdapter/Data/WPWAPAdapterResource.rss
omaprovisioning/provisioning/WAPAdapter/Group/WPWAPAdapter.mmp
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPAdapterBase.h
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBookmarkItem.h
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBrowserAdapter.h
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBrowserItem.h
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPItemBAse.h
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPMMSAdapter.h
omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPMMSItem.h
omaprovisioning/provisioning/WAPAdapter/Inc/MWPWAPItemBase.h
omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPDebug.h
omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPItemFactory.h
omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPUtil.h
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPAdapterBase.cpp
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBookmarkItem.cpp
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBrowserAdapter.cpp
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBrowserItem.cpp
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPItemBAse.cpp
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPMMSAdapter.cpp
omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPMMSItem.cpp
omaprovisioning/provisioning/WAPAdapter/Src/WPWAPAdapterGroupProxy.cpp
omaprovisioning/provisioning/WAPAdapter/Src/WPWAPAdapterMain.cpp
omaprovisioning/provisioning/WAPAdapter/Src/WPWAPItemFactory.cpp
omaprovisioning/provisioning/WAPAdapter/Src/WPWAPUtil.cpp
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAccesspointItem.h
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAdapter.h
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPItemBase.h
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPLogicalProxy.h
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPNapdef.h
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPPhysicalProxy.h
omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPPort.h
omaprovisioning/provisioning/accesspointadapter/Inc/ProvisioningDebug.h
omaprovisioning/provisioning/accesspointadapter/Inc/WPAPAdapter.pan
omaprovisioning/provisioning/accesspointadapter/Inc/WPAPDefs.h
omaprovisioning/provisioning/accesspointadapter/Inc/WPAPSharedDataKeys.h
omaprovisioning/provisioning/accesspointadapter/Inc/WPAPUtil.h
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPAccesspointItem.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPAdapter.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPItemBase.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPLogicalProxy.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPNapdef.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPPhysicalProxy.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPAPPort.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPLog.cpp
omaprovisioning/provisioning/accesspointadapter/Src/CWPLog.h
omaprovisioning/provisioning/accesspointadapter/Src/CWPLogDef.h
omaprovisioning/provisioning/accesspointadapter/Src/WPAPAdapterGroupProxy.cpp
omaprovisioning/provisioning/accesspointadapter/Src/WPAPAdapterPanics.cpp
omaprovisioning/provisioning/accesspointadapter/Src/WPAPUtil.cpp
omaprovisioning/provisioning/accesspointadapter/group/101F84D8.rss
omaprovisioning/provisioning/accesspointadapter/group/WPAPAdapter.mmp
omaprovisioning/provisioning/accesspointadapter/group/WPAPAdapterResource.rss
omaprovisioning/provisioning/accesspointadapter/group/bld.inf
omaprovisioning/provisioning/accesspointadapter/loc/WPAPAdapter.loc
omaprovisioning/provisioning/accesspointadapter/rom/WPAPAdapter.iby
omaprovisioning/provisioning/accesspointadapter/rom/WPAPAdapterResources.iby
omaprovisioning/provisioning/alwaysonadapter/Group/alwaysonadapter.mmp
omaprovisioning/provisioning/conf/CI_s60provisioning.confml
omaprovisioning/provisioning/cpdestinationnwadapter/group/wpdestinationnwadapter.mmp
omaprovisioning/provisioning/help/inc/prov.hlp.hrh
omaprovisioning/provisioning/tsrc/ModuleTest/group/moduletestprovisioning.mmp
policymanagement/dmutilserver/group/DMUtilServer.mmp
policymanagement/dmutilserver/src/DMUtilObserver.cpp
policymanagement/dmutilserver/src/DMUtilSession.cpp
policymanagement/group/bld.inf
policymanagement/policyengine/centreptoolserver/src/RepositorySession.cpp
policymanagement/policyengine/group/PMRfsPlugin.mmp
policymanagement/policyengine/group/PolicyEngineServer.mmp
policymanagement/policyengine/group/PolicyEngineUI.mmp
policymanagement/policyengine/group/bld.inf
policymanagement/policyengine/policyengine.pro
policymanagement/policyengine/policyengineclient/src/Contexts.cpp
policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h
policymanagement/policyengine/policyengineserver/src/OperationParser.cpp
policymanagement/policyengine/policyengineserver/src/PolicyEngineServer.cpp
policymanagement/policyengine/policyengineserver/src/PolicyParser.cpp
policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp
policymanagement/policyengine/policyengineserver/src/SettingEnforcementManager.cpp
policymanagement/policyengine/policyengineui/InputDialog.docml
policymanagement/policyengine/policyengineui/PolicyEngineUI.pro
policymanagement/policyengine/policyengineui/PolicyEngineUI.qrc
policymanagement/policyengine/policyengineui/data/10207817.rss
policymanagement/policyengine/policyengineui/data/PolicyEngineUI.rss
policymanagement/policyengine/policyengineui/dialog.docml
policymanagement/policyengine/policyengineui/inc/Logger.h
policymanagement/policyengine/policyengineui/inc/PolicyEngUINotifierplugin.h
policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h
policymanagement/policyengine/policyengineui/inc/policyengineui.hrh
policymanagement/policyengine/policyengineui/loc/PolicyEngineUI.loc
policymanagement/policyengine/policyengineui/src/PolicyEngNotifierplugin.cpp
policymanagement/policyengine/policyengineui/src/PolicyEngineUi.cpp
policymanagement/policyengine/rom/policyengine.iby
policymanagement/policymanagement.pro
remotemgmt.pro
remotemgmt_plat/common_agent_util_and_definitions_api/inc/nsmlconstants.h
remotemgmt_plat/common_agent_util_and_definitions_api/tsrc/group/TestSyncAgent.mmp
remotemgmt_plat/data_synchronization_notification_api/inc/DataSyncInternalPSKeys.h
remotemgmt_plat/data_synchronization_plugin_api/tsrc/group/TestStoreFormat.mmp
remotemgmt_plat/dcmo_adapter_api/inc/DcmoConst.h
remotemgmt_plat/dcmo_control_api/group/bld.inf
remotemgmt_plat/dcmo_control_api/inc/lawmoclient.h
remotemgmt_plat/device_management_parameter_api/group/bld.inf
remotemgmt_plat/device_management_parameter_api/inc/DevManInternalCRKeys.h
remotemgmt_plat/device_management_parameter_api/inc/lawmoadaptercrkeys.h
remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf
remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h
remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogsymbian.h
remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h
remotemgmt_plat/diagnostics_framework_api/diagnostics_framework_api.metaxml
remotemgmt_plat/diagnostics_framework_api/group/bld.inf
remotemgmt_plat/diagnostics_framework_api/inc/diagappcommand.h
remotemgmt_plat/diagnostics_framework_api/inc/diagengine.h
remotemgmt_plat/diagnostics_framework_api/inc/diagenginecommon.h
remotemgmt_plat/diagnostics_framework_api/inc/diagengineobserver.h
remotemgmt_plat/diagnostics_framework_api/inc/diagenginewatchdogtypes.h
remotemgmt_plat/diagnostics_framework_api/inc/diagexecplanentry.h
remotemgmt_plat/diagnostics_framework_api/inc/diagframeworkdebug.h
remotemgmt_plat/diagnostics_framework_api/inc/diagpluginexecplan.h
remotemgmt_plat/diagnostics_plugin_api/diagnostics_plugin_api.metaxml
remotemgmt_plat/diagnostics_plugin_api/group/bld.inf
remotemgmt_plat/diagnostics_plugin_api/inc/diagplugin.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagpluginconstructionparam.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagsuiteexecparam.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagsuiteobserver.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagsuiteplugin.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagsuitepluginbase.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagtestexecparam.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagtestobserver.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagtestplugin.h
remotemgmt_plat/diagnostics_plugin_api/inc/diagtestpluginbase.h
remotemgmt_plat/diagnostics_plugin_pool_api/diagnostics_plugin_pool_api.metaxml
remotemgmt_plat/diagnostics_plugin_pool_api/group/bld.inf
remotemgmt_plat/diagnostics_plugin_pool_api/inc/diagpluginpool.h
remotemgmt_plat/diagnostics_plugin_pool_api/inc/diagpluginpoolobserver.h
remotemgmt_plat/diagnostics_plugin_utility_api/diagnostics_plugin_utility_api.metaxml
remotemgmt_plat/diagnostics_plugin_utility_api/group/bld.inf
remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagcommondialog.h
remotemgmt_plat/diagnostics_plugin_utility_api/inc/diaglogeventeraser.h
remotemgmt_plat/diagnostics_plugin_utility_api/inc/diaglogeventeraserobserver.h
remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagnetworkregstatusobserver.h
remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagnetworkregstatuswatcher.h
remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagpluginwaitingdialogwrapper.h
remotemgmt_plat/diagnostics_results_api/diagnostics_results_api.metaxml
remotemgmt_plat/diagnostics_results_api/group/bld.inf
remotemgmt_plat/diagnostics_results_api/inc/diagresultdetail.h
remotemgmt_plat/diagnostics_results_api/inc/diagresultdetailbasic.h
remotemgmt_plat/diagnostics_results_api/inc/diagresultsdatabase.h
remotemgmt_plat/diagnostics_results_api/inc/diagresultsdatabaseitem.h
remotemgmt_plat/diagnostics_results_api/inc/diagresultsdatabasetestrecordinfo.h
remotemgmt_plat/diagnostics_results_api/inc/diagresultsdbitembuilder.h
remotemgmt_plat/diagnostics_results_api/inc/diagresultsdbrecordengineparam.h
remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconst.h
remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconstants.h
remotemgmt_plat/dm_device_dialog_api/dm_device_dialog_api.metaxml
remotemgmt_plat/dm_device_dialog_api/group/bld.inf
remotemgmt_plat/dm_device_dialog_api/inc/dmdevdialogclient.h
remotemgmt_plat/dm_device_dialog_api/tsrc/conf/dmdevicedialogstest.cfg
remotemgmt_plat/dm_device_dialog_api/tsrc/group/bld.inf
remotemgmt_plat/dm_device_dialog_api/tsrc/group/dmdevicedialogstest.mmp
remotemgmt_plat/dm_device_dialog_api/tsrc/group/dmdevicedialogstest.pkg
remotemgmt_plat/dm_device_dialog_api/tsrc/inc/dmdevicedialogstest.h
remotemgmt_plat/dm_device_dialog_api/tsrc/init/dmdevicedialogs.ini
remotemgmt_plat/dm_device_dialog_api/tsrc/src/dmdevicedialogstest.cpp
remotemgmt_plat/dm_device_dialog_api/tsrc/src/dmdevicedialogstestBlocks.cpp
remotemgmt_plat/dm_native_notifier_api/group/bld.inf
remotemgmt_plat/dm_native_notifier_api/inc/DMNativeNotifier.h
remotemgmt_plat/dm_native_notifier_api/inc/DMNativeNotifier.inl
remotemgmt_plat/dm_native_notifier_api/inc/DMNativeNotifierInterface.h
remotemgmt_plat/ds_constant_definitions_api/inc/nsmldsconstants.h
remotemgmt_plat/fota_engine_api/group/bld.inf
remotemgmt_plat/fota_engine_api/inc/FotaEngStream.h
remotemgmt_plat/fota_engine_api/inc/FotaEngine.h
remotemgmt_plat/fota_engine_api/inc/fotaconst.h
remotemgmt_plat/fota_engine_api/tsrc/group/fota_engine_api.mmp
remotemgmt_plat/group/bld.inf
remotemgmt_plat/lawmo_plugin_api/group/bld.inf
remotemgmt_plat/lawmo_plugin_api/inc/lawmocallbackinterface.h
remotemgmt_plat/lawmo_plugin_api/inc/lawmointerface.h
remotemgmt_plat/lawmo_plugin_api/inc/lawmointerface.inl
remotemgmt_plat/oma_ds_extensions_api/tsrc/group/ClientAPIAdvanced.mmp
remotemgmt_plat/oma_provisioning_engine_api/group/bld.inf
remotemgmt_plat/oma_provisioning_engine_api/inc/CWPBootstrap.h
remotemgmt_plat/oma_provisioning_engine_api/inc/CWPPushMessage.h
remotemgmt_plat/oma_provisioning_engine_api/inc/MWPContextManager.h
remotemgmt_plat/oma_provisioning_engine_api/inc/MWPPhone.h
remotemgmt_plat/oma_provisioning_engine_api/inc/ProvisioningInternalCRKeys.h
remotemgmt_plat/oma_provisioning_engine_api/inc/WPPhoneFactory.h
remotemgmt_plat/oma_provisioning_engine_api/tsrc/group/testengineapis.mmp
remotemgmt_plat/pnpms_utils_api/tsrc/group/TestPnpUtil.mmp
remotemgmt_plat/policy_management_certificate_api/tsrc/group/dmcertapi.mmp
remotemgmt_plat/policy_management_certificate_api/tsrc/group/dmcertapiexe.mmp
remotemgmt_plat/policy_management_request_api/tsrc/group/TempClient.mmp
remotemgmt_plat/policy_management_request_api/tsrc/group/TempServer.mmp
remotemgmt_plat/policy_management_request_api/tsrc/group/TrustClient.mmp
remotemgmt_plat/policy_management_request_api/tsrc/group/TrustServer.mmp
remotemgmt_plat/policy_management_request_api/tsrc/group/policy_management_request_api.mmp
remotemgmt_plat/policy_management_request_api/tsrc/group/request_cntxt_api.mmp
remotemgmt_plat/scp_server_api/inc/SCPClient.h
remotemgmt_plat/scp_server_api/inc/SCPParamObject.h
remotemgmt_plat/scp_server_api/inc/SCPServerInterface.h
remotemgmt_plat/scp_server_api/tsrc/group/scp_autolock_exe.mmp
remotemgmt_plat/scp_server_api/tsrc/group/scp_server_api.mmp
remotemgmt_plat/scp_server_api/tsrc/group/scp_terminal_security_exe.mmp
remotemgmt_plat/scp_server_api/tsrc/group/testCSCPParamObject.mmp
remotemgmt_plat/setting_enforcement_info_api/tsrc/group/TestSettingEnforcementInfo.mmp
remotemgmt_plat/sync_service_api/group/bld.inf
remotemgmt_plat/sync_service_api/inc/SyncService.h
remotemgmt_plat/sync_service_api/inc/SyncService.rh
remotemgmt_plat/sync_service_api/inc/SyncServiceConst.h
remotemgmt_plat/sync_service_api/inc/SyncServiceParams.h
remotemgmt_plat/sync_service_api/inc/SyncServiceSession.h
remotemgmt_plat/sync_service_api/sync_service_api.metaxml
remotemgmt_plat/syncml_client_api/inc/SyncMLErr.h
remotemgmt_plat/syncml_client_api/tsrc/group/ClientAPI.mmp
remotemgmt_plat/syncml_client_api/tsrc/group/TestHistoryLog.mmp
remotemgmt_plat/syncml_ds_customization_api/group/bld.inf
remotemgmt_plat/syncml_ds_customization_api/inc/NSmlOperatorDataCRKeys.h
remotemgmt_plat/syncml_ds_customization_api/inc/nsmldevinfextdatacontainerplugin.h
remotemgmt_plat/syncml_ds_customization_api/inc/nsmldevinfextdatacontainerplugin.inl
remotemgmt_plat/syncml_ds_customization_api/syncml_ds_customization_api.metaxml
remotemgmt_plat/syncml_ds_customization_api/syncml_fw_customization_api.metaxml
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/SyncFwCustomizerSettingItemList.uidesign
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/application.uidesign
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/customlistview.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/customlistview.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer.l01
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer.loc
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer.rss
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizerSettingItemList.l01
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizerSettingItemList.loc
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizerSettingItemList.rssi
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer_reg.loc
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer_reg.rss
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/list_icon.bmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/list_icon_mask.bmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/mark_icon.bmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/mark_icon_mask.bmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/qgn_menu_SyncFwCustomizer.svg
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/group/Icons_aif_scalable_dc.mk
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/group/SyncFwCustomizer.mmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/group/bld.inf
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizer.hrh
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizer.pan
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerAppUi.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerApplication.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerDocument.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemList.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemList.hrh
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemListSettings.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemListView.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/main.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/sis/SyncFwCustomizer.pkg
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/sis/backup_registration.xml
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerAppUi.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerApplication.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerDocument.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerSettingItemList.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerSettingItemListSettings.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerSettingItemListView.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/syncfwcustomizer.iby
remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/syncfwcustomizer.pro
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/UT_devinfextmgmtinterface.mmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/bld.inf
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/def/bwinscwdevinfextmgmtif_testu.def
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/def/eabidevinfextmgmtif_testu.def
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/devinfextmgmtif_test.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/devinfextmgmtif_test.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/dllmain.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/data/exampledevinfextdatacontainerplugin.rss
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/bld.inf
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/def/bwinscwexampledevinfextdatacontainerpluginu.def
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/def/eabiexampledevinfextdatacontainerpluginu.def
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/exampledevinfextdatacontainerplugin.mmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/inc/exampledevinfextdatacontainerplugin.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/src/exampledevinfextdatacontainerplugin.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/src/exampledevinfextdatacontainerplugindllmain.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/bld.inf
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/def/bwinscwdsoperatorsettings_testu.def
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/def/eabidsoperatorsettings_testu.def
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/dllmain.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/nsmldsoperatorsettings_test.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/nsmldsoperatorsettings_test.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/readme.txt
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/testdata/2001E2E1.txt
remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/ut_nsmldsoperatorsettings.mmp
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidator.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidator.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorengine_p.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorengine_p.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorenginewrapper.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorenginewrapper.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchdeviceinfo.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchdeviceinfo.h
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/main.cpp
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/synchconfigvalidator.iby
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/synchconfigvalidator.pro
remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/synchconfigvalidator.ui
remotemgmt_plat/syncml_ds_error_reporting_api/group/bld.inf
remotemgmt_plat/syncml_ds_error_reporting_api/inc/NSmlOperatorErrorCRKeys.h
remotemgmt_plat/syncml_ds_error_reporting_api/syncml_ds_error_reporting_api.metaxml
remotemgmt_plat/syncml_ds_error_reporting_api/syncml_fw_error_reporting_api.metaxml
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/QtSyncStatusSpy.pro
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/main.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslog.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslog.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslogview.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslogview.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusmodel.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusmodel.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusspy.iby
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusview.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusview.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/SyncStatusSpySettingItemList.uidesign
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/application.uidesign
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy.l01
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy.loc
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy.rss
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpySettingItemList.l01
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpySettingItemList.loc
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpySettingItemList.rssi
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy_reg.loc
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy_reg.rss
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/list_icon.bmp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/list_icon_mask.bmp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/mark_icon.bmp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/mark_icon_mask.bmp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/qgn_menu_SyncStatusSpy.svg
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/Icons_aif_scalable_dc.mk
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/SyncStatusSpy.mmp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/bld.inf
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/cenreputils.d
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/syncstatusspyappui.d
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/syncstatusspysettingitemlist.d
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/CenrepUtils.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/ErrorCodeNotifier.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/ProfileIdNotifier.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncInitiationNotifier.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpy.pan
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpyAppUi.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpyApplication.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpyDocument.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpySettingItemList.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpySettingItemList.hrh
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpySettingItemListSettings.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncTypeNotifier.h
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/sis/SyncStatusSpy.pkg
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/sis/backup_registration.xml
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/CenrepUtils.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/ErrorCodeNotifier.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/ProfileIdNotifier.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncInitiationNotifier.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpyAppUi.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpyApplication.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpyDocument.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpySettingItemList.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpySettingItemListSettings.cpp
remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncTypeNotifier.cpp
remotemgmt_plat/syncml_notifier_api/group/bld.inf
remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifier.h
remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifierParams.h
remotemgmt_plat/syncml_notifier_api/syncml_notifier_api.metaxml
remotemgmt_plat/syncml_notifier_roaming_api/group/bld.inf
remotemgmt_plat/syncml_notifier_roaming_api/inc/SyncMLNotifierDomainCRKeys.h
remotemgmt_plat/syncml_notifier_roaming_api/syncml_notifier_roaming_api.metaxml
remotemgmt_plat/terminal_security_device_lock_api/inc/TerminalControl3rdPartyAPI.h
remotemgmt_plat/terminal_security_device_lock_api/inc/dmencryptionutil.inl
remotemgmt_plat/terminal_security_device_lock_api/tsrc/group/TestTerminalControl.mmp
syncmlfw/common/alertqueue/bld/NSmlAlertQueue.mmp
syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp
syncmlfw/common/alertqueue/src/NSmlDSAlertParser11.cpp
syncmlfw/common/alertqueue/src/NSmlDSAlertParser12.cpp
syncmlfw/common/http/bld/nsmlhttp.mmp
syncmlfw/common/http/inc/nsmldialiap.h
syncmlfw/common/http/inc/nsmlhttp.h
syncmlfw/common/http/inc/nsmlhttpclient.h
syncmlfw/common/http/src/nsmldialiap.cpp
syncmlfw/common/http/src/nsmlhttp.cpp
syncmlfw/common/http/src/nsmlhttpclient.cpp
syncmlfw/common/inc/nsmloperatordefines.h
syncmlfw/common/obex/obexclient/bld/nsmlobexclient.mmp
syncmlfw/common/obex/obexclient/inc/Btobexsearcher.h
syncmlfw/common/obex/obexclient/inc/Irdaobexsearcher.h
syncmlfw/common/obex/obexclient/inc/NSmlBTServiceSearcher.h
syncmlfw/common/obex/obexclient/src/Btobexsearcher.cpp
syncmlfw/common/obex/obexclient/src/Irdaobexsearcher.cpp
syncmlfw/common/obex/obexclient/src/NSmlBTServiceSearcher.cpp
syncmlfw/common/obex/obexclient/src/NSmlObexClient.cpp
syncmlfw/common/sosserver/bld/nsmlsosserver.mmp
syncmlfw/common/sosserver/inc/PnpLogger.h
syncmlfw/common/sosserver/inc/nsmlsosthread.h
syncmlfw/common/sosserver/src/NSmlSOSBackup.cpp
syncmlfw/common/sosserver/src/NSmlTask.cpp
syncmlfw/common/sosserver/src/nsmlsoshandler.cpp
syncmlfw/common/sosserver/src/nsmlsossession.cpp
syncmlfw/common/sosserver/src/nsmlsosthread.cpp
syncmlfw/common/sosserver_clientapi/bld/NSmlClientAPI.mmp
syncmlfw/common/sosserver_clientapi/src/NSmlClientAPIActiveCallback.cpp
syncmlfw/common/sosserver_clientapi/src/NSmlClientContactSuiteAPIActiveCallback.cpp
syncmlfw/common/sosserver_transporthandler/src/NSmlTransportHandler.cpp
syncmlfw/common/syncagent/bld/DEF/bwinscwu.def
syncmlfw/common/syncagent/bld/DEF/eabiu.def
syncmlfw/common/syncagent/bld/NSmlAgentCommon.mmp
syncmlfw/common/syncagent/inc/NSmlAgentBase.h
syncmlfw/common/syncagent/inc/NSmlStatusContainer.h
syncmlfw/common/syncagent/src/NSmlAgentBase.cpp
syncmlfw/common/syncagent/src/nsmlstatuscontainer.cpp
syncmlfw/common/transport/bld/nsmltransport.mmp
syncmlfw/common/transport/src/nsmltransport.cpp
syncmlfw/common/wbxml/bld/nsmlwbxml.mmp
syncmlfw/common/wbxml/src/syncml/smldtd.cpp
syncmlfw/common/xml/bld/nsmlxml.mmp
syncmlfw/conf/CI_devman.confml
syncmlfw/conf/datasync.confml
syncmlfw/conf/datasync_2000CF7E.crml
syncmlfw/conf/devman.confml
syncmlfw/conf/devman_101F9A0A.crml
syncmlfw/conf/nsmloperatorsettings.confml
syncmlfw/conf/nsmloperatorsettings_2002682E.crml
syncmlfw/conf/operatordatasync.confml
syncmlfw/conf/operatordatasync_2001E2E1.crml
syncmlfw/conf/operatordatasyncerror.confml
syncmlfw/conf/operatordatasyncerror_2001FDF1.crml
syncmlfw/dm/adapters/inc/nsmldmimpluids.h
syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp
syncmlfw/dm/provisioningadapter/bld/NSmlDmProvisioningAdapter.mmp
syncmlfw/dm/provisioningadapter/inc/NSmlDmProvisioningAdapter.h
syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp
syncmlfw/dm/settings/bld/bld.inf
syncmlfw/dm/settings/conf/CI_factorydmprofiles.confml
syncmlfw/dm/settings/conf/factorydmprofiles.confml
syncmlfw/dm/settings/inc/DMprofileContentHandler.h
syncmlfw/dm/settings/src/DMProfileContentHandler.cpp
syncmlfw/dm/settings/src/NSmlDMResourceProfiles.cpp
syncmlfw/dm/settings/src/NSmlDMSettings.cpp
syncmlfw/dm/syncagent/bld/nsmldmagent.mmp
syncmlfw/dm/syncagent/inc/NSmlDMAgent.h
syncmlfw/dm/syncagent/inc/NSmlDMCmds.h
syncmlfw/dm/syncagent/inc/OnlineSupportLogger.h
syncmlfw/dm/syncagent/inc/nsmldmagconstants.h
syncmlfw/dm/syncagent/src/nsmldmagent.cpp
syncmlfw/dm/syncagent/src/nsmldmcmds.cpp
syncmlfw/dm/treemodule/src/nsmldmddf.cpp
syncmlfw/dm/treemodule/src/nsmldmmodule.cpp
syncmlfw/dm/wappushalert/bld/nsmldmwappushalert.mmp
syncmlfw/ds/agentlog/src/nsmlagentlog.cpp
syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/inc/testprofileutil.h
syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testprofileutilBlocks.cpp
syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testsync.cpp
syncmlfw/ds/dsutils/dbcaps/src/NSmlPropParam.cpp
syncmlfw/ds/dsutils/dbcaps/src/NSmldbcapsSerializer.cpp
syncmlfw/ds/hostserver/dshostserverbase/bld/nsmldshostserver.mmp
syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsession.h
syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsessioncancel.h
syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsessioncanceleventhandler.h
syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldsasynccallback.cpp
syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsession.cpp
syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsessioncancel.cpp
syncmlfw/ds/hostserver/dshostservers/bld/nsmldshostserver1.mmp
syncmlfw/ds/hostserver/dshostservers/bld/nsmldshostserver2.mmp
syncmlfw/ds/provisioningadapter/bld/NSmlDsProvisioningAdapter.mmp
syncmlfw/ds/provisioningadapter/inc/NSmlDsProvisioningAdapter.h
syncmlfw/ds/provisioningadapter/src/NSmlDsProvisioningAdapter.cpp
syncmlfw/ds/settings/bld/DEF/bwinscwdssettingsu.def
syncmlfw/ds/settings/bld/DEF/eabidssettingsu.def
syncmlfw/ds/settings/bld/nsmldssettings.mmp
syncmlfw/ds/settings/inc/NSmlProfileContentHandler.h
syncmlfw/ds/settings/inc/nsmldsoperatorsettings.h
syncmlfw/ds/settings/inc/nsmldssettings.h
syncmlfw/ds/settings/src/NSmlDSSettings.cpp
syncmlfw/ds/settings/src/nsmldsoperatorsettings.cpp
syncmlfw/ds/settings/src/pcsuite/NSmlDSProfileRes.rss
syncmlfw/ds/syncagent/bld/nsmldsagent.mmp
syncmlfw/ds/syncagent/inc/NSmlDSAgent.h
syncmlfw/ds/syncagent/inc/NSmlDSCmds.h
syncmlfw/ds/syncagent/src/nsmldsagent.cpp
syncmlfw/ds/syncagent/src/nsmldscmds.cpp
syncmlfw/ds/syncagent/src/nsmldscontent.cpp
syncmlfw/ds/syncagent/src/nsmldsnetmon.cpp
syncmlfw/ds/wappushalert/bld/nsmldswappushalert.mmp
syncmlfw/group/bld.inf
syncmlfw/rom/NSmlDMSync.iby
syncmlfw/rom/NSmlDSSync.iby
syncmlfw/syncmlnotifier/BWINS/SyncMLNotifieru.def
syncmlfw/syncmlnotifier/appserver/SyncMLNotifierAppserver.mmp
syncmlfw/syncmlnotifier/appserver/SyncMLNotifierAppserver.rss
syncmlfw/syncmlnotifier/appserver/SyncMLNotifierServerApplication.cpp
syncmlfw/syncmlnotifier/appserver/SyncMLNotifierServerApplication.h
syncmlfw/syncmlnotifier/appserver/SyncMLNotifierappserver_reg.rss
syncmlfw/syncmlnotifier/cenrep/keys_syncmlnotifier.xls
syncmlfw/syncmlnotifier/conf/syncmlnotifier.confml
syncmlfw/syncmlnotifier/conf/syncmlnotifier_101F8769.crml
syncmlfw/syncmlnotifier/data/SyncMLNotifier.rss
syncmlfw/syncmlnotifier/eabi/SyncMLNotifieru.def
syncmlfw/syncmlnotifier/ecom/101F876A.rss
syncmlfw/syncmlnotifier/ecom/SyncMLNotifierWrapper.cpp
syncmlfw/syncmlnotifier/ecom/SyncMLNotifierWrapper.mmp
syncmlfw/syncmlnotifier/group/101F8769.txt
syncmlfw/syncmlnotifier/group/SyncMLNotifier.mmp
syncmlfw/syncmlnotifier/group/bld.inf
syncmlfw/syncmlnotifier/inc/SyncMLAknPopUplist.h
syncmlfw/syncmlnotifier/inc/SyncMLAppLaunchNotifier.h
syncmlfw/syncmlnotifier/inc/SyncMLDlgNotifier.h
syncmlfw/syncmlnotifier/inc/SyncMLFwUpdNotifier.h
syncmlfw/syncmlnotifier/inc/SyncMLMessageQueryDialog.h
syncmlfw/syncmlnotifier/inc/SyncMLNotifDebug.h
syncmlfw/syncmlnotifier/inc/SyncMLNotifPrivateCRKeys.h
syncmlfw/syncmlnotifier/inc/SyncMLNotifier.hrh
syncmlfw/syncmlnotifier/inc/SyncMLNotifierBase.h
syncmlfw/syncmlnotifier/inc/SyncMLPreSyncPluginInterface.h
syncmlfw/syncmlnotifier/inc/SyncMLQueryDialog.h
syncmlfw/syncmlnotifier/inc/SyncMLQueryTimer.h
syncmlfw/syncmlnotifier/inc/SyncMLTimedDateQuery.h
syncmlfw/syncmlnotifier/inc/SyncMLTimedInputTextQuery.h
syncmlfw/syncmlnotifier/inc/SyncMLTimedMessageQuery.h
syncmlfw/syncmlnotifier/inc/SyncMLTimedNumberQueryDialog.h
syncmlfw/syncmlnotifier/inc/SyncMLTimedQueryDialog.h
syncmlfw/syncmlnotifier/inc/syncmlmmcwatcher.h
syncmlfw/syncmlnotifier/loc/SyncMLNotifier.loc
syncmlfw/syncmlnotifier/loc/SyncMLNotifierFota.loc
syncmlfw/syncmlnotifier/rom/SyncMLNotifier.iby
syncmlfw/syncmlnotifier/rom/SyncMLNotifierResources.iby
syncmlfw/syncmlnotifier/src/SyncMLAknPopUpList.cpp
syncmlfw/syncmlnotifier/src/SyncMLAppLaunchNotifier.cpp
syncmlfw/syncmlnotifier/src/SyncMLDlgNotifier.cpp
syncmlfw/syncmlnotifier/src/SyncMLFwUpdNotifier.cpp
syncmlfw/syncmlnotifier/src/SyncMLMessageQueryDialog.cpp
syncmlfw/syncmlnotifier/src/SyncMLNotifierBase.cpp
syncmlfw/syncmlnotifier/src/SyncMLNotifierMain.cpp
syncmlfw/syncmlnotifier/src/SyncMLPreSyncPluginInterface.cpp
syncmlfw/syncmlnotifier/src/SyncMLQueryDialog.cpp
syncmlfw/syncmlnotifier/src/SyncMLQueryTimer.cpp
syncmlfw/syncmlnotifier/src/SyncMLTimedDateQuery.cpp
syncmlfw/syncmlnotifier/src/SyncMLTimedInputTextQuery.cpp
syncmlfw/syncmlnotifier/src/SyncMLTimedMessageQuery.cpp
syncmlfw/syncmlnotifier/src/SyncMLTimedNumberQueryDialog.cpp
syncmlfw/syncmlnotifier/src/SyncMLTimedQueryDialog.cpp
syncmlfw/syncmlnotifier/src/syncmlmmcwatcher.cpp
syncmlfw/syncservice/BWINS/SyncServiceu.def
syncmlfw/syncservice/INC/SyncServiceDebug.h
syncmlfw/syncservice/SRC/SyncService.cpp
syncmlfw/syncservice/SRC/SyncServiceSession.cpp
syncmlfw/syncservice/eabi/SyncServiceu.def
syncmlfw/syncservice/group/SyncService.mmp
syncmlfw/syncservice/group/bld.inf
syncmlfw/syncservice/rom/syncservice.iby
sysdef_1_5_1.dtd
terminalsecurity/SCP/DmEventNotifier/group/DmEventNotifier.mmp
terminalsecurity/SCP/DmEventNotifier/inc/JavaApplicationService.h
terminalsecurity/SCP/DmEventNotifier/src/DmEventScheduler.cpp
terminalsecurity/SCP/SCPClient/BWINS/SCPClientu.def
terminalsecurity/SCP/SCPClient/data/SCPNotifier.rss
terminalsecurity/SCP/SCPClient/eabi/SCPClientu.def
terminalsecurity/SCP/SCPClient/group/SCPClient.mmp
terminalsecurity/SCP/SCPClient/inc/SCPLockObserver.h
terminalsecurity/SCP/SCPClient/inc/SCPQueryDialog.h
terminalsecurity/SCP/SCPClient/loc/SCPNotifier.loc
terminalsecurity/SCP/SCPClient/src/SCPClient.cpp
terminalsecurity/SCP/SCPClient/src/SCPLockObserver.cpp
terminalsecurity/SCP/SCPClient/src/SCPParamObject.cpp
terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp
terminalsecurity/SCP/SCPDatabase/group/SCPDatabase.mmp
terminalsecurity/SCP/SCPDatabase/src/SCPParamDB.cpp
terminalsecurity/SCP/SCPDatabase/src/SCPParamDBController.cpp
terminalsecurity/SCP/SCPEventHandler/group/SCPEventHandler.mmp
terminalsecurity/SCP/SCPHistoryPlugin/group/SCPHistoryPlugin.mmp
terminalsecurity/SCP/SCPHistoryPlugin/inc/SCPHistoryPlugin.h
terminalsecurity/SCP/SCPHistoryPlugin/inc/SCPSpecificStringsPlugin.h
terminalsecurity/SCP/SCPHistoryPlugin/src/SCPHistoryPlugin.cpp
terminalsecurity/SCP/SCPHistoryPlugin/src/SCPSpecificStringsPlugin.cpp
terminalsecurity/SCP/SCPPatternPlugin/group/SCPPatternPlugin.mmp
terminalsecurity/SCP/SCPPatternPlugin/inc/SCPPatternPlugin.h
terminalsecurity/SCP/SCPPatternPlugin/src/SCPPatternPlugin.cpp
terminalsecurity/SCP/SCPServer/group/SCPServer.mmp
terminalsecurity/SCP/SCPServer/inc/SCPConfiguration.h
terminalsecurity/SCP/SCPServer/inc/SCPLockNotificationEventHandler.h
terminalsecurity/SCP/SCPServer/inc/SCPPlugin.h
terminalsecurity/SCP/SCPServer/inc/SCPServer.h
terminalsecurity/SCP/SCPServer/inc/SCPSession.h
terminalsecurity/SCP/SCPServer/src/SCPConfiguration.cpp
terminalsecurity/SCP/SCPServer/src/SCPLockNotificationEventHandler.cpp
terminalsecurity/SCP/SCPServer/src/SCPLockSettingEventHandler.cpp
terminalsecurity/SCP/SCPServer/src/SCPPluginManager.cpp
terminalsecurity/SCP/SCPServer/src/SCPServer.cpp
terminalsecurity/SCP/SCPServer/src/SCPSession.cpp
terminalsecurity/SCP/SCPTimestampPlugin/group/SCPTimestampPlugin.mmp
terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPTimestampPlugin.h
terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPUserInf.h
terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp
terminalsecurity/SCP/SCPTimestampPlugin/src/SCPUserInf.cpp
terminalsecurity/SCP/inc/SCPLockCode.h
terminalsecurity/client/BWINS/TerminalControlu.def
terminalsecurity/client/eabi/TerminalControlu.def
terminalsecurity/client/group/TerminalControlClient.mmp
terminalsecurity/client/src/TerminalControlClient.cpp
terminalsecurity/conf/Keys_SCPLockCode.confml
terminalsecurity/conf/Keys_SCPLockCode_2002677B.crml
terminalsecurity/inc/TerminalControlClientServer.h
terminalsecurity/server/group/TerminalControlServer.mmp
terminalsecurity/server/inc/TerminalControlServer.h
terminalsecurity/server/src/TerminalControlServer.cpp
terminalsecurity/server/src/TerminalControlSession.cpp
terminalsecurity/tcadapter/bld/tcadapter.mmp
--- a/dcmofw/dcmoclient/group/dcmoclient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmoclient/group/dcmoclient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -35,3 +35,5 @@
 LIBRARY         euser.lib
 LIBRARY         featmgr.lib
 LIBRARY       	flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- a/dcmofw/dcmocustcmd/group/dcmostartupcustcmd.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmocustcmd/group/dcmostartupcustcmd.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -40,3 +40,5 @@
 LIBRARY		  	 	dcmoclient.lib
 LIBRARY					featmgr.lib
 DEBUGLIBRARY    flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- a/dcmofw/dcmoserver/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmoserver/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -21,6 +21,7 @@
 
 
 ../loc/dcmo.loc												MW_LAYER_LOC_EXPORT_PATH(dcmo.loc)
+
 // Generic configuration interface for component cenrep settings  
 ../conf/dcmo.confml                   MW_LAYER_CONFML(dcmo.confml)
 ../conf/dcmo_2001FE47.crml 	    	    MW_LAYER_CRML(dcmo_2001FE47.crml)
--- a/dcmofw/dcmoserver/group/dcmoserver.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmoserver/group/dcmoserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -18,7 +18,7 @@
 #include <platform_paths.hrh>
 
 
-CAPABILITY			CAP_SERVER DiskAdmin AllFiles
+CAPABILITY			CAP_SERVER TrustedUI NetworkControl DiskAdmin AllFiles
 
 TARGET        	dcmoserver.exe
 TARGETTYPE    	exe
@@ -29,13 +29,12 @@
 SOURCEPATH    	../src
 SOURCE       	 	dcmoserver.cpp
 SOURCE       	 	dcmosession.cpp
-SOURCE       	 	dcmomessagebox.cpp
+SOURCE       	 	dcmonotifieraob.cpp
 SOURCE					dcmogenericcontrol.cpp
+SOURCE				AMSmlHelper.cpp
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
-SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
-SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
 USERINCLUDE   	../inc
 USERINCLUDE   	../../inc
 
@@ -44,8 +43,25 @@
     TARGETPATH  resource
     LANGUAGE_IDS
 END 
-LIBRARY     	euser.lib 
+
+LIBRARY     	euser.lib commonengine.lib efsrv.lib
 LIBRARY       ecom.lib
 LIBRARY       centralrepository.lib
+LIBRARY				aknnotify.lib eiksrv.lib
 LIBRARY    		flogger.lib
-LIBRARY       HbCore.lib HbWidgets.lib
+LIBRARY 		TerminalControl.lib
+LIBRARY				nsmlprivateapi.lib
+LIBRARY     		commdb.lib
+LIBRARY				apengine.lib	esock.lib 
+#ifdef __TARM_SYMBIAN_CONVERGENCY
+ LIBRARY				dmtreeclient.lib
+ LIBRARY				SmlClient.lib
+#else
+ LIBRARY			nsmldmtreedbhandler.lib
+ LIBRARY  			syncmlclientapi.lib
+ LIBRARY 			nsmldmmodule.lib
+ LIBRARY 			nsmldmtreedbclient.lib connmon.lib
+ LIBRARY     		nsmltransporthandler.lib
+LIBRARY     		nsmltransport.lib cone.lib javaregistryclient.lib avkon.lib eikcore.lib  apparc.lib
+#endif // __TARM_SYMBIAN_CONVERGENCY
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/dcmoserver/inc/amsmlhelper.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Implementation of applicationmanagement components
+ *
+ */
+
+#ifndef __ABMSMLHELPER_H__
+#define __ABMSMLHELPER_H__
+
+#include <SyncMLDef.h>
+#include <SyncMLTransportProperties.h>
+#include <SyncMLClient.h>
+#include <SyncMLClientDM.h>
+
+class SmlHelper
+        {
+public:
+
+        // NOTE: this enum must match with property array described in 
+        // SyncML_Sync_Agent_Client_API_Specification.doc.
+        enum TNSmlSyncTransportProperties
+            {
+            EPropertyIntenetAccessPoint = 0,
+            EPropertyHttpUsed = 5,
+            EPropertyHttpUserName = 6,
+            EPropertyHttpPassword = 7
+            };
+
+        /**
+         * Fetch the default IAP used by the currently active DM profile
+         * @param aDefaultIAP on successfull return contains the default IAP number
+         */
+
+        static void GetDefaultIAPFromDMProfileL(TInt& aDefaultIAP);
+
+        static void GetConnectionPropertyNameL(RSyncMLSession& aSyncSession,
+                TDes8& aText, TInt aPropertyPos);
+
+        static TInt StrToInt(const TDesC& aText, TInt& aNum);
+        };
+	
+#endif
+
+//  End of File
--- a/dcmofw/dcmoserver/inc/dcmomessagebox.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  DCMO Message Box
-*
-*/
-
-#ifndef __DCMO_MESSAGEBOX_H__
-#define __DCMO_MESSAGEBOX_H__
-
-// INCLUDES
-
-#include <hbdevicemessageboxsymbian.h>
-
-/**
-* Message Box class to show the global note.
-*
-*/
-class CDCMOMessageBox : public CBase, public MHbDeviceMessageBoxObserver
-	{
-public:
-    static CDCMOMessageBox* NewL( );
-    
-  /**
-	 * Destructor
-	 */
-		~CDCMOMessageBox();
-		
-	/**
-	 * Show the Notification
-	 * @param aString , to be shown
-	 * @return 
-	 */
-		void ShowMessageL( TDesC& aString );
-		
-public: // from MHbDeviceMessageBoxObserver
-    void MessageBoxClosed(const CHbDeviceMessageBoxSymbian *aMessageBox,
-        CHbDeviceMessageBoxSymbian::TButtonId aButton);
-		
-		/**
-	 * Gets the Message Box status
-	 * @param None
-	 * @return ETrue if the user pressed ok button, else EFalse.
-	 */
-		static TBool IsMsgBoxClosed();
-		
-		/**
-	 * Sets the Message Box status
-	 * @param ETrue if the user pressed ok button, else EFalse.
-	 * @return None
-	 */
-		static void SetMsgBoxStatus(TBool aStatus);
-		
-private:  
-	/**
-	 * Createss CDCMOMessageBox
-	 * Default Constructor
-	 */  
-		CDCMOMessageBox( );		
-
-private:		
-		CHbDeviceMessageBoxSymbian* iMessageBox;
-		static TBool iMsgBoxClosed;
-	};
-#endif //__DCMO_MESSAGEBOX_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/dcmoserver/inc/dcmonotifieraob.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DCMO Notifier Aob
+*
+*/
+
+#ifndef __DCMO_NOTIFIERAOB_H__
+#define __DCMO_NOTIFIERAOB_H__
+
+// INCLUDES
+
+#include <AknGlobalMsgQuery.h>
+
+/**
+* An active class to show the global note.
+*
+*/
+class CDCMONotifierAob : public CActive
+	{
+public:
+    static CDCMONotifierAob* NewL( );
+    
+  /**
+	 * Destructor
+	 */
+		~CDCMONotifierAob();
+		
+	/**
+	 * Show the Notification
+	 * @param aString , to be shown
+	 * @return 
+	 */
+		void ShowNotifierL( TDesC& aString );
+		
+		/**
+     * From CActive,DoCancel.
+     */
+		void DoCancel();
+
+		/**
+     * From CActive,RunL.
+     */
+	  void RunL();
+
+		/**
+     * From CActive,RunError.
+     */
+		TInt RunError(TInt aError);
+		
+private:  
+	/**
+	 * Createss CDCMOGenericControl
+	 * Default Constructor
+	 */  
+		CDCMONotifierAob( );
+		
+	/**
+	 * second phase constructor
+	 */
+    void ConstructL();
+
+private:		
+		CAknGlobalMsgQuery* iGlobalMsgQuery;
+
+	};
+#endif //__DCMO_NOTIFIERAOB_H__
--- a/dcmofw/dcmoserver/inc/dcmoserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmoserver/inc/dcmoserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -21,28 +21,27 @@
 // INCLUDES
 
 #include <e32base.h>
-#include <hbdevicemessageboxsymbian.h>
 #include "dcmoclientserver.h"
 #include "dcmoconst.h"
-#include "dcmomessagebox.h"
-
-
+#include "dcmonotifieraob.h"
+#include <lawmocallbackinterface.h>
 // CONSTANTS
 const TUid KCRUidDCMOServer={0x2001FE47};
 const TInt KDCMOKeyMaxNumber = 16;
 // FORWARD DECLARATIONS
 // CLASS DECLARATION
-
+class CLAWMOPluginInterface;
 /**
 *  CDCMOServer
 *  Description.
 */
 
 
-class CDCMOServer : public CServer2
+class CDCMOServer : public CServer2,
+                    public MLawmoPluginWipeObserver
 	{
 	friend class CDCMOSession;
-	friend class CDCMOMessageBox;
+	friend class CDCMONotifierAob;
 
 public:
 	/**
@@ -87,6 +86,11 @@
 	 * @return None
 	 */
 	void DropSession();
+public:
+	
+	// Callback from MLawmoPluginWipeObserver
+	void HandleWipeCompleted(TInt status);
+	//void SendGenericAlert();
 	
 private:
 	/**
@@ -169,12 +173,15 @@
 	 */
 	void SetStarter(TBool aValue);	
 	
-	/**
-	 * Deletes the idcmoArray value if any
-	 * @param none
-	 * @return none
-	 */
-	void CleanDcmoArray();	
+    TLawMoStatus WipeItem(TInt aValue=0);
+	
+    TLawMoStatus WipeAllItem();
+
+	TLawMoStatus GetListItemL(TDesC& item, TDes& strValue);
+
+	TLawMoStatus GetToBeWipedL(TDesC& item, TDes& wipeValue);
+
+	TLawMoStatus SetToBeWipedL(TDesC& item, TInt wipeValue);
 	
 private:
 	
@@ -183,7 +190,7 @@
 	 * @param aCategory
 	 * @return the uid
 	 */
-	TUid GetAdapterUidL(const TDesC& aCategory);
+	TUid GetAdapterUidL(const TDesC& aCategory, TBool aIsLawmo = EFalse);
 	
 	/**
 	 * Finds whether the plug-in adapter is a generic category
@@ -192,11 +199,19 @@
 	 */
 		TInt GetLocalCategoryL(const TDesC& aCategory);	
 	
+	void GetLawmoPluginUidsL();
+	
+	void StartDMNetworkMonitorL(TDesC& aServerId, TInt iapid=0);
 private:
 	RArray<dcmoInfoList> idcmoArray;
 	static TInt iSessionCount;
 	TBool iStarter;	
-	CDCMOMessageBox* iMessageBox;
+	CDCMONotifierAob* iNotifier;
+	RArray<TUid> ilawmoPluginUidToBeWiped;
+	RArray<CLAWMOPluginInterface*> ilawmoPlugins;
+	TInt iwipeStatus;
+    TInt iCount;
+    TInt iSessionIap;
 	};
 	
 #endif //__DCMO_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/dcmoserver/src/AMSmlHelper.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Implementation of applicationmanagement components
+ *
+ */
+
+#include "amsmlhelper.h"
+#include <SyncMLClientDM.h>
+#include <rconnmon.h> 
+#include <es_sock.h>
+#include <es_enum_internal.h>
+#include <es_sock_partner.h>
+#include <es_enum.h>
+#include "lawmodebug.h"
+
+const TUid KUidNSmlMediumTypeInternet =
+    {
+    0x101F99F0
+    };
+const TUid KSosServerUid =
+    {
+    0x101F99FB
+    };
+
+const TInt KBufSize32 = 32;
+
+void SmlHelper::GetDefaultIAPFromDMProfileL(TInt& aDefaultIAP)
+    {
+    RLDEBUG("ApplicationManagementServer::GetDefaultIAPFromDMProfileL() - start");
+
+    // first try to obtain the current profile id
+    RSyncMLSession ses;
+    ses.OpenL();
+    RLDEBUG("	1/8");
+    CleanupClosePushL(ses);
+
+    TSmlJobId jid;
+    TSmlUsageType jtype;
+    ses.CurrentJobL(jid, jtype);
+    RLDEBUG("	2/8");
+    RSyncMLDevManJob job;
+    job.OpenL(ses, jid);
+    RLDEBUG("	3/8");
+    CleanupClosePushL(job);
+    // get profile id
+    TSmlProfileId pid(job.Profile() );
+    CleanupStack::PopAndDestroy( &job);
+
+    TBuf8<KBufSize32> key;
+    TBuf<KBufSize32> value;
+    TInt num = KErrNotFound;
+
+    // get connection property name first
+    GetConnectionPropertyNameL(ses, key, EPropertyIntenetAccessPoint);
+    RLDEBUG("	4/8");
+    // we need to open sync profile in ordere to open the RSyncMLConnection
+    RSyncMLDevManProfile syncProfile;
+    syncProfile.OpenL(ses, pid);
+    RLDEBUG("	5/8");
+    CleanupClosePushL(syncProfile);
+
+    TSmlTransportId transport;
+    RArray<TSmlTransportId> connections;
+    _LIT8( KNSmlIAPId, "NSmlIapId" );
+
+    // now open the syncML connection
+    RSyncMLConnection syncConnection;
+    syncProfile.ListConnectionsL(connections);
+
+    transport = connections[0];
+    syncConnection.OpenL(syncProfile, transport);
+    RLDEBUG("	6/8");
+    CleanupClosePushL(syncConnection);
+
+    const TDesC8& source(syncConnection.GetPropertyL(KNSmlIAPId) );
+    RLDEBUG("	7/8");
+    value.Copy(source.Left(value.MaxLength() ) );
+    User::LeaveIfError(StrToInt(value, num) );
+    RLDEBUG("	8/8");
+
+    aDefaultIAP = num;
+
+    // If there is no default Access point in DM profile then use
+    // currently used access point by DM session
+
+    if (aDefaultIAP == -1)
+        {
+        RLDEBUG("adefault iap -1");
+        TInt sockIapid = -1;
+
+        RSocketServ serv;
+        CleanupClosePushL(serv);
+        User::LeaveIfError(serv.Connect() );
+
+        RConnection conn;
+        CleanupClosePushL(conn);
+        User::LeaveIfError(conn.Open(serv) );
+        RLDEBUG("RConnection opened");
+        
+        TUint count( 0);
+        User::LeaveIfError(conn.EnumerateConnections(count) );
+        RLDEBUG_2("RConnection count %d",count);
+        // enumerate connections
+        for (TUint idx=1; idx<=count; ++idx)
+            {
+            TConnectionInfo connectionInfo;
+            TConnectionInfoBuf connInfo(connectionInfo);
+            RLDEBUG("RConnection loop");
+            TInt err = conn.GetConnectionInfo(idx, connInfo); // iapid
+            RLDEBUG("RConnection get conn info");
+            if (err != KErrNone)
+                {
+                CleanupStack::PopAndDestroy( 2); // conn, serv
+                User::Leave(err);
+                }
+            // enumerate connectionclients
+            TConnectionEnumArg conArg;
+            conArg.iIndex = idx;
+            TConnEnumArgBuf conArgBuf(conArg);
+            RLDEBUG("RConnection control");
+            err=conn.Control(KCOLConnection, KCoEnumerateConnectionClients,
+                    conArgBuf);
+            if (err != KErrNone)
+                {
+                CleanupStack::PopAndDestroy( 2); // conn, serv
+                User::Leave(err);
+                }
+            TInt cliCount = conArgBuf().iCount;
+            RLDEBUG("RConnection second loop");
+            for (TUint j=1; j<=cliCount; ++j)
+                {
+                TConnectionGetClientInfoArg conCliInfo;
+                conCliInfo.iIndex = j;
+                TConnGetClientInfoArgBuf conCliInfoBuf(conCliInfo);
+                RLDEBUG("RConnection another control");
+                err=conn.Control(KCOLConnection, KCoGetConnectionClientInfo,
+                        conCliInfoBuf);
+
+                if (err != KErrNone)
+                    {
+                    CleanupStack::PopAndDestroy( 2); // conn, serv
+                    User::Leave(err);
+                    }
+                TConnectionClientInfo conCliInf = conCliInfoBuf().iClientInfo;
+                TUid uid = conCliInf.iUid;
+                RLDEBUG_2("RConnection check uid %d", uid.iUid);
+                if (uid == KSosServerUid)
+                    {
+                    sockIapid = connInfo().iIapId;
+                    RLDEBUG("RConnection uid matched");
+                    }
+
+                }
+            }
+        CleanupStack::PopAndDestroy( 2); // conn, serv		
+
+        aDefaultIAP = sockIapid;
+        RLDEBUG("RConnection out");
+        }
+    // get profile's server id
+    //aServerId = syncProfile.ServerId().AllocL();
+    RLDEBUG("RConnection total out");
+
+    CleanupStack::PopAndDestroy( &syncConnection);
+    CleanupStack::PopAndDestroy( &syncProfile);
+
+    CleanupStack::PopAndDestroy( &ses);
+    connections.Close();
+    RLDEBUG("ApplicationManagementServer::GetDefaultIAPFromDMProfileL() - end");
+    }
+
+void SmlHelper::GetConnectionPropertyNameL(RSyncMLSession& aSyncSession,
+        TDes8& aText, TInt aPropertyPos)
+    {
+    RLDEBUG("ApplicationManagementServer::GetConnectionPropertyNameL() - start");
+
+    // at the moment RSyncMLTransport is only needed
+    // for internet connection settings
+    RSyncMLTransport transport;
+    CleanupClosePushL(transport);
+    transport.OpenL(aSyncSession, KUidNSmlMediumTypeInternet.iUid);
+
+    const CSyncMLTransportPropertiesArray& arr = transport.Properties();
+    RLDEBUG("GetConnectionPropertyNameL interior");
+    __ASSERT_DEBUG( arr.Count()> aPropertyPos, User::Panic(_L("invalid count"), KErrGeneral) );
+
+    const TSyncMLTransportPropertyInfo& info = arr.At(aPropertyPos);
+    aText = info.iName;
+    CleanupStack::PopAndDestroy( &transport);
+
+    RLDEBUG("ApplicationManagementServer::GetConnectionPropertyNameL() - end");
+    }
+
+TInt SmlHelper::StrToInt(const TDesC& aText, TInt& aNum)
+    {
+    TLex lex(aText);
+    TInt err = lex.Val(aNum);
+    return err;
+    }
+
+// End of File
--- a/dcmofw/dcmoserver/src/dcmomessagebox.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  DCMO Message Box 
-*
-*/
-
-
-#include "dcmomessagebox.h"
-#include "dcmoserver.h"
-#include "dcmodebug.h"
-
-TBool CDCMOMessageBox::iMsgBoxClosed = EFalse;
-
-// --------------------------------------------------------------------------
-// CDCMOMessageBox* CDCMOMessageBox::NewL( )
-// --------------------------------------------------------------------------
-//
-CDCMOMessageBox* CDCMOMessageBox::NewL( )
-	{
-		RDEBUG("CDCMOMessageBox::NewL begin");
-		CDCMOMessageBox* self = new (ELeave) CDCMOMessageBox( );
-  	RDEBUG("CDCMOMessageBox::NewL end");
-		return self;		
-	}
-
-// --------------------------------------------------------------------------
-// CDCMOMessageBox::CDCMOMessageBox( )
-// --------------------------------------------------------------------------
-//
-CDCMOMessageBox::CDCMOMessageBox( ) 
-	{
-		iMessageBox = NULL;
-		RDEBUG("CDCMOMessageBox::constructor");
-	}
-
-// --------------------------------------------------------------------------
-// CDCMOMessageBox::~CDCMOMessageBox()
-// --------------------------------------------------------------------------
-//
-CDCMOMessageBox::~CDCMOMessageBox()
-	{
-		RDEBUG("CDCMOMessageBox::~CDCMOMessageBox begin");   
-		if( iMessageBox )
-		{
-			delete iMessageBox ;
-    	iMessageBox = NULL; 
-		}	
-		RDEBUG("CDCMOMessageBox::~CDCMOMessageBox end");    
-  }
-
-// --------------------------------------------------------------------------
-// TBool CDCMOMessageBox::IsMsgBoxClosed( )
-// --------------------------------------------------------------------------
-//
-TBool CDCMOMessageBox::IsMsgBoxClosed()
-	{
-		return iMsgBoxClosed;
-	}
-
-// --------------------------------------------------------------------------
-// void CDCMOMessageBox::SetMsgBoxStatus( TBool aStatus )
-// --------------------------------------------------------------------------
-//
-void CDCMOMessageBox::SetMsgBoxStatus(TBool aStatus)
-{
-		iMsgBoxClosed = aStatus;
-}
-	
-// --------------------------------------------------------------------------
-// void CDCMOMessageBox::ShowNotifierL( TDesC& aString )
-// --------------------------------------------------------------------------
-//
-void CDCMOMessageBox::ShowMessageL( TDesC& aString )
-{
-		RDEBUG("CDCMOMessageBox::ShowMessageL() : Begin");
-		if( !iMessageBox )
-			iMessageBox = CHbDeviceMessageBoxSymbian::NewL();			
-		iMessageBox->SetTimeout(0); //HbPopup::NoTimeout); 
-		iMessageBox->SetDismissPolicy(0); //HbPopup::NoDismiss
-		iMessageBox->SetTextL(aString);
-		iMessageBox->SetObserver(this);
-		iMessageBox->ShowL();		
-		RDEBUG("CDCMOMessageBox::ShowMessageL() : End");	
-}
-
-void CDCMOMessageBox::MessageBoxClosed(const CHbDeviceMessageBoxSymbian */*aMessageBox*/,
-     CHbDeviceMessageBoxSymbian::TButtonId /*aButton*/)
- {
-  		 delete	iMessageBox;
-  		 iMessageBox = NULL;
-    	 iMsgBoxClosed = ETrue;	
-    	 if( CDCMOServer::iSessionCount == 0)
-    		CActiveScheduler::Stop();
- }
-	
-//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/dcmoserver/src/dcmonotifieraob.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DCMO Notifier Aob
+*
+*/
+
+
+#include "dcmonotifieraob.h"
+#include "dcmoserver.h"
+#include "dcmodebug.h"
+
+
+// --------------------------------------------------------------------------
+// CDCMONotifierAob* CDCMONotifierAob::NewL( CAknGlobalMsgQuery& aGlobalMsgQuery )
+// --------------------------------------------------------------------------
+//
+CDCMONotifierAob* CDCMONotifierAob::NewL( )
+	{
+		RDEBUG("CDCMONotifierAob::NewL begin");
+		CDCMONotifierAob* self = new (ELeave) CDCMONotifierAob( );
+		CleanupStack::PushL(self);
+  	self->ConstructL();
+  	CleanupStack::Pop(); // self
+  	RDEBUG("CDCMONotifierAob::NewL end");
+		return self;		
+	}
+
+// --------------------------------------------------------------------------
+// CDCMONotifierAob::CDCMONotifierAob( CAknGlobalMsgQuery& aGlobalMsgQuery )
+// --------------------------------------------------------------------------
+//
+CDCMONotifierAob::CDCMONotifierAob( ) 
+	:CActive( EPriorityStandard ) //EPriorityNormal )  
+	{
+		RDEBUG("CDCMONotifierAob::constructor");
+	}
+
+
+// --------------------------------------------------------------------------
+// void CDCMONotifierAob::ConstructL()
+// --------------------------------------------------------------------------
+//
+void CDCMONotifierAob::ConstructL()
+    {   
+    	RDEBUG("CDCMONotifierAob::ConstructL begin");		
+    	iGlobalMsgQuery = NULL;
+    	CActiveScheduler::Add(this);	
+    	RDEBUG("CDCMONotifierAob::ConstructL end");    	
+    }
+
+// --------------------------------------------------------------------------
+// CDCMONotifierAob::~CDCMONotifierAob()
+// --------------------------------------------------------------------------
+//
+CDCMONotifierAob::~CDCMONotifierAob()
+	{
+		RDEBUG("CDCMONotifierAob::~CDCMONotifierAob begin");   
+		if( iGlobalMsgQuery )
+		{
+			delete iGlobalMsgQuery ;
+    	iGlobalMsgQuery = NULL; 
+		}	
+		RDEBUG("CDCMONotifierAob::~CDCMONotifierAob end");    
+  }
+
+// --------------------------------------------------------------------------
+// void CDCMONotifierAob::RunL()
+// --------------------------------------------------------------------------
+//
+void CDCMONotifierAob::RunL()
+    {
+    RDEBUG("CDCMONotifierAob::RunL() : Begin");   
+
+    if(iStatus == EAknSoftkeyOk)
+    {
+    	RDEBUG("CDCMONotifierAob::RunL() : EAknSoftkeyOk");     	
+    	delete iGlobalMsgQuery ;
+    	iGlobalMsgQuery = NULL; 	
+    	if( CDCMOServer::iSessionCount == 0)
+    		CActiveScheduler::Stop();
+    }
+        
+    RDEBUG("CDCMONotifierAob::RunL() : End");
+    }
+
+// --------------------------------------------------------------------------
+// void CDCMONotifierAob::DoCancel()
+// --------------------------------------------------------------------------
+//
+void CDCMONotifierAob::DoCancel()
+   {
+   		RDEBUG("CDCMONotifierAob::DoCancel() : Begin");
+   		iGlobalMsgQuery->CancelMsgQuery();
+    	delete iGlobalMsgQuery ;
+    	iGlobalMsgQuery = NULL; 	
+			RDEBUG("CDCMONotifierAob::DoCancel() : End");
+	 }
+
+// --------------------------------------------------------------------------
+// void CDCMONotifierAob::ShowNotifierL( TDesC& aString )
+// --------------------------------------------------------------------------
+//
+void CDCMONotifierAob::ShowNotifierL( TDesC& aString )
+{
+		RDEBUG("CDCMONotifierAob::ShowNotifierL() : Begin");
+		if( !iGlobalMsgQuery )
+			iGlobalMsgQuery = CAknGlobalMsgQuery::NewL();
+		if (!IsActive())
+    {
+			iStatus = KRequestPending;		
+		     
+			iGlobalMsgQuery->ShowMsgQueryL(
+		                    iStatus, 
+		                    aString,
+		                    R_AVKON_SOFTKEYS_OK_EMPTY, //R_AVKON_SOFTKEYS_OK_EMPTY, //R_AVKON_SOFTKEYS_OK_CANCEL,
+		                    KNullDesC,
+		                    KNullDesC);  
+			SetActive();                    
+		}
+		RDEBUG("CDCMONotifierAob::ShowNotifierL() : End");	
+}
+
+// -----------------------------------------------------------------------------
+// CDCMONotifierAob::RunError
+// Called when RunL leaves
+// This method can't leave
+// -----------------------------------------------------------------------------
+
+TInt CDCMONotifierAob::RunError(TInt /* aError */)
+	{
+	RDEBUG("CDCMONotifierAob::RunError >>");
+			
+	RDEBUG("CDCMONotifierAob::RunError <<");
+	return KErrNone;
+	}
+	
+//  End of File
--- a/dcmofw/dcmoserver/src/dcmoserver.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmoserver/src/dcmoserver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -21,9 +21,10 @@
 #include <e32base.h>
 #include <centralrepository.h>
 #include <stringresourcereader.h> 
+#include <dcmo.rsg> // Resource to be read header
+#include <AknGlobalMsgQuery.h>
 #include <data_caging_path_literals.hrh>
 #include <f32file.h> 
-#include <hbtextresolversymbian.h>
 #include "dcmoclientserver.h"
 #include "dcmoconst.h"
 #include "dcmointerface.h"
@@ -31,11 +32,18 @@
 #include "dcmosession.h"
 #include "dcmogenericcontrol.h"
 #include "dcmodebug.h"
-
+#include "lawmodebug.h"
+#include "amsmlhelper.h"
+#include <lawmoadaptercrkeys.h>
+#include <DevManInternalCRKeys.h>
 
-_LIT( KdcmoResourceFileName, "deviceupdates_" );	
-_LIT( KdcmoResourceFilePath, "z:/resource/qt/translations/" );	
+#include    <e32property.h>
+#include    <PSVariables.h>   // Property values
+#include    <lawmointerface.h>
+_LIT( KdcmoResourceFileName, "z:dcmo.rsc" );	
 const TInt KBufferSize = 256;
+const TInt KWipeSuccess = 1201;
+const TInt KWipeFailure = 1405;
 
 TInt CDCMOServer::iSessionCount = 0;
 // Standard server startup code
@@ -104,6 +112,9 @@
 void CDCMOServer::ConstructL()
 	{
 	RDEBUG("CDCMOServer::ConstructL- begin");
+	iwipeStatus = 0;
+	iSessionIap = KErrNotFound;
+	iCount = -1;
 	StartL(KDCMOServerName);	
 	RDEBUG("CDCMOServer::ConstructL- end");
 	}
@@ -115,7 +126,7 @@
 CDCMOServer::CDCMOServer() : CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/
 	{	
 		iStarter = EFalse;
-		iMessageBox = NULL;
+		iNotifier = NULL;
 	}
 
 // ----------------------------------------------------------------------------------------
@@ -125,24 +136,34 @@
 {	
 	RDEBUG("CDCMOServer::~CDCMOServer- begin");
   TInt count = idcmoArray.Count();  
-  RDEBUG_2("CDCMOServer::~CDCMOServer; %d", count );
+	RDEBUG_2("~~CDCMOServer::~CDCMOServer; %d", count );
 	if(count)
 	{	
 		for(TInt i=0; i< count; i++)
 				delete idcmoArray[i].iCategoryName;
 		idcmoArray.Reset();
-		delete iMessageBox;
-		iMessageBox = NULL;	
-	}
-	else
-	{
-		//Kill the server
-		if( iSessionCount == 0)
-			CActiveScheduler::Stop();	
+		delete iNotifier;
+		iNotifier = NULL;	
 	}
 	
+    RLDEBUG("CDCMOServer::wipe done delete pluginuid()");
+    TInt pluginObjectCount = ilawmoPlugins.Count();           
+    while(pluginObjectCount>0)
+	{
+        RLDEBUG("plugin to be deleted");
+        delete ilawmoPlugins[pluginObjectCount-1];
+        RLDEBUG("plugin deleted");
+        pluginObjectCount--;
+	}
+    RLDEBUG("CDCMOServer::close all RArrays()");
+    ilawmoPluginUidToBeWiped.Close();
+	
+    RLDEBUG("CDCMOServer::closeD all RArrays()");
+    ilawmoPlugins.Close();
+		
+    RDEBUG("CDCMOServer::call FinalClose");	
 	REComSession::FinalClose();
-	RDEBUG("CDCMOServer::~CDCMOServer- end");
+	RDEBUG("~~~CDCMOServer::~CDCMOServer- end");
 }
 
 // -----------------------------------------------------------------------------
@@ -158,20 +179,24 @@
   		RDEBUG("CDCMOServer::DropSession(): Starter");
   		SetStarter( EFalse );
   		return;                 
-  	} 
-  	if(CDCMOMessageBox::IsMsgBoxClosed())
-  	{
-  		CleanDcmoArray();
-  	}  
+  	}   
 		if( idcmoArray.Count() && ( iSessionCount == 0 ))
 		{
 			// A session is being destroyed		
+            RDEBUG("CDCMOServer::DropSession- dofinalise ?");
 			TRAPD( err, DoFinalizeL());		
+			iCount = 0;
 			if ( !err )
 			{
 				RDEBUG_2("CDCMOServer::DropSession err =  %d", err );
 			}						
 		}		
+		if((iSessionCount == 0)&&(iCount== -1))
+		    {
+            RDEBUG("DropSession kill server, only when no session and no wipe pending");
+            CActiveScheduler::Stop();
+            RDEBUG("DropSession kill server");
+		}		
 		RDEBUG("CDCMOServer::DropSession- end");
 	}
 
@@ -212,21 +237,28 @@
 // CDCMOServer::GetAdapterUidL
 // Gets the plug-in adapter implementation uid if it present.
 // ----------------------------------------------------------------------------------------
-TUid CDCMOServer::GetAdapterUidL(const TDesC& aCategory)
+TUid CDCMOServer::GetAdapterUidL(const TDesC& aCategory, TBool aIsLawmo)
 {
 	RDEBUG("CDCMOServer::GetDCMOAdapterUidL(): begin");
-	
+    RLDEBUG("CDCMOServer::GetAdapterUidL(): begin");
 	TUid retUid = {0x0};
-	
+	TEComResolverParams resolverParams;
 	RImplInfoPtrArray infoArray;
 	// Note that a special cleanup function is required to reset and destroy
 	// all items in the array, and then close it.
 	TCleanupItem cleanup(CleanupEComArray, &infoArray);
 	CleanupStack::PushL(cleanup);
+	if(aIsLawmo)
+	    {
+	    REComSession::ListImplementationsL(KLAWMOPluginInterfaceUid, resolverParams, KRomOnlyResolverUid, infoArray);
+	    RLDEBUG("CDCMOServer::GetAdapterUidL(): listImpl");
+	    }
+	else
 	REComSession::ListImplementationsL(KDCMOInterfaceUid, infoArray);
 
 	// Loop through each info for each implementation			
 	TBuf8<KBufferSize> buf;            
+    RLDEBUG("CDCMOServer::GetAdapterUidL(): for loop");
 	for (TInt i=0; i< infoArray.Count(); i++)
 	{
 		buf = infoArray[i]->OpaqueData();
@@ -235,12 +267,13 @@
 		if(category.Find(infoArray[i]->OpaqueData())!= KErrNotFound)
 		{
 			retUid = infoArray[i]->ImplementationUid();
+                    RLDEBUG("CDCMOServer::GetAdapterUidL(): matched");
 			break;
 		}
 		buf.Zero();
 	}
 	CleanupStack::PopAndDestroy(); //cleanup
-	
+    RLDEBUG("CDCMOServer::GetAdapterUidL():end");
 	RDEBUG("CDCMOServer::GetDCMOAdapterUidL(): end");
 	return retUid;
 }
@@ -374,21 +407,25 @@
 			RDEBUG("CDCMOServer::SetIntAttributeL(): LocalCategory");
 			CDCMOGenericControl* iGenericControl = new(ELeave) CDCMOGenericControl;
 			err = iGenericControl->SetIntAttributeL(categotyNumber, id, value);	
-			
-			TBool result = HbTextResolverSymbian::Init(KdcmoResourceFileName, KdcmoResourceFilePath );					
-
+			TFileName myFileName;
+  		TParse parseObj;
+  		parseObj.Set( KdcmoResourceFileName(), &KDC_RESOURCE_FILES_DIR,NULL );
+ 			myFileName = parseObj.FullName();
+ 			CStringResourceReader* test = CStringResourceReader::NewL( myFileName );
 			TPtrC buf;
 			dcmoList.iUid = categotyNumber;
 			if(categotyNumber == 0)
-			    {
-					_LIT(KTextCamera, "txt_device_update_info_camera");
-					stringHolder = HbTextResolverSymbian::LoadL(KTextCamera);
+			    {			    
+			    buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_CAMERA));
+			    stringHolder = buf.AllocL() ; 
 			    } 
 			else
-			    {	
-					_LIT(KTextFOTA, "txt_device_update_info_firmware_update");
-					stringHolder = HbTextResolverSymbian::LoadL(KTextFOTA);
-			    }		
+			    {			   
+			    buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_FIRMWARE_UPDATE));
+			    stringHolder = buf.AllocL() ; 
+			    }			
+     delete test;
+     test = NULL;
   	 delete iGenericControl;
 		 iGenericControl = NULL;
 	}
@@ -417,7 +454,7 @@
   		RDEBUG("CDCMOServer::SetIntAttributeL(): Starter");
   		SetStarter ( EFalse );
   		delete stringHolder;
-			stringHolder = NULL;
+		stringHolder = NULL;
   		return err;                
    }   
 	if((err == EDcmoSuccess) && (id == EEnable) ) 
@@ -478,7 +515,7 @@
 	RDEBUG("CDCMOServer::DoFinalizeL(): begin");	   
 
 	HBufC* content  = HBufC::NewLC(KDCMOMaxStringSize);
-  TPtr   contentptr  = content->Des(); 
+  	TPtr   contentptr  = content->Des(); 
 	HBufC* enableContent  = HBufC::NewLC(KDCMOMaxStringSize);
 	TPtr   enableContentptr  = enableContent->Des(); 
 	HBufC* disableContent  = HBufC::NewLC(KDCMOMaxStringSize);
@@ -486,6 +523,10 @@
 
 	TBool enable ( EFalse );
 	TBool disable ( EFalse );
+	TFileName myFileName;
+  TParse parseObj;
+  parseObj.Set( KdcmoResourceFileName(), &KDC_RESOURCE_FILES_DIR,NULL );
+  myFileName = parseObj.FullName();
 	TInt arrayCount = idcmoArray.Count(); 
 	_LIT(KNewLine, "\n");
 		
@@ -506,34 +547,38 @@
       		disableContentptr.Append( idcmoArray[i].iCategoryName->Des() );
       		disable = ETrue;
       	}	
-		}	  
-  
-		TBool result = HbTextResolverSymbian::Init(KdcmoResourceFileName, KdcmoResourceFilePath );
+		}
+	  
+  	CStringResourceReader* test = CStringResourceReader::NewL( myFileName );	  
 		if ( enable )
 		{
-			_LIT(KTextEnabled, "txt_device_update_title_enabled_by_the_system_admi");
-			HBufC* buf = HbTextResolverSymbian::LoadL(KTextEnabled);
-			contentptr.Append(buf->Des());
+			TPtrC buf;
+			buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_ENABLE)); 	    	
+			contentptr.Append(buf);
 	 		contentptr.Append(enableContentptr);
-	 		delete buf;
 		}
 		if ( disable )
 		{
-	 		_LIT(KTextDisabled, "txt_device_update_title_disabled_by_the_system_adm");
-			HBufC* buf = HbTextResolverSymbian::LoadL(KTextDisabled);
+	 		TPtrC buf;
+	 		buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_DISABLE));
 	 		if( enable )
-	 			contentptr.Append(KNewLine());	 		
-			contentptr.Append(buf->Des());
+	 			contentptr.Append(KNewLine());
+	 		contentptr.Append(buf);
 	 		contentptr.Append(disableContentptr);
-	 		delete buf;
 		}
-	
-		if( !iMessageBox )
-		{		
-			iMessageBox = CDCMOMessageBox::NewL();					
+		delete test;
+		test = NULL;
+		
+		if( iNotifier )
+		{
+			iNotifier->Cancel();
 		}
-		iMessageBox->ShowMessageL(contentptr);
-
+		else
+		{			
+			iNotifier = CDCMONotifierAob::NewL( );			
+		}
+		
+	  iNotifier->ShowNotifierL(contentptr);    
 	  CleanupStack::PopAndDestroy(3); //disableContent, enableContent, content
 	}	
 	RDEBUG("CDCMOServer::DoFinalizeL(): end");
@@ -602,6 +647,170 @@
 }
 
 // ----------------------------------------------------------------------------------------
+// CDCMOServer::GetPluginUids
+// Gets the plug-in adapter implementation uid if it present.
+// ----------------------------------------------------------------------------------------
+void CDCMOServer::GetLawmoPluginUidsL()
+{
+    RDEBUG("CDCMOServer::GetPluginUids(): begin");
+    ilawmoPluginUidToBeWiped.Reset();
+    RImplInfoPtrArray infoArray;
+    TEComResolverParams resolverParams;
+    // Note that a special cleanup function is required to reset and destroy
+    // all items in the array, and then close it.
+    TCleanupItem cleanup(CleanupEComArray, &infoArray);
+    CleanupStack::PushL(cleanup);
+    REComSession::ListImplementationsL(KLAWMOPluginInterfaceUid, resolverParams, KRomOnlyResolverUid, infoArray);
+    RLDEBUG("CDCMOServer::GetPluginUids(): listImpl");
+    // Loop through each info for each implementation           
+    for (TInt i=0; i< infoArray.Count(); i++)
+    {
+    ilawmoPluginUidToBeWiped.Append(infoArray[i]->ImplementationUid());
+    RLDEBUG("CDCMOServer::GetPluginUids(): for loop");
+    }
+    CleanupStack::PopAndDestroy(); //cleanup
+    RLDEBUG("CDCMOServer::GetPluginUids():end");
+    return;
+}
+
+TLawMoStatus CDCMOServer::WipeAllItem()
+    {
+    //Update ilawmopluginUid, so that all Node items are wiped.
+    //WipeItem doesn only on Uid's in the RArray.
+    TRAPD(error,GetLawmoPluginUidsL());
+    if(error == KErrNone)
+    return WipeItem();
+    else
+        return ELawMoWipeNotPerformed;
+    }
+
+TLawMoStatus CDCMOServer::WipeItem(TInt aValue)
+    {
+    RLDEBUG("CDCMOServer::WipeItem(): begin");
+    TLawMoStatus lawmostat(ELawMoAccepted);
+    iCount = 0;
+    if(ilawmoPluginUidToBeWiped.Count() > 0)
+        {
+		RLDEBUG_2("CDCMOServer::WipeItem got uid(): %d",ilawmoPluginUidToBeWiped[iCount]);
+        CLAWMOPluginInterface* obj;
+		RLDEBUG("CDCMOServer::WipeItem(): NewL");
+        TRAPD(err,obj = CLAWMOPluginInterface::NewL(ilawmoPluginUidToBeWiped[iCount], this));
+        if(err == KErrNone)
+            {
+            RLDEBUG("CDCMOServer::WipeItem(): obj created");
+            RLDEBUG_2("CDCMOServer::WipeItem plugin count: %d",ilawmoPlugins.Count());
+            TRAP(err,obj->WipeL());
+        RLDEBUG_2("CDCMOServer::WipeItem(): wipe called %d",err);
+        ilawmoPlugins.Append(obj);
+        // Get the IAP being used in the current session
+        TRAP( err, SmlHelper::GetDefaultIAPFromDMProfileL( iSessionIap ) );
+        RLDEBUG_2("CDCMOServer::HandleWipeCompleted(): get iap %d",iSessionIap);
+            }
+        if(err!=KErrNone)
+        HandleWipeCompleted(KErrGeneral);
+        }
+    else
+        {
+        lawmostat = ELawMoWipeNotPerformed;
+        }
+    
+    RLDEBUG("CDCMOServer::WipeItem(): End");
+    return lawmostat;
+    }
+
+TLawMoStatus CDCMOServer::GetListItemL(TDesC& item, TDes& strValue)
+{
+    RLDEBUG("CDCMOServer::GetListItem(): begin");
+    TEComResolverParams resolverParams;
+	TLawMoStatus lawmostat(ELawMoSuccess);
+    TBuf<KBufferSize> itemName;
+    RImplInfoPtrArray infoArray;
+    TCleanupItem cleanup(CleanupEComArray, &infoArray);
+    CleanupStack::PushL(cleanup);
+    REComSession::ListImplementationsL(KLAWMOPluginInterfaceUid, resolverParams, KRomOnlyResolverUid, infoArray);
+    RLDEBUG("CDCMOServer::GetListItem(): listImpl");
+
+    for (TInt i=0; i< infoArray.Count(); i++)
+        {   
+        RLDEBUG("CDCMOServer::GetListItem(): for loop");
+        TBuf<KBufferSize> temp;
+        temp.Copy(infoArray[i]->OpaqueData());
+        RLDEBUG_2("CDCMOServer::GetListItem opaque data to compare is %s", temp.PtrZ());
+        if(item == temp)
+            {
+                itemName.Copy(infoArray[i]->DisplayName());
+                RLDEBUG("CDCMOServer::GetListItem(): matched");
+                break;
+            }
+        }
+    CleanupStack::PopAndDestroy(); //cleanup
+    RLDEBUG_2("CDCMOServer::GetListItem display name is %s", itemName.PtrZ());
+    strValue.Zero();
+    strValue.Append(itemName);
+    RLDEBUG("CDCMOServer::GetListItem(): End");
+    return lawmostat;
+}
+
+
+TLawMoStatus CDCMOServer::GetToBeWipedL(TDesC& item, TDes& wipeValue)
+{
+    RLDEBUG("CDCMOServer::GetToBeWiped(): begin");
+    TLawMoStatus lawmostat(ELawMoSuccess);
+    TInt wipeVal(0);
+    TUid impluid = GetAdapterUidL(item, ETrue);
+    RLDEBUG_2("CDCMOServer::GetToBeWiped for uid(): %d", impluid);
+    TInt afind = ilawmoPluginUidToBeWiped.Find(impluid);
+    if(afind!=KErrNotFound)
+        {
+        wipeVal = 1;
+        RLDEBUG("CDCMOServer::GetToBeWiped(): uid in Rarray");
+        }
+    wipeValue.Zero();
+    wipeValue.Num(wipeVal);
+    RLDEBUG("CDCMOServer::GetToBeWiped(): End");
+    return lawmostat;
+}
+
+TLawMoStatus CDCMOServer::SetToBeWipedL(TDesC& item, TInt wipeValue)
+{
+    RLDEBUG("CDCMOServer::SetToBeWiped(): begin");
+    TLawMoStatus lawmostat(ELawMoSuccess);
+    TUid impluid = GetAdapterUidL(item, ETrue);
+    RLDEBUG_2("CDCMOServer::SetToBeWiped for uid(): %d", impluid);
+    TInt afind = ilawmoPluginUidToBeWiped.Find(impluid);
+    // Add Node's corresponding plugin uid to list so that it can be wiped
+    if(impluid.iUid)
+        {
+        if(wipeValue)
+            {
+            RLDEBUG("CDCMOServer::SetToBeWiped(): wipeVal true");
+            if(afind==KErrNotFound)
+                ilawmoPluginUidToBeWiped.Append(impluid);
+            else
+                RLDEBUG("CDCMOServer::SetToBeWiped() tobewiped already set");               
+            }
+        else
+            {
+            RLDEBUG("CDCMOServer::SetToBeWiped(): wipeVal false");        
+            if(afind!=KErrNotFound)
+                {
+                ilawmoPluginUidToBeWiped.Remove(afind);
+                RLDEBUG("CDCMOServer::SetToBeWiped() tobewiped unset");
+                }
+            else
+                RLDEBUG("CDCMOServer::SetToBeWiped() tobewiped notset atall");                
+            }
+        }
+    else
+        {
+        RLDEBUG("CDCMOServer::SetToBeWiped(): no such plugin found");
+        lawmostat = ELawMoFail;
+        }
+    RLDEBUG("CDCMOServer::SetToBeWiped(): End");
+    return lawmostat;
+}
+
+// ----------------------------------------------------------------------------------------
 // CDCMOServer::SetStarter
 // Sets the iStarter value
 // ----------------------------------------------------------------------------------------
@@ -612,21 +821,137 @@
 	RDEBUG("CDCMOServer::SetStarter(): end");
 }
 
-// ----------------------------------------------------------------------------------------
-// CDCMOServer::CleanDcmoArray
-// Sets the iStarter value
-// ----------------------------------------------------------------------------------------
-void CDCMOServer::CleanDcmoArray()
+void CDCMOServer::HandleWipeCompleted(TInt status)
 {
-	RDEBUG("CDCMOServer::CleanDcmoArray(): begin");
-	TInt count = idcmoArray.Count();  
-  RDEBUG_2("CDCMOServer::CleanDcmoArray; %d", count );
-	if(count)
-	{	
-		for(TInt i=0; i< count; i++)
-				delete idcmoArray[i].iCategoryName;
-		idcmoArray.Reset();
-	}
-	CDCMOMessageBox::SetMsgBoxStatus(EFalse);
-	RDEBUG("CDCMOServer::CleanDcmoArray(): end");
+    RLDEBUG("CDCMOServer::HandleWipeCompleted(): begin");
+    // whether wipe is performed or failed
+    iwipeStatus = (iwipeStatus && status);
+    RLDEBUG_2("CDCMOServer::HandleWipeCompleted wipestate: %d",iwipeStatus);
+    iCount++;
+    if(ilawmoPluginUidToBeWiped.Count()>iCount)
+        {
+        RLDEBUG("CDCMOServer::HandleWipeCompleted(): create obj");
+        CLAWMOPluginInterface* obj;
+        TRAPD(err, obj = CLAWMOPluginInterface::NewL(ilawmoPluginUidToBeWiped[iCount], this));
+        if(err == KErrNone)
+             {
+             RLDEBUG("CDCMOServer::HandleWipeCompleted(): obj created");
+             RLDEBUG_2("CDCMOServer::HandleWipeCompleted plugin count: %d",ilawmoPlugins.Count());
+            TRAP(err,obj->WipeL());
+        RLDEBUG_2("CDCMOServer::HandleWipeCompleted(): wipe called %d",err);
+        ilawmoPlugins.Append(obj);
+            }
+        if(err!=KErrNone)
+            HandleWipeCompleted(KErrGeneral);
+        }
+    else
+        {
+        // start DM session using the Monitor for generic alert
+        RLDEBUG("CDCMOServer::HandleWipeCompleted(): done");
+        TInt err;
+        TBuf<KBufferSize> srvrid; 
+        CRepository* crep;
+        TRAP(err, crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys );
+                         CleanupStack::Pop(crep));
+        RLDEBUG("CDCMOServer::HandleWipeCompleted(): get srvrid");
+        if(err == KErrNone)
+            err = crep->Get( KLAWMOfactoryDmServerID, srvrid );
+        RDEBUG_2("CDCMOServer::GetCurrentServerId() %d",err);
+        RLDEBUG_2("CDCMOServer::HandleWipeCompleted(): srvrid %s",srvrid.PtrZ());
+        if (err == KErrNone)
+            {
+            RLDEBUG("CDCMOServer::startNwMonitor()");
+            TRAP(err,StartDMNetworkMonitorL(srvrid, iSessionIap));
+            }
+        
+        if(crep)
+			{
+            delete crep; //crep
+			crep = NULL;
+			}
+        
+        // Only when session is started successfully, Set wipestatus
+        if(err==KErrNone)
+            {
+            RLDEBUG("CDCMOServer::HandleWipeCompleted(): writing wipestatus to cenrep");
+            CRepository* repository;
+            TRAP(err, repository = CRepository::NewLC ( KCRUidLawmoAdapter );
+                      CleanupStack::Pop(crep));
+            
+            if(iwipeStatus==KErrNone)
+            iwipeStatus = KWipeSuccess;
+            else
+            iwipeStatus = KWipeFailure;
+            
+            repository->Set(KLawmoWipeStatus,iwipeStatus);
+            RLDEBUG_2("CDCMOServer::HandleWipeCompleted wipestate: %d",iwipeStatus);
+            if (repository)
+				{
+	            delete repository;
+				repository = NULL;
+				}
+            }
+        
+        RLDEBUG_2("printing ilawmoPluginUidToBeWiped %d", ilawmoPluginUidToBeWiped.Count());
+        RLDEBUG_2("printing ilawmoPlugins %d", ilawmoPlugins.Count());
+        RLDEBUG_2("printing ilawmoPlugins %d", iCount);
+        iCount = -1; // To indicate all wipe is done
+        if( iSessionCount == 0)
+           {
+            CActiveScheduler::Stop();
+            RLDEBUG("CDCMOServer::HandleWipeCompleted(): kill server");
+            }        
+        }    
+    
+    RLDEBUG("CDCMOServer::HandleWipeCompleted(): end");
 }
+
+// ------------------------------------------------------------------------------------------------
+// CDCMOServer::StartDMNetworkMonitorL()
+// ------------------------------------------------------------------------------------------------
+void CDCMOServer::StartDMNetworkMonitorL(TDesC& aServerId, TInt iapid)
+{
+    TInt retryenabled = 1;
+    _LIT( KNetMon,"\\dmnetworkmon.exe" );
+    RLDEBUG("CDCMOServer::StartDMNetworkMonitorL(): start");
+    TBuf8<KBufferSize> serverid;
+    serverid.Copy(aServerId);
+    // Enable DM Network Monitoring for retry of Generic alert in case of N/W loss
+    
+    CRepository *repository= CRepository::NewLC ( KCRUidDeviceManagementInternalKeys );
+    repository->Set(KDevManEnableDMNetworkMon, retryenabled);
+    repository->Set(KDevManServerIdKey, serverid);
+    repository->Set(KDevManIapIdKey, iapid);
+    RLDEBUG("CDCMOServer::StartDMNetworkMonitorL(): set rep keys");
+    CleanupStack::PopAndDestroy();
+    
+    // create NetMon EXE
+    RProcess rp;
+    TInt err = rp.Create(KNetMon,KNullDesC);
+    RLDEBUG("CDCMOServer::StartDMNetworkMonitorL():create rprocess");
+    User::LeaveIfError(err);
+    TRequestStatus stat;
+    rp.Rendezvous(stat);
+    RLDEBUG("CDCMOServer::StartDMNetworkMonitorL():rendezvous");
+        
+    if (stat!=KRequestPending)
+        {
+        RLDEBUG("CDCMOServer::StartDMNetworkMonitorL():abort srvr");
+        rp.Kill(0);     // abort startup
+        }
+    else
+        {
+        RLDEBUG("CDCMOServer::StartDMNetworkMonitorL(): start server");
+        rp.Resume();    // logon OK - start the server
+        }
+    User::WaitForRequest(stat);     // wait for start or death
+    TInt r= rp.ExitType();
+    TInt reqstat  = stat.Int();
+    //TExitType a;
+    RLDEBUG_2("CDCMOServer::StartDMNetworkMonitorL() exittype %d",r);
+    RLDEBUG_2("CDCMOServer::StartDMNetworkMonitorL() reqstatus %d",reqstat);
+
+    rp.Close();
+}
+
+
--- a/dcmofw/dcmoserver/src/dcmosession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/dcmoserver/src/dcmosession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -19,9 +19,8 @@
 
 #include "dcmosession.h"
 #include "dcmoclientserver.h"
-#include "dcmomessagebox.h"
 #include "dcmodebug.h"
-
+#include "lawmodebug.h"
 
 // ----------------------------------------------------------------------------------------
 // CDCMOSession::CDCMOSession
@@ -69,15 +68,13 @@
 	RDEBUG_2("CDCMOSession::DispatchMessageL; %d", aMessage.Function() );
   TInt value; 
   TDCMOStatus statusValue;
+  TLawMoStatus lstatusValue;
   TDCMONode nodeValue;
   TPckg<TDCMOStatus> status(statusValue);
+  TPckg<TLawMoStatus> lstatus(lstatusValue);
   TPckg<TDCMONode> node(nodeValue);
   TPckg<TInt> intvalue(value);
   
-  if(CDCMOMessageBox::IsMsgBoxClosed())
-  	{
-  		Server().CleanDcmoArray();
-  	}
   HBufC*     category  = HBufC::NewLC(KDCMOMaxStringSize);
   TPtr       categoryptr  = category->Des(); 
   aMessage.Read (0, categoryptr);           
@@ -157,6 +154,88 @@
 						RDEBUG("CDCMOSession::DispatchMessageL - EDcmoSearchAdapter status " );
 	    	}
 	    	break;	
+	    case EWipe:
+	        {
+            //HBufC*     item  = HBufC::NewLC(KDCMOMaxStringSize);
+            //TPtr       itemPtr  = category->Des(); 
+            //aMessage.Read (0, itemPtr); 
+	        //aMessage.Complete(KErrNone);
+	        //RDEBUG("CDCMOSession::EWipe force complete the request");
+	        lstatusValue = Server().WipeItem(); 
+            aMessage.Write (0, lstatus);
+            //CleanupStack::PopAndDestroy();
+            RLDEBUG_2("CDCMOSession::DispatchMessageL EWipe %d", lstatusValue );
+	        }
+	        break;
+	        
+	    case EWipeAll:
+	        {
+	        //TInt aForce(1);
+	        lstatusValue = Server().WipeAllItem(); 
+	        aMessage.Write (0, lstatus);
+            RLDEBUG_2("CDCMOSession::DispatchMessageL EWipeAll %d", lstatusValue );
+	        }
+	        break;
+	        
+	    case EListItemName_Get:
+	        {
+	        HBufC*     buf1  = HBufC::NewLC(KDCMOMaxStringSize);
+	        TPtr       bufPtr1  = buf1->Des();
+	        HBufC*     item  = HBufC::NewLC(KDCMOMaxStringSize);
+	        TPtr       itemPtr  = item->Des(); 
+	        aMessage.Read (0, itemPtr); 
+	        lstatusValue = Server().GetListItemL(itemPtr, bufPtr1); 
+	        aMessage.Write (1, bufPtr1);
+	        aMessage.Write (2, lstatus);
+	        CleanupStack::PopAndDestroy(2);
+	        RLDEBUG_2("CDCMOSession::DispatchMessageL EListItemName_Get %d", lstatusValue );
+	        }
+	        break;
+	        
+	    case EToBeWiped_Get:
+	        {
+	        HBufC*     item  = HBufC::NewLC(KDCMOMaxStringSize);
+            TPtr       itemPtr  = item->Des();
+            HBufC*     buf1  = HBufC::NewLC(KDCMOMaxStringSize);
+            TPtr       bufPtr1  = buf1->Des();
+            aMessage.Read (0, itemPtr);
+            lstatusValue = Server().GetToBeWipedL(itemPtr, bufPtr1);
+            aMessage.Write (1, bufPtr1);
+            aMessage.Write (2, lstatus);
+            CleanupStack::PopAndDestroy(2);
+            RLDEBUG_2("CDCMOSession::DispatchMessageL EToBeWiped_Get %d", lstatusValue );
+	        }
+	        break;
+	            
+	      case EToBeWiped_Set:
+            {
+            //TLex lex;
+            //TInt val;
+            //TBuf<255> wipeValue;
+            HBufC*     item  = HBufC::NewLC(KDCMOMaxStringSize);
+            TPtr       itemPtr  = item->Des();
+            aMessage.Read (0, itemPtr);
+            TInt val = aMessage.Int1();
+            //aMessage.Read (1, wipeValue); 
+            RLDEBUG_2("Tobewiped category %s",itemPtr.PtrZ());
+            //lex.Assign( wipeValue );
+            //TInt err = lex.Val( val );
+            RLDEBUG_2("Tobewiped value,int %d", val );
+            //if(err==KErrNone)
+            //    {
+            //    RLDEBUG("SetToBeWiped call" );
+                lstatusValue = Server().SetToBeWipedL(itemPtr, val);
+            //    }
+            //else
+            //    {
+            //    RLDEBUG("SetToBeWiped not" );
+            //    lstatusValue = ELawMoFail;
+            //    }
+            aMessage.Write (2, lstatus);
+            CleanupStack::PopAndDestroy();  
+            RLDEBUG_2("CDCMOSession::DispatchMessageL EToBeWiped_Set %d", lstatusValue );
+            }
+            break;
 	    default :
 	    		RDEBUG("CDCMOSession::DispatchMessageL- Case Not Found" );
 	    }	  
--- a/dcmofw/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -18,8 +18,10 @@
 
 PRJ_EXPORTS
 ../rom/dcmofw.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(dcmofw.iby)
+../rom/dcmofwresources.iby			LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(dcmofwresources.iby)
 
 PRJ_MMPFILES
 #include "../dcmoclient/group/bld.inf"
 #include "../dcmoserver/group/bld.inf"
 #include "../dcmocustcmd/group/bld.inf"
+#include "../lawmoclient/group/bld.inf"
\ No newline at end of file
--- a/dcmofw/inc/dcmoclientserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/inc/dcmoclientserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -39,4 +39,15 @@
 	EDcmoSearchAdapter
 	};
 
+enum TLawmoControlMessages
+    {
+    ECreateSubSession = 10,
+    ECloseSubSession,
+    EListItemName_Get,
+    EToBeWiped_Get, 
+    EToBeWiped_Set,
+    EWipe,
+    EWipeAll,
+    ENotUsed
+    };
 #endif// __DCMOCLIENTSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/inc/lawmodebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of terminalsecurity components
+*
+*/
+
+
+#ifndef _LAW_DEBUG_HEADER_
+#define _LAW_DEBUG_HEADER_
+
+#include <f32file.h>
+#include <flogger.h>
+// CONSTANTS
+_LIT( KLawLogFolderName, "law" );
+_LIT( KLawLogFileName, "law.log" );
+// MACROS
+#ifdef _DEBUG
+#define _LAW_FILE_DEBUG
+#endif
+
+#ifdef _LAW_FILE_DEBUG
+		#define RLDEBUG(X)					RFileLogger::Write( KLawLogFolderName, KLawLogFileName, EFileLoggingModeAppend, _L(X) )
+		#define RLDEBUG_2(X,Y)			RFileLogger::WriteFormat( KLawLogFolderName, KLawLogFileName, EFileLoggingModeAppend, _L(X),Y )	
+		#define RLDEBUG_3(X,Y,Z)	  RFileLogger::WriteFormat( KLawLogFolderName, KLawLogFileName, EFileLoggingModeAppend, _L(X),Y,Z )	
+#else
+
+	#if defined (_DEBUG)
+		#define RLDEBUG(X)								RDebug::Print(_L(X))
+		#define RLDEBUG_2(X,Y)						RDebug::Print(_L(X),Y)
+		#define RLDEBUG_3(X,Y,Z)					RDebug::Print(_L(X),Y,Z)
+	#else
+		#define RLDEBUG(X)								
+		#define RLDEBUG_2(X,Y)						
+		#define RLDEBUG_3(X,Y,Z)	
+	#endif // _DEBUG
+	
+#endif // _LAW_FILE_DEBUG
+
+
+
+
+#endif // _LAW_DEBUG_HEADER_
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/lawmoclient/bwins/lawmoclientu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,9 @@
+EXPORTS
+	?SetToBeWipedValue@RLawmoClient@@QAEHAAVTDes16@@H@Z @ 1 NONAME ; int RLawmoClient::SetToBeWipedValue(class TDes16 &, int)
+	?GetListItemName@RLawmoClient@@QAEHAAVTDes16@@0@Z @ 2 NONAME ; int RLawmoClient::GetListItemName(class TDes16 &, class TDes16 &)
+	?GetToBeWipedValue@RLawmoClient@@QAEHAAVTDes16@@AAH@Z @ 3 NONAME ; int RLawmoClient::GetToBeWipedValue(class TDes16 &, int &)
+	?DeviceWipe@RLawmoClient@@QAE?AW4TLawMoStatus@@XZ @ 4 NONAME ; enum TLawMoStatus RLawmoClient::DeviceWipe(void)
+	?Connect@RLawmoClient@@QAEHXZ @ 5 NONAME ; int RLawmoClient::Connect(void)
+	?DeviceWipeAll@RLawmoClient@@QAE?AW4TLawMoStatus@@XZ @ 6 NONAME ; enum TLawMoStatus RLawmoClient::DeviceWipeAll(void)
+	?Close@RLawmoClient@@QAEXXZ @ 7 NONAME ; void RLawmoClient::Close(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/lawmoclient/eabi/lawmoclientu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN12RLawmoClient10DeviceWipeEv @ 1 NONAME
+	_ZN12RLawmoClient13DeviceWipeAllEv @ 2 NONAME
+	_ZN12RLawmoClient15GetListItemNameER6TDes16S1_ @ 3 NONAME
+	_ZN12RLawmoClient17GetToBeWipedValueER6TDes16Ri @ 4 NONAME
+	_ZN12RLawmoClient17SetToBeWipedValueER6TDes16i @ 5 NONAME
+	_ZN12RLawmoClient5CloseEv @ 6 NONAME
+	_ZN12RLawmoClient7ConnectEv @ 7 NONAME
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/lawmoclient/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,20 @@
+/*
+* 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 file provides building information for DCMO Client.
+*
+*/
+
+
+PRJ_MMPFILES
+lawmoclient.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/lawmoclient/group/lawmoclient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* 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:  DCMO Client for DCMO framework
+*
+*/
+
+#include <platform_paths.hrh>
+#include "defaultcaps.hrh"
+
+CAPABILITY      CAP_CLIENT_DLL
+TARGET          lawmoclient.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x2002EA20
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          lawmoclient.cpp
+
+MW_LAYER_SYSTEMINCLUDE
+USERINCLUDE     .
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc   
+
+LIBRARY         euser.lib
+LIBRARY         featmgr.lib
+LIBRARY       	flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/lawmoclient/src/lawmoclient.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  LAWMO Client implementation
+*
+*/
+
+#include <e32svr.h>
+#include <featmgr.h>
+#include "dcmoclientserver.h"
+#include "lawmoclient.h"
+#include "lawmodebug.h"
+// Standard server startup code
+// 
+static TInt StartServer()
+	{
+	RLDEBUG("from lawmoclient ->starting dcmo server...");
+	
+	// EPOC and EKA 2 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 r=server.Create(KDCMOServerName,KNullDesC);
+
+	if (r!=KErrNone)
+		{
+		RLDEBUG_2("lawmoclient -> server start failed %d",r);
+		return r;
+		}
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat!=KRequestPending)
+		server.Kill(0);		// abort startup
+	else
+		server.Resume();	// logon OK - start the server
+	RLDEBUG("lawmoclient -> dcmoserver Started");
+	User::WaitForRequest(stat);		// wait for start or death
+	// we can't use the 'exit reason' if the server panicked as this
+	// is the panic 'reason' and may be '0' which cannot be distinguished
+	// from KErrNone
+	r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+	server.Close();
+	return r;
+	}
+
+
+// This is the standard retry pattern for server connection
+EXPORT_C TInt RLawmoClient::Connect()
+    {
+    RLDEBUG("RLawmoClient: connect...");
+    TInt retry=2;
+    for (;;)
+        {
+        TInt r=CreateSession(KDCMOServerName,TVersion(0,0,0),1);
+        if (r!=KErrNotFound && r!=KErrServerTerminated)
+            return r;
+        if (--retry==0)
+            return r;
+        RLDEBUG("RLawmoClient: to start server...");
+        r=StartServer();
+        if (r!=KErrNone && r!=KErrAlreadyExists)
+            return r;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RLawmoClient::Close()
+// ---------------------------------------------------------------------------
+EXPORT_C void RLawmoClient::Close()
+	{
+	RLDEBUG(" RLawmoClient::Close");
+	RSessionBase::Close();  //basecall
+	   RLDEBUG(" RLawmoClient::close done");
+	}
+
+// ----------------------------------------------------------------------------------------
+// RLawmoClient::DeviceWipeL
+// ----------------------------------------------------------------------------------------
+EXPORT_C TLawMoStatus RLawmoClient::DeviceWipe()
+    {
+    RLDEBUG("RLawmoClient::DeviceWipe Begin");
+    TLawMoStatus status(ELawMoAccepted);
+    TPckg<TLawMoStatus> statusValue(status);
+    TInt err = SendReceive(EWipe,TIpcArgs(&statusValue));
+    //TInt err = SendReceive(EWipe);
+    if(err != KErrNone)
+        status = ELawMoWipeNotPerformed;
+    RLDEBUG("RLawmoClient::DeviceWipe End");
+    return status;
+    }
+
+// ----------------------------------------------------------------------------------------
+// RLawmoClient::DeviceWipeAll
+// ----------------------------------------------------------------------------------------
+EXPORT_C TLawMoStatus RLawmoClient::DeviceWipeAll( )
+    {
+    RLDEBUG("RLawmoClient::DeviceWipeAll Begin");
+    TLawMoStatus status(ELawMoSuccess);
+    TPckg<TLawMoStatus> statusValue(status);
+    TInt err = SendReceive( EWipeAll,TIpcArgs(&statusValue) );
+    if(err != KErrNone)//if sendreceive itself failed
+        status = ELawMoWipeFailed;
+    RLDEBUG("RLawmoClient::DeviceWipeAll End");
+    return status;
+    }
+
+// ----------------------------------------------------------------------------------------
+// RLawmoClient::SetPasscodeMaxAttempts
+// ----------------------------------------------------------------------------------------
+EXPORT_C TInt RLawmoClient::GetListItemName( TDes& aItemName, TDes& aNodeValue )
+    {
+    RLDEBUG("RLawmoClient::GetListItemName Begin");    
+    
+    TIpcArgs args1;
+    TLawMoStatus status(ELawMoOk);
+    
+    args1.Set( 0, &aItemName );
+    args1.Set( 1, &aNodeValue );
+    args1.Set( 2, status);
+    TInt err = SendReceive( EListItemName_Get, args1 );
+    if(err != KErrNone)
+        status = ELawMoInvalid;   
+    RLDEBUG("RLawmoClient::GetListItemName End");    
+    return status;
+    }
+
+EXPORT_C TInt RLawmoClient::GetToBeWipedValue( TDes& aItemName, TBool& aWipeVal )
+    {
+    RLDEBUG("RLawmoClient::GetToBeWipedValue Begin");    
+    
+    TIpcArgs args1;
+    TBuf<255> wipeValue;
+    TLex lex;
+    
+    TLawMoStatus status(ELawMoOk);
+    
+    args1.Set( 0, &aItemName );
+    args1.Set( 1, &wipeValue );
+    args1.Set( 2, status);
+    
+    TInt err = SendReceive( EToBeWiped_Get, args1 );
+    
+    if( err == KErrNone )
+        {
+        lex.Assign( wipeValue );
+        err = lex.Val( aWipeVal );
+        }
+    if(err != KErrNone)
+        status = ELawMoInvalid;
+    
+    RLDEBUG("RLawmoClient::GetToBeWipedValue End");    
+    return status;
+    }
+
+EXPORT_C TInt RLawmoClient::SetToBeWipedValue( TDes& aItemName, TInt aWipeVal )
+    {
+    RLDEBUG("RLawmoClient::SetToBeWipedValue Begin");        
+    TIpcArgs args1;    
+    TLawMoStatus status(ELawMoOk);
+    
+    args1.Set( 0, &aItemName );
+    args1.Set( 1, aWipeVal );
+    args1.Set( 2, status);
+    
+    TInt err = SendReceive( EToBeWiped_Set, args1 );
+    
+    if(err != KErrNone)
+        status = ELawMoInvalid;
+    
+    RLDEBUG("RLawmoClient::SetToBeWipedValue End");    
+    return status;
+    }
+// ----------------------------------------------------------------------------------------
+// RLawmoClient::SetPasscodeMaxAttempts
+// ----------------------------------------------------------------------------------------
+/*EXPORT_C TInt RLawmoClient::GetLawMoState( TDes& aState )
+    {
+    RLDEBUG("RLawmoClient::GetLawMoState Begin");
+    
+    TLawMoStatus status(ELawMoSuccess);
+    TIpcArgs args1;    
+    args1.Set( 0, &aState );
+    args1.Set( 1, status);
+    TInt err = SendReceive( EState, args1 );
+      
+    if(err != KErrNone)
+        status = ELawMoFail;
+    
+    RLDEBUG("RLawmoClient::GetLawMoState End");
+    return status;
+    }*/
--- a/dcmofw/rom/dcmofw.iby	Tue Aug 31 16:04:06 2010 +0300
+++ b/dcmofw/rom/dcmofw.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -20,13 +20,17 @@
 #define _DCMOFW_IBY_
 
 file=ABI_DIR\BUILD_DIR\dcmoclient.dll		SHARED_LIB_DIR\dcmoclient.dll
+#ifdef FF_OMA_LAWMO
+file=ABI_DIR\BUILD_DIR\lawmoclient.dll		SHARED_LIB_DIR\lawmoclient.dll
+#endif
 
-#ifdef FF_RUNTIME_DEVICE_CAPABILITY_CONFIGURATION
+#if defined(FF_RUNTIME_DEVICE_CAPABILITY_CONFIGURATION) || defined(FF_OMA_LAWMO)
 data=DATAZ_\RESOURCE_FILES_DIR\dcmo.rsc	RESOURCE_FILES_DIR\dcmo.rsc
 file=ABI_DIR\BUILD_DIR\dcmoserver.exe		PROGRAMS_DIR\dcmoserver.exe
 
 data=\epoc32\data\Z\private\10202BE9\2001FE47.txt       private\10202BE9\2001FE47.txt
 data=\epoc32\data\Z\private\10202BE9\2000253D.txt       private\10202BE9\2000253D.txt
 #endif
+
 #endif
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/rom/dcmofwresources.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image description file for project dcmofw
+*
+*/
+
+
+#ifndef _DCMOFWRESOURCES_IBY_
+#define _DCMOFWRESOURCES_IBY_
+
+
+#if defined(FF_RUNTIME_DEVICE_CAPABILITY_CONFIGURATION) || defined(FF_OMA_LAWMO)
+data=DATAZ_\RESOURCE_FILES_DIR\dcmo.rsc	RESOURCE_FILES_DIR\dcmo.rsc
+#endif
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/bwins/diagframework.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,63 @@
+EXPORTS
+	??0TDiagSuiteExecParam@@QAE@AAVMDiagSuiteObserver@@AAVMDiagEngineCommon@@@Z @ 1 NONAME ; TDiagSuiteExecParam::TDiagSuiteExecParam(class MDiagSuiteObserver &, class MDiagEngineCommon &)
+	??0TDiagTestExecParam@@QAE@AAVMDiagTestObserver@@AAVMDiagEngineCommon@@@Z @ 2 NONAME ; TDiagTestExecParam::TDiagTestExecParam(class MDiagTestObserver &, class MDiagEngineCommon &)
+	??1CDiagEngine@@UAE@XZ @ 3 NONAME ; CDiagEngine::~CDiagEngine(void)
+	??1CDiagLogEventEraser@@UAE@XZ @ 4 NONAME ; CDiagLogEventEraser::~CDiagLogEventEraser(void)
+	??1CDiagNetworkRegStatusWatcher@@UAE@XZ @ 5 NONAME ; CDiagNetworkRegStatusWatcher::~CDiagNetworkRegStatusWatcher(void)
+	??1CDiagPluginConstructionParam@@UAE@XZ @ 6 NONAME ; CDiagPluginConstructionParam::~CDiagPluginConstructionParam(void)
+	??1CDiagPluginPool@@UAE@XZ @ 7 NONAME ; CDiagPluginPool::~CDiagPluginPool(void)
+	?CancelLoadPluginsL@CDiagPluginPool@@QAEXXZ @ 8 NONAME ; void CDiagPluginPool::CancelLoadPluginsL(void)
+	?CreatePluginL@CDiagPluginPool@@SAPAVMDiagPlugin@@VTUid@@@Z @ 9 NONAME ; class MDiagPlugin * CDiagPluginPool::CreatePluginL(class TUid)
+	?CreateSimpleDbItemL@CDiagResultsDbItemBuilder@@SAPAVCDiagResultsDatabaseItem@@VTUid@@HW4TResult@2@@Z @ 10 NONAME ; class CDiagResultsDatabaseItem * CDiagResultsDbItemBuilder::CreateSimpleDbItemL(class TUid, int, enum CDiagResultsDatabaseItem::TResult)
+	?Engine@TDiagSuiteExecParam@@QBEAAVMDiagEngineCommon@@XZ @ 11 NONAME ; class MDiagEngineCommon & TDiagSuiteExecParam::Engine(void) const
+	?Engine@TDiagTestExecParam@@QBEAAVMDiagEngineCommon@@XZ @ 12 NONAME ; class MDiagEngineCommon & TDiagTestExecParam::Engine(void) const
+	?EraseLogsL@CDiagLogEventEraser@@QAEXXZ @ 13 NONAME ; void CDiagLogEventEraser::EraseLogsL(void)
+	?ExecuteL@CDiagEngine@@QAEXXZ @ 14 NONAME ; void CDiagEngine::ExecuteL(void)
+	?Filter@CDiagLogEventEraser@@QAEAAVCLogFilter@@XZ @ 15 NONAME ; class CLogFilter & CDiagLogEventEraser::Filter(void)
+	?FindPlugin@CDiagPluginPool@@QBEHABVTDesC16@@AAPAVMDiagPlugin@@@Z @ 16 NONAME ; int CDiagPluginPool::FindPlugin(class TDesC16 const &, class MDiagPlugin * &) const
+	?FindPlugin@CDiagPluginPool@@QBEHVTUid@@AAPAVMDiagPlugin@@@Z @ 17 NONAME ; int CDiagPluginPool::FindPlugin(class TUid, class MDiagPlugin * &) const
+	?FindPluginL@CDiagPluginPool@@QBEAAVMDiagPlugin@@ABVTDesC16@@@Z @ 18 NONAME ; class MDiagPlugin & CDiagPluginPool::FindPluginL(class TDesC16 const &) const
+	?FindPluginL@CDiagPluginPool@@QBEAAVMDiagPlugin@@VTUid@@@Z @ 19 NONAME ; class MDiagPlugin & CDiagPluginPool::FindPluginL(class TUid) const
+	?GetCurrentTime@CDiagResultsDbItemBuilder@@QBE?AVTTime@@XZ @ 20 NONAME ; class TTime CDiagResultsDbItemBuilder::GetCurrentTime(void) const
+	?GetPluginDependencyL@CDiagEngine@@QAEHXZ @ 21 NONAME ; int CDiagEngine::GetPluginDependencyL(void)
+	?LoadAsyncL@CDiagPluginPool@@QAEXVTUid@@@Z @ 22 NONAME ; void CDiagPluginPool::LoadAsyncL(class TUid)
+	?LogClient@CDiagLogEventEraser@@QAEAAVCLogClient@@XZ @ 23 NONAME ; class CLogClient & CDiagLogEventEraser::LogClient(void)
+	?NewL@CDiagEngine@@SAPAV1@AAVCAknViewAppUi@@AAVMDiagEngineObserver@@AAVRDiagResultsDatabase@@AAVCDiagPluginPool@@HABV?$RArray@VTUid@@@@@Z @ 24 NONAME ; class CDiagEngine * CDiagEngine::NewL(class CAknViewAppUi &, class MDiagEngineObserver &, class RDiagResultsDatabase &, class CDiagPluginPool &, int, class RArray<class TUid> const &)
+	?NewL@CDiagEngine@@SAPAV1@AAVCAknViewAppUi@@AAVMDiagEngineObserver@@AAVRDiagResultsDatabase@@AAVCDiagPluginPool@@VTUid@@@Z @ 25 NONAME ; class CDiagEngine * CDiagEngine::NewL(class CAknViewAppUi &, class MDiagEngineObserver &, class RDiagResultsDatabase &, class CDiagPluginPool &, class TUid)
+	?NewL@CDiagLogEventEraser@@SAPAV1@AAVMDiagLogEventEraserObserver@@PAVCLogFilter@@@Z @ 26 NONAME ; class CDiagLogEventEraser * CDiagLogEventEraser::NewL(class MDiagLogEventEraserObserver &, class CLogFilter *)
+	?NewL@CDiagNetworkRegStatusWatcher@@SAPAV1@AAVMDiagNetworkRegStatusObserver@@@Z @ 27 NONAME ; class CDiagNetworkRegStatusWatcher * CDiagNetworkRegStatusWatcher::NewL(class MDiagNetworkRegStatusObserver &)
+	?NewL@CDiagPluginConstructionParam@@SAPAV1@PAVHBufC16@@PAVCDesC16ArrayFlat@@HVTUid@@2@Z @ 28 NONAME ; class CDiagPluginConstructionParam * CDiagPluginConstructionParam::NewL(class HBufC16 *, class CDesC16ArrayFlat *, int, class TUid, class TUid)
+	?NewL@CDiagPluginPool@@SAPAV1@AAVMDiagPluginPoolObserver@@@Z @ 29 NONAME ; class CDiagPluginPool * CDiagPluginPool::NewL(class MDiagPluginPoolObserver &)
+	?NewL@CDiagResultsDbItemBuilder@@SAPAV1@VTUid@@H@Z @ 30 NONAME ; class CDiagResultsDbItemBuilder * CDiagResultsDbItemBuilder::NewL(class TUid, int)
+	?NewLC@CDiagEngine@@SAPAV1@AAVCAknViewAppUi@@AAVMDiagEngineObserver@@AAVRDiagResultsDatabase@@AAVCDiagPluginPool@@HABV?$RArray@VTUid@@@@@Z @ 31 NONAME ; class CDiagEngine * CDiagEngine::NewLC(class CAknViewAppUi &, class MDiagEngineObserver &, class RDiagResultsDatabase &, class CDiagPluginPool &, int, class RArray<class TUid> const &)
+	?NewLC@CDiagEngine@@SAPAV1@AAVCAknViewAppUi@@AAVMDiagEngineObserver@@AAVRDiagResultsDatabase@@AAVCDiagPluginPool@@VTUid@@@Z @ 32 NONAME ; class CDiagEngine * CDiagEngine::NewLC(class CAknViewAppUi &, class MDiagEngineObserver &, class RDiagResultsDatabase &, class CDiagPluginPool &, class TUid)
+	?NewLC@CDiagPluginConstructionParam@@SAPAV1@PAVHBufC16@@PAVCDesC16ArrayFlat@@HVTUid@@2@Z @ 33 NONAME ; class CDiagPluginConstructionParam * CDiagPluginConstructionParam::NewLC(class HBufC16 *, class CDesC16ArrayFlat *, int, class TUid, class TUid)
+	?NewLC@CDiagPluginPool@@SAPAV1@AAVMDiagPluginPoolObserver@@@Z @ 34 NONAME ; class CDiagPluginPool * CDiagPluginPool::NewLC(class MDiagPluginPoolObserver &)
+	?NewLC@CDiagResultsDbItemBuilder@@SAPAV1@VTUid@@H@Z @ 35 NONAME ; class CDiagResultsDbItemBuilder * CDiagResultsDbItemBuilder::NewLC(class TUid, int)
+	?Observer@TDiagSuiteExecParam@@QBEAAVMDiagSuiteObserver@@XZ @ 36 NONAME ; class MDiagSuiteObserver & TDiagSuiteExecParam::Observer(void) const
+	?Observer@TDiagTestExecParam@@QBEAAVMDiagTestObserver@@XZ @ 37 NONAME ; class MDiagTestObserver & TDiagTestExecParam::Observer(void) const
+	?Order@CDiagPluginConstructionParam@@QBEHXZ @ 38 NONAME ; int CDiagPluginConstructionParam::Order(void) const
+	?ParentUid@CDiagPluginConstructionParam@@QBE?AVTUid@@XZ @ 39 NONAME ; class TUid CDiagPluginConstructionParam::ParentUid(void) const
+	?ResultDetail@CDiagResultsDbItemBuilder@@QBEAAVMDiagResultDetail@@XZ @ 40 NONAME ; class MDiagResultDetail & CDiagResultsDbItemBuilder::ResultDetail(void) const
+	?ResumeL@CDiagEngine@@QAEXXZ @ 41 NONAME ; void CDiagEngine::ResumeL(void)
+	?ServiceProvided@CDiagPluginConstructionParam@@QBEABVTDesC16@@XZ @ 42 NONAME ; class TDesC16 const & CDiagPluginConstructionParam::ServiceProvided(void) const
+	?ServicesRequired@CDiagPluginConstructionParam@@QBEABVCDesC16ArrayFlat@@XZ @ 43 NONAME ; class CDesC16ArrayFlat const & CDiagPluginConstructionParam::ServicesRequired(void) const
+	?SetCustomParam@CDiagEngine@@QAEXPAX@Z @ 44 NONAME ; void CDiagEngine::SetCustomParam(void *)
+	?SetResultDetail@CDiagResultsDbItemBuilder@@QAEXPAVMDiagResultDetail@@@Z @ 45 NONAME ; void CDiagResultsDbItemBuilder::SetResultDetail(class MDiagResultDetail *)
+	?SetTestCompleted@CDiagResultsDbItemBuilder@@QAEXW4TResult@CDiagResultsDatabaseItem@@@Z @ 46 NONAME ; void CDiagResultsDbItemBuilder::SetTestCompleted(enum CDiagResultsDatabaseItem::TResult)
+	?SetTestUid@CDiagResultsDbItemBuilder@@QAEXVTUid@@@Z @ 47 NONAME ; void CDiagResultsDbItemBuilder::SetTestUid(class TUid)
+	?SetTimeCompleted@CDiagResultsDbItemBuilder@@QAEXVTTime@@@Z @ 48 NONAME ; void CDiagResultsDbItemBuilder::SetTimeCompleted(class TTime)
+	?SetTimeStarted@CDiagResultsDbItemBuilder@@QAEXVTTime@@@Z @ 49 NONAME ; void CDiagResultsDbItemBuilder::SetTimeStarted(class TTime)
+	?SetWasDependency@CDiagResultsDbItemBuilder@@QAEXH@Z @ 50 NONAME ; void CDiagResultsDbItemBuilder::SetWasDependency(int)
+	?StartAsyncEraseLogsL@CDiagLogEventEraser@@QAEXXZ @ 51 NONAME ; void CDiagLogEventEraser::StartAsyncEraseLogsL(void)
+	?StartObserver@CDiagNetworkRegStatusWatcher@@QAEXXZ @ 52 NONAME ; void CDiagNetworkRegStatusWatcher::StartObserver(void)
+	?StopObserver@CDiagNetworkRegStatusWatcher@@QAEXXZ @ 53 NONAME ; void CDiagNetworkRegStatusWatcher::StopObserver(void)
+	?SuspendL@CDiagEngine@@QAEXXZ @ 54 NONAME ; void CDiagEngine::SuspendL(void)
+	?TestResult@CDiagResultsDbItemBuilder@@QBE?AW4TResult@CDiagResultsDatabaseItem@@XZ @ 55 NONAME ; enum CDiagResultsDatabaseItem::TResult CDiagResultsDbItemBuilder::TestResult(void) const
+	?TestUid@CDiagResultsDbItemBuilder@@QBE?AVTUid@@XZ @ 56 NONAME ; class TUid CDiagResultsDbItemBuilder::TestUid(void) const
+	?TimeCompleted@CDiagResultsDbItemBuilder@@QBE?AVTTime@@XZ @ 57 NONAME ; class TTime CDiagResultsDbItemBuilder::TimeCompleted(void) const
+	?TimeStarted@CDiagResultsDbItemBuilder@@QBE?AVTTime@@XZ @ 58 NONAME ; class TTime CDiagResultsDbItemBuilder::TimeStarted(void) const
+	?ToResultsDatabaseItemL@CDiagResultsDbItemBuilder@@QBEPAVCDiagResultsDatabaseItem@@XZ @ 59 NONAME ; class CDiagResultsDatabaseItem * CDiagResultsDbItemBuilder::ToResultsDatabaseItemL(void) const
+	?Uid@CDiagPluginConstructionParam@@QBE?AVTUid@@XZ @ 60 NONAME ; class TUid CDiagPluginConstructionParam::Uid(void) const
+	?WasDependency@CDiagResultsDbItemBuilder@@QBEHXZ @ 61 NONAME ; int CDiagResultsDbItemBuilder::WasDependency(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/cenrep_files/clean_cenrep.bat	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,17 @@
+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 "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+rd /s /q output
Binary file devicediagnosticsfw/diagframework/cenrep_files/keys_diagnosticsfw.xls has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/cenrep_files/make_cenrep.bat	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,35 @@
+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 "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+@set XLS_FILE=keys_diagnosticsfw.xls
+@set INI_FILE=2000B16B.txt
+@set RELEASE=3.2
+
+@set CENREP_DIR=%CD%
+@cd \epoc32\tools\cenrep
+
+cenrep.pl -o "%CENREP_DIR%\output" -l "%CENREP_DIR%\%XLS_FILE%" -p %RELEASE%
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\winscw\udeb\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\winscw\udeb\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\winscw\urel\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\armv5\udeb\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\armv5\urel\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\data\Z\private\10202be9\
+@cd "%CENREP_DIR%"
+
+@echo ================= done. Hit any key to continue ==================
+@pause
+
Binary file devicediagnosticsfw/diagframework/cenrep_files/output/inifiles/2000B16B.txt has changed
Binary file devicediagnosticsfw/diagframework/cenrep_files/output/key_sheets_info.storable has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/cenrep_files/output/rfs/cenrep_rfs.txt	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1 @@
+ÿþ
\ No newline at end of file
Binary file devicediagnosticsfw/diagframework/conf/diagnosticsfw.confml has changed
Binary file devicediagnosticsfw/diagframework/conf/diagnosticsfw_2000B16B.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/eabi/diagframework.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,77 @@
+EXPORTS
+	_ZN11CDiagEngine14SetCustomParamEPv @ 1 NONAME
+	_ZN11CDiagEngine20GetPluginDependencyLEv @ 2 NONAME
+	_ZN11CDiagEngine4NewLER13CAknViewAppUiR19MDiagEngineObserverR20RDiagResultsDatabaseR15CDiagPluginPool4TUid @ 3 NONAME
+	_ZN11CDiagEngine4NewLER13CAknViewAppUiR19MDiagEngineObserverR20RDiagResultsDatabaseR15CDiagPluginPooliRK6RArrayI4TUidE @ 4 NONAME
+	_ZN11CDiagEngine5NewLCER13CAknViewAppUiR19MDiagEngineObserverR20RDiagResultsDatabaseR15CDiagPluginPool4TUid @ 5 NONAME
+	_ZN11CDiagEngine5NewLCER13CAknViewAppUiR19MDiagEngineObserverR20RDiagResultsDatabaseR15CDiagPluginPooliRK6RArrayI4TUidE @ 6 NONAME
+	_ZN11CDiagEngine7ResumeLEv @ 7 NONAME
+	_ZN11CDiagEngine8ExecuteLEv @ 8 NONAME
+	_ZN11CDiagEngine8SuspendLEv @ 9 NONAME
+	_ZN11CDiagEngineD0Ev @ 10 NONAME
+	_ZN11CDiagEngineD1Ev @ 11 NONAME
+	_ZN11CDiagEngineD2Ev @ 12 NONAME
+	_ZN15CDiagPluginPool10LoadAsyncLE4TUid @ 13 NONAME
+	_ZN15CDiagPluginPool13CreatePluginLE4TUid @ 14 NONAME
+	_ZN15CDiagPluginPool18CancelLoadPluginsLEv @ 15 NONAME
+	_ZN15CDiagPluginPool4NewLER23MDiagPluginPoolObserver @ 16 NONAME
+	_ZN15CDiagPluginPool5NewLCER23MDiagPluginPoolObserver @ 17 NONAME
+	_ZN15CDiagPluginPoolD0Ev @ 18 NONAME
+	_ZN15CDiagPluginPoolD1Ev @ 19 NONAME
+	_ZN15CDiagPluginPoolD2Ev @ 20 NONAME
+	_ZN18TDiagTestExecParamC1ER17MDiagTestObserverR17MDiagEngineCommon @ 21 NONAME
+	_ZN18TDiagTestExecParamC2ER17MDiagTestObserverR17MDiagEngineCommon @ 22 NONAME
+	_ZN19CDiagLogEventEraser10EraseLogsLEv @ 23 NONAME
+	_ZN19CDiagLogEventEraser20StartAsyncEraseLogsLEv @ 24 NONAME
+	_ZN19CDiagLogEventEraser4NewLER27MDiagLogEventEraserObserverP10CLogFilter @ 25 NONAME
+	_ZN19CDiagLogEventEraser6FilterEv @ 26 NONAME
+	_ZN19CDiagLogEventEraser9LogClientEv @ 27 NONAME
+	_ZN19CDiagLogEventEraserD0Ev @ 28 NONAME
+	_ZN19CDiagLogEventEraserD1Ev @ 29 NONAME
+	_ZN19CDiagLogEventEraserD2Ev @ 30 NONAME
+	_ZN19TDiagSuiteExecParamC1ER18MDiagSuiteObserverR17MDiagEngineCommon @ 31 NONAME
+	_ZN19TDiagSuiteExecParamC2ER18MDiagSuiteObserverR17MDiagEngineCommon @ 32 NONAME
+	_ZN25CDiagResultsDbItemBuilder10SetTestUidE4TUid @ 33 NONAME
+	_ZN25CDiagResultsDbItemBuilder14SetTimeStartedE5TTime @ 34 NONAME
+	_ZN25CDiagResultsDbItemBuilder15SetResultDetailEP17MDiagResultDetail @ 35 NONAME
+	_ZN25CDiagResultsDbItemBuilder16SetTestCompletedEN24CDiagResultsDatabaseItem7TResultE @ 36 NONAME
+	_ZN25CDiagResultsDbItemBuilder16SetTimeCompletedE5TTime @ 37 NONAME
+	_ZN25CDiagResultsDbItemBuilder16SetWasDependencyEi @ 38 NONAME
+	_ZN25CDiagResultsDbItemBuilder19CreateSimpleDbItemLE4TUidiN24CDiagResultsDatabaseItem7TResultE @ 39 NONAME
+	_ZN25CDiagResultsDbItemBuilder4NewLE4TUidi @ 40 NONAME
+	_ZN25CDiagResultsDbItemBuilder5NewLCE4TUidi @ 41 NONAME
+	_ZN28CDiagNetworkRegStatusWatcher12StopObserverEv @ 42 NONAME
+	_ZN28CDiagNetworkRegStatusWatcher13StartObserverEv @ 43 NONAME
+	_ZN28CDiagNetworkRegStatusWatcher4NewLER29MDiagNetworkRegStatusObserver @ 44 NONAME
+	_ZN28CDiagNetworkRegStatusWatcherD0Ev @ 45 NONAME
+	_ZN28CDiagNetworkRegStatusWatcherD1Ev @ 46 NONAME
+	_ZN28CDiagNetworkRegStatusWatcherD2Ev @ 47 NONAME
+	_ZN28CDiagPluginConstructionParam4NewLEP7HBufC16P16CDesC16ArrayFlati4TUidS4_ @ 48 NONAME
+	_ZN28CDiagPluginConstructionParam5NewLCEP7HBufC16P16CDesC16ArrayFlati4TUidS4_ @ 49 NONAME
+	_ZN28CDiagPluginConstructionParamD0Ev @ 50 NONAME
+	_ZN28CDiagPluginConstructionParamD1Ev @ 51 NONAME
+	_ZN28CDiagPluginConstructionParamD2Ev @ 52 NONAME
+	_ZNK15CDiagPluginPool10FindPluginE4TUidRP11MDiagPlugin @ 53 NONAME
+	_ZNK15CDiagPluginPool10FindPluginERK7TDesC16RP11MDiagPlugin @ 54 NONAME
+	_ZNK15CDiagPluginPool11FindPluginLE4TUid @ 55 NONAME
+	_ZNK15CDiagPluginPool11FindPluginLERK7TDesC16 @ 56 NONAME
+	_ZNK18TDiagTestExecParam6EngineEv @ 57 NONAME
+	_ZNK18TDiagTestExecParam8ObserverEv @ 58 NONAME
+	_ZNK19TDiagSuiteExecParam6EngineEv @ 59 NONAME
+	_ZNK19TDiagSuiteExecParam8ObserverEv @ 60 NONAME
+	_ZNK25CDiagResultsDbItemBuilder10TestResultEv @ 61 NONAME
+	_ZNK25CDiagResultsDbItemBuilder11TimeStartedEv @ 62 NONAME
+	_ZNK25CDiagResultsDbItemBuilder12ResultDetailEv @ 63 NONAME
+	_ZNK25CDiagResultsDbItemBuilder13TimeCompletedEv @ 64 NONAME
+	_ZNK25CDiagResultsDbItemBuilder13WasDependencyEv @ 65 NONAME
+	_ZNK25CDiagResultsDbItemBuilder14GetCurrentTimeEv @ 66 NONAME
+	_ZNK25CDiagResultsDbItemBuilder22ToResultsDatabaseItemLEv @ 67 NONAME
+	_ZNK25CDiagResultsDbItemBuilder7TestUidEv @ 68 NONAME
+	_ZNK28CDiagPluginConstructionParam15ServiceProvidedEv @ 69 NONAME
+	_ZNK28CDiagPluginConstructionParam16ServicesRequiredEv @ 70 NONAME
+	_ZNK28CDiagPluginConstructionParam3UidEv @ 71 NONAME
+	_ZNK28CDiagPluginConstructionParam5OrderEv @ 72 NONAME
+	_ZNK28CDiagPluginConstructionParam9ParentUidEv @ 73 NONAME
+	_ZTI28CDiagNetworkRegStatusWatcher @ 74 NONAME ; #<TI>#
+	_ZTV28CDiagNetworkRegStatusWatcher @ 75 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for Diagnostics Framework
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+// Generic configuration interface for component cenrep settings  
+../conf/diagnosticsfw.confml                    MW_LAYER_CONFML(diagnosticsfw.confml)
+../conf/diagnosticsfw_2000B16B.crml	        MW_LAYER_CRML(diagnosticsfw_2000B16B.crml)
+
+PRJ_MMPFILES
+diagframework.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/group/diagframework.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification for DiagFramework.dll
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET      diagframework.dll
+TARGETTYPE  dll
+
+UID	        0x1000008d 0x2000afe8
+
+CAPABILITY  CAP_GENERAL_DLL
+VENDORID    VID_DEFAULT
+
+SOURCEPATH  ../src
+SOURCE      diagengine.cpp
+SOURCE   	diagengineimpl.cpp
+SOURCE      diagenginestatemachine.cpp
+SOURCE      diagpluginpool.cpp
+SOURCE 		diagpluginconstructionparam.cpp
+SOURCE      diagpluginexecplanimpl.cpp
+SOURCE      diagexecplanentryimpl.cpp
+SOURCE      diagexecplanentryimpltest.cpp
+SOURCE      diagexecplanentryimplsuite.cpp
+SOURCE      DiagTestExecParam.cpp
+SOURCE      diagsuiteexecparam.cpp
+SOURCE      diagrootsuite.cpp
+SOURCE      diagpluginpoolimpl.cpp
+SOURCE      diagpluginloaderdependencyparser.cpp
+SOURCE      diagresultsdbitembuilder.cpp
+SOURCE      diagenginecallhandler.cpp
+SOURCE      diagengineconfig.cpp
+// Events
+SOURCE      diagengineeventbasic.cpp
+SOURCE      diagengineeventtestprogress.cpp
+// Log Event Eraser
+SOURCE      diaglogeventeraser.cpp
+// Network registration status watcher
+SOURCE      diagnetworkregstatuswatcher.cpp
+USERINCLUDE ../inc
+
+// System Include Paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+MW_LAYER_SYSTEMINCLUDE
+
+// This macro disables DRM API
+//#define DIAGFW_DISABLE_DRM_API
+
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY bafl.lib
+LIBRARY flogger.lib
+LIBRARY xmlframework.lib
+LIBRARY etel3rdparty.lib            // For CTelephony
+LIBRARY centralrepository.lib       // For CRepository
+LIBRARY diagresultsdatabase.lib
+LIBRARY logcli.lib                  // For Log Eraser
+LIBRARY efsrv.lib                   // For Log Eraser
+
+#if ( defined(WINSCW) || !defined(DIAGFW_DISABLE_DRM_API) )
+    LIBRARY drmserviceapi.lib       // DRM::CDrmServiceApi
+#else
+    MACRO __DIAGFW_DISABLE_DRM_API
+#endif
+
+#if defined(WINSCW)
+    deffile ../bwins/diagframework.def
+#else
+    deffile ../eabi/diagframework.def
+#endif
+
+nostrictdef 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/group/diagframework_uid_.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of diagnostics components
+*
+*/
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x1000008d,0x2000afe8,EPriorityForeground,0x000ffffeu,0x00000000u,0x2000afe8,0x101fb657,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagappcommand.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 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:  List of commands that plug-ins can request from application.
+*
+*/
+
+
+#ifndef DIAGAPPCOMMAND_H
+#define DIAGAPPCOMMAND_H
+
+/**
+*  Diagnostics Application command types.
+*
+*  This is a list of command that plug-in can request from the application.
+* 
+*/
+enum TDiagAppCommand
+    {
+    /**
+    * EDiagAppCommandSwitchToMainView
+    *
+    * This command can be used by interactive view plug-in to notify the 
+    * application that plug-in is done with current view and application can
+    * switch to main view. View to switch to is determined by the application.
+    *
+    * aParam1:      No parameter is needed. Always pass NULL.
+    * aParam2:      No parameter is needed. Always pass NULL.
+    *
+    * @code
+    *   
+    *   ExecutionParam().Engine().ExecuteAppCommandL( 
+    *       EDiagAppCommandSwitchToMainView, 
+    *       NULL,
+    *       NULL );
+    *   
+    *   or
+    *   
+    *   TRAPD( err, ExecutionParam().Engine().ExecuteAppCommandL( 
+    *                   EDiagAppCommandSwitchToMainView, 
+    *                   NULL,
+    *                   NULL ) );
+    *   
+    */
+    EDiagAppCommandSwitchToMainView = 1
+    };
+
+#endif // DIAGAPPCOMMAND_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagcleanupresetanddestroy.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2007 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:  Provides ResetAndDestroy for RPointerArrays.
+*
+*/
+
+
+#ifndef DIAGCLEANUPRESETANDDESTROY_H
+#define DIAGCLEANUPRESETANDDESTROY_H
+
+// SYSTEM INCLUDES
+#include <e32def.h>                 // TAny
+
+// FORWARD DECLARATION
+template< class T >
+class RPointerArray;
+
+namespace DiagFwInternal
+    {
+
+    /**
+    * Cleanup function for RPointerArray or any other types with ResetAndDestroy()
+    *   @usage
+    *   RPointerArray< CDiagResultsDatabaseItem > myArray;
+    *   CleanupStack::PushL( TCleanupItem( 
+    *       DiagFwInternal::CleanupResetAndDestroy< RPointerArray< CDiagResultsDatabaseItem > >,
+    *       &myArray ) );
+    *    
+    *   ...
+    *
+    *   CleanupStack::PopAndDestroy( &myArray );
+    */
+    template< class T >
+    inline void CleanupResetAndDestroy( TAny* aObj );
+
+    /**
+    * Push a RPointerArray of templated type to cleanup stack
+    *   @usage
+    *   RPointerArray< CDiagResultsDatabaseItem > myArray;
+    *   DiagFwInternal::CleanupRPointerArrayPushL< CDiagResultsDatabaseItem >( &myArray );
+    *
+    *   ...
+    *   
+    *   CleanupStack::PopAndDestroy( &myArray );
+    */
+    template< class T >
+    inline void CleanupRPointerArrayPushL( RPointerArray< T >* aObj );
+
+    }
+
+// Inline methods
+#include "diagcleanupresetanddestroy.inl"
+
+#endif // DIAGCLEANUPRESETANDDESTROY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagcleanupresetanddestroy.inl	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007 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:  Function Definition of CleanupResetAndDestroy
+*
+*/
+
+
+// CLASS DECLARATION
+
+// SYSTEM INCLUDE FILES
+#include <e32base.h>                // CleanupStack
+
+// USER INCLUDE FILES
+
+namespace DiagFwInternal
+    {
+
+    template< class T >
+    inline void CleanupResetAndDestroy( TAny* aObj )
+        {
+        if ( aObj )
+            {
+            static_cast< T* >( aObj )->ResetAndDestroy();
+            }
+        }
+
+    template< class T >
+    inline void CleanupRPointerArrayPushL( RPointerArray< T >* aObj )
+        {
+        if ( aObj )
+            {
+            CleanupStack::PushL( TCleanupItem(
+                CleanupResetAndDestroy< RPointerArray< T > >,
+                aObj ) );
+            }
+        }
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagcommondialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2007 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:  List of common dialog types
+*
+*/
+
+
+#ifndef DIAGCOMMONDIALOG_H
+#define DIAGCOMMONDIALOG_H
+
+
+/**
+*  Diagnostics Common Dialog Types
+*
+*  This is a list of common dialogs that can be used by plug-ins.
+* 
+*/
+enum TDiagCommonDialog
+    {
+    /**
+    * EDiagCommonDialogConfirmCancelAll
+    * Dialog that asks the user if all tests should be cancelled or not.
+    *
+    * aInitData:       No init data needed.  Always pass NULL.
+    * Return:          Standard dialog.  Use CAknDialog.
+    * Execution:       Call RunLD().
+    * RunLD() returns: - EAknSoftkeyYes, if the user confirmed the request to
+    *                    cancel all test execution.  Plugins should not do
+    *                    any further execution and should return immediately.
+    *                  - EAknSoftkeyNo, if the user dismissed the dialog and
+    *                    decided not to cancel all test execution.
+    *                  - 0, if the dialog is forced closed.  Generally,
+    *                    plugins should not distinguish between EAknSoftkeyNo
+    *                    and 0 (i.e., they should *only* check for
+    *                    EAknSoftkeyYes), unless there is good reason to.
+    *
+    * @code
+    *
+    *    CAknDialog* dlg = ExecutionParam().Engine().CreateCommonDialogLC(
+    *        EDiagCommonDialogConfirmCancelAll,
+    *        NULL );
+    *
+    *    TInt result = 0;
+    *    if ( !RunWaitingDialogL( dlg, result ) ||
+    *         result == EAknSoftkeyYes )
+    *        {
+    *        // Do not continue executing.  Either the dialog has been deleted
+    *        // or the user has cancelled all execution.
+    *        return;
+    *        }
+    *
+    *    dlg = NULL;
+    *
+    *    // Loop and display the plugin query again.
+    *    askAgain = ETrue;
+    *
+    */
+    EDiagCommonDialogConfirmCancelAll = 1,
+    EDiagCommonDialogConfirmSkipAll =2
+    };
+
+#endif // DIAGCOMMONDIALOG_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengine.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagEngine
+*
+*/
+
+
+#ifndef DIAGENGINE_H
+#define DIAGENGINE_H
+
+
+// system includes
+#include <e32base.h>                // CBase
+
+// user includes.
+#include <DiagEngineCommon.h>       // MDiagEngineCommon
+
+// Forward declarations
+class MDiagEngineObserver;
+class RDiagResultsDatabase;
+class CDiagPluginPool;
+class CDiagEngineImpl;
+
+
+/**
+*  Diagnostics Framework Engine 
+*
+*  This class is used by the client to execute tests and load plug-ins.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagEngine ) : public CBase,
+                                   public MDiagEngineCommon
+    {
+public:
+
+    /**
+    * Two-phased constructors. 
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aDisableDependency    if ETrue, plug-ins should execute
+    *                      event if dependencies are not met.
+    * @param aExecutionBatch array of plug-ins to execute.
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewL( CAknViewAppUi&          aViewAppUi, 
+                                       MDiagEngineObserver&    aObserver,
+                                       RDiagResultsDatabase&   aDbSession,
+                                       CDiagPluginPool&        aPluginPool,
+                                       TBool                   aDisableDependency,
+                                       const RArray< TUid >&   aExecutionBatch );
+
+    /**
+    * Two-phased constructors. This is identical to NewL, except that it will 
+    * keep newl instance in clean up stack.
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aDisableDependency    if ETrue, plug-ins should execute
+    *                      event if dependencies are not met.
+    * @param aExecutionBatch array of plug-ins to execute.
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewLC( CAknViewAppUi&          aViewAppUi, 
+                                        MDiagEngineObserver&    aObserver,
+                                        RDiagResultsDatabase&   aDbSession,
+                                        CDiagPluginPool&        aPluginPool,
+                                        TBool                   aDisableDependency,
+                                        const RArray< TUid >&   aExecutionBatch );
+    /**
+    * Two-phased constructors. 
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *   
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewL( CAknViewAppUi&          aViewAppUi, 
+                                       MDiagEngineObserver&    aObserver,
+                                       RDiagResultsDatabase&   aDbSession,
+                                       CDiagPluginPool&        aPluginPool,
+                                       TUid                    aIncompleteRecordUid );
+
+    /**
+    * Two-phased constructors. This is identical to NewL, except that it will 
+    * keep newl instance in clean up stack.
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewLC( CAknViewAppUi&          aViewAppUi, 
+                                        MDiagEngineObserver&    aObserver,
+                                        RDiagResultsDatabase&   aDbSession,
+                                        CDiagPluginPool&        aPluginPool,
+                                        TUid                    aIncompleteRecordUid );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CDiagEngine();
+
+    /**
+    * Execute tests. This is a asynchronous method. 
+    * First, execution plan is sent via MDiagEngineObserver::TestExecutionBeginL(). 
+    * Then, during the execution, MDiagEngineObserver::TestExecutionProgressL() 
+    * may be called multiple times to notify execution progress.  
+    * When execution is completed, 
+    * MDiagEngineObserver::TestExecutionCompletedL() is called.
+    */
+    IMPORT_C void ExecuteL();
+
+    /**
+    * Set custom execution parameter.
+    *
+    * @param aCustomParams - Custom data. Owership is not transefrred
+    *   so, the client must delete it once test is completed.
+    *   Desipte it being a pointer, ownership cannot be transferred 
+    *   because engine does not know the type of pointer. 
+    */
+    IMPORT_C void SetCustomParam( TAny* aCustomParams );
+
+    /**
+    * Suspend execution.  This can be used to suspend test execution.
+    * If currently executing test is suspendable, it will be suspended and resumed.
+    * Otherwise, it will be stopped. When CDiagEngine::ResumeL is called, 
+    * the stopped test will be restarted from the beginning. Already executed
+    * tests are not affected. 
+    * 
+    * After engine is suspended, MDiagEngineObserver::TestExecutionSuspendedL() is called.
+    *
+    */
+    IMPORT_C void SuspendL();
+
+    /**
+    * Resume suspended execution. This function can be used to resume 
+    * previously suspended execution. If execution was suspended on a test
+    * that cannot be suspended, the test will restart. Previously executed tests
+    * will not be re-run. Also, dependent tests will not be re-run.  If 
+    * the suspended test fails to resume (e.g. leaves), it will be marked as
+    * failure.
+    *
+    * After engine is resumed, MDiagEngineObserver::TestExecutionResumedL() is called.
+    */
+    IMPORT_C void ResumeL();
+    
+    
+    // ADO & Platformization Changes
+    ///@@@KSR: changes for Codescanner error val = High
+    //IMPORT_C TBool GetPluginDependency();
+    IMPORT_C TBool GetPluginDependencyL();
+
+public: // from MDiagEngineCommon
+
+    /**
+    * Returns current execution plan.
+    * @see MDiagEngineCommon::ExecutionPlanL
+    */
+    virtual const MDiagPluginExecPlan& ExecutionPlanL() const;
+
+    /**
+    * Stop current execution of tests.
+    * @see MDiagEngineCommon::ExecutionStopL
+    */
+    virtual void ExecutionStopL( TCancelMode aCancelMode );
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog();
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType );
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete );
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * @see MDiagEngineCommon::ViewAppUi
+    */
+    virtual CAknViewAppUi& ViewAppUi();
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * @see MDiagEngineCommon::ViewAppUi
+    */
+    virtual const CAknViewAppUi& ViewAppUi() const;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * @see MDiagEngineCommon::DbRecord
+    */
+    virtual RDiagResultsDatabaseRecord& DbRecord();
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * @see MDiagEngineCommon::DbRecord
+    */
+    virtual const RDiagResultsDatabaseRecord& DbRecord() const;
+
+    /**
+    * Get reference to Plugin Pool
+    * @see MDiagEngineCommon::PluginPool
+    */
+    virtual CDiagPluginPool& PluginPool();
+
+    /**
+    * Get reference to Plugin Pool
+    * @see MDiagEngineCommon::PluginPool
+    */
+    virtual const CDiagPluginPool& PluginPool() const;
+
+    /**
+    * Add a text to configuraiton list option. 
+    * @see MDiagEngineCommon::AddToConfigListL
+    */
+    virtual void AddToConfigListL( TConfigListType aListType, const TDesC& aText );
+
+    /**
+    * Remove a text from configuration list.
+    * @see MDiagEngineCommon::RemoveFromConfigListL
+    */
+    virtual void RemoveFromConfigListL( TConfigListType aListType, const TDesC& aText );
+
+    /**
+    * Create a common dialog.
+    * @see MDiagEngineCommon::CreateCommonDialogL
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData );
+
+    /**
+    * Stop watchdog activity temporarily.
+    * @see MDiagEngineCommon::StopWatchdogTemporarily
+    */
+    virtual void StopWatchdogTemporarily();
+
+    /**
+    * Check if current engine is being executed with dependency disabled.
+    *  @see MDiagEngineCommon::IsDependencyDisabled
+    */
+    virtual TBool IsDependencyDisabled() const;
+
+    /**
+    * Get custom param
+    *  @see MDiagEngineCommon::CustomParam
+    */
+    virtual TAny* CustomParam() const;
+
+    /**
+    * Execute an application command. 
+    *   @see MDiagEngineCommon::ExecuteAppCommandL
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 );
+
+private:    // private data
+    CDiagEngineImpl* iEngineImpl;
+    };
+
+
+#endif // DIAGENGINE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginecallhandler.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for DiagFwInternal::TEvent
+*
+*/
+
+
+#ifndef DIAGENGINECALLHANDLER_H
+#define DIAGENGINECALLHANDLER_H
+
+// SYSTEM INCLUDES
+#include <etel3rdparty.h>       // CTelephony and its T classes
+#include <badesca.h>            // CDesCArrayFlat - needed since its a typedef
+
+// USER INCLUDES
+#include "diagenginecallhandlerstates.h"    // TDiagEngineCallHandlerState
+
+// FORWARD DECLARATION
+class MDiagEngineCallHandlerObserver;
+
+
+/**
+*  Call Handler.
+*  
+*   This component is responsible for checking both MO and MT voice calls.
+*   If new calls are made, this component will let the observer know that
+*   call status has changed.
+*
+*   It also maintains a list of acceptable phone numbers that can be ignored.
+*   The list can be changed dynamically.
+*   
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagEngineCallHandler ) : public CActive
+    {
+public:
+    /**
+    * Two-phased constructor
+    * 
+    * @param aObserver - Reference to object interested in voice call events.
+    * @return New instance of CDiagEngineCallHandler
+    */
+    static CDiagEngineCallHandler* NewL( MDiagEngineCallHandlerObserver& aObserver );
+
+    /**
+    * C++ Destructor
+    * 
+    */
+    virtual ~CDiagEngineCallHandler();
+
+    /**
+    * Add a new phone number to a ignore list. If a new call is made, and
+    * it is in the ignore list, state chaneg will not occur.
+    *
+    * Note that if the number specified is already in-call, adding the 
+    * numebr will not cause the state to be changed. Only new calls
+    * are watched.
+    * 
+    * @param aNumber - Phone number to ignore
+    */
+    void AddIgnoreNumberL( const TDesC& aNumber );
+
+    /**
+    * Remove a number from the ignore list. Number must match exactly to
+    * be successful. If entry is not found, this function will leave
+    * vith KErrNotFound.
+    *
+    * Note that if the number specified is already in call, removing 
+    * the number will not generate state change event. Only new
+    * calls are handled.
+    * 
+    * @param aNumber - Phone number to ignore
+    */
+    void RemoveIgnoreNumberL( const TDesC& aNumber );
+
+    /**
+    * Returns current call handler state.
+    *
+    * @return Current call handler state.
+    */
+    TDiagEngineCallHandlerState CurrentState() const;
+
+private:    // from CActive
+    /**
+    * @see CActive::RunL()
+    */
+    virtual void RunL();
+
+    /**
+    * @see CActive::DoCancel()
+    */
+    virtual void DoCancel();
+
+private:    // private functions
+    /**
+    * C++ Constructor
+    *
+    * @param aObserver - reference to observer.
+    */
+    CDiagEngineCallHandler( MDiagEngineCallHandlerObserver& aObserver );
+
+    /**
+    * Second phase constructor.
+    *
+    */
+    void ConstructL();
+
+    /**
+    * Request from the telephony to receive phone status change indication.
+    * This function must be called every time status update happens in
+    * order to continue to receive new state change.
+    *
+    */
+    void RequestNotify();
+
+    /**
+    * Handle CTelephony::EStatusIdle case.
+    *
+    * @return ETrue if state is changed, and observer should be notified.
+    */
+    TBool HandleIdle();
+
+    /**
+    * Handle CTelephony::EStatusDialling and CTelephony::EStatusRinning case.
+    *
+    * @return ETrue if state is changed, and observer should be notified.
+    */
+    TBool HandleCall();
+
+    /**
+    * Debugging function that logs a human readable text of current 
+    * call status.
+    *
+    * This function does not do anything in DEBUG builds.
+    */
+    void LogCallStatus() const;
+
+private:
+    /**
+    * iObserver - Observers call handle status.
+    */
+    MDiagEngineCallHandlerObserver& iObserver;          
+
+    /**
+    * iTelephony - Used to receive call status changed indication.
+    * Owns.
+    */
+    CTelephony* iTelephony;
+
+    /**
+    * iCallStatus - This is where call status data is updated.
+    */
+    CTelephony::TCallStatusV1 iCallStatus;
+
+    /**
+    * iCallStatusPckg - packaged version of iCallStatus
+    */
+    CTelephony::TCallStatusV1Pckg iCallStatusPckg;
+
+    /**
+    * iCallIgnoreList - List of numbers to ignore.
+    * Owns.
+    */
+    CDesCArrayFlat* iCallIgnoreList;    
+
+    /**
+    * iState - internal state.
+    */
+    TDiagEngineCallHandlerState iState;
+    };
+
+#endif // DIAGENGINECALLHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginecallhandlerobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for MDiagEngineCallHandlerObserver
+*
+*/
+
+
+#ifndef DIAGENGINECALLHANDLEROBSERVER_H
+#define DIAGENGINECALLHANDLEROBSERVER_H
+
+#include "diagenginecallhandlerstates.h"    // TDiagEngineCallHandlerState
+
+class MDiagEngineCallHandlerObserver
+    {
+public:
+    /**
+    * Notify call state change
+    * @param aState - EDiagEngineCallHandlerStateIdle if not in call.
+    *                 EDiagEngineCallHandlerStateBusy if in call.
+    */
+    virtual void CallHandlerStateChangedL( TDiagEngineCallHandlerState aState ) = 0;
+    };
+
+#endif // DIAGENGINECALLHANDLEROBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginecallhandlerstates.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for TDiagEngineCallHandlerState
+*
+*/
+
+
+#ifndef DIAGENGINECALLHANDLERSTATES_H
+#define DIAGENGINECALLHANDLERSTATES_H
+
+enum TDiagEngineCallHandlerState
+    {
+    EDiagEngineCallHandlerStateIdle = 0,    // in idle state.
+    EDiagEngineCallHandlerStateBusy         // call is active.
+    };
+
+#endif // DIAGENGINECALLHANDLERSTATES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginecommon.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2007 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:  Common interface to use engine
+*
+*/
+
+
+#ifndef DIAGENGINECOMMON_H
+#define DIAGENGINECOMMON_H
+
+// SYSTEM INCLUDES
+#include <e32std.h>                     // TDesC, TTimeIntervalMicroSeconds32
+#include <DiagCommonDialog.h>           // TDiagCommonDialog
+#include <DiagAppCommand.h>             // TDiagAppCommand
+#include <DiagEngineWatchdogTypes.h>    // TDiagEngineWatchdogTypes
+
+// FORWARD DECLARATION
+class MDiagPluginExecPlan;
+class MDiagPlugin;
+class CAknViewAppUi;
+class RDiagResultsDatabaseRecord;
+class CDiagPluginPool;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Engine Common Interface
+*
+*  This interface is provided for Test plug-ins, Suite plug-ins and
+*  any other clients of CDiagEngine.
+*
+*  @since S60 v5.0
+*/
+class MDiagEngineCommon
+    {
+public: // Data Structures
+    
+    /** 
+    * Possible cancellation mode.
+    */
+    enum TCancelMode
+        {
+        ESkip,        // Cancel current test only. Continue rest.
+        ECancelAll      // Cancel current test and skip rest of execution.
+        };
+
+    /**
+    *  Text List based config options
+    */
+    enum TConfigListType
+        { 
+        /**
+        * EConfigListCallIngore - List of phone numbers to ignore. 
+        *   If a phone number is added to this list, engine will ignore the number
+        *   a new MO/MT call is created by the phone, and will not suspend
+        *   the engine execution when new call is made.
+        */
+        EConfigListCallIngore = 0
+        };
+
+public: // public methods
+
+    /**
+    * Returns current execution plan.
+    * If test is not being executed, it will leave with KErrNotReady.
+    *
+    * @return Reference to current execution plan.
+    */
+    virtual const MDiagPluginExecPlan& ExecutionPlanL() const = 0;
+
+    /**
+    * Stop current execution of tests.
+    * If test is not being executed, it will leave with KErrNotReady.
+    *
+    * @param aCancelMode   ESkip       - Skip current test only. Rest will continue.
+    *                      ECancelAll  - Cancels current test and skips the rest of
+    *                                  execution.
+    */
+    virtual void ExecutionStopL( TCancelMode aCancelMode ) = 0;
+
+    /**
+    * Resets test execution watchdog timer.  It will use the last given watchdog
+    * timer value for currently executing plug-in.
+    */
+    virtual void ResetWatchdog() = 0;
+
+    /**
+    * Resets test execution watchdog timer.  
+    *   Watchog timer value will be determined by the type of watchdog requested.
+    *   Given value is valid until next plug-in is executed, or another
+    *   ResetWachdogL() or TestProgressL() is called.
+    *
+    * @param aWatchdogType Type of watchdog timer vaule to use.
+    *   @see TDiagEngineWatchdogTypes
+    */
+    virtual void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType ) = 0;
+
+    /**
+    * Resets test execution watchdog timer.  
+    *   Engine will allow specified amount of time. 
+    *   Given value is valid until next plug-in is executed, or another
+    *   ResetWachdogL() or TestProgressL() is called.
+    * 
+    * @param aTimeToWait - Amount of time to wait before watchdog is expired.
+    */
+    virtual void ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete ) = 0;
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * AppUi reference can be used for tests that requires AppUi for view switching.
+    * 
+    * @return Reference to CAknViewAppUi
+    */
+    virtual CAknViewAppUi& ViewAppUi() = 0;
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * AppUi reference can be used for tests that requires AppUi for view switching.
+    * 
+    * @return Reference to CAknViewAppUi
+    */
+    virtual const CAknViewAppUi& ViewAppUi() const = 0;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * 
+    * @return Reference to RDiagResultsDatabaseRecord
+    */
+    virtual RDiagResultsDatabaseRecord& DbRecord() = 0;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * 
+    * @return Reference to RDiagResultsDatabaseRecord
+    */
+    virtual const RDiagResultsDatabaseRecord& DbRecord() const = 0;
+
+    /**
+    * Get reference to Plugin Pool
+    * 
+    * @return Reference to CDiagPluginPool
+    */
+    virtual CDiagPluginPool& PluginPool() = 0;
+
+    /**
+    * Get reference to Plugin Pool
+    * 
+    * @return Reference to CDiagPluginPool
+    */
+    virtual const CDiagPluginPool& PluginPool() const = 0;
+
+    /**
+    * Add a text to configuraiton list option. 
+    * 
+    * @param aListType - List type to add the configuration option to. 
+    *   @see TConfigListType
+    * @param aText - text to add to the list
+    */
+    virtual void AddToConfigListL( TConfigListType aListType, const TDesC& aText ) = 0;
+
+    /**
+    * Remove a text from configuration list.
+    * If configuration item text does not exist in the list, this function will 
+    * leave with KErrNotFound.
+    * 
+    * @param aListType - List type to remove the item from. 
+    *   @see TConfigListType
+    * @param aText - text for the option
+    */
+    virtual void RemoveFromConfigListL( TConfigListType aListType, const TDesC& aText ) = 0;
+
+    /**
+    * Create a common dialog.
+    * Plug-ins can use this factory method to create a common dialog.
+    * For available dialog types, @see DiagCommonDialog.h
+    * 
+    * @param aDialogType - Type of dialog to create.
+    * @param aInitData - Initialization parameter. Ownership is passed to engine.
+    * @return a pointer to newly created dialog. Ownership is passed to caller.
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData ) = 0;
+
+    /**
+    * Stop watchdog activity temporarily. Watchdog will stay inactive until:
+    *   a ) TestProgressL() is called.
+    *   b ) ResetWatchdogL() is called.
+    *   c ) Plug-in is cancelled and the next plug-in starts to execute.
+    */
+    virtual void StopWatchdogTemporarily() = 0;
+
+    /**
+    * Check if current engine is being executed with dependency disabled.
+    *   @return TBool - ETrue if dependency is disabled.
+    *                   EFalse if depencenty is enabled.
+    */
+    virtual TBool IsDependencyDisabled() const = 0;
+
+    /**
+    * Get custom parameter passed during engine creation.
+    *   @return TAny* Custom parameter.  Ownership is not transferred.
+    */
+    virtual TAny* CustomParam() const = 0;
+
+    /**
+    * Send a command to application to execute.. This can be used by the plug-in to
+    * request certain behavior from application. For more information about
+    * types of commands possible, @see TDiagAppCommand.
+    * If the command is not supported by the application, this function will 
+    * leave with error code KErrNotSupported.
+    *
+    * Memory Ownership of Parameters.
+    *   Note that in general, parameters should be owned by the caller. This is 
+    *   because if a particular operation is not supported, application 
+    *   will not know how to deallocate the parameter, causing memory leak.
+    *   
+    *   In cases where ownership must be passed, caller must check if
+    *   ExecuteAppCommandL() leaves KErrNotSupported and deallocate
+    *   parameters.
+    *
+    * @param aCommand - Type of command to execute. @see TDiagAppCommand
+    * @param aParam1 - Data for the command. Value of this parameter depends
+    *   on the type of command. Ownership not transferred. @see TDiagAppCommand
+    * @param aParam2 - Data for the command. Value of this parameter depends
+    *   on the type of command. Ownership not transferred. @see TDiagAppCommand
+    *   
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 ) = 0;
+    };
+
+
+#endif // DIAGENGINECOMMON_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengineconfig.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for TDiagEngineConfig
+*
+*/
+
+
+#ifndef DIAGENGINECONFIG_H
+#define DIAGENGINECONFIG_H
+
+// SYSTEM INCLUDE FILES
+#include <e32base.h>                // NONSHARABLE_CLASS
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+/**
+* Diagnostics Engine Configuration.
+*
+* This class implements TDiagEngineConfig class. This class stores configuration
+* information.
+*
+* @since S60 v5.0
+*
+*/
+NONSHARABLE_CLASS( TDiagEngineConfig )
+    {
+public:     // public interface
+    /**
+    * C++ default contructor
+    */
+    TDiagEngineConfig();
+
+    /**
+    * Read Cenrep key vaules
+    */
+    void ReadCenrepKeysL();
+
+    /**
+    * Get watchdog timeout vaule for interactive plug-ins.
+    * 
+    * @return Watchdog timeout value for interactive plug-ins. 
+    */
+    const TTimeIntervalMicroSeconds32& WatchdogTimeoutValueInteractive() const;
+
+    /**
+    * Get watchdog timeout vaule for automatic plug-ins.
+    * 
+    * @return Watchdog timeout value for automatic plug-ins. 
+    */
+    const TTimeIntervalMicroSeconds32& WatchdogTimeoutValueAutomatic() const;
+
+    /**
+    * Get test plug-in initial delay vaule.
+    * 
+    * @return Initial test plug-in delay vaule.
+    *   Unit is in micro seconds
+    */
+    const TTimeIntervalMicroSeconds32& TestPluginInitialDelay() const;
+
+    /**
+    * Set whether engine is configured to disable dependency checks.
+    *
+    * @param aDisableDependency - ETrue to change configuration to disable
+    *   dependency. EFalse to change configuration to enable dependency.
+    */
+    void SetDependencyDisabled( TBool aDisableDependency );
+
+    /**
+    * Get disable depndency value.
+    *
+    * @return - ETrue if dependency is disabled.
+    *   EFalse if dependency is enabled.
+    */
+    TBool IsDependencyDisabled() const;
+
+private:    // private methods
+    /**
+    * Read TTimeIntervalMicroSeconds32 value from cenrep.
+    *   
+    * @param aCenrep - Reference to Cenrep object to read timeout value from.
+    * @param aKey - Cenrep key to read.
+    * @param aValue - If successful, this variable will be updated with
+    *   the value from cenrep.
+    */
+    void ReadTimeIntervalFromCenrepL( CRepository& aCenrep,
+                                      TUint32 aKey,
+                                      TTimeIntervalMicroSeconds32& aValue );
+
+private:    // private data
+    /**
+    * iCenRepWatchdogTimeout - Watchdog timer value for Interactive steps.
+    *   Unit is in microseconds.
+    */
+    TTimeIntervalMicroSeconds32 iCenRepWatchdogTimeoutInteractive;
+    
+    /**
+    * iCenRepWatchdogTimeout - Watchdog timer value for automatic steps.
+    *   Unit is in microseconds.
+    */
+    TTimeIntervalMicroSeconds32 iCenRepWatchdogTimeoutAutomatic;
+
+    /**
+    * iCenRepInitDelay - Initial delay for test plug-ins.
+    *   Unit is in microseconds.
+    */
+    TTimeIntervalMicroSeconds32 iCenRepInitDelay;
+
+    /**
+    * iDisableDependency - If Enabled, dependency will not be executed.
+    * From constructor input.
+    */
+    TBool iDisableDependency;
+
+    };
+
+#endif // DIAGENGINECONFIG_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengineeventbasic.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for DiagFwInternal::TEvent
+*
+*/
+
+
+#ifndef DIAGENGINEEVENTBASIC_H
+#define DIAGENGINEEVENTBASIC_H
+
+// SYSTEM INCLUDES
+#include <e32base.h>            // CBase
+
+// USER INCLUDES
+#include "diagengineevents.h"
+
+namespace DiagFwInternal
+    {
+/**
+* CEventBasic
+*
+* Basic event with just event ID.
+*/
+NONSHARABLE_CLASS( CEventBasic ) : public CBase
+    {
+public:
+    /**
+    * C++ Constructor
+    * 
+    * @param aType - Type of event.
+    * @see DiagFwInternal::TEvent
+    */
+    CEventBasic( TEvent aType );
+
+    /**
+    * Get Type
+    * 
+    * @see DiagFwInternal::TEvent
+    * @return Type of event.
+    */
+    TEvent GetType() const;
+
+    /**
+    * Get name of the event
+    * 
+    * @return Name of the event
+    */
+    const TDesC& ToString() const;
+
+private:    // private data
+    /**
+    * iType - event type.
+    * @see DiagFwInternal::TEvent
+    */
+    TEvent iType;
+    };    
+    } // namespace DiagFwInternal
+
+#endif // ifndef DIAGENGINEEVENTBASIC_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengineevents.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for DiagFwInternal::TEvent
+*
+*/
+
+
+#ifndef DIAGENGINEEVENTS_H
+#define DIAGENGINEEVENTS_H
+
+// SYSTEM INCLUDES
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem
+#include <DiagEngineCommon.h>           // MDiagEngineCommon
+
+class MDiagPlugin;
+class MDiagTestPlugin;
+class MDiagSuitePlugin;
+
+namespace DiagFwInternal
+    {
+typedef enum
+    {
+    EEventExecute,              // ::ExecuteTestL() is called.
+    EEventPlanCreated,          // Execution plan is created.
+    EEventExecuteNext,          // Execute next item in plan.
+    EEventTestProgress,         // ::TestProgressL is called.
+    EEventAllPluginsCompleted,  // All plug-ins are completed.
+    EEventResumeToRunning,      // Resume to Runinng state from suspend
+    EEventResumeToCreatingPlan, // Resume to Creating plan from suspend
+    EEventSkip,                 // ::ExecutionStopL w/ Skip called
+    EEventCancelAll,            // ::ExecutionStopL w/ CancelAll called
+    EEventSuspend,              // ::SuspendL called.
+    EEventVoiceCallActive,      // MO / MT call
+    EEventFinalized             // db record and plug-ins are finalized.
+    } TEvent;
+    } // end of namespace DiagFwInternal
+
+#endif // DIAGENGINEEVENTS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengineeventtestprogress.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for DiagFwInternal::CEventTestProgress
+*
+*/
+
+
+#ifndef DIAGENGINEEVENTTESTPROGRESS_H
+#define DIAGENGINEEVENTTESTPROGRESS_H
+
+// SYSTEM INCLUDES
+#include <e32base.h>            // CBase
+
+// USER INCLUDES
+#include "diagengineevents.h"       // DiagFwInternal::TEvent
+#include "diagengineeventbasic.h"   // DiagFwInternal::CEventBasic
+
+namespace DiagFwInternal
+    {
+/**
+* CEventTestProgress
+*
+* Event for test progress
+*/
+NONSHARABLE_CLASS( CEventTestProgress ) : public CEventBasic
+    {
+public:
+    /** 
+    * C++ Constructor
+    *
+    * @param aSender - Sender of the progress event
+    * @param aCurrentStep - Current progress step
+    * @param aTotalSteps - Total number of steps to complete
+    */
+    CEventTestProgress( const MDiagPlugin& aSender, 
+                        TUint aCurrentStep, 
+                        TUint aTotalSteps );
+
+    /** 
+    * Get Sender
+    *
+    * @return Reference to the plugin
+    */
+    const MDiagPlugin& Sender() const;
+
+    /** 
+    * Get progress
+    *
+    * @return progress
+    */
+    TUint CurrStep() const;
+
+    /** 
+    * Get total number of steps to complete
+    *
+    * @return total number of steps
+    */
+    TUint TotalSteps() const;
+
+private:    // private data
+    /**
+    * iSender - Plug-in that sent in the progress
+    */
+    const MDiagPlugin& iSender;
+
+    /**
+    * iCurrStep - Current step.
+    */
+    TUint iCurrStep;
+
+    /**
+    * iTotalSteps - Total steps
+    */
+    TUint iTotalSteps;
+    };
+    } // namespace DiagFwInternal
+
+#endif // ifndef DIAGENGINEEVENTTESTPROGRESS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengineimpl.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,803 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagEngineImpl
+*
+*/
+
+
+#ifndef DIAGENGINEIMPL_H
+#define DIAGENGINEIMPL_H
+
+
+// system includes
+#include <e32base.h>                    // CActive
+#include <DiagEngineCommon.h>           // MDiagEngineCommon
+#include <DiagEngineObserver.h>         // MDiagEngineObserver::TSuspendReason
+#include <DiagResultsDatabase.h>        // RDiagResultsDatabase, RDiagResultsDatabaseRecord
+#include <DiagTestPlugin.h>             // MDiagTestPlugin::TStopReason
+#include <DiagSuitePlugin.h>            // MDiagSuitePlugin::TStopReason
+
+// user includes.
+#include "diagenginestatemachineobserver.h"     // DiagFwInternal::MStateMachineObserver
+#include "diagenginestates.h"                   // DiagFwInternal::TState
+#include "diagengineevents.h"                   // DiagFwInternal::TEvent
+#include "diagenginecallhandlerobserver.h"      // MDiagEngineCallHandlerObserver
+#include "diagexecplanentryimplobserver.h"      // MDiagExecPlanEntryImplObserver
+#include "diagengineconfig.h"                   // TDiagEngineConfig
+
+
+// Forward declarations
+class MDiagTestPlugin;
+class MDiagSuitePlugin;
+class CDiagPluginPool;
+class CAknViewAppUi;
+class CDiagEngineCallHandler;
+class CDiagPluginExecPlanImpl;
+class CDiagExecPlanEntryImpl;
+class CDiagExecPlanEntryImplTest;
+
+namespace DiagFwInternal
+    {
+    class CStateMachine;
+    class CEventBasic;
+    class CEventCancel;
+    class CEventSendCompletion;
+    class CEventSuiteContinue;
+    class CEventTestCompleted;
+    class CEventTestProgress;
+    class CEventWatchdog;
+    }
+
+/**
+*  Diagnostics Framework Engine Implementation
+*
+*  This class is the actual class that implements CDiagEngine.
+*  All actual work is done by CDiagEngineImpl class.
+*
+*/
+NONSHARABLE_CLASS( CDiagEngineImpl ) : public CActive,
+                                       public MDiagEngineCommon,
+                                       public MDiagExecPlanEntryImplObserver,
+                                       public DiagFwInternal::MStateMachineObserver,
+                                       public MDiagEngineCallHandlerObserver
+    {
+public:
+
+    /**
+    * Two-phased constructor.
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aDisableDependency    if ETrue, plug-ins should execute
+    *                      event if dependencies are not met.
+    * @param aExecutionBatch - array of test uids to execute
+    *
+    * @return new instance of CDiagEngineImpl*
+    */
+    static CDiagEngineImpl* NewL( CAknViewAppUi&          aViewAppUi, 
+                                  MDiagEngineObserver&    aObserver,
+                                  RDiagResultsDatabase&   aDbSession,
+                                  CDiagPluginPool&        aPluginPool,
+                                  TBool                   aDisableDependency,
+                                  const RArray< TUid >&   aExecutionBatch );
+
+    /**
+    * Two-phased constructor. This function is identical to NewL, 
+    * except that it pushs created object in clean up stack.
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aDisableDependency    if ETrue, plug-ins should execute
+    *                      event if dependencies are not met.
+    * @param aExecutionBatch - array of test uids to execute
+    *
+    * @return new instance of CDiagEngineImpl*
+    */
+    static CDiagEngineImpl* NewLC( CAknViewAppUi&          aViewAppUi, 
+                                   MDiagEngineObserver&    aObserver,
+                                   RDiagResultsDatabase&   aDbSession,
+                                   CDiagPluginPool&        aPluginPool,
+                                   TBool                   aDisableDependency,
+                                   const RArray< TUid >&   aExecutionBatch );
+    
+
+    /**
+    * Two-phased constructor.
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *
+    * @return new instance of CDiagEngineImpl*
+    */
+    static CDiagEngineImpl* NewL( CAknViewAppUi&          aViewAppUi, 
+                                  MDiagEngineObserver&    aObserver,
+                                  RDiagResultsDatabase&   aDbSession,
+                                  CDiagPluginPool&        aPluginPool,
+                                  TUid                    aIncompleteRecordUid );
+    /**
+    * Two-phased constructor. This function is identical to NewL, 
+    * except that it pushs created object in clean up stack.
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *
+    * @return new instance of CDiagEngineImpl*
+    */
+    static CDiagEngineImpl* NewLC( CAknViewAppUi&          aViewAppUi, 
+                                   MDiagEngineObserver&    aObserver,
+                                   RDiagResultsDatabase&   aDbSession,
+                                   CDiagPluginPool&        aPluginPool,
+                                   TUid                    aIncompleteRecordUid );
+    
+
+    /**
+    * Destructor.
+    */
+    virtual ~CDiagEngineImpl();
+
+    /**
+    * Execute tests. This implements CDiagEngine::ExecuteL
+    *
+    * @see CDiagEngine::ExecuteL
+    */
+    void ExecuteL();
+
+    /**
+    * Set custom execution parameter.
+    *
+    * @see CDiagEngine::SetCustomParam
+    */
+    void SetCustomParam( TAny* aCustomParams );
+
+    /**
+    * Suspend execution.  
+    * 
+    * @see CDiagEngine::SuspendL
+    */
+    void SuspendL();
+
+    /**
+    * Resume suspended execution. This implements CDiagEngine::ResumeL
+    *
+    * @see CDiagEngine::ResumeL
+    */
+    void ResumeL();
+
+public: // from MDiagEngineCommon
+    /**
+    * Returns current execution plan.
+    * 
+    * @see MDiagEngineCommon::ExecutionPlanL
+    */
+    virtual const MDiagPluginExecPlan& ExecutionPlanL() const;
+
+    /**
+    * Stop current execution of tests.
+    * 
+    * @see MDiagEngineCommon::ExecutionStopL
+    */
+    virtual void ExecutionStopL( TCancelMode aCancelMode );
+    
+    /**
+    * Resets test execution watchdog timer.
+    * 
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog();
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType );
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete );
+    
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * 
+    * @see MDiagEngineCommon::ViewAppUi()
+    */
+    virtual CAknViewAppUi& ViewAppUi();
+    
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * 
+    * @see MDiagEngineCommon::ViewAppUi()
+    */
+    virtual const CAknViewAppUi& ViewAppUi() const;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * 
+    * @see MDiagEngineCommon::DbRecord
+    */
+    virtual RDiagResultsDatabaseRecord& DbRecord();
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * 
+    * @see MDiagEngineCommon::DbRecord
+    */
+    virtual const RDiagResultsDatabaseRecord& DbRecord() const;
+
+    /**
+    * Get reference to Plugin Pool
+    * 
+    * @see MDiagEngineCommon::PluginPool
+    */
+    virtual CDiagPluginPool& PluginPool();
+
+    /**
+    * Get reference to Plugin Pool
+    * 
+    * @see MDiagEngineCommon::PluginPool
+    */
+    virtual const CDiagPluginPool& PluginPool() const;
+
+    /**
+    * Add a text to configuraiton list option. 
+    * 
+    * @see MDiagEngineCommon::AddToConfigListL
+    */
+    virtual void AddToConfigListL( TConfigListType aListType, const TDesC& aText );
+
+    /**
+    * Remove a text from configuration list.
+    * 
+    * @see MDiagEngineCommon::RemoveFromConfigListL
+    */
+    virtual void RemoveFromConfigListL( TConfigListType aListType, const TDesC& aText );
+
+    /**
+    * Create a common dialog.
+    * @see MDiagEngineCommon::CreateCommonDialogL
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData );
+
+    /**
+    * Stop watchdog activity temporarily.
+    * @see MDiagEngineCommon::StopWatchdogTemporarily
+    */
+    virtual void StopWatchdogTemporarily();
+
+    /**
+    * Check if current engine is being executed with dependency disabled.
+    * @see MDiagEngineCommon::IsDependencyDisabled
+    */
+    virtual TBool IsDependencyDisabled() const;
+
+    /**
+    * Get custom execution parameter.
+    * @see MDiagEngineCommon::CustomParam
+    */
+    virtual TAny* CustomParam() const;
+
+    /**
+    * Send a command to application.
+    *   @see MDiagEngineCommon::ExecuteAppCommandL
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 );
+
+private: // from MDiagExecPlanEntryImplObserver
+    /**
+    * Observe plugin execution progress
+    * @see MDiagExecPlanEntryImplObserver::ExecPlanEntryProgressL
+    */
+    virtual void ExecPlanEntryProgressL( CDiagExecPlanEntryImpl& aSender,
+                                         TUint aCurrentStep,
+                                         TUint aTotalSteps );
+    /**
+    * Observe plugin execution completion
+    * @see MDiagExecPlanEntryImplObserver::ExecPlanEntryExecutedL
+    */
+    virtual void ExecPlanEntryExecutedL( CDiagExecPlanEntryImpl& aSender );
+
+    /**
+    * Observer critical error from plug-in execution entry.
+    * @see MDiagExecPlanEntryImplObserver::ExecPlanEntryCriticalError
+    */
+    virtual void ExecPlanEntryCriticalError( TInt aError );
+
+private: // from DiagFwInternal::MStateMachineObserver
+    /**
+    * Handle state transition
+    * 
+    * @see MDiagEngineStateMachineObserver::HandleStateChangedL
+    */
+    virtual void HandleStateChangedL( DiagFwInternal::TState aPreviousState, 
+                                      DiagFwInternal::TState aCurrentState,
+                                      const DiagFwInternal::CEventBasic& aEventPreview );
+
+    /**
+    * Handle event.
+    * 
+    * @see MDiagEngineStateMachineObserver::HandleEventL
+    */
+    virtual void HandleEventL( DiagFwInternal::CEventBasic& aEvent );
+
+    /**
+    * Handle error.
+    * 
+    * @see MDiagEngineStateMachineObserver::HandleError
+    */
+    virtual DiagFwInternal::TState HandleError( DiagFwInternal::TState aCurrentState, 
+                                                TInt aError );
+
+private:    // From MDiagEngineCallHandlerObserver
+    /**
+    * Handle call handling state change.
+    * 
+    * @see MDiagEngineCallHandlerObserver::CallHandlerStateChangedL
+    */
+    virtual void CallHandlerStateChangedL( TDiagEngineCallHandlerState aState );
+
+private:    // from CActive
+    /**
+    * RunL from CActive
+    * 
+    * @see CActive::RunL
+    */
+    virtual void RunL();
+
+    /**
+    * DoCancel from CActive
+    * 
+    * @see CActive::DoCancel
+    */
+    virtual void DoCancel();
+
+    /**
+    * Handle error 
+    * 
+    * @see CActive::RunError
+    */
+    virtual TInt RunError( TInt aError );
+
+private:    // Private Constructors
+    /**
+    * C++ Constrctor
+    *
+    * @param aViewAppUi - Reference to Appui.
+    * @param aObserver - Reference to engine observer. (Generall app)
+    * @param aDbSession - Session to the database.
+    * @param aPluginPool - Reference to plug-in pool.
+    * @param aDisableDependency - Whether to disable dependency check.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *   If this UID is aIncompleteRecordUid == TUid::Null(), it will create
+    *   a new record. 
+    */
+    CDiagEngineImpl( CAknViewAppUi&          aViewAppUi,
+                     MDiagEngineObserver&    aObserver,
+                     RDiagResultsDatabase&   aDbSession,
+                     CDiagPluginPool&        aPluginPool );
+    
+    /**
+    * Second phase constructor for creating a new record.
+    *
+    * @param aDisableDependency - Whether to disable dependency check
+    * @param aExecutionBatch - Array of plug-in uids to execute
+    */
+    void ConstructNewRecordL( TBool aDisableDependency, 
+                              const RArray< TUid >& aExecutionBatch );
+
+    /**
+    * Second phase constructor for resuming incomplete record.
+    * 
+    * @param aIncompleteRecordUid - Uid of DB record to resume from.
+    */
+    void ConstructIncompleteRecordL( TUid aIncompleteRecordUid );
+    
+    /**
+    * Second phase constructor common.
+    * Initializes items that are common to both new session and resuming session.
+    */
+    void ConstructCommonL();
+
+private:    // Event handlers
+    /**
+    * State handler function for EStateCreatingPlan
+    *
+    * @param aEvent - Event to handle.
+    */
+    void HandleEventInCreatingPlanStateL( DiagFwInternal::CEventBasic& aEvent );
+
+    /**
+    * State handler function for EStateRunning
+    *
+    * @param aEvent - Event to handle.
+    */
+    void HandleEventInRunningStateL( DiagFwInternal::CEventBasic& aEvent );
+
+    /**
+    * State handler function for EStateCancelAll
+    *
+    * @param aEvent - Event to handle.
+    */
+    void HandleEventInCancelAllStateL( DiagFwInternal::CEventBasic& aEvent );
+
+    /**
+    * State handler function for EStateSuspended
+    *
+    * @param aEvent - Event to handle.
+    */
+    void HandleEventInSuspendedStateL( DiagFwInternal::CEventBasic& aEvent );
+
+    /**
+    * State handler function for EStateFinalizing
+    *
+    * @param aEvent - Event to handle.
+    */
+    void HandleEventInFinalizingStateL( DiagFwInternal::CEventBasic& aEvent );
+
+    /**
+    * State handler function for EStateStopped
+    *
+    * @param aEvent - Event to handle.
+    */
+    void HandleEventInStoppedStateL( DiagFwInternal::CEventBasic& aEvent );
+
+private:    // Other private functions
+    /**
+    * Start creating execution plan
+    */
+    void StartCreateExecutionPlanL();
+
+    /**
+    * Handle Plan created event
+    */
+    void HandlePlanCreatedL();
+
+    /**
+    * Notify test progress event to engine observer
+    *
+    * @param aEvent - test progress event.
+    */
+    void NotifyTestProgressL( DiagFwInternal::CEventTestProgress& aEvent );
+
+    /**
+    * Report plug-in execution result to observer and continue to the next test.
+    *
+    * @param aError - Error code to report to observer.
+    * @param aResult - result to report to observer.
+    */
+    void NotifyResultAndContinueL( TInt aError, CDiagResultsDatabaseItem* aResult );
+
+    /**
+    * Commit db record to DB. 
+    *
+    */
+    void CommitResultsToDb();
+
+    /**
+    * Notify observer that last plugin is completed and engine is now stopped.
+    * This could also mean that execution has failed.
+    *
+    * @param aEvent - last completion event
+    */
+    void NotifyLastPluginCompletedL( DiagFwInternal::CEventSendCompletion& aEvent );
+
+    /**
+    * Execute next plugin in the plan
+    *
+    */
+    void ExecuteNextPluginL();
+
+    /**
+    * Suspend engine
+    * 
+    * @param aReason - Reason for suspending.
+    */
+    void DoSuspendL( MDiagEngineObserver::TSuspendReason aReason );
+
+    /**
+    * Add event to state machine.
+    *   This functions makes sure that correct resume event is added to 
+    *   the state machine depending on the previous state.
+    * @param aReason - Resume reason.
+    */
+    void AddResumeEventL( MDiagEngineObserver::TResumeReason aReason );
+
+    /**
+    * Resume engine
+    *
+    */
+    void DoResumeL();
+
+    /**
+    * Handle Skip
+    *
+    */
+    void HandleSkipL();
+
+    /**
+    * Handle cancelling of all plug-ins
+    *
+    */
+    void HandleCancelAllL();
+
+    /**
+    * Start delay timer for test plugin
+    *
+    * @param aPlanEntry - test plugin entry in plan to execute.
+    */
+    void StartTimerForDelayingTestL( CDiagExecPlanEntryImpl& aPlanEntry );
+
+    /**
+    * Start Executing a test plug-in
+    *
+    * @param aPlanEntry - test plugin entry in plan to execute.
+    */
+    void DoExecuteTestPluginL( CDiagExecPlanEntryImpl& aPlanEntry );
+
+    /**
+    * Start Executing a suite plug-in
+    *
+    * @param aPlanEntry - suite plugin entry in plan to execute.
+    */
+    void DoExecuteSuitePluginL( CDiagExecPlanEntryImpl& aPlanEntry );
+
+    /**
+    * Callback function for plugin delay timer expiration.
+    *
+    * @param aPtr - pointer to "this"
+    */
+    static TInt PluginDelayTimerExpiredL( TAny* aPtr );
+
+    /**
+    * Callback function for watchdog timer expiration. 
+    *
+    * @param aPtr - pointer to "this"
+    */
+    static TInt WatchdogTimerExpiredL( TAny* aPtr );
+
+    /**
+    * Handle watchdog time expiration. 
+    *
+    * @param aEvent - Watchdog event.
+    */
+    void HandleWatchdogTimeoutL( DiagFwInternal::CEventWatchdog& aEvent );
+
+    /**
+    * Function to stop currently executing plugin
+    *
+    * @param aStopMode - Reason for stopping the execution.
+    * @param aIsWatchdog - ETrue if this is because of watchdog timeout.
+    * @return Test Result. NULL if plug-in was a suite. Ownership transferred
+    *   to caller.
+    */
+    CDiagResultsDatabaseItem* StopCurrentPluginL( TCancelMode aStopMode, 
+                                                  TBool aIsWatchdog );
+
+    /**
+    * Function to stop currently executing test plugin
+    *
+    * @param aStopMode - Reason for stopping the execution.
+    * @param aIsWatchdog - ETrue if this is because of watchdog timeout.
+    * @return Test Result. NULL if plug-in was a suite. Ownership transferred
+    *   to caller.
+    */
+    CDiagResultsDatabaseItem* StopCurrentTestPluginL( TCancelMode aStopMode, 
+                                                      TBool aIsWatchdog );
+
+    /**
+    * Function to stop currently executing suite plugin
+    *
+    * @param aStopMode - Reason for stopping the execution.
+    * @param aIsWatchdog - ETrue if this is because of watchdog timeout.
+    */
+    void StopCurrentSuitePluginL( TCancelMode aStopMode, TBool aIsWatchdog );
+
+    /**
+    * Function to create test stop reason based on input parameter
+    *
+    * @param aStopMode - Reason for stopping the execution.
+    * @param aIsWatchdog - ETrue if this is because of watchdog timeout.
+    * @return Test stop reason
+    */
+    MDiagTestPlugin::TStopReason TranslateTestStopReason( TCancelMode aStopMode, 
+                                                          TBool aIsWatchdog );
+        
+    /**
+    * Function to create suite stop reason based on input parameter
+    *
+    * @param aStopMode - Reason for stopping the execution.
+    * @param aIsWatchdog - ETrue if this is because of watchdog timeout.
+    * @return Suite stop reason
+    */
+    MDiagSuitePlugin::TStopReason TranslateSuiteStopReason( TCancelMode aStopMode, 
+                                                            TBool aIsWatchdog );
+        
+    /**
+    * Function to create database result type based on input parameter
+    *
+    * @param aStopMode - Reason for stopping the execution.
+    * @param aIsWatchdog - ETrue if this is because of watchdog timeout.
+    * @return Database result type.
+    */
+    CDiagResultsDatabaseItem::TResult ConvertToDbResult( TCancelMode aStopMode, 
+                                                         TBool aIsWatchdog );     
+        
+    /**
+    * Create database result item with just result.
+    *
+    * @param aCurrentItem - Currently executing item
+    * @param aResult - Result type
+    * @return Database result item. Ownership transferred to caller.
+    */
+    CDiagResultsDatabaseItem* CreateDbItemL( 
+            CDiagExecPlanEntryImpl& aCurrentItem,
+            CDiagResultsDatabaseItem::TResult aResultType ) const;
+        
+    /**
+    * Call TestSessionEndL on all plug-ins.
+    *
+    */
+    void NotifyPluginsOfTestSessionEnd();
+
+    /**
+    * Stops all active requests
+    */
+    void StopAllRequests();
+
+    /**
+    * Cleans up incomplete test session during engine destruction.
+    * This function should be called only from destructor.
+    */
+    void CleanupIncompleteTestSession();
+
+    /**
+    * Finalizes test session. This will notify plug-ins, finalize DB record and
+    * notify application.
+    */
+    void FinalizeTestSessionL();
+
+private:    // private data
+    /**
+    * iViewAppUi - Reference to View App Ui. Passed to plug-ins to allow
+    * view switching.
+    */
+    CAknViewAppUi& iViewAppUi;
+
+    /**
+    * iObserver - reference to engine observer.
+    */
+    MDiagEngineObserver& iObserver;
+
+    /**
+    * iDbSession - Database session.
+    */
+    RDiagResultsDatabase& iDbSession;
+
+    /**
+    * iDbRecord - New record created for current test session.
+    */
+    RDiagResultsDatabaseRecord iDbRecord;
+
+    /**
+    * iRecordId - New record id created for current test session.
+    */
+    TUid iRecordId;
+
+    /**
+    * iPluginPool - Reference to the plug-in pool.
+    */
+    CDiagPluginPool& iPluginPool;
+
+    /**
+    * iCustomParam - Custom parameter.
+    * Ownership - Client.
+    */
+    TAny* iCustomParam;
+
+    /**
+    * iBatch - list of items to execute.
+    * Ownership - Individual elements are owned by plug-in pool. 
+    */
+    RPointerArray< MDiagPlugin > iBatch;
+
+    /**
+    * iWatchdogTimer - Timer for watchdog.
+    * Ownership - this
+    */
+    CPeriodic* iWatchdogTimer;
+
+    /**
+    * iLastWatchdogValue - Last watchdog value set.
+    *   This will be used when ResetWatchdog() is called without
+    *   any value specified.
+    */
+    TInt iLastWatchdogValue;
+
+    /**
+    * iPlan - Execution plan
+    * Ownership - this
+    */
+    CDiagPluginExecPlanImpl* iPlan;
+
+    /**
+    * iStateMachine - State machine.
+    * Ownership - this
+    */
+    DiagFwInternal::CStateMachine* iStateMachine;
+
+    /**
+    * iSuspendedPrevState - previous state just before suspended.
+    * This is used to resume to correct state.
+    */
+    DiagFwInternal::TState iSuspendedPrevState;
+
+    /**
+    * iSuspendReason - Reason why engine was suspended.
+    */
+    MDiagEngineObserver::TSuspendReason iSuspendReason;
+
+    /**
+    * iResumeReason - Reason why engine is resumed.
+    */
+    MDiagEngineObserver::TResumeReason iResumeReason;
+
+    /**
+    * iSuspendedResult - Temporary result from test plug-in when engine is 
+    * suspended. When test is suspended just before being able to save the
+    * test result, its result is saved here, so that when resumed
+    * it will use this result instead of re-executing.
+    * Ownership - this
+    */
+    CDiagResultsDatabaseItem* iSuspendedResult;
+    
+    /**
+    * iCallHandler - Handles call states
+    * Ownership - this
+    */
+    CDiagEngineCallHandler* iCallHandler;
+    
+    /**
+    * iContinueIncompleteRecord - Indicates whether engine is supposed to
+    *   continue from an incomplete record.
+    *   ETrue if engine is working with incomplete record.
+    *   EFalse if engine is working with a new record.
+    */
+    TBool iContinueIncompleteRecord;
+
+    /**
+    * iEngineConfig - Confiugration information about engine.
+    */
+    TDiagEngineConfig iEngineConfig;
+
+    /**
+    * iEngineError - Error code of engine.
+    */
+    TInt iEngineError;
+    };
+
+#endif // DIAGENGINEIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagengineobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2007 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:  Observer interface to use with CDiagEngine
+*
+*/
+
+
+#ifndef DIAGENGINEOBSERVER_H
+#define DIAGENGINEOBSERVER_H
+
+
+// SYSTEM INCLUDES
+#include <e32def.h>                 // TUint
+#include <DiagCommonDialog.h>       // TDiagCommonDialog
+#include <DiagAppCommand.h>         // TDiagAppCommand
+
+// FORWARD DECLARATION
+class CDiagResultsDatabaseItem;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Engine Observer
+*
+*  This interface is called by CDiagEngine to notify its client
+*  of progress of requests made to engine.
+*
+* @since S60 v5.0
+*/
+class MDiagEngineObserver
+    {
+public: // Public Data types
+    enum TSuspendReason
+        {
+        ESuspendByClient = 0,
+        ESuspendByPhoneCall
+        };
+
+    enum TResumeReason
+        {
+        EResumedByClient = 0,
+        EAutoResumedByCallHangup
+        };
+
+public: // Public interface
+
+    /**
+    * Notify client of test execution begin. Clients can get testplan using
+    * CDiagEngine::ExecutionPlanL. 
+    */
+    virtual void TestExecutionBeginL() = 0;
+
+    /**
+    * Notify client of test execution progress.
+    *
+    * @param aCurrentItemStep       - Progress in current entry.
+    * @param aCurrentItemTotalSteps - Total steps to execute in current entry.
+    */
+    virtual void TestExecutionProgressL( TUint aCurrentItemStep,
+                                         TUint aCurrentItemTotalSteps ) = 0;
+
+    /**
+    * Notify client of execution completion of one plug-in.
+    *   This can be either test plug-in or suite plug-in.
+    *
+    * @param aError  - KErrNone - Success.
+    *   KErrNoMemory - Out of memory.
+    *   KErrCancel   - Cancelled due to ExecutionStopL()
+    *
+    * @param aResult - Result of the test. Ownership is transferred here. 
+    *  Client must deallocate aResult to avoid memory leak. aResult is Null 
+    *  if the plug-in being executed is a suite pre/post method.
+    */
+    virtual void TestExecutionPluginExecutedL( TInt aError,
+                                               CDiagResultsDatabaseItem* aResult ) = 0;
+
+    /**
+    * Notify client of execution suspend.
+    *
+    * @param aSuspendReason - Why execution is suspended.
+    */
+    virtual void TestExecutionSuspendedL( TSuspendReason aSuspendReason ) = 0;
+
+    /**
+    * Notify client of execution resume.
+    *
+    * @param aResumeReason - Why execution is being resumed
+    */
+    virtual void TestExecutionResumedL( TResumeReason aResumeReason ) = 0;
+
+    /**
+    * Notify client of engine stopping.
+    *
+    * This indicates that engine execution has stopped. There will not be any
+    * further messages from engine. This could be called because all
+    * tests are completed, or an unrecoverable error occured during execution.
+    *
+    * Note that if cancel is called during plan creation or if plan creation
+    * fails, TestExecutionStoppedL() may be called withing first calling
+    * TestExecutionBeginL(). 
+    *
+    * @param aError - Reason for engine stopping. 
+    *   a) KErrNone - All tests are successfully completed.
+    *   b) KErrCancel - ExecutionStopL is called with ECancelAll. 
+    *       Test session cannot be resumed later.
+    *   c) KErrArgument - Parameters passed to engine are invalid.
+    *   d) Others - Other critical that could not be recovered occured during
+    *       test execution.  Test may be resumed later in this case.
+    */
+    virtual void TestExecutionCompletedL( TInt aError ) = 0;
+
+    /**
+    * Create a common Dialog.
+    * Application should create an instance of requested dialog.
+    * For available dialog types, @see DiagCommonDialog.h
+    * 
+    * @param aDialogType - Type of dialog to create.
+    * @param aData - Initialization parameter. Ownership is passed to engine.
+    * @return a pointer to newly created dialog. Ownership is passed to caller.
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData ) = 0;
+
+    /**
+    * Execute a command from plug-in. Parameters are identical to 
+    * MDiagEngineCommon::ExecuteAppCommandL(). 
+    * @see MDiagEngineCommon::ExecuteAppCommandL()
+    * @see TDiagAppCommand
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 ) = 0;
+    };
+
+
+#endif // DIAGENGINEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginestatemachine.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for DiagFwInternal::CStateMachine
+*
+*/
+
+
+#ifndef DIAGENGINESTATEMACHINE_H
+#define DIAGENGINESTATEMACHINE_H
+
+// system include
+#include <e32base.h>
+
+// user include
+#include "diagenginestates.h"   // DiagFwInternal::TState
+#include "diagengineevents.h"   // DiagFwInternal::TEvent
+
+
+namespace DiagFwInternal
+    {
+// forward declaration
+class CEventBasic;
+class MStateMachineObserver;
+
+/**
+*  Diagnostics Framework Engine State Machine
+*
+*  This class implements state machine for CDiagEngine.
+*
+*/
+NONSHARABLE_CLASS( CStateMachine ) : public CActive
+    {
+public:
+    /**
+    * Two-phased constructor.
+    * 
+    * @param aObserver     Engine observer.
+    * @return New instance of CStateMachine
+    */
+    static CStateMachine* NewL( MStateMachineObserver& aObserver );
+    static CStateMachine* NewLC( MStateMachineObserver& aObserver );
+
+    /**
+    * Queue a new event into event queue. 
+    * 
+    * @param aEvent  New event. CStateMachine will own
+    *              the object from this point on.
+    *              It will be freed by CStateMachine when
+    *              the event is processed.
+    */
+    void AddEventL( CEventBasic* aEvent );
+
+    /**
+    * Queue a new event into event queue.
+    * 
+    * @param aEventId  Event Id of new event. CEventBasic will be created.
+    */
+    void AddEventL( TEvent aEventId );
+
+    /**
+    * Current State.
+    * 
+    * @return Current state.
+    */
+    TState CurrentState() const;
+
+    /**
+    * Handle error. This should be called when an abnormal error
+    * occurs (e.g. leave that cannot be handled.)
+    * 
+    * @param aError - Error number.
+    */
+    void HandleError( TInt aError );
+
+    /**
+    * State Name. 
+    * Debugging purpose only. In release build, this function will
+    * return empty string.
+    * 
+    * @param aState - a state 
+    * @return Name of the state
+    */
+    const TDesC& StateName( TState aState ) const;
+
+    /**
+    * C++ Destructor
+    */
+    ~CStateMachine();
+
+protected: // from CActive
+    /**
+    * @see CActive::RunL
+    */
+    virtual void RunL();
+    
+    /**
+    * @see CActive::DoCancel
+    */
+    virtual void DoCancel();
+
+    /**
+    * @see CActive::RunError
+    */
+    virtual TInt RunError( TInt aError );
+
+private:    // private constructors
+    /**
+    * C++ constructor
+    */
+    CStateMachine( MStateMachineObserver& iObserver );
+
+    /**
+    * 2nd phase constructor
+    *
+    */
+    virtual void ConstructL();
+
+private:    // private functions
+    /**
+    * Match states in state table.
+    */
+    TState CheckStateTable( TState aCurrState, TEvent aEvent ) const;
+
+    /**
+    * Complete request and set itself to be active so that the next
+    * item in the queue can be executed.
+    */
+    void ReactivateQueue();
+
+    
+private: // private data
+    /**
+    * iObserver - Observer.
+    */
+    MStateMachineObserver&          iObserver;      
+
+    /**
+    * iEventQueue - array of events to process.
+    */
+    RPointerArray<CEventBasic>      iEventQueue;
+
+    /**
+    * iState - Current state.
+    */
+    TState                          iState;
+    };
+    } // end of namespace DiagFwInternal
+#endif // DIAGENGINESTATEMACHINE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginestatemachineobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for MStateMachineObserver
+*
+*/
+
+
+#ifndef DIAGENGINESTATEMACHINEOBSERVER_H
+#define DIAGENGINESTATEMACHINEOBSERVER_H
+
+// system include
+
+// user include
+#include "diagenginestates.h"   // DiagFwInternal::TState
+#include "diagengineevents.h"   // DiagFwInternal::TEvent
+
+namespace DiagFwInternal
+    {
+// forward declaration
+class CEventBasic;
+
+/**
+ *  Diagnostics Framework Engine State Machine Observer
+ *
+ *  This interface is called by CDiagEngineStateMachine to notify
+ *  its client of state changes and events.
+ *
+ *  @since S60 v5.0
+ */
+class MStateMachineObserver
+    {
+public:
+    /**
+    * Notify state machine client that state machine has entered a new state.
+    *
+    * @param aPreviousState     Previous state.
+    * @param aCurrentState      Current state. (new state.)
+    * @param aEventPreview  Event that caused state change. Note that
+    *   this is just a preview.  HandleEventL() will be called with the same
+    *   event later on.
+    */
+    virtual void HandleStateChangedL( TState aPreviousState, 
+                                      TState aCurrentState,
+                                      const CEventBasic& aEventPreview ) = 0;
+
+    /**
+    * Notify state machine client that a new event is received.
+    *
+    * @param aEvent        New event.
+    */
+    virtual void HandleEventL( CEventBasic& aEvent ) = 0;
+
+    /**
+    * Notify state machine client that an abnormal error has occured.
+    * Client can handle the error and return appropriate error state.
+    *
+    * @param aCurrentState Current state.
+    * @param aError        Error number.
+    * @return TState       New state to go to.
+    */
+    virtual TState HandleError( TState aCurrentState, TInt aError ) = 0;
+    };
+    } // end of namespace DiagFwInternal
+    
+#endif // DIAGENGINESTATEMACHINEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginestates.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for DiagFwInternal::TState
+*
+*/
+
+
+
+#ifndef DIAGENGINESTATES_H
+#define DIAGENGINESTATES_H
+
+namespace DiagFwInternal
+    {
+enum TState
+    {
+    EStateAny               = -1,
+    EStateNotReady,
+    EStateCreatingPlan,
+    EStateRunning,
+    EStateCancelAll,
+    EStateSuspended,
+    EStateFinalizing,
+    EStateStopped
+    };
+    } // end of namespace DiagFwInternal
+
+#endif // DIAGENGINESTATES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagenginewatchdogtypes.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for TDiagEngineWatchdogTypes
+*
+*/
+
+
+
+#ifndef DIAGENGINEWATCHDOGTYPES_H
+#define DIAGENGINEWATCHDOGTYPES_H
+
+/**
+* These types indicate to engine how long it should wait between each
+* test execution progress reports.  
+*
+* Typically, if a test step requires user interaction, engine should wait
+* longer before stopping its execution. For non-interactive steps,
+* engine should not wait as long. 
+* 
+* The actual values are specifed by cenrep key value owned by engine.
+*
+* Values:
+* EDiagEngineWatchdogTypeInteractive - Indicates that engine should
+*   use interactive watchdog timer value.
+*
+* EDiagEngineWatchdogTypeAutomatic - Indicates that engine should
+*   use non-interactive watchdog timer value.
+*
+* @since S60 3.2
+*/
+enum TDiagEngineWatchdogTypes
+    {
+    EDiagEngineWatchdogTypeInteractive   = 0,
+    EDiagEngineWatchdogTypeAutomatic
+    };
+
+#endif // DIAGENGINEWATCHDOGTYPES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagexecplanentry.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagExecPlanEntry
+*
+*/
+
+
+#ifndef DIAGEXECPLANENTRY_H
+#define DIAGEXECPLANENTRY_H
+
+
+// SYSTEM INCLUDE FILES
+#include <e32def.h>         // TBool
+
+// FORWARD DECLARATION
+class MDiagPlugin;
+
+/**
+* Diagnostics Plug-in Execution Plan Entry.
+*
+* This class provides the interface for test execution plan entries.
+*
+* @since S60 v5.0
+*
+*/
+class MDiagExecPlanEntry
+    {
+public: // data types
+    /**
+    * Item execution state.
+    */
+    enum TState
+        {
+        EStateQueued     = 0,   // Execution has not begun.
+        EStateInitDelay,        // Waiting for initial delay timer to expire
+        EStateRunning,          // RunTestL() is called. Waiting for completion.
+        EStateSuspended,        // Execution is suspended
+        EStateStopped,          // Plugin is stopped, but result not logged yet.
+        EStateCompleted         // Result is logged
+        };
+
+public:
+    /**
+    * Plugin associated with the entry
+    *   @return Reference to the plugin.
+    */
+    virtual const MDiagPlugin& Plugin() const = 0;
+
+    /**
+    * Returns whether item is being executed to satisfy dependency or not.
+    *   @return ETrue if item is being executed to satisfy dependency.
+    *       EFalse if item is being executed explicitly.
+    */
+    virtual TBool AsDependency() const = 0;
+
+    /**
+    * Item State
+    *   @return Current state of execution plan item
+    */
+    virtual TState State() const = 0;
+
+    };
+
+#endif // DIAGEXECPLANENTRY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagexecplanentryimpl.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagExecPlanEntryImpl
+*
+*/
+
+
+#ifndef DIAGEXECPLANENTRYIMPL_H
+#define DIAGEXECPLANENTRYIMPL_H
+
+// SYSTEM INCLUDE FILES
+#include <e32base.h>                // CBase
+#include <DiagExecPlanEntry.h>      // MDiagExecPlanEntry
+#include <DiagEngineCommon.h>       // MDiagEngineCommon::TCancelMode
+
+class MDiagExecPlanEntryImplObserver;
+class TDiagEngineConfig;
+
+/**
+* Diagnostics Plug-in Execution Plan Entry Implementation.
+*
+* This class implements MDiagExecPlanEntry. It is meant to be private
+*   to Diagnostics Framework and not exported.
+*
+* @since S60 v5.0
+*
+*/
+NONSHARABLE_CLASS( CDiagExecPlanEntryImpl ) :  public CActive,
+                                               public MDiagExecPlanEntry
+    {
+public:     // Data Types
+    /**
+    * TType - Execution plan entry type. 
+    *   ETypeTestExec           - Test plugin execution.
+    *   ETypeSuitePrepare       - Suite prepare execution
+    *   ETypeSuiteFinalize      - Suite finalize execution
+    *   ETypeSuiteUnexpanded    - Suite before being expanded into 
+    *                               ETypeSuitePrepare or ETypeSuiteFinalize
+    */
+    enum TType
+        {
+        ETypeTestExec = 0,      
+        ETypeSuitePrepare,      
+        ETypeSuiteFinalize,     
+        ETypeSuiteUnexpanded,   
+        };
+
+public:     // Public API
+    /**
+    * C++ destructor 
+    */
+    virtual ~CDiagExecPlanEntryImpl();
+
+    /**
+    * Plugin associated with the entry
+    *   @return Reference to the plugin.
+    */
+    MDiagPlugin& Plugin();      //lint !e1411  This is proper overload
+
+    /**
+    * Get item type
+    *   @return current item type
+    */
+    TType Type() const;
+
+    /**
+    * Update item type
+    *   @param aType - new type.
+    */
+    void SetType( TType aType );
+
+    /**
+    * Update dependency
+    *   @param aAsDependency - ETrue if item is being executed to satisfy 
+    *       dependency. EFalse otherwise.
+    */
+    void SetAsDependency( TBool aAsDependency );
+
+    /**
+    * Handle cancel execution by client. Calling this will case IsStoppedByClient()
+    * to return ETrue.
+    *
+    * @param aCancelMode - Cancellation mode.
+    */
+    void StopExecutionByClientL( MDiagEngineCommon::TCancelMode aCancelMode );
+
+    /**
+    * Check if test was stopped by client.
+    *
+    * @return ETrue if it was stopped by StopExecutionByClientL call. 
+    *   EFalse otherwise.
+    */
+    TBool IsStoppedByClient() const;
+
+    /**
+    * Reset Watchdog to last known value.  
+    * If watchdog was suspended, it will resume. 
+    * If watchdog was not running, this does nothing.
+    */
+    void ResetWatchdog();
+
+    /**
+    * Reset Watchdog to one of the default based on watchdog type
+    * If watchdog was suspended, it will resume. 
+    * If watchdog was not running, this does nothing.
+    * @param aWatchdogType - type of watchdog to use.
+    */
+    void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType );
+
+    /**
+    * Reset watchdog to a specific value.
+    * If watchdog was suspended, it will resume. 
+    * If watchdog was not running, this does nothing.
+    * @param aTimer value - watchdog timer value. 
+    */
+    void ResetWatchdog( TTimeIntervalMicroSeconds32 aWatchdogValue );
+
+    /**
+    * Stop watchdog temporarily.
+    */
+    void StopWatchdogTemporarily();
+
+public:     // APIs to be implemented by derived class
+    /**
+    * Execute plan entry. To cancel request, call Cancel()
+    */
+    virtual void ExecuteL() = 0;
+
+    /**
+    * Suspend execution.
+    */
+    virtual void SuspendL() = 0;
+
+    /**
+    * Resume suspended execution.
+    */
+    virtual void ResumeL() = 0;
+
+public:    // From MDiagExecPlanEntry
+    /**
+    * Plugin associated with the entry
+    *   @see MDiagExecPlanEntry::Plugin
+    */
+    const MDiagPlugin& Plugin() const;
+
+    /**
+    * Returns whether item is being executed to satisfy dependency or not.
+    *   @see MDiagExecPlanEntry::AsDepndent
+    */
+    TBool AsDependency() const;
+
+    /**
+    * Item State
+    *   @see MDiagExecPlanEntry::State
+    */
+    TState State() const;
+
+
+protected:  // API for derived class
+    /**
+    * C++ Constructor
+    *   This is protected since it should not be created directly.
+    *   Use one of the derived class version.
+    *
+    *   @param aEngine - Reference to the engine.
+    *   @param aEngineConifg - Reference to the engine configuration.
+    *   @param aPlugin - Reference to the plug-in.
+    *   @param aAsDependent - Whether it is being executed as dependent test.
+    *   @param aType - Type of entry. @see CDiagExecPlanEntryImpl::TType
+    */
+    CDiagExecPlanEntryImpl( MDiagEngineCommon& aEngine,
+                            const TDiagEngineConfig& aEngineConfig,
+                            MDiagExecPlanEntryImplObserver& aObserver,
+                            MDiagPlugin& aPlugin,
+                            TBool aAsDependency,
+                            TType aType );
+
+    /**
+    * Get Engine reference
+    * 
+    * @return reference to engine.
+    */
+    MDiagEngineCommon& Engine();
+
+    /**
+    * Get Engine configuration reference
+    * 
+    * @return Reference to engine configuration.
+    */
+    const TDiagEngineConfig& EngineConfig() const;
+
+    /**
+    * Get observer.
+    * 
+    * @return Reference to plan entry observer.
+    */
+    MDiagExecPlanEntryImplObserver& Observer();
+
+    /**
+    * Change current state to a new state.  
+    *   @param aState - new state to set to.
+    */
+    void ChangeStateL( TState aState );
+
+protected:  // API to be implemented by derived class.
+    /**
+    * Handle cancel execution by client.
+    *
+    * @param aCancelMode - Cancellation mode.
+    */
+    virtual void DoStopExecutionByClientL( MDiagEngineCommon::TCancelMode aCancelMode ) = 0;
+
+    /**
+    * Watchdog timeout stop.
+    */
+    virtual void StopExecutionByWatchdogL() = 0;
+
+
+private:    // private methods
+    /**
+    * Watchdog timer timeout handler.
+    * @param aPtr - pointer to *this* object.
+    */
+    static TInt WatchdogTimerExpiredL( TAny* aPtr );
+
+private:    // Private data
+    /**
+    * Engine
+    */
+    MDiagEngineCommon& iEngine;
+
+    /**
+    * Engine Configuration.
+    */
+    const TDiagEngineConfig& iEngineConfig;
+
+    /**
+    * Observer
+    */
+    MDiagExecPlanEntryImplObserver& iObserver;
+
+    /**
+    * Plug-in
+    */
+    MDiagPlugin& iPlugin;
+
+    /**
+    * Indicates whether it is being executed as dependent test.
+    */
+    TBool iAsDependency;
+
+    /**
+    * Indicates whether execution is stopped by client.
+    */
+    TBool iStoppedByClient;
+
+    /**
+    * Current item state
+    *   @see MDiagExecPlanEntry::TState
+    */
+    TState iState;
+
+    /**
+    * Current item type
+    *   @see CDiagExecPlanEntryImpl::TType
+    */
+    TType iType;
+    
+    /**
+    * Watchdog timer value. It is a microsecond value to be used with 
+    * watchdog timer.
+    */
+    TTimeIntervalMicroSeconds32 iWatchdogValue;
+
+    /**
+    * Watchdog timer
+    * Owership: this.
+    */
+    CPeriodic* iWatchdogTimer;
+
+    };
+
+#endif // DIAGEXECPLANENTRY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagexecplanentryimplobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for MDiagExecPlanEntryImplObserver.h
+*
+*/
+
+
+#ifndef DIAGEXECPLANENTRYIMPLOBSERVER_H
+#define DIAGEXECPLANENTRYIMPLOBSERVER_H
+
+
+class CDiagExecPlanEntryImpl;
+
+/**
+* Diagnostics Plug-in Execution Plan Entry Observer Interface
+*
+* This interface is called by CDiagExecPlanEntryImpl and its derived classes
+* to notify progress of plugin execution.
+*
+* @since S60 v5.0
+*
+*/
+class MDiagExecPlanEntryImplObserver
+    {
+public:
+    /**
+    * Notify plugin execution progress
+    * @param aSender        - Reference to the plan entry that caused this event.
+    * @param aCurrentStep   - current execution step.
+    * @param aTotalSteps    - Total number of steps to execute.
+    */
+    virtual void ExecPlanEntryProgressL( CDiagExecPlanEntryImpl& aSender,
+                                         TUint aCurrentStep,
+                                         TUint aTotalSteps ) = 0;
+
+    /**
+    * Notify plugin execution completion. 
+    *   This is called only when it is completed normally.
+    *   It will not becalled if execution is interrupted by watchdog or by client.
+    * @param aSender        - Reference to the plan entry that caused this event.
+    */
+    virtual void ExecPlanEntryExecutedL( CDiagExecPlanEntryImpl& aSender ) = 0;
+
+    /**
+    * Notify that a critical error has occured.
+    *   This is called when there is a critical execution error
+    *   that cannot be recovered. Engine should not execute any
+    *   more plug-ins after this point.
+    * @param aError - Error number.
+    */
+    virtual void ExecPlanEntryCriticalError( TInt aError ) = 0;
+    };
+
+#endif // DIAGEXECPLANENTRYIMPLOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagexecplanentryimplsuite.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagExecPlanEntryImplSuite
+*
+*/
+
+
+#ifndef DIAGEXECPLANENTRYIMPLSUITE_H
+#define DIAGEXECPLANENTRYIMPLSUITE_H
+
+// SYSTEM INCLUDE FILES
+#include <DiagSuitePlugin.h>            // MDiagSuitePlugin::TStopReason
+#include <DiagSuiteObserver.h>          // MDiagSuiteObserver
+
+// USER INCLUDE FILES
+#include "diagexecplanentryimpl.h"      // CDiagExecPlanEntryImpl
+
+// FORWARD DECLARATION
+class MDiagSuitePlugin;
+
+/**
+* Diagnostics Plug-in Execution Plan Entry Implementation for Suite plugin
+*
+* This class implements CDiagExecPlanEntryImplSuite. It is meant to be private
+*   to Diagnostics Framework and not exported.
+*
+* @since S60 v5.0
+*
+*/
+NONSHARABLE_CLASS( CDiagExecPlanEntryImplSuite ) : public CDiagExecPlanEntryImpl,
+                                                   public MDiagSuiteObserver
+    {
+public: // Public constructors and destructors
+    /**
+    * Symbian two-phased constructor
+    *   
+    * @param aEngine - Diagnostics Engine
+    * @param aEngineConfig - Engine configuration.
+    * @param aObserver - Execution plan entry observer.
+    * @param aPlugin - Suite plug-in that this plan entry represents.
+    * @param aAsDependency - Whether this item is being executed as dependency or not.
+    * @param aType - Type of execution. @see CDiagExecPlanEntryImpl::TType
+    *
+    * @return a new instance of CDiagExecPlanEntryImplSuite
+    */
+    static CDiagExecPlanEntryImplSuite* NewL( MDiagEngineCommon& aEngine,
+                                              const TDiagEngineConfig& aEngineConfig,
+                                              MDiagExecPlanEntryImplObserver& aObserver,
+                                              MDiagSuitePlugin& aPlugin,
+                                              TBool aAsDependency,
+                                              TType aType );
+
+    /**
+    * Symbian two-phased constructor
+    *  This will leave a entry in clean up stack.
+    *
+    * @param aEngine - Diagnostics Engine
+    * @param aEngineConfig - Engine configuration.
+    * @param aObserver - Execution plan entry observer.
+    * @param aPlugin - Suite plug-in that this plan entry represents.
+    * @param aAsDependency - Whether this item is being executed as dependency or not.
+    * @param aType - Type of execution. @see CDiagExecPlanEntryImpl::TType
+    *
+    * @return a new instance of CDiagExecPlanEntryImplSuite
+    */
+    static CDiagExecPlanEntryImplSuite* NewLC( MDiagEngineCommon& aEngine,
+                                               const TDiagEngineConfig& aEngineConfig,
+                                               MDiagExecPlanEntryImplObserver& aObserver,
+                                               MDiagSuitePlugin& aPlugin,
+                                               TBool aAsDependency,
+                                               TType aType );
+
+    /**
+    * C++ destructor
+    */
+    virtual ~CDiagExecPlanEntryImplSuite();
+
+public:     // new public api
+    /**
+    * Get suite plugin associated.
+    */
+    MDiagSuitePlugin& SuitePlugin();
+
+private:    // from CActive
+    /*
+    * @see CActive::RunL
+    */
+    virtual void RunL();
+
+    /*
+    * @see CActive::DoCancel
+    */
+    virtual void DoCancel();
+    
+
+private:     // from CDiagExecPlanEntryImpl
+    /**
+    * @see CDiagExecPlanEntryImpl::ExecuteL
+    */
+    virtual void ExecuteL();
+
+    /**
+    * @see CDiagEXecPlanEntryImpl::StopExecutionByWatchdogL
+    */
+    virtual void StopExecutionByWatchdogL();
+
+    /**
+    * @see CDiagEXecPlanEntryImpl::StopExecutionByClientL
+    */
+    virtual void DoStopExecutionByClientL( MDiagEngineCommon::TCancelMode aCancelMode );
+
+    /**
+    * @see CDiagEXecPlanEntryImpl::SuspendL
+    */
+    virtual void SuspendL();
+
+    /**
+    * @see CDiagEXecPlanEntryImpl::ResumeL
+    */
+    virtual void ResumeL();
+
+
+private: // from MDiagSuiteObserver
+    /**
+    * Notify engine of suite plug-in execution completion.
+    * 
+    * @see MDiagSuitePlugin::ContinueExecutionL
+    */
+    virtual void ContinueExecutionL( const MDiagSuitePlugin& aSender );
+
+
+private:    // private methods
+    /**
+    * C++ constructor
+    *   
+    * @param aEngine - Diagnostics Engine
+    * @param aEngineConfig - Engine configuration.
+    * @param aObserver - Execution plan entry observer.
+    * @param aPlugin - Suite plug-in that this plan entry represents.
+    * @param aAsDependency - Whether this item is being executed as dependency or not.
+    * @param aType - Type of execution. @see CDiagExecPlanEntryImpl::TType
+    */
+    CDiagExecPlanEntryImplSuite( MDiagEngineCommon& aEngine,
+                                 const TDiagEngineConfig& aEngineConfig,
+                                 MDiagExecPlanEntryImplObserver& aObserver,
+                                 MDiagSuitePlugin& aPlugin,
+                                 TBool aAsDependency,
+                                 TType aType );
+
+    /**
+    * Stop suite plug-in.
+    * 
+    * @param aStopReason - Stop reason to pass to suite.
+    */
+    void StopSuitePluginL( MDiagSuitePlugin::TStopReason aStopReason );
+    };
+
+#endif // DIAGEXECPLANENTRYIMPLSUITE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagexecplanentryimpltest.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagExecPlanEntryImplTest
+*
+*/
+
+
+#ifndef DIAGEXECPLANENTRYIMPLTEST_H
+#define DIAGEXECPLANENTRYIMPLTEST_H
+
+// SYSTEM INCLUDE FILES
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem::TResult
+#include <DiagTestObserver.h>           // MDiagTestObserver
+#include <DiagTestPlugin.h>             // MDiagTestPlugin::TStopReason
+
+// USER INCLUDE FILES
+#include "diagexecplanentryimpl.h"      // CDiagExecPlanEntryImpl
+
+// FORWARD DECLARATION
+class MDiagTestPlugin;
+
+/**
+* Diagnostics Plug-in Execution Plan Entry Implementation for test plugin
+*
+* This class implements CDiagExecPlanEntryImplTest. It is meant to be private
+*   to Diagnostics Framework and not exported.
+*
+* @since S60 v5.0
+*
+*/
+NONSHARABLE_CLASS( CDiagExecPlanEntryImplTest ): public CDiagExecPlanEntryImpl,
+                                                 public MDiagTestObserver
+    {
+public: // Public constructors and destructors
+    /**
+    * Symbian two-phased constructor
+    *
+    * @param aEngine - Diagnostics Engine
+    * @param aEngineConig - Engine configuration.
+    * @param aObserver - Execution plan entry observer.
+    * @param aPlugin - Test plug-in that this plan entry represents.
+    * @param aAsDependency - Whether this item is being executed as dependency or not.
+    * @param aResult - Initial result. 
+    *
+    * @return a new instance of CDiagExecPlanEntryImplTest
+    */
+    static CDiagExecPlanEntryImplTest* NewL( MDiagEngineCommon& aEngine,
+                                             const TDiagEngineConfig& aEngineConfig,
+                                             MDiagExecPlanEntryImplObserver& aObserver,
+                                             MDiagTestPlugin& aPlugin,
+                                             TBool aAsDependency,
+                                             CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Symbian two-phased constructor.
+    * This will put an entry in cleanup stack.
+    *
+    * @param aEngine - Diagnostics Engine
+    * @param aEngineConig - Engine configuration.
+    * @param aObserver - Execution plan entry observer.
+    * @param aPlugin - Test plug-in that this plan entry represents.
+    * @param aAsDependency - Whether this item is being executed as dependency or not.
+    * @param aResult - Initial result. 
+    *
+    * @return a new instance of CDiagExecPlanEntryImplTest
+    */
+    static CDiagExecPlanEntryImplTest* NewLC( MDiagEngineCommon& aEngine,
+                                              const TDiagEngineConfig& aEngineConfig,
+                                              MDiagExecPlanEntryImplObserver& aObserver,
+                                              MDiagTestPlugin& aPlugin,
+                                              TBool aAsDependency,
+                                              CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * C++ destructor
+    */
+    virtual ~CDiagExecPlanEntryImplTest();
+
+public:     // new public api
+    /**
+    * Get test result
+    *   @return Test result enum.
+    */
+    CDiagResultsDatabaseItem::TResult Result() const;
+
+    /**
+    * Set test result
+    *   @param aResult - Test result.
+    */
+    void SetResult( CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Get result database item. If cached value is available, it will use
+    * cached value. Otherwise, it will retrieve from database.
+    *   @return Test result item from database. Ownership is transferred.
+    */
+    CDiagResultsDatabaseItem* GetLastTestResultL();
+
+    /**
+    * Get test plugin associated.
+    * @return a reference to test plug-in that this entry represents.
+    */
+    MDiagTestPlugin& TestPlugin();
+
+private:    // from CActive
+    /*
+    * @see CActive::RunL
+    */
+    virtual void RunL();
+
+    /*
+    * @see CActive::DoCancel
+    */
+    virtual void DoCancel();
+
+    /*
+    * @see CActive::RunError
+    */
+    virtual TInt RunError( TInt aError );
+
+private:    // from CDiagExecPlanEntryImpl
+    /**
+    * @see CDiagExecPlanEntryImpl::ExecuteL
+    */
+    virtual void ExecuteL();
+
+    /**
+    * @see CDiagExecPlanEntryImpl::StopExecutionByWatchdogL
+    */
+    virtual void StopExecutionByWatchdogL();
+
+    /**
+    * @see CDiagExecPlanEntryImpl::DoStopExecutionByClientL
+    */
+    virtual void DoStopExecutionByClientL( MDiagEngineCommon::TCancelMode aCancelMode );
+
+    /**
+    * @see CDiagExecPlanEntryImpl::SuspendL
+    */
+    virtual void SuspendL();
+
+    /**
+    * @see CDiagExecPlanEntryImpl::ResumeL
+    */
+    virtual void ResumeL();
+
+private:    // from MDiagTestObserver
+    /**
+    * Notify engine of test plug-in execution progress.
+    * @see MDiagTestObserver::TestProgressL
+    */
+    virtual void TestProgressL( const MDiagTestPlugin& aSender, 
+                                TUint aCurrentStep );
+
+    /**
+    * Notify engine of test plug-in execution completion.
+    * @see MDiagTestObserver::TestExecutionCompletedL
+    */
+    virtual void TestExecutionCompletedL( const MDiagTestPlugin& aSender, 
+                                          CDiagResultsDatabaseItem* aTestResult );
+    
+    
+private:    // Private methods
+    /**
+    * c++ constructor.
+    *
+    * @param aEngine - Diagnostics Engine
+    * @param aEngineConig - Engine configuration.
+    * @param aObserver - Execution plan entry observer.
+    * @param aPlugin - Test plug-in that this plan entry represents.
+    * @param aAsDependency - Whether this item is being executed as dependency or not.
+    * @param aResult - Initial result. 
+    */
+    CDiagExecPlanEntryImplTest( MDiagEngineCommon& aEngine,
+                                const TDiagEngineConfig& aEngineConfig,
+                                MDiagExecPlanEntryImplObserver& aObserver,
+                                MDiagTestPlugin& aPlugin,
+                                TBool aAsDependency,
+                                CDiagResultsDatabaseItem::TResult aResult );
+    
+    /**
+    * Starts executing test.
+    */
+    void DoExecuteTestPluginL();
+
+    /**
+    * Stop test plugin
+    */
+    CDiagResultsDatabaseItem* StopTestPluginL( MDiagTestPlugin::TStopReason aReason );
+
+    /**
+    * Handler function for initial delay timer expiration.
+    */
+    static TInt HandleDelayTimerExpiredL( TAny* aData );
+
+    /**
+    * Stop initial delay timer.
+    */
+    void StopInitDelayTimer();
+
+    /**
+    * Stop all active requests and timers.
+    */
+    void StopAll();
+
+    /**
+    * Stops test execution, but test result is not reported.
+    */
+    void StopExecutionAndIgnoreResultL();
+
+    /**
+    * Get human readable name for test result. This is meant for debugging
+    * purpose only. In non-debug build, it will return empty string.
+    */
+    static const TDesC& TestResultString( CDiagResultsDatabaseItem::TResult aResult );
+
+
+private:    // private data
+    /**
+    * Test result
+    */
+    CDiagResultsDatabaseItem::TResult iResult;
+
+    /**
+    * Plugin test initial delay timer.
+    * Ownership - this
+    */
+    CPeriodic* iInitDelayTimer;
+
+    /**
+    * Cached test result. This stores test result temporarily, so that database access
+    * could be avoided. Currently, cache will remain only for one request after
+    * test is completed.
+    * Ownership - this
+    */
+    CDiagResultsDatabaseItem* iCachedResult;
+
+    };
+
+#endif // DIAGEXECPLANENTRYIMPLTEST_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagframework.pan	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 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:  Enum definition of Framdwork Panic Codes
+*
+*/
+
+
+#ifndef DIAGFRAMEWORK_PAN
+#define DIAGFRAMEWORK_PAN
+
+/**
+* Panic Codes for Diagnostics Framework
+* 
+* @since 5.0
+*/
+enum TDiagFrameworkPanics
+    {
+    EDiagFrameworkBadArgument           = 1,    // Invalid input parameter
+    EDiagFrameworkInvalidState          = 2,    // Function called in incorrect state
+    EDiagFrameworkInvalidEvent          = 3,    // Even not valid in current state.
+    EDiagFrameworkCorruptStateMachine   = 4,    // State machine may be corrupted.
+    EDiagFrameworkArrayBounds           = 5,    // Array out of bounds
+    EDiagFrameworkCorruptPlugin         = 6,    // Plug-in information is corrupted.
+    EDiagFrameworkNullTestResult        = 7,    // Test result is NULL
+    EDiagFrameworkInternal              = 8,    // Other framework internal error
+    EDiagFrameworkDb                    = 9,    // Database related errors.
+    EDiagFrameworkPlugin                = 10    // General plug-in behavior error
+    };
+
+_LIT(KDiagFwCategory,"Diag Fw");
+
+inline void Panic( TDiagFrameworkPanics aReason )
+    {
+    User::Panic( KDiagFwCategory, aReason );
+    }
+
+#endif // DIAGFRAMEWORK_PAN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagframeworkdebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2007 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:  Debugging trace definition for framework and plug-ins.
+*
+*/
+
+
+#ifndef DIAGFRAMEWORKDEBUG_H
+#define DIAGFRAMEWORKDEBUG_H
+
+/**
+* Diagnostics Framework Debug Traces
+*
+* This header file defines common debug trace macros for Diagnostics Framework.
+* It is used by the diagnostics framework internally. However, it is 
+* recomanded that application and plug-ins use the macros defined here
+* in order to allow consistent logging.
+*
+* Debugging messages are enabled only on non DEBUG build. 
+*
+* These macros can be configured to use either Flogger (RFileLogger) or
+* RDebug.  By default, it will use RFileLogger. If RDebug trace is needed,
+* uncomment //#define DIAG_DEBUG_LOG_USE_RDEBUG below.
+*
+* The following macros are provided by this files.
+*
+* LOGTEXT( aDescriptor );   
+*   - This prints a descriptor to log. E.g. if you have a TDesC type, then
+*   you can use this. e.g.
+*
+*       void CMyClass::PrintSomeText( const TDesC& aText )
+*           {
+*           LOGTEXT( aText );
+*           }
+* 
+* LOGSTRING( aFormat )
+* LOGSTRING2( aFormat, a );
+* LOGSTRING3( aFormat, a, b );
+* LOGSTRING4( aFormat, a, b, c );
+* LOGSTRING5( aFormat, a, b, c, d );
+*   - These macros are used to print debugging messages with formatting text 
+*   and several arguments. Formatting string is similar to printf.
+*
+*       void CMyClass::PrintSomeText( TInt aInt, TInt aHex )
+*           {
+*           LOGSTRING( "CMyClass::PrintSomeText() Enter" );
+*           LOGSTRING3( "CMyClass::PrintSomeText() aInt = %d, aHex = 0x%08x", 
+*                       aInt, 
+*                       aHex );
+*           }
+*
+*/
+
+#define ENABLE_DIAG_DEBUG_LOG       // Enable diagnostics debug log
+//#define DIAG_DEBUG_LOG_USE_RDEBUG   // Use RDebug::Print instead of flogger.
+
+#if ( defined _DEBUG && defined ENABLE_DIAG_DEBUG_LOG )
+
+#ifdef DIAG_DEBUG_LOG_USE_RDEBUG
+
+#include <e32debug.h> // RDebug
+
+#define LOGTEXT( aDescriptor )                              \
+    {                                                       \
+    RDebug::Print( aDescriptor );                           \
+    }
+
+#define LOGSTRING( aFormat )                                \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat );                               \
+    }
+
+#define LOGSTRING2( aFormat, a )                            \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a );                            \
+    }
+
+#define LOGSTRING3( aFormat, a, b )                         \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a, b );                         \
+    }
+
+#define LOGSTRING4( aFormat, a, b, c )                      \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a, b, c );                      \
+    }
+
+#define LOGSTRING5( aFormat, a, b, c, d )                   \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a, b, c, d );                   \
+    }
+
+#else // #ifdef DIAG_DEBUG_LOG_USE_RDEBUG
+
+// SYSTEM INCLUDES
+#include <flogger.h>
+
+// CONSTANTS
+_LIT( KDiagFrameworkLogFolder,  "DiagFramework" );
+_LIT( KDiagFrameworkLogFile,    "LOG.TXT" );
+
+// MACROS
+#define LOGTEXT( aDescriptor )                              \
+    {                                                       \
+    RFileLogger::Write( KDiagFrameworkLogFolder(),          \
+                        KDiagFrameworkLogFile(),            \
+                        EFileLoggingModeAppend,             \
+                        aDescriptor );                      \
+    }
+
+#define LOGSTRING( aFormat )                                \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::Write( KDiagFrameworkLogFolder(),          \
+                        KDiagFrameworkLogFile(),            \
+                        EFileLoggingModeAppend,             \
+                        KFormat() );                        \
+    }
+
+#define LOGSTRING2( aFormat, a )                            \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a );                          \
+    }
+
+#define LOGSTRING3( aFormat, a, b )                         \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a, b );                       \
+    }
+
+#define LOGSTRING4( aFormat, a, b, c )                      \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a, b, c );                    \
+    }
+
+#define LOGSTRING5( aFormat, a, b, c, d )                   \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend, \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a, b, c, d );                 \
+    }
+
+#endif // #else DIAG_DEBUG_LOG_USE_RDEBUG
+
+#else   // _DEBUG && ENABLE_DIAG_DEBUG_LOG
+
+#define LOGTEXT( aDescriptor )
+#define LOGSTRING( aFormat )
+#define LOGSTRING2( aFormat, a )
+#define LOGSTRING3( aFormat, a, b )
+#define LOGSTRING4( aFormat, a, b, c )
+#define LOGSTRING5( aFormat, a, b, c, d )
+
+#endif  // else _DEBUG && ENABLE_DIAG_DEBUG_LOG
+
+#endif // DIAGFRAMEWORKDEBUG_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diaglogeventeraser.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Logs Event Eraser.
+*
+*/
+
+
+#ifndef DIAGLOGEVENTERASER_H
+#define DIAGLOGEVENTERASER_H
+
+// Include Files
+#include <e32base.h>                    // CActive
+#include <f32file.h>                    // RFs
+
+// Forward Declarations
+class MDiagLogEventEraserObserver;
+class CActiveSchedulerWait;
+class CLogClient;
+class CLogViewEvent;
+class CLogFilter;
+
+/**
+* Diagnostics Plugin Log Event Eraser
+*
+* This class is used to remove log events generated by diagnostics plugins.
+* Events could be anything that is logged by the system log, such as call or
+* data use records.
+*
+* @lib euser.lib
+* @lib logcli.lib 
+* @lib efsrv.lib
+* @lib flogger.lib
+*/
+NONSHARABLE_CLASS( CDiagLogEventEraser ) : public CActive
+    {
+
+public: // New functions
+
+    /**
+    * Symbian OS two-phase constructor.
+    *
+    * @param aObserver A reference to the observer for this event eraser.
+    * @param aFilter The filter to be used for log erasure.  Clients may pass
+    *                NULL for no filtering.  Ownership is transferred.
+    * @return An pointer to the new instance of CDiagLogEventEraser.
+    */
+    IMPORT_C static CDiagLogEventEraser* NewL(
+        MDiagLogEventEraserObserver& aObserver,
+        CLogFilter* aFilter = NULL );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagLogEventEraser();
+
+    /**
+    * This gets the filter used for the log erasure.  Clients which want to
+    * filter the logs to be erased must call this function and set the
+    * appropriate filter before calling StartAsyncEraseLogsL or EraseLogsL.
+    *
+    * @return The filter to apply to the logs to check for erasure.
+    */
+    IMPORT_C CLogFilter& Filter();
+
+    /**
+    * This gets the log client used for the log erasure.
+    *
+    * @return The log client used for log erasure.
+    */
+    IMPORT_C CLogClient& LogClient();
+
+    /**
+    * This starts an asynchronous log erase operation.  The completion of this
+    * request is notified by MDiagLogEventEraserObserver::CompleteEventEraseL.
+    */
+    IMPORT_C void StartAsyncEraseLogsL();
+
+    /**
+    * This performs a synchronous log erase operation.  The function will
+    * leave if there is any error in log erasure.
+    */
+    IMPORT_C void EraseLogsL();
+
+
+private: // New functions
+
+    /**
+    * C++ default constructor.
+    *
+    * @param aObserver A reference to the observer for this event eraser.
+    * @param aFilter The filter to be used for log erasure.  If NULL is
+    *                passed, a new filter will be created during the second
+    *                phase of construction.  Ownership is transferred.
+    */
+    CDiagLogEventEraser( MDiagLogEventEraserObserver& aObserver,
+                         CLogFilter* aFilter );
+    
+    /**
+    * Symbian OS default constructor.
+    */
+    void ConstructL();
+
+    /**
+    * Handles the completion of log erasing and performs different operations
+    * depending on whether the erasing was asynchronous or not.
+    */
+    void HandleCompletionL( TInt aError );
+
+
+private: // From base class CActive
+
+    /**
+    * Handle active object completion event.
+    */
+    virtual void RunL();
+
+    /**
+    * Handle active object cancel event.
+    */
+    virtual void DoCancel();
+
+
+private: // Data
+
+    /** The state of the log erasing operation. */
+    enum TDiagLogEventEraserState
+        {
+        EStateInitial = 0,
+        EStateApplyingFilter,
+        EStateReadingEntries,
+        EStateDeletingEntry,
+        EStateComplete
+        };
+
+    /** The observer for this instance of the log event eraser. */
+    MDiagLogEventEraserObserver& iObserver;
+
+    /** The active scheduler, used for synchronous log erasure.  Own. */
+    CActiveSchedulerWait* iWaitScheduler;
+
+    /** The Log client.  Own. */
+    CLogClient* iLogClient;
+
+    /** The Log view.  Own. */
+    CLogViewEvent* iLogView;
+
+    /** The Log filter.  Own. */
+    CLogFilter* iLogFilter;
+
+    /** A file server session used to delete the logs. */
+    RFs iFsSession;
+
+    /** The internal state of the log event eraser. */
+    TDiagLogEventEraserState iState;
+
+    /** Indicates if the log event eraser is running a synchronous delete. */
+    TBool iIsDeletingSynchronous;
+
+    /** The return code for syncronous operation. */
+    TInt iError;
+    };
+
+#endif // DIAGLOGEVENTERASER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diaglogeventeraserobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Logs Event Eraser
+*                 Observer class, which clients implement to receive events
+*                 from the Event Eraser.
+*
+*/
+
+
+#ifndef DIAGLOGEVENTERASEROBSERVER_H
+#define DIAGLOGEVENTERASEROBSERVER_H
+
+// Forward Declarations
+class CLogEvent;
+
+/**
+* Diagnostics Plugin Log Event Eraser Observer
+*   
+* This is a pure virtual class that clients of the Event Eraser must implement
+* to receive callbacks from the Log Event Eraser.
+*/
+class MDiagLogEventEraserObserver
+    {
+
+public: // New functions
+
+    /**
+    * This function is called to check if the log event needs to be deleted.
+    *
+    * @param aEvent The event to check.
+    * @return ETrue if the log event should be deleted, EFalse otherwise.
+    */
+    virtual TBool IsEventToBeDeleted( const CLogEvent& aEvent ) = 0;
+    
+    /**
+    * This function is called to notify that the erase operation is complete.
+    *
+    * @param aError Error code to indicate erase failure, or KErrNone.
+    */           
+    virtual void CompleteEventEraseL( TInt aError ) = 0;
+
+    };
+
+#endif // DIAGLOGEVENTERASEROBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagnetworkregstatusobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Network registration
+*                 status observer interface
+*
+*/
+
+
+#ifndef DIAGNETWORKREGSTATUSOBSERVER_H
+#define DIAGNETWORKREGSTATUSOBSERVER_H
+
+/**
+* Diagnostics Plugin Network registration status observer interface
+*   
+* This is an abstract class which plugins must derive and implement to receive
+* call-backs from the Diagnostics Network registration status observer.
+*/
+class MDiagNetworkRegStatusObserver
+    {
+public:
+    /**
+    * This function is used to inform the intial network registration status
+    *
+    * @param aRegistered. 
+    *  ETrue :The device is currently registered on the network
+    *  EFalse:The device is currently not registered on the network.
+    */
+    virtual void InitialNetworkRegistrationStatusL( const TBool& aRegistered ) = 0;
+    
+    /**
+    * This interface is used to inform the clients of any changes in the network registration
+    * status
+    *
+    * @param aRegistered
+    * ETrue :The device has now changed to registered status.
+    * EFalse:The device has now lost network coverage.
+    */    
+    virtual void NetworkRegistrationStatusChangeL( const TBool& aRegistered ) = 0;
+    };
+
+#endif // DIAGNETWORKREGSTATUSOBSERVER_H
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagnetworkregstatuswatcher.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Network registration
+*                 status watcher.
+*
+*/
+
+
+#ifndef DIAGNETWORKREGSTATUSWATCHER_H
+#define DIAGNETWORKREGSTATUSWATCHER_H
+
+// Include files
+#include <e32base.h>        // CActive
+#include <etel3rdparty.h>   // CTelephony
+
+//Forward declaration
+class MDiagNetworkRegStatusObserver;
+
+
+/**
+* Diagnostics Network registration status watcher
+*
+* This class can be used as an observer for network status. After 
+* instantiating the class and calling StartObserver(), the class firstly 
+* informs the client of the current registration status and then goes into
+* an observing mode for any changes in the network registration status.
+*
+*/
+class CDiagNetworkRegStatusWatcher : public CActive
+    {
+public:
+
+    /**
+    * Symbian OS constructor.
+    *
+    * @param aCallBack A reference to the callback for this network
+             registration status watcher
+    * @return An pointer to the new instance of CDiagNetworkRegStatusWatcher.
+    */
+    IMPORT_C static CDiagNetworkRegStatusWatcher* NewL(
+                    MDiagNetworkRegStatusObserver& aCallBack );
+    
+    /**
+    * Default C++ virtual destructor
+    */               
+    IMPORT_C virtual ~CDiagNetworkRegStatusWatcher();
+    
+    /**
+    * This function is used by client to start the watcher. Firstly, the
+    * watcher will inform the clients via call
+    * MDiagNetworkRegStatusObserver::InitialNetworkRegistrationStatusL()
+    * and then go into an observing mode for any changes in the network
+    * registration status. The changes status is informed via 
+    * MDiagNetworkRegStatusObserver::NetworkRegistrationStatusChangeL()
+    */    
+    IMPORT_C void StartObserver();
+    
+
+    /**
+    * This function is used by client to stop the observer.
+    */     
+    IMPORT_C void StopObserver();
+
+private:
+
+    /**
+    * C++ constructor.
+    *
+    * @param aCallBack A reference to the callback for Network
+    * registration status observer
+    */
+    CDiagNetworkRegStatusWatcher( MDiagNetworkRegStatusObserver&
+                                                            aCallBack );
+   
+    /**
+    * Symbian C++ 2nd phase constructor.
+    *
+    */    
+    void ConstructL();
+
+private: // From base class CActive
+
+    /**
+    * Handle active object completion event.
+    */
+    virtual void RunL();
+
+    /**
+    * Handle active object cancel event.
+    */
+    virtual void DoCancel();
+    
+private: // private functions
+
+    /**
+    * Handler for the internal state EStateWaitForInitialStatus
+    */
+    void HandleInitialStatusL();
+    
+    /**
+    * Handler for the internal state EStateWaitForStatusChange
+    */    
+    void HandleNetworkStatusChangeL();
+
+    /**
+    * This function wraps the logic to decide if the device is currently 
+    * registered or not.
+    *
+    * @return ETrue if the devide is registered, EFalse if the device is 
+    * not registered.
+    */
+    TBool IsDeviceRegisteredOnNetwork();
+    
+private:
+
+    /** States of the Network registration status watcher */
+    enum TDiagNetwRegStatusWatcherState
+        {
+        EStateInit = 0,
+        EStateWaitForInitialStatus,
+        EStateWaitForStatusChange,
+        EStateStopping
+        };
+    
+    /** variable to store the internal state of the network registration
+    *   status watcher
+    */
+    TDiagNetwRegStatusWatcherState iState;        
+
+    /** Interface to phone's telephony system.  Own. */
+    CTelephony* iTelephony;
+    
+    /** Defines the current network registration status */    
+    CTelephony::TNetworkRegistrationV1 iRegV1;
+    
+    /** A typedef'd packaged CTelephony::TNetworkRegistrationV1 for
+    passing through a generic API method. */    
+    CTelephony::TNetworkRegistrationV1Pckg iRegV1Pckg;        
+                        
+    /** The callback interface for this instance of Network
+    registration status observer */
+    MDiagNetworkRegStatusObserver& iCallBack; 
+
+    /** This variable remembers whether in previous state the 
+    * the device was registered or not
+    */
+    TBool iPreviouslyRegistered;
+    };
+
+#endif // DIAGNETWORKREGSTATUSWATCHER_H
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagnosticsfwprivatecrkeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2007 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:  Private Central Repository keys.
+*
+*/
+
+
+#ifndef DIAGNOSTICSFWPRIVATECRKEYS_H
+#define DIAGNOSTICSFWPRIVATECRKEYS_H
+
+//  INCLUDES
+
+#include <e32std.h>
+
+// =============================================================================
+// Diagnostics Framework
+// =============================================================================
+
+const TUid KCRUidDiagnosticsFw = { 0x2000B16B };
+
+/**
+* Configure number of microseconds Diagnostics Framework will delay before starting
+* to execute each test.  This gives user a chance to cancel before a test 
+* begins.
+*/
+const TUint32 KDiagFwTestInitDelay = 0x00000001;
+
+/**
+* Configure number of microseconds of test inactivity Diagnostics Framework will 
+* tolerate before cancelling an interactive test. This prevents single tests
+* from blocking entire testing session.
+* The value will be used for interactive test steps.
+*/
+const TUint32 KDiagFwWatchdogTimeoutInteractive = 0x00000002;
+
+/**
+* Configure number of microseconds of test inactivity Diagnostics Framework will 
+* tolerate before cancelling an automatic test. This prevents single tests
+* from blocking entire testing session.
+* The value will be used for non-interactive (automatic) test steps.
+*/
+const TUint32 KDiagFwWatchdogTimeoutAutomatic = 0x00000003;
+
+#endif      // DIAGNOSTICSFWPRIVATECRKEYS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagplugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2007 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:  Abstract class that represents a diagnostics plug-in
+*
+*/
+
+
+#ifndef DIAGPLUGIN_H
+#define DIAGPLUGIN_H
+
+// INCLUDES
+#include <badesca.h>            // CPtrCArray . Needed since this is typedef.
+
+//Forward declarations
+class CGulIcon;
+class MDiagEngineCommon;
+
+// Constants for plugin interfaces 
+const TUid KDiagPluginInterfaceUid = { 0x2000AFEB };
+
+// UID of top most root suite uid.  All plug-ins are descendant of this suite.
+const TUid KDiagRootSuiteUid = { 0x00000000 };
+
+/**
+* Abstract class that repsesents a diagnostics plug-in.
+*
+* @since S60 v5.0
+**/
+class MDiagPlugin
+    {
+public: //data structures
+
+    /**
+    * Indicates is the plug-in a suite or a test plug-in
+    **/
+    enum TPluginType
+        {
+        ETypeTestPlugin,
+        ETypeSuitePlugin
+        };
+
+    /**
+    * Layout type of name being requested.
+    */
+    enum TNameLayoutType
+        {
+        ENameLayoutListSingle,              // list_single_graphic_heading_pane_t1_cp2
+        ENameLayoutPopupNoteWaitWindow,     // popup_note_wait_window
+        ENameLayoutListLargeGraphic,        // list_single_large_graphic_pane_t1
+        ENameLayoutHeadingPane,             // heading_pane_t1
+        ENameLayoutPopupInfoPane,           // popup_info_list_pane_t1
+        ENameLayoutTitlePane,               // title_pane_t2/opt12
+        ENameLayoutListSingleGraphic,       // list_single_graphic_pane_t1
+        ENameLayoutListDoubleGraphic        // list_double_graphic_pane_t1
+        };
+
+public: // public methods
+
+    /**
+    * Virtual destructor. This ensures that when the interface is deleted,
+    * compiler will look up virtual table to find correct destructor.
+    */
+    virtual ~MDiagPlugin() {}
+
+    /**
+    * Method for getting the name of the plugin. Name returned should be based
+    * on the layout requested, and it should fit within the layout.
+    *
+    * @param aLayoutType - Layout where text will be displayed in. @see TNameLayoutType
+    * @return Localized name of the plug-in. Ownership is transferred to caller.
+    */
+    virtual HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const = 0;
+
+    /**
+    * Get the name of the service that the plug-in provides.
+    * Service name is defined in the ECOM resource file, thus, it is not localized.
+    *
+    * @return The name of the service.
+    **/
+    virtual const TDesC& ServiceLogicalName() const = 0;
+
+    /**
+    * Get logical dependencies. One plug-in can have multiple dependencies to other plug-ins.
+    *
+    * @param aArray An array of logical names.
+    * @see ServiceLogicalName.
+    **/
+    virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const = 0;
+
+    /**
+    * Return the type of the plug-in. 
+    *
+    * @return The type.
+    * @see TPluginType.
+    **/
+    virtual TPluginType Type() const = 0;
+
+    /**
+    * Create an icon that represents the plug-in.
+    *
+    * @return An icon. 
+    **/
+    virtual CGulIcon* CreateIconL() const = 0;
+
+    /** Method for checking, if plugin should be visible.
+    * (for example shown in listbox).
+    * Overwrite this function to show or hide your plugin dynamically.
+    *
+    * @return ETrue if plugin should be visible, EFalse otherwise.
+    */
+    virtual TBool IsVisible() const = 0;
+
+    /** Method for checking, if plugin is supported.
+    * Overwrite this function to enable or disable your plugin dynamically.
+    * If EFalse, plug-in will not be loaded by plugin pool.
+    *
+    * @return ETrue if plugin is supported, EFalse otherwise.
+    */
+    virtual TBool IsSupported() const = 0;
+
+    /**
+    * Get localised description of the test. Description should be used to explain 
+    * the test for the user. It can contain comments that this service needs for 
+    * example access point and it creates costs or that the duration might be long.
+    *
+    * @return Allocated buffer containing localized description of the plugin.
+    **/
+    virtual HBufC* GetDescriptionL() const = 0;
+
+    /**
+    * Get UID of this plug-in.
+    *
+    * @return the UID.
+    **/
+    virtual TUid Uid() const = 0;
+
+    /**
+    * Get the order number that this plug-in should appear in its parent list.
+    *
+    * @return TUint order number.
+    **/
+    virtual TUint Order() const = 0;
+
+    /**
+    * Get UID of the parent.
+    *
+    * @return The parent UID.
+    **/
+    virtual TUid ParentUid() const = 0;
+
+    /**
+    * Set ECom Destructor ID Key.
+    *
+    * @param aDtorIdKey Uid returned by REComSession::CreateImplementationL()
+    **/
+    virtual void SetDtorIdKey( TUid aDtorIdKey ) = 0;
+
+
+    /**
+    * Initialization Step. This method is called before any plugin are executed.
+    * This can be used to clean up any left over data from previous execution 
+    * sessions. All plug-ins in execution plan will have a chance to clean 
+    * up before any plug-ins are run.  This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in will be executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                    TBool aSkipDependencyCheck,
+                                    TAny* aCustomParams ) = 0;
+
+
+    /**
+    * Cleanup Step. This method is called after all plug-ins in the 
+    * execution plan is completed to clean up any left over data from 
+    * current sesison. This can be used to clean up any data that
+    * provides dependent service created for its dependencies.
+    * This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in as executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                  TBool aSkipDependencyCheck,
+                                  TAny* aCustomParams ) = 0;
+
+
+    /**
+    * Reserved for future use/plugin's custom functionality.
+    *
+    * @param aUid Unique identifier of the operation.
+    * @param aParam Custom parameter. 
+    * @return TAny pointer. Custom data.
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual TAny* CustomOperationL( TUid aUid, TAny* aParam ) = 0;
+        
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aParam Custom parameter.
+    * @return TAny pointer. Custom data. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual TAny* GetCustomL( TUid aUid, TAny* aParam ) = 0;
+    };
+
+#endif // DIAGPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginconstructionparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Plug-in Construction Parameter
+*
+*/
+
+
+#ifndef DIAGPLUGINCONSTRUCTIONPARAM_H
+#define DIAGPLUGINCONSTRUCTIONPARAM_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class CDesC16ArrayFlat;
+
+/**
+* Parameters that are needed to construct a Diagnostics plug-in.
+*
+* @since S60 v5.0
+**/
+NONSHARABLE_CLASS( CDiagPluginConstructionParam ) : public CBase
+    {
+public:
+
+    /**
+    * Two-phased constructors.
+    *
+    * @param    aServiceProvided - Name of the service provided.
+    *           Ownership is transferred to CDiagPluginConstructionParam.
+    * @param    aServicesRequired - Array of services required.
+    *           Ownership is transferred to CDiagPluginConstructionParam.
+    * @param    aOrder - Order that this plug-in should appear in
+    *           in parent suite.
+    * @param    aImplUid - Implementation Uid of the plug-in.
+    * @return   new instance of CDiagPluginConstructionParam*
+    **/
+    IMPORT_C static CDiagPluginConstructionParam* NewL(
+                                        HBufC*              aServiceProvided,
+                                        CDesC16ArrayFlat*   aServicesRequired,
+                                        TInt                aOrder,
+                                        TUid                aImplUid,
+                                        TUid                aParentUid );
+    IMPORT_C static CDiagPluginConstructionParam* NewLC(
+                                        HBufC*              aServiceProvided,
+                                        CDesC16ArrayFlat*   aServicesRequired,
+                                        TInt                aOrder,
+                                        TUid                aImplUid,
+                                        TUid                aParentUid );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagPluginConstructionParam();
+
+    /**
+    * Get Name of the service provived.
+    *
+    * @return Name of the service provided.
+    */
+    IMPORT_C const TDesC& ServiceProvided() const;
+
+    /**
+    * Get array of services required for plug-in.
+    *
+    * @return Array of services required for plug-in.
+    */
+    IMPORT_C const CDesC16ArrayFlat& ServicesRequired() const;
+
+    /**
+    * Get the order this plug-in should appear in parent.
+    *
+    * @return Order that this plug-in should appear in parent.
+    */
+    IMPORT_C TInt Order() const;
+
+    /**
+    * Uid of plug-in.
+    *
+    * @return Uid of plug-in specified in RSS file.
+    */
+    IMPORT_C TUid Uid() const;
+
+    /**
+    * Parent Uid of plug-in.
+    *
+    * @return Parent Uid of plug-in specified in RSS file.
+    */
+    IMPORT_C TUid ParentUid() const;
+
+private:    
+    
+    /**
+    * C++ Constructor.
+    **/
+    CDiagPluginConstructionParam( HBufC*              aServiceProvided,
+                                  CDesC16ArrayFlat*   aServicesRequired,
+                                  TInt                aOrder,
+                                  TUid                aImplUid,
+                                  TUid                aParentUid );
+    
+    
+private:    // data
+
+    /**
+    * iServiceProvided - Buffer containing service name
+    * Owns.
+    */
+    HBufC* iServiceProvided;
+
+    /**
+    * iServicesRequired - Array containing list of dependency list.
+    * Owns
+    */
+    CDesC16ArrayFlat* iServicesRequired;
+
+    /**
+    * iOrder - Order in parent list.
+    */
+    TInt iOrder;
+
+    /**
+    * iImplUid - Uid of the plug-in
+    */
+    TUid iImplUid;
+
+    /**
+    * iParentUid - Uid of the parent suite plug-ins
+    */
+    TUid iParentUid;
+    };
+
+#endif // DIAGPLUGINCONSTRUCTIONPARAM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginexecplan.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagPluginExecPlan
+*
+*/
+
+
+#ifndef DIAGPLUGINEXECPLAN_H
+#define DIAGPLUGINEXECPLAN_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATION
+class MDiagPlugin;
+class MDiagExecPlanEntry;
+
+/**
+*  Diagnostics Plugin Execution Plan
+*
+*  This class provides interface to access execution plan.
+*  It also provides interface to modify execution plan.
+*  A cursor to currently executing item is also maintained.
+*
+*/
+class MDiagPluginExecPlan
+    {
+public: 
+    /**
+    * Access an item in plan.
+    *
+    * @param aIndex    - index 
+    * @return Reference to plan entry at given index.
+    */
+    virtual const MDiagExecPlanEntry& operator[]( TInt aIndex ) const = 0;
+
+    /**
+    * Get current execution plan item.
+    *
+    * @return Reference to currently executing plan item.
+    */
+    virtual const MDiagExecPlanEntry& CurrentExecutionItem() const = 0;
+
+    /**
+    * Returns index of execution cursor. Note that this index 
+    * includes both suite plug-in and test plug-in.
+    *
+    * If only interested about test plug-ins. use CurrentTestIndex().
+    *
+    * @return Index to current execution cursor.
+    */
+    virtual TInt CurrentIndex() const = 0;
+
+    /**
+    * Returns total number of items in the plan. Note that this count
+    * includes both suite plug-in and test plug-in.
+
+    * If only interested only test plug-ins. use TestCount().
+    *
+    * @return Number of items in the test plan.
+    */
+    virtual TInt Count() const = 0;
+
+    /**
+    * Get current test index.
+    *
+    * Note that only test plug-ins (MDiagTestPlugin) are counted in this
+    * case.  Suite pre/post execution are not. You cannot use this value
+    * with [] operator since this is not a real index.
+    * 
+    * To get real cursor index, use GetCurrentIndex().
+    *
+    * @param aIncludeDependency  If ETrue, test index will also include
+    *                            plugins that are included as dependency.
+    * @return current test index.
+    */
+    virtual TInt CurrentTestIndex( TBool aIncludeDependency ) const = 0;
+
+    /**
+    * Get total test count.
+    *
+    * Note that only test plug-ins (MDiagTestPlugin) are counted in this
+    * case.  Suite pre/post execution are not. You cannot use this value
+    * with [] operator since this is not a real count.
+    * 
+    * To get the real number of items in the plan, use GetCount().
+    *
+    * @param aIncludeDependency  If ETrue, test index will also include
+    *                            plug-ins that are included as dependency.
+    * @return current test index.
+    */
+    virtual TInt TestCount( TBool aIncludeDependency ) const = 0;
+
+    /**
+    * Check if this is the last test being executed.
+    *
+    * Note that only test plug-ins (MDiagTestPlugin) are counted in this
+    * case.  Suite pre/post execution are not.
+    * If you are interested in checking if it is currently running
+    * the last plug-in, including test and suites, @see IsLastPlugin()
+    *
+    * @return ETrue plan is executing the last test plug-in.
+    */
+    virtual TBool IsLastTest() const = 0;
+
+    /**
+    * Check if this is the last plug-in being executed.
+    *
+    * Note that this includes both test plug-ins and suite plug-ins.
+    * If you are interested in checking the progress on tests only,
+    * @see IsLastTest()
+    *
+    * @return ETrue plan is executing the last test or suite plug-in.
+    */
+    virtual TBool IsLastPlugin() const = 0;
+
+    /**
+    * Returns the plug-in index that plan is resuming from.
+    * If this session is not a resume session, this will return 0 (first index).
+    * Otherwise, this index will point the first real execution item.
+    *
+    * Note that this value will not change as test session progresses. Even
+    * as test progresses, this value will still point to the index that
+    * this session is being resumed from.
+    *
+    * @return Index of which session is being resumed from.
+    */
+    virtual TInt ResumeIndex() const = 0;
+    };
+
+#endif // DIAGPLUGINEXECPLAN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginexecplanimpl.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,463 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagPluginExecPlanImpl
+*
+*/
+
+
+#ifndef DIAGPLUGINEXECPLANIMPL_H
+#define DIAGPLUGINEXECPLANIMPL_H
+
+// SYSTEM INCLUDE FILES
+#include <e32base.h>                    // CBase
+#include <DiagPluginExecPlan.h>         // MDiagPluginExecPlan
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem::TResult
+
+// USER INCLUDE FILES
+#include "diagexecplanentryimpl.h"      // TDiagPluginExecPlanImpl::TType
+
+// FORWARD DECLARATION
+class MDiagPlugin;
+class MDiagSuitePlugin;
+class MDiagEngineCommon;
+class CDiagPluginPool;
+class RDiagResultsDatabaseRecord;
+class TDiagEngineConfig;
+struct TTransitionStackEntry;
+
+template <class T, TBool StackOwnsEntry>
+class CStack;
+
+/**
+*  Diagnostics Plugin Execution Plan
+*
+*  This class provides interface to access execution plan.
+*  It also provides interface to modify execution plan.
+*  A cursor to currently executing item is also maintained.
+*
+* @since S60 v5.0
+*
+*/
+NONSHARABLE_CLASS( CDiagPluginExecPlanImpl ) : public CActive,
+                                               public MDiagPluginExecPlan
+    {
+public: 
+    /**
+    * Two-phase constructor
+    *
+    * @param aEngine - Reference to diagnostics engine.
+    * @param aEngineConfig - Engine configuration information.
+    * @param aEntryObserver - Reference to entry observer.
+    * @return new instance of CDiagPluginExecPlanImpl
+    */
+    static CDiagPluginExecPlanImpl* NewL( MDiagEngineCommon& aEngine,
+                                          const TDiagEngineConfig& aEngineConfig,
+                                          MDiagExecPlanEntryImplObserver& aEntryObserver );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CDiagPluginExecPlanImpl();
+
+public:     // New API
+    /**
+    * Initialize execution plan
+    *
+    * @param aStatus - Request status to set when plan creatation is completed.
+    * @param aBatch - list of plug-ins to execute
+    */
+    void InitializeL( TRequestStatus& aStatus, 
+                      const RPointerArray< MDiagPlugin >& aBatch );
+
+    /**
+    * Initialize execution plan from db.
+    *   This will read current data from results database and reconstruct
+    *   the execution plan.
+    *
+    *   This should be used to continue an incomplete session.
+    *
+    * @param aStatus - Request status to set when plan creatation is completed.
+    */
+    void InitializeL( TRequestStatus& aStatus );
+
+    /**
+    * Access an item in plan. 
+    *
+    * @param aIndex    - index 
+    * @return Reference to plan entry at given index.
+    */
+    CDiagExecPlanEntryImpl& operator[]( TInt aIndex );      //lint !e1411  This is proper overload
+
+    /**
+    * Get current execution plan item.
+    *
+    * @return Reference to currently executing plan item.
+    */
+    CDiagExecPlanEntryImpl& CurrentExecutionItem();         //lint !e1411  This is proper overload
+
+    /**
+    * Reset execution cursor
+    * 
+    * Resets execution cursor to the beginning.
+    */
+    void ResetExecutionCursor();
+
+    /**
+    * Moves execution cursor to next item.
+    *
+    * @return ETrue if cursor is updated.
+    *         EFalse if cursor is already at last item.
+    */
+    TInt MoveCursorToNext();
+
+private:     // from CActive
+    /**
+    * Handle Active Object completion event.
+    * @see CActive::RunL()
+    */
+    virtual void RunL();
+
+    /**
+    * Cancel outstanding request
+    * @see CActive::RunL()
+    */
+    virtual void DoCancel();
+
+    /**
+    * Handle errors
+    * @see CActive::RunError()
+    */
+    virtual TInt RunError( TInt aError );
+
+public:     // from MDiagPluginExecPlan
+    /**
+    * Access an item in plan.
+    *   @see MDiagPluginExecPlan::operator[]
+    */
+    virtual const MDiagExecPlanEntry& operator[]( TInt aIndex ) const;
+
+    /**
+    * Get current execution plan item.
+    *   @see MDiagPluginExecPlan::CurrentExecutionItem
+    */
+    virtual const MDiagExecPlanEntry& CurrentExecutionItem() const;
+
+    /**
+    * Returns index of execution cursor. 
+    *   @see MDiagPluginExecPlan::CurrentIndex
+    */
+    virtual TInt CurrentIndex() const;
+
+    /**
+    * Returns total number of items in the plan.
+    *   @see MDiagPluginExecPlan::Count
+    */
+    virtual TInt Count() const;
+
+    /**
+    * Get current test index.
+    *
+    *   @see MDiagPluginExecPlan::CurrentTestIndex
+    */
+    virtual TInt CurrentTestIndex( TBool aIncludeDependency ) const;
+
+    /**
+    * Get total test count.
+    *
+    *   @see MDiagPluginExecPlan::TestCount
+    */
+    virtual TInt TestCount( TBool aIncludeDependency ) const;
+
+    /**
+    * Check if this is the last test being executed.
+    *
+    *   @see MDiagPluginExecPlan::IsLastTest
+    */
+    virtual TBool IsLastTest() const;
+
+    /**
+    * Check if this is the last plug-in being executed.
+    *
+    *   @see MDiagPluginExecPlan::IsLastPlugin
+    */
+    virtual TBool IsLastPlugin() const;
+
+    /**
+    * Returns the plug-in index that plan is resuming from.
+    *
+    *   @see MDiagPluginExecPlan::ResumeIndex
+    */
+    virtual TInt ResumeIndex() const;
+
+private: // private data types
+    /**
+    * State
+    */
+    enum TState
+        {
+        EStateIdle  = 0,
+        EStateExpandDependencyAndSuites,
+        EStateRemoveEmptySuites,
+        EStateInsertSuiteTransitions,
+        EStateStoreToDb,
+        EStatePlanCreated
+        };
+
+private: // private functions
+    /**
+    * C++ Constructor
+    * @param aEngine - reference to engine.
+    * @param aEngineConfig - reference to engine configuration information.
+    * @param aEntryObserver - Reference to observer for each plug-in
+    */
+    CDiagPluginExecPlanImpl( MDiagEngineCommon& aEngine,
+                             const TDiagEngineConfig& aEngineConfig,
+                             MDiagExecPlanEntryImplObserver& aEntryObserver );
+
+    /**
+    * Symbian 2nd phase constructor
+    */
+    void ConstructL();
+
+    /**
+    * Change state
+    *   @param aState - new state.
+    */    
+    void ChangeState( TState aState );
+
+    /**
+    * Plan creation phase 1. Expand dependencies
+    *
+    * @return ETrue if any changes are made to the plan.
+    */
+    TBool ExpandDependenciesL();
+
+    /**
+    * Plan creation phase 2. Expand suites to plug-ins
+    *
+    * @return ETrure if any changes are made to the plan
+    */
+    TBool ExpandSuitesL();
+
+    /**
+    * Plan creation phase 3. Remove empty suites. Delete plan entries that
+    * just has prepare and finalize without any tests in between.
+    *
+    */
+    void RemoveEmptySuites();
+
+    /**
+    * Plan creation phase 4. Insert suite transition based on parent
+    *
+    */
+    void InsertSuiteTransitionsL();
+
+    /**
+    * Store next test plan item to database. Part of STEP_6.
+    *
+    */
+    void StoreNextTestPluginToDbL();
+    
+    /**
+    * Plan creation step 7. Prepend items from last session to new plan.
+    */
+    void PrependExecutedItemsL();
+
+    /**
+    * Report result to client.
+    * 
+    * @param aErr - Result to report back to engine. KErrNone if successful.
+    *   
+    */
+    void ReportResult( TInt aErr );
+
+    /**
+    * Insert plugin
+    *
+    * This function will attempt to add a plugin into plan. 
+    * If item already exists in the plan prior to the given index, it will
+    * not add a new item. 
+    * If item exists after the given index, and the item is a dependent item, it will
+    * move it up in the plan, so that it will be executed earlier.
+    * If item exists after the given index, and the item is not a dependent item, 
+    * it will create a duplicate entry, to make sure that client specified order
+    * is not changed.
+    *
+    * @param aPlugin - Plugin to insert
+    * @param aAsDependent - whether new item is to satify dependency or not.
+    * @param aAt - index to insert the dependent item to.
+    * @return ETrue if plan is updated. EFalse if no changes to plan is made.
+    */
+    TBool InsertPluginL( MDiagPlugin& aPlugin,
+                         TBool aAsDependent, 
+                         TInt aAt );
+
+    /**
+    * Utility function to create a default execution plan entry
+    *   For test plug-ins, it will create an entry with EQueueToRun as status.
+    *   For suite plug-ins, it will create an entry with ETypeSuiteUnexpanded as type.
+    *
+    * @param aPlugin - Plugin to create default entry for. Either test or suite plug-in.
+    * @param aAsDependency - Whether the entry should be created as dependency or not.
+    *
+    * @return New execution plan entry. Ownership is transferred.
+    */
+    CDiagExecPlanEntryImpl* CreateDefaultPlanEntryLC(
+            MDiagPlugin& aPlugin,
+            TBool aAsDependency ) const;
+
+    /**
+    * Utility function to add root suite if it does not alredy exists 
+    * in the plan. 
+    * 
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    */
+    void AddRootSuiteIfMissingL();
+
+    /**
+    * Utility function to push new transition into stack.
+    *
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    *
+    * @param aStack - Stack to push new transition to.
+    * @Param aHeadIndex - index in execution plan to head entry.
+    */
+    void PushNewLevelL( CStack<TTransitionStackEntry, ETrue>& aStack, TInt aHeadIndex );
+
+    /**
+    * Utility function to pop a level from stack. This will remove top entry
+    *
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    *
+    * @param aStack - Stack to pop the head item from.
+    */
+    void PopLevel( CStack<TTransitionStackEntry, ETrue>& aStack );
+
+    /**
+    * Utility function to check if given level exists in stack
+    *
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    *
+    * @param aStack - Stack to check levels in.
+    * @param aLevelUid - Uid of leven to check in stack.
+    * 
+    * @return ETrue if item exists in stack. EFalse if not found.
+    */
+    TBool IsLevelInStack( CStack<TTransitionStackEntry, ETrue>& aStack, TUid aLevelUid ) const;
+
+    /**
+    * Utility function to check if there is more of items of the same parent
+    * exists in the plan.
+    *
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    * 
+    * @param aParentUid - Uid of suite to search for.
+    * @param aIndex - Index to execution plan to start searching for.
+    * @return ETrue if given suite is still needed.
+    *   EFalse otherwise.
+    */
+    TBool IsThisSuiteNeededAfterThisIndex( TUid aSuiteUid, TInt aIndex ) const;
+
+    /**
+    * Utility function to add a SuitePrepare entry into plan.
+    *
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    *
+    * @param aLevelUid - Uid of suite to add in plan.
+    * @param aAt - Index in plan to add new prepare entry to.
+    */
+    void AddSuitePrepareL( TUid aLevelUid, TInt aAt );
+
+    /**
+    * Utility function to add a SuiteFinalize entry into plan.
+    *
+    * NOTE: This should be called only from InsertSuiteTransitionsL()
+    *
+    * @param aPrepareIndex - location in plan where prepare is at. Some information
+    *   from prepare item will be copied to finalize.
+    * @param aAt - Index in execution plan to add finalize entry to.
+    */
+    void AddSuiteFinalizeL( TInt aPrepareIndex, TInt aAt );
+    
+    /**
+    * Log plan information to debug log. This function does nothing in release build.
+    */
+    void LogPlanL() const;
+
+    /**
+    * Debug function that validate that entries are written to db correctly.
+    * This function does nothing in release build.
+    */
+    void LogPlanInRecordL() const;
+
+private: // data
+
+    /**
+    * iPlan - holds plan entries
+    * Individual entries are owned by the array.
+    */
+    RPointerArray<CDiagExecPlanEntryImpl> iPlan;
+
+    /**
+    * iExecutedEntries  - Items that are already executed in the
+    * previous session.
+    * Individual entries are owned by the array.
+    */
+    RPointerArray<CDiagExecPlanEntryImpl> iExecutedEntries;
+
+    /**
+    * iExecutionCursor - currently executing item.
+    */
+    TInt iExecutionCursor;
+
+    /**
+    * iResumeIndex - Index which session is being resumed from.
+    */
+    TInt iResumeIndex;
+
+    /**
+    * iEngine - Reference to diag engine.
+    */
+    MDiagEngineCommon& iEngine;
+
+    /**
+    * iEngineConfig - Enine configuration information.
+    */
+    const TDiagEngineConfig& iEngineConfig;
+
+    /**
+    * iPlanEntryObserver - Plan entry observer. Passed to each plan entry
+    *    when it is created.
+    */
+    MDiagExecPlanEntryImplObserver& iPlanEntryObserver;
+
+    /**
+    * iClientStatus - TRequestStatus of the client. Used to notify
+    * completion and error.
+    * Ownership - Does not own.
+    */
+    TRequestStatus* iClientStatus;
+
+    /**
+    * iState - state of the execution plan creation.
+    *   @see TState
+    */
+    TState iState;
+    };
+
+#endif // DIAGPLUGINEXECPLANIMPL_H
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginloaderdependencyparser.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,341 @@
+/*
+* Copyright (c) 2007 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:  XML Parser for opaque data field of Plug-ins.  This field
+*  contains information about depdendencies and ordering.
+*
+*/
+
+
+#ifndef DIAGPLUGINLOADERDEPENDENCYPARSER_H
+#define DIAGPLUGINLOADERDEPENDENCYPARSER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <xml/contenthandler.h>
+
+// FORWARD DECLARATION
+class CDesC16ArrayFlat;
+
+namespace Xml
+    {
+    class CParser;
+    class RAttribute;    
+    }
+
+namespace DiagPluginPool
+    {
+/**
+*  Plugin Loader Depdenency Parser
+*  Parse dependency information and other data out of plug-ins via the
+*  opaque_data field.
+* 
+* @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDependencyParser ) : public CBase, 
+                                         public Xml::MContentHandler
+    {
+public:
+
+    /**
+    * Two-phased constructor.
+    *
+    * @return New instance of CDependencyParser
+    */
+    static CDependencyParser* NewL();   
+    
+    /**
+    * Two-phased constructor.
+    *
+    * @return New instance of CDependencyParser and pop onto cleanup stack
+    */
+    static CDependencyParser* NewLC();   
+
+    /**
+    * Destructor.
+    */
+    virtual ~CDependencyParser();
+
+    /**
+    * Parse out Plug-in Information from XML.
+    *
+    * @param aOpaqueData    Contains text with opaque data for Dependencies/Order Number
+    * @param aDefaultData   Contains text with default data for Parent UID
+    * Leave Codes:    KErrNone      Valid data was parsed
+    *                 KErrNotFound  No valid fields found
+    *                 KErrArgument  Text is NULL or empty
+    *                 KErrCorrupt   XML was determined to be corrupt
+    * 
+    */
+    void ParseL( const TDesC8& aOpaqueData, const TDesC8& aDefaultData );
+    
+    /**
+    * Return parsed order number
+    *
+    * @return orrder number
+    */ 
+    TInt GetOrderNumber() const;
+
+    /**
+    * Return parsed parent UID
+    *
+    * @return parent UID
+    */ 
+    const TUid& GetParentUid() const;
+
+    /**
+    * Return parsed service provided.  Ownership is transferred to the caller    
+    *
+    * @return service provided
+    */
+    HBufC* GetServiceProvided();
+
+    /**
+    * Return parsed services required.  Caller assumes ownership.
+    *
+    * @return services required
+    */
+    CDesC16ArrayFlat* GetServicesRequired();
+    
+private:    // from  Base Class Xml::MContentHandler 
+    /**
+    * Callback from XML Parser that indicates a Plugin element is starting
+    *
+    * @param aElement     handle to element's details
+    * @param aAttributes  contains attributes for element
+    * @param aErrorCode   indicates error, if any
+    */     
+    virtual void OnStartElementL( const Xml::RTagInfo& aElement,
+                                  const Xml::RAttributeArray& aAttributes,
+                                  TInt aErrorCode );
+    
+    /**
+    * Callback from XML Parser that indicates the end of a plug-in element
+    *
+    * @param aElement     handle to element's details
+    * @param aErrorCode   indicates error, if any
+    */         
+    virtual void OnEndElementL( const Xml::RTagInfo& aElement, TInt aErrorCode );
+    
+    /**
+    * Callback from XML Parser that indicates content in an XML element
+    *
+    * @param aBytes       simple stream of data indicating the content
+    * @param aErrorCode   indicates error, if any
+    */     
+    virtual void OnContentL( const TDesC8& aBytes, TInt aErrorCode );
+
+    /**
+    * Callback from XML Parser that indicates a parsing error
+    *
+    * @param aErrorCode   indicates error, if any
+    * Note: The XmlFramework has been allocated error codes in the range: -17550 to -17599
+    */         
+    virtual void OnError( TInt aErrorCode );
+    
+    // Unused virtual member functions
+    
+    /**
+    * @see Xml::MContentHandler::OnStartDocumentL
+    */
+    virtual void OnStartDocumentL( const Xml::RDocumentParameters& aDocParam, TInt aErrorCode );
+    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */
+    virtual void OnEndDocumentL( TInt aErrorCode );
+
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual void OnStartPrefixMappingL( const RString& aPrefix, 
+                                        const RString& aUri, 
+                                        TInt aErrorCode );    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual void OnEndPrefixMappingL( const RString& aPrefix, TInt aErrorCode );
+    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual void OnIgnorableWhiteSpaceL( const TDesC8& aBytes, TInt aErrorCode );
+    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual void OnSkippedEntityL( const RString& aName, TInt aErrorCode );
+    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual void OnProcessingInstructionL( const TDesC8& aTarget, 
+                                           const TDesC8& aData, 
+                                           TInt aErrorCode );    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual void OnExtensionL( const RString& aData, TInt aToken, TInt aErrorCode );
+    
+    /**
+    * @see Xml::MContentHandler::OnEndDocumentL
+    */    
+    virtual TAny* GetExtendedInterface( const TInt32 aUid );
+    
+private:    // private utility functions
+
+    /**     
+    * Simple utility function to allocate and pop onto the stack a 16 bit buffer descriptor
+    * from an 8 bit descriptor.
+    *
+    * @param aDes   8 bit descriptor to be converted to 16 bits
+    * @return       Newly allocated 16-bit buffer containing converted contents of aDes
+    */      
+    HBufC* Convert8BitTo16BitBufferLC( const TDesC8& aDes ) const;
+    
+    /**     
+    * Parse a numeric attribute from XML text with specific notation for diagnostics framework
+    * plug-ins.
+    *
+    * @param aAttribute         XML attribute
+    * @param aNumericAttribute  Parsed out integer
+    * @return                   Indicates whether or not attribute was parsed correctly
+    */      
+    TBool ParseNumericAttribute( const Xml::RAttribute& aAttribute, TInt& aNumericAttribute );
+    
+    /**     
+    * Parse a string attribute from XML text with specific notation for diagnostics framework
+    * plug-ins.
+    *
+    * @param aAttribute         XML attribute
+    * @param aStringAttribute   Parsed out string
+    * @return                   Indicates whether or not attribute was parsed correctly
+    */          
+    TBool ParseStringAttributeL( const Xml::RAttribute& aAttribute, HBufC*& aStringAttribute );
+    
+    /**     
+    * Parse a hex UID from given descriptor
+    *
+    * @param aSource             String containing UID
+    * @param aTarget             Parsed out UID
+    * @return                    Error Code
+    */          
+    TInt ParseToUid( const TDesC8& aSource, TUid& aTarget );
+    
+    /**     
+    * Parse a hex UID from given descriptor
+    *
+    * @param aAttributes         List of attributes to parse
+    * @param aFoundTag           Reference to some class variable that indicates if a given tag has been found.
+    * @return                    ETrue==XML OK/EFalse==XML not validated
+    */     
+    TBool ValidateXmlTag( const Xml::RAttributeArray& aAttributes, TBool& aFoundTag );
+       
+    /**     
+    * Reset all data
+    *
+    */  
+    void ResetL();
+    
+private:  // private constructors
+
+    /**
+    * Construct a CDependencyParser object
+    *    
+    */
+    CDependencyParser();
+    
+    /**
+    * 2nd phase constructor
+    *
+    */     
+    void ConstructL();
+
+private: // data
+    
+    /**
+     * Pointer to XML Parser from SDK
+     * owns
+     */
+    Xml::CParser* iParser;
+
+    /**
+    * Error code indicates error in parsing
+    */
+    TInt iParseStatus;
+
+    /**
+    * Parsed order number
+    */
+    TInt iOrderNumber;
+
+    /**
+    * Parsed provided service
+    * owns
+    */
+    HBufC* iServiceProvided;
+
+    /**
+    * Parsed required service
+    * owns
+    */
+    CDesC16ArrayFlat* iServicesRequired;
+
+    /**
+    * Parsed parent uid
+    */
+    TUid iParentUid;
+
+    /**
+    * Indicates that parsing is happening within services required blocks
+    */
+    TBool iParsingServicesRequired;
+
+    /**
+    * Indicates that there was some problem with the parsing
+    */
+    TBool iBadXML;
+
+    /**
+    * Indicates that root node has been found and we are inside it
+    */
+    TBool iInsideRootNode;
+    
+    /**
+    * Indicates that order number has been found
+    */    
+    TBool iFoundOrderNumber;
+    
+    /**
+    * Indicates that services provided has been found
+    */    
+    TBool iFoundServiceProvided;
+    
+    /**
+    * Indicates that services required has been found
+    */    
+    TBool iFoundServicesRequired;
+    
+    /**
+    * Indicates that parser has been run at least once
+    */    
+    TBool iHasBeenRun;
+        
+    };
+        
+    } // namespace DiagPluginPool
+
+#endif // DIAGPLUGINLOADERDEPENDENCYPARSER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginpool.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 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:  Manages Diagnostics Plug-in
+*
+*/
+
+
+#ifndef DIAGPLUGINPOOL_H
+#define DIAGPLUGINPOOL_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class MDiagPlugin;
+class MDiagPluginPoolObserver;
+class CDiagPluginPoolImpl;        
+
+
+/**
+*  Diagnostics Framework Plugin Pool Class
+*
+*  This class is used to load Diagnostics ECom plug-ins. It works with both
+*  Suite Plug-in and Test Plug-in. Once loaded, it will manage the life
+*  cycle of the plug-ins.
+*
+*  All loaded plug-ins will be destroyed when pool is deleted.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagPluginPool ) : public CBase
+    {
+public:
+
+    /**
+    * Two-phased constructors
+    *
+    * @param aObserver     Plug-in Pool observer.
+    * @return New instance of CDiagPluginPool
+    */
+    IMPORT_C static CDiagPluginPool* NewL( MDiagPluginPoolObserver& aObserver );
+    IMPORT_C static CDiagPluginPool* NewLC( MDiagPluginPoolObserver& aObserver );
+
+    /**
+    * Destructor
+    *
+    */
+    IMPORT_C virtual ~CDiagPluginPool();
+
+public:     // new API
+
+    /**
+    * Loads all plug-ins. Progress is notified via MDiagPluginPoolObserver.
+    * 
+    * @param aUid - Interface Uid to load.
+    */
+    IMPORT_C void LoadAsyncL( TUid aUid );
+    
+    /**
+    * Create an instance of a plug-in. It can be a test plug-in or suite plug-in.
+    * If this is a suite, it will not have its children associated with it since
+    * will require children to be loaded as well.
+    *
+    * Plug-ins created using this method is not part of plug-in pool. Therefore
+    * client must manage the life cycle of the plug-in.
+    * 
+    * @param aUid - Implementation Uid of plug-in. 
+    * @return Newly instantiated plug-in. Ownership is transferred to caller.
+    */
+    IMPORT_C static MDiagPlugin* CreatePluginL( TUid aUid );
+
+    /**
+    * Cancel Plug-in Loading
+    * This method cancels plug-in loading. If it was not currently loading
+    * plug-ins, it will leave with KErrNotReady
+    */
+    IMPORT_C void CancelLoadPluginsL();
+
+    /**
+    * Find Plug-in that matches given Uid.
+    *
+    * @param aUid      Uid of plug-in to search.
+    * @param aPlugin   Reference to Plugin found. Engine owns this plug-in.
+    *                  Client must not deallocate plug-in.
+    * @return TInt     KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    */
+    IMPORT_C TInt FindPlugin( TUid aUid, MDiagPlugin*& aPlugin ) const;
+
+    /**
+    * Find Plug-in that matches given Uid. This function will leave on error.
+    *  Leave codes:    KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    *
+    * @param aUid      Uid of plug-in to search.
+    * @return Refernce to the plug-in found.
+    */
+    IMPORT_C MDiagPlugin& FindPluginL( TUid aUid ) const;
+
+    /**
+    * Find Plug-in that matches given service name.
+    *
+    * @param aServiceName  Service name of the plug-in. Name must match exactly.
+    * @param aPlugin       Reference to Plugin found. Engine owns this plug-in.
+    *                      Client must not deallocate plug-in.
+    * @return TInt         KErrNone        - Success.
+    *                      KErrNotFound    - Not found.
+    *                      KErrNotReady    - Plug-ins are not yet loaded.
+    */
+    IMPORT_C TInt FindPlugin( const TDesC& aServiceName,
+                              MDiagPlugin*& aPlugin ) const;
+
+    /**
+    * Find Plug-in that matches given service name. Will leave on error.
+    *  Leave codes:    KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    *
+    * @param aServiceName  Service name of the plug-in. Name must match exactly.
+    * @return Reference to Plugin found.
+    */
+    IMPORT_C MDiagPlugin& FindPluginL( const TDesC& aServiceName ) const;
+
+private:  // private constructors
+    
+    /**
+    * C++ Constructor
+    *    
+    */    
+    CDiagPluginPool();
+    
+    /**
+    * 2nd phase constructor
+    *    
+    */        
+    void ConstructL( MDiagPluginPoolObserver& aObserver );
+
+private:    //  MEMBER DATA
+    
+    /**
+    * iPluginPoolImpl - Acutal implementation of CDiagPluginPool
+    * Owns
+    */
+    CDiagPluginPoolImpl* iPluginPoolImpl;
+    };
+
+
+#endif // DIAGPLUGINPOOL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginpoolimpl.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2007 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:  Manages Diagnostics Plug-in
+*
+*/
+
+
+#ifndef DIAGPLUGINPOOLIMPL_H
+#define DIAGPLUGINPOOLIMPL_H
+
+// INCLUDES
+#include <e32base.h>                    // CActive
+#include <implementationinformation.h>  // RImplInfoPtrArray
+
+// FORWARD DECLARATIONS
+class MDiagPlugin;
+class MDiagPluginPoolObserver;
+class CDiagPluginConstructionParam;
+class MDiagSuitePlugin;   
+
+/**
+*  Diagnostics Framework Plugin Pool Implementation Class
+*
+*  This class is used to load Diagnostics ECom plug-ins. It works with both
+*  Suite Plug-in and Test Plug-in. Once loaded, it will manage the life
+*  cycle of the plug-ins.
+*
+*  All loaded plug-ins will be destroyed when pool is deleted.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagPluginPoolImpl ) : public CActive
+    {
+public:
+
+    /**
+    * Two-phased constructors
+    *
+    * @param aObserver     Plug-in Pool observer.
+    * @return New instance of CDiagPluginPool
+    */
+    static CDiagPluginPoolImpl* NewL( MDiagPluginPoolObserver& aObserver );
+    static CDiagPluginPoolImpl* NewLC( MDiagPluginPoolObserver& aObserver );
+
+    /**
+    * Destructor
+    *
+    */
+    virtual ~CDiagPluginPoolImpl();
+
+public:     // new API
+
+    /**
+    * Loads all plug-ins. Progress is notified via MDiagPluginPoolObserver.
+    * Leave codes:     KErrNone        - Success.
+    *                  KErrNotFound    - No plugins
+    *                  KErrAlreadyExists    - Plug-ins have already been loaded.
+    */
+    void LoadAsyncL();
+    
+    /**
+    * Create an instance of a plug-in. It can be a test plug-in or suite plug-in.
+    * If this is a suite, it will not have its children associated with it since
+    * will require children to be loaded as well.
+    *
+    * Plug-ins created using this method is not part of plug-in pool. Therefore
+    * client must manage the life cycle of the plug-in.
+    * 
+    * @param aUid - Implementation Uid of plug-in. 
+    * @return Newly instantiated plug-in. Ownership is transferred to caller.
+    */
+    static MDiagPlugin* CreatePluginL( const TUid aUid );
+
+    /**
+    * Find Plug-in that matches given Uid.
+    *
+    * @param aUid      Uid of plug-in to search.
+    * @param aPlugin   Reference to Plugin found. Engine owns this plug-in.
+    *                  Client must not deallocate plug-in.
+    * @return TInt     KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    */
+    TInt FindPlugin( TUid aUid, MDiagPlugin*& aPlugin ) const;
+
+    /**
+    * Find Plug-in that matches given service name.
+    *
+    * @param aServiceName  Service name of the plug-in. Name must match exactly.
+    * @param aPlugin       Reference to Plugin found. Engine owns this plug-in.
+    *                      Client must not deallocate plug-in.
+    * @return TInt         KErrNone        - Success.
+    *                      KErrNotFound    - Not found.
+    *                      KErrNotReady    - Plug-ins are not yet loaded.
+    */
+    TInt FindPlugin( const TDesC& aServiceName, 
+                             MDiagPlugin*& aPlugin ) const;      
+
+
+private:    // internal types                                   
+    typedef RPointerArray<CDiagPluginConstructionParam> RConstructionParamArray;        
+                             
+private:    // private constructors
+    
+    /**
+    * Construct a CDiagPluginPoolImpl object
+    *
+    * @param aObserver  The observer which listens to plug-in pool events
+    */
+    CDiagPluginPoolImpl( MDiagPluginPoolObserver& aObserver );
+    
+    /**
+    * 2nd phase constructor
+    *
+    */    
+    void ConstructL();  
+
+
+private: // internal API
+
+    /**
+    * Obtain the list construction paramaters to construct a plug-in
+    *    
+    * @return Pointer to construction paramaters pointer array
+    */    
+    static RConstructionParamArray* GeneratePluginListL();
+    
+    /**
+    * Generate parmaters to construct a plug-in given the ECOM implementation
+    * info structure
+    *
+    * @param aInfo  Pointer to the implementation info structure
+    * @return Pointer to newly generated construction params
+    */
+    
+    static CDiagPluginConstructionParam* GenerateConstructionParamsLC(
+            const CImplementationInformation* aInfo );
+            
+    /**
+    * Create a plug-in from given construction data
+    *
+    * @param aInfo  Pointer to the implementation info structure
+    * @return Pointer to the newly created plug-in
+    */
+    static MDiagPlugin* CreatePluginFromConstructionParamsL(
+            const CDiagPluginConstructionParam* aParams );                       
+
+    /**
+    * Setup active object for next iteration of plug-in loading
+    *    
+    */
+    void SetNextIteration();
+    
+    /**
+    * Load the next plug-in in the list per built in iterator
+    *    
+    */
+    void LoadNextPluginL();
+    
+    /**
+    * Add plug-in to plug-in pool by inserting into the plug-in tree.
+    * Plug-in ownership is transferred to the Plug-in Pool if it is
+    * supported.  If the plug-in is not supported, it is deleted.
+    *
+    * @param aPlugin pointer to the new plug-in to be added
+    * @return TUid UID of the plug-in to report back to the application.
+    * Set to TUid::Null() if the plug-in was not added to the pool.
+    */
+    TUid AddPluginToPoolLD( MDiagPlugin* aPlugin );
+    
+    /**
+    * Destroy implementation info regarding ECOM plug-ins
+    *    
+    */
+    void DestroyConstructionParams();            
+
+    /**
+    * Call when a plug-in is loaded to add a newly loaded plug-in to a currently 
+    * loaded suite (if available)
+    * no ownership transfer
+    *
+    * @param aPluginSuite pointer to the new plug-in to be added
+    */
+    void AddNewPluginToSuiteL(MDiagPlugin* aPlugin);
+    
+    /**
+    * Call when a suite is loaded to add any existing parentless plug-ins with
+    * matching parent UID to suite
+    * no ownership transfer
+    *
+    * @param aPluginSuite pointer to the new suite to be added
+    */
+    void AddPluginsToNewSuiteL(MDiagSuitePlugin* aPluginSuite);
+    
+    /**
+    * Resets all member data and notifies observer that load is copmlete
+    *
+    * @param aErrorCode Plug-In load error
+    * @return LoadCompletedL error, if any
+    */
+    TInt ResetAndNotify(TInt aErrorCode);
+
+
+private: // From CActive
+
+    /**
+    * @see CActive::RunL
+    */
+    virtual void RunL();
+
+    /**
+    * @see CActive::DoCancel
+    */
+    virtual void DoCancel();
+
+    /**
+    * @see CActive::RunError
+    */
+    virtual TInt RunError( TInt aError );
+
+private:    //  member data
+
+    MDiagPluginPoolObserver& iObserver;
+            
+    // List of plug-ins that have been loaded
+    RPointerArray<MDiagPlugin> iPlugins;        
+    
+    // Array of plug-in construction params        
+    // owned
+    RConstructionParamArray* iConstructionParamArray;
+    
+    // Indicates that all plug-ins have been loaded
+    TBool iPluginsLoaded;
+    
+    // Indicates that plug-ins are currently loading
+    TBool iPluginsLoading;
+            
+    // Index of current plug-in for plug-in load iteration
+    TInt iCurrentPluginIndex;            
+    
+    // Holds error code for first error found in loading process
+    TInt iErrorCode;
+    
+    // Total number of plug-ins found
+    TInt iTotalPluginsFound;
+    };
+    
+#endif // DIAGPLUGINPOOLIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagpluginpoolobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2007 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:  Observer interface to use with CDiagPluginPool 
+*
+*/
+
+
+#ifndef DIAGPLUGINPOOLOBSERVER_H
+#define DIAGPLUGINPOOLOBSERVER_H
+
+// INCLUDES
+#include <e32cmn.h>     // TUid
+#include <e32def.h>     // TInt
+
+// FORWARD DECLARATIONS
+class MDiagPlugin;
+
+/**
+*  Diagnostics Framework Plugin Pool Observer
+*
+*  This interface is called by CDiagPluginPool to notify the plug-in 
+*  loading progress. This is used only for LoadAsyncL() scenario.
+*
+*  @since S60 v5.0
+*/
+class MDiagPluginPoolObserver 
+    {
+public:
+
+    /**
+    * Notify client of plug-in loading progress.
+    *
+    * @param aCurrPlugin   Current plugin index in loading process. 
+    *                       Use it to display loading progress.
+    * @param aPluginCount  Totals number of plug-ins
+    * @param aLoadedPluginUid  Uid of the plug-in just loaded.
+    */
+    virtual void LoadProgressL( TUint aCurrentPlugin, 
+                                TUint aPluginCount, 
+                                const TUid& aLoadedPluginUid ) = 0;
+
+
+    /**
+    * Notify client of plug-in loading completion
+    *
+    * @param aError     KErrNone - Success
+    *                   KErrCorrupt  - One ore more plugin could not
+    *                   be loaded. 
+    *                   KErrNoMemory - Not enough memory.
+    */
+    virtual void LoadCompletedL( TInt aError ) = 0;
+    };
+
+
+#endif // DIAGPLUGINPOOLOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagresultdetail.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Detail Test Result Interface
+*
+*/
+
+
+#ifndef DIAGRESULTDETAIL_H
+#define DIAGRESULTDETAIL_H
+
+// INCLUDES
+#include <e32cmn.h>         // RBuf
+
+// FORWARD DECLARATIONS
+class CGulIcon;
+
+
+/**
+*  Diagnostics Framework Test Result Details
+*
+*  This interface allows application to query addtional information about
+*  Diagnostics Test Result.  
+*
+*  @since S60 v5.0
+*/
+class MDiagResultDetail 
+    {
+public:
+    /** 
+    * Possible Output Formats.
+    */
+    enum TOutputFormat
+        {
+        EGetMoreInfo,           // Human readable text format.
+        ECorrectionUrl,         // URL for correction
+        ECorrectionUrlCaption   // Caption for the correction URL.
+        };
+
+    /**
+    * Get list of supported output
+    *
+    * @param aOutputList   - Returns supported output formats
+    */
+    virtual void GetSupportedOutput( RArray<TOutputFormat>& aOutputList ) const = 0;
+
+    /**
+    * Check if a given output format is supported.
+    *
+    * @param aOutputFormat - Possible output formate.
+    * @return ETrue if supported. EFalse otherwise.
+    */
+    virtual TBool IsOutputSupported( TOutputFormat aOutputFormat ) const = 0;
+
+    /**
+    * Output current result to a specified format.
+    *
+    * @param aFormat   Format of desired output.
+    * @param aBuffer   Output buffer.
+    */
+    virtual void GetOutputL( TOutputFormat aFormat, RBuf& aBuffer ) const = 0;
+
+    /**
+    * Create an icon. Icon can be created based on the results of the test.
+    *
+    * @return An icon that matches the result of the test.
+    **/
+    virtual CGulIcon* CreateIconL() const = 0;
+
+    /**
+    * Externalize to CBufFlat. This will be how the data will be stored in the 
+    * CDiagResultsDatabaseItem
+    *
+    * @return CBufFlat containing the externalized data. Ownership is passed 
+    *   to the caller.
+    **/
+    virtual CBufFlat* ExternalizeToBufferL() const = 0;
+
+    /**
+    * C++ Virtual destructor. Virtual destructor must be defined to make sure
+    * that correct destructor is called. 
+    *
+    **/
+    virtual ~MDiagResultDetail() {};
+    };
+
+#endif // DIAGRESULTDETAIL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagresultsdbItembuilder.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Results Database Item Builder
+*
+*/
+
+
+
+#ifndef DIAGRESULTSDBITEMBUILDER_H
+#define DIAGRESULTSDBITEMBUILDER_H
+
+// INCLUDES
+#include <DiagResultsDatabaseItem.h>        // CDiagResultsDatabaseItem::TResult
+
+// FORWARD DECLARATIONS
+namespace DRM
+    {
+    class CDrmServiceApi;
+    }
+
+class MDiagResultDetail;
+
+
+/**
+*  Diagnostics Result Database Item Builder.
+*
+*  This class can be used to build CDiagResultsDatabaseItem, without having
+*  to have all the values avaliable.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagResultsDbItemBuilder ) : public CBase
+    {
+public:  // Constructors and Destructors
+    /**
+    * Two-phase constructor.
+    *
+    * This will set the test started time to now.
+    *
+    * @param aTestUid - Test Uid.
+    * @param aDependencyExecution - Whether thsa was executed as dependency.
+    * @return New instance of CDiagResultsDbItemBuilder
+    */
+    IMPORT_C static CDiagResultsDbItemBuilder* NewL( TUid  aTestUid,
+                                                     TBool aDependencyExecution );
+    IMPORT_C static CDiagResultsDbItemBuilder* NewLC( TUid  aTestUid,
+                                                      TBool aDependencyExecution );
+
+    /**
+    * Destructor
+    *
+    */
+    virtual ~CDiagResultsDbItemBuilder();
+
+public: // New Interface
+
+    /**
+    * Set Test Uid
+    *
+    * @param aUid - Test uid.
+    */
+    IMPORT_C void SetTestUid( TUid aUid );
+
+    /**
+    * Get Test Uid
+    *
+    * @return Test uid.
+    */
+    IMPORT_C TUid TestUid() const;
+
+    /**
+    * Get current time. If DRM clock is available, it will use the DRM clock.
+    *
+    */
+    IMPORT_C TTime GetCurrentTime() const;
+
+    /**
+    * Set whether test was executed as dependency or not.
+    *
+    * @param aWasDependency
+    */
+    IMPORT_C void SetWasDependency( TBool aWasDependency );
+
+    /**
+    * Get was dependency value
+    *
+    * @return ETrue if test was executed as a dependency.
+    */
+    IMPORT_C TBool WasDependency() const;
+
+    /**
+    * Update test result and also set completed time to now
+    *
+    * @param aResult - Test result.
+    */
+    IMPORT_C void SetTestCompleted( CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Get Test result
+    *
+    * @return Test result.
+    */
+    IMPORT_C CDiagResultsDatabaseItem::TResult TestResult() const;
+
+    /**
+    * Set Time Started 
+    *
+    * @param aTime - time started.
+    */
+    IMPORT_C void SetTimeStarted( TTime aTime );
+
+    /**
+    * Get Time started.
+    *
+    * @return Time started.
+    */
+    IMPORT_C TTime TimeStarted() const;
+
+    /**
+    * Set Time Completed
+    *
+    * @param aTime - time completed.
+    */
+    IMPORT_C void SetTimeCompleted( TTime aTime );
+
+    /**
+    * Get Time Completed..
+    *
+    * @return Time Completed.
+    */
+    IMPORT_C TTime TimeCompleted() const;
+
+    /**
+    * Set result detail object. If it was already set, previous object is deleted.
+    *
+    * @param aResultDetail - Result detail object. Ownership is transferred.
+    */
+    IMPORT_C void SetResultDetail( MDiagResultDetail* aResultDetail );
+
+    /**
+    * Get result detail object. Use static_cast to change to specific instance.
+    *   If result detail was not set previosuly, it will Panic with 
+    *   EDiagFrameworkInvalidState
+    *
+    * @return Result detail object.
+    */
+    IMPORT_C MDiagResultDetail& ResultDetail() const;
+
+    /**
+    * Create CDiagResultsDatabaseItem from data available.
+    *
+    */
+    IMPORT_C CDiagResultsDatabaseItem* ToResultsDatabaseItemL() const;
+
+    /**
+    * Create a simple CDiagResultsDatabaseItem. This function is meant to be
+    * used to create default result data with just with minimal set of information.
+    * It will use current time as both start and end time of test.
+    * If manipulation of other information in needed, either instantiate
+    * CDiagResultsDbItemBuilder or CDiagResultsDatabaseItem
+    *
+    * @param aTestUid - Uid of test plugin.
+    * @param aAsDependency - Whether it was executed as dependency or not.
+    * @param aResultType - Result of the test.
+    * @return Instance of CDiagResultsDatabaseItem* with given info. 
+    *   Ownership is transferred.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* CreateSimpleDbItemL( 
+        TUid aTestUid,
+        TBool aAsDependency,
+        CDiagResultsDatabaseItem::TResult aResultType );
+
+
+protected:  // constructors
+    /**
+    * C++ Constructor
+    *
+    * @param aTestUid - Uid of the test
+    * @param aDependencyExecution - Whether this is being executed as dependency.
+    */
+    CDiagResultsDbItemBuilder( TUid  aTestUid,
+                               TBool aDependencyExecution );
+    /**
+    * ConstructL
+    *
+    */
+    void ConstructL();
+
+private: // Data
+    /**
+    * iTestUid - Uid of the test plug-in that this result is for.
+    */
+    TUid iTestUid;
+
+    /**
+    * iDependencyExecution - Whether this test is being executed to 
+    *   satisfy dependency or not.
+    */
+    TBool iDependencyExecution;
+
+    /**
+    * iResut - Actual result of the test.
+    */
+    CDiagResultsDatabaseItem::TResult iResult;
+
+    /**
+    * iStartTime - Time test started.
+    */
+    TTime iStartTime;
+
+    /**
+    * iEndTime - Time test finished.
+    */
+    TTime iEndTime;
+
+    /**
+    * iResultDetail - Extra details data.
+    * Owns.
+    */
+    MDiagResultDetail* iResultDetail;
+
+    /**
+    * iDrmApi - Used to get accurate clock through DRM.
+    * Owns.
+    */
+    DRM::CDrmServiceApi* iDrmApi;
+    };
+
+
+#endif // DIAGRESULTSDBITEMBUILDER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagrootsuite.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagRootSuite
+*
+*/
+
+
+#ifndef DIAGROOTSUITE_H
+#define DIAGROOTSUITE_H
+
+
+// SYSTEM INCLUDES
+#include <DiagSuitePlugin.h>        // MDiagSuitePlugin
+
+// USER INCLUDES
+
+// fORWARD DECLARATIONS
+
+namespace DiagFwInternal
+    {
+/**
+*  Diagnostics Root Suite
+*
+*  This class implements root suite. This provides a container for ALL suites
+*  that can be loaded via Plug-in Pool.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagRootSuite ) : public CBase,
+                                      public MDiagSuitePlugin
+    {
+public:
+
+    /**
+    * Two-phased constructors.
+    *
+    * @return New instance of CDiagRootSuite*
+    */
+    static CDiagRootSuite* NewL();
+    static CDiagRootSuite* NewLC();
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CDiagRootSuite();
+
+public: // from MDiagPlugin
+    /**
+    * Get name of the plug-in
+    * @see MDiagPlugin::GetPluginNameL
+    */
+    virtual HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const;
+
+    /**
+    * Get name of the service it provides.
+    * @see MDiagPlugin::ServiceLogicalName
+    */
+    virtual const TDesC& ServiceLogicalName() const;
+
+    /**
+    * Get list af dependencies it requires.
+    * @see MDiagPlugin::GetLogicalDependenciesL
+    */
+    virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const;
+
+    /**
+    * Get Type of plug-in
+    * @see MDiagPlugin::Type
+    */
+    virtual TPluginType Type() const;
+
+    /**
+    * Create an icon for this plug-in.
+    * @see MDiagPlugin::CreateIconL
+    */
+    virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * Whether this plug-in should be visible to user or not.
+    * @see MDiagPlugin::IsVisible
+    */
+    virtual TBool IsVisible() const;
+
+    /**
+    * Whether this plug-in is supported in this build or not.
+    * @see MDiagPlugin::IsSupported
+    */
+    virtual TBool IsSupported() const;
+
+    /**
+    * Get localized title of the plug-in
+    * @see MDiagPlugin::GetTitleL
+    */
+    virtual HBufC* GetTitleL() const;
+
+    /**
+    * Get localized description of the plug-in
+    * @see MDiagPlugin::GetDescriptionL
+    */
+    virtual HBufC* GetDescriptionL() const;
+
+    /**
+    * Uid of the plug-in
+    * @see MDiagPlugin::Uid
+    */
+    virtual TUid Uid() const;
+
+    /**
+    * Uid of the parent plug-in
+    * @see MDiagPlugin::ParentUid
+    */
+    virtual TUid ParentUid() const;
+
+    /**
+    * Set destructor key for ECOM plug-in
+    * @see MDiagPlugin::SetDtorIdKey
+    */
+    virtual void SetDtorIdKey( TUid aDtorIdKey );
+
+    /**
+    * Custom operation
+    * @see MDiagPlugin::CustomOperationL
+    */
+    virtual TAny* CustomOperationL( TUid aUid, TAny* aParam );
+
+    /**
+    * Custom operation
+    * @see MDiagPlugin::GetCustomL
+    */
+    virtual TAny* GetCustomL( TUid aUid, TAny* aParam );
+
+    /**
+    * Order to appear in the parent
+    * @see MDiagPlugin::Order
+    */
+    virtual TUint Order() const;
+
+    /**
+    * Initialize the plug-in for execution.
+    * @see MDiagPlugin::TestSessionBeginL
+    */
+    virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                    TBool aSkipDependencyCheck,
+                                    TAny* aCustomParams );
+
+    /**
+    * Cleanup the plug-in after execution.
+    * @see MDiagPlugin::TestSessionEndL
+    */
+    virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                  TBool aSkipDependencyCheck,
+                                  TAny* aCustomParams );
+
+public: // from MDiagSuitePlugin
+    /**
+    * Get list of children in the specified order.
+    * @see MDiagSuitePlugin::GetChildrenL
+    */
+    virtual void GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                               TSortOrder aOrder ) const;
+
+    /**
+    * Add child 
+    * @see MDiagSuitePlugin::AddChildL
+    */
+    virtual void AddChildL( MDiagPlugin* aChild );
+
+    /**
+    * Prepare suite entering one of its children.
+    * @see MDiagSuitePlugin::PrepareExecutionL
+    */
+    virtual void PrepareChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                            TBool aSkipDependencyCheck,
+                                            TBool aDependencyExecution );
+
+    /**
+    * Finalize suite for exiting one of its children.
+    * @see MDiagSuitePlugin::FinalizeExecutionL
+    */
+    virtual void FinalizeChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                             TBool aSkipDependencyCheck,
+                                             TBool aDependencyExecution );
+
+    /**
+    * Get list of uids of its children it the specified order.
+    * @see MDiagSuitePlugin::GetChildrenUidsL
+    */
+    virtual void GetChildrenUidsL( RArray<TUid>& aUids,
+                                   TSortOrder aOrder ) const;
+
+    /**
+    * Stop execution of PrepareExecutionL or FinalizeExecutionL
+    * @see MDiagSuitePlugin::ExecutionStopL
+    */
+    virtual void ExecutionStopL( TStopReason aReason );
+
+
+private: // private constructors
+
+    /**
+    * C++ Constructor.
+    **/
+    CDiagRootSuite();
+    
+    /**
+    * 2nd phase constructor
+    */
+    void ConstructL();
+
+
+private: // data
+    
+    /**
+    * iChildren - list of plug-ins it owns.
+    */
+    RPointerArray<MDiagPlugin> iChildren;
+    };
+    } // namespace DiagFwInternal
+#endif // DIAGROOTSUITE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagsuiteexecparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2007 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:  Provides execution parameters for Suite plug-ins
+*
+*/
+
+
+
+#ifndef DIAGSUITEEXECPARAM_H
+#define DIAGSUITEEXECPARAM_H
+
+// SYSTEM INCLUDES
+#include <e32def.h>             // IMPORT_C / EXPORT_C
+
+
+// FORWARD DECLARATIONS
+class MDiagSuiteObserver;
+class MDiagEngineCommon;
+
+/**
+* Diagnostics Suite plug-in Execution Parameters
+*
+* This class provides the execution environment for Suite plug-ins.
+*
+* @since S60 v5.0
+**/
+NONSHARABLE_CLASS( TDiagSuiteExecParam )
+    {
+public:
+    /**
+    * C++ Constructor
+    *
+    * @param aObserver - Observer to notify continuation. 
+    * @param aEngine - Reference to engine that provides necessary environment
+    *   for suite execution, such as CDiagPluginPool, CAknViewAppUi and
+    *   CDiagPluginExecPlan.
+    */
+    IMPORT_C TDiagSuiteExecParam( MDiagSuiteObserver& aObserver,
+                                  MDiagEngineCommon& aEngine );
+    
+public: // new functions
+
+    /**
+    * Get the Suite plug-in execution observer.
+    *
+    * @return MDiagSuiteObserver - Observer of Suite-plugin.
+    **/
+    IMPORT_C MDiagSuiteObserver& Observer() const;
+
+    /**
+    * Get execution engine.
+    *
+    * @return MDiagEngineCommon - Engine that executes the plug-in.
+    *   Engine provides various functionalities needed for executing
+    *   plug-ins.
+    **/
+    IMPORT_C MDiagEngineCommon& Engine() const;
+    
+private: // data
+    /**
+    * iObserver  - Suite execution observer.
+    */
+    MDiagSuiteObserver&  iObserver;
+
+    /**
+    * iEngine - Engine common interface.
+    */
+    MDiagEngineCommon&  iEngine;
+    };
+
+#endif // DIAGSUITEEXECPARAM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagsuiteobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 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:  Interface to observe suite plug-ins
+*
+*/
+
+
+#ifndef DIAGSUITEOBSERVER_H
+#define DIAGSUITEOBSERVER_H
+
+// FORWARD DECLARTION
+class MDiagSuitePlugin;
+
+/**
+*  Diagnostics Framework Suite Plug-in Observer
+*
+*  This interface is called by Suite Plug-ins to notify the engine
+*  of its suite execution completion.
+*
+*  @since S60 v5.0
+*/
+class MDiagSuiteObserver
+    {
+public:
+    /**
+    * Notify engine of suite plug-in execution completion.
+    * This should be called when PreTestExecutionL() or
+    * PostTestExecutionL() is called.
+    *
+    * @param aSender - reference to sender object.
+    */
+    virtual void ContinueExecutionL( const MDiagSuitePlugin& aSender ) = 0;
+    };
+
+
+#endif // DIAGSUITEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagsuiteplugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2007 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 a test suite i.e. contains collection of tests. 
+*
+*/
+
+
+
+#ifndef DIAGSUITEPLUGIN_H
+#define DIAGSUITEPLUGIN_H
+
+// INCLUDES
+#include    <DiagPlugin.h>          // MDiagPlugin
+
+// FORWARD DECLARATIONS
+class MDiagSuiteObserver;
+class MDiagEngineCommon;
+class CDiagPluginPool;
+class TDiagSuiteExecParam;
+
+/**
+* Test suite plug-in abstract interface. 
+*
+* @since S60 v5.0
+**/
+class MDiagSuitePlugin: public MDiagPlugin
+    {
+public: //DATA STRUCTURES
+
+    /**
+    * Defines sorting algorithm.
+    **/
+    enum TSortOrder 
+    {
+        ENotSorted,
+        ESortByPosition
+    };
+
+    /**
+    * Reason for execution stop.
+    **/
+    enum TStopReason
+    {
+        ESkip,
+        ECancelAll,
+        EWatchdog
+    };
+
+public:    // new API
+
+    /**
+    * Get children of this plug-in. The pointer array is guaranteed to 
+    * be sorted defined by TSortOrder.
+    * @param aChildren Children are appended into this array.
+    * @param aOrder Sorting algorithm.
+    **/
+    virtual void GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                               TSortOrder aOrder ) const = 0;
+
+    /**
+    * Add one child. Child can be either a test suite or a test plug-in.
+    * @param aChild - Child to be added. Ownership is transferred to
+    *               MDiagPluginSuite.
+    **/
+    virtual void AddChildL( MDiagPlugin* aChild ) = 0;
+
+    /**
+    * Called before one of its test plug-in is executed.  Note that it will
+    * not be called if two of its children plug-ins are executed in 
+    * sequence.
+    *
+    * @param aExecParams Parameters for suite pre execution
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    virtual void PrepareChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                            TBool aSkipDependencyCheck,
+                                            TBool aDependencyExecution ) = 0;
+
+    /**
+    * Called before test execution switches to another test suite.
+    *
+    * @param aExecParams Parameters for suite post execution
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    virtual void FinalizeChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                             TBool aSkipDependencyCheck,
+                                             TBool aDependencyExecution ) = 0;
+
+    /**
+    * Get the Uids. The uid is used for database access.
+    * Test suites return a list of their childrens' uids.
+    *
+    * @param aUids An UID array.
+    * @param aOrder Sorting algorithm.
+    **/
+    virtual void GetChildrenUidsL( RArray<TUid>& aUids,
+                                   TSortOrder aOrder ) const = 0;
+
+    /**
+    * Cancels pre/post execution. Cancellation is expected to be synchronous.
+    * Suite plug-in must not call ContinueExecutionL().
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    **/
+    virtual void ExecutionStopL( TStopReason aReason ) = 0;
+    };
+
+#endif // DIAGSUITEPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagtestexecparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2007 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:  Provides execution parameters for test plug-ins
+*
+*/
+
+
+
+#ifndef DIAGTESTEXECPARAM_H
+#define DIAGTESTEXECPARAM_H
+
+
+// SYSTEM INCLUDES
+#include <e32def.h>             // IMPORT_C / EXPORT_C
+
+// FORWARD DECLARATIONS
+class MDiagTestObserver;
+class MDiagEngineCommon;
+
+/**
+* Diagnostics test plug-in Execution Parameters
+*
+* This class provides the execution environment for test plug-ins.
+*
+* @since S60 v5.0
+**/
+NONSHARABLE_CLASS( TDiagTestExecParam )
+    {
+public: // constructor
+    /**
+    * C++ Constructor
+    *
+    * @param aObserver - Observer to notify test execution progress.
+    * @param aEngine - Reference to engine that provides necessary environment
+    *   for test execution, such as CDiagPluginPool, or CAknViewAppUi.
+    */
+    IMPORT_C TDiagTestExecParam( MDiagTestObserver& aObserver,
+                                 MDiagEngineCommon& aEngine );
+    
+public: // new functions
+
+    /**
+    * Get the test plug-in execution observer.
+    *
+    * @return MDiagTestObserver - Observer of test-plugin. Test progress
+    *   and completion should be notified via this object.
+    **/
+    IMPORT_C MDiagTestObserver& Observer() const;
+
+    /**
+    * Get execution engine.
+    *
+    * @return MDiagEngineCommon - Engine that executes the plug-in.
+    *   Engine provides various functionalities needed for executing
+    *   plug-ins.
+    **/
+    IMPORT_C MDiagEngineCommon& Engine() const;
+    
+private: // data
+    /**
+    * iObserver - Test execution observer.
+    */
+    MDiagTestObserver&  iObserver;
+
+    /**
+    * iEngine - Common Engine interface
+    */
+    MDiagEngineCommon&  iEngine;
+    };
+
+#endif // DIAGTESTEXECPARAM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagtestobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2007 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:  Interface to observe test plug-ins
+*
+*/
+
+
+#ifndef DIAGTESTOBSERVER_H
+#define DIAGTESTOBSERVER_H
+
+// INCLUDES
+#include <e32def.h>                         // TUint
+#include <DiagEngineWatchdogTypes.h>        // TDiagEngineWatchdogTypes
+
+// FORWARD DECLARATION
+class CDiagResultsDatabaseItem;
+class MDiagTestPlugin;
+
+
+/**
+* Diagnostics Framework Test Plug-in Observer
+*
+* This interface is called by Test Plug-ins to notify the engine
+* of its test execution progress or completion.
+*
+* @since S60 v3.2
+*/
+class MDiagTestObserver
+    {
+public:
+    /**
+    * Notify engine of test plug-in execution progress.
+    *
+    * @param aSender - Reference to sender object.
+    * @param aCurrentStep - Current execution step.
+    */
+    virtual void TestProgressL( const MDiagTestPlugin& aSender, 
+                                TUint aCurrentStep ) = 0;
+
+
+    /**
+    * Notify engine of test plug-in execution completion.
+    *
+    * @param aSender       Reference to sender object.
+    * @param aTestResult   Result of test execution. Ownership is transferred
+    *                      from the plug-in to engine.
+    */
+    virtual void TestExecutionCompletedL( const MDiagTestPlugin& aSender, 
+                                          CDiagResultsDatabaseItem* aTestResult ) = 0;
+    };
+
+
+#endif // DIAGTESTOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/inc/diagtestplugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2007 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:  Test Plugin Abstract Interface
+*
+*/
+
+
+#ifndef DIAGTESTPLUGIN_H
+#define DIAGTESTPLUGIN_H
+
+// INCLUDES
+#include    <DiagPlugin.h>              // MDiagPlugin
+
+
+// FORWARD DECLARATION
+class CDiagPluginExecPlan;
+class MDiagTestObserver;
+class MDiagEngineCommon;
+class CDiagPluginPool;
+class TDiagTestExecParam;
+class CDiagResultsDatabaseItem;
+class MDiagResultDetail;
+
+/**
+* Diagnostics test plug-in abstract interface.
+*
+* @since S60 v5.0
+**/
+class MDiagTestPlugin: public MDiagPlugin
+    {
+public: 
+
+    /**
+    * Run mode defines what kind of behaviour is expected from this plug-in.
+    **/
+    enum TRunMode
+        {
+        EInteractiveView,       // plugin with a view
+        EInteractiveDialog,     // interactive, but with dialogs
+        EAutomatic              // automatic tests
+        };
+
+    /**
+    * Reason for execution stop.
+    **/
+    enum TStopReason
+        {
+        ESkip,
+        ECancelAll,
+        EWatchdog
+        };
+
+    /**
+    * Execute a diagnostics test. This is an asynchronous method. The plug-in
+    * must call MDiagTestObserver:TestExecutionCompletedL when test has finished.
+    *
+    * @param aExecParams   Parameters for running the test.
+    * @param aSkipDependencyCheck - If ETrue, plug-in should execute even if 
+    *   dependencies are not executed.
+    * @param aDependencyExecution - If ETrue, this is being executed to 
+    *   satisfy dependency.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   These should be used if TDiagTestExecParam is not enough. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual void RunTestL( TDiagTestExecParam* aExecParam,
+                           TBool aSkipDependencyCheck,
+                           TBool aDependencyExecution,
+                           TAny* aCustomParams ) = 0;
+
+    /**
+    * Describes the run mode of the test plug-in.
+    *
+    * @return Run mode.
+    * @see TDiagRunMode.
+    **/
+    virtual TRunMode RunMode() const = 0;
+
+    /**
+    * Cancels testing. Cancellation is expected to be synchronous.
+    * Test plug-in must return the result immediately, and it must not call
+    * TestExecutionCompletedL(). Ownership of the CDiagResultsDatabaseItem is 
+    * transferred to the caller.
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    * @return Returns result object.  Test must not call TestExecutionCompletedL.
+    **/
+    virtual CDiagResultsDatabaseItem* ExecutionStopL( TStopReason aReason ) = 0;
+
+    /**
+    * Suspend test.  If test cannot be suspended, it will leave with
+    * KErrNotSupported.
+    **/
+    virtual void SuspendL() = 0;
+
+    /**
+    * Resume test. If test cannot be resumed, it will leave with 
+    * KErrNotSupported.
+    **/
+    virtual void ResumeL() = 0;
+
+    /**
+    * Get the number of steps that is needed to execute tests. 
+    * This can be used to calculate progress information. 
+    *
+    * @return The number of steps.
+    **/
+    virtual TUint TotalSteps() const = 0;
+
+    /**
+    * Create detailed information object from test result.
+    * Ownership is transferred to caller.
+    *
+    * @param aTestResult - Base test result.
+    * @return Instance of MDiagResultDetail* that can provide detailed 
+    *   information about the last test.
+    **/
+    virtual MDiagResultDetail* CreateDetailL( 
+                        const CDiagResultsDatabaseItem& aResult ) const = 0;
+    };
+
+#endif // DIAGTESTPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/DiagTestExecParam.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007 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:  Class definition of TDiagTestExecParam
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagTestExecParam.h>
+
+// SYSTEM INCLUDE FILES
+
+// USER INCLUDE FILES
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// TDiagTestExecParam::TDiagTestExecParam()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TDiagTestExecParam::TDiagTestExecParam( MDiagTestObserver& aObserver,
+                                                  MDiagEngineCommon& aEngine )
+    :   iObserver( aObserver ),
+        iEngine( aEngine )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDiagTestExecParam::Observer()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagTestObserver& TDiagTestExecParam::Observer() const
+    {
+    return iObserver;
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDiagTestExecParam::Engine()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagEngineCommon& TDiagTestExecParam::Engine() const
+    {
+    return iEngine;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagengine.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,376 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagEngine
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagengineimpl.h"
+
+// SYSTEM INCLUDE FILES
+#include <DiagEngine.h>
+
+// USER INCLUDE FILES
+#include "diagframework.pan"        // For Panics codes.
+
+#include "diagpluginexecplan.h"   // ADO & Platformization Changes
+#include "diagexecplanentryimpltest.h"   // ADO & Platformization Changes
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::NewL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagEngine* CDiagEngine::NewL( CAknViewAppUi&         aViewAppUi, 
+                                         MDiagEngineObserver&   aObserver,
+                                         RDiagResultsDatabase&  aDbSession,
+                                         CDiagPluginPool&       aPluginPool,
+                                         TBool                  aDisableDependency,
+                                         const RArray< TUid >&  aExecutionBatch )
+    {
+    CDiagEngine* self = CDiagEngine::NewLC( aViewAppUi,
+                                            aObserver,
+                                            aDbSession,
+                                            aPluginPool,
+                                            aDisableDependency,
+                                            aExecutionBatch );
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::NewLC()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagEngine* CDiagEngine::NewLC( CAknViewAppUi&         aViewAppUi, 
+                                          MDiagEngineObserver&   aObserver,
+                                          RDiagResultsDatabase&  aDbSession,
+                                          CDiagPluginPool&       aPluginPool,
+                                          TBool                  aDisableDependency,
+                                          const RArray< TUid >&  aExecutionBatch )
+    {
+    CDiagEngine* self = new ( ELeave ) CDiagEngine();
+    CleanupStack::PushL( self );
+
+    self->iEngineImpl = CDiagEngineImpl::NewL( aViewAppUi,
+                                               aObserver,
+                                               aDbSession,
+                                               aPluginPool,
+                                               aDisableDependency,
+                                               aExecutionBatch );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::NewL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagEngine* CDiagEngine::NewL( CAknViewAppUi&         aViewAppUi, 
+                                         MDiagEngineObserver&   aObserver,
+                                         RDiagResultsDatabase&  aDbSession,
+                                         CDiagPluginPool&       aPluginPool,
+                                         TUid                   aIncompleteRecordUid )
+    {
+    CDiagEngine* self = CDiagEngine::NewLC( aViewAppUi,
+                                            aObserver,
+                                            aDbSession,
+                                            aPluginPool,
+                                            aIncompleteRecordUid );
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::NewLC()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagEngine* CDiagEngine::NewLC( CAknViewAppUi&         aViewAppUi, 
+                                          MDiagEngineObserver&   aObserver,
+                                          RDiagResultsDatabase&  aDbSession,
+                                          CDiagPluginPool&       aPluginPool,
+                                          TUid                   aIncompleteRecordUid )
+    {
+    CDiagEngine* self = new ( ELeave ) CDiagEngine();
+    CleanupStack::PushL( self );
+
+    self->iEngineImpl = CDiagEngineImpl::NewL( aViewAppUi,
+                                               aObserver,
+                                               aDbSession,
+                                               aPluginPool,
+                                               aIncompleteRecordUid );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::~CDiagEngine
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagEngine::~CDiagEngine()
+    {
+    delete iEngineImpl;
+    iEngineImpl = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::ExecuteL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagEngine::ExecuteL()
+    {
+    iEngineImpl->ExecuteL();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::SetCustomParam
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagEngine::SetCustomParam( TAny* aCustomParams )
+    {
+    __ASSERT_ALWAYS( aCustomParams, Panic( EDiagFrameworkBadArgument ) );
+    iEngineImpl->SetCustomParam( aCustomParams );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::SuspendL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagEngine::SuspendL()
+    {
+    iEngineImpl->SuspendL();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngine::ResumeL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagEngine::ResumeL()
+    {
+    iEngineImpl->ResumeL();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ExecutionPlanL
+// ---------------------------------------------------------------------------
+//
+const MDiagPluginExecPlan& CDiagEngine::ExecutionPlanL() const
+    {
+    return iEngineImpl->ExecutionPlanL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ExecutionStopL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::ExecutionStopL( TCancelMode aCancelMode )
+    {
+    iEngineImpl->ExecutionStopL( aCancelMode );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::ResetWatchdog()
+    {
+    iEngineImpl->ResetWatchdog();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType )
+    {
+    iEngineImpl->ResetWatchdog( aWatchdogType );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete )
+    {
+    iEngineImpl->ResetWatchdog( aExpectedTimeToComplete );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ViewAppUi
+// ---------------------------------------------------------------------------
+//
+CAknViewAppUi& CDiagEngine::ViewAppUi()
+    {
+    return iEngineImpl->ViewAppUi();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ViewAppUi
+// ---------------------------------------------------------------------------
+//
+const CAknViewAppUi& CDiagEngine::ViewAppUi() const
+    {
+    return iEngineImpl->ViewAppUi();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::DbRecord
+// ---------------------------------------------------------------------------
+//
+RDiagResultsDatabaseRecord& CDiagEngine::DbRecord()
+    {
+    return iEngineImpl->DbRecord();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::DbRecord
+// ---------------------------------------------------------------------------
+//
+const RDiagResultsDatabaseRecord& CDiagEngine::DbRecord() const
+    {
+    return iEngineImpl->DbRecord();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::DbRecord
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPool& CDiagEngine::PluginPool()
+    {
+    return iEngineImpl->PluginPool();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::DbRecord
+// ---------------------------------------------------------------------------
+//
+const CDiagPluginPool& CDiagEngine::PluginPool() const
+    {
+    return iEngineImpl->PluginPool();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::AddToConfigListL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::AddToConfigListL( MDiagEngineCommon::TConfigListType aListType,
+                                     const TDesC&                       aText )
+    {
+    return iEngineImpl->AddToConfigListL( aListType, aText );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::RemoveFromConfigListL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::RemoveFromConfigListL( MDiagEngineCommon::TConfigListType aListType,
+                                          const TDesC&                       aText )
+    {
+    return iEngineImpl->RemoveFromConfigListL( aListType, aText );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::CreateCommonDialogLC
+// ---------------------------------------------------------------------------
+//
+CAknDialog* CDiagEngine::CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                               TAny* aInitData )
+    {
+    return iEngineImpl->CreateCommonDialogLC( aDialogType, aInitData );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::ExecuteAppCommandL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                      TAny* aParam1,
+                                      TAny* aParam2 )
+    {
+    iEngineImpl->ExecuteAppCommandL( aCommand, aParam1, aParam2 );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::StopWatchdogTemporarily
+// ---------------------------------------------------------------------------
+//
+void CDiagEngine::StopWatchdogTemporarily()
+    {
+    iEngineImpl->StopWatchdogTemporarily();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::IsDependencyDisabled
+// ---------------------------------------------------------------------------
+//
+TBool CDiagEngine::IsDependencyDisabled() const
+    {
+    return iEngineImpl->IsDependencyDisabled();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngine::CustomParam
+// ---------------------------------------------------------------------------
+//
+TAny* CDiagEngine::CustomParam() const
+    {
+    return iEngineImpl->CustomParam();
+    }
+    
+    
+  // ADO & Platformization Changes
+    
+///@@@KSR: changes for Codescanner error val = High
+//EXPORT_C TBool CDiagEngine::GetPluginDependency()
+EXPORT_C TBool CDiagEngine::GetPluginDependencyL()
+{
+	return iEngineImpl->ExecutionPlanL().CurrentExecutionItem().AsDependency();
+}
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagenginecallhandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,402 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagEngineCallHandler
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagenginecallhandler.h"   
+
+// SYSTEM INCLUDE FILES
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+#include <badesca.h>                        // CDesCArrayFlat
+
+// USER INCLUDE FILES
+#include "diagenginecallhandlerobserver.h"  // MDiagEngineCallHandlerObserver
+
+
+// CONSTANTS
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagEngineCallHandler* CDiagEngineCallHandler::NewL( 
+        MDiagEngineCallHandlerObserver& aObserver )
+    {
+    CDiagEngineCallHandler* self = new( ELeave )CDiagEngineCallHandler( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::CDiagEngineCallHandler
+// ---------------------------------------------------------------------------
+//
+CDiagEngineCallHandler::CDiagEngineCallHandler( 
+        MDiagEngineCallHandlerObserver& aObserver )
+    :   CActive( EPriorityStandard ),
+        iObserver( aObserver ),
+        iCallStatus(),
+        iCallStatusPckg( iCallStatus )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+
+    iCallIgnoreList = new( ELeave )CDesCArrayFlat( 1 );
+    
+    iTelephony = CTelephony::NewL();
+
+    // Get call initial status.
+    TInt err = iTelephony->GetLineStatus( CTelephony::EVoiceLine, iCallStatusPckg );
+
+    if ( err != KErrNone )
+        {
+        // This can happen even if hw failure does not occur. E.g.
+        // user puts the phone in offline mode, or sim card is missing.
+        // In this situation, assume that phone is offline and continue
+        // since it does not actually affect engine execution.
+        LOGSTRING2( "CDiagEngineCallHandler::ConstructL() "
+            L"Unable to get voice line status. Err = %d", err )
+        iState = EDiagEngineCallHandlerStateIdle;
+        }
+    else
+        {
+        LOGSTRING2( "CDiagEngineCallHandler::ConstructL() Call status = %d",
+            iCallStatus.iStatus )
+        if ( iCallStatus.iStatus != CTelephony::EStatusIdle )
+            {
+            iState = EDiagEngineCallHandlerStateBusy;
+            }
+        }
+
+    RequestNotify();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::~CDiagEngineCallHandler
+// ---------------------------------------------------------------------------
+//
+CDiagEngineCallHandler::~CDiagEngineCallHandler()
+    {
+    Cancel();
+
+    delete iTelephony;
+    iTelephony = NULL;
+
+    delete iCallIgnoreList;
+    iCallIgnoreList = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::AddIgnoreNumberL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::AddIgnoreNumberL( const TDesC& aNumber )
+    {
+    LOGSTRING( "CDiagEngineCallHandler::AddIgnoreNumberL: Number = " )
+    LOGTEXT( aNumber )
+
+    iCallIgnoreList->AppendL( aNumber );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::RemoveIgnoreNumberL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::RemoveIgnoreNumberL( const TDesC& aNumber )
+    {
+    LOGSTRING( "CDiagEngineCallHandler::RemoveIgnoreNumberL: Number = " )
+    LOGTEXT( aNumber )
+
+    TInt position = 0;
+
+    TInt err = iCallIgnoreList->Find( aNumber, position );
+
+    if ( err == KErrNone )
+        {
+        // element found. Remove.
+        iCallIgnoreList->Delete( position );
+        }
+    else
+        {
+        LOGSTRING2( "CDiagEngineCallHandler::RemoveIgnoreNumberL:"
+                L"Not found. Err = %d", err )
+        User::Leave( err );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::CurrentState
+// ---------------------------------------------------------------------------
+//
+TDiagEngineCallHandlerState CDiagEngineCallHandler::CurrentState() const
+    {
+    return iState;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::RequestNotify
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::RequestNotify()
+    {
+    Cancel();
+    iTelephony->NotifyChange(
+        iStatus, CTelephony::EVoiceLineStatusChange, iCallStatusPckg );
+    SetActive();
+    }
+
+
+// ---------------------------------------------------------------------------
+// from CActive
+// CDiagEngineCallHandler::RunL()
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::RunL()
+    {
+    TBool notifyObserver = EFalse;
+    
+    LogCallStatus();    
+
+    switch ( iCallStatus.iStatus )
+        {
+        case CTelephony::EStatusIdle:
+            notifyObserver = HandleIdle();
+            break;
+
+        case CTelephony::EStatusDialling:   // fall through
+        case CTelephony::EStatusRinging:    
+            notifyObserver = HandleCall();
+            break;
+
+        default:
+            // Ignore. 
+            break;
+        }
+
+    if ( iStatus != KErrCancel )
+        {
+        RequestNotify();
+        }
+
+    if ( notifyObserver )
+        {
+        iObserver.CallHandlerStateChangedL( iState );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// from CActive
+// CDiagEngineCallHandler::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::DoCancel()
+    {
+    if ( iTelephony )
+        {
+        iTelephony->CancelAsync( CTelephony::EVoiceLineStatusChangeCancel );
+        }
+    }
+    
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::HandleIdle
+// ---------------------------------------------------------------------------
+//
+TBool CDiagEngineCallHandler::HandleIdle()
+    {
+    LOGSTRING( "CDiagEngineCallHandler::HandleIdle()" )
+
+    TBool notifyObserver = EFalse;
+    if ( iState != EDiagEngineCallHandlerStateIdle )
+        {
+        LOGSTRING( "CDiagEngineCallHandler::HandleIdle() Changing to IDLE" )
+        iState = EDiagEngineCallHandlerStateIdle;
+        notifyObserver = ETrue;
+        }
+
+    return notifyObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::HandleCall
+// ---------------------------------------------------------------------------
+//
+TBool CDiagEngineCallHandler::HandleCall()
+    {
+    LOGSTRING( "CDiagEngineCallHandler::HandleCall()" )
+
+    TBool notifyObserver = EFalse;
+
+    if ( iState == EDiagEngineCallHandlerStateIdle )
+        {
+        LOGSTRING( "CDiagEngineCallHandler::HandleCall() was in Idle" )
+
+        // Get phone number
+        TBuf<CTelephony::KMaxTelNumberSize> number;
+
+        CTelephony::TRemotePartyInfoV1 remInfoUse;
+        CTelephony::TCallInfoV1        callInfoUse;
+        CTelephony::TCallSelectionV1   callSelectionUse;
+
+        callSelectionUse.iLine = CTelephony::EVoiceLine;
+        callSelectionUse.iSelect = CTelephony::EInProgressCall;
+
+        CTelephony::TRemotePartyInfoV1Pckg  remParty( remInfoUse );
+        CTelephony::TCallInfoV1Pckg         callInfo( callInfoUse );
+        CTelephony::TCallSelectionV1Pckg    callSelection( callSelectionUse );
+
+        iTelephony->GetCallInfo( callSelection, callInfo, remParty );
+
+        LOGSTRING( "CDiagEngineCallHandler::HandleCall() Remote Number = " )
+        LOGTEXT( remInfoUse.iRemoteNumber.iTelNumber )
+    
+        LOGSTRING( "CDiagEngineCallHandler::HandleCall() Dialed Number = " )
+        LOGTEXT( callInfoUse.iDialledParty.iTelNumber )
+
+        if ( iCallStatus.iStatus == CTelephony::EStatusRinging )
+            {
+            number.Copy( remInfoUse.iRemoteNumber.iTelNumber );
+            }
+        else if ( iCallStatus.iStatus == CTelephony::EStatusDialling )
+            {
+            number.Copy( callInfoUse.iDialledParty.iTelNumber );
+            }
+        else
+            {
+            // number not valid.
+            }
+
+        // check if the number is in ignore list
+        TInt position = 0;
+        TInt err = iCallIgnoreList->Find( number, position );
+
+        if ( err == KErrNone )
+            {
+            // number found.
+            LOGSTRING( "CDiagEngineCallHandler::HandleCall() Ignore: Number =" )
+            LOGTEXT( number )
+            }
+        else
+            {
+            // number found.
+            LOGSTRING( "CDiagEngineCallHandler::HandleCall() Going to Busy State. Number = " )
+            LOGTEXT( number )
+
+            iState = EDiagEngineCallHandlerStateBusy;
+
+            notifyObserver = ETrue;
+            }
+        }
+
+    return notifyObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineCallHandler::LogCallStatus
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineCallHandler::LogCallStatus() const
+    {
+    #ifdef _DEBUG
+
+    switch ( iCallStatus.iStatus )
+        {
+        case CTelephony::EStatusUnknown:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusUnknown" )
+            break;
+
+        case CTelephony::EStatusIdle:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusIdle" )
+            break;
+
+        case CTelephony::EStatusDialling:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusDialling" )
+            break;
+
+        case CTelephony::EStatusRinging:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusRinging" )
+            break;
+
+        case CTelephony::EStatusAnswering:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusAnswering" )
+            break;
+
+        case CTelephony::EStatusConnecting:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusConnecting" )
+            break;
+
+        case CTelephony::EStatusConnected:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusConnected" )
+            break;
+
+        case CTelephony::EStatusReconnectPending:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusReconnectPending" )
+            break;
+
+        case CTelephony::EStatusDisconnecting:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusDisconnecting" )
+            break;
+
+        case CTelephony::EStatusHold:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L" Call Status = EStatusHold" )
+            break;
+
+        case CTelephony::EStatusTransferring:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L"Call Status = EStatusTransferring" )
+            break;
+
+        case CTelephony::EStatusTransferAlerting:
+            LOGSTRING( "CDiagEngineCallHandler::LogCallStatus():"
+                    L"Call Status = EStatusTransferAlerting" )
+            break;
+
+        default:
+            LOGSTRING2( "CDiagEngineCallHandler::LogCallStatus():"
+                    L"Unknown Call Status = %d", iCallStatus.iStatus )
+            break;
+        }
+
+    #endif // _DEBUG
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagengineconfig.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2007 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:  Class definition of TDiagEngineConfig
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagengineconfig.h"       
+
+// SYSTEM INCLUDE FILES
+#include <centralrepository.h>              // CRepository
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+
+// USER INCLUDE FILES
+#include "diagnosticsfwprivatecrkeys.h"     // Private CenRep Key
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::TDiagEngineConfig()
+// ---------------------------------------------------------------------------
+//
+TDiagEngineConfig::TDiagEngineConfig()
+    :   iCenRepWatchdogTimeoutInteractive( 0 ),
+        iCenRepWatchdogTimeoutAutomatic( 0 ),
+        iCenRepInitDelay( 0 ),
+        iDisableDependency( EFalse )
+    {
+    // note that this is a T class, so all member must be initialized explicitly.
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::ReadCenrepKeysL
+// ---------------------------------------------------------------------------
+//
+void TDiagEngineConfig::ReadCenrepKeysL()
+    {
+    CRepository* cenrep = NULL;
+    cenrep = CRepository::NewLC( KCRUidDiagnosticsFw );
+
+    ReadTimeIntervalFromCenrepL( *cenrep, 
+                                 KDiagFwWatchdogTimeoutInteractive, 
+                                 iCenRepWatchdogTimeoutInteractive );
+    ReadTimeIntervalFromCenrepL( *cenrep,
+                                 KDiagFwWatchdogTimeoutAutomatic, 
+                                 iCenRepWatchdogTimeoutAutomatic );
+    ReadTimeIntervalFromCenrepL( *cenrep,
+                                 KDiagFwTestInitDelay,
+                                 iCenRepInitDelay );
+       
+    CleanupStack::PopAndDestroy( cenrep );
+    cenrep = NULL;
+
+    LOGSTRING2( "TDiagEngineConfig::ReadCenrepKeysL() "
+        L"KDiagFwWatchdogTimeoutInteractive: %d micro seconds", 
+        iCenRepWatchdogTimeoutInteractive.Int() )
+    LOGSTRING2( "TDiagEngineConfig::ReadCenrepKeysL() "
+        L"KDiagFwWatchdogTimeoutAutomatic: %d sec",
+        iCenRepWatchdogTimeoutAutomatic.Int() )
+    LOGSTRING2( "TDiagEngineConfig::ReadCenrepKeysL(): "
+        L"KDiagFwTestInitDelay: %d microsec", 
+        iCenRepInitDelay.Int() )
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::ReadTimeIntervalFromCenrepL
+// ---------------------------------------------------------------------------
+//
+void TDiagEngineConfig::ReadTimeIntervalFromCenrepL( 
+        CRepository& aCenrep,
+        TUint32 aKey,
+        TTimeIntervalMicroSeconds32& aValue )
+    {
+    TInt timeoutValue = 0;
+    User::LeaveIfError( aCenrep.Get( aKey, timeoutValue ) );
+    aValue = timeoutValue;
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::WatchdogTimeoutValueInteractive
+// ---------------------------------------------------------------------------
+//
+const TTimeIntervalMicroSeconds32& TDiagEngineConfig::WatchdogTimeoutValueInteractive() const
+    {
+    return iCenRepWatchdogTimeoutInteractive;
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::WatchdogTimeoutValueAutomatic
+// ---------------------------------------------------------------------------
+//
+const TTimeIntervalMicroSeconds32& TDiagEngineConfig::WatchdogTimeoutValueAutomatic() const
+    {
+    return iCenRepWatchdogTimeoutAutomatic;
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::TestPluginInitialDelay
+// ---------------------------------------------------------------------------
+//
+const TTimeIntervalMicroSeconds32& TDiagEngineConfig::TestPluginInitialDelay() const
+    {
+    return iCenRepInitDelay;
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::SetDependencyDisabled
+// ---------------------------------------------------------------------------
+//
+void TDiagEngineConfig::SetDependencyDisabled( TBool aDisableDependency )
+    {
+    iDisableDependency = aDisableDependency;
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagEngineConfig::IsDependencyDisabled
+// ---------------------------------------------------------------------------
+//
+TBool TDiagEngineConfig::IsDependencyDisabled() const
+    {
+    return iDisableDependency;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagengineeventbasic.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2007 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:  Class definition of DiagFwInternal::CEventBasic
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagengineeventbasic.h"       
+
+// SYSTEM INCLUDE FILES
+#include <DiagFrameworkDebug.h>
+
+// USER INCLUDE FILES
+#include "diagframework.pan"            // Panic Codes.
+
+using namespace DiagFwInternal;
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CEventBasic::CEventBasic()
+// ---------------------------------------------------------------------------
+//
+CEventBasic::CEventBasic( TEvent aType )
+    :   iType( aType )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CEventBasic::GetType()
+// ---------------------------------------------------------------------------
+//
+TEvent CEventBasic::GetType() const
+    {
+    return iType;
+    }
+
+// ---------------------------------------------------------------------------
+// CEventBasic::ToString()
+// ---------------------------------------------------------------------------
+//
+const TDesC& CEventBasic::ToString() const
+    {
+    #if _DEBUG
+        _LIT( KEventExecute,             "EEventExecute" );
+        _LIT( KEventPlanCreated,         "EEventPlanCreated" );
+        _LIT( KEventExecuteNext,         "EEventExecuteNext" );
+        _LIT( KEventTestProgress,        "EEventTestProgress" );
+        _LIT( KEventResumeToRunning,     "EEventResumeToRunning" );
+        _LIT( KEventResumeToCreatingPlan,"EEventResumeToCreatingPlan" );
+        _LIT( KEventSkip,                "EEventSkip" );
+        _LIT( KEventCancelAll,           "EEventCancelAll" );
+        _LIT( KEventSuspend,             "EEventSuspend" );
+        _LIT( KEventVoiceCallActive,     "EEventVoiceCallActive" );
+        _LIT( KEventAllPluginsCompleted, "EEventAllPluginsCompleted" );
+        _LIT( KEventFinalized,           "EEventFinalized" );
+
+        switch ( iType )
+            {
+            case EEventExecute:
+                return KEventExecute();
+            case EEventPlanCreated:
+                return KEventPlanCreated();
+            case EEventExecuteNext:
+                return KEventExecuteNext();
+            case EEventTestProgress:
+                return KEventTestProgress();
+            case EEventResumeToRunning:
+                return KEventResumeToRunning();
+            case EEventResumeToCreatingPlan:
+                return KEventResumeToCreatingPlan();
+            case EEventSkip:
+                return KEventSkip();
+            case EEventCancelAll:
+                return KEventCancelAll();
+            case EEventSuspend:
+                return KEventSuspend();
+            case EEventVoiceCallActive:
+                return KEventVoiceCallActive();
+            case EEventAllPluginsCompleted:
+                return KEventAllPluginsCompleted();
+            case EEventFinalized:
+                return KEventFinalized();
+            default:
+                Panic( EDiagFrameworkInternal );
+                break;
+            }
+
+
+    #endif // if _DEBUG
+    
+    _LIT( KEventDefaultName, "?" );
+    return KEventDefaultName();
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagengineeventtestprogress.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2007 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:  Class definition of DiagFwInternal::CEventTestProgress
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagengineeventtestprogress.h"   
+
+// SYSTEM INCLUDE FILES
+
+// USER INCLUDE FILES
+
+using namespace DiagFwInternal;
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CEventTestProgress::CEventTestProgress()
+// ---------------------------------------------------------------------------
+//
+CEventTestProgress::CEventTestProgress(
+        const MDiagPlugin& aSender, TUint aCurrStep, TUint aTotalSteps ) 
+    :   CEventBasic( EEventTestProgress ), 
+        iSender( aSender ),
+        iCurrStep( aCurrStep ),
+        iTotalSteps( aTotalSteps )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CEventTestProgress::Sender()
+// ---------------------------------------------------------------------------
+//
+const MDiagPlugin& CEventTestProgress::Sender() const
+    {
+    return iSender;
+    }
+
+// ---------------------------------------------------------------------------
+// CEventTestProgress::CurrStep()
+// ---------------------------------------------------------------------------
+//
+TUint CEventTestProgress::CurrStep() const
+    {
+    return iCurrStep;
+    }
+
+// ---------------------------------------------------------------------------
+// CEventTestProgress::TotalSteps()
+// ---------------------------------------------------------------------------
+//
+TUint CEventTestProgress::TotalSteps() const
+    {
+    return iTotalSteps;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagengineimpl.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1551 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagEngineImpl
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagengineimpl.h"                 // CDiagEngineImpl
+
+// SYSTEM INCLUDE FILES
+#include <DiagPluginPool.h>                 // CDiagPluginPool
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+#include <DiagPlugin.h>                     // MDiagPlugin
+#include <DiagTestExecParam.h>              // TDiagTestExecParam
+#include <DiagSuiteExecParam.h>             // TDiagSuiteExecParam
+#include <DiagResultsDbItemBuilder.h>       // CDiagResultsDbItemBuilder
+#include <DiagResultsDbRecordEngineParam.h> // CDiagResultsDbRecordEngineParam
+
+// USER INCLUDE FILES
+#include "diagpluginexecplanimpl.h"         // CDiagPluginExecPlanImpl
+#include "diagexecplanentryimpltest.h"      // CDiagExecPlanEntryImplTest
+#include "diagenginestatemachine.h"         // DiagFwInternal::CStateMachine
+#include "diagenginecallhandler.h"          // CDiagEngineCallHandler
+#include "diagframework.pan"                // Panic Codes
+#include "diagengineconfig.h"               // TDiagEngineConfig
+
+// EVENT INCLUDE FILES
+#include "diagengineeventbasic.h"           // DiagFwInternal::CEventBasic
+#include "diagengineeventtestprogress.h"    // DiagFwInternal::CEventTestProgress
+
+using namespace DiagFwInternal;
+
+// DATA
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NewL()
+// ---------------------------------------------------------------------------
+//
+CDiagEngineImpl* CDiagEngineImpl::NewL( 
+        CAknViewAppUi&          aViewAppUi, 
+        MDiagEngineObserver&    aObserver,
+        RDiagResultsDatabase&   aDbSession,
+        CDiagPluginPool&        aPluginPool,
+        TBool                   aDisableDependency,
+        const RArray< TUid >&   aExecutionBatch )
+    {
+    CDiagEngineImpl* self = CDiagEngineImpl::NewLC( aViewAppUi,
+                                                    aObserver,
+                                                    aDbSession,
+                                                    aPluginPool,
+                                                    aDisableDependency,
+                                                    aExecutionBatch );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NewLC()
+// ---------------------------------------------------------------------------
+//
+CDiagEngineImpl* CDiagEngineImpl::NewLC( 
+        CAknViewAppUi&          aViewAppUi, 
+        MDiagEngineObserver&    aObserver,
+        RDiagResultsDatabase&   aDbSession,
+        CDiagPluginPool&        aPluginPool,
+        TBool                   aDisableDependency,
+        const RArray< TUid >&   aExecutionBatch )
+    {
+    CDiagEngineImpl* self = new ( ELeave ) CDiagEngineImpl( aViewAppUi,
+                                                            aObserver,
+                                                            aDbSession,
+                                                            aPluginPool );
+
+    CleanupStack::PushL( self );
+    self->ConstructNewRecordL( aDisableDependency, aExecutionBatch );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NewL()
+// ---------------------------------------------------------------------------
+//
+CDiagEngineImpl* CDiagEngineImpl::NewL( CAknViewAppUi&          aViewAppUi, 
+                                        MDiagEngineObserver&    aObserver,
+                                        RDiagResultsDatabase&   aDbSession,
+                                        CDiagPluginPool&        aPluginPool,
+                                        TUid                    aIncompleteRecordUid )
+    {
+    CDiagEngineImpl* self = CDiagEngineImpl::NewLC( aViewAppUi,
+                                                    aObserver,
+                                                    aDbSession,
+                                                    aPluginPool,
+                                                    aIncompleteRecordUid );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NewLC()
+// ---------------------------------------------------------------------------
+//
+CDiagEngineImpl* CDiagEngineImpl::NewLC( CAknViewAppUi&    aViewAppUi, 
+                                   MDiagEngineObserver&    aObserver,
+                                   RDiagResultsDatabase&   aDbSession,
+                                   CDiagPluginPool&        aPluginPool,
+                                   TUid                    aIncompleteRecordUid )
+    {
+    CDiagEngineImpl* self = new ( ELeave ) CDiagEngineImpl( aViewAppUi,
+                                                            aObserver,
+                                                            aDbSession,
+                                                            aPluginPool );
+
+    CleanupStack::PushL( self );
+    self->ConstructIncompleteRecordL( aIncompleteRecordUid );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::CDiagEngineImpl
+// ---------------------------------------------------------------------------
+//
+CDiagEngineImpl::CDiagEngineImpl( CAknViewAppUi&          aViewAppUi,
+                                  MDiagEngineObserver&    aObserver,
+                                  RDiagResultsDatabase&   aDbSession,
+                                  CDiagPluginPool&        aPluginPool )
+    :   CActive( EPriorityStandard ),
+        iViewAppUi( aViewAppUi ),
+        iObserver( aObserver ),
+        iDbSession( aDbSession ),
+        iPluginPool( aPluginPool )
+    {
+    LOGSTRING( "---- DIAG ENGINE BEGIN ---- DIAG ENGINE BEGIN ----{" )
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::ConstructNewRecordL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ConstructNewRecordL( TBool aDisableDependency,
+                                           const RArray< TUid >& aExecutionBatch )
+    {
+    ConstructCommonL();
+
+    LOGSTRING( "CDiagEngineImpl::ConstructNewRecordL()" )
+
+    iContinueIncompleteRecord = EFalse;
+    iEngineConfig.SetDependencyDisabled( aDisableDependency );
+
+    // convert uid array to plugin reference array.
+    // Also, make a copy of the plug-in UID array so that it can be
+    // passed to database.
+    TInt batchCount = aExecutionBatch.Count();
+
+    // uidList must be allocated in heap since it database will own the data later.
+    RArray< TUid >* uidList = new( ELeave )RArray< TUid >();
+    CleanupStack::PushL( uidList );     // to delete array itself.
+    CleanupClosePushL( *uidList );      // to call close.
+
+    uidList->ReserveL( batchCount );
+    
+    MDiagPlugin* plugin = NULL;
+
+    for ( TInt i = 0; i < batchCount ; i++ )
+        {
+        LOGSTRING2( "CDiagEngineImpl::ConstructNewRecordL() "
+            L"Add plugin 0x%08x", aExecutionBatch[i].iUid )
+            
+        iPluginPool.FindPlugin( aExecutionBatch[i], plugin );
+        iBatch.AppendL( plugin );
+        plugin = NULL;
+
+        uidList->AppendL( aExecutionBatch[i] );
+        }
+
+    CDiagResultsDbRecordEngineParam* engineParam = 
+        CDiagResultsDbRecordEngineParam::NewL(
+            uidList,                                // ownership transfer
+            !iEngineConfig.IsDependencyDisabled()   /* isDependencyExecution */ );
+
+    CleanupStack::Pop( uidList );   // CleanupClosePushL( *uidList )
+    CleanupStack::Pop( uidList );   // CleanupStack::PushL( uidList )
+    uidList = NULL;
+
+    CleanupStack::PushL( engineParam );
+    User::LeaveIfError( 
+        iDbRecord.CreateNewRecord( iDbSession, iRecordId, *engineParam ) );
+    CleanupStack::PopAndDestroy( engineParam );
+    engineParam = NULL;
+
+    iPlan = CDiagPluginExecPlanImpl::NewL( *this, iEngineConfig, *this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::ConstructIncompleteRecordL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ConstructIncompleteRecordL( TUid aIncompleteRecordUid )
+    {
+    ConstructCommonL();
+
+    LOGSTRING2( "CDiagEngineImpl::ConstructIncompleteRecordL() "
+        L"RecordId = 0x%08x", aIncompleteRecordUid.iUid )
+        
+    iRecordId = aIncompleteRecordUid;
+    iContinueIncompleteRecord = ETrue;
+
+    User::LeaveIfError( 
+        iDbRecord.Connect( iDbSession, 
+                           iRecordId,
+                           EFalse   /* aReadOnly */ ) );
+
+    // make sure that record is open for writing.
+    TBool isTestCompleted = EFalse;
+    User::LeaveIfError( iDbRecord.IsTestCompleted( isTestCompleted ) );
+    if ( isTestCompleted )
+        {
+        User::Leave( KErrLocked );
+        }
+
+    // recover original parameter
+    CDiagResultsDbRecordEngineParam* engineParam = NULL;
+    User::LeaveIfError(
+        iDbRecord.GetEngineParam( engineParam ) );
+
+    CleanupStack::PushL( engineParam );
+
+    // Recover original batch.
+    MDiagPlugin* plugin = NULL;
+    iEngineConfig.SetDependencyDisabled( !engineParam->DependencyExecution() );
+    const RArray< TUid >& uidArray = engineParam->ExecutionsUidArray();
+    TInt count = uidArray.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        LOGSTRING2( "CDiagEngineImpl::ConstructNewRecordL() "
+            L"Add plugin 0x%08x", uidArray[i].iUid )
+            
+        User::LeaveIfError( 
+            iPluginPool.FindPlugin( uidArray[i], plugin ) );
+        iBatch.AppendL( plugin );
+        plugin = NULL;
+        }
+    
+    CleanupStack::PopAndDestroy( engineParam );
+    engineParam = NULL;
+
+    iPlan = CDiagPluginExecPlanImpl::NewL( *this, iEngineConfig, *this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::ConstructCommonL()
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ConstructCommonL()
+    {
+    LOGSTRING( "CDiagEngineImpl::ConstructCommonL." )
+
+    // Read Cenrep key
+    iEngineConfig.ReadCenrepKeysL();
+
+    // Create state machine.
+    iStateMachine = CStateMachine::NewL( *this );
+
+    // Create call handler.
+    iCallHandler = CDiagEngineCallHandler::NewL( *this );
+
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::~CDiagEngineImpl
+// ---------------------------------------------------------------------------
+//
+CDiagEngineImpl::~CDiagEngineImpl()
+    {
+    LOGSTRING( "CDiagEngineImpl::~CDiagEngineImpl() Destructor" )
+
+    StopAllRequests();
+
+    CleanupIncompleteTestSession();
+
+    // always delete plan before record is closed.
+    delete iPlan;
+    iPlan = NULL;
+
+    iDbRecord.Close();
+
+    iBatch.Close(); // MUST NOT destroy since we don't own elements within it
+
+    delete iStateMachine;
+    iStateMachine = NULL;
+
+    delete iSuspendedResult;
+    iSuspendedResult = NULL;
+
+    delete iCallHandler;
+    iCallHandler = NULL;
+
+    LOGSTRING( "} ---- DIAG ENGINE END ---- DIAG ENGINE END ----" )
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::CleanupIncompleteTestSession
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::CleanupIncompleteTestSession()
+    {
+    if ( iStateMachine == NULL || 
+            iStateMachine->CurrentState() == EStateNotReady ||
+            iStateMachine->CurrentState() == EStateStopped )
+        {
+        // Test is never started or already finished. Nothing to clean up here.
+        return;
+        }
+
+    // At this point, we can either suspend or complete the test record.
+    // Normally, since state machine is not in EStateStopped state,
+    // record should suspended.
+    //
+    // However, even if it is not completely done executing the plan, 
+    // if last test is already completed, engine will report TestCompleted( ETrue ).
+    // Otherwise, when examining db record for resuming, the record will appear
+    // incomplete, but in reality there is no more test to execute and resuming the
+    // record will immediately finish the session, which is meaningless.
+    // Hence, when last test plug-in is executed, engine will record test completed,
+    // instead of suspend, even if there are suite items left in plan.
+
+    LOGSTRING2( "CDiagEngineImpl::CleanupIncompleteTestSession() State = %d", 
+        iStateMachine->CurrentState() )
+
+    switch( iStateMachine->CurrentState() )
+        {
+        case EStateStopped:
+            // all completed. Nothing to finalize.
+            break;
+
+        case EStateNotReady:        // fall through
+        case EStateCreatingPlan:
+            // Plan was not fully created.
+            // Mark the record as incomplete and let execution plan
+            // to figure out how to resume later.
+            // No need to call NotifyPluginsOfTestSessionEnd() since 
+            // TestSessionBeginL() was never called. 
+            iDbRecord.Suspend();    // in destructor. Error ignored.
+            break;
+        
+        case EStateCancelAll:
+            {
+            // Test session was being cancelled. Since we were in cancel all mode,
+            // it cannot be resumed. Mark the record completed.
+            NotifyPluginsOfTestSessionEnd();
+
+            TInt err =  iDbRecord.TestCompleted( EFalse /* aFullyComplete */ );
+            LOGSTRING2( "CDiagEngineImpl::CleanupIncompleteTestSession() "
+                L" TestCompleted( EFalse ) err = %d", err )
+            // in destructor. Error ignored.
+            }
+            break;
+
+        case EStateFinalizing:
+            {
+            // Engine was about to finalize, but never got a chance to.
+            // In this state, db record should always be closed with TestCompleted
+            // since it is a normal execution finish scenario and it cannot
+            // be resumed later.
+            NotifyPluginsOfTestSessionEnd();
+
+            TBool isFullyCompleted = ( iEngineError == KErrNone );
+            TInt err = iDbRecord.TestCompleted( isFullyCompleted );
+            LOGSTRING3( "CDiagEngineImpl::CleanupIncompleteTestSession() "
+                L"iDbRecord.TestCompleted( %d ) err = %d", isFullyCompleted, err )
+            
+            // We are in destructor. Ignore errors from db.
+            }
+            break;
+
+        default:
+            // In other states, engine was still executing some items.
+            // Check if it shoud be marked as suspended or not.
+            {
+            TBool allTestsCompleted = EFalse;
+            for ( TInt i = iPlan->CurrentIndex(); i < iPlan->Count(); i++ )
+                {
+                if ( (*iPlan)[i].Plugin().Type() == MDiagPlugin::ETypeTestPlugin &&
+                     (*iPlan)[i].State() != MDiagExecPlanEntry::EStateCompleted )
+                    {
+                    // Found a test entry that is not completed.
+                    allTestsCompleted = EFalse;
+                    break; //lint !e960  break OK here.
+                    }
+                }
+
+            NotifyPluginsOfTestSessionEnd();
+
+            if ( allTestsCompleted )
+                {
+                TInt err =  iDbRecord.TestCompleted( ETrue /* aFullyComplete */ );
+                LOGSTRING2( "CDiagEngineImpl::CleanupIncompleteTestSession() "
+                    L" iDbRecord.TestCompleted( ETrue ) err = %d", err )
+                }
+            else
+                {
+                TInt err = iDbRecord.Suspend();
+                LOGSTRING2( "CDiagEngineImpl::CleanupIncompleteTestSession(). "
+                    L"iDbRecord.Suspend() err = %d", err )
+                }
+            
+            }
+            break;
+
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::ExecuteL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecuteL()
+    {
+    __ASSERT_ALWAYS( iStateMachine->CurrentState() == EStateNotReady,
+                     Panic( EDiagFrameworkInvalidState ) );
+
+    iStateMachine->AddEventL( EEventExecute );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::SetCustomParam
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::SetCustomParam( TAny* aCustomParams )
+    {
+    __ASSERT_ALWAYS( aCustomParams, Panic( EDiagFrameworkBadArgument ) );
+
+    // Custom parameter can be set only when engine is not running.
+    __ASSERT_ALWAYS( iStateMachine->CurrentState() == EStateNotReady, 
+                     Panic( EDiagFrameworkInvalidState ) );
+
+    iCustomParam = aCustomParams;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::SuspendL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::SuspendL()
+    {
+    DiagFwInternal::TState state = iStateMachine->CurrentState();
+
+    // Suspendable states:
+    __ASSERT_ALWAYS( ( state == EStateRunning ||
+                       state == EStateCreatingPlan ||
+                       state == EStateFinalizing ||
+                       state == EStateStopped ),
+                     Panic( EDiagFrameworkInvalidState ) );
+
+    if ( state == EStateFinalizing || state == EStateStopped )
+        {
+        // ignore suspend request. All tests are already completed and
+        // we are just waiting to finalize db record and report final
+        // result.
+        return;
+        }
+
+    StopAllRequests();
+
+    LOGSTRING( "CDiagEngineImpl::SuspendL(). Adding suspend event" )
+    iStateMachine->AddEventL( EEventSuspend );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::ResumeL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ResumeL()
+    {
+    __ASSERT_ALWAYS( iStateMachine->CurrentState() == EStateSuspended,
+                     Panic( EDiagFrameworkInvalidState ) );
+
+    LOGSTRING( "CDiagEngineImpl::SuspendL(). Adding resume event" )
+    AddResumeEventL( MDiagEngineObserver::EResumedByClient );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ExecutionPlanL
+// ---------------------------------------------------------------------------
+//
+const MDiagPluginExecPlan& CDiagEngineImpl::ExecutionPlanL() const
+    {
+    return *iPlan;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ExecutionStopL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecutionStopL( TCancelMode aCancelMode )
+    {
+    DiagFwInternal::TState state = iStateMachine->CurrentState();
+
+    // Acceptable states for execution stop.
+    __ASSERT_ALWAYS( state == EStateCreatingPlan ||
+                     state == EStateRunning ||
+                     state == EStateSuspended ||
+                     state == EStateFinalizing ||
+                     state == EStateStopped,
+                     Panic( EDiagFrameworkInvalidState ) );
+
+    if ( state == EStateFinalizing || state == EStateStopped )
+        {
+        // ignore cancel request. All tests are already completed and
+        // we are just waiting to finalize db record and report final
+        // result.
+        return;
+        }
+
+    StopAllRequests();
+    
+    if ( aCancelMode == ESkip )
+        {
+        iStateMachine->AddEventL( EEventSkip );
+        }
+    else
+        {
+        iStateMachine->AddEventL( EEventCancelAll );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ResetWatchdog()
+    {
+    iPlan->CurrentExecutionItem().ResetWatchdog();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType )
+    {
+    iPlan->CurrentExecutionItem().ResetWatchdog( aWatchdogType );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete )
+    {
+    iPlan->CurrentExecutionItem().ResetWatchdog( aExpectedTimeToComplete );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ViewAppUi
+// ---------------------------------------------------------------------------
+//
+CAknViewAppUi& CDiagEngineImpl::ViewAppUi()
+    {
+    return iViewAppUi;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ViewAppUi
+// ---------------------------------------------------------------------------
+//
+const CAknViewAppUi& CDiagEngineImpl::ViewAppUi() const
+    {
+    return iViewAppUi;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::DbRecord
+// ---------------------------------------------------------------------------
+//
+RDiagResultsDatabaseRecord& CDiagEngineImpl::DbRecord()
+    {
+    return iDbRecord;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::DbRecord
+// ---------------------------------------------------------------------------
+//
+const RDiagResultsDatabaseRecord& CDiagEngineImpl::DbRecord() const
+    {
+    return iDbRecord;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::PluginPool
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPool& CDiagEngineImpl::PluginPool()
+    {
+    return iPluginPool;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::PluginPool
+// ---------------------------------------------------------------------------
+//
+const CDiagPluginPool& CDiagEngineImpl::PluginPool() const
+    {
+    return iPluginPool;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::AddToConfigListL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::AddToConfigListL(
+        MDiagEngineCommon::TConfigListType aListType, 
+        const TDesC& aText )
+    {
+    switch ( aListType )
+        {
+        case MDiagEngineCommon::EConfigListCallIngore:
+            iCallHandler->AddIgnoreNumberL( aText );
+            break;
+
+        default:
+            LOGSTRING2( "CDiagEngineImpl::AddToConfigListL(). Invalid ListType %d",
+                aListType )
+            Panic( EDiagFrameworkBadArgument );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::RemoveFromConfigListL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::RemoveFromConfigListL(
+        MDiagEngineCommon::TConfigListType aListType,
+        const TDesC& aText )
+    {
+    switch ( aListType )
+        {
+        case MDiagEngineCommon::EConfigListCallIngore:
+            iCallHandler->RemoveIgnoreNumberL( aText );
+            break;
+
+        default:
+            LOGSTRING2( "CDiagEngineImpl::RemoveFromConfigListL(). Invalid ListType %d",
+                aListType )
+            Panic( EDiagFrameworkBadArgument );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::CreateCommonDialogLC
+// ---------------------------------------------------------------------------
+//
+CAknDialog* CDiagEngineImpl::CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                                   TAny* aInitData )
+    {
+    return iObserver.CreateCommonDialogLC( aDialogType, aInitData );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::ExecuteAppCommandL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                          TAny* aParam1,
+                                          TAny* aParam2 )
+    {
+    iObserver.ExecuteAppCommandL( aCommand, aParam1, aParam2 );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::StopWatchdogTemporarily
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::StopWatchdogTemporarily()
+    {
+    if ( iStateMachine == NULL || iPlan == NULL )
+        {
+        return;
+        }
+
+    if ( iStateMachine->CurrentState() == EStateRunning )
+        {
+        iPlan->CurrentExecutionItem().StopWatchdogTemporarily();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::IsDependencyDisabled
+// ---------------------------------------------------------------------------
+//
+TBool CDiagEngineImpl::IsDependencyDisabled() const
+    {
+    return iEngineConfig.IsDependencyDisabled();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCommon
+// CDiagEngineImpl::CustomParam
+// ---------------------------------------------------------------------------
+//
+TAny* CDiagEngineImpl::CustomParam() const
+    {
+    return iCustomParam;
+    }   //lint !e1763 Custom param is just passed along. Does not actually change engine.
+
+// ---------------------------------------------------------------------------
+// From class MDiagExecPlanEntryImplObserver
+// CDiagEngineImpl::ExecPlanEntryProgressL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecPlanEntryProgressL( 
+        CDiagExecPlanEntryImpl& aSender,
+        TUint aCurrentStep, 
+        TUint aTotalSteps )
+    {
+    LOGSTRING4( "CDiagEngineImpl::ExecPlanEntryProgressL: Plugin = 0x%08x, (%d / %d) ",
+        aSender.Plugin().Uid().iUid,
+        aCurrentStep, 
+        aTotalSteps )
+
+    if ( aSender.Plugin().Uid() == iPlan->CurrentExecutionItem().Plugin().Uid() )
+        {
+        CEventTestProgress* event = new ( ELeave ) CEventTestProgress(
+                aSender.Plugin(), aCurrentStep, aTotalSteps );
+
+        iStateMachine->AddEventL( event ); // ownership changed.
+        }
+    else
+        {
+        // probably timing issue. Ignore event.
+        __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagExecPlanEntryImplObserver
+// CDiagEngineImpl::ExecPlanEntryExecutedL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecPlanEntryExecutedL( CDiagExecPlanEntryImpl& aSender )
+    {
+    LOGSTRING2( "CDiagEngineImpl::ExecPlanEntryExecutedL: Plugin = 0x%08x",
+        aSender.Plugin().Uid().iUid )
+
+    if ( aSender.Plugin().Uid() != iPlan->CurrentExecutionItem().Plugin().Uid() )
+        {
+        // probably timing issue. Ignore event.
+        __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+        }
+    else
+        {
+        TInt error = KErrNone;
+        if ( aSender.IsStoppedByClient() )
+            {
+            error = KErrCancel;
+            }
+
+        CDiagResultsDatabaseItem* result = NULL;
+
+        if ( aSender.Plugin().Type() == MDiagPlugin::ETypeTestPlugin )
+            {
+            // Test was completed. Get test result.
+            CDiagExecPlanEntryImplTest& testEntry = 
+                static_cast< CDiagExecPlanEntryImplTest& >( aSender );
+
+            result = testEntry.GetLastTestResultL();
+
+            __ASSERT_ALWAYS( result != NULL, Panic( EDiagFrameworkNullTestResult ) );
+            }
+
+        NotifyResultAndContinueL( error, result );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagExecPlanEntryImplObserver
+// CDiagEngineImpl::ExecPlanEntryCriticalError
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecPlanEntryCriticalError( TInt aError )
+    {
+    LOGSTRING2( "CDiagEngineImpl::ExecPlanEntryCriticalError: "
+        L"Critical failure %d", aError )
+
+    // Unrecoverable error has occered. e.g. out of memory, disk full etc.
+    iStateMachine->HandleError( aError );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineStateMachineObserver
+// CDiagEngineImpl::HandleStateChangedL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleStateChangedL( 
+        TState aPreviousState, 
+        TState aCurrentState,
+        const CEventBasic& aEventPreview )
+    {
+    // NOTE: This method is called by state machine as soon as an event that
+    // changes states is called. This means that it could execute within caller's
+    // call stack. (e.g. it could be still within application or plug-in's 
+    // call stack.) It is best to limit amount of implementation here to
+    // things that must be done as soon as an event occurs.
+    // 
+    // Suspend and Resume are exceptions since they require immediate notification
+    // to observer. Otherwise, observer might have mismatch in notifications.
+
+    LOGSTRING3( "CDiagEngineImpl::HandleStateChangedL(): "
+            L"Entering State : %d( %S )",
+            aCurrentState, &iStateMachine->StateName( aCurrentState ) )
+
+    switch ( aCurrentState )
+        {
+        case EStateSuspended:
+            // keep track of state befor suspended, so that we can resume
+            // to correct state.
+            iSuspendedPrevState = aPreviousState;
+
+            MDiagEngineObserver::TSuspendReason reason;
+            if ( aEventPreview.GetType() == EEventSuspend )
+                {
+                reason = MDiagEngineObserver::ESuspendByClient;
+                }
+            else
+                {
+                reason = MDiagEngineObserver::ESuspendByPhoneCall;
+                }
+
+            // This will also notify iObserver.
+            DoSuspendL( reason );
+            break;
+
+        case EStateRunning: 
+            if ( aEventPreview.GetType() == EEventResumeToRunning )
+                {
+                LOGSTRING( "CDiagEngineImpl::HandleStateChangedL(). Notify resume" )
+                iObserver.TestExecutionResumedL( iResumeReason );
+                }
+            break;
+
+        case EStateCreatingPlan:
+            if ( aEventPreview.GetType() == EEventResumeToCreatingPlan )
+                {
+                LOGSTRING( "CDiagEngineImpl::HandleStateChangedL(). Notify resume" )
+                iObserver.TestExecutionResumedL( iResumeReason );
+                }
+            break;
+        
+        default:
+            // Do nothing.
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineStateMachineObserver
+// CDiagEngineImpl::HandleEventL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventL( CEventBasic& aEvent )
+    {
+    LOGSTRING5( "CDiagEngineImpl::HandleEventL(): State=%d(%S), Event=%d(%S)",
+        iStateMachine->CurrentState(), 
+        &iStateMachine->StateName( iStateMachine->CurrentState() ),
+        aEvent.GetType(), &aEvent.ToString() )
+            
+    switch ( iStateMachine->CurrentState() )
+        {
+        case EStateNotReady:
+            LOGSTRING( "CDiagEngineImpl::HandleEventL: "
+                L"ERROR! Cannot accept events in EStateNotReady State" )
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+            break;
+
+        case EStateCreatingPlan:
+            HandleEventInCreatingPlanStateL( aEvent );
+            break;
+
+        case EStateRunning:
+            HandleEventInRunningStateL( aEvent );
+            break;
+
+        case EStateCancelAll:
+            HandleEventInCancelAllStateL( aEvent );
+            break;
+
+        case EStateSuspended:
+            HandleEventInSuspendedStateL( aEvent );
+            break;
+
+        case EStateFinalizing:
+            HandleEventInFinalizingStateL( aEvent );
+            break;
+
+        case EStateStopped:
+            HandleEventInStoppedStateL( aEvent );
+            break;
+
+        case EStateAny:     // fall through
+        default:
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+            break;
+        }
+    LOGSTRING( "CDiagEngineImpl::HandleEventL(): return" )
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventInCreatingPlanStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventInCreatingPlanStateL( CEventBasic& aEvent )
+    {
+    switch ( aEvent.GetType() )
+        {
+        case EEventExecute:                 // fall through
+        case EEventResumeToCreatingPlan:
+            StartCreateExecutionPlanL();
+            break;
+        
+        default:
+            LOGSTRING2( "CDiagEngineImpl::HandleEventInCreatingPlanStateL: "
+                        L"Invalid event = %d", aEvent.GetType() )
+            // Ignored.
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventInRunningStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventInRunningStateL( CEventBasic& aEvent )
+    {
+    switch ( aEvent.GetType() )
+        {
+        case EEventPlanCreated:         
+            // Normal case. Plan is created normally.
+            HandlePlanCreatedL();
+            break;
+        
+        case EEventExecuteNext:
+            ExecuteNextPluginL();
+            break;
+
+        case EEventSkip:
+            HandleSkipL();
+            break;
+
+        case EEventTestProgress:
+            NotifyTestProgressL( static_cast<CEventTestProgress&>( aEvent ) );
+            break;
+
+        case EEventResumeToRunning:
+            DoResumeL();
+            break;
+
+        default:
+            LOGSTRING2( "CDiagEngineImpl::HandleEventInRunningStateL "
+                        L"Invalid event = %d", aEvent.GetType() )
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventInCancelAllStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventInCancelAllStateL( CEventBasic& aEvent )
+    {
+    switch ( aEvent.GetType() )
+        {
+        case EEventCancelAll:
+        case EEventExecuteNext:
+            HandleCancelAllL();
+            break;
+
+        case EEventSuspend:                 // fall through
+        case EEventVoiceCallActive:
+            // suspend is always handed in its own state
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+            break;
+
+        default:
+            // other events are ingored( e.g. progress ), since
+            // cancel has been requested
+            LOGSTRING2( "CDiagEngineImpl::HandleEventInCancelAllStateL "
+                        L"Invalid event = %d", aEvent.GetType() )
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventInSuspendedStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventInSuspendedStateL( CEventBasic& aEvent )
+    {
+    switch ( aEvent.GetType() )
+        {
+        case EEventSuspend:
+            // nothing to do. Suspend is immediate, so it is handled
+            // in HandleStateChangedL 
+            break;
+
+        default:
+            // suspended. ignore.
+            LOGSTRING2( "CDiagEngineImpl::HandleEventInSuspendedStateL "
+                        L"Invalid event = %d", aEvent.GetType() )
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventInFinalizingStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventInFinalizingStateL( CEventBasic& aEvent )
+    {
+    switch ( aEvent.GetType() )
+        {
+        case EEventAllPluginsCompleted:
+            FinalizeTestSessionL();
+            break;
+
+        default:
+            // ignore all others. This is because if the state machine
+            // gets here due to error, there may be left over events in
+            // event queue. Those should be ignored.
+            LOGSTRING2( "CDiagEngineImpl::HandleEventInFinalizingStateL "
+                        L"Invalid event = %d", aEvent.GetType() )
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventInStoppedStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleEventInStoppedStateL( CEventBasic& /* aEvent */ )
+    {
+    // ignore all events. This is because if the state machine
+    // gets here due to error, there may be left over events in
+    // event queue. Those should be ignored.
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineStateMachineObserver
+// CDiagEngineImpl::HandleError
+// ---------------------------------------------------------------------------
+//
+TState CDiagEngineImpl::HandleError( TState aCurrentState, TInt aError )
+    {
+    LOGSTRING4( "CDiagEngineImpl::HandleError() State %d(%S), ERROR %d",
+        aCurrentState,
+        &iStateMachine->StateName( aCurrentState ),
+        aError )
+
+    switch ( aCurrentState )
+        {
+        case EStateNotReady:    // fall through.
+        case EStateStopped:
+            // was not running.. Nothing to do.
+            return aCurrentState;
+
+        default:
+            {
+            iEngineError = aError;
+
+            // Database record is open. Suspend the record so that
+            // user can retry later.
+            iDbRecord.Suspend(); // error ignored
+
+            // Ignore error from application in this case since we are already
+            // handling error.
+            TRAP_IGNORE( iObserver.TestExecutionCompletedL( aError ) )
+            }
+            return EStateStopped;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::StartCreateExecutionPlanL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::StartCreateExecutionPlanL()
+    {
+    LOGSTRING( "CDiagEngineImpl::StartCreateExecutionPlanL() Start creating plan" )
+    if ( iContinueIncompleteRecord )
+        {
+        iPlan->InitializeL( iStatus );
+        }
+    else
+        {
+        iPlan->InitializeL( iStatus, iBatch );
+        }
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleEventExecute
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandlePlanCreatedL()
+    {
+    if ( iPlan->Count() == 0 )
+        {
+        // Error. There were no items in the plan.
+        iEngineError = KErrArgument;
+        iStateMachine->AddEventL( EEventAllPluginsCompleted );
+        return;
+        }
+
+    // First initialize each plugins for execution.
+    // Note that if initialization step fails, it will be caught by
+    // CStateMachine's active object, and will call ::HandleError()
+    LOGSTRING( "CDiagEngineImpl::HandlePlanCreatedL() : Phase I - Initaliaze all plugins" )
+    for ( TInt i = 0; i < iPlan->Count(); i++ )
+        {
+        MDiagPlugin& plugin = (*iPlan)[i].Plugin();
+        plugin.TestSessionBeginL( *this, iEngineConfig.IsDependencyDisabled(), iCustomParam );
+        }
+
+    LOGSTRING( "CDiagEngineImpl::HandlePlanCreatedL() : Phase II - Execution Begins" )
+    iPlan->ResetExecutionCursor();
+    iStateMachine->AddEventL( EEventExecuteNext );
+    iObserver.TestExecutionBeginL();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::ExecuteNextPluginL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::ExecuteNextPluginL()
+    {
+    // first, check if cursor needs to be advanced
+    if ( iPlan->CurrentExecutionItem().State() == MDiagExecPlanEntry::EStateCompleted )
+        {
+        TBool moved = iPlan->MoveCursorToNext();
+        if ( !moved )
+            {
+            // cursor should always move. This is because execute next event
+            // should have never been created by NotifyResultAndContinueL
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+            return;
+            }
+        }
+
+    // Check if we are in call. If so, suspend current execution immediately.
+    if ( iCallHandler->CurrentState() == EDiagEngineCallHandlerStateBusy )
+        {
+        LOGSTRING( "CDiagEngineImpl::ExecuteNextPluginL() Call in progress" )
+        iStateMachine->AddEventL( EEventVoiceCallActive );
+        return;
+        }
+
+    LOGSTRING2( "CDiagEngineImpl::ExecuteNextPluginL() : "
+        L"Executing plugin 0x%08x", 
+        iPlan->CurrentExecutionItem().Plugin().Uid().iUid )
+
+    iPlan->CurrentExecutionItem().ExecuteL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NotifyTestProgressL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::NotifyTestProgressL( CEventTestProgress& aEvent )
+    {
+    // make sure that we are reporting progress on currently executing test.
+    CDiagExecPlanEntryImpl& currItem = iPlan->CurrentExecutionItem();
+
+    if ( currItem.Plugin().Uid() == aEvent.Sender().Uid() &&
+         currItem.State() != MDiagExecPlanEntry::EStateCompleted )
+        {
+        LOGSTRING3( "CDiagEngineImpl::NotifyTestProgressL. "
+            L"Calling TestExecutionProgressL( %d, %d )", 
+            aEvent.CurrStep(), 
+            aEvent.TotalSteps() )
+        iObserver.TestExecutionProgressL( aEvent.CurrStep(), aEvent.TotalSteps() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NotifyResultAndContinueL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::NotifyResultAndContinueL( 
+        TInt aError,
+        CDiagResultsDatabaseItem* aResult )
+    {
+    // aResult can be NULL if it was executing suite.
+    if ( aResult )
+        {
+        CleanupStack::PushL( aResult );
+        }
+    
+    if ( aResult )
+        {
+        CleanupStack::Pop( aResult );
+        }
+
+    iObserver.TestExecutionPluginExecutedL( aError, aResult ); 
+    aResult = NULL; // aResult ownership transferred above.
+
+    if ( iPlan->IsLastPlugin() )
+        {
+        User::After(2000000);
+        iStateMachine->AddEventL( EEventAllPluginsCompleted );
+        }
+    else
+        {
+        iStateMachine->AddEventL( EEventExecuteNext );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleSkipL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleSkipL()
+    {
+    // if plan was empty, ( e.g. before any execution has actually started.
+    // do nothing.
+    if ( iPlan->Count() == 0 )
+        {
+        iEngineError = KErrArgument;
+        iStateMachine->AddEventL( EEventAllPluginsCompleted );
+        return;
+        }
+
+    // Stop execution.  While plug-ins are required to stop immediately,
+    // writing to results db is async. Completion is notified is
+    // ExecPlanEntryExecutedL()
+    iPlan->CurrentExecutionItem().StopExecutionByClientL( ESkip );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::HandleCancelAllL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::HandleCancelAllL()
+    {
+    iEngineError = KErrCancel;
+
+    if ( iPlan->Count() == 0 )
+        {
+        // If plan was empty, ( e.g. before any execution has actually started ),
+        // do nothing and send back completed with KErrCancel.
+        iStateMachine->AddEventL( EEventAllPluginsCompleted );
+        return;
+        }
+
+    if ( iPlan->CurrentExecutionItem().State() == MDiagExecPlanEntry::EStateCompleted )
+        {
+        TBool moved = iPlan->MoveCursorToNext();
+        if ( !moved )
+            {
+            // cursor should always move. This is because execute next event
+            // should have never been created by NotifyResultAndContinueL
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+            return;
+            }
+        }
+
+    iPlan->CurrentExecutionItem().StopExecutionByClientL( ECancelAll );
+    // Continue to ::ExecPlanEntryExecutedL
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::DoSuspendL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::DoSuspendL( MDiagEngineObserver::TSuspendReason aReason )
+    {
+    if ( iSuspendedPrevState == EStateNotReady ||
+         iSuspendedPrevState == EStateCreatingPlan ||
+         iSuspendedPrevState == EStateStopped )
+        {
+        // not much to do here.
+        }
+    else
+        {
+        StopAllRequests();
+
+        iSuspendReason = aReason;
+
+        iPlan->CurrentExecutionItem().SuspendL();
+        }
+
+    LOGSTRING( "CDiagEngineImpl::DoSuspendL: Engine Suspended" )
+    iObserver.TestExecutionSuspendedL( aReason );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::AddResumeEventL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::AddResumeEventL( MDiagEngineObserver::TResumeReason aReason )
+    {
+    iResumeReason = aReason;
+    if ( iSuspendedPrevState == EStateNotReady ||
+         iSuspendedPrevState == EStateCreatingPlan )
+        {
+        iStateMachine->AddEventL( EEventResumeToCreatingPlan );
+        }
+    else
+        {
+        iStateMachine->AddEventL( EEventResumeToRunning );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::DoResumeL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::DoResumeL()
+    {
+    LOGSTRING( "CDiagEngineImpl::DoResumeL: Resuming Engine..." )
+    CDiagExecPlanEntryImpl& entry = iPlan->CurrentExecutionItem();
+
+    if ( entry.State() == MDiagExecPlanEntry::EStateCompleted )
+        {
+        // already completed. nothing to resume.
+        ExecuteNextPluginL();
+        }
+    else
+        {
+        entry.ResumeL();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::CreateDbItem
+//
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDatabaseItem* CDiagEngineImpl::CreateDbItemL(
+        CDiagExecPlanEntryImpl& aCurrItem,
+        CDiagResultsDatabaseItem::TResult aResultType ) const
+    {
+    return CDiagResultsDbItemBuilder::CreateSimpleDbItemL( aCurrItem.Plugin().Uid(),
+                                                           aCurrItem.AsDependency(),
+                                                           aResultType );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::NotifyPluginsOfTestSessionEnd
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::NotifyPluginsOfTestSessionEnd()
+    {
+    LOGSTRING( "CDiagEngineImpl::NotifyPluginsOfTestSessionEnd() : "
+        L"Phase III - Cleaning up stage" )
+    // unlike initialization stage, it will TRAP all errors so that 
+    // every plug-ins will have a chance to run its clean up code.
+    for ( TInt index = 0; index < iPlan->Count(); index++ )
+        {
+        MDiagPlugin& plugin = (*iPlan)[index].Plugin();
+        TRAPD( err, plugin.TestSessionEndL( 
+            *this, iEngineConfig.IsDependencyDisabled(), iCustomParam ) );
+        if ( err != KErrNone )
+            {
+            LOGSTRING3( "CDiagEngineImpl::NotifyPluginsOfTestSessionEnd(): "
+                L"Plug-in Uid %d CleanupL failed with error %d", 
+                plugin.Uid().iUid, err )
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::StopAllRequests
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::StopAllRequests()
+    {
+    Cancel();
+    StopWatchdogTemporarily();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::FinalizeTestSessionL
+//
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::FinalizeTestSessionL()
+    {
+    LOGSTRING( "CDiagEngineImpl::FinalizeTestSessionL() " )
+    
+    // This causes state to change to EStateStopped
+    //iStateMachine->AddEventL( EEventFinalized );
+
+    // Call TestSessionEnd on all plug-ins
+    NotifyPluginsOfTestSessionEnd();
+
+    // Mark DB completed.
+    TBool isFullyCompleted = ( iEngineError == KErrNone );
+    
+    TInt err = iDbRecord.TestCompleted( isFullyCompleted );
+    if ( err != KErrNone )
+        {
+        LOGSTRING3( "CDiagEngineImpl::FinalizeTestSessionL() "
+            L"iDbRecord.TestCompleted( %d ) return err %d", 
+            isFullyCompleted, 
+            err )
+        iEngineError = err;
+        }
+    
+    // Let observer know that test is completed.
+    iObserver.TestExecutionCompletedL( iEngineError );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MDiagEngineCallHandlerObserver
+// CDiagEngineImpl::CallHandlerStateChangedL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::CallHandlerStateChangedL( TDiagEngineCallHandlerState aState )
+    {
+    if ( aState == EDiagEngineCallHandlerStateBusy && 
+            ( iStateMachine->CurrentState() == EStateRunning) )
+        {
+        iStateMachine->AddEventL( EEventVoiceCallActive );
+        }
+    else if ( aState == EDiagEngineCallHandlerStateIdle && 
+            iStateMachine->CurrentState() == EStateSuspended  &&
+            iSuspendReason == MDiagEngineObserver::ESuspendByPhoneCall )
+        {
+        AddResumeEventL( MDiagEngineObserver::EAutoResumedByCallHangup );
+        }
+    else
+        {
+        // Ignored
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// CDiagEngineImpl::RunL
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::RunL()
+    {
+    LOGSTRING2( "CDiagEngineImpl::RunL() error %d", iStatus.Int() )
+    
+    User::LeaveIfError( iStatus.Int() );
+    
+    switch ( iStateMachine->CurrentState()  )
+        {
+        case EStateCreatingPlan:
+            // plan created successfully.
+            iStateMachine->AddEventL( EEventPlanCreated );
+            break;
+
+        default:
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// CDiagEngineImpl::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CDiagEngineImpl::DoCancel()
+    {
+    switch ( iStateMachine->CurrentState() )
+        {
+        case EStateCreatingPlan:
+            iPlan->Cancel();
+            break;
+
+        default:
+            // Nothing to do
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// CDiagEngineImpl::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CDiagEngineImpl::RunError( TInt aError )
+    {
+    if ( iStateMachine )
+        {
+        iStateMachine->HandleError( aError );
+        }
+
+    return KErrNone;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagenginestatemachine.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,362 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CStateMachine
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagenginestatemachine.h"         // DiagFwInternal::CStateMachine
+
+// SYSTEM INCLUDE FILES
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+
+// USER INCLUDE FILES
+#include "diagenginestatemachineobserver.h" // DiagFwInternal::MStateMachineObserver
+#include "diagengineeventbasic.h"           // DiagFwInternal::CEventBasic
+#include "diagframework.pan"                // Panics
+
+
+namespace DiagFwInternal
+    {
+// ======== LOCAL DATA ==========
+struct TStateTableEntry
+    {
+    TState  iInputState;
+    TEvent  iEventType;
+    TState  iOutputState;
+    };
+
+
+static const TStateTableEntry  KStateTable[] = 
+    {
+        // current state    input event                 output state
+        {
+        EStateNotReady,     EEventExecute,              EStateCreatingPlan
+        },
+        {
+        EStateCreatingPlan, EEventPlanCreated,          EStateRunning
+        },
+        {
+        EStateSuspended,    EEventResumeToRunning,      EStateRunning
+        },
+        {
+        EStateSuspended,    EEventResumeToCreatingPlan, EStateCreatingPlan
+        },
+        {
+        EStateFinalizing,   EEventFinalized,            EStateStopped,
+        },
+        // ALL EStateAny MUST be listed in below.
+        // This makes sure that more specific transition happens before
+        // any state transitions occur.
+        {
+        EStateAny,          EEventAllPluginsCompleted,  EStateFinalizing
+        },
+        {
+        EStateAny,          EEventCancelAll,            EStateCancelAll
+        },
+        {
+        EStateAny,          EEventSuspend,              EStateSuspended
+        },
+        {
+        EStateAny,          EEventVoiceCallActive,      EStateSuspended
+        }
+    };
+
+static const TInt KStateTableSize = sizeof( KStateTable )/sizeof( TStateTableEntry );
+
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CStateMachine::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CStateMachine::NewL()
+// ---------------------------------------------------------------------------
+//
+CStateMachine* CStateMachine::NewL( MStateMachineObserver& aObserver )
+    {
+    CStateMachine* self = CStateMachine::NewLC( aObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CStateMachine::NewLC()
+// ---------------------------------------------------------------------------
+//
+CStateMachine* CStateMachine::NewLC( MStateMachineObserver& aObserver )
+    {
+    CStateMachine* self = new( ELeave )CStateMachine( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CStateMachine::CStateMachine
+// ---------------------------------------------------------------------------
+//
+CStateMachine::CStateMachine( MStateMachineObserver& aObserver )
+    :   CActive( EPriorityStandard ),
+        iObserver( aObserver ),
+        iEventQueue(),
+        iState( EStateNotReady )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CStateMachine::~CStateMachine
+// ---------------------------------------------------------------------------
+//
+CStateMachine::~CStateMachine() 
+    {
+    Cancel();
+    iEventQueue.ResetAndDestroy();
+    iEventQueue.Close();
+    }
+    
+
+// ---------------------------------------------------------------------------
+// CStateMachine::AddEventL
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::AddEventL( CEventBasic* aEvent )
+    {
+    __ASSERT_ALWAYS( aEvent, Panic( EDiagFrameworkBadArgument ) );
+
+    LOGSTRING2( "CStateMachine::AddEventL: Type = %S", &( aEvent->ToString() ) )
+
+    CleanupStack::PushL( aEvent );
+    iEventQueue.AppendL( aEvent );     // owership transfer
+    CleanupStack::Pop( aEvent );
+    // do not set aEvent to NULL, since it is used later
+
+    TState nextState = CheckStateTable( iState, aEvent->GetType() );
+
+    if ( nextState != EStateAny && nextState != iState )
+        {
+        // state change happened.
+        TState prevState = iState;
+        iState = nextState;
+
+        iObserver.HandleStateChangedL( prevState, iState, *aEvent );
+        }
+
+    ReactivateQueue();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CStateMachine::AddEventL
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::AddEventL( TEvent aEventId )
+    {
+    // simple event. Create a basic event type
+    AddEventL( new( ELeave )CEventBasic( aEventId ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CStateMachine::CurrentState
+// ---------------------------------------------------------------------------
+//
+TState CStateMachine::CurrentState() const
+    {
+    return iState;
+    }
+
+// ---------------------------------------------------------------------------
+// CStateMachine::HandleError
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::HandleError( TInt aError )
+    {
+    iState = iObserver.HandleError( iState, aError );
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CStateMachine::RunL
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::RunL() 
+    {
+    // Note that ReactivateQueue() must always be called before observer method
+    // is called. This is because observer may delete state machine
+    // during the callback. To prevent crashes, callback MUST BE the
+    // last funciton to call before returning.
+    if ( iEventQueue.Count() > 0 )
+        {
+        // there is an item in the event queue.
+        // Pop and execute the event.
+        CEventBasic* event = iEventQueue[0];
+        iEventQueue.Remove( 0 );
+        
+        // always reactivate the queue before calling observer
+        ReactivateQueue();
+
+        CleanupStack::PushL( event );
+        iObserver.HandleEventL( *event );
+        CleanupStack::PopAndDestroy( event );
+
+        // must return immediately to make sure that no member variables
+        // are accessed after observer is called.
+        return;
+        }
+    else
+        {
+        LOGSTRING( "CStateMachine::RunL(). Called for no reason?" )
+        __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CStateMachine::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::DoCancel() 
+    {
+    // Nothing to do here..
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CStateMachine::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CStateMachine::RunError( TInt aError ) 
+    {
+    HandleError( aError );
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CStateMachine::CheckStateTable
+// ---------------------------------------------------------------------------
+//
+TState CStateMachine::CheckStateTable( TState aCurrState, TEvent aEvent ) const
+    {
+    TState outputState = EStateAny;
+    TBool isFound = EFalse;
+
+    for ( TInt i = 0; i < KStateTableSize && !isFound; i++ )
+        {
+        if ( ( KStateTable[i].iInputState == EStateAny || 
+                    aCurrState == KStateTable[i].iInputState ) &&
+                aEvent == KStateTable[i].iEventType )
+            {
+            outputState = KStateTable[i].iOutputState;
+            isFound = ETrue;
+            }
+        }
+    return outputState;
+    }
+
+// ---------------------------------------------------------------------------
+// CStateMachine::ReactivateQueue
+// ---------------------------------------------------------------------------
+//
+void CStateMachine::ReactivateQueue()
+    {
+    if ( !IsActive() && iEventQueue.Count() > 0 )
+        {
+        // reactivate only if it is not already active, and there is something
+        // in the queue
+        TRequestStatus* stat = &iStatus;
+        User::RequestComplete( stat, KErrNone );
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CStateMachine::StateName
+// ---------------------------------------------------------------------------
+//
+
+#if _DEBUG
+const TDesC& CStateMachine::StateName( TState aState ) const
+    {
+    _LIT( KStateAny,         "EStateAny" );
+    _LIT( KStateNotReady,    "EStateNotReady" );
+    _LIT( KStateCreatingPlan,"EStateCreatingPlan" );
+    _LIT( KStateRunning,     "EStateRunning" );
+    _LIT( KStateStopped,     "EStateStopped" );
+    _LIT( KStateCancelAll,   "EStateCancelAll" );
+    _LIT( KStateSuspended,   "EStateSuspended" );
+    _LIT( KStateFinalizing,  "EStateFinalizing" );
+
+    switch ( aState )
+        {
+        case EStateAny:
+            return KStateAny();
+
+        case EStateNotReady:
+            return KStateNotReady();
+
+        case EStateCreatingPlan:
+            return KStateCreatingPlan();
+
+        case EStateRunning:
+            return KStateRunning();
+
+        case EStateStopped:
+            return KStateStopped();
+
+        case EStateCancelAll:
+            return KStateCancelAll();
+
+        case EStateSuspended:
+            return KStateSuspended();
+
+        case EStateFinalizing:
+            return KStateFinalizing();
+        
+        default:
+            _LIT( KUnknownState, "* Unknown State *");
+            return KUnknownState(); 
+        }
+    }
+
+#else   // #if _DEBUG
+
+// non-debug version.
+const TDesC& CStateMachine::StateName( TState /* aState */ ) const
+    {
+    _LIT( KNonDebugStateName, "?" );
+    return KNonDebugStateName();
+    }
+
+#endif // #else _DEBUG
+
+    } // end of namespace DiagFwInternal
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagexecplanentryimpl.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,332 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagExecPlanEntryImpl
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagexecplanentryimpl.h"
+
+// SYSTEM INCLUDE FILES
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+
+// USER INCLUDE FILES
+#include "diagengineconfig.h"               // TDiagEngineConfig
+#include "diagframework.pan"                // Panic Codes
+
+// DATA
+
+// MACROS
+
+// LOCAL DATA TYPES
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::CDiagExecPlanEntryImpl
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImpl::CDiagExecPlanEntryImpl( 
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagPlugin& aPlugin,
+        TBool aAsDependency,
+        TType aType )
+    :   CActive( EPriorityStandard ),
+        iEngine( aEngine ),
+        iEngineConfig( aEngineConfig ),
+        iObserver( aObserver ),
+        iPlugin( aPlugin ),
+        iAsDependency( aAsDependency ),
+        iState ( EStateQueued ),
+        iType ( aType )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::~CDiagExecPlanEntryImpl
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImpl::~CDiagExecPlanEntryImpl()
+    {
+    if ( iWatchdogTimer )
+        {
+        iWatchdogTimer->Cancel();
+        delete iWatchdogTimer;
+        iWatchdogTimer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::Plugin
+// ---------------------------------------------------------------------------
+//
+MDiagPlugin& CDiagExecPlanEntryImpl::Plugin()
+    {
+    return iPlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::Plugin
+// ---------------------------------------------------------------------------
+//
+const MDiagPlugin& CDiagExecPlanEntryImpl::Plugin() const
+    {
+    return iPlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::State
+// ---------------------------------------------------------------------------
+//
+MDiagExecPlanEntry::TState CDiagExecPlanEntryImpl::State() const
+    {
+    return iState;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::ChangeStateL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::ChangeStateL( TState aState )
+    {
+    iState = aState;
+
+    TBool watchdogNeeded = EFalse;
+
+    // determine if we need a watchdog or not.
+    switch( aState )
+        {
+        case EStateRunning:
+        case EStateStopped:
+            watchdogNeeded = ETrue;
+            break;
+
+        case EStateQueued:
+        case EStateInitDelay:
+        case EStateCompleted:
+        case EStateSuspended:
+        default:
+            watchdogNeeded = EFalse;
+            break;
+        }
+
+    if ( watchdogNeeded )
+        {
+        if ( iWatchdogTimer == NULL )
+            {
+            LOGSTRING( "CDiagExecPlanEntryImpl::ChangeStateL() Create watchdog timer" )
+            iWatchdogTimer = CPeriodic::NewL( EPriorityStandard );
+            }
+        ResetWatchdog();
+        }
+    else
+        {
+        if ( iWatchdogTimer )
+            {
+            LOGSTRING( "CDiagExecPlanEntryImpl::ChangeStateL() delete watchdog timer" )
+            iWatchdogTimer->Cancel();
+            delete iWatchdogTimer;
+            iWatchdogTimer = NULL;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::Type
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImpl::TType CDiagExecPlanEntryImpl::Type() const
+    {
+    return iType;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::SetType
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::SetType( TType aType )
+    {
+    iType = aType;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::AsDependency
+// ---------------------------------------------------------------------------
+//
+TBool CDiagExecPlanEntryImpl::AsDependency() const
+    {
+    return iAsDependency;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::SetAsDependency
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::SetAsDependency( TBool aAsDependency )
+    {
+    iAsDependency = aAsDependency;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::IsStoppedByClient
+// ---------------------------------------------------------------------------
+//
+TBool CDiagExecPlanEntryImpl::IsStoppedByClient() const
+    {
+    return iStoppedByClient;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::Engine
+// ---------------------------------------------------------------------------
+//
+MDiagEngineCommon& CDiagExecPlanEntryImpl::Engine()
+    {
+    return iEngine;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::EngineConfig
+// ---------------------------------------------------------------------------
+//
+const TDiagEngineConfig& CDiagExecPlanEntryImpl::EngineConfig() const
+    {
+    return iEngineConfig;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::Observer
+// ---------------------------------------------------------------------------
+//
+MDiagExecPlanEntryImplObserver& CDiagExecPlanEntryImpl::Observer()
+    {
+    return iObserver;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::StopExecutionByClientL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::StopExecutionByClientL( 
+        MDiagEngineCommon::TCancelMode aCancelMode )
+    {
+    iStoppedByClient = ETrue;
+
+    DoStopExecutionByClientL( aCancelMode );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::ResetWatchdog()
+    {
+    if ( iWatchdogTimer )
+        {
+        LOGSTRING2( "CDiagExecPlanEntryImpl::ResetWatchdog() "
+            L"Timout Value = %d microseconds", iWatchdogValue.Int() )
+        iWatchdogTimer->Cancel();
+        iWatchdogTimer->Start( iWatchdogValue,
+                               iWatchdogValue,
+                               TCallBack( WatchdogTimerExpiredL, this ) );
+        }
+    else    
+        {
+        LOGSTRING( "CDiagExecPlanEntryImpl::ResetWatchdog() "
+            L"Watchdog was not running. Reset request ignored." )
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType )
+    {
+    switch ( aWatchdogType )
+        {
+        case EDiagEngineWatchdogTypeAutomatic:
+            iWatchdogValue = iEngineConfig.WatchdogTimeoutValueAutomatic();
+            break;
+
+        case EDiagEngineWatchdogTypeInteractive:
+            iWatchdogValue = iEngineConfig.WatchdogTimeoutValueInteractive();
+            break;
+
+        default:
+            __ASSERT_ALWAYS( 0, Panic( EDiagFrameworkBadArgument ) );
+            break;
+        }
+
+    ResetWatchdog();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::ResetWatchdog( TTimeIntervalMicroSeconds32 aWatchdogValue )
+    {
+    iWatchdogValue = aWatchdogValue;
+    ResetWatchdog();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImpl::StopWatchdogTemporarily
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImpl::StopWatchdogTemporarily()
+    {
+    LOGSTRING( "CDiagExecPlanEntryImpl::StopWatchdogTemporarily() " )
+    if ( iWatchdogTimer )
+        {
+        iWatchdogTimer->Cancel();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagEngineImpl::WatchdogTimerExpiredL
+//
+// ---------------------------------------------------------------------------
+//
+TInt CDiagExecPlanEntryImpl::WatchdogTimerExpiredL( TAny* aPtr )
+    {
+    LOGSTRING( "CDiagExecPlanEntryImpl::WatchdogTimerExpiredL()" )
+    
+    CDiagExecPlanEntryImpl* thisPtr = static_cast< CDiagExecPlanEntryImpl* >( aPtr );
+
+    // once watchdog expires, it should not be restarted, since it is end of test.
+    thisPtr->iWatchdogTimer->Cancel();
+    delete thisPtr->iWatchdogTimer;
+    thisPtr->iWatchdogTimer = NULL;
+
+    thisPtr->StopExecutionByWatchdogL();
+    
+    return 0;
+    }
+
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagexecplanentryimplsuite.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,419 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagExecPlanEntryImplSuite
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagexecplanentryimplsuite.h"
+
+// SYSTEM INCLUDE FILES
+#include <DiagPlugin.h>                     // MDiagPlugin
+#include <DiagSuitePlugin.h>                // MDiagSuitePlugin
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+#include <DiagSuiteExecParam.h>             // TDiagSuiteExecParam
+
+// USER INCLUDE FILES
+#include "diagframework.pan"                // Panics
+#include "diagexecplanentryimplobserver.h"  // MDiagExecPlanEntryImplObserver
+
+// DATA
+
+// MACROS
+
+// LOCAL DATA TYPES
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplSuite* CDiagExecPlanEntryImplSuite::NewL(
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagSuitePlugin& aPlugin,
+        TBool aAsDependency,
+        CDiagExecPlanEntryImpl::TType aType )
+    {
+    CDiagExecPlanEntryImplSuite* self = NewLC( aEngine,
+                                               aEngineConfig,
+                                               aObserver,
+                                               aPlugin,
+                                               aAsDependency,
+                                               aType );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::NewLC
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplSuite* CDiagExecPlanEntryImplSuite::NewLC(
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagSuitePlugin& aPlugin,
+        TBool aAsDependency,
+        CDiagExecPlanEntryImpl::TType aType )
+    {
+    CDiagExecPlanEntryImplSuite* self = 
+        new ( ELeave ) CDiagExecPlanEntryImplSuite ( aEngine,
+                                                     aEngineConfig,
+                                                     aObserver,
+                                                     aPlugin, 
+                                                     aAsDependency,
+                                                     aType );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::CDiagExecPlanEntryImplSuite
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplSuite::CDiagExecPlanEntryImplSuite( 
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagSuitePlugin& aPlugin,
+        TBool aAsDependency,
+        CDiagExecPlanEntryImpl::TType aType )
+    :   CDiagExecPlanEntryImpl( 
+            aEngine,
+            aEngineConfig,
+            aObserver,
+            aPlugin,
+            aAsDependency,
+            aType  )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::~CDiagExecPlanEntryImplSuite
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplSuite::~CDiagExecPlanEntryImplSuite()
+    {
+    Cancel();
+
+    if ( CDiagExecPlanEntryImpl::State() == EStateRunning )
+        {
+        TRAP_IGNORE( SuitePlugin().ExecutionStopL( MDiagSuitePlugin::ESkip ) )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::SuitePlugin
+// ---------------------------------------------------------------------------
+//
+MDiagSuitePlugin& CDiagExecPlanEntryImplSuite::SuitePlugin()
+    {
+    // It is safe to typecast here, since CDiagExecPlanEntryImplSuite::NewL
+    // accepts only MDiagSuitePlugin&.
+    return static_cast< MDiagSuitePlugin& >( Plugin() );
+    }
+
+// ---------------------------------------------------------------------------
+// From CDiagExecPlanEntryImpl
+// CDiagExecPlanEntryImplSuite::ExecuteL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::ExecuteL()
+    {
+    #ifdef _DEBUG
+    HBufC* pluginName = Plugin().GetPluginNameL( 
+        MDiagPlugin::ENameLayoutListSingle );
+    
+    LOGSTRING4( "---- SUITE BEGIN ---- [ 0x%08x %S / %s ] ---- SUITE BEGIN ---- {",
+        Plugin().Uid().iUid,
+        pluginName,
+        ( Type() == ETypeSuitePrepare ) ? L"PREPARE" : L"FINALIZE" )
+
+    delete pluginName;
+    pluginName = NULL;
+    #endif // _DEBUG
+
+    __ASSERT_DEBUG( State() == EStateQueued,
+                    Panic( EDiagFrameworkCorruptStateMachine ) );
+
+    ResetWatchdog( EDiagEngineWatchdogTypeAutomatic );
+    ChangeStateL( EStateRunning );
+
+    // Notify observer that progress is 0 of 1 since suite does not have progress.
+    Observer().ExecPlanEntryProgressL( *this, 0, 1 );
+
+    TDiagSuiteExecParam* execParam = new ( ELeave ) TDiagSuiteExecParam( *this, Engine() );
+    if ( Type() == CDiagExecPlanEntryImpl::ETypeSuitePrepare )
+        {
+        SuitePlugin().PrepareChildrenExecutionL( execParam,  // owership change
+                                                 Engine().IsDependencyDisabled(),
+                                                 AsDependency() );
+        }
+    else
+        {
+        SuitePlugin().FinalizeChildrenExecutionL( execParam, // owership change
+                                                  Engine().IsDependencyDisabled(),
+                                                  AsDependency() );
+        }
+
+    execParam = NULL; //lint !e423 execParam ownership changed.
+    }
+
+// ---------------------------------------------------------------------------
+// From CDiagExecPlanEntryImpl
+// CDiagExecPlanEntryImplSuite::StopExecutionByWatchdogL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::StopExecutionByWatchdogL()
+    {
+    StopSuitePluginL( MDiagSuitePlugin::EWatchdog );
+    }
+
+// ---------------------------------------------------------------------------
+// From CDiagExecPlanEntryImpl
+// CDiagExecPlanEntryImplSuite::StopExecutionByClientL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::DoStopExecutionByClientL( 
+        MDiagEngineCommon::TCancelMode aCancelMode )
+    {
+    MDiagSuitePlugin::TStopReason stopReason;
+
+    switch ( aCancelMode )
+        {
+        case MDiagEngineCommon::ECancelAll:
+            stopReason = MDiagSuitePlugin::ECancelAll;
+            break;
+
+        case MDiagEngineCommon::ESkip:
+            stopReason = MDiagSuitePlugin::ESkip;
+            break;
+
+        default:
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+            stopReason = MDiagSuitePlugin::ESkip;
+            break;
+        }
+
+    StopSuitePluginL( stopReason );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::StopSuitePluginL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::StopSuitePluginL(
+        MDiagSuitePlugin::TStopReason aStopReason )
+    {
+    LOGSTRING3( "CDiagExecPlanEntryImplSuite::StopSuitePluginL(): "
+        L"Calling plugin uid = 0x%08x SuitePlugin::ExecutionStopL( %d )",
+        Plugin().Uid().iUid,
+        aStopReason )
+
+    Cancel();
+
+    switch ( State() )
+        {
+        case EStateQueued:      // fall through
+        case EStateInitDelay:   // fall through
+        case EStateStopped:     // fall through
+        case EStateSuspended:   // fall through
+        case EStateCompleted:
+            LOGSTRING3( "CDiagExecPlanEntryImplSuite::DoStopSuitePluginL(): "
+                L"Plugin 0x%08x = %d. Do nothing.",
+                Plugin().Uid().iUid,
+                State() )
+            break;
+
+        case EStateRunning:
+            LOGSTRING2( "CDiagExecPlanEntryImplSuite::DoStopSuitePluginL(): "
+                L"Plugin 0x%08x was in ERunning or ESuspended. Call Stop",
+                Plugin().Uid().iUid )
+            SuitePlugin().ExecutionStopL( aStopReason );
+            break;
+
+        default:
+            LOGSTRING3( "CDiagExecPlanEntryImplSuite::DoStopSuitePluginL(): "
+                L"Plugin 0x%08x = INVALID STATE! %d",
+                Plugin().Uid().iUid,
+                State() )
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+            break;
+        }
+
+    // Notify observer as if plug-in itself would have done.
+    ContinueExecutionL( SuitePlugin() );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::SuspendL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::SuspendL()
+    {
+    Cancel();
+
+    switch ( State() )
+        {
+        case EStateQueued:      // fall through
+        case EStateInitDelay:   // fall through
+            LOGSTRING3( "CDiagExecPlanEntryImplSuite::SuspendL(): "
+                L"Plugin 0x%08x = %d. Reset to Queued state",
+                Plugin().Uid().iUid,
+                State() )
+            // force reset the execution state to queued so that
+            // it will be restarted
+            ChangeStateL( EStateQueued );
+            break;
+
+        case EStateRunning:
+            LOGSTRING2( "CDiagExecPlanEntryImplSuite::SuspendL(): "
+                L"Plugin 0x%08x was in ERunning. Calling Stop",
+                Plugin().Uid().iUid )
+
+            // Suites do not have suspend. Stop with cancel as reason.
+            SuitePlugin().ExecutionStopL( MDiagSuitePlugin::ESkip );
+            // force reset the plugin execution to queued so that
+            // it will be restarted
+            ChangeStateL( EStateQueued );
+            break;
+
+        case EStateStopped:
+            LOGSTRING2( "CDiagExecPlanEntryImplSuite::SuspendL(): "
+                L"Plugin 0x%08x = Stopped.",
+                Plugin().Uid().iUid )
+            // plug-in is already stopped.
+            ChangeStateL( EStateSuspended );
+            break;
+
+        case EStateSuspended:
+            LOGSTRING2( "CDiagExecPlanEntryImplSuite::SuspendL(): "
+                L"Plugin 0x%08x = Suspended.",
+                Plugin().Uid().iUid )
+            // already suspneded. nothing to do.
+            break;
+
+        case EStateCompleted:
+            LOGSTRING2( "CDiagExecPlanEntryImplSuite::SuspendL(): "
+                L"Plugin 0x%08x was already in completed state. No change",
+                Plugin().Uid().iUid )
+            break;
+
+        default:
+            LOGSTRING3( "CDiagExecPlanEntryImplSuite::SuspendL(): "
+                L"Plugin 0x%08x = INVALID STATE! %d",
+                Plugin().Uid().iUid,
+                State() )
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+            break;
+        }
+
+    // Postcondition. Check acceptble states.
+    __ASSERT_DEBUG( State() == EStateQueued ||
+                    State() == EStateSuspended ||
+                    State() == EStateCompleted,
+                    Panic( EDiagFrameworkCorruptStateMachine ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplSuite::ResumeL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::ResumeL()
+    {
+    LOGSTRING3( "CDiagExecPlanEntryImplTest::ResumeL(): "
+        L"Plugin 0x%08x, State = %d", Plugin().Uid().iUid, State() )
+
+    __ASSERT_DEBUG( State() == EStateQueued ||
+                    State() == EStateSuspended,
+                    Panic( EDiagFrameworkCorruptStateMachine ) );
+
+    if ( State() == EStateQueued )
+        {
+        ExecuteL();
+        }
+    else
+        {
+        ContinueExecutionL( SuitePlugin() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuiteObserver
+// CDiagExecPlanEntryImplSuite::ContinueExecutionL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::ContinueExecutionL( const MDiagSuitePlugin& aSender )
+    {
+    __ASSERT_ALWAYS( aSender.Uid() == Plugin().Uid(), Panic( EDiagFrameworkPlugin ) );
+
+    // Need to do an empty request complete since by default, suite plug-ins
+    // do nothing in prepare/finalize steps and just call ContinueExecutionL.
+    // Doing empty request complete ensures that Plug-in call back does not
+    // directly call application TestExecutionCompletedL() method.
+
+    ChangeStateL( EStateStopped );
+
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagExecPlanEntryImplSuite::RunL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::RunL()
+    {
+    ChangeStateL( EStateCompleted );
+
+    #ifdef _DEBUG
+    HBufC* pluginName = Plugin().GetPluginNameL( 
+        MDiagPlugin::ENameLayoutListSingle );
+    
+    LOGSTRING4( "} ---- SUITE END ---- [ 0x%08x %S / %s ] ---- SUITE END ----",
+        Plugin().Uid().iUid,
+        pluginName,
+        ( Type() == ETypeSuitePrepare ) ? L"PREPARE" : L"FINALIZE" )
+
+    delete pluginName;
+    pluginName = NULL;
+    #endif // _DEBUG
+
+    Observer().ExecPlanEntryExecutedL( *this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagExecPlanEntryImplSuite::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplSuite::DoCancel()
+    {
+    // nothing to do
+    }
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagexecplanentryimpltest.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,857 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagExecPlanEntryImplTest
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagexecplanentryimpltest.h"
+
+// SYSTEM INCLUDE FILES
+#include <DiagPlugin.h>                     // MDiagPlugin
+#include <DiagTestPlugin.h>                 // MDiagTestPlugin
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+#include <DiagResultsDbItemBuilder.h>       // CDiagResultsDbItemBuilder
+#include <DiagTestExecParam.h>              // TDiagTestExecParam
+#include <DiagResultsDatabase.h>            // RDiagResultsDatabaseRecord
+
+// USER INCLUDE FILES
+#include "diagframework.pan"                // Panic Codes
+#include "diagexecplanentryimplobserver.h"  // MDiagExecPlanEntryImplObserver
+#include "diagengineconfig.h"               // TDiagEngineConfig
+
+
+// DATA
+
+// MACROS
+
+// LOCAL DATA TYPES
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplTest* CDiagExecPlanEntryImplTest::NewL(
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagTestPlugin& aPlugin,
+        TBool aAsDependency,
+        CDiagResultsDatabaseItem::TResult aResult )
+    {
+    CDiagExecPlanEntryImplTest* self = NewLC( aEngine,
+                                              aEngineConfig,
+                                              aObserver,
+                                              aPlugin,
+                                              aAsDependency,
+                                              aResult );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::NewLC
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplTest* CDiagExecPlanEntryImplTest::NewLC(
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagTestPlugin& aPlugin,
+        TBool aAsDependency,
+        CDiagResultsDatabaseItem::TResult aResult )
+    {
+    CDiagExecPlanEntryImplTest* self = 
+        new ( ELeave ) CDiagExecPlanEntryImplTest ( aEngine,
+                                                    aEngineConfig,
+                                                    aObserver,
+                                                    aPlugin, 
+                                                    aAsDependency,
+                                                    aResult );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::CDiagExecPlanEntryImplTest
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplTest::CDiagExecPlanEntryImplTest( 
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aObserver,
+        MDiagTestPlugin& aPlugin,
+        TBool aAsDependency,
+        CDiagResultsDatabaseItem::TResult aResult )
+    :   CDiagExecPlanEntryImpl( 
+            aEngine,
+            aEngineConfig,
+            aObserver,
+            aPlugin,
+            aAsDependency,
+            ETypeTestExec ),
+        iResult( aResult )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::~CDiagExecPlanEntryImplTest
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImplTest::~CDiagExecPlanEntryImplTest()
+    {
+    StopAll();  // deletes timer as well.
+    if ( CDiagExecPlanEntryImpl::State() != EStateCompleted )
+        {
+        // TRAP is needed since this is being called in destructor.
+        TRAP_IGNORE( StopExecutionAndIgnoreResultL() )
+        }
+    delete iCachedResult;
+    iCachedResult = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::Result
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDatabaseItem::TResult CDiagExecPlanEntryImplTest::Result() const
+    {
+    return iResult;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::SetResult
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::SetResult( CDiagResultsDatabaseItem::TResult aResult )
+    {
+    iResult = aResult;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::TestPlugin
+// ---------------------------------------------------------------------------
+//
+MDiagTestPlugin& CDiagExecPlanEntryImplTest::TestPlugin()
+    {
+    // It is safe to typecast here, since CDiagExecPlanEntryImplTest::NewL
+    // accepts only MDiagTestPlugin&.
+    return static_cast< MDiagTestPlugin& >( Plugin() );
+    }
+
+// ---------------------------------------------------------------------------
+// From CDiagExecPlanEntryImpl
+// CDiagExecPlanEntryImplTest::ExecuteL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::ExecuteL()
+    {
+    #ifdef _DEBUG
+    HBufC* pluginName = Plugin().GetPluginNameL( 
+        MDiagPlugin::ENameLayoutListSingle );
+    
+    LOGSTRING3( "---- TEST BEGIN ---- [ 0x%08x  %S ] ---- TEST BEGIN ---- {",
+        Plugin().Uid().iUid,
+        pluginName )
+    delete pluginName;
+    pluginName = NULL;
+    #endif // _DEBUG
+
+    __ASSERT_DEBUG( State() == EStateQueued,
+                    Panic( EDiagFrameworkCorruptStateMachine ) );
+
+    
+    // Case 1) Item was already executed. (Resume scenario)
+    // Just go straight to EStateCompleted and let engine know that
+    // it was completed.
+    if ( Result() != CDiagResultsDatabaseItem::EQueuedToRun )
+        {
+        // it was already executed. Report result immediately.
+        ChangeStateL( EStateCompleted );
+        Observer().ExecPlanEntryExecutedL( *this );
+        return;
+        }
+
+    // Notify observer that progress is 0 so that application will know that
+    // plug-in execution has now started.
+    Observer().ExecPlanEntryProgressL( *this, 0, TestPlugin().TotalSteps() );
+        
+    // Case 2) Initial delay was specified. Start delay timer.
+    if ( EngineConfig().TestPluginInitialDelay().Int() > 0 )
+        {
+        // timer value is specified. Start timer.
+        ChangeStateL( EStateInitDelay );
+        StopInitDelayTimer();
+        iInitDelayTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+        iInitDelayTimer->Start( EngineConfig().TestPluginInitialDelay(),   // initial delay 
+                                EngineConfig().TestPluginInitialDelay(),   // repeat
+                                TCallBack( HandleDelayTimerExpiredL, this ) );
+
+        return;
+        }
+
+    // Case 3) Start test immediately.
+    DoExecuteTestPluginL();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::DoExecuteTestPluginL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::DoExecuteTestPluginL()
+    {
+    #ifdef _DEBUG
+    HBufC* pluginName = Plugin().GetPluginNameL( 
+        MDiagPlugin::ENameLayoutListSingle );
+    
+    LOGSTRING3( "CDiagExecPlanEntryImplTest::DoExecuteTestPluginL() "
+        L"Starting test plugin Uid 0x%x (%S)", 
+        Plugin().Uid().iUid,
+        pluginName )
+    delete pluginName;
+    pluginName = NULL;
+    #endif // _DEBUG
+        
+    // Real test starts now, so reset watchdog timer.
+    if ( TestPlugin().RunMode() == MDiagTestPlugin::EAutomatic )
+        {
+        ResetWatchdog( EDiagEngineWatchdogTypeAutomatic );
+        }
+    else
+        {
+        ResetWatchdog( EDiagEngineWatchdogTypeInteractive );
+        }
+
+    ChangeStateL( EStateRunning );
+
+
+    // Create a result in case test fails during RunTestL().
+    // It needs to be created at this point to make sure that 
+    // test start time is recorded correctly, since RunTestL() may
+    // take some time to finish.
+    CDiagResultsDbItemBuilder* resultBuilder = 
+        CDiagResultsDbItemBuilder::NewLC( Plugin().Uid(), AsDependency() );
+
+    TDiagTestExecParam* execParam = 
+        new ( ELeave ) TDiagTestExecParam( *this,   // aObserver
+                                           Engine() /* aEngine */ );
+
+    // Trap when calling test. This makes sure that if a test fails during
+    // its RunTestL(), it will automatically be marked as failed.
+    TRAPD( err, TestPlugin().RunTestL( execParam,      // ownership changed
+                                       Engine().IsDependencyDisabled(),
+                                       AsDependency(),
+                                       Engine().CustomParam() ) );
+    execParam = NULL;  //lint !e423 execParam ownership changed.
+    
+    if ( err != KErrNone )
+        {
+        // Test failure. Call stop plug-in so that it may have a chance to 
+        // clean up, but result is not needed. Discard it and replace it with
+        // CDiagResultsDatabaseItem::EFailed
+        LOGSTRING2( "CDiagExecPlanEntryImplTest::DoExecuteTestPluginL() "
+            L"RunTestL() for 0x%08x failed! Mark it as FAILED and continue",
+            Plugin().Uid().iUid )
+
+        StopExecutionAndIgnoreResultL();
+        resultBuilder->SetTestCompleted( CDiagResultsDatabaseItem::EFailed );
+
+        CDiagResultsDatabaseItem* result = resultBuilder->ToResultsDatabaseItemL(); 
+
+        // Call test execution observer as if the real test is completed.
+        TestExecutionCompletedL( TestPlugin(), result );
+        result = NULL;  // ownership transferred above.
+        }
+
+    CleanupStack::PopAndDestroy( resultBuilder );
+    resultBuilder = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestObserver
+// CDiagExecPlanEntryImplTest::TestProgressL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::TestProgressL(
+        const MDiagTestPlugin& aSender,
+        TUint aCurrentStep )
+    {
+    __ASSERT_ALWAYS( aSender.Uid() == Plugin().Uid(), Panic( EDiagFrameworkPlugin ) );
+    __ASSERT_ALWAYS( aCurrentStep <= TestPlugin().TotalSteps(), Panic( EDiagFrameworkPlugin ) );
+
+    // TestExecutionProgressL is accepted only if we were running.
+    if ( State() != EStateRunning )
+        {
+        __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+        return;
+        }
+
+    ResetWatchdog();
+    Observer().ExecPlanEntryProgressL( *this, aCurrentStep, TestPlugin().TotalSteps() );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestObserver
+// CDiagExecPlanEntryImplTest::TestExecutionCompletedL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::TestExecutionCompletedL( 
+        const MDiagTestPlugin& aSender,
+        CDiagResultsDatabaseItem* aTestResult )
+    {
+    __ASSERT_ALWAYS( aSender.Uid() == Plugin().Uid(), Panic( EDiagFrameworkPlugin ) );
+    __ASSERT_ALWAYS( aTestResult, Panic( EDiagFrameworkNullTestResult ) );
+
+    // TestExecutionCompletedL is accepted only if we were running.
+    if ( State() == EStateCompleted )
+        {
+        __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+        return;
+        }
+
+    // For view-switching plugins, ask the application to switch the view
+    // back.  This allows the application to be in a known state.  This must
+    // be done before logging the test result, because that may fail.
+    if ( TestPlugin().RunMode() == MDiagTestPlugin::EInteractiveView )
+        {
+        TRAP_IGNORE( Engine().ExecuteAppCommandL(
+            EDiagAppCommandSwitchToMainView,
+            NULL,
+            NULL ) )
+        }
+    // Writing to db is a non interactive step.
+    ResetWatchdog( EDiagEngineWatchdogTypeAutomatic );
+    ChangeStateL( EStateStopped );
+
+
+    // update cache. Cached result will be available until ResultsDbItem()
+    // is called.
+    delete iCachedResult;
+    iCachedResult = aTestResult;
+    aTestResult = NULL;
+
+    iResult = iCachedResult->TestResult();
+
+    Engine().DbRecord().LogTestResult( iStatus, *iCachedResult );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagExecPlanEntryImplTest::RunL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::RunL()
+    {
+    // Currently, this object only uses one request, which is
+    // Engine().DbRecord().LogTestResult(), which is sent only when state is
+    // EStateStopped
+    User::LeaveIfError( iStatus.Int() );
+
+    ChangeStateL( EStateCompleted );
+
+    #ifdef _DEBUG
+    HBufC* pluginName = Plugin().GetPluginNameL( 
+        MDiagPlugin::ENameLayoutListSingle );
+
+    LOGSTRING4( "} ---- TEST END ---- [ 0x%08x  %S %S ] ---- TEST END ----",
+        Plugin().Uid().iUid,
+        pluginName,
+        &TestResultString( iResult ) )
+
+    delete pluginName;
+    pluginName = NULL;
+    #endif // _DEBUG
+
+    // Notify engine that test is completed.
+    Observer().ExecPlanEntryExecutedL( *this );
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagExecPlanEntryImplTest::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::DoCancel()
+    {
+    // Currently, DbRecord().LogTestResult() is the only request this uses.
+    Engine().DbRecord().CancelLogTestResult();
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagExecPlanEntryImplTest::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CDiagExecPlanEntryImplTest::RunError( TInt aError )
+    {
+    Observer().ExecPlanEntryCriticalError( aError );
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::StopExecutionByWatchdogL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::StopExecutionByWatchdogL()
+    {
+    CDiagResultsDatabaseItem* result = StopTestPluginL( MDiagTestPlugin::EWatchdog );
+    
+    if ( result == NULL )
+        {
+        // It was not originally running, so no real result. Create
+        // a default that makes sense.
+        result = CDiagResultsDbItemBuilder::CreateSimpleDbItemL(
+            Plugin().Uid(),
+            AsDependency(),
+            CDiagResultsDatabaseItem::EWatchdogCancel );
+        }
+
+    TestExecutionCompletedL( TestPlugin(), result ); // ownership transferred.
+    result = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::DoStopExecutionByClientL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::DoStopExecutionByClientL( 
+        MDiagEngineCommon::TCancelMode aCancelMode )
+    {
+    MDiagTestPlugin::TStopReason stopReason;
+
+    switch ( aCancelMode )
+        {
+        case MDiagEngineCommon::ECancelAll:
+            stopReason = MDiagTestPlugin::ECancelAll;
+            break;
+
+        case MDiagEngineCommon::ESkip:
+            stopReason = MDiagTestPlugin::ESkip;
+            break;
+
+        default:
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+            stopReason = MDiagTestPlugin::ESkip;
+            break;
+        }
+
+    CDiagResultsDatabaseItem* result = StopTestPluginL( stopReason );
+    
+    if ( result == NULL )
+        {
+        // it was not originally running, so no result was given by
+        // the plugin. Create one for them.
+        result = CDiagResultsDbItemBuilder::CreateSimpleDbItemL( 
+            Plugin().Uid(),
+            AsDependency(),
+            CDiagResultsDatabaseItem::ESkipped );
+        }
+
+    TestExecutionCompletedL( TestPlugin(), result ); // ownership transferred.
+    result = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::StopExecutionAndIgnoreResultL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::StopExecutionAndIgnoreResultL()
+    {
+    CDiagResultsDatabaseItem* result = StopTestPluginL( MDiagTestPlugin::ESkip );
+    delete result;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::StopTestPluginL
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDatabaseItem* CDiagExecPlanEntryImplTest::StopTestPluginL( 
+        MDiagTestPlugin::TStopReason aReason )
+    {
+    StopAll();
+
+    CDiagResultsDatabaseItem* result = NULL;
+
+    switch ( State() )
+        {
+        case EStateQueued:          // fall through
+        case EStateInitDelay:
+            // Test was not actually running in these casese.
+            LOGSTRING3( "CDiagExecPlanEntryImplTest::StopTestPluginL()"
+                L"Plugin 0x%x. State = %d",
+                Plugin().Uid().iUid,
+                State() )
+            break;
+
+        case EStateStopped:
+            // Test was already completed. Return last result.
+            LOGSTRING3( "CDiagExecPlanEntryImplTest::StopTestPluginL()"
+                L"Plugin 0x%x. State = %d",
+                Plugin().Uid().iUid,
+                State() )
+            result = GetLastTestResultL();
+            break;
+            
+        case EStateRunning:     // fall through
+        case EStateSuspended:
+            // Test was actually running in this case.
+            // Need to call execution stop and use result from plug-in.
+            LOGSTRING2( "CDiagEngineImpl::StopTestPluginL: "
+                L"Plugin 0x%x was in ERunning or ESuspended. Call Stop",
+                Plugin().Uid().iUid )
+            result = TestPlugin().ExecutionStopL( aReason );
+            __ASSERT_ALWAYS( result, Panic( EDiagFrameworkNullTestResult ) );
+            break;
+
+        case EStateCompleted:
+        default:
+            LOGSTRING3( "CDiagEngineImpl::StopTestPluginL: "
+                L"Plugin 0x%x = INVALID STATE! %d",
+                Plugin().Uid().iUid,
+                State() )
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+
+            // Use result from cache or DB.
+            result = GetLastTestResultL();
+            break;
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::SuspendL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::SuspendL()
+    {
+    StopAll();
+
+    switch ( State() )
+        {
+        case EStateQueued:          // fall through
+        case EStateInitDelay:       // fall through
+            // nothing to do. 
+            LOGSTRING3( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                L"Plugin 0x%08x state = %d. Was not running. Change to EQueued",
+                Plugin().Uid().iUid,
+                State() )
+
+            ChangeStateL( EStateQueued );
+            break;
+
+        case EStateRunning:
+            {
+            // it is currently running. suspend
+            LOGSTRING2( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                L"Plugin 0x%08x = ERunning. Trying to stop",
+                Plugin().Uid().iUid )
+            TRAPD( err, TestPlugin().SuspendL() )
+            if ( err == KErrNone )
+                {
+                LOGSTRING2( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                    L"Plugin 0x%08x Stop successful. To ESuspended",
+                    Plugin().Uid().iUid )
+
+                ChangeStateL( EStateSuspended );
+                }
+            else 
+                {
+                // Suspend probably not supported. Try Stop
+                LOGSTRING2( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                    L"Plugin 0x%x Stop not successful. Try to Stop",
+                    Plugin().Uid().iUid )
+
+                CDiagResultsDatabaseItem* result = 
+                    TestPlugin().ExecutionStopL( MDiagTestPlugin::ESkip );
+                __ASSERT_ALWAYS( result, Panic( EDiagFrameworkNullTestResult ) );
+                delete result;   // not interested in result.
+                // force reset the plugin execution to queued so that
+                // it will be restarted
+                ChangeStateL( EStateQueued );
+                }
+            }
+            break;
+
+        case EStateStopped:
+            LOGSTRING2( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                L"Plugin 0x%08x = EStateStopped. Do nothing.",
+                Plugin().Uid().iUid )
+            // do nothing, When resumed, it will store temporary result to db
+            break;
+
+        case EStateSuspended:
+            LOGSTRING2( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                L"Plugin 0x%08x = ESuspended. Already suspended..",
+                Plugin().Uid().iUid )
+            // do nothing.
+            break;
+
+        case EStateCompleted:
+            // result already logged. do nothing.
+            LOGSTRING2( "CDiagExecPlanEntryImplTest::SuspendL(): "
+                L"Plugin 0x%08x = ECompleted. Stay completed.",
+                Plugin().Uid().iUid )
+            break;
+
+        default:
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkCorruptStateMachine ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::ResumeL
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::ResumeL()
+    {
+    LOGSTRING3( "CDiagExecPlanEntryImplTest::ResumeL(): "
+        L"Plugin 0x%08x, State = %d", Plugin().Uid().iUid, State() )
+
+    // resumable states are: EStateQueued, EStateSuspended, EStateStopped
+
+    switch ( State() )
+        {
+        case EStateQueued:
+            ExecuteL();
+            break;
+
+        case EStateSuspended:
+            {
+            ChangeStateL( EStateRunning );
+            
+            TestPlugin().ResumeL();
+            }
+            break;
+
+        case EStateStopped:
+            {
+            // There was a result not saved in DB yet.
+            // If test was suspended in EStopped state, there MUST BE a
+            // saved test result.
+            __ASSERT_DEBUG( iCachedResult, Panic( EDiagFrameworkInternal ) );
+
+            if ( iCachedResult ) //lint !e774 Will be evaluated in non DEBUG build.
+                {
+                // Simulate TestExecutionCompletedL from plug-in.
+                // Unset iCachedResult, since TestExecutionCompletedL() will try 
+                // to deallocate iCachedResult.
+                CDiagResultsDatabaseItem* result = iCachedResult;
+                iCachedResult = NULL;
+                TestExecutionCompletedL( TestPlugin(), result ); // ownership passed
+                result = NULL;
+                }
+            }
+            break;
+
+        default:
+            // already running. ignored.
+            break;
+        }
+    }
+
+    
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::GetLastTestResultL
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDatabaseItem* CDiagExecPlanEntryImplTest::GetLastTestResultL()
+    {
+    // Currently, cache is implemented such that calling 
+    // GetLastTestResultL() once after test is completed will not 
+    // require a request to DB. Any subsequent request will have to access
+    // database. 
+    // 
+    // This should satisfy most common usage of execution plan entry.
+    // It could be expanded to store for longer than that, however, it
+    // may take up too much memory if there are lots of tests in the 
+    // execution plan. At this point, this should be sufficient.
+    
+    CDiagResultsDatabaseItem* result = NULL;
+
+    if ( iCachedResult )
+        {
+        if ( State() != EStateStopped )
+            {
+            LOGSTRING2( "CDiagExecPlanEntryImplTest::GetLastTestResultL() "
+                L"Plugin 0x%08x. Cache hit",
+                Plugin().Uid().iUid )
+            result = iCachedResult;
+            iCachedResult = NULL;
+            }
+        else
+            {
+            LOGSTRING2( "CDiagExecPlanEntryImplTest::GetLastTestResultL() "
+                L"Plugin 0x%08x. Cache hit, but need to duplicate.",
+                Plugin().Uid().iUid )
+            // If we were in STOPPED state, make a copy, since it
+            // may not been fully written to db yet.
+            // Cached copy should be deleted only after it is written to db.
+            const CBufFlat* detailData = iCachedResult->DetailsData();
+            CBufFlat* detailDataCopy = NULL;
+
+            if ( detailData )
+                {
+                detailDataCopy = CBufFlat::NewL( detailData->Size() );
+                CleanupStack::PushL( detailDataCopy );
+
+                TPtr8 ptr = detailDataCopy->Ptr( 0 );
+                detailData->Read( 0, ptr );
+                }
+
+            result = CDiagResultsDatabaseItem::NewL(
+                iCachedResult->TestUid(),
+                iCachedResult->WasDependency(),
+                iCachedResult->TestResult(),
+                iCachedResult->TimeStarted(),
+                iCachedResult->TimeCompleted(),
+                detailDataCopy );
+
+            if ( detailDataCopy )
+                {
+                CleanupStack::Pop( detailDataCopy );
+                }
+            }
+        }
+    else
+        {
+        LOGSTRING2( "CDiagExecPlanEntryImplTest::GetLastTestResultL() "
+            L"Plugin 0x%08x. Cache miss",
+            Plugin().Uid().iUid )
+        // result was not avaiable in cache. Fetch it from database.
+        User::LeaveIfError( Engine().DbRecord().GetTestResult( Plugin().Uid(), result ) );
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::HandleDelayTimerExpiredL
+// ---------------------------------------------------------------------------
+//
+TInt CDiagExecPlanEntryImplTest::HandleDelayTimerExpiredL( TAny* aData )
+    {
+    CDiagExecPlanEntryImplTest* self = static_cast< CDiagExecPlanEntryImplTest* >( aData );
+    
+    self->StopInitDelayTimer();
+    self->DoExecuteTestPluginL();
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::StopAll
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::StopAll()
+    {
+    Cancel();
+    StopInitDelayTimer();
+    StopWatchdogTemporarily();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::StopInitDelayTimer
+// ---------------------------------------------------------------------------
+//
+void CDiagExecPlanEntryImplTest::StopInitDelayTimer()
+    {
+    if ( iInitDelayTimer )
+        {
+        iInitDelayTimer->Cancel();
+        delete iInitDelayTimer;
+        iInitDelayTimer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagExecPlanEntryImplTest::TestResultString
+// ---------------------------------------------------------------------------
+//
+#ifdef _DEBUG
+const TDesC& CDiagExecPlanEntryImplTest::TestResultString( 
+        CDiagResultsDatabaseItem::TResult aResult )
+    {
+    _LIT( KSuccess, "ESuccess" );
+    _LIT( KFailed, "EFailed" );
+    _LIT( KSkipped, "ESkipped" );
+    _LIT( KCancelled, "ECancelled" );
+    _LIT( KInterrupted, "EInterrupted" );
+    _LIT( KNotPerformed, "ENotPerformed" );
+    _LIT( KDependencyFailed, "EDependencyFailed" );
+    _LIT( KWatchdogCancel, "EWatchdogCancel" );
+    _LIT( KSuspended, "ESuspended" );
+    _LIT( KQueuedToRun, "EQueuedToRun" );
+
+    switch( aResult )
+        {
+        case CDiagResultsDatabaseItem::ESuccess:
+            return KSuccess();
+
+        case CDiagResultsDatabaseItem::EFailed:
+            return KFailed();
+
+        case CDiagResultsDatabaseItem::ESkipped:
+            return KSkipped();
+
+        case CDiagResultsDatabaseItem::ECancelled:
+            return KCancelled();
+
+        case CDiagResultsDatabaseItem::EInterrupted:
+            return KInterrupted();
+
+        case CDiagResultsDatabaseItem::ENotPerformed:
+            return KNotPerformed();
+
+        case CDiagResultsDatabaseItem::EDependencyFailed:
+            return KDependencyFailed();
+
+        case CDiagResultsDatabaseItem::EWatchdogCancel:
+            return KWatchdogCancel();
+
+        case CDiagResultsDatabaseItem::ESuspended:
+            return KSuspended();
+
+        case CDiagResultsDatabaseItem::EQueuedToRun:
+            return KQueuedToRun();
+
+        default:
+            _LIT( KUnknown, "* Unknown *" );
+            return KUnknown();
+        }
+    }
+
+#else   // #if _DEBUG
+
+// non-debug version.
+const TDesC& CDiagExecPlanEntryImplTest::TestResultString( 
+        CDiagResultsDatabaseItem::TResult /* aResult */ )
+    {
+    _LIT( KNonDebugResultName, "?" );
+    return KNonDebugResultName();
+    }
+
+#endif // #else _DEBUG
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diaglogeventeraser.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2007 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 implementation of the Diagnostics Log Event
+*                Eraser, which is used to delete OS log entries.
+*
+*/
+
+
+// System Include Files
+#include <e32base.h>                        // CActiveSchedulerWait
+#include <logcli.h>                         // CLogClient
+#include <logview.h>                        // CLogViewEvent
+#include <DiagFrameworkDebug.h>             // Debugging macros
+
+// Local Include Files
+#include "diaglogeventeraser.h"             // CDiagLogEventEraser
+#include "diaglogeventeraserobserver.h"     // MDiagLogEventEraserObserver
+
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Static two-phase constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagLogEventEraser* CDiagLogEventEraser::NewL(
+    MDiagLogEventEraserObserver& aObserver,
+    CLogFilter* aFilter )
+    {
+    LOGSTRING( "CDiagLogEventEraser::NewL()" )
+
+    CleanupStack::PushL( aFilter );
+    CDiagLogEventEraser* self = new ( ELeave ) CDiagLogEventEraser(
+        aObserver,
+        aFilter );
+    CleanupStack::Pop( aFilter );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagLogEventEraser::~CDiagLogEventEraser()
+    {
+    LOGSTRING( "CDiagLogEventEraser::~CDiagLogEventEraser()" )
+
+    Cancel();
+
+    delete iLogFilter;
+    delete iLogView;
+    delete iLogClient;
+    delete iWaitScheduler;
+
+    iFsSession.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the filter to use when erasing logs.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CLogFilter& CDiagLogEventEraser::Filter()
+    {
+    LOGSTRING( "CDiagLogEventEraser::Filter()" )
+    return *iLogFilter;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the log client used for the log erasure.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CLogClient& CDiagLogEventEraser::LogClient()
+    {
+    LOGSTRING( "CDiagLogEventEraser::LogClient()" )
+    return *iLogClient;
+    }
+
+// ---------------------------------------------------------------------------
+// Begins asynchronous erasure of logs.  The observer will be notified of
+// completion via callback.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagLogEventEraser::StartAsyncEraseLogsL()
+    {
+    LOGSTRING( "CDiagLogEventEraser::StartAsyncEraseLogsL()" )
+
+    __ASSERT_DEBUG( iState == EStateInitial, User::Invariant() );
+
+    // Apply the filter.
+    if( iLogView->SetFilterL( *iLogFilter, iStatus ) )
+        {
+        iState = EStateApplyingFilter;
+        iIsDeletingSynchronous = EFalse;
+        SetActive();
+        }
+
+    // There are no logs, so set this object active so that the callback will
+    // be asynchronous.
+    else
+        {
+        iState = EStateComplete;
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, KErrNone );
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Begins synchronous erasure of logs.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagLogEventEraser::EraseLogsL()
+    {
+    LOGSTRING( "CDiagLogEventEraser::EraseLogsL()" )
+
+    __ASSERT_DEBUG( iState == EStateInitial, User::Invariant() );
+
+    iError = KErrNone;
+
+    // Apply the filter.  iWaitScheduler->Start() will return after the wait
+    // scheduler is stopped.
+    if( iLogView->SetFilterL( *iLogFilter, iStatus ) )
+        {
+        iState = EStateApplyingFilter;
+        iIsDeletingSynchronous = ETrue;
+        SetActive();
+        iWaitScheduler->Start();
+        }
+
+    // If there is an error, iError will be set when the active object is run.
+    User::LeaveIfError( iError );
+    }
+
+// ---------------------------------------------------------------------------
+// The default constructor.
+// ---------------------------------------------------------------------------
+//
+CDiagLogEventEraser::CDiagLogEventEraser(
+    MDiagLogEventEraserObserver& aObserver,
+    CLogFilter* aFilter )
+:   CActive( EPriorityStandard ),
+    iObserver( aObserver ),
+    iLogFilter( aFilter )
+    {
+    LOGSTRING( "CDiagLogEventEraser::CDiagLogEventEraser()" )
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// The second phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CDiagLogEventEraser::ConstructL()
+    {
+    LOGSTRING( "CDiagLogEventEraser::ConstructL()" )
+
+    User::LeaveIfError( iFsSession.Connect() );
+    iWaitScheduler = new( ELeave ) CActiveSchedulerWait;
+    iLogClient = CLogClient::NewL( iFsSession );
+    iLogView = CLogViewEvent::NewL( *iLogClient );
+    if ( !iLogFilter )
+        {
+        iLogFilter = CLogFilter::NewL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the completion of log erasing and performs different operations
+// depending on whether the erasing was asynchronous or not.
+// ---------------------------------------------------------------------------
+//
+void CDiagLogEventEraser::HandleCompletionL( TInt aError )
+    {
+    LOGSTRING2( "CDiagLogEventEraser::HandleCompletionL( %d )", aError )
+
+    // Reset the state so that the object can be reused.
+    iState = EStateInitial;
+
+    // For synchronous erasure, set the error code and stop the wait
+    // scheduler, so that it will return in EraseLogsL.
+    if ( iIsDeletingSynchronous )
+        {
+        iError = aError;
+        iWaitScheduler->AsyncStop();
+        }
+
+    // For asynchronous erasure, inform the observer that erasing has
+    // completed.
+    else
+        {
+        iObserver.CompleteEventEraseL( aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the completion of active requests.
+// ---------------------------------------------------------------------------
+//
+void CDiagLogEventEraser::RunL()
+    {
+    LOGSTRING( "CDiagLogEventEraser::RunL()" )
+
+    // Check that the request completed successfully.
+    if( iStatus != KErrNone )
+        {
+        HandleCompletionL( iStatus.Int() );
+        return;
+        }
+
+    LOGSTRING2( "CDiagLogEventEraser::RunL() - State %d", iState )
+    switch( iState )
+        {
+        case EStateApplyingFilter:
+            {
+            // The log view filter has been successfully applied.  Issue
+            // another request to start processing log events.  Events are
+            // read from last to first.  The reason for this arrangement is
+            // that we are deleting entries while reading them.
+            if( iLogView->LastL( iStatus ) )
+                {
+                iState = EStateReadingEntries;
+                SetActive();
+                }
+
+            // There are no events in the view.
+            else
+                {
+                HandleCompletionL( KErrNone );
+                }
+
+            break;
+            }
+
+        case EStateReadingEntries:
+            {
+            const CLogEvent& event = iLogView->Event();
+
+            // The log event has been fetched successfully.  Ask the observer
+            // if this event should be erased.  If so, issue another request
+            // to begin erasing the event.
+            if( iObserver.IsEventToBeDeleted( event ) )
+                {
+                iState = EStateDeletingEntry;
+                iLogClient->DeleteEvent( event.Id(), iStatus );
+                SetActive();
+                }
+
+            // The log event should not be erased, so get the next event.
+            else if( iLogView->PreviousL( iStatus ) )
+                {
+                SetActive();
+                }
+
+            // There are no events in the view.
+            else
+                {
+                HandleCompletionL( KErrNone );
+                }
+
+            break;
+            }
+
+        case EStateDeletingEntry:
+            {
+            // The log event was successfully deleted.  Issue another request
+            // to read the next entry.
+            if( iLogView->PreviousL( iStatus ) )
+                {
+                iState = EStateReadingEntries;
+                SetActive();
+                }
+
+            // There are no events in the view.
+            else
+                {
+                HandleCompletionL( KErrNone );
+                }
+
+            break;
+            }
+
+        case EStateComplete:
+            {
+            HandleCompletionL( KErrNone );
+            break;
+            }
+
+        default:
+            // This state should never be reached.
+            LOGSTRING( "CDiagLogEventEraser::RunL() - Invalid State." )
+            User::Invariant();
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the cancellation of active requests.
+// ---------------------------------------------------------------------------
+//
+void CDiagLogEventEraser::DoCancel()
+    {
+    LOGSTRING( "CDiagLogEventEraser::DoCancel()" )
+
+    iLogView->Cancel();
+    iLogClient->Cancel();
+    iState = EStateInitial;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagnetworkregstatuswatcher.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2007 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 implementation for the Diagnostics Network 
+*                 registration status watcher.
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagNetworkRegStatusWatcher.h>
+
+// SYSTM INCLUDE FILES
+#include <e32base.h>                        
+#include <DiagFrameworkDebug.h>             // Debugging macros
+#include <DiagNetworkRegStatusObserver.h>   // MDiagNetworkRegStatusObserver
+
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// Static two-phase constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagNetworkRegStatusWatcher* CDiagNetworkRegStatusWatcher::NewL(
+    MDiagNetworkRegStatusObserver& aCallBack )
+    {
+    CDiagNetworkRegStatusWatcher* self = new ( ELeave )
+                                       CDiagNetworkRegStatusWatcher( aCallBack );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagNetworkRegStatusWatcher::~CDiagNetworkRegStatusWatcher()
+    {
+    // cancel any pending request
+    Cancel();
+    
+    delete iTelephony;
+    iTelephony = NULL;
+    
+    LOGSTRING( "CDiagNetworkRegStatusWatcher::ConstructL() Destroying Network registration status watcher" )            
+    }
+
+// ---------------------------------------------------------------------------
+// The default constructor.
+// ---------------------------------------------------------------------------
+//
+CDiagNetworkRegStatusWatcher::CDiagNetworkRegStatusWatcher
+    ( MDiagNetworkRegStatusObserver& aCallBack )
+    : CActive( EPriorityStandard ),
+    iState( EStateInit ),
+    iRegV1(),
+    iRegV1Pckg( iRegV1 ),
+    iCallBack( aCallBack )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// The second phase constructor.
+// ---------------------------------------------------------------------------
+//
+
+void CDiagNetworkRegStatusWatcher::ConstructL()
+    {
+    LOGSTRING( "CDiagNetworkRegStatusWatcher::ConstructL() Creating Network registration status watcher" )
+    iTelephony = CTelephony::NewL();     
+    iPreviouslyRegistered = EFalse;
+    }
+
+
+// ---------------------------------------------------------------------------
+// This function starts the network registration status monitor process. This
+// involves first checking for the current status and then registering for any
+// changes that may occur.
+// ---------------------------------------------------------------------------
+//
+
+EXPORT_C void CDiagNetworkRegStatusWatcher::StartObserver()
+    {
+    // get the current status of network registration
+    iState = EStateWaitForInitialStatus;
+    iTelephony->GetNetworkRegistrationStatus( iStatus, iRegV1Pckg );
+    SetActive();        
+    }
+
+
+// ---------------------------------------------------------------------------
+// This function stops the network registration monitor process
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagNetworkRegStatusWatcher::StopObserver()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the completion of active requests.
+// ---------------------------------------------------------------------------
+//
+void CDiagNetworkRegStatusWatcher::RunL()
+    {
+    switch ( iState )
+        {
+        case EStateWaitForInitialStatus:
+            {
+            HandleInitialStatusL();
+            }
+            break;
+
+        case EStateWaitForStatusChange:
+            {
+            HandleNetworkStatusChangeL();
+            }
+            break;
+            
+        default:
+            break;                                    
+        }
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Handles the request for initial network registration status
+// ---------------------------------------------------------------------------
+//
+void CDiagNetworkRegStatusWatcher::HandleInitialStatusL()
+    {
+    if ( iStatus == KErrNone )
+        {  
+        // get the current registration status
+        TBool currentRegStatus = IsDeviceRegisteredOnNetwork();
+
+        LOGSTRING2( "CDiagNetworkRegStatusWatcher::HandleInitialStatus : current status = %d", currentRegStatus )
+        
+        // we have to continue monitoring changes in network registration status
+        // so set the next asynchronous request
+        iState = EStateWaitForStatusChange;            
+        iTelephony->NotifyChange( iStatus, 
+                    CTelephony::ENetworkRegistrationStatusChange, iRegV1Pckg );
+        SetActive();
+
+        // inform the client about the initial registration status
+        iPreviouslyRegistered = currentRegStatus;
+        iCallBack.InitialNetworkRegistrationStatusL( currentRegStatus );                
+        }
+    else
+        {
+        // inform the client that device is not registered
+        iCallBack.InitialNetworkRegistrationStatusL( EFalse );
+        iPreviouslyRegistered = EFalse;        
+        }
+    }
+    
+
+
+// ---------------------------------------------------------------------------
+// Handles the events related to Network registration status change
+// ---------------------------------------------------------------------------
+//
+void CDiagNetworkRegStatusWatcher::HandleNetworkStatusChangeL()
+    {
+    if ( iStatus == KErrNone )
+        {
+        // get the current registration status
+        TBool currentRegStatus = IsDeviceRegisteredOnNetwork();
+
+        LOGSTRING2( "CDiagNetworkRegStatusWatcher::HandleNetworkStatusChange : current status = %d", currentRegStatus )
+        
+        // we have to continue monitoring changes in network registration status
+        // so set the next asynchronous request
+        iState = EStateWaitForStatusChange;            
+        iTelephony->NotifyChange( iStatus, 
+                    CTelephony::ENetworkRegistrationStatusChange, iRegV1Pckg );
+        SetActive();
+
+        // if the current registration state is different from previous state,
+        // inform the client
+        if ( currentRegStatus != iPreviouslyRegistered )
+            {
+            // inform the client about the network status change
+            iCallBack.NetworkRegistrationStatusChangeL( currentRegStatus );
+            }
+        iPreviouslyRegistered = currentRegStatus;
+        }
+    else
+        {
+        iCallBack.NetworkRegistrationStatusChangeL( EFalse );
+        iPreviouslyRegistered = EFalse;            
+        }
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// This function wraps the logic if the device is currently registered or not
+// ---------------------------------------------------------------------------
+//
+TBool CDiagNetworkRegStatusWatcher::IsDeviceRegisteredOnNetwork()
+    {
+    TBool regStatus = EFalse;
+    switch ( iRegV1.iRegStatus )
+        {
+            case CTelephony::ERegisteredOnHomeNetwork:
+            case CTelephony::ERegisteredRoaming:
+                {    
+                regStatus = ETrue; 
+                }
+                break;
+            default:
+                {
+                // the device lost the network coverage
+                regStatus = EFalse;
+                }
+                break;                    
+        }
+    return regStatus;
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the cancellation of active requests.
+// ---------------------------------------------------------------------------
+//
+void CDiagNetworkRegStatusWatcher::DoCancel()
+    {
+    switch ( iState )
+        {
+            case EStateWaitForInitialStatus:
+                {
+                iTelephony->CancelAsync( CTelephony::EGetNetworkRegistrationStatusCancel );
+                }
+                break;
+
+            case EStateWaitForStatusChange:
+                {
+                iTelephony->CancelAsync( CTelephony::ENetworkRegistrationStatusChangeCancel );
+                }
+                break;
+                
+            default:
+                break;                                    
+        }
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagpluginconstructionparam.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagPluginConstructionParam
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagPluginConstructionParam.h>
+
+// SYSTEM INCLUDE FILES
+#include <badesca.h>            // CDesC16ArrayFlat
+
+// USER INCLUDE FILES
+
+// CONSTANTS
+_LIT( KDiagPluginBlankServiceName, "" );
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::NewL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginConstructionParam* CDiagPluginConstructionParam::NewL(
+                                        HBufC*              aServiceProvided,
+                                        CDesC16ArrayFlat*   aServicesRequired,
+                                        TInt                aOrder,
+                                        TUid                aImplUid,
+                                        TUid                aParentUid )
+    {
+    CDiagPluginConstructionParam* self = CDiagPluginConstructionParam::NewLC( 
+                                        aServiceProvided,
+                                        aServicesRequired,
+                                        aOrder,
+                                        aImplUid,
+                                        aParentUid );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::NewLC()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginConstructionParam* CDiagPluginConstructionParam::NewLC(
+                                        HBufC*              aServiceProvided,
+                                        CDesC16ArrayFlat*   aServicesRequired,
+                                        TInt                aOrder,
+                                        TUid                aImplUid,
+                                        TUid                aParentUid )
+    {
+    CDiagPluginConstructionParam* self = new( ELeave )CDiagPluginConstructionParam(
+                                        aServiceProvided,
+                                        aServicesRequired,
+                                        aOrder,
+                                        aImplUid,
+                                        aParentUid );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::CDiagPluginConstructionParam
+// ---------------------------------------------------------------------------
+//
+CDiagPluginConstructionParam::CDiagPluginConstructionParam(
+        HBufC*              aServiceProvided,
+        CDesC16ArrayFlat*   aServicesRequired,
+        TInt                aOrder,
+        TUid                aImplUid,
+        TUid                aParentUid )
+    :   iServiceProvided    ( aServiceProvided ),
+        iServicesRequired   ( aServicesRequired ),
+        iOrder              ( aOrder ),
+        iImplUid            ( aImplUid ),
+        iParentUid          ( aParentUid )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::~CDiagPluginConstructionParam
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginConstructionParam::~CDiagPluginConstructionParam()
+    {
+    delete iServiceProvided;
+    iServiceProvided = NULL;
+
+    delete iServicesRequired;
+    iServicesRequired = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::ServiceProvided
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CDiagPluginConstructionParam::ServiceProvided() const
+    {
+    if ( iServiceProvided )
+        {
+        return *iServiceProvided;
+        }
+    else
+        {
+        // there is no service name. Because we must return a reference,
+        // we should at least return a blank text.
+        return KDiagPluginBlankServiceName();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::ServicesRequired
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CDesC16ArrayFlat& CDiagPluginConstructionParam::ServicesRequired() const
+    {
+    return *iServicesRequired;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::Order
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagPluginConstructionParam::Order() const
+    {
+    return iOrder;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::Uid
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid CDiagPluginConstructionParam::Uid() const
+    {
+    return iImplUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginConstructionParam::ParentUid
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid CDiagPluginConstructionParam::ParentUid() const
+    {
+    return iParentUid;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagpluginexecplanimpl.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1577 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagPluginExecPlanImpl
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagpluginexecplanimpl.h"
+
+// SYSTEM INCLUDE FILES
+#include <e32def.h>
+#include <cstack.h>                     // CStack
+#include <DiagPlugin.h>                 // MDiagPlugin
+#include <DiagSuitePlugin.h>            // MDiagSuitePlugin
+#include <DiagTestPlugin.h>             // MDiagTestPlugin
+#include <DiagPluginPool.h>             // CDiagPluginPool
+#include <DiagResultsDatabase.h>        // RDiagResultsDatabaseRecord
+#include <DiagResultsDbItemBuilder.h>   // CDiagResultsDbItemBuilder
+#include <DiagResultDetail.h>           // MDiagResultDetail
+#include <DiagFrameworkDebug.h>         // For debug log
+#include <DiagResultsDbRecordEngineParam.h> // CDiagResultsDbRecordEngineParam
+
+// USER INCLUDE FILES
+#include "diagframework.pan"            // panic codes
+#include "diagexecplanentryimpl.h"      // CDiagExecPlanEntryImpl
+#include "diagexecplanentryimpltest.h"  // CDiagExecPlanEntryImplTest
+#include "diagexecplanentryimplsuite.h" // CDiagExecPlanEntryImplSuite
+#include "diagcleanupresetanddestroy.h" // CleanupRPointerArrayPushL
+#include "diagengineconfig.h"           // TDiagEngineConfig
+
+
+// DATA
+
+// MACROS
+// Uncomment the line below to enable more plan creation log.
+// #define _DEBUG_EXEC_PLAN
+
+
+// LOCAL DATA TYPES
+/**
+* Used for keeping track of suite level stack.
+* It is used in InsertSuiteTransitionsL() function. ( STEP_5 )
+*/
+struct TTransitionStackEntry
+    {
+    /**
+    * iLeavelUid - Uid of the current level. 
+    */
+    TUid  iLevelUid;
+    
+    /**
+    * iPrepareIndex - Index in the plan where ETypeSuitePrepare entry is. 
+    *   This information is used to update the suite iAsDependent field.
+    */
+    TInt    iPrepareIndex;         
+    };    
+
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagPluginExecPlanImpl* CDiagPluginExecPlanImpl::NewL( 
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aEntryObserver )
+    {
+    CDiagPluginExecPlanImpl* self = new ( ELeave ) CDiagPluginExecPlanImpl( 
+        aEngine,
+        aEngineConfig,
+        aEntryObserver );
+
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::CDiagPluginExecPlanImpl
+// ---------------------------------------------------------------------------
+//
+CDiagPluginExecPlanImpl::CDiagPluginExecPlanImpl( 
+        MDiagEngineCommon& aEngine,
+        const TDiagEngineConfig& aEngineConfig,
+        MDiagExecPlanEntryImplObserver& aEntryObserver )
+    :   CActive( EPriorityLow ),
+        iEngine( aEngine ),
+        iEngineConfig( aEngineConfig ),
+        iPlanEntryObserver( aEntryObserver )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::~CDiagPluginExecPlanImpl
+// ---------------------------------------------------------------------------
+//
+CDiagPluginExecPlanImpl::~CDiagPluginExecPlanImpl()
+    {
+    Cancel();
+    iPlan.ResetAndDestroy();
+    iPlan.Close();
+    iExecutedEntries.ResetAndDestroy();
+    iExecutedEntries.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::InitaliazeL
+//      Creating a fresh session.
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::InitializeL( TRequestStatus& aStatus, 
+                                           const RPointerArray< MDiagPlugin >& aBatch )
+    {
+    LOGSTRING( "CDiagPluginExecPlanImpl::InitializeL: new session")
+
+    __ASSERT_ALWAYS( iState == EStateIdle, Panic( EDiagFrameworkInternal ) );
+
+    aStatus = KRequestPending;
+    iClientStatus = &aStatus;
+
+    iExecutedEntries.ResetAndDestroy();
+    iPlan.ResetAndDestroy();
+    iResumeIndex = 0;
+
+    // pre-step execution step. copy the argument to a local plan
+    TInt i;
+    for ( i = 0; i < aBatch.Count();  i++ )
+        {
+        __ASSERT_ALWAYS( aBatch[i] != NULL, Panic( EDiagFrameworkBadArgument ) );
+
+        CDiagExecPlanEntryImpl* newEntry = CreateDefaultPlanEntryLC(
+            *(aBatch[i]),
+            EFalse );   // aAsDependency
+
+        iPlan.AppendL( newEntry );  // ownership transferred.
+        CleanupStack::Pop( newEntry ); 
+        newEntry = NULL;
+        }
+
+    LOGSTRING( "CDiagPluginExecPlanImpl::InitializeL: Initial Batch" )
+    LogPlanL();
+
+    ChangeState( EStateExpandDependencyAndSuites );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::InitializeL
+//      Continuing from incomplete session.
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::InitializeL( TRequestStatus& aStatus )
+    {
+    LOGSTRING( "CDiagPluginExecPlanImpl::InitaliazeL: continue" )
+
+    // validate input.
+    __ASSERT_ALWAYS( iState == EStateIdle, Panic( EDiagFrameworkInternal ) );
+
+    // if we are resuming incomplete session, it must incomplete.
+    TBool isRecordCompleted = EFalse;
+    User::LeaveIfError( iEngine.DbRecord().IsTestCompleted( isRecordCompleted ) );
+    __ASSERT_ALWAYS( !isRecordCompleted, Panic( EDiagFrameworkBadArgument ) );
+
+    aStatus = KRequestPending;
+    iClientStatus = &aStatus;
+    iResumeIndex = 0;
+
+    iExecutedEntries.ResetAndDestroy();
+    iPlan.ResetAndDestroy();
+
+    // Retrieve records from database and use it as base for creating 
+    // a new plan.
+    RPointerArray< CDiagResultsDatabaseItem > previousResults;
+    DiagFwInternal::CleanupRPointerArrayPushL< CDiagResultsDatabaseItem >( &previousResults );
+
+    User::LeaveIfError( 
+        iEngine.DbRecord().GetTestResults( previousResults ) );
+
+    TInt resultCount = previousResults.Count();
+    for( TInt i = 0; i < resultCount; i++ )
+        {
+        // Get the test plug-in.
+        // Note that FindPlugin does not transfer ownership and hence testPlugin
+        // and does not need to be deallocated.
+        MDiagPlugin& testPlugin = 
+            iEngine.PluginPool().FindPluginL( previousResults[i]->TestUid() );
+
+        // This should have been a test plug-in
+        __ASSERT_DEBUG( testPlugin.Type() == MDiagPlugin::ETypeTestPlugin,
+            Panic( EDiagFrameworkInternal ) );
+
+        CDiagExecPlanEntryImplTest* testEntry = 
+            CDiagExecPlanEntryImplTest::NewLC( 
+                iEngine,
+                iEngineConfig,
+                iPlanEntryObserver,
+                static_cast< MDiagTestPlugin& >( testPlugin ),
+                previousResults[i]->WasDependency(),
+                previousResults[i]->TestResult() );
+
+        if ( testEntry->Result() == CDiagResultsDatabaseItem::EQueuedToRun )
+            {
+            // it was queued to be executed.
+            iPlan.AppendL( testEntry ); // ownership transferred.
+            }
+        else
+            {
+            // it was already executed. 
+            iExecutedEntries.AppendL( testEntry ); // ownership transferred.
+            }
+        CleanupStack::Pop( testEntry );
+        testEntry = NULL;
+        }
+
+    CleanupStack::PopAndDestroy( &previousResults );
+
+    iResumeIndex = iExecutedEntries.Count();
+
+    if ( iResumeIndex != 0 )
+        {
+        LOGSTRING( "CDiagPluginExecPlanImpl::InitializeL: Queued Items" )
+        LogPlanL();
+
+        ChangeState( EStateExpandDependencyAndSuites );
+        }
+    else
+        {
+        LOGSTRING( "CDiagPluginExecPlanImpl::InitializeL: "
+            L"Items in DB may be invalid. Fully recreate plan" )
+
+        // If iResumeIndex is 0, it means that all items in the db are 
+        // marked as EQueuedToRun. Because of the async nature of db,
+        // it could also indicate that not previous plan was not fully
+        // written to the database. In this case, read the engine parameter
+        // and try to recreate the plan from scratch.
+        //
+        // If it was already fully written but hadn't had a chance to really
+        // execute anything, this will not cause any ill effects since
+        // plan created should be identical and simply reset 
+        // all results in db to EQueuedToRun.
+        iExecutedEntries.ResetAndDestroy();
+        iPlan.ResetAndDestroy();
+
+        RPointerArray< MDiagPlugin > batch;
+        CleanupClosePushL( batch );    // items are not owned, so no need for "Destroy"
+
+        CDiagResultsDbRecordEngineParam* engineParam = NULL;
+        User::LeaveIfError( 
+            iEngine.DbRecord().GetEngineParam( engineParam ) );
+
+        CleanupStack::PushL( engineParam );
+
+        const RArray< TUid >& batchUids = engineParam->ExecutionsUidArray();
+
+        // Read original Uids from previous engine param.
+        for( TInt i = 0; i < batchUids.Count(); i++ )
+            {
+            MDiagPlugin* testPlugin = NULL;
+            User::LeaveIfError( 
+                iEngine.PluginPool().FindPlugin( batchUids[i], testPlugin ) );
+
+            __ASSERT_DEBUG( testPlugin != NULL, Panic( EDiagFrameworkInternal ) );
+            if ( testPlugin )  //lint !e774 This will be evaluated on non-debug build.
+                {
+                batch.AppendL( testPlugin );
+                }
+            }
+
+        CleanupStack::PopAndDestroy( engineParam );
+        engineParam = NULL;
+
+        // Call the normal InitializeL() method as if it is a new session.
+        InitializeL( aStatus, batch );
+
+        CleanupStack::PopAndDestroy( &batch );  // calls Close()
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::operator[]
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImpl& CDiagPluginExecPlanImpl::operator[]( TInt aIndex )
+    {
+    return *iPlan[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::CurrentExecutionItem
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImpl& CDiagPluginExecPlanImpl::CurrentExecutionItem() 
+    {
+    return *iPlan[iExecutionCursor];
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::ResetExecutionCursor
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::ResetExecutionCursor()
+    {
+    iExecutionCursor = 0;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::MoveCursorToNext
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::MoveCursorToNext()
+    {
+    TBool value = EFalse;
+
+    if ( iExecutionCursor < iPlan.Count() - 1 )
+        {
+        iExecutionCursor++;
+        value = ETrue;
+        }
+    else
+        {
+        // cannot move beyond the last item.
+        }
+
+    return value;
+    }
+
+// ======== From CActive =========
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagPluginExecPlanImpl::RunL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::RunL()
+    {
+    /*----------------------------------------------------------------------
+       Create execution plan:
+       Overview:
+       
+            STEP_1. Expand Dependency 
+            STEP_2. Expand Suites.
+            STEP_3. Repeat STEP_1 & STEP_2 until no changes are made to the plan
+            STEP_4. Check and remove empty suites
+            STEP_5. Add Prepare/Finalize suite execution.
+            STEP_6. Store execution plan to results db. 
+            STEP_7. Append items that were executed in the previous test
+                    to the beginning of the test.
+       
+       Details:
+        STEP_1. Expand Dependency
+            In this step, each item is checked for dependency and 
+            dependent items will be inserted into plan.
+            Note that if dependent item also depends on something else, those
+            will be added immediately.
+       
+            All items inserted during this phase is inserted as dependent.
+       
+        STEP_2. Expand suites
+            Suites are expandeded to individual tests or suites. Suite
+            item will be expanded between parent suite's Prepare and 
+            Finalize items. 
+            
+            iAsDependent value will be inherited from the parent suite
+            that it expanded from. E.g. if suite was dependent, then so will
+            all the items that included from that suite.
+        
+            Note that it does not remove the original suite entry in the plan. 
+            This is to make sure that dependencies inserted will be grouped
+            within the same group as the plug-ins that depended on it.
+            If they are removed, and re-inserted later in STEP_5, it will
+            cause the dependent items to be outside of the original grouping.
+                e.g.  S1 = {P1}
+                      S2 = {P2, P3}
+
+                      and P2 depends on P1
+
+                When dependency and suites are expanded with original
+                suite removed, after STEP_3, the plan will look like this:
+                    (* indicates iAsDependent == ETrue)
+
+                      0     1    2
+                      *P1   P2   P3
+
+                When it tries to add suite transition back in to the plan,
+                it will look like this:
+                    (* indicates iAsDependent == ETrue)
+                    (< indicates suite prepare execution.)
+                    (> indicates suite finalize execution.)
+
+                      0    1    2    3    4   5   6
+                      <S1  *P1  S1>  <S2  P2  P3  S2>
+
+                which is somewhat incorrect since *P1 is added due to 
+                dependency. 
+                
+                Instead, if original suite grouping is kept, after STEP_3
+
+                    0    1    2    3    4
+                    <S2  *P1  P2   P3   S2>
+
+                After STEP_5
+
+                    0    1    2    3    4   5   6
+                    <S2  <S1  *P1  S1>  P2  P3  S2>
+                             
+                which is more correct.
+            
+            Note that this will be done in breadth first style. If there is a
+            nested suites, it will not be expanded until next cycle. 
+            This is to allow dependencies of the suite to be expanded before
+            being removed.
+       
+        STEP_3. Repeat STEP_1 & STEP_2 until no changes are made.
+            This step ensures that suites are expanded, and all dependent
+            items are added to the plan.
+       
+        STEP_4. Remove Empty suites
+            Because dependent items can be moved, it is possible that plan ends
+            up with empty suites. This section will check for 
+            suite prepare/finalize that has nothing inside, and remove them.
+
+        STEP_5. Add Prepare/Finalize steps for suites.
+            As a final step, it will navigate all the entries in the plan, and
+            insert proper prepare/finalize steps. This is based on stack,
+            where every suite prepare is pushed into a stack, and poped when
+            suite finalize is called. e.g. consider following plug-ins:
+
+                S1 = { P1, P2 }
+                S2 = { P3, P4 }
+
+                And P3 depends on P2.
+
+            And resulting plan after STEP_4 looked like this:
+
+                0    1     2    3    4
+                <S2  *P2   P3   P4   S2>
+
+            After STEP_5, it should look like this:
+
+                0    1    2    3    4    5    6
+                <S2  <S1  *P2  S1>  P3   P4   S2>
+
+        STEP_6. Store execution plan to results db. 
+            This allows continuation of the incomplete results.
+            Only test plug-ins are written to the database. 
+
+        STEP_7. Append items that were executed in the previous test
+            to the beginning of the test.
+
+        Other Notes:
+
+        NOTE_1) This logic currently does not check for circular dependencies.
+           If circular dependency exists, the program will go into an
+           infinite loop in ExpandDependenciesL().
+
+        NOTE_2) Inserting duplicate items.
+            Due to dependencies, duplicate entries may exist in the plan.
+
+            When items are inserted during STEP_1 - STEP_2, it will be checked
+            for duplicates.
+       
+            Duplicate removal policy is as follows:
+            RULE_A) If an item with "iAsDependent == ETrue" is being inserted,
+                AND if an item already exist in the plan before current index,
+                then it will not be inserted. 
+
+            RULE_B) Any items inserted with "iAsDependent == EFalse" will 
+               always be inserted at the requested index.
+               This is because they are considered to be user input, and
+               plan will not try to re-order the execution order that 
+               client or user has specified.
+
+            RULE_C) The first instance of an item has higher priority than later
+               instances. Later instace of duplicate will be removed, unless
+               it violates RULE_B. (e.g. item has "iAsDependent == EFalse".)
+
+            This has a side effect: item may execute twice in certain cases.
+            E.g. original plan has two plug-ins:  P1, P2, P3
+            P1 depends on P2, and P3 also depends ond P2
+
+            Original Input:   0   1   2
+                              P1  P2  P3
+
+            After STEP_3, it should look like this. 
+                    (* indicates iAsDependent == ETrue)
+
+                              0    1    2   3    4
+                              *P2  P1   P2  *P2  P3
+
+            During STEP_4, duplicates are removed, and it should look like this:
+                    (* indicates iAsDependent == ETrue)
+
+                              0    1    2   4
+                              *P2  P1   P2  P3
+
+            Note that there are two P2s in the plan; 
+            at 0 with iAsDependent == ETrue and at 2 with iAsDependent == EFalse
+
+            There may be some discussions on whether this is how it should be.
+            However, at this point, it seems that it is more important that
+            execution appears to the user in the order specified. 
+
+            To make sure that user sees that P2 is executed only once, plug-in
+            developer may need to make sure that if a plug-in provides services,
+            it should also handle cases where it is executed twice.
+
+            In reality, such cases can be avoided by grouping the plug-ins 
+            in the correct order, hence it should not be an issue.
+
+    ----------------------------------------------------------------------*/
+
+    // First, error handling.
+    LOGSTRING3( "CDiagPluginExecPlanImpl::RunL: State = %d, Err = %d",
+        iState, iStatus.Int() )
+
+    User::LeaveIfError( iStatus.Int() );
+
+    switch ( iState )
+        {
+        case EStateExpandDependencyAndSuites:
+            {
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: STEP_1")
+            // STEP_1. Expand dependency. 
+            if ( !iEngineConfig.IsDependencyDisabled() )
+                {
+                ExpandDependenciesL();
+                }
+
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: STEP_2")
+            // STEP_2. Expand suites.
+            if ( ExpandSuitesL() )
+                {
+                // STEP_3. Repeat STEP_1, STEP_2 until no changes are made.
+                // Do a self transition to repeat STEP_1 and STEP_2
+                ChangeState( EStateExpandDependencyAndSuites );
+                }
+            else
+                {
+                // no changes are made to the plan. Move to STEP_4
+                ChangeState( EStateRemoveEmptySuites );
+                }
+            }
+            break;
+
+        case EStateRemoveEmptySuites:
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: STEP_4")
+            // STEP_4. Remove empty suites. This can happen because of duplicate
+            // dependencies moving later dependent test to earlier position.
+            RemoveEmptySuites();
+
+            #ifdef _DEBUG_EXEC_PLAN
+            LOGSTRING( "CDiagPluginExecPlanImpl:CreatePlanL: "
+                L"Before Inserting Suite Transtions" )
+            LogPlanL();
+            #endif // _DEBUG_EXEC_PLAN
+
+            // Continue to STEP_5
+            ChangeState( EStateInsertSuiteTransitions );
+            break;
+
+        case EStateInsertSuiteTransitions:
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: STEP_5 - Insert Suite Transtions")
+            // STEP_5. Add pre/post suite execution
+            InsertSuiteTransitionsL();
+
+            // STEP_6. Store plan to db.
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: STEP_6 - Store to db")
+            // this time, manually update state, since storing 
+            // to database needs to use iStatus
+            iState = EStateStoreToDb;
+
+            // Move cursor to one before so that it can start checking from
+            // the beginning. StoreNextTestPluginToDbL() will move the cursor
+            // as soon as it enters.
+            iExecutionCursor = -1;
+            StoreNextTestPluginToDbL();
+            
+            break;
+
+        case EStateStoreToDb:
+            LOGSTRING2( "CDiagPluginExecPlanImpl::RunL: STEP_6 - "
+                L"item 0x%08x stored.",
+                iPlan[iExecutionCursor]->Plugin().Uid().iUid )
+
+            StoreNextTestPluginToDbL();
+            break;
+
+        case EStatePlanCreated:
+            // STEP_7. Prepend the items that were executed in last session
+            // to the beginning of the execution plan.
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: STEP_7 - prepend executed items" )
+            PrependExecutedItemsL();
+
+            LOGSTRING( "CDiagPluginExecPlanImpl::RunL: Final Plan" )
+            LogPlanL();
+            
+            LOGSTRING2( "CDiagPluginExecPlanImpl::RunL: Resume at index %d", iResumeIndex )
+
+            LogPlanInRecordL();
+
+            ResetExecutionCursor();
+
+            ReportResult( KErrNone );
+            break;
+
+        case EStateIdle:
+        default:
+            __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagPluginExecPlanImpl::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::DoCancel()
+    {
+    iPlan.ResetAndDestroy();
+    iExecutedEntries.ResetAndDestroy();
+    iState = EStateIdle;
+
+    ReportResult( KErrCancel );
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagPluginExecPlanImpl::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginExecPlanImpl::RunError( TInt aError )
+    {
+    iPlan.ResetAndDestroy();
+    iExecutedEntries.ResetAndDestroy();
+    iState = EStateIdle;
+
+    ReportResult( aError );
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::CurrentIndex
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginExecPlanImpl::CurrentIndex() const
+    {
+    return iExecutionCursor;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::CurrentTestIndex
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginExecPlanImpl::CurrentTestIndex( TBool aIncludeDependency ) const
+    {
+    TInt count = 0;
+
+    for ( TInt i = 0; i < iPlan.Count() && i < iExecutionCursor; i++ )
+        {
+        if ( iPlan[i]->Plugin().Type() == MDiagPlugin::ETypeTestPlugin )
+            {
+            // if caller wants to include both explicit and dependent
+            // or if plug-in is not depentent test, count.
+            if ( aIncludeDependency || ( !iPlan[i]->AsDependency() ) )
+                {
+                count++;
+                }
+            }
+        }
+    
+    // subtract 1 if we only went past the last test.
+    if ( count >= TestCount( aIncludeDependency ) )
+        {
+        count--;
+        }
+    return count;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::TestCount
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginExecPlanImpl::TestCount( TBool aIncludeDependency ) const
+    {
+    TInt count = 0;
+
+    for ( TInt i = 0; i < iPlan.Count(); i++ )
+        {
+        if ( iPlan[i]->Plugin().Type() == MDiagPlugin::ETypeTestPlugin )
+            {
+            // if caller wants to include both explicit and dependent
+            // or if plug-in is not depentent test, count.
+            if ( aIncludeDependency || ( !iPlan[i]->AsDependency() ) )
+                count++;
+            }
+        }
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::operator[] () const
+// ---------------------------------------------------------------------------
+//
+const MDiagExecPlanEntry& CDiagPluginExecPlanImpl::operator[] ( TInt aIndex ) const
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iPlan.Count(), 
+                     Panic( EDiagFrameworkArrayBounds ) );
+    return *( static_cast< MDiagExecPlanEntry* >( iPlan[aIndex] ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::CurrentExecutionItem const
+// ---------------------------------------------------------------------------
+//
+const MDiagExecPlanEntry& CDiagPluginExecPlanImpl::CurrentExecutionItem() const
+    {
+    __ASSERT_ALWAYS( iExecutionCursor >= 0 && iExecutionCursor < iPlan.Count(), 
+                     Panic( EDiagFrameworkArrayBounds ) );
+    return *( static_cast< MDiagExecPlanEntry* >( iPlan[iExecutionCursor] ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::IsLastTest
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::IsLastTest() const
+    {
+    if ( TestCount( ETrue ) == 0 )
+        {
+        // there was no test in the plan.. 
+        // In this case, it is always ETrue.
+        return ETrue;
+        }
+
+    return ( CurrentTestIndex( ETrue ) == TestCount( ETrue ) - 1 );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::IsLastPlugin
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::IsLastPlugin() const
+    {
+    if ( iPlan.Count() == 0 )
+        {
+        // if plan was empty, always consider it to be the last.
+        return ETrue;
+        }
+
+    return iExecutionCursor == ( iPlan.Count() -1 );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::Count
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginExecPlanImpl::Count() const
+    {
+    return iPlan.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPluginExecPlan
+// CDiagPluginExecPlanImpl::ResumeIndex
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginExecPlanImpl::ResumeIndex() const
+    {
+    return iResumeIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::ChangeState
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::ChangeState( TState aState )
+    {
+    LOGSTRING3( "CDiagPluginExecPlanImpl::ChangeState: state change %d -> %d",
+        iState, aState )
+
+    iState = aState;
+
+    TRequestStatus* stat = &iStatus;
+    User::RequestComplete( stat, KErrNone );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::ExpandDependenciesL
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::ExpandDependenciesL()
+    {
+    // STEP_1. Expand dependency.
+    // Before modifying this function, please see STEP_1 comments in CreatePlanL()
+    TInt planIdx = 0;
+    TBool planChanged( EFalse );
+    while ( planIdx < iPlan.Count() )
+        {
+        TBool itemAdded = EFalse;
+
+        // we are only interested in type ETypeTestExec or ETypeSuiteUnexpanded. 
+        // If it is ETypeSuitePrepare or ETypeSuiteFinalize, that means 
+        // that it is a suite and it has been already been expanded to 
+        // prepare/finalize. Since dependencies are resolved before suites 
+        // are expanded, we are not interested in re-evaluating expanded tests.
+        if ( iPlan[planIdx]->Type() == CDiagExecPlanEntryImpl::ETypeTestExec ||
+             iPlan[planIdx]->Type() == CDiagExecPlanEntryImpl::ETypeSuiteUnexpanded )
+            {
+            // dependencies should be rare. So granuality 1 should be fine.
+            CPtrCArray* depList = new( ELeave )CPtrCArray( 1 );
+            CleanupStack::PushL( depList );
+            iPlan[planIdx]->Plugin().GetLogicalDependenciesL( *depList );
+
+            // iterate through the dependiencies BACKWARDS to make sure
+            // that dependencies are inserted in the same order 
+            // specified. If it is not added backwards, developers may 
+            // be surprised that dependencies are executed 
+            // in reverse order of what is specified in the XML.
+            for ( TInt depIdx = depList->Count() - 1; depIdx >= 0; depIdx-- )
+                {
+                // If dependency is specified, but the dependent plug-in is 
+                // not found in plug-in pool, this probably means 
+                // plug-in database is corrupted.
+                MDiagPlugin& plugin = iEngine.PluginPool().FindPluginL( ( *depList )[ depIdx ] );
+
+                if ( InsertPluginL( plugin, 
+                                    ETrue, 
+                                    planIdx ) )
+                    {
+                    itemAdded = ETrue;
+                    }
+                }
+            CleanupStack::PopAndDestroy( depList );
+            depList = NULL;
+            }
+
+        // Advance to next item in plan only if no new item is added.
+        // This ensures that items just added are re-evaluated for
+        // dependency, and expand if it is an unexpanded suite.
+        if ( !itemAdded )
+            {
+            planIdx++;
+            }
+        else
+            {
+            planChanged = ETrue;
+            }
+        }
+
+    return planChanged;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::ExpandSuitesL
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::ExpandSuitesL() 
+    {
+    // STEP_2. Expand suites.
+    // Before modifying this function, please see STEP_1 comments in CreatePlanL()
+    TBool planChanged = EFalse;
+    TInt i = 0;
+    while ( i < iPlan.Count() )
+        {
+        if ( iPlan[i]->Type() == CDiagExecPlanEntryImpl::ETypeSuiteUnexpanded )
+            {
+            // If it is unexpanded, it must be a suite.
+            __ASSERT_DEBUG( iPlan[i]->Plugin().Type() == MDiagPlugin::ETypeSuitePlugin,
+                            Panic( EDiagFrameworkInternal ) );
+            planChanged = ETrue;
+
+            // Change type from ETestExec to ETypeSuitePrepare. This indicates
+            // that the suite item in the plan has been examined and
+            // expanded.
+            iPlan[i]->SetType( CDiagExecPlanEntryImpl::ETypeSuitePrepare );
+
+            // dependency is inherited
+            TBool asDependency = iPlan[i]->AsDependency();
+            
+            // Get Children from the plug-in
+            MDiagSuitePlugin& suite = static_cast<MDiagSuitePlugin&>( iPlan[i]->Plugin() );
+            RPointerArray<MDiagPlugin> children;
+            CleanupClosePushL( children );
+
+            suite.GetChildrenL( children, MDiagSuitePlugin::ESortByPosition );
+
+            i++; // insert rest after current item.
+
+            TInt childIdx = 0;
+            while ( childIdx < children.Count() )
+                {
+                if ( InsertPluginL( *( children[childIdx] ), 
+                                    asDependency, 
+                                    i ) )
+                    {
+                    // new item is added. Move to next
+                    i++;
+                    }
+                childIdx++;
+                }
+
+            children.Reset();   // children pointers are not owned 
+            CleanupStack::PopAndDestroy( &children );
+
+            // insert suite finalize entry into plan
+            CDiagExecPlanEntryImplSuite* finalizeEntry = 
+                CDiagExecPlanEntryImplSuite::NewLC(
+                    iEngine,
+                    iEngineConfig,
+                    iPlanEntryObserver,
+                    suite,
+                    asDependency,
+                    CDiagExecPlanEntryImpl::ETypeSuiteFinalize );
+
+            iPlan.InsertL( static_cast< CDiagExecPlanEntryImpl* >( finalizeEntry ), i );   
+            CleanupStack::Pop( finalizeEntry ); // owership transferred
+            finalizeEntry = NULL;
+            i++;
+            }
+        else
+            {
+            // this one is not suite, so examine the next one.
+            i++;    
+            }
+        }
+
+    return planChanged;
+    }
+
+// Looking for STEP_3?  It is in RunL() .. 
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::RemoveEmptySuites
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::RemoveEmptySuites()
+    {
+    // STEP_4. Remove empty suites
+    // Before modifying this function, please see STEP_1 comments in CreatePlanL()
+
+    // Checking for duplicate is done by checking if suite prepare/finalize
+    // is in the plan next to each other.
+    //
+    // NOTE_4
+    // After a empty suite is removed, step back one index.
+    // so that the previous item will be re-evaluated, in case removing them cased 
+    // the parent suite to be empty as well.
+    //      e.g
+    //      i == 1
+    //      index:   0   [1]  2   3
+    //               <A  <B   B>  A> 
+    //  after removal, now prepare/finalize A becomes next to each other
+    //
+    //      i == 1
+    //      index:   0   [1] 
+    //               <A  A> 
+    //
+    // in order to make sure that above case is handled, decrement i and
+    // re-evaluate from index 0
+    //
+    TInt i = 0;
+    while ( i < iPlan.Count() - 2 )  // no need to go beyond the last item
+        {
+        if ( iPlan[i]->Type() == CDiagExecPlanEntryImpl::ETypeSuitePrepare &&
+                iPlan[i+1]->Type() == CDiagExecPlanEntryImpl::ETypeSuiteFinalize )
+            {
+            // if these two do not match, then there may have been
+            // a problem during plan creation.
+            __ASSERT_DEBUG( iPlan[i]->Plugin().Uid() == iPlan[i+1]->Plugin().Uid(),
+                            Panic( EDiagFrameworkCorruptPlugin ) );
+
+
+            CDiagExecPlanEntryImpl* entry = iPlan[ i + 1 ];
+            iPlan.Remove( i+1 );
+            delete entry;
+            entry = NULL;
+
+            entry = iPlan[i];
+            iPlan.Remove( i );
+            delete entry;
+            entry = NULL;
+            
+            // Wondering why step back by one? See NOTE_4
+            if ( i > 0 )
+                {
+                i--;
+                }
+            }
+        else
+            {
+            // it's not empty. Examine next item.
+            i++;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::InsertSuiteTransitionsL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::InsertSuiteTransitionsL()
+    {
+    // STEP_5. Add pre/post suite execution based on test parent change.
+    // Before modifying this function, please see STEP_1 comments in CreatePlanL()
+    
+    // if plan is empty, nothing to do.
+    if ( iPlan.Count() == 0 )
+        {
+        return;
+        }
+    
+    // Create a new CStack. Second template parameter ETrue means that
+    // CStack owns the stack entries.
+    CStack<TTransitionStackEntry, ETrue>* stack = 
+        new( ELeave )CStack<TTransitionStackEntry, ETrue>;
+    
+    CleanupStack::PushL( stack );
+
+    // create a root entry
+    AddRootSuiteIfMissingL();
+    
+    // In this loop, iPlan.Count() cannot be cached because new item may be
+    // added within the loop
+    TInt i = 0;
+    while ( i < iPlan.Count() )
+        {
+        #ifdef _DEBUG_EXEC_PLAN
+        LOGSTRING2( "CDiagPluginExecPlanImpl::InsertSuiteTransitionsL: ------ %d", i )
+        LogPlanL();
+        #endif // _DEBUG_EXEC_PLAN
+            
+        // Case 1
+        // If current item is a suite prepare, push a new level into stack.
+        if ( iPlan[i]->Type() == CDiagExecPlanEntryImpl::ETypeSuitePrepare )
+            {
+            // we are entering a new suite. Push current plan item into stack.
+            PushNewLevelL( *stack, i );
+            i++;
+            continue; //lint !e960  continue OK. examine next item.
+            }
+
+        // Case 2
+        // If current item is a suite finalize, pop a level from stack.
+        if ( iPlan[i]->Type() == CDiagExecPlanEntryImpl::ETypeSuiteFinalize && 
+                stack->Head() != NULL &&
+                stack->Head()->iLevelUid == iPlan[i]->Plugin().Uid() )
+            {
+            // we are leaving a suite. Pop top item from suite.
+            PopLevel( *stack );
+            i++;
+            continue; //lint !e960 : continue OK. examine next item.
+            }
+
+        // it was neither prepare or finalize. Examine item as current level.
+        const TTransitionStackEntry& level = *(stack->Head()); // Peek
+
+        TUid newLevelUid = iPlan[i]->Plugin().ParentUid();
+
+        // Case 3
+        if ( newLevelUid == level.iLevelUid )
+            {
+            // still in the same suite level.  No need to add new items.
+
+            // check if current item is non-dependent.
+            // If so, update the iAsDependent to reflect that it includes
+            // a non-dependent item.
+            if ( !(iPlan[i]->AsDependency()) )
+                {
+                // update the prepare item, indicating that it has
+                // an non-dependent item
+                iPlan[level.iPrepareIndex]->SetAsDependency( EFalse );
+                }
+            i++;
+            continue;   //lint !e960 : continue OK. examine next item.
+            }
+
+        // If parent UID is differnt from current level uid, 
+        // it can mean one of the following:
+        //  A ) We are entering a new suite.
+        //  B ) We leaving a suite.
+        // Case B ) can be deteced by checking whether the new parent is 
+        // already in the stack somewhere (stack will be popped until we are
+        // in the same level), or if there is no more item of the same
+        // level is in the plan, which means it is not needed.
+        // If case B ) fails, assume case A.
+        if ( IsLevelInStack( *stack, newLevelUid ) ||
+             !IsThisSuiteNeededAfterThisIndex( stack->Head()->iLevelUid, i ) )
+            {
+            // Case B) Insert a new Finalize item.
+            AddSuiteFinalizeL( level.iPrepareIndex, i );
+            }
+        else
+            {
+            // Case A) Insert a new prepare item.
+            AddSuitePrepareL( newLevelUid, i );
+            }
+        }
+
+    // When all done, stack must be empty.
+    __ASSERT_DEBUG( stack->IsEmpty(), Panic( EDiagFrameworkInternal ) );
+
+    CleanupStack::PopAndDestroy( stack );
+    stack = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::AddRootSuiteIfMissingL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::AddRootSuiteIfMissingL()
+    {
+    // Check to see if root element is already in the plan.
+    if ( iPlan[0]->Plugin().Uid() != KDiagRootSuiteUid )
+        {
+        // root( uid 0 ) does not exist in the plan.
+        // Add prepare and finalize root into the plan.
+        MDiagPlugin& rootPlugin = iEngine.PluginPool().FindPluginL( KDiagRootSuiteUid );
+
+        CDiagExecPlanEntryImplSuite* rootEntry = 
+            CDiagExecPlanEntryImplSuite::NewLC(
+                iEngine,
+                iEngineConfig,
+                iPlanEntryObserver,
+                static_cast< MDiagSuitePlugin& >( rootPlugin ),
+                ETrue,              // iAsDependent == ETrue. Updated as later.
+                CDiagExecPlanEntryImpl::ETypeSuitePrepare );
+
+        iPlan.InsertL( static_cast< CDiagExecPlanEntryImpl* >( rootEntry ), 0 );  
+        CleanupStack::Pop( rootEntry ); // ownership transferred above.
+        rootEntry = NULL;
+
+        rootEntry = CDiagExecPlanEntryImplSuite::NewLC(
+            iEngine,
+            iEngineConfig,
+            iPlanEntryObserver,
+            static_cast< MDiagSuitePlugin& >( rootPlugin ),
+            ETrue,              // iAsDependent == ETrue. Updated as later.
+            CDiagExecPlanEntryImpl::ETypeSuiteFinalize );
+
+        // insert same entry with finalize as type
+        iPlan.AppendL( static_cast< CDiagExecPlanEntryImpl* >( rootEntry ) );
+        CleanupStack::Pop( rootEntry ); // ownership transferred above
+        rootEntry = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::PushNewLevelL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::PushNewLevelL( 
+        CStack<TTransitionStackEntry, ETrue>& aStack, 
+        TInt aHeadIndex )
+    {
+    TTransitionStackEntry* level = new( ELeave )TTransitionStackEntry;
+
+    __ASSERT_ALWAYS( aHeadIndex >= 0 && aHeadIndex < iPlan.Count(),
+                     Panic( EDiagFrameworkInternal ) );
+
+    level->iLevelUid = iPlan[aHeadIndex]->Plugin().Uid();
+    level->iPrepareIndex = aHeadIndex;
+
+    #ifdef _DEBUG_EXEC_PLAN
+    LOGSTRING2( "CDiagPluginExecPlanImpl:: Push 0x%08x", level->iLevelUid.iUid )
+    #endif // _DEBUG_EXEC_PLAN
+
+    aStack.PushL( level ); // owership transferred.
+    level = NULL; //lint !e423 Ownership transferred. No leak here.
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::PopLevel
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::PopLevel( CStack<TTransitionStackEntry, ETrue>& aStack )
+    {
+    TTransitionStackEntry* level = aStack.Pop();
+    #ifdef _DEBUG_EXEC_PLAN
+    LOGSTRING2( "CDiagPluginExecPlanImpl:: Pop 0x%08x", level->iLevelUid.iUid )
+    #endif // _DEBUG_EXEC_PLAN
+    delete level;
+    level = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::IsLevelInStack
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::IsLevelInStack( 
+        CStack<TTransitionStackEntry, ETrue>& aStack,
+        TUid aLevelUid ) const
+    {
+    for ( TInt i = 0; i < aStack.Count(); i++ )
+        {
+        const TTransitionStackEntry& currEntry = *aStack[i];
+        if ( currEntry.iLevelUid == aLevelUid )
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::IsThisSuiteNeededAfterThisIndex
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::IsThisSuiteNeededAfterThisIndex(
+        TUid aSuiteUid,
+        TInt aIndex ) const
+    {
+    for ( TInt i = aIndex; i < iPlan.Count(); i++ )
+        {
+        if ( iPlan[i]->Plugin().Uid() == aSuiteUid ||  // finalize already exists
+             iPlan[i]->Plugin().ParentUid() == aSuiteUid )
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::AddSuitePrepareL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::AddSuitePrepareL( TUid aLevelUid, TInt aAt )
+    {
+    MDiagPlugin& suitePlugin = iEngine.PluginPool().FindPluginL( aLevelUid );
+
+    CDiagExecPlanEntryImplSuite* prepareEntry =
+        CDiagExecPlanEntryImplSuite::NewLC( 
+            iEngine,
+            iEngineConfig,
+            iPlanEntryObserver,
+            static_cast< MDiagSuitePlugin& >( suitePlugin ),
+            ETrue, // iAsDependent. Updated as later if not true.
+            CDiagExecPlanEntryImpl::ETypeSuitePrepare );
+
+    iPlan.InsertL( static_cast< CDiagExecPlanEntryImpl* >( prepareEntry ), aAt );
+    CleanupStack::Pop( prepareEntry ); // ownership transfer
+    prepareEntry = NULL;
+
+    #ifdef _DEBUG_EXEC_PLAN
+    LOGSTRING2( "CDiagPluginExecPlanImpl:: InsertPrepare 0x%08x", aLevelUid )
+    #endif // _DEBUG_EXEC_PLAN
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::AddSuiteFinalizeL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::AddSuiteFinalizeL( TInt aPrepareIndex, TInt aAt )
+    {
+    // It is identical to the prepare entry, except that type is ETypeSuiteFinalize
+    __ASSERT_ALWAYS( aPrepareIndex >= 0 && aPrepareIndex < iPlan.Count(),
+                     Panic( EDiagFrameworkInternal ) );
+
+    CDiagExecPlanEntryImplSuite& prepareEntry = 
+        static_cast< CDiagExecPlanEntryImplSuite& > ( *(iPlan[aPrepareIndex]) );
+
+    CDiagExecPlanEntryImplSuite* finalizeEntry = 
+        CDiagExecPlanEntryImplSuite::NewLC( 
+            iEngine,
+            iEngineConfig,
+            iPlanEntryObserver,
+            prepareEntry.SuitePlugin(),
+            prepareEntry.AsDependency(),
+            CDiagExecPlanEntryImpl::ETypeSuiteFinalize );
+
+    iPlan.InsertL( static_cast< CDiagExecPlanEntryImpl* >( finalizeEntry ), aAt );
+    CleanupStack::Pop( finalizeEntry );  // ownership transmitted above
+    finalizeEntry = NULL;
+
+    #ifdef _DEBUG_EXEC_PLAN
+    LOGSTRING2( "CDiagPluginExecPlanImpl:: InsertFinalize 0x%08x", prepareEntry.Plugin().Uid().iUid );
+    #endif // _DEBUG_EXEC_PLAN
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::StoreNextTestPluginToDbL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::StoreNextTestPluginToDbL()
+    {
+    // STEP_6. Store plan to DB. 
+    // In this step, all test entries must be stored in db with EQueuedToRun
+    // status. Since DbRecord().LogTestResult() is an async call, only one
+    // item can be written at a time. 
+    //
+    // To do this, this function will search for the next "TEST" plug-in that
+    // needs to be logged to DB. Once it is found, it will call async function
+    // LogTestResult() and wait for RunL() to execute again.
+    // In RunL(), StoreNextTestPluginToDbL() is called again, and it will look for the
+    // next test plugin to store until it loops through all items in plan.
+    while ( MoveCursorToNext() )
+        {
+        if ( CurrentExecutionItem().Plugin().Type() == MDiagPlugin::ETypeTestPlugin )
+            {
+            LOGSTRING2( "CDiagPluginExecPlanImpl::RunL: STEP_6 - storing item 0x%08x",
+                CurrentExecutionItem().Plugin().Uid().iUid )
+
+            CDiagResultsDatabaseItem* resultItem = 
+                CDiagResultsDbItemBuilder::CreateSimpleDbItemL( 
+                    CurrentExecutionItem().Plugin().Uid(),
+                    CurrentExecutionItem().AsDependency(),
+                    CDiagResultsDatabaseItem::EQueuedToRun );
+
+            // Record initial test result to db.
+            // StoreNextTestPluginToDbL() will be called again later from RunL()
+            iEngine.DbRecord().LogTestResult( iStatus, *resultItem );
+            SetActive();
+
+            delete resultItem;
+            resultItem = NULL;
+
+            // Exit here since we must wait for LogTestResult() to complete
+            // before moving on to the next item.
+            return;
+            }
+        }
+
+    // All items are stored now.
+    ChangeState( EStatePlanCreated );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::PrependExecutedItemsL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::PrependExecutedItemsL()
+    {
+    #ifdef _DEBUG_EXEC_PLAN
+    LOGSTRING( "CDiagExecPlanEntryImpl::PrependExecutedItemsL(). "
+        L" Before prepending executed entries" );
+    LogPlanL();
+    #endif // _DEBUG_EXEC_PLAN
+
+    for ( TInt lastIndex = iExecutedEntries.Count() - 1;
+          lastIndex >= 0 ;
+          lastIndex-- )
+        {
+        // Insert last entry from the executed list to the beginning.
+        iPlan.InsertL( iExecutedEntries[ lastIndex ], 0 );
+        iExecutedEntries.Remove( lastIndex );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::ReportResult
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::ReportResult( TInt aError )
+    {
+    User::RequestComplete( iClientStatus, aError );
+    iClientStatus = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::InsertPluginL
+// ---------------------------------------------------------------------------
+//
+TBool CDiagPluginExecPlanImpl::InsertPluginL( MDiagPlugin& aPlugin,
+                                              TBool aAsDependency,
+                                              TInt aAt )
+    {
+    #ifdef _DEBUG_EXEC_PLAN
+    LOGSTRING4( "CDiagPluginExecPlanImpl::InsertPluginL:"
+            L"Id = 0x%x, Type = %s, At %d", 
+            aPlugin.Uid().iUid,  
+            ( aPlugin.Type() == MDiagPlugin::ETypeTestPlugin ? L"Test" : L"Suite" ),
+            aAt )
+    #endif // _DEBUG_EXEC_PLAN
+
+    __ASSERT_ALWAYS( aAt >= 0 && aAt <= iPlan.Count(), Panic( EDiagFrameworkArrayBounds ) );
+
+    // First, examine items before given index.
+    // If new item has iAsDependent == ETrue, and also found before the given index,
+    //   --> it is okay to not insert the item, since it will just be duplicates.
+    // if new item has iAsDependent == EFalse, 
+    //   --> no need to check for items prior to current position, since
+    //   explicit
+    // where it was requested.
+    TInt idx = 0;
+    if ( aAsDependency )
+        {
+        // check if it was already executed in the previous session.
+        for ( idx = 0; idx < iExecutedEntries.Count(); idx++ )
+            {
+            if ( iExecutedEntries[idx]->Plugin().Uid() == aPlugin.Uid() )
+                {
+                // matching item found.
+                // No need to instert a new item.
+                return EFalse;
+                }
+            }
+
+        // check for items in current plan.
+        for ( idx = 0; idx < aAt && idx < iPlan.Count(); idx++ )
+            {
+            if ( iPlan[idx]->Plugin().Uid() == aPlugin.Uid() )
+                {
+                // Matching item found. 
+                // No change to plan made.
+                return EFalse;
+                }
+            }
+        }
+
+    // Duplicate item not found before given index.
+    // An item will be inserted at the given index. Now, we search for
+    // duplicates after current index, and see if we can remove them.
+    idx = aAt;
+    while ( idx < iPlan.Count() )
+        {
+        if ( iPlan[idx]->Plugin().Uid() == aPlugin.Uid() && iPlan[idx]->AsDependency() )
+            {
+            // Item is found, and it was for dependency.
+            // We can move this item to current position. 
+            // For now, we just need to remove it, since it will be added at
+            // current position when for loop is done.
+            CDiagExecPlanEntryImpl* entry = iPlan[idx];
+            iPlan.Remove( idx );
+            delete entry;
+            entry = NULL;
+
+            // no need to increment idx, since current item is removed.
+            // idx should already be at the next item.
+            }
+        else
+            {
+            idx++;     // check next item.
+            }
+        }
+
+    // Either plug-in is not found, or we found one that we can move.
+    // Add to current position.
+    CDiagExecPlanEntryImpl* newEntry = CreateDefaultPlanEntryLC(
+        aPlugin,
+        aAsDependency );
+
+    iPlan.InsertL( newEntry, aAt );
+    CleanupStack::Pop( newEntry );
+    newEntry = NULL;
+
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::CreateDefaultPlanEntryL
+//
+// ---------------------------------------------------------------------------
+//
+CDiagExecPlanEntryImpl* CDiagPluginExecPlanImpl::CreateDefaultPlanEntryLC(
+        MDiagPlugin& aPlugin,
+        TBool aAsDependency ) const
+    {
+    CDiagExecPlanEntryImpl* newEntry = NULL;
+
+    if ( aPlugin.Type() == MDiagPlugin::ETypeTestPlugin )
+        {
+        newEntry = static_cast< CDiagExecPlanEntryImpl* >(
+            CDiagExecPlanEntryImplTest::NewLC(
+                iEngine,
+                iEngineConfig,
+                iPlanEntryObserver,
+                static_cast< MDiagTestPlugin& >( aPlugin ),
+                aAsDependency,
+                CDiagResultsDatabaseItem::EQueuedToRun ) );
+        }
+    else
+        {
+        newEntry = static_cast< CDiagExecPlanEntryImpl* >(
+            CDiagExecPlanEntryImplSuite::NewLC(
+                iEngine,
+                iEngineConfig,
+                iPlanEntryObserver,
+                static_cast< MDiagSuitePlugin& >( aPlugin ),
+                aAsDependency,
+                CDiagExecPlanEntryImpl::ETypeSuiteUnexpanded ) );
+        }
+
+    return newEntry;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::LogPlan
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::LogPlanL() const
+    {
+    #ifdef _DEBUG
+    LOGSTRING( "CDiagPluginExecPlanImpl::LogPlan(): Plan Dump." )
+    for ( TInt i = 0; i < iPlan.Count(); i++ )
+        {            
+        HBufC* pluginName = iPlan[i]->Plugin().GetPluginNameL( 
+            MDiagPlugin::ENameLayoutListSingle );
+
+        LOGSTRING5( "Plan Entry: Id = 0x%08x, %s, Dep=[%s], Name = %S",
+            iPlan[i]->Plugin().Uid().iUid,  
+            ( iPlan[i]->Type() == CDiagExecPlanEntryImpl::ETypeSuitePrepare ? L"<" : 
+                ( iPlan[i]->Type() == CDiagExecPlanEntryImpl::ETypeSuiteFinalize ? L">" : L" " ) ),
+            ( iPlan[i]->AsDependency() ? L"*" : L" " ),
+            pluginName )
+
+        delete pluginName;
+        }
+    #endif // _DEBUG
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginExecPlanImpl::LogPlanInRecordL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginExecPlanImpl::LogPlanInRecordL() const
+    {
+    #ifdef _DEBUG
+
+    LOGSTRING( "CDiagPluginExecPlanImpl::LogPlanInRecord()" )
+
+    RPointerArray< CDiagResultsDatabaseItem > results;
+    DiagFwInternal::CleanupRPointerArrayPushL< CDiagResultsDatabaseItem >( &results );
+    User::LeaveIfError(
+        iEngine.DbRecord().GetTestResults( results ) );
+
+    TInt resultCount = results.Count();
+
+    LOGSTRING2( "  Result Count = %d", resultCount )
+
+    for ( TInt i = 0; i < resultCount; i++ )
+        {
+        LOGSTRING4( "   Test UID = 0x%08x, Result = %d, Dep = %d", 
+            results[i]->TestUid().iUid,
+            results[i]->TestResult(),
+            results[i]->WasDependency() )
+        }
+
+    CleanupStack::PopAndDestroy( &results );
+
+    #endif // _DEBUG
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagpluginloaderdependencyparser.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,596 @@
+/*
+* Copyright (c) 2007 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:  Parse dependency information from XML in ECOM plug-in
+                 resource files
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagpluginloaderdependencyparser.h"
+
+// SYSTEM INCLUDE FILES
+#include <xml/parser.h>         // CParser
+#include <badesca.h>
+#include <e32svr.h>
+#include <DiagFrameworkDebug.h> // LOGSTRING
+
+// USER INCLUDE FILES
+
+using namespace Xml;
+
+namespace DiagPluginPool
+    {
+// ============================================================================
+// LOCAL DATA
+// ============================================================================
+
+_LIT8( KParserMIMEType, "text/xml" );
+_LIT8( KRootXmlTag, "diagplugininfo" );
+_LIT8( KOrderNumberTag, "order" );
+_LIT8( KServiceProvidedTag, "serviceprovided" );
+_LIT8( KServicesRequiredTag, "servicesrequired" );
+_LIT8( KServiceTag, "service" );
+_LIT8( KNameAttrTag, "name" );
+_LIT8( KNumberAttrTag, "number" );
+
+// ============================================================================
+// MEMBER FUNCTIONS( CDepdendencyParser )
+// ============================================================================
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CDependencyParser* CDependencyParser::NewL()
+    {
+    CDependencyParser* self = CDependencyParser::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CDependencyParser* CDependencyParser::NewLC()
+    {
+    CDependencyParser* self = new( ELeave )CDependencyParser;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    } 
+
+// ---------------------------------------------------------------------------
+// ~CDependencyParser
+// ---------------------------------------------------------------------------
+//
+CDependencyParser::~CDependencyParser()
+    {
+    delete iParser;
+    delete iServiceProvided;
+    if ( iServicesRequired )
+        {
+        iServicesRequired->Reset();
+        }
+    delete iServicesRequired;
+    }
+
+// ---------------------------------------------------------------------------
+// ParseL
+// ---------------------------------------------------------------------------
+//
+void CDependencyParser::ParseL( const TDesC8& aOpaqueData, const TDesC8& aDefaultData )
+    {
+    
+    ASSERT( aOpaqueData.Length() );    
+    ASSERT( aDefaultData.Length() );        
+    
+    // Start out by deleting and zeroing old elements
+    if ( iHasBeenRun )
+        {        
+        ResetL();
+        }        
+           
+    iHasBeenRun = ETrue;
+    
+    // Get Parent UID    
+    iParseStatus = ParseToUid( aDefaultData, iParentUid );       
+    
+    // Do not parse opaque data if UID is invalid because plug-in will not be loaded
+    // when data error is detected.        
+    if ( iParseStatus == KErrNone )    
+        {
+        // Parse buffer in one fell swoop            
+        iParser->ParseBeginL();    
+        iParser->ParseL( aOpaqueData );    
+        iParser->ParseEndL();            
+        }            
+    
+    // Check for error from parser
+    User::LeaveIfError( iParseStatus );
+    
+    // Check for error in format
+    if ( iBadXML )
+        {
+        User::Leave( KErrCorrupt );
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// GetOrderNumber
+// ---------------------------------------------------------------------------
+//    
+TInt CDependencyParser::GetOrderNumber() const
+    {
+    return iOrderNumber;
+    }
+    
+// ---------------------------------------------------------------------------
+// GetServiceProvided
+// ---------------------------------------------------------------------------
+//    
+HBufC* CDependencyParser::GetServiceProvided()
+    {
+    HBufC* ret = iServiceProvided;
+    iServiceProvided = NULL;
+    return ret;
+    }
+ 
+// ---------------------------------------------------------------------------
+// GetServicesRequired
+// ---------------------------------------------------------------------------
+//   
+CDesC16ArrayFlat* CDependencyParser::GetServicesRequired()
+    {
+    // Ownership is passed to caller
+    CDesC16ArrayFlat* ret = iServicesRequired;    
+    iServicesRequired = NULL;
+    return ret;
+    }
+    
+// ---------------------------------------------------------------------------
+// GetServicesRequired
+// ---------------------------------------------------------------------------
+//       
+const TUid& CDependencyParser::GetParentUid() const
+    {
+    return iParentUid;       
+    }
+
+// ---------------------------------------------------------------------------
+// From Xml::MContentHandler
+// OnStartElementL
+// ---------------------------------------------------------------------------
+//
+void CDependencyParser::OnStartElementL(
+    const RTagInfo& aElement,
+    const RAttributeArray& aAttributes,
+    TInt aErrorCode
+    )
+    {
+    const TDesC8& elementName8 = aElement.LocalName().DesC();
+    
+#ifdef _DEBUG   
+    HBufC* elementName16 = Convert8BitTo16BitBufferLC( elementName8 );
+    LOGSTRING3( "OnStartElementL %S %d\n", elementName16, aErrorCode )
+    CleanupStack::PopAndDestroy( elementName16 );    
+#endif
+    
+    /*
+    Parse XML tags in the following sample format:
+    
+    <diagplugininfo>
+       <order number="5"/>
+       <serviceprovided name="Browser"/>
+       <servicesrequired>"
+           <service name="SIM"/>
+           <service name="Graphics"/>
+       </servicesrequired>
+   </diagplugininfo>   
+    */        
+    
+    if ( !iInsideRootNode )
+        {
+        // Look for root node
+        if ( ! elementName8.Compare( KRootXmlTag ) )
+            {
+            iInsideRootNode = ETrue;
+            }
+        else
+            {
+            LOGSTRING( "Error: unexpected element looking for root node.\n" )
+            iBadXML = ETrue;
+            }
+        }
+    else // Look for "body" nodes
+        {
+        // Check order number
+        if ( ! elementName8.Compare( KOrderNumberTag ) )
+            {
+            LOGSTRING("Order number\n")
+            if ( ValidateXmlTag( aAttributes, iFoundOrderNumber ))
+                {
+                if ( ! ParseNumericAttribute( aAttributes[0], iOrderNumber ) )
+                    {
+                    LOGSTRING2( "Order Number: \'%d\'\n", iOrderNumber )
+                    }
+                else
+                    {                                       
+                    iBadXML = ETrue;
+                    }
+                }           
+            }
+        // Check service provided
+        else if ( ! elementName8.Compare( KServiceProvidedTag ) )
+            {
+            LOGSTRING("Service Provided\n")
+            
+            if ( ValidateXmlTag( aAttributes, iFoundServiceProvided ))
+                {
+                if ( ! ParseStringAttributeL( aAttributes[0], iServiceProvided ) )
+                                            
+                    {                    
+                    LOGSTRING2( "Service Provided \"%S\"\n", iServiceProvided )
+                    }
+                else
+                    {                    
+                    iBadXML = ETrue;
+                    }
+                }              
+            }
+
+        // Check services required block
+        else if ( ! elementName8.Compare( KServicesRequiredTag ) )
+            {
+            if ( ! iFoundServicesRequired )
+                {                
+                iParsingServicesRequired = ETrue;
+                iFoundServicesRequired = ETrue;
+                }
+            else
+                {                
+                LOGSTRING( "Error: unexpected services required tag found.\n" )
+                iBadXML = ETrue;
+                }
+            }
+        
+        // Check service tag
+        else if ( ! elementName8.Compare( KServiceTag ) )
+            {
+            LOGSTRING("Service\n")
+            
+            // OK to have multiple service tags so use dummy as "found" flag
+            TBool Dummy = EFalse;
+            
+            if ( ValidateXmlTag( aAttributes, Dummy ))
+                {
+                HBufC* newService = NULL;
+                
+                if ( ! ParseStringAttributeL( aAttributes[0],
+                                                newService ) )
+                    {
+                    LOGSTRING2( "Got service required \"%S\"\n", newService )
+                    CleanupStack::PushL( newService );
+                    iServicesRequired->AppendL( *newService );
+                    CleanupStack::PopAndDestroy( newService );                    
+                    }
+                else
+                    {
+                    iBadXML = ETrue;
+                    }
+                }            
+            }
+        // Unexpected tag            
+        else
+            {
+            LOGSTRING( "Error: unexpected XML tag found.\n" )
+            iBadXML = ETrue;
+            }
+        }        
+    }       
+
+// ---------------------------------------------------------------------------
+// From Xml::MContentHandler
+// OnEndElementL
+// ---------------------------------------------------------------------------
+//    
+void CDependencyParser::OnEndElementL( const Xml::RTagInfo& aElement, TInt aErrorCode )
+    {
+    const TDesC8& elementName8 = aElement.LocalName().DesC();
+    
+ #ifdef _DEBUG
+    HBufC* elementName16 = Convert8BitTo16BitBufferLC( elementName8 );
+    LOGSTRING3( "OnEndElementL %S %d\n", elementName16, aErrorCode )
+    CleanupStack::PopAndDestroy( elementName16 );
+ #endif
+    
+    // Check for end services required block
+    if ( ! elementName8.Compare( KServicesRequiredTag ) )
+        {
+        iParsingServicesRequired = EFalse;
+        }    
+        
+    // Check for end of root block
+    if ( ! elementName8.Compare( KRootXmlTag ) )        
+        {            
+        iInsideRootNode = EFalse;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From Xml::MContentHandler
+// OnContentL
+// ---------------------------------------------------------------------------
+//     
+void CDependencyParser::OnContentL( const TDesC8& /*aBytes*/, TInt aErrorCode )
+    {    
+    LOGSTRING2( "OnContentL %d\n", aErrorCode )
+    }    
+    
+// ---------------------------------------------------------------------------
+// From Xml::MContentHandler
+// OnError
+// ---------------------------------------------------------------------------
+//    
+void CDependencyParser::OnError( TInt aErrorCode )
+    {
+    LOGSTRING2( "OnError %d\n", aErrorCode )
+        
+    iParseStatus = aErrorCode;
+    }  
+    
+// ============================================================================
+// PRIVATE MEMBER FUNCTIONS( CDepdendencyParser )
+// ============================================================================    
+    
+// ---------------------------------------------------------------------------
+// Convert8BitTo16BitBufferLC
+// ---------------------------------------------------------------------------
+//  
+HBufC* CDependencyParser::Convert8BitTo16BitBufferLC( const TDesC8& Des ) const
+    {
+    HBufC* buf = HBufC::NewLC( Des.Length() );
+    buf->Des().Copy( Des );
+    return buf;
+    }
+
+// ---------------------------------------------------------------------------
+// ParseNumericAttribute
+// ---------------------------------------------------------------------------
+//  
+TBool CDependencyParser::ParseNumericAttribute( const RAttribute& aAttribute, 
+                                                TInt& aNumericAttribute )
+    {
+    TBool corrupt = EFalse;
+    const TDesC8& attrName = aAttribute.Attribute().LocalName().DesC();
+    const TDesC8& attrVal = aAttribute.Value().DesC();
+
+    // Attribute name should be "number"
+    if ( attrName.Compare( KNumberAttrTag ) )
+        {
+        LOGSTRING( "Error: expected number attribute.\n" )
+        corrupt = ETrue;
+        }
+    else
+        {
+        // Parse out order number
+        TLex8 lex( attrVal );
+        TInt rc=lex.Val( aNumericAttribute );
+        if ( rc != KErrNone )
+            {
+            LOGSTRING2( "Error: Could not parse attribute( rc=%d )", rc )
+            corrupt = ETrue;
+            }
+        }
+
+    return corrupt;
+    }
+
+// ---------------------------------------------------------------------------
+// ParseStringAttributeL
+// ---------------------------------------------------------------------------
+//
+TBool CDependencyParser::ParseStringAttributeL( const RAttribute& aAttribute, 
+                                                HBufC*& aStringAttribute )
+    {
+    TBool corrupt = EFalse;
+    const TDesC8& attrName = aAttribute.Attribute().LocalName().DesC();
+    const TDesC8& attrVal = aAttribute.Value().DesC();
+
+    // Attribute name should be "name"
+    if ( attrName.Compare( KNameAttrTag ) )
+        {
+        LOGSTRING( "Error: expected name attribute.\n" )
+        corrupt = ETrue;
+        }
+    else
+        {
+        aStringAttribute = Convert8BitTo16BitBufferLC( attrVal );
+        CleanupStack::Pop( aStringAttribute );
+        }
+
+    return corrupt;
+    }
+
+// ----------------------------------------------------------------------------
+// ParseToUid
+// ----------------------------------------------------------------------------
+//
+TInt CDependencyParser::ParseToUid( const TDesC8& aSource, TUid& aTarget )
+    {
+    // Remove required "0x" from the descriptor
+    _LIT8( KHexPrefix, "0x" );
+
+    TPtrC8 pSource( aSource );
+    const TInt prefixPosition = pSource.Find( KHexPrefix );
+    if ( prefixPosition == KErrNotFound )
+        {
+        return KErrCorrupt;            
+        }
+    else
+        {
+        pSource.Set( aSource.Mid( prefixPosition + KHexPrefix().Length() ) );
+        }            
+
+    // Parse to integer
+    TLex8 lex( pSource );
+    TUint integer = 0;
+
+    // Parse using TRadix::EHex as radix:
+    const TInt err = lex.Val( integer, EHex );
+    aTarget.iUid = integer;
+   
+    return err;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// ValidateXmlTag
+// Validate Xml tag following a few standard rules that apply to
+// all XML tags in this format:
+// 1) Only one attribute is in each XML tag
+// 2) Only one of any given tag is allowed
+// ---------------------------------------------------------------------------
+//
+TBool CDependencyParser::ValidateXmlTag( const Xml::RAttributeArray& aAttributes,
+                                         TBool& aFoundTag )
+    {         
+    if ( aFoundTag )
+        {
+        LOGSTRING( "Error: multiple tags found.  Ignoring subsequent values.\n" )        
+        }
+    else 
+        {
+        aFoundTag = ETrue;
+        
+        if ( aAttributes.Count() == 1 )
+            {
+            return ETrue;
+            }
+        else if ( aAttributes.Count() > 1 )
+            {
+            LOGSTRING( "Error: Extra data after attribute tag.\n" )
+            iBadXML = ETrue;
+            }
+        else
+            {
+            LOGSTRING( "Error: No attributes found.\n" )
+            iBadXML = ETrue;
+            }
+        }                
+        
+    return EFalse;        
+    }    
+
+// ---------------------------------------------------------------------------
+// ResetL
+// ---------------------------------------------------------------------------
+//
+void CDependencyParser::ResetL()
+    {
+    delete iServiceProvided;
+    iServiceProvided = NULL;
+            
+    if ( iServicesRequired )
+        {
+        iServicesRequired->Reset();
+        }
+    delete iServicesRequired;
+    iServicesRequired = new( ELeave )CDesC16ArrayFlat( 1 );
+            
+    iOrderNumber = 0;
+    iParentUid = TUid::Uid(0);
+    
+    // Reset all flags
+    iParsingServicesRequired = EFalse;
+    iBadXML = EFalse;
+    iInsideRootNode = EFalse;
+    iFoundOrderNumber = EFalse;
+    iFoundServiceProvided = EFalse;
+    iFoundServicesRequired = EFalse;
+    iParseStatus = 0;
+    }
+        
+// ============================================================================
+// PRIVATE CONSTRUCTORS ( CDepdendencyParser )
+// ============================================================================           
+        
+// ---------------------------------------------------------------------------
+// CDependencyParser::CDependencyParser
+// ---------------------------------------------------------------------------
+//
+CDependencyParser::CDependencyParser()
+    {    //lint !e1927 variables not showing up in initializer list
+         // initialized in CBase constructor
+    }    //lint !e1744 member variables possibly not initialized
+    
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CDependencyParser::ConstructL()
+    {        
+    iParser = CParser::NewL( KParserMIMEType, *this );            
+    iServicesRequired = new( ELeave )CDesC16ArrayFlat( 1 );
+    }       
+    
+
+// ============================================================================
+// Unused pure virtual functions from Xml::MContentHandler
+// ============================================================================
+
+void CDependencyParser::OnStartDocumentL( const RDocumentParameters& /* aDocParam */, TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnEndDocumentL( TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnStartPrefixMappingL( const RString& /* aPrefix */, const RString& /* aUri */, TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnEndPrefixMappingL( const RString& /* aPrefix */, TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnIgnorableWhiteSpaceL( const TDesC8& /* aBytes */, TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnSkippedEntityL( const RString& /* aName */, TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnProcessingInstructionL( const TDesC8& /* aTarget */, const TDesC8& /* aData */, TInt /* aErrorCode */ )
+    {
+    }
+
+void CDependencyParser::OnExtensionL( const RString& /* aData */, TInt /* aToken */, TInt /* aErrorCode */ )
+    {
+    }
+
+TAny* CDependencyParser::GetExtendedInterface( const TInt32 /* aUid */ )
+    {
+    return 0;
+    }
+    
+    } // namespace DiagPluginPool
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagpluginpool.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagPluginPool
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagpluginpoolimpl.h" // CDiagPluginPoolImpl
+#include <DiagFrameworkDebug.h>
+// SYSTEM INCLUDE FILES
+#include <DiagPluginPool.h>
+#include <DiagPlugin.h>             // MDiagPlugin
+
+// USER INCLUDE FILES
+
+
+// ===========================================================================
+// MEMBER FUNCTIONS
+// ===========================================================================
+
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::NewL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginPool* CDiagPluginPool::NewL( 
+            MDiagPluginPoolObserver& aObserver )
+    {
+    LOGSTRING("CDiagPluginPool* CDiagPluginPool::NewL");
+    CDiagPluginPool* self = CDiagPluginPool::NewLC( aObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::NewLC()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginPool* CDiagPluginPool::NewLC( 
+            MDiagPluginPoolObserver& aObserver )
+    {
+    LOGSTRING("CDiagPluginPool* CDiagPluginPool::NewLC");
+    CDiagPluginPool* self = new( ELeave )CDiagPluginPool();
+    CleanupStack::PushL( self );
+    self->ConstructL( aObserver );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::CDiagPluginPool
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPool::CDiagPluginPool()
+    {
+    }    
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::LoadAsyncL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagPluginPool::LoadAsyncL( TUid /*aUid*/ )
+    {    
+    iPluginPoolImpl->LoadAsyncL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::CreatePluginL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagPlugin* CDiagPluginPool::CreatePluginL( TUid aUid )
+    {
+    LOGSTRING("CDiagPluginPool::CreatePluginL");
+    return CDiagPluginPoolImpl::CreatePluginL( aUid );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::CancelLoadPluginsL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagPluginPool::CancelLoadPluginsL()
+    {
+    iPluginPoolImpl->Cancel();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::FindPlugin
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagPluginPool::FindPlugin( TUid aUid, 
+            MDiagPlugin*& aPlugin ) const
+    {    
+    LOGSTRING("CDiagPluginPool::FindPlugin");
+    return iPluginPoolImpl->FindPlugin( aUid, aPlugin );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::FindPluginL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagPlugin& CDiagPluginPool::FindPluginL( TUid aUid ) const
+    {    
+    MDiagPlugin* plugin = NULL;
+    User::LeaveIfError( FindPlugin( aUid, plugin ) );
+    return *plugin;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::FindPlugin
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagPluginPool::FindPlugin( const TDesC& aServiceName, 
+            MDiagPlugin*& aPlugin ) const
+    {
+    return iPluginPoolImpl->FindPlugin( aServiceName, aPlugin );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::FindPluginL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagPlugin& CDiagPluginPool::FindPluginL( const TDesC& aServiceName ) const
+    {    
+    MDiagPlugin* plugin = NULL;
+    User::LeaveIfError( FindPlugin( aServiceName, plugin ) );
+    return *plugin;
+    }
+    
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPool::ConstructL( MDiagPluginPoolObserver& aObserver )
+    {
+    // Construct implementation class
+    iPluginPoolImpl = CDiagPluginPoolImpl::NewL( aObserver );
+    }    
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool::~CDiagPluginPool
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginPool::~CDiagPluginPool()
+    {
+    LOGSTRING("CDiagPluginPool::~CDiagPluginPool");
+    delete iPluginPoolImpl;
+    }    
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagpluginpoolimpl.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,626 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of Diagnostics Plug-in Pool
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagpluginpoolimpl.h"
+
+// SYSTEM INCLUDE FILES
+#include <ecom.h>
+#include <DiagPlugin.h>
+#include <DiagPluginPoolObserver.h>
+#include <DiagPluginConstructionParam.h>
+#include <DiagPluginPoolObserver.h>
+#include <DiagFrameworkDebug.h>
+#include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroyPushL
+
+// USER INCLUDE FILES
+#include "diagpluginloaderdependencyparser.h"
+#include "diagrootsuite.h"
+
+using namespace DiagPluginPool;
+using namespace DiagFwInternal;
+
+_LIT( KPanicCode, "PluginPool" );
+
+// ===========================================================================
+// PUBLIC MEMBER FUNCTIONS
+// ===========================================================================    
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPoolImpl* CDiagPluginPoolImpl::NewL( MDiagPluginPoolObserver& aObserver )
+    {
+    LOGSTRING("");
+    CDiagPluginPoolImpl* self = CDiagPluginPoolImpl::NewLC( aObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPoolImpl* CDiagPluginPoolImpl::NewLC( MDiagPluginPoolObserver& aObserver )
+    {
+    CDiagPluginPoolImpl* self = new( ELeave )CDiagPluginPoolImpl( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }        
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPoolImpl::~CDiagPluginPoolImpl()
+    {
+    LOGSTRING("");
+    Cancel();
+    iPlugins.ResetAndDestroy();
+    iPlugins.Close();
+    REComSession::FinalClose();
+    }
+    
+// ---------------------------------------------------------------------------
+// LoadAsyncL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPoolImpl::LoadAsyncL()
+    {
+    LOGSTRING( "CDiagPluginPoolImpl::LoadAsyncL" )
+
+    ASSERT ( !iPluginsLoaded );
+    ASSERT ( !iPluginsLoading );
+
+    iPluginsLoading = ETrue;       
+       
+    iConstructionParamArray = GeneratePluginListL();
+    
+    iTotalPluginsFound = iConstructionParamArray->Count();
+
+    // No plug-ins found
+    if ( ! iTotalPluginsFound )
+        {
+        DestroyConstructionParams();
+        User::Leave( KErrNotFound );
+        }                
+            
+    // Create root suite to define the hierarchy
+    MDiagSuitePlugin* rootSuite = CDiagRootSuite::NewL();    
+    CleanupStack::PushL( rootSuite );
+    iPlugins.AppendL( rootSuite ); // ownership transfered        
+    CleanupStack::Pop( rootSuite );
+
+    SetNextIteration();
+    }
+    
+// ---------------------------------------------------------------------------
+// CreatePluginL
+// ---------------------------------------------------------------------------
+//
+MDiagPlugin* CDiagPluginPoolImpl::CreatePluginL( const TUid aUid )
+    {
+    TInt errorCode = KErrNone;
+
+    LOGSTRING2( "CDiagPluginPoolImpl::CreatePluginL %d\n", aUid.iUid )
+
+    // Create construction parameters list
+    RConstructionParamArray* constructionParamsArray = GeneratePluginListL();
+    CleanupStack::PushL( constructionParamsArray );
+    CleanupResetAndDestroyPushL( *constructionParamsArray );
+    
+    MDiagPlugin* plugin = NULL;
+    
+    // Find plug-in with matching UID        
+    for ( TInt i=0; i<constructionParamsArray->Count(); i++ )
+        {
+        if ( ( *constructionParamsArray )[i]->Uid() == aUid )
+            {            
+            plugin = CreatePluginFromConstructionParamsL( ( *constructionParamsArray )[i] );
+            
+            // Construction params owned by plug-in so remove from list
+            constructionParamsArray->Remove(i);
+            break;  //lint !e960 ok to break from for loop     
+            }
+        }
+        
+    if ( ! plugin )
+        {                
+        errorCode = KErrNotFound;                
+        }
+       
+    CleanupStack::PopAndDestroy();        // *implInfoArray
+    CleanupStack::PopAndDestroy( constructionParamsArray );
+    
+    User::LeaveIfError( errorCode );
+        
+    return plugin;    
+    }
+
+// ---------------------------------------------------------------------------
+// FindPlugin
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginPoolImpl::FindPlugin( TUid aUid, MDiagPlugin*& aPlugin ) const
+    {
+    LOGSTRING2( "CDiagPluginPoolImpl::FindPlugin 0x%x\n", aUid.iUid )
+
+    aPlugin = NULL;
+
+    // Find plug-in with matching UID in pool
+    for ( TInt i=0; i<iPlugins.Count(); i++ )
+        {           
+        if ( iPlugins[i]->Uid() == aUid )           
+            {
+            aPlugin = iPlugins[i];            
+            return KErrNone;
+            }
+        }
+        
+    return KErrNotFound;        
+    }
+
+// ---------------------------------------------------------------------------
+// FindPlugin
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginPoolImpl::FindPlugin( const TDesC& aServiceName,
+                                        MDiagPlugin *& aPlugin ) const
+    {    
+    LOGSTRING2( "CDiagPluginPoolImpl::FindPlugin \"%S\"\n", &aServiceName )
+
+    aPlugin = NULL;
+    
+    // Find plug-in with matching service name in pool
+    for ( TInt i=0; i<iPlugins.Count(); i++ )
+        {           
+        if ( iPlugins[i]->ServiceLogicalName() == aServiceName )           
+            {
+            aPlugin = iPlugins[i];            
+            return KErrNone;
+            }
+        }
+        
+    return KErrNotFound;
+    }
+
+
+// ===========================================================================
+// PRIVATE CONSTRUCTORS
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// CDiagPluginPool
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPoolImpl::CDiagPluginPoolImpl( MDiagPluginPoolObserver& aObserver )
+        // Priority is idle to allow plug-ins to load in background regardless of
+        // what UI priority is set to.
+    :   CActive( EPriorityIdle ),
+        iObserver( aObserver ),
+        iErrorCode( KErrNone )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPoolImpl::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    }        
+    
+
+// ===========================================================================
+// PRIVATE STATIC FUNCTIONS
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// ObtainImplementationInfoL
+// ---------------------------------------------------------------------------
+//
+CDiagPluginPoolImpl::RConstructionParamArray* CDiagPluginPoolImpl::GeneratePluginListL()
+    {     
+
+    // Get list of plug-in implementation implementationInfo
+    RImplInfoPtrArray* implInfoArray = new( ELeave )RImplInfoPtrArray;
+    
+    REComSession::ListImplementationsL( KDiagPluginInterfaceUid, *implInfoArray );
+        
+    // Leave if no matching plug-ins found        
+    if ( ! implInfoArray->Count() )
+        {
+        delete implInfoArray;
+        User::Leave( KErrNotFound );
+        }
+        
+    CleanupStack::PushL( implInfoArray );
+    CleanupResetAndDestroyPushL( *implInfoArray );         
+        
+    RConstructionParamArray* constructionParamsArray = new(ELeave)RConstructionParamArray;
+    CleanupStack::PushL( constructionParamsArray );
+    CleanupResetAndDestroyPushL( *constructionParamsArray );
+    CDependencyParser* parser = CDependencyParser::NewLC();
+    
+    // Iterate through implementation information array and create construction data for each
+    // plug-in.  Insert into array by order number.
+    for ( TInt pluginIndex=0; pluginIndex < implInfoArray->Count(); pluginIndex++ )
+        {
+        CImplementationInformation* pluginImplementationInfo = ( *implInfoArray )[pluginIndex];
+
+        if ( !pluginImplementationInfo->RomBased() )
+            {
+#ifdef _DEBUG
+            LOGSTRING2( "CDiagPluginPoolImpl::GeneratePluginListL() "
+                L" Loading non-rom plug-in 0x%08x", 
+                pluginImplementationInfo->ImplementationUid() );
+#else   // #ifdef _DEBUG
+            // In non _DEBUG build, do not load plug-in that are not in ROM
+            // for security reasons. Continue to next plug-in.
+            //continue;
+#endif  // #else _DEBUG
+            }
+
+        // Obtain depenency and other information from opaque data field
+        parser->ParseL( pluginImplementationInfo->OpaqueData(), 
+                        pluginImplementationInfo->DataType() );
+        
+        CDiagPluginConstructionParam* constructionParams = 
+            GenerateConstructionParamsLC( pluginImplementationInfo );
+                
+        TInt orderNumber = constructionParams->Order();        
+        
+        // Find correct index to insert plug-in
+        TInt insertIndex;
+        for ( insertIndex=0; insertIndex<constructionParamsArray->Count(); insertIndex++ )
+            {
+            if ( orderNumber < (*constructionParamsArray)[insertIndex]->Order() )
+                {                
+                break;    //lint !e960 break OK here.
+                }
+            } 
+                        
+        // Insert in order by order number
+        constructionParamsArray->InsertL(constructionParams,insertIndex);            
+        CleanupStack::Pop(constructionParams);
+        }
+                    
+    // Clean up                    
+    CleanupStack::PopAndDestroy(parser);              
+    CleanupStack::Pop(); // constructionParamsArray
+    CleanupStack::Pop(constructionParamsArray);            
+    CleanupStack::PopAndDestroy(); // implInfoArray
+    CleanupStack::PopAndDestroy(implInfoArray);                  
+        
+    return constructionParamsArray;
+    }
+    
+// ---------------------------------------------------------------------------
+// GenerateConstructionParamsL
+// ---------------------------------------------------------------------------
+//     
+CDiagPluginConstructionParam* CDiagPluginPoolImpl::GenerateConstructionParamsLC(
+                                    const CImplementationInformation* aInfo )
+    {
+    CDependencyParser* parser = CDependencyParser::NewLC();
+    
+    // Obtain depenency and other information from opaque data field
+    parser->ParseL( aInfo->OpaqueData(), aInfo->DataType() );
+    
+    CDiagPluginConstructionParam* params = CDiagPluginConstructionParam::NewL
+                                    (
+                                    parser->GetServiceProvided(),
+                                    parser->GetServicesRequired(),
+                                    parser->GetOrderNumber(),
+                                    aInfo->ImplementationUid(),
+                                    parser->GetParentUid()
+                                    );
+        
+    CleanupStack::PopAndDestroy( parser );
+    CleanupStack::PushL( params );
+    
+    return params;
+    }
+
+// ---------------------------------------------------------------------------
+// CreatePluginFromImplementationInfoL
+// ---------------------------------------------------------------------------
+//    
+MDiagPlugin* CDiagPluginPoolImpl::CreatePluginFromConstructionParamsL(
+                                    const CDiagPluginConstructionParam* aParams )
+    {    
+    MDiagPlugin* newPlugin = NULL;
+    TUid destructorIdKey;
+
+    // Call ECOM to load next plug-in
+    TAny* object = REComSession::CreateImplementationL( aParams->Uid(), 
+                                                        destructorIdKey, 
+                                                        ( TAny* )aParams );
+    if (!object)
+    User::Leave(KErrNotFound);
+    
+    newPlugin = static_cast<MDiagPlugin*>( object );
+    newPlugin->SetDtorIdKey( destructorIdKey );
+    return newPlugin;
+    }           
+    
+// ===========================================================================
+// PRIVATE MEMBER FUNCTIONS
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// AddNewPluginToSuiteL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPoolImpl::AddNewPluginToSuiteL(MDiagPlugin* aPlugin)
+    {
+    // Search the plug-in list for a matching suite plug-in and add this newly
+    // loaded plug-in to that corresponding suite.  If a suite is not found,
+    // this plug-in will have no parent unless the parent suite is loaded
+    // at some later point.
+    for ( TInt pluginIndex = 0; pluginIndex < iPlugins.Count(); pluginIndex++ )
+        {
+        
+        // Find matching parent suite
+        if ( aPlugin->ParentUid() == iPlugins[pluginIndex]->Uid() )
+            {               
+            if ( iPlugins[pluginIndex]->Type() == MDiagPlugin::ETypeSuitePlugin )
+                {
+                // If parent is a suite, add child         
+                MDiagSuitePlugin* parent = static_cast<MDiagSuitePlugin*>( iPlugins[pluginIndex] );
+                
+                parent->AddChildL( aPlugin );
+                return;
+                }
+            else
+                {
+                // if parent is not a suite, leave
+                User::Leave( KErrCorrupt );
+                }
+            }            
+        }   
+    }
+    
+// ---------------------------------------------------------------------------
+// AddPluginsToNewSuiteL
+// ---------------------------------------------------------------------------
+//    
+void CDiagPluginPoolImpl::AddPluginsToNewSuiteL(MDiagSuitePlugin* aPluginSuite)
+    {        
+    // Search the plug-in list for plug-ins with matching parent suite.
+    for ( TInt pluginIndex = 0; pluginIndex < iPlugins.Count(); pluginIndex++ )
+        {        
+        // Add any "orphan" plug-ins
+        if ( aPluginSuite->Uid() == iPlugins[pluginIndex]->ParentUid() )
+            {                                      
+            aPluginSuite->AddChildL( iPlugins[pluginIndex] );                      
+            }            
+        }   
+    }    
+
+// ---------------------------------------------------------------------------
+// SetNextIteration
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPoolImpl::SetNextIteration()
+    {
+    TRequestStatus* status = &iStatus;
+    
+    // Complete own request
+    User::RequestComplete( status, KErrNone );    
+    SetActive();
+    }
+    
+// ---------------------------------------------------------------------------
+// LoadNextPlugin
+// ---------------------------------------------------------------------------
+//    
+void CDiagPluginPoolImpl::LoadNextPluginL()
+    {
+    // Get parameters to generate plug-in
+    CDiagPluginConstructionParam* constructionParams = ( *iConstructionParamArray )[ 0 ];
+    iCurrentPluginIndex++;
+    MDiagPlugin* newPlugin = NULL;
+    
+    // Uid to report to application, defaults to NULL.
+    TUid reportedUid = TUid::Null();
+
+    // Create plug-in from ECOM structure
+    // Any parsing or ECOM error will be caught here
+    TRAPD( error, newPlugin = CreatePluginFromConstructionParamsL( constructionParams ) )
+        
+    // Construction params are now owned by plug-in so remove from array
+    iConstructionParamArray->Remove( 0 );        
+
+    LOGSTRING4( "CDiagPluginPoolImpl::LoadNextPluginL Plugin( %d/%d ): Error=%d\n",
+                iCurrentPluginIndex, iTotalPluginsFound, error )
+                                                          
+    // Check for error in plug-in creation                
+    if ( error != KErrNone )
+        {        
+        if ( iErrorCode == KErrNone )
+            {
+            // Sets error code to whatever was the first error encountered        
+            iErrorCode = error;
+            }                     
+        }
+    else
+        {
+        
+        CleanupDeletePushL( newPlugin );
+        
+        // Add to plug-in pool
+        reportedUid = AddPluginToPoolLD( newPlugin );
+        newPlugin = NULL;
+        }
+
+    // Load is not complete
+    if ( iConstructionParamArray->Count() )
+        {        
+        
+        // Set next plug-in to load in next active scheduler cycle
+        SetNextIteration();
+        
+        // Report progress to client
+        iObserver.LoadProgressL( iCurrentPluginIndex, iTotalPluginsFound, reportedUid );
+        }
+        
+    // Load is complete        
+    else
+        {
+        // Report load completed to client
+        iPluginsLoading = EFalse;
+        iPluginsLoaded = ETrue;
+
+        iObserver.LoadCompletedL( iErrorCode );
+
+        // Don't need implementation implementationInfo list anymore
+        DestroyConstructionParams();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DestroyConstructionParams
+// ---------------------------------------------------------------------------
+//    
+TUid CDiagPluginPoolImpl::AddPluginToPoolLD( MDiagPlugin* aPlugin )
+    {
+    
+    TUid reportedUid = TUid::Null();
+    
+    // Add plug-in to list
+    if ( aPlugin->IsSupported() )
+        {
+        iPlugins.AppendL( aPlugin );
+        
+        // Indicate to client that a plug-in was loaded with this UID
+        reportedUid = aPlugin->Uid();
+        
+        // Update suite tree.  If this is a plug-in, try to find parent
+        // suite and add.  If this is a suite, try to find child plug-ins
+        // and add them.            
+        AddNewPluginToSuiteL(aPlugin);
+        
+        if ( aPlugin->Type() == MDiagPlugin::ETypeSuitePlugin )
+            {
+            MDiagSuitePlugin* pluginSuite = 
+                    static_cast<MDiagSuitePlugin*>(aPlugin);
+            AddPluginsToNewSuiteL( pluginSuite );
+            }            
+        
+        CleanupStack::Pop();    // aPlugin        
+        }
+    else
+        {
+        LOGSTRING2( " Plugin UID 0x%x NOT SUPPORTED. Skipped", aPlugin->Uid().iUid )
+        CleanupStack::PopAndDestroy(); // aPlugin        
+        }
+        
+    return reportedUid;        
+    }
+    
+// ---------------------------------------------------------------------------
+// DestroyConstructionParams
+// ---------------------------------------------------------------------------
+// 
+void CDiagPluginPoolImpl::DestroyConstructionParams( )
+    {
+    if ( iConstructionParamArray )
+        {
+        iConstructionParamArray->ResetAndDestroy();
+        delete iConstructionParamArray;
+        iConstructionParamArray = NULL;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// ResetAndNotify
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginPoolImpl::ResetAndNotify(TInt aErrorCode)
+    {
+    // Reset load data
+    iCurrentPluginIndex = 0;
+    iPlugins.ResetAndDestroy();
+
+    iPluginsLoading = EFalse;
+
+    // Reset and delete implementation implementationInfo array
+    DestroyConstructionParams();
+
+    TRAPD( error, iObserver.LoadCompletedL( aErrorCode ) )
+    
+    return error;
+    }
+
+    
+
+// ===========================================================================
+// From CActive
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// RunL
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPoolImpl::RunL()
+    {
+    // Load a plug-in in active scheduler cycle
+    LoadNextPluginL();
+    }
+
+// ---------------------------------------------------------------------------
+// DoCancel
+// ---------------------------------------------------------------------------
+//
+void CDiagPluginPoolImpl::DoCancel()
+    {   
+    LOGSTRING( "CDiagPluginPoolImpl::DoCancel" )
+    
+    TInt error = ResetAndNotify(KErrCancel);
+
+    // Reset load data
+    if ( error )
+        {
+        User::Panic( KPanicCode(), error );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RunError
+// ---------------------------------------------------------------------------
+//
+TInt CDiagPluginPoolImpl::RunError( TInt aError )
+    {
+    // An unhandled exception occurs while running.  Destroy all currently
+    // loaded plug-ins.
+
+    LOGSTRING2( "CDiagPluginPoolImpl::RunError %d", aError )
+
+    TInt err = ResetAndNotify( aError );
+    LOGSTRING2( "CDiagPluginPoolImpl::RunError %d", err )
+    
+    return KErrNone;
+    }
+    
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagresultsdbitembuilder.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,285 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagResultsDbItemBuilder
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagResultsDbItemBuilder.h>
+
+// SYSTEM INCLUDE FILES
+#include <DiagResultDetail.h>               // MDiagResultDetail
+
+#ifndef __DIAGFW_DISABLE_DRM_API
+#include <drmserviceapi.h>                  // DRM::CDrmServiceApi
+#endif // __DIAGFW_DISABLE_DRM_API
+
+// USER INCLUDE FILES
+#include "diagframework.pan"                // Panic Codes
+
+
+// CONSTANTS
+
+// ======== MEMBER FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDbItemBuilder* CDiagResultsDbItemBuilder::NewL(
+        TUid aTestUid,
+        TBool aDependencyExecution )
+    {
+    CDiagResultsDbItemBuilder* self = CDiagResultsDbItemBuilder::NewLC(
+        aTestUid,
+        aDependencyExecution );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::NewLC
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDbItemBuilder* CDiagResultsDbItemBuilder::NewLC(
+        TUid aTestUid,
+        TBool aDependencyExecution )
+    {
+    CDiagResultsDbItemBuilder* self = new( ELeave )CDiagResultsDbItemBuilder(
+        aTestUid,
+        aDependencyExecution );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::CDiagResultsDbItemBuilder
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDbItemBuilder::CDiagResultsDbItemBuilder(
+        TUid aTestUid,
+        TBool aDependencyExecution )
+    :   iTestUid( aTestUid ),
+        iDependencyExecution( aDependencyExecution ),
+        iResult( CDiagResultsDatabaseItem::ENotPerformed )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDbItemBuilder::ConstructL()
+    {
+#ifndef __DIAGFW_DISABLE_DRM_API
+    iDrmApi = DRM::CDrmServiceApi::NewL();
+#endif // __DIAGFW_DISABLE_DRM_API
+
+    SetTimeStarted( GetCurrentTime() );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::~CDiagResultsDbItemBuilder
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDbItemBuilder::~CDiagResultsDbItemBuilder()
+    {
+#ifndef __DIAGFW_DISABLE_DRM_API
+    delete iDrmApi;
+    iDrmApi = NULL;
+#endif // __DIAGFW_DISABLE_DRM_API
+    delete iResultDetail;
+    iResultDetail = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::SetTestUid
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbItemBuilder::SetTestUid( TUid aUid )
+    {
+    iTestUid = aUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::TestUid
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid CDiagResultsDbItemBuilder::TestUid() const
+    {
+    return iTestUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::GetCurrentTime
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TTime CDiagResultsDbItemBuilder::GetCurrentTime() const
+    {
+    TTime currTime = ( TInt64 )0;
+#ifndef __DIAGFW_DISABLE_DRM_API
+    TInt timeZone = 0;
+    DRMClock::ESecurityLevel secLevel = DRMClock::KInsecure;
+    if ( iDrmApi->GetSecureTime( currTime, timeZone, secLevel ) != KErrNone )
+        {
+        __ASSERT_DEBUG( 0, Panic( EDiagFrameworkInternal ) );
+        // if we are unable to get DRM clock, use home clock.
+        currTime.UniversalTime();
+        }
+#endif // __DIAGFW_DISABLE_DRM_API
+		 currTime.UniversalTime(); // Added for Time Updation in HardwareSuiteView
+    return currTime;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::SetWasDependency
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbItemBuilder::SetWasDependency( TBool aWasDependency )
+    {
+    iDependencyExecution = aWasDependency;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::WasDependency
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagResultsDbItemBuilder::WasDependency() const
+    {
+    return iDependencyExecution;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::SetTestCompleted
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbItemBuilder::SetTestCompleted( 
+        CDiagResultsDatabaseItem::TResult aResult )
+    {
+    iResult = aResult;
+    SetTimeCompleted( GetCurrentTime() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::TestResult
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem::TResult CDiagResultsDbItemBuilder::TestResult() const
+    {
+    return iResult;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::SetTimeStarted
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbItemBuilder::SetTimeStarted( TTime aTime )
+    {
+    iStartTime = aTime;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::TimeStarted
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TTime CDiagResultsDbItemBuilder::TimeStarted() const
+    {
+    return iStartTime;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::SetTimeCompleted
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbItemBuilder::SetTimeCompleted( TTime aTime )
+    {
+    iEndTime = aTime;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::TimeCompleted
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TTime CDiagResultsDbItemBuilder::TimeCompleted() const
+    {
+    return iStartTime;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::SetResultDetail
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbItemBuilder::SetResultDetail( 
+        MDiagResultDetail* aResultDetail )
+    {
+    delete iResultDetail;
+    iResultDetail = aResultDetail;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::ResultDetail
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagResultDetail& CDiagResultsDbItemBuilder::ResultDetail() const
+    {
+    __ASSERT_ALWAYS( iResultDetail, Panic( EDiagFrameworkInvalidState ) );
+    return *iResultDetail;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::ToResultsDatabaseItemL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem* CDiagResultsDbItemBuilder::ToResultsDatabaseItemL() const
+    {
+    CBufFlat* detailsData = NULL;
+
+    if ( iResultDetail )
+        {
+        detailsData = iResultDetail->ExternalizeToBufferL();
+        }
+
+    return CDiagResultsDatabaseItem::NewL( iTestUid,
+                                           iDependencyExecution,
+                                           iResult,
+                                           iStartTime,
+                                           iEndTime,
+                                           detailsData ); // ownership tranferred.
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultsDbItemBuilder::CreateSimpleDbItemL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem* CDiagResultsDbItemBuilder::CreateSimpleDbItemL(
+        TUid aTestUid,
+        TBool aAsDependency,
+        CDiagResultsDatabaseItem::TResult aResultType )
+    {
+    CDiagResultsDbItemBuilder* resultBuilder = 
+        CDiagResultsDbItemBuilder::NewL( aTestUid,
+                                         aAsDependency );
+    resultBuilder->SetTestCompleted( aResultType );
+
+    CleanupStack::PushL( resultBuilder );
+    CDiagResultsDatabaseItem* dbItem = resultBuilder->ToResultsDatabaseItemL();
+    CleanupStack::PopAndDestroy( resultBuilder );
+
+    return dbItem;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagrootsuite.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,374 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagRootSuite
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagrootsuite.h"
+
+// SYSTEM INCLUDE FILES
+#include <DiagSuiteExecParam.h>     // TDiagSuiteExecParam
+#include <DiagSuiteObserver.h>      // MDiagSuiteObserver
+
+// USER INCLUDE FILES
+#include "diagframework.pan"        // panic codes.
+#include "diagrootsuite.h"          // CDiagRootSuite
+
+using namespace DiagFwInternal;
+
+// ======== LOCAL FUNCTIONS ========
+/**
+* Compares two plug-ins by order.  Used for RArray  InsertInOrderAllowRepeats
+* @param aFirst - first plug-in
+* @param aSecond - second plug-in
+* @return   positive if aFirst > aSecond
+*           0 if same.
+*           negative if aFirst < aSecond
+*/
+static TInt ComparePluginByOrder( const MDiagPlugin& aFirst,
+                                   const MDiagPlugin& aSecond )
+    {
+    return aFirst.Order() - aSecond.Order();
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagRootSuite::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagRootSuite::NewL()
+// ---------------------------------------------------------------------------
+//
+CDiagRootSuite* CDiagRootSuite::NewL()
+    {
+    CDiagRootSuite* self = CDiagRootSuite::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagRootSuite::NewLC()
+// ---------------------------------------------------------------------------
+//
+CDiagRootSuite* CDiagRootSuite::NewLC()
+    {
+    CDiagRootSuite* self = new( ELeave )CDiagRootSuite();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagRootSuite::CDiagRootSuite
+// ---------------------------------------------------------------------------
+//
+CDiagRootSuite::CDiagRootSuite()
+    :   iChildren()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagRootSuite::~CDiagRootSuite
+// ---------------------------------------------------------------------------
+//
+CDiagRootSuite::~CDiagRootSuite()
+    {
+    iChildren.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// from MDiagPlugin
+// CDiagRootSuite::GetPluginNameL
+// ---------------------------------------------------------------------------
+//
+HBufC* CDiagRootSuite::GetPluginNameL( TNameLayoutType /* aLayoutType */) const
+    {
+    _LIT( KRootSuitePluginName, "*Root Suite" );
+    return KRootSuitePluginName().AllocL();
+    }
+
+// ---------------------------------------------------------------------------
+// from MDiagPlugin
+// CDiagRootSuite::ServiceLogicalName
+// ---------------------------------------------------------------------------
+//
+const TDesC& CDiagRootSuite::ServiceLogicalName() const
+    {
+    _LIT( KRootSuiteServiceName, "" );
+    return KRootSuiteServiceName();
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::GetLogicalDependenciesL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::GetLogicalDependenciesL( CPtrCArray& /* aArray */ ) const
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::Type
+// ---------------------------------------------------------------------------
+//
+MDiagPlugin::TPluginType CDiagRootSuite::Type() const
+    {
+    return ETypeSuitePlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::CreateIconL
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CDiagRootSuite::CreateIconL() const
+    {
+    return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::IsVisible
+// ---------------------------------------------------------------------------
+//
+TBool CDiagRootSuite::IsVisible() const
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::IsSupported
+// ---------------------------------------------------------------------------
+//
+TBool CDiagRootSuite::IsSupported() const
+    {
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::GetTitleL
+// ---------------------------------------------------------------------------
+//
+HBufC* CDiagRootSuite::GetTitleL() const
+    {
+    // This should never be displayed to the end user.
+    _LIT( KRootSuitePluginTitle, "*Root Suite Title" );
+    return KRootSuitePluginTitle().AllocL();
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::GetDescriptionL
+// ---------------------------------------------------------------------------
+//
+HBufC* CDiagRootSuite::GetDescriptionL() const
+    {
+    // This should never be displayed to the end user.
+    _LIT( KRootSuitePluginDesc, "*Root Suite Desc" );
+    return KRootSuitePluginDesc().AllocL();
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::Uid
+// ---------------------------------------------------------------------------
+//
+TUid CDiagRootSuite::Uid() const
+    {
+    return TUid::Uid( 0 );
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::ParentUid
+// ---------------------------------------------------------------------------
+//
+TUid CDiagRootSuite::ParentUid() const
+    {
+    return TUid::Uid( 0 );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::SetDtorIdKey
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::SetDtorIdKey( TUid /* aDtorIdKey */ )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::CustomOperationL
+// ---------------------------------------------------------------------------
+//
+TAny* CDiagRootSuite::CustomOperationL( TUid /*aUid*/, TAny* /*aParam*/ )
+    {
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::GetCustomL
+// ---------------------------------------------------------------------------
+//
+TAny* CDiagRootSuite::GetCustomL( TUid /* aUid */, TAny* /*aParam*/ )
+    {
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagRootSuite::TestSessionBeginL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::TestSessionBeginL( MDiagEngineCommon& /* aEngine */,
+                                        TBool /* aSkipDependencyCheck */,
+                                        TAny* /* aCustomParams */ )
+    {
+    // nothing to do
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagRootSuite::CleanupL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::TestSessionEndL( MDiagEngineCommon& /* aEngine */,
+                                      TBool /* aSkipDependencyCheck */,
+                                      TAny* /* aCustomParams */ )
+    {
+    // nothing to do
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagRootSuite::Order
+// ---------------------------------------------------------------------------
+//
+TUint CDiagRootSuite::Order() const
+    {
+    return 0;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagRootSuite::GetChildrenL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                                   TSortOrder aOrder ) const
+    {
+    if ( aOrder != ENotSorted && aOrder != ESortByPosition )
+        User::Leave( KErrArgument );
+
+    for ( TInt i = 0; i < iChildren.Count(); i++ )
+        {
+        aChildren.AppendL( iChildren[i] );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagRootSuite::AddChildL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::AddChildL( MDiagPlugin* aChild )
+    {
+    TLinearOrder<MDiagPlugin> order( *ComparePluginByOrder );
+    User::LeaveIfError( iChildren.InsertInOrderAllowRepeats( aChild, order ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagRootSuite::PrepareChildrenExecutionL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::PrepareChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                                TBool /* aSkipDependencyCheck */,
+                                                TBool /* aDependencyExecution */ )
+    {
+    aParam->Observer().ContinueExecutionL( *this );
+    delete aParam;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagRootSuite::FinalizeExecutionL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::FinalizeChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                                 TBool /* aSkipDependencyCheck */,
+                                                 TBool /* aDependencyExecution */ )
+    {
+    aParam->Observer().ContinueExecutionL( *this );
+    delete aParam;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagRootSuite::GetChildrenUidsL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::GetChildrenUidsL( RArray<TUid>& aUids,
+                                        TSortOrder aOrder ) const
+    {
+    if ( aOrder != ENotSorted && aOrder != ESortByPosition )
+        User::Leave( KErrArgument );
+
+    for ( TInt i = 0; i < iChildren.Count(); i++ )
+        {
+        aUids.AppendL( iChildren[i]->Uid() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagRootSuite::ExecutionStopL
+// ---------------------------------------------------------------------------
+//
+void CDiagRootSuite::ExecutionStopL( TStopReason /* aReason */ )
+    {
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagframework/src/diagsuiteexecparam.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2007 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:  Class definition of TDiagSuiteExecParam
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagSuiteExecParam.h>
+
+// SYSTEM INCLUDE FILES
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// TDiagSuiteExecParam::TDiagSuiteExecParam()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TDiagSuiteExecParam::TDiagSuiteExecParam( MDiagSuiteObserver& aObserver,
+                                                    MDiagEngineCommon& aEngine )
+    :   iObserver( aObserver ),
+        iEngine( aEngine )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// TDiagSuiteExecParam::Observer()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagSuiteObserver& TDiagSuiteExecParam::Observer() const
+    {
+    return iObserver;
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDiagSuiteExecParam::Engine()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagEngineCommon& TDiagSuiteExecParam::Engine() const
+    {
+    return iEngine;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/bwins/diagpluginbase.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,89 @@
+EXPORTS
+	??0CDiagResultDetailBasic@@QAE@W4TResult@CDiagResultsDatabaseItem@@@Z @ 1 NONAME ; CDiagResultDetailBasic::CDiagResultDetailBasic(enum CDiagResultsDatabaseItem::TResult)
+	??0CDiagSuitePluginBase@@IAE@PAVCDiagPluginConstructionParam@@@Z @ 2 NONAME ; CDiagSuitePluginBase::CDiagSuitePluginBase(class CDiagPluginConstructionParam *)
+	??0CDiagTestPluginBase@@IAE@PAVCDiagPluginConstructionParam@@@Z @ 3 NONAME ; CDiagTestPluginBase::CDiagTestPluginBase(class CDiagPluginConstructionParam *)
+	??1CDiagPluginWaitingDialogWrapper@@UAE@XZ @ 4 NONAME ; CDiagPluginWaitingDialogWrapper::~CDiagPluginWaitingDialogWrapper(void)
+	??1CDiagResultDetailBasic@@UAE@XZ @ 5 NONAME ; CDiagResultDetailBasic::~CDiagResultDetailBasic(void)
+	??1CDiagSuitePluginBase@@UAE@XZ @ 6 NONAME ; CDiagSuitePluginBase::~CDiagSuitePluginBase(void)
+	??1CDiagTestPluginBase@@UAE@XZ @ 7 NONAME ; CDiagTestPluginBase::~CDiagTestPluginBase(void)
+	?AddChildL@CDiagSuitePluginBase@@UAEXPAVMDiagPlugin@@@Z @ 8 NONAME ; void CDiagSuitePluginBase::AddChildL(class MDiagPlugin *)
+	?AreDependenciesSatisfiedL@CDiagTestPluginBase@@MBEHAAVMDiagEngineCommon@@AAPAV?$RArray@VTUid@@@@@Z @ 9 NONAME ; int CDiagTestPluginBase::AreDependenciesSatisfiedL(class MDiagEngineCommon &, class RArray<class TUid> * &) const
+	?BaseConstructL@CDiagResultDetailBasic@@IAEXAAVRReadStream@@@Z @ 10 NONAME ; void CDiagResultDetailBasic::BaseConstructL(class RReadStream &)
+	?BaseConstructL@CDiagResultDetailBasic@@IAEXABVCBufFlat@@@Z @ 11 NONAME ; void CDiagResultDetailBasic::BaseConstructL(class CBufFlat const &)
+	?BaseConstructL@CDiagSuitePluginBase@@IAEXABVTDesC16@@@Z @ 12 NONAME ; void CDiagSuitePluginBase::BaseConstructL(class TDesC16 const &)
+	?BaseConstructL@CDiagTestPluginBase@@IAEXABVTDesC16@@@Z @ 13 NONAME ; void CDiagTestPluginBase::BaseConstructL(class TDesC16 const &)
+	?CoeEnv@CDiagSuitePluginBase@@IAEAAVCCoeEnv@@XZ @ 14 NONAME ; class CCoeEnv & CDiagSuitePluginBase::CoeEnv(void)
+	?CoeEnv@CDiagTestPluginBase@@IAEAAVCCoeEnv@@XZ @ 15 NONAME ; class CCoeEnv & CDiagTestPluginBase::CoeEnv(void)
+	?CompleteTestL@CDiagTestPluginBase@@IAEXW4TResult@CDiagResultsDatabaseItem@@@Z @ 16 NONAME ; void CDiagTestPluginBase::CompleteTestL(enum CDiagResultsDatabaseItem::TResult)
+	?CreateDetailL@CDiagTestPluginBase@@MBEPAVMDiagResultDetail@@ABVCDiagResultsDatabaseItem@@@Z @ 17 NONAME ; class MDiagResultDetail * CDiagTestPluginBase::CreateDetailL(class CDiagResultsDatabaseItem const &) const
+	?CreateIconL@CDiagResultDetailBasic@@UBEPAVCGulIcon@@XZ @ 18 NONAME ; class CGulIcon * CDiagResultDetailBasic::CreateIconL(void) const
+	?CreateIconL@CDiagSuitePluginBase@@UBEPAVCGulIcon@@XZ @ 19 NONAME ; class CGulIcon * CDiagSuitePluginBase::CreateIconL(void) const
+	?CreateIconL@CDiagTestPluginBase@@MBEPAVCGulIcon@@XZ @ 20 NONAME ; class CGulIcon * CDiagTestPluginBase::CreateIconL(void) const
+	?CustomOperationL@CDiagSuitePluginBase@@UAEPAXVTUid@@PAX@Z @ 21 NONAME ; void * CDiagSuitePluginBase::CustomOperationL(class TUid, void *)
+	?CustomOperationL@CDiagTestPluginBase@@MAEPAXVTUid@@PAX@Z @ 22 NONAME ; void * CDiagTestPluginBase::CustomOperationL(class TUid, void *)
+	?CustomParam@CDiagTestPluginBase@@IBEPAXXZ @ 23 NONAME ; void * CDiagTestPluginBase::CustomParam(void) const
+	?DismissWaitingDialog@CDiagSuitePluginBase@@IAEXXZ @ 24 NONAME ; void CDiagSuitePluginBase::DismissWaitingDialog(void)
+	?DismissWaitingDialog@CDiagTestPluginBase@@IAEXXZ @ 25 NONAME ; void CDiagTestPluginBase::DismissWaitingDialog(void)
+	?DoExecutionStopL@CDiagTestPluginBase@@MAEXW4TStopReason@MDiagTestPlugin@@AAW4TResult@CDiagResultsDatabaseItem@@@Z @ 26 NONAME ; void CDiagTestPluginBase::DoExecutionStopL(enum MDiagTestPlugin::TStopReason, enum CDiagResultsDatabaseItem::TResult &)
+	?ExecutionParam@CDiagTestPluginBase@@IAEAAVTDiagTestExecParam@@XZ @ 27 NONAME ; class TDiagTestExecParam & CDiagTestPluginBase::ExecutionParam(void)
+	?ExecutionStopL@CDiagSuitePluginBase@@UAEXW4TStopReason@MDiagSuitePlugin@@@Z @ 28 NONAME ; void CDiagSuitePluginBase::ExecutionStopL(enum MDiagSuitePlugin::TStopReason)
+	?ExecutionStopL@CDiagTestPluginBase@@MAEPAVCDiagResultsDatabaseItem@@W4TStopReason@MDiagTestPlugin@@@Z @ 29 NONAME ; class CDiagResultsDatabaseItem * CDiagTestPluginBase::ExecutionStopL(enum MDiagTestPlugin::TStopReason)
+	?ExternalizeL@CDiagResultDetailBasic@@QBEXAAVRWriteStream@@@Z @ 30 NONAME ; void CDiagResultDetailBasic::ExternalizeL(class RWriteStream &) const
+	?ExternalizeToBufferL@CDiagResultDetailBasic@@UBEPAVCBufFlat@@XZ @ 31 NONAME ; class CBufFlat * CDiagResultDetailBasic::ExternalizeToBufferL(void) const
+	?FinalizeChildrenExecutionL@CDiagSuitePluginBase@@UAEXPAVTDiagSuiteExecParam@@HH@Z @ 32 NONAME ; void CDiagSuitePluginBase::FinalizeChildrenExecutionL(class TDiagSuiteExecParam *, int, int)
+	?GetChildrenL@CDiagSuitePluginBase@@UBEXAAV?$RPointerArray@VMDiagPlugin@@@@W4TSortOrder@MDiagSuitePlugin@@@Z @ 33 NONAME ; void CDiagSuitePluginBase::GetChildrenL(class RPointerArray<class MDiagPlugin> &, enum MDiagSuitePlugin::TSortOrder) const
+	?GetChildrenUidsL@CDiagSuitePluginBase@@UBEXAAV?$RArray@VTUid@@@@W4TSortOrder@MDiagSuitePlugin@@@Z @ 34 NONAME ; void CDiagSuitePluginBase::GetChildrenUidsL(class RArray<class TUid> &, enum MDiagSuitePlugin::TSortOrder) const
+	?GetCustomL@CDiagSuitePluginBase@@UAEPAXVTUid@@PAX@Z @ 35 NONAME ; void * CDiagSuitePluginBase::GetCustomL(class TUid, void *)
+	?GetCustomL@CDiagTestPluginBase@@MAEPAXVTUid@@PAX@Z @ 36 NONAME ; void * CDiagTestPluginBase::GetCustomL(class TUid, void *)
+	?GetDescriptionL@CDiagSuitePluginBase@@UBEPAVHBufC16@@XZ @ 37 NONAME ; class HBufC16 * CDiagSuitePluginBase::GetDescriptionL(void) const
+	?GetDescriptionL@CDiagTestPluginBase@@MBEPAVHBufC16@@XZ @ 38 NONAME ; class HBufC16 * CDiagTestPluginBase::GetDescriptionL(void) const
+	?GetLogicalDependenciesL@CDiagSuitePluginBase@@UBEXAAVCPtrC16Array@@@Z @ 39 NONAME ; void CDiagSuitePluginBase::GetLogicalDependenciesL(class CPtrC16Array &) const
+	?GetLogicalDependenciesL@CDiagTestPluginBase@@MBEXAAVCPtrC16Array@@@Z @ 40 NONAME ; void CDiagTestPluginBase::GetLogicalDependenciesL(class CPtrC16Array &) const
+	?GetOutputL@CDiagResultDetailBasic@@UBEXW4TOutputFormat@MDiagResultDetail@@AAVRBuf16@@@Z @ 41 NONAME ; void CDiagResultDetailBasic::GetOutputL(enum MDiagResultDetail::TOutputFormat, class RBuf16 &) const
+	?GetSupportedOutput@CDiagResultDetailBasic@@UBEXAAV?$RArray@W4TOutputFormat@MDiagResultDetail@@@@@Z @ 42 NONAME ; void CDiagResultDetailBasic::GetSupportedOutput(class RArray<enum MDiagResultDetail::TOutputFormat> &) const
+	?GetTitleL@CDiagSuitePluginBase@@UBEPAVHBufC16@@XZ @ 43 NONAME ; class HBufC16 * CDiagSuitePluginBase::GetTitleL(void) const
+	?GetTitleL@CDiagTestPluginBase@@MBEPAVHBufC16@@XZ @ 44 NONAME ; class HBufC16 * CDiagTestPluginBase::GetTitleL(void) const
+	?GetValue@CDiagResultDetailBasic@@IBEHHAAH@Z @ 45 NONAME ; int CDiagResultDetailBasic::GetValue(int, int &) const
+	?GetValue@CDiagResultDetailBasic@@IBEHHAAVTPtrC16@@@Z @ 46 NONAME ; int CDiagResultDetailBasic::GetValue(int, class TPtrC16 &) const
+	?GetValue@CDiagResultDetailBasic@@IBEHHAAVTPtrC8@@@Z @ 47 NONAME ; int CDiagResultDetailBasic::GetValue(int, class TPtrC8 &) const
+	?IsDependencyCheckSkipped@CDiagTestPluginBase@@IBEHXZ @ 48 NONAME ; int CDiagTestPluginBase::IsDependencyCheckSkipped(void) const
+	?IsDependencyExecution@CDiagTestPluginBase@@IBEHXZ @ 49 NONAME ; int CDiagTestPluginBase::IsDependencyExecution(void) const
+	?IsOutputSupported@CDiagResultDetailBasic@@UBEHW4TOutputFormat@MDiagResultDetail@@@Z @ 50 NONAME ; int CDiagResultDetailBasic::IsOutputSupported(enum MDiagResultDetail::TOutputFormat) const
+	?IsSupported@CDiagSuitePluginBase@@UBEHXZ @ 51 NONAME ; int CDiagSuitePluginBase::IsSupported(void) const
+	?IsSupported@CDiagTestPluginBase@@MBEHXZ @ 52 NONAME ; int CDiagTestPluginBase::IsSupported(void) const
+	?NewL@CDiagPluginWaitingDialogWrapper@@SAPAV1@PAVCAknDialog@@@Z @ 53 NONAME ; class CDiagPluginWaitingDialogWrapper * CDiagPluginWaitingDialogWrapper::NewL(class CAknDialog *)
+	?Order@CDiagSuitePluginBase@@UBEIXZ @ 54 NONAME ; unsigned int CDiagSuitePluginBase::Order(void) const
+	?Order@CDiagTestPluginBase@@MBEIXZ @ 55 NONAME ; unsigned int CDiagTestPluginBase::Order(void) const
+	?ParentUid@CDiagSuitePluginBase@@UBE?AVTUid@@XZ @ 56 NONAME ; class TUid CDiagSuitePluginBase::ParentUid(void) const
+	?ParentUid@CDiagTestPluginBase@@MBE?AVTUid@@XZ @ 57 NONAME ; class TUid CDiagTestPluginBase::ParentUid(void) const
+	?PrepareChildrenExecutionL@CDiagSuitePluginBase@@UAEXPAVTDiagSuiteExecParam@@HH@Z @ 58 NONAME ; void CDiagSuitePluginBase::PrepareChildrenExecutionL(class TDiagSuiteExecParam *, int, int)
+	?ReportTestProgressL@CDiagTestPluginBase@@IAEXI@Z @ 59 NONAME ; void CDiagTestPluginBase::ReportTestProgressL(unsigned int)
+	?ResultsDbItemBuilder@CDiagTestPluginBase@@IAEAAVCDiagResultsDbItemBuilder@@XZ @ 60 NONAME ; class CDiagResultsDbItemBuilder & CDiagTestPluginBase::ResultsDbItemBuilder(void)
+	?ResumeL@CDiagTestPluginBase@@MAEXXZ @ 61 NONAME ; void CDiagTestPluginBase::ResumeL(void)
+	?RunError@CDiagTestPluginBase@@MAEHH@Z @ 62 NONAME ; int CDiagTestPluginBase::RunError(int)
+	?RunLD@CDiagPluginWaitingDialogWrapper@@QAEHAAH@Z @ 63 NONAME ; int CDiagPluginWaitingDialogWrapper::RunLD(int &)
+	?RunTestL@CDiagTestPluginBase@@MAEXPAVTDiagTestExecParam@@HHPAX@Z @ 64 NONAME ; void CDiagTestPluginBase::RunTestL(class TDiagTestExecParam *, int, int, void *)
+	?RunWaitingDialogL@CDiagSuitePluginBase@@IAEHPAVCAknDialog@@AAH@Z @ 65 NONAME ; int CDiagSuitePluginBase::RunWaitingDialogL(class CAknDialog *, int &)
+	?RunWaitingDialogL@CDiagTestPluginBase@@IAEHPAVCAknDialog@@AAH@Z @ 66 NONAME ; int CDiagTestPluginBase::RunWaitingDialogL(class CAknDialog *, int &)
+	?ServiceLogicalName@CDiagSuitePluginBase@@UBEABVTDesC16@@XZ @ 67 NONAME ; class TDesC16 const & CDiagSuitePluginBase::ServiceLogicalName(void) const
+	?ServiceLogicalName@CDiagTestPluginBase@@MBEABVTDesC16@@XZ @ 68 NONAME ; class TDesC16 const & CDiagTestPluginBase::ServiceLogicalName(void) const
+	?SetDtorIdKey@CDiagSuitePluginBase@@UAEXVTUid@@@Z @ 69 NONAME ; void CDiagSuitePluginBase::SetDtorIdKey(class TUid)
+	?SetDtorIdKey@CDiagTestPluginBase@@MAEXVTUid@@@Z @ 70 NONAME ; void CDiagTestPluginBase::SetDtorIdKey(class TUid)
+	?SetResult@CDiagResultDetailBasic@@QAEXW4TResult@CDiagResultsDatabaseItem@@@Z @ 71 NONAME ; void CDiagResultDetailBasic::SetResult(enum CDiagResultsDatabaseItem::TResult)
+	?SetValueL@CDiagResultDetailBasic@@IAEXHABVTDesC8@@0@Z @ 72 NONAME ; void CDiagResultDetailBasic::SetValueL(int, class TDesC8 const &, class TDesC8 const &)
+	?SetValueL@CDiagResultDetailBasic@@IAEXHABVTDesC8@@ABVTDesC16@@@Z @ 73 NONAME ; void CDiagResultDetailBasic::SetValueL(int, class TDesC8 const &, class TDesC16 const &)
+	?SetValueL@CDiagResultDetailBasic@@IAEXHABVTDesC8@@H@Z @ 74 NONAME ; void CDiagResultDetailBasic::SetValueL(int, class TDesC8 const &, int)
+	?StopAndCleanupL@CDiagTestPluginBase@@IAEXXZ @ 75 NONAME ; void CDiagTestPluginBase::StopAndCleanupL(void)
+	?SuspendL@CDiagTestPluginBase@@MAEXXZ @ 76 NONAME ; void CDiagTestPluginBase::SuspendL(void)
+	?TestSessionBeginL@CDiagSuitePluginBase@@UAEXAAVMDiagEngineCommon@@HPAX@Z @ 77 NONAME ; void CDiagSuitePluginBase::TestSessionBeginL(class MDiagEngineCommon &, int, void *)
+	?TestSessionBeginL@CDiagTestPluginBase@@MAEXAAVMDiagEngineCommon@@HPAX@Z @ 78 NONAME ; void CDiagTestPluginBase::TestSessionBeginL(class MDiagEngineCommon &, int, void *)
+	?TestSessionEndL@CDiagSuitePluginBase@@UAEXAAVMDiagEngineCommon@@HPAX@Z @ 79 NONAME ; void CDiagSuitePluginBase::TestSessionEndL(class MDiagEngineCommon &, int, void *)
+	?TestSessionEndL@CDiagTestPluginBase@@MAEXAAVMDiagEngineCommon@@HPAX@Z @ 80 NONAME ; void CDiagTestPluginBase::TestSessionEndL(class MDiagEngineCommon &, int, void *)
+	?Type@CDiagSuitePluginBase@@UBE?AW4TPluginType@MDiagPlugin@@XZ @ 81 NONAME ; enum MDiagPlugin::TPluginType CDiagSuitePluginBase::Type(void) const
+	?Type@CDiagTestPluginBase@@MBE?AW4TPluginType@MDiagPlugin@@XZ @ 82 NONAME ; enum MDiagPlugin::TPluginType CDiagTestPluginBase::Type(void) const
+	?SinglePluginExecution@CDiagTestPluginBase@@IBEHXZ @ 83 NONAME ; int CDiagTestPluginBase::SinglePluginExecution(void) const
+	?VerifyDependenciesL@CDiagTestPluginBase@@MBE?AW4TResult@CDiagResultsDatabaseItem@@AAVMDiagEngineCommon@@AAPAV?$RArray@VTUid@@@@@Z @ 84 NONAME ; enum CDiagResultsDatabaseItem::TResult CDiagTestPluginBase::VerifyDependenciesL(class MDiagEngineCommon &, class RArray<class TUid> * &) const
+	?ResetWatchdog@CDiagTestPluginBase@@IAEXHW4TResult@CDiagResultsDatabaseItem@@@Z @ 85 NONAME ; void CDiagTestPluginBase::ResetWatchdog(int, enum CDiagResultsDatabaseItem::TResult)
+	?ResetWatchdog@CDiagTestPluginBase@@IAEXW4TDiagEngineWatchdogTypes@@W4TResult@CDiagResultsDatabaseItem@@@Z @ 86 NONAME ; void CDiagTestPluginBase::ResetWatchdog(enum TDiagEngineWatchdogTypes, enum CDiagResultsDatabaseItem::TResult)
+	?ResetWatchdogToDefault@CDiagTestPluginBase@@IAEXXZ @ 87 NONAME ; void CDiagTestPluginBase::ResetWatchdogToDefault(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/eabi/diagpluginbase.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,156 @@
+EXPORTS
+	_ZN19CDiagTestPluginBase10GetCustomLE4TUidPv @ 1 NONAME
+	_ZN19CDiagTestPluginBase12SetDtorIdKeyE4TUid @ 2 NONAME
+	_ZN19CDiagTestPluginBase13CompleteTestLEN24CDiagResultsDatabaseItem7TResultE @ 3 NONAME
+	_ZN19CDiagTestPluginBase14BaseConstructLERK7TDesC16 @ 4 NONAME
+	_ZN19CDiagTestPluginBase14ExecutionParamEv @ 5 NONAME
+	_ZN19CDiagTestPluginBase14ExecutionStopLEN15MDiagTestPlugin11TStopReasonE @ 6 NONAME
+	_ZN19CDiagTestPluginBase15StopAndCleanupLEv @ 7 NONAME
+	_ZN19CDiagTestPluginBase15TestSessionEndLER17MDiagEngineCommoniPv @ 8 NONAME
+	_ZN19CDiagTestPluginBase16CustomOperationLE4TUidPv @ 9 NONAME
+	_ZN19CDiagTestPluginBase16DoExecutionStopLEN15MDiagTestPlugin11TStopReasonERN24CDiagResultsDatabaseItem7TResultE @ 10 NONAME
+	_ZN19CDiagTestPluginBase17RunWaitingDialogLEP10CAknDialogRi @ 11 NONAME
+	_ZN19CDiagTestPluginBase17TestSessionBeginLER17MDiagEngineCommoniPv @ 12 NONAME
+	_ZN19CDiagTestPluginBase19ReportTestProgressLEj @ 13 NONAME
+	_ZN19CDiagTestPluginBase20DismissWaitingDialogEv @ 14 NONAME
+	_ZN19CDiagTestPluginBase20ResultsDbItemBuilderEv @ 15 NONAME
+	_ZN19CDiagTestPluginBase6CoeEnvEv @ 16 NONAME
+	_ZN19CDiagTestPluginBase7ResumeLEv @ 17 NONAME
+	_ZN19CDiagTestPluginBase8RunErrorEi @ 18 NONAME
+	_ZN19CDiagTestPluginBase8RunTestLEP18TDiagTestExecParamiiPv @ 19 NONAME
+	_ZN19CDiagTestPluginBase8SuspendLEv @ 20 NONAME
+	_ZN19CDiagTestPluginBaseC2EP28CDiagPluginConstructionParam @ 21 NONAME
+	_ZN19CDiagTestPluginBaseD0Ev @ 22 NONAME
+	_ZN19CDiagTestPluginBaseD1Ev @ 23 NONAME
+	_ZN19CDiagTestPluginBaseD2Ev @ 24 NONAME
+	_ZN20CDiagSuitePluginBase10GetCustomLE4TUidPv @ 25 NONAME
+	_ZN20CDiagSuitePluginBase12SetDtorIdKeyE4TUid @ 26 NONAME
+	_ZN20CDiagSuitePluginBase14BaseConstructLERK7TDesC16 @ 27 NONAME
+	_ZN20CDiagSuitePluginBase14ExecutionStopLEN16MDiagSuitePlugin11TStopReasonE @ 28 NONAME
+	_ZN20CDiagSuitePluginBase15TestSessionEndLER17MDiagEngineCommoniPv @ 29 NONAME
+	_ZN20CDiagSuitePluginBase16CustomOperationLE4TUidPv @ 30 NONAME
+	_ZN20CDiagSuitePluginBase17RunWaitingDialogLEP10CAknDialogRi @ 31 NONAME
+	_ZN20CDiagSuitePluginBase17TestSessionBeginLER17MDiagEngineCommoniPv @ 32 NONAME
+	_ZN20CDiagSuitePluginBase20DismissWaitingDialogEv @ 33 NONAME
+	_ZN20CDiagSuitePluginBase25PrepareChildrenExecutionLEP19TDiagSuiteExecParamii @ 34 NONAME
+	_ZN20CDiagSuitePluginBase26FinalizeChildrenExecutionLEP19TDiagSuiteExecParamii @ 35 NONAME
+	_ZN20CDiagSuitePluginBase6CoeEnvEv @ 36 NONAME
+	_ZN20CDiagSuitePluginBase9AddChildLEP11MDiagPlugin @ 37 NONAME
+	_ZN20CDiagSuitePluginBaseC2EP28CDiagPluginConstructionParam @ 38 NONAME
+	_ZN20CDiagSuitePluginBaseD0Ev @ 39 NONAME
+	_ZN20CDiagSuitePluginBaseD1Ev @ 40 NONAME
+	_ZN20CDiagSuitePluginBaseD2Ev @ 41 NONAME
+	_ZN22CDiagResultDetailBasic14BaseConstructLER11RReadStream @ 42 NONAME
+	_ZN22CDiagResultDetailBasic14BaseConstructLERK8CBufFlat @ 43 NONAME
+	_ZN22CDiagResultDetailBasic9SetResultEN24CDiagResultsDatabaseItem7TResultE @ 44 NONAME
+	_ZN22CDiagResultDetailBasic9SetValueLEiRK6TDesC8RK7TDesC16 @ 45 NONAME
+	_ZN22CDiagResultDetailBasic9SetValueLEiRK6TDesC8S2_ @ 46 NONAME
+	_ZN22CDiagResultDetailBasic9SetValueLEiRK6TDesC8i @ 47 NONAME
+	_ZN22CDiagResultDetailBasicC1EN24CDiagResultsDatabaseItem7TResultE @ 48 NONAME
+	_ZN22CDiagResultDetailBasicC2EN24CDiagResultsDatabaseItem7TResultE @ 49 NONAME
+	_ZN22CDiagResultDetailBasicD0Ev @ 50 NONAME
+	_ZN22CDiagResultDetailBasicD1Ev @ 51 NONAME
+	_ZN22CDiagResultDetailBasicD2Ev @ 52 NONAME
+	_ZN31CDiagPluginWaitingDialogWrapper4NewLEP10CAknDialog @ 53 NONAME
+	_ZN31CDiagPluginWaitingDialogWrapper5RunLDERi @ 54 NONAME
+	_ZN31CDiagPluginWaitingDialogWrapperD0Ev @ 55 NONAME
+	_ZN31CDiagPluginWaitingDialogWrapperD1Ev @ 56 NONAME
+	_ZN31CDiagPluginWaitingDialogWrapperD2Ev @ 57 NONAME
+	_ZNK19CDiagTestPluginBase11CreateIconLEv @ 58 NONAME
+	_ZNK19CDiagTestPluginBase11CustomParamEv @ 59 NONAME
+	_ZNK19CDiagTestPluginBase11IsSupportedEv @ 60 NONAME
+	_ZNK19CDiagTestPluginBase13CreateDetailLERK24CDiagResultsDatabaseItem @ 61 NONAME
+	_ZNK19CDiagTestPluginBase15GetDescriptionLEv @ 62 NONAME
+	_ZNK19CDiagTestPluginBase18ServiceLogicalNameEv @ 63 NONAME
+	_ZNK19CDiagTestPluginBase21IsDependencyExecutionEv @ 64 NONAME
+	_ZNK19CDiagTestPluginBase23GetLogicalDependenciesLER12CPtrC16Array @ 65 NONAME
+	_ZNK19CDiagTestPluginBase24IsDependencyCheckSkippedEv @ 66 NONAME
+	_ZNK19CDiagTestPluginBase25AreDependenciesSatisfiedLER17MDiagEngineCommonRP6RArrayI4TUidE @ 67 NONAME
+	_ZNK19CDiagTestPluginBase4TypeEv @ 68 NONAME
+	_ZNK19CDiagTestPluginBase5OrderEv @ 69 NONAME
+	_ZNK19CDiagTestPluginBase9GetTitleLEv @ 70 NONAME
+	_ZNK19CDiagTestPluginBase9ParentUidEv @ 71 NONAME
+	_ZNK20CDiagSuitePluginBase11CreateIconLEv @ 72 NONAME
+	_ZNK20CDiagSuitePluginBase11IsSupportedEv @ 73 NONAME
+	_ZNK20CDiagSuitePluginBase12GetChildrenLER13RPointerArrayI11MDiagPluginEN16MDiagSuitePlugin10TSortOrderE @ 74 NONAME
+	_ZNK20CDiagSuitePluginBase15GetDescriptionLEv @ 75 NONAME
+	_ZNK20CDiagSuitePluginBase16GetChildrenUidsLER6RArrayI4TUidEN16MDiagSuitePlugin10TSortOrderE @ 76 NONAME
+	_ZNK20CDiagSuitePluginBase18ServiceLogicalNameEv @ 77 NONAME
+	_ZNK20CDiagSuitePluginBase23GetLogicalDependenciesLER12CPtrC16Array @ 78 NONAME
+	_ZNK20CDiagSuitePluginBase4TypeEv @ 79 NONAME
+	_ZNK20CDiagSuitePluginBase5OrderEv @ 80 NONAME
+	_ZNK20CDiagSuitePluginBase9GetTitleLEv @ 81 NONAME
+	_ZNK20CDiagSuitePluginBase9ParentUidEv @ 82 NONAME
+	_ZNK22CDiagResultDetailBasic10GetOutputLEN17MDiagResultDetail13TOutputFormatER6RBuf16 @ 83 NONAME
+	_ZNK22CDiagResultDetailBasic11CreateIconLEv @ 84 NONAME
+	_ZNK22CDiagResultDetailBasic12ExternalizeLER12RWriteStream @ 85 NONAME
+	_ZNK22CDiagResultDetailBasic17IsOutputSupportedEN17MDiagResultDetail13TOutputFormatE @ 86 NONAME
+	_ZNK22CDiagResultDetailBasic18GetSupportedOutputER6RArrayIN17MDiagResultDetail13TOutputFormatEE @ 87 NONAME
+	_ZNK22CDiagResultDetailBasic20ExternalizeToBufferLEv @ 88 NONAME
+	_ZNK22CDiagResultDetailBasic8GetValueEiR6TPtrC8 @ 89 NONAME
+	_ZNK22CDiagResultDetailBasic8GetValueEiR7TPtrC16 @ 90 NONAME
+	_ZNK22CDiagResultDetailBasic8GetValueEiRi @ 91 NONAME
+	_ZTI19CDiagTestPluginBase @ 92 NONAME ; #<TI>#
+	_ZTI20CDiagSuitePluginBase @ 93 NONAME ; #<TI>#
+	_ZTI22CDiagResultDetailBasic @ 94 NONAME ; #<TI>#
+	_ZTI26CDiagResultDetailBasicItem @ 95 NONAME ; #<TI>#
+	_ZTI31CDiagPluginWaitingDialogWrapper @ 96 NONAME ; #<TI>#
+	_ZTV19CDiagTestPluginBase @ 97 NONAME ; #<VT>#
+	_ZTV20CDiagSuitePluginBase @ 98 NONAME ; #<VT>#
+	_ZTV22CDiagResultDetailBasic @ 99 NONAME ; #<VT>#
+	_ZTV26CDiagResultDetailBasicItem @ 100 NONAME ; #<VT>#
+	_ZTV31CDiagPluginWaitingDialogWrapper @ 101 NONAME ; #<VT>#
+	_ZThn28_N19CDiagTestPluginBase10GetCustomLE4TUidPv @ 102 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase12SetDtorIdKeyE4TUid @ 103 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase14ExecutionStopLEN15MDiagTestPlugin11TStopReasonE @ 104 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase15TestSessionEndLER17MDiagEngineCommoniPv @ 105 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase16CustomOperationLE4TUidPv @ 106 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase17TestSessionBeginLER17MDiagEngineCommoniPv @ 107 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase7ResumeLEv @ 108 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase8RunTestLEP18TDiagTestExecParamiiPv @ 109 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBase8SuspendLEv @ 110 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBaseD0Ev @ 111 NONAME ; #<thunk>#
+	_ZThn28_N19CDiagTestPluginBaseD1Ev @ 112 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase10GetCustomLE4TUidPv @ 113 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase12SetDtorIdKeyE4TUid @ 114 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase14ExecutionStopLEN16MDiagSuitePlugin11TStopReasonE @ 115 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase15TestSessionEndLER17MDiagEngineCommoniPv @ 116 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase16CustomOperationLE4TUidPv @ 117 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase17TestSessionBeginLER17MDiagEngineCommoniPv @ 118 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase25PrepareChildrenExecutionLEP19TDiagSuiteExecParamii @ 119 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase26FinalizeChildrenExecutionLEP19TDiagSuiteExecParamii @ 120 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBase9AddChildLEP11MDiagPlugin @ 121 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBaseD0Ev @ 122 NONAME ; #<thunk>#
+	_ZThn28_N20CDiagSuitePluginBaseD1Ev @ 123 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase11CreateIconLEv @ 124 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase11IsSupportedEv @ 125 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase13CreateDetailLERK24CDiagResultsDatabaseItem @ 126 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase15GetDescriptionLEv @ 127 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase18ServiceLogicalNameEv @ 128 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase23GetLogicalDependenciesLER12CPtrC16Array @ 129 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase4TypeEv @ 130 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase5OrderEv @ 131 NONAME ; #<thunk>#
+	_ZThn28_NK19CDiagTestPluginBase9ParentUidEv @ 132 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase11CreateIconLEv @ 133 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase11IsSupportedEv @ 134 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase12GetChildrenLER13RPointerArrayI11MDiagPluginEN16MDiagSuitePlugin10TSortOrderE @ 135 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase15GetDescriptionLEv @ 136 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase16GetChildrenUidsLER6RArrayI4TUidEN16MDiagSuitePlugin10TSortOrderE @ 137 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase18ServiceLogicalNameEv @ 138 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase23GetLogicalDependenciesLER12CPtrC16Array @ 139 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase4TypeEv @ 140 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase5OrderEv @ 141 NONAME ; #<thunk>#
+	_ZThn28_NK20CDiagSuitePluginBase9ParentUidEv @ 142 NONAME ; #<thunk>#
+	_ZThn4_N22CDiagResultDetailBasicD0Ev @ 143 NONAME ; #<thunk>#
+	_ZThn4_N22CDiagResultDetailBasicD1Ev @ 144 NONAME ; #<thunk>#
+	_ZThn4_NK22CDiagResultDetailBasic10GetOutputLEN17MDiagResultDetail13TOutputFormatER6RBuf16 @ 145 NONAME ; #<thunk>#
+	_ZThn4_NK22CDiagResultDetailBasic11CreateIconLEv @ 146 NONAME ; #<thunk>#
+	_ZThn4_NK22CDiagResultDetailBasic17IsOutputSupportedEN17MDiagResultDetail13TOutputFormatE @ 147 NONAME ; #<thunk>#
+	_ZThn4_NK22CDiagResultDetailBasic18GetSupportedOutputER6RArrayIN17MDiagResultDetail13TOutputFormatEE @ 148 NONAME ; #<thunk>#
+	_ZThn4_NK22CDiagResultDetailBasic20ExternalizeToBufferLEv @ 149 NONAME ; #<thunk>#
+	_ZNK19CDiagTestPluginBase21SinglePluginExecutionEv @ 150 NONAME
+	_ZNK19CDiagTestPluginBase19VerifyDependenciesLER17MDiagEngineCommonRP6RArrayI4TUidE @ 151 NONAME
+	_ZN19CDiagTestPluginBase13ResetWatchdogE24TDiagEngineWatchdogTypesN24CDiagResultsDatabaseItem7TResultE @ 152 NONAME
+	_ZN19CDiagTestPluginBase13ResetWatchdogEiN24CDiagResultsDatabaseItem7TResultE @ 153 NONAME
+	_ZN19CDiagTestPluginBase22ResetWatchdogToDefaultEv @ 154 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for Diagnostics Plug-in Base Classes
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/diagplugincommon.loc         MW_LAYER_PLATFORM_EXPORT_PATH( diagplugincommon.loc )
+
+PRJ_MMPFILES
+diagpluginbase.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/group/diagpluginbase.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification for DiagPluginBase.dll
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET      diagpluginbase.dll
+TARGETTYPE  dll
+
+UID	        0x1000008d 0x2000afe9
+
+CAPABILITY  CAP_GENERAL_DLL
+VENDORID    VID_DEFAULT
+
+SOURCEPATH  ../src
+SOURCE      diagtestpluginbase.cpp
+SOURCE      diagsuitepluginbase.cpp
+SOURCE      diagresultdetailbasic.cpp
+SOURCE      diagresultdetailbasicitem.cpp
+SOURCE      diagpluginbaseutils.cpp
+SOURCE      diagpluginwaitingdialogwrapper.cpp
+
+// User Include
+USERINCLUDE ../inc
+
+// System Include Paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY     euser.lib
+LIBRARY     ecom.lib
+LIBRARY     efsrv.lib
+LIBRARY     bafl.lib
+LIBRARY     cone.lib            // CCoeEnv
+LIBRARY     commonengine.lib
+LIBRARY     estor.lib           // RBufReadStream
+LIBRARY     flogger.lib         // logging
+LIBRARY     eikdlg.lib          // CEikDialog
+LIBRARY     diagframework.lib
+LIBRARY     diagresultsdatabase.lib
+
+#if defined(WINSCW)
+    deffile ../bwins/diagpluginbase.def
+#else
+    deffile ../eabi/diagpluginbase.def
+#endif
+
+nostrictdef 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/group/diagpluginbase_uid_.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of diagnostics components
+*
+*/
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x1000008d,0x2000afe9,EPriorityForeground,0x000ffffeu,0x00000000u,0x2000afe9,0x101fb657,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagpluginbase.pan	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2007 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:  Enum definition of Framdwork Panic Codes
+*
+*/
+
+
+#ifndef DIAGPLUGINBASE_PAN
+#define DIAGPLUGINBASE_PAN
+
+/**
+* Panic Codes for Diagnostics PluginBase
+* 
+* @since 5.0
+*/
+enum TDiagPluginBasePanics
+    {
+    EDiagPluginBasePanicConstruction     = 1,   // Failed to construct
+    EDiagPluginBasePanicBadArgument      = 2,   // Invalid input parameter
+    EDiagPluginBasePanicDialogAlreadyUp  = 3,   // Another dialog is already being displayed.
+    EDiagPluginBasePanicInternal         = 4,   // Base class internal error
+    EDiagPluginBasePanicInvalidState     = 5    // Function called in invalid state.
+    };
+
+
+_LIT( KDiagPluginBaseCategory, "Diag Plugin Base" );
+
+inline void Panic( TDiagPluginBasePanics aReason )
+    {
+    User::Panic( KDiagPluginBaseCategory, aReason );
+    }
+
+#endif // DIAGPLUGINBASE_PAN
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagpluginbaseutils.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2007 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:  Utility functions for plug-ins
+*
+*/
+
+
+#ifndef DIAGPLUGINBASEUTILS_H
+#define DIAGPLUGINBASEUTILS_H
+
+// INCLUDES
+
+// FORWARD DECLARATIONS
+class RConeResourceLoader;
+
+// CONSTANTS
+
+/**
+*  Diagnostics Plugin Base Utility Functions
+*
+*   Collection of various useful functions.
+*
+*  @since S60 v5.0
+*/
+
+namespace DiagPluginBaseUtils
+    {
+void OpenResourceFileL( const TDesC& aResourceFileName,
+                        RConeResourceLoader& aResourceLoader,
+                        RFs& aFsSession );
+    }   // namespace DiagPluginBaseUtils
+
+#endif // DIAGPLUGINBASEUTILS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagplugincommon.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2007 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:  Localization strings for project Diagnostics Plugin
+*
+*/
+
+
+// d:Softkey text for Skip
+// l:control_pane_t1/opt7
+// r:3.2
+//
+#define qtn_diag_softk_skip "Skip"
+
+
+// d:Message for remove cables
+// l:popup_note_window
+// r:3.2
+//
+#define qtn_diag_msg_remove_all_cables "Please remove all cables"
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagpluginwaitingdialogwrapper.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2007 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:  Provides wrapper for waiting dialogs.
+*
+*/
+
+
+#ifndef DIAGPLUGINWAITINGDIALOGWRAPPER_H
+#define DIAGPLUGINWAITINGDIALOGWRAPPER_H
+
+// INCLUDES
+#include <e32base.h>                // CBase
+
+// FORWARD DECLARATIONS
+class CAknDialog;
+
+/**
+*  Diagnostics Plugin Waiting Dialog Wrapper.
+*
+*   This class provides a wrapper for executing dialogs. The only functionality
+*   it adds is that it provides a way for the caller to find out whether
+*   the dialog was dismissed by the user response, or by application deletion.
+*
+*  @since S60 v5.0
+*/
+class CDiagPluginWaitingDialogWrapper : public CBase
+    {
+public: // new API
+    /**
+    * Two-phased constructor.
+    *
+    *   @param - aWaitingDialog.  Pointer to dialog to display. Note that 
+    *       it must be a dialog with EEikDialogFlagWait set. Otherwise, it 
+    *       will panic with EDiagPluginBasePanicBadArgument
+    *       Ownership is transferred to the wrapper.
+    *   @return - New instance of CDiagPluginWaitingDialogWrapper
+    */
+    IMPORT_C static CDiagPluginWaitingDialogWrapper* NewL( CAknDialog* aWaitingDialog );
+    
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagPluginWaitingDialogWrapper();
+
+    /**
+    * Run a dialog that waits for response. 
+    *
+    * To dismiss the dialog, simply delete CDiagPluginWaitingDialogWrapper instance.
+    *
+    * The difference from normal dialog RunLD is that this function returns 
+    * ETrue if dialog exited due to user response and 
+    * EFalse if the object was deleted.
+    * 
+    *   !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING  !!!!
+    *   !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!!
+    *   !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY.    !!!!
+    * 
+    * The normal dialog response is returned via aDialogResponse parameter.
+    *
+    * @param aDialogResponse - Response from the dialog.  
+    *   For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes
+    *   The only exception is that if cancel is pressed, it will be 0.
+    * @return ETrue if dialog is exiting due to user response.
+    *   Efalse if dialog is dismissed without user input. 
+    *   If EFalse is returned, plug-in MUST NOT act on the response.
+    */
+    IMPORT_C TBool RunLD( TInt& aDialogResponse );
+
+private:    // private interface
+    /**
+    * C++ Constructor
+    *   
+    *   @param - aWaitingDialog.  Pointer to dialog to display. Note that 
+    *       it must be a dialog with EEikDialogFlagWait set. Otherwise, it 
+    *       will panic with EDiagPluginBasePanicBadArgument
+    *       Ownership is transferred to the wrapper.
+    */
+    CDiagPluginWaitingDialogWrapper( CAknDialog* aWaitingDialog );
+
+private:    // Private Data
+    /**
+    * Pointer to the dialog being displayed.
+    * Ownership: Shared. Normally, dialog will dismiss itself. However,
+    * if plug-in is being deleted, it can be deleted by the plug-in as well.
+    */
+    CAknDialog* iWaitingDialog;
+
+    /**
+    * Indicates whether this class is deleted by caller.
+    * Ownership: Not owned. Normally, it will point to a stack entry.
+    */
+    TBool* iIsObjectDeletedPtr;
+    };
+
+#endif // DIAGTESTPLUGINBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagresultdetailbasic.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2007 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:  Basic Diagnostics Test Result Detail class
+*
+*/
+
+
+#ifndef DIAGRESULTDETAILBASIC_H
+#define DIAGRESULTDETAILBASIC_H
+
+// INCLUDES
+#include <e32base.h>                    // CBase
+#include <DiagResultDetail.h>           // MDiagResultDetail
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem::TResult
+
+// FORWARD DECLARATIONS
+class CDiagResultDetailBasicItem;
+
+
+// CONSTANTS
+const TInt KDiagResultDetailBasicVersion  = 1;   // verion of data format.
+
+/**
+*  Diagnostics Result Database Detail  class.
+*
+*  This  class provides  implementation of MDiagResultDetail 
+*  with commonly used methods.
+*
+*  @since S60 v5.0
+*/
+class CDiagResultDetailBasic : public CBase,
+                               public MDiagResultDetail
+    {
+public:
+    /**
+    * Constructor.
+    *
+    * @param aResult - Test Result
+    */
+    IMPORT_C CDiagResultDetailBasic( 
+                    CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagResultDetailBasic();
+
+    /**
+    * Externalize to a stream
+    *
+    * @param aWriteStream - stream to write to.
+    */
+    IMPORT_C void ExternalizeL( RWriteStream& aWriteStream ) const;
+
+    /**
+    * Update result value
+    * 
+    * @param aResult - Test result
+    */
+    IMPORT_C void SetResult( CDiagResultsDatabaseItem::TResult aResult );
+
+protected: // Interface for Derived class
+    /**
+    * Set data to a field.  This function sets a value to a field.
+    * If data already exists at the same field id, new data will 
+    * over write the old value at the same field.
+    *
+    * @param aFieldId - Unique ID to identify the data.
+    * @param aFieldName - Name of the field. This only for a 
+    *   reference.
+    * @param aValue - Value to set. This can be a TInt,
+    *   const TDesC8& or const TDesC16&.
+    */
+    IMPORT_C void SetValueL( TInt aFieldId,
+                             const TDesC8& aFieldName,
+                             TInt aValue );
+    IMPORT_C void SetValueL( TInt aFieldId,
+                             const TDesC8& aFieldName,
+                             const TDesC8& aValue );
+    IMPORT_C void SetValueL( TInt aFieldId,
+                             const TDesC8& aFieldName,
+                             const TDesC16& aValue );
+
+    /**
+    * Get value. If invalid aFieldId is passed, or type does not 
+    * match, function will leave with KErrArgument. 
+    *
+    * @param aFieldId - Unique id that identifies the data. Same
+    *   value used in SetValueL function.
+    * @param aValue - Output paramater. The data will be stored
+    *   here.
+    * @return KErrNone if successful. If not found KErrNotFound.
+    *   If type does not match, KErrArgument.
+    */
+    IMPORT_C TInt GetValue( TInt aFieldId, TInt& aValue ) const;
+    IMPORT_C TInt GetValue( TInt aFieldId, TPtrC8& aValue ) const;
+    IMPORT_C TInt GetValue( TInt aFieldId, TPtrC16& aValue ) const;
+
+public: // from MDiagResultDetail
+    /**
+    * Get list of supported output
+    *
+    * @param aOutputList   - Returns supported output formats
+    */
+    IMPORT_C virtual void GetSupportedOutput(
+                RArray<TOutputFormat>& aOutputList ) const;
+
+    /**
+    * Check if a given output format is supported.
+    *
+    * @param aOutputFormat - Possible output formate.
+    * @return ETrue if supported. EFalse otherwise.
+    */
+    IMPORT_C virtual TBool IsOutputSupported( TOutputFormat aOutputFormat ) const;
+
+    /**
+    * Output current result to a specified format.
+    *
+    * @param aFormat   Format of desired output.
+    * @param aBuffer   Output buffer.
+    */
+    IMPORT_C virtual void GetOutputL( TOutputFormat aFormat, RBuf& aBuffer ) const;
+
+    /**
+    * Create an icon. Icon can be created based on the results of the test.
+    *
+    * @return An icon that matches the result of the test.
+    **/
+    IMPORT_C virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * Externalize to a CBufFlat. 
+    *   @see MDiagResultDetail::ExternalizeToBufferL
+    */
+    IMPORT_C CBufFlat* ExternalizeToBufferL() const;
+
+protected:
+    /**
+    * BaseConstructL
+    *
+    * @param aReadStream - Initialize from a stream.
+    */
+    IMPORT_C void BaseConstructL( RReadStream& aReadStream );
+
+    /**
+    * BaseConstructL
+    *
+    * @param aBuffer - Buffer to initialize from
+    */
+    IMPORT_C void BaseConstructL( const CBufFlat& aBuffer );
+
+
+private:  // internal methods
+    /**
+    * InternalizeL
+    *
+    * @param aReadStream - Initialize from a stream.
+    */
+    void InternalizeL( RReadStream& aReadStream );
+
+    /**
+    * Insert a new item. This function will delete the old item if item with 
+    * same field id already existsed.
+    *
+    * @param aNewItem - new item to set
+    */
+    void SetItemL( CDiagResultDetailBasicItem* aNewItem );
+
+    /**
+    * Find item by field id
+    *
+    * @param - Field id to look up.
+    * @return - Index in iFields array if look up is successful.
+    *   Return value is negative if look up fails.
+    */
+    TInt FindItem( TInt aFieldId ) const;
+
+
+private: // DATA
+    /**
+    * Test result.
+    */
+    CDiagResultsDatabaseItem::TResult            iResult;
+    
+    /**
+    * List of fields it contains.
+    *   All items are owned by this class.
+    */
+    RPointerArray<CDiagResultDetailBasicItem>    iFields;
+    };
+
+
+
+#endif // DIAGRESULTDETAILBASIC_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagresultdetailbasicitem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2007 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:  Basic Diagnostics Test Result Detail Item class
+*
+*/
+
+
+#ifndef DIAGRESULTDETAILBASICITEM_H
+#define DIAGRESULTDETAILBASICITEM_H
+
+// INCLUDES
+#include <e32base.h>                     //  CBase
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+
+/**
+*  Diagnostics Result Database Detail  Item Classe.
+*
+*  This  class stores information needed for each entry in
+*  CDiagResultDetailBasic.
+*
+*  @since S60 v5.0
+*/
+class CDiagResultDetailBasicItem : public CBase
+    {
+public: // Data Types
+    enum TFieldType 
+        {
+        ETypeInt    = 0,    // data is TInt type
+        ETypeDes16,         // data is TDesC16 type
+        ETypeDes8,          // data is TDesC8 type
+        };
+
+public: // Constructors
+    /**
+    * Two-phase constructor.
+    *
+    * @param aFieldId   - Field Id.
+    * @param aFieldName - Textual description of the field.
+    * @param aValue     - TInt value.
+    */
+    static CDiagResultDetailBasicItem* NewL( TInt aFieldId,
+                                             const TDesC8& aFieldName,
+                                             TInt aValue );
+
+    /**
+    * Two-phase constructor.
+    *
+    * @param aFieldId   - Field Id.
+    * @param aFieldName - Textual description of the field.
+    * @param aValue     - TDesC8 Text value.
+    */
+    static CDiagResultDetailBasicItem* NewL( TInt aFieldId,
+                                             const TDesC8& aFieldName,
+                                             const TDesC8& aValue );
+
+    /**
+    * Two-phase constructor.
+    *
+    * @param aFieldId   - Field Id
+    * @param aFieldName - Textual description of the field.
+    * @param aValue     - TDesC16 Text value.
+    */
+    static CDiagResultDetailBasicItem* NewL( TInt aFieldId,
+                                                const TDesC8& aFieldName,
+                                                const TDesC16& aValue );
+
+    /**
+    * Two-phase constructor with RReadStream
+    *
+    * @param aReadStream - stream to internalize from
+    */
+    static CDiagResultDetailBasicItem* NewL( RReadStream& aReadStream );
+
+    /**
+    * Destructor
+    */
+    ~CDiagResultDetailBasicItem();
+
+    /**
+    * Get the field Id.
+    *
+    * @return Field Id.
+    */
+    TInt FieldId() const;
+
+    /**
+    * Get the name of the field. 
+    *
+    * @return Name of the field.
+    */
+    const TDesC8& FieldName() const;
+
+    /**
+    * Get the type of the field.
+    *
+    * @return Type of the field. 
+    */
+    TFieldType Type() const;
+
+    /**
+    * Get value. If invalid aFieldId is passed, or type does not 
+    * match, function will leave with KErrArgument. 
+    *
+    * @param aValue - Output paramater. The data will be stored
+    *   here.
+    * @param KErrArgument if type does not match
+    */
+    TInt GetValue( TInt& aValue ) const;
+    TInt GetValue( TPtrC8& aValue ) const;
+    TInt GetValue( TPtrC16& aValue ) const;
+
+    /**
+    * Externalize to a stream.
+    *
+    */
+    void ExternalizeL( RWriteStream& aWriteStream ) const;
+
+private:  
+    /**
+    * Constructor 
+    *
+    */
+    CDiagResultDetailBasicItem();
+
+    /**
+    * Internalize from stream.
+    *
+    * @param aReadStream - stream to read from.
+    */
+    void InternalizeL( RReadStream& aReadStream );
+
+
+private: // Private Data Types
+    
+    typedef union 
+        {
+        HBufC16*    iBuffer16;
+        HBufC8*     iBuffer8;
+        TInt        iInt;
+        } TValue;
+
+private: // Data
+    TFieldType  iFieldType;
+    TInt        iFieldId;
+    TValue      iValue;
+    HBufC8*     iFieldName;
+    };
+
+#endif // DIAGRESULTDETAILBASICITEM_h
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagsuitepluginbase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Suite Plug-in Base class
+*
+*/
+
+
+#ifndef DIAGSUITEPLUGINBASE_H
+#define DIAGSUITEPLUGINBASE_H
+
+// INCLUDES
+#include <e32cmn.h>             // TUid
+#include <DiagSuitePlugin.h>    // MDiagSuitePlugin
+#include <ConeResLoader.h>      // RConeResourceLoader
+
+// FORWARD DECLARATIONSn
+class CDiagPluginConstructionParam;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Suite Plugin Base Class
+*
+*  This base class provides common implementation of Suite Plugin.
+*
+*  @since S60 v5.0
+*/
+class CDiagSuitePluginBase : public CActive,
+                             public MDiagSuitePlugin
+    {
+public:
+    /**
+    * Destructor. 
+    */
+    IMPORT_C virtual ~CDiagSuitePluginBase();
+
+protected:  // new API for derived class.
+    /**
+    * C++ constructor
+    * 
+    * @param aConstructionParam Construction parameters.
+    */
+    IMPORT_C CDiagSuitePluginBase( CDiagPluginConstructionParam* aParam );
+    
+    /**
+    * Base class constructor
+    * This initializes CDiagSuitePluginBase class. Derived class must call this
+    * method in its ConstructL() method.
+    *  
+    * @param aResourceFileName Drive and name of resource file in format
+    *                          <path>:<rsc_file_name>
+    */
+    IMPORT_C void BaseConstructL( const TDesC& aResourceFileName );
+
+    /**
+    * Run a dialog that waits for response. It is highly recommended that
+    * all plug-ins use this function to display dialogs since it can detect
+    * deletion of dialogs.
+    *
+    * The difference from normal dialog RunLD is that this function returns 
+    * ETrue if dialog exited due to user response and 
+    * EFalse if it was by other means, such as object deletion or
+    * by DismissWaitingDialog() method. 
+    * 
+    *   !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING  !!!!
+    *   !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!!
+    *   !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY.    !!!!
+    * 
+    * The normal dialog response is returned via aDialogResponse reference.
+    * This function can only display one dialog at a time. Calling it again 
+    * while it has not been returned will cause panic.
+    *
+    * @param aDialog - Pointer to dialog to run. If the dialog does not have
+    *   EEikDialogFlagWait flag set, it will panic with EDiagPluginBasePanicBadArgument
+    * @param aDialogResponse - Response from the dialog.  
+    *   For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes
+    *   The only exception is that if cancel is pressed, it will be 0.
+    * @return ETrue if dialog is exiting due to user response.
+    *   Efalse if dialog is dismissed withou user input. 
+    *   If EFalse is returned, plug-in MUST NOT act on the response.
+    *   Also, since plug-in may have been deleted,
+    */
+    IMPORT_C TBool RunWaitingDialogL( CAknDialog* aDialog, TInt& aDialogResponse );
+
+    /**
+    * Dismiss the waiting dialog. This will cause the RunDialogLD() function to return with
+    * aIsUserResponse = Efalse. If nothing is being displayed, this function
+    * does nothing.
+    */
+    IMPORT_C void DismissWaitingDialog();
+
+    /**
+    * CCoeEnv
+    *   @return Reference to CCoeEnv.
+    */
+    IMPORT_C CCoeEnv& CoeEnv();
+
+public: // from MDiagPlugin
+    /**
+    * Get the name of the service that the plug-in provides.
+    *
+    * @return The name of the service.
+    **/
+    IMPORT_C virtual const TDesC& ServiceLogicalName() const;
+
+    /**
+    * Get logical dependencies. One plug-in can have multiple dependencies 
+    * to other plug-ins.
+    *
+    * @param aArray An array of logical names.
+    * @see ServiceLogicalName.
+    **/
+    IMPORT_C virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const;
+
+    /**
+    * Return the type of the plug-in. 
+    *
+    * @return The type.
+    * @see TPluginType.
+    **/
+    IMPORT_C virtual TPluginType Type() const;
+
+    /**
+    * Create an icon that represents the plug-in.
+    *
+    * @return An icon. 
+    **/
+    IMPORT_C virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * Get the order number that this plug-in should appear in its parent list.
+    *
+    * @return TUint order number.
+    **/
+    IMPORT_C virtual TUint Order() const;
+
+    /**
+    * @see MDiagPlugin::IsSupported
+    **/
+    IMPORT_C virtual TBool IsSupported() const;
+
+    /**
+    * Get UID of the parent.
+    *
+    * @return The parent UID.
+    **/
+    IMPORT_C virtual TUid ParentUid() const;
+
+    /**
+    * @see MDiagPlugin::SetDTorIdKey()
+    */
+    IMPORT_C virtual void SetDtorIdKey( TUid aDtorIdKey );
+
+    /**
+    * Get title of the plugin. Default implementation in CDiagSuitePluginBase
+    *   will leave with KErrNotSupported. If plug-in has a title, plug-ins 
+    *   must override this method.
+    * @see MDiagPlugin::GetTitleL() 
+    */
+    IMPORT_C virtual HBufC* GetTitleL() const;
+
+    /**
+    * Get description of the plugin. Default implementation in 
+    *   CDiagSuitePluginBase will leave with KErrNotSupported. If plug-in 
+    *   has a description, plug-ins must override this method.
+    * @see MDiagPlugin::GetDescriptionL()
+    */
+    IMPORT_C virtual HBufC* GetDescriptionL() const;
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the operation.
+    * @param aParam Custom parameter. 
+    * @return TAny pointer. Custom data.
+    */
+    IMPORT_C virtual TAny* CustomOperationL( TUid aUid, TAny* aParam );
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the property
+    * @param aParam Custom parameter.
+    * @return TAny pointer. Custom data. 
+    */
+    IMPORT_C virtual TAny* GetCustomL( TUid aUid, TAny* aParam );
+
+    /**
+    * Initialization Step. This method is called before any plugin are executed.
+    * This can be used to clean up any left over data from previous execution 
+    * sessions. All plug-ins in execution plan will have a chance to clean 
+    * up before any plug-ins are run.  This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in will be executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    **/
+    IMPORT_C virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                             TBool aSkipDependencyCheck,
+                                             TAny* aCustomParams );
+
+    /**
+    * Cleanup Step. This method is called after all plug-ins in the 
+    * execution plan is completed to clean up any left over data from 
+    * current sesison. This can be used to clean up any data that
+    * provides dependent service created for its dependencies.
+    * This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in as executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    **/
+    IMPORT_C virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                           TBool aSkipDependencyCheck,
+                                           TAny* aCustomParams );
+
+
+public: // from MDiagSuitePlugin
+
+    /**
+    * Get children of this plug-in. The pointer array is guaranteed to 
+    * be sorted defined by TSortOrder.
+    *
+    * @param aChildren Children are appended into this array.
+    * @param aOrder Sorting algorithm.
+    **/
+    IMPORT_C virtual void GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                                        TSortOrder aOrder ) const;
+
+    /**
+    * Add one child. Child can be either a test suite or a test plug-in.
+    *
+    * @param aChild - Child to be added. However, ownership is not
+    *               transferred here. 
+    **/
+    IMPORT_C virtual void AddChildL( MDiagPlugin* aChild );
+
+    /**
+    * Get the Uids. The uid is used for database access.
+    * Test suites return a list of their childrens' uids.
+    *
+    * @param aUids  An UID array.
+    * @param aOrder Sorting algorithm.
+    **/
+    IMPORT_C virtual void GetChildrenUidsL( RArray<TUid>& aUids,
+                                    TSortOrder aOrder ) const;
+
+    /**
+    * Called before one of its test plug-in is executed.  Note that it will
+    * not be called if two of its children plug-ins are executed in 
+    * sequence.
+    *
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    IMPORT_C virtual void PrepareChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                                     TBool aSkipDependencyCheck,
+                                                     TBool aDependencyExecution );
+
+    /**
+    * Called before test execution switches to another test suite.
+    *
+    * @param aExecParams Parameters for suite post execution
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    IMPORT_C virtual void FinalizeChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                                      TBool aSkipDependencyCheck,
+                                                      TBool aDependencyExecution );
+
+    /**
+    * Cancels pre/post execution. Cancellation is expected to be synchronous.
+    * Suite plug-in must not call ContinueExecutionL().
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    **/
+    IMPORT_C virtual void ExecutionStopL( TStopReason aReason );
+
+private:    // Private Data Types
+    class TPrivateData;
+
+private:    // Private data
+    /**
+    * Plug-in constructor parameter.
+    * Ownership: this
+    */
+    CDiagPluginConstructionParam* iConstructionParam;
+
+    /**
+    * CCoeEnv. This is needed for handling resources. 
+    */
+    CCoeEnv& iCoeEnv;
+
+    /**
+    * Plug-in base's private data
+    */
+    TPrivateData* iData;
+    };
+
+#endif // DIAGSUITEPLUGINBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/inc/diagtestpluginbase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,589 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Test Plug-in  Base class
+*
+*/
+
+
+#ifndef DIAGTESTPLUGINBASE_H
+#define DIAGTESTPLUGINBASE_H
+
+// INCLUDES
+#include <DiagTestPlugin.h>     // MDiagTestPlugin
+#include <ConeResLoader.h>      // RConeResourceLoader
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem::TResult
+#include <DiagEngineWatchdogTypes.h>    // TDiagEngineWatchdogTypes
+
+// FORWARD DECLARATIONS
+class CDiagResultsDbItemBuilder;
+class TDiagTestPluginBasePrivateData;
+class CDiagPluginConstructionParam;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Test Plugin  Base Class
+*
+*  This class provides further simplification of test execution.
+*  It handles execution parameter and reporting results to engine
+*
+*  @since S60 v5.0
+*/
+class CDiagTestPluginBase : public CActive,
+                            public MDiagTestPlugin
+    {
+public: // C++ Destructor
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagTestPluginBase();
+
+protected: // new API for derived class
+    /**
+    * C++ constructor
+    * 
+    *   Note that BaseConstructL() must be called to complete object construction.
+    * @param aConstructionParam Construction parameters.
+    */
+    IMPORT_C CDiagTestPluginBase( CDiagPluginConstructionParam* aConstructionParam );
+    
+    /**
+    * 2nd phase Base class constructor
+    * This initializes CDiagTestPluginBase class. Derived class must call this
+    * method in its ConstructL() method.
+    *  
+    * @param aResourceFileName Drive and name of resource file in format
+    *                          <path>:<rsc_file_name>
+    */
+    IMPORT_C void BaseConstructL( const TDesC& aResourceFileName );
+
+    /**
+    * Verify that all dependencies are satisfied. Also returns a list of
+    * failed dependencies.
+    *
+    * @param aEngine. Reference to engine, which provides references to
+    *   database session and plug-in pool.
+    * @param aFailedUids. If ETrue is returned, the parameter is NULL.
+    *           if EFalse is returned, the parameter points to an array that
+    *           can be used to query UIDs of failed dependencies. Client is
+    *           responsible of closing the array.
+    * @return ETrue if all dependencies are executed successfully.
+    *         EFalse if one or more dependencies are failed.
+    */
+    IMPORT_C virtual TBool AreDependenciesSatisfiedL( MDiagEngineCommon& aEngine,
+                                            RArray<TUid>*& aFailedUids ) const;
+
+    /**
+    * Check result of dependencies. This will check each dependency and
+    * determine the best overall result of all the dependencies.
+    *
+    * @param aEngine. Reference to engine, which provides references to
+    *   database session and plug-in pool.
+    * @param aFailedUids. If ESuccess is returned, the parameter is NULL.
+    *           Otherwise the parameter points to an array that
+    *           can be used to query UIDs of failed dependencies. Client is
+    *           responsible of closing the array.
+    * @return Result of the dependency check. If multiple depencies or suites
+    *   are included, it will return the most appropreate result.
+    */
+    IMPORT_C virtual CDiagResultsDatabaseItem::TResult VerifyDependenciesL( 
+        MDiagEngineCommon& aEngine,
+        RArray<TUid>*& aFailedUids ) const;
+
+    /**
+    * Returns execution parameter. 
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return Execution parameter.
+    */
+    IMPORT_C TDiagTestExecParam& ExecutionParam();
+
+    /**
+    * Check if current test session has dependency check skip flag set.
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    * 
+    * @return ETrue if dependency check is disabled for this execution sesison.
+    *   EFalse if dependency check is enabled.
+    */
+    IMPORT_C TBool IsDependencyCheckSkipped() const;
+
+    /**
+    * Check if current test is being executed to satisfy dependency or
+    *   if it is being executed explicitly.
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return ETrue - If it is to satisfy dependency.
+    *   EFalse - If it is being executed explicitly.
+    */
+    IMPORT_C TBool IsDependencyExecution() const;
+
+    /**
+    * Get custom parameter passed to from the engine
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    * 
+    * @return Custom parameter. Ownership is not transferred.
+    */
+    IMPORT_C TAny* CustomParam() const;
+
+    /**
+    * Get currently result db item builder.
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return Reference to current CDiagResultsDbItemBuilder.
+    */
+    IMPORT_C CDiagResultsDbItemBuilder& ResultsDbItemBuilder();
+
+    /**
+    * Report test progress test observer.
+    *   This function will call engine's TestProgressL method with watchdog
+    *   type value that is based on plug-in RunMode.
+    *
+    *   If EAutomatic plug-in, it will use EDiagEngineWatchdogTypeNonInteractive.
+    *   If EInteractiveView or EInteractiveDialog, EDiagEngineWatchdogTypeInteractive. 
+    *
+    *   When watchdog is timed out, it will stop test with test result
+    *   CDiagResultsDatabaseItem::EWatchdogCancel.
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @param aCurrentStep - Current execution step
+    */
+    IMPORT_C void ReportTestProgressL( TUint aCurrentStep );
+
+    /**
+    * Reset watchdog value and watchdog failure result type.
+    *   When watchdog is timed out, it will use the given result type as
+    *   value to report back to engine.  
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @param aWatchdogType - Type of watchdog requested.
+    * @param aResultType - Result to report when wachdog is failed.
+    */
+    IMPORT_C void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType,
+                                 CDiagResultsDatabaseItem::TResult aResultType );
+
+    /**
+    * Reset watchdog value and watchdog failure result type.
+    *   For most plug-ins, the other ResetWatchdog should be better. 
+    *   This should be used only if specific time must be given for the step.
+    *
+    *   When watchdog is timed out, it will use the given result type as
+    *   value to report back to engine.  
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @param aTimeToCompletion - Time needed to complete current operation.
+    *   Unit is in microseconds.
+    * @param aResultType - Result to report when wachdog is failed.
+    */
+    IMPORT_C void ResetWatchdog( 
+        TInt aTimeToCompletion,
+        CDiagResultsDatabaseItem::TResult aResultType );
+
+    /**
+    * Reset watchdog value and watchdog failure result type to default values.
+    *   This will also reset watchdog on engine.
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    */
+    IMPORT_C void ResetWatchdogToDefault();
+
+    /**
+    * Report test result to test observer. 
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    *   This function will also call StopAndCleanupL(), which will call 
+    *   DoStopAndCleanupL(). After CompleteTestL() is called, ExecutionParam() and
+    *   other test state specific API will fail.
+    *
+    * @param aResult - Test result.
+    */
+    IMPORT_C void CompleteTestL( CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Stop current execution and free any data associated with the test.
+    *   This method will call DoStopAndCleanupL() function to allow
+    *   derived class to clean up.
+    *   
+    *   It will also call DismissWaitingDialog() and CActive::Cancel().
+    *
+    *   If derived class overrides ExecutionStopL() function, this function
+    *   must be called by derived version of ExecutionStopL() to allow
+    *   proper clean up of CDiagTestPluginBase.
+    *
+    *   @see CDiagTestPluginBase::ExecutionStopL
+    */
+    IMPORT_C void StopAndCleanupL();
+
+    /**
+    * Run a dialog that waits for response. It is highly recommended that
+    * all plug-ins use this function to display dialogs since it can detect
+    * deletion of dialogs.
+    *
+    * The difference from normal dialog RunLD is that this function returns 
+    * ETrue if dialog exited due to user response and 
+    * EFalse if it was by other means, such as object deletion or
+    * by DismissWaitingDialog() method. 
+    * 
+    *   !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING  !!!!
+    *   !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!!
+    *   !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY.    !!!!
+    * 
+    * The normal dialog response is returned via aDialogResponse reference.
+    * This function can only display one dialog at a time. Calling it again 
+    * while it has not been returned will cause panic.
+    *
+    * @param aDialog - Pointer to dialog to run. If the dialog does not have
+    *   EEikDialogFlagWait flag set, it will panic with EDiagPluginBaseBadArgument
+    * @param aDialogResponse - Response from the dialog.  
+    *   For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes
+    *   The only exception is that if cancel is pressed, it will be 0.
+    * @return ETrue if dialog is exiting due to user response.
+    *   Efalse if dialog is dismissed withou user input. 
+    *   If EFalse is returned, plug-in MUST NOT act on the response.
+    *   Also, since plug-in may have been deleted,
+    */
+    IMPORT_C TBool RunWaitingDialogL( CAknDialog* aDialog, TInt& aDialogResponse );
+
+    /**
+    * Dismiss the waiting dialog. This will cause the RunDialogLD() function to return with
+    * aIsUserResponse = Efalse. If nothing is being displayed, this function
+    * does nothing.
+    */
+    IMPORT_C void DismissWaitingDialog();
+
+    /**
+    * CCoeEnv
+    *   @return Reference to CCoeEnv.
+    */
+    IMPORT_C CCoeEnv& CoeEnv();
+
+    /**
+    * Check if current test is being executed as a single plugin or 
+    * as a part of a suite
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return ETrue - If run as a single plugin
+    *   EFalse - If run as a part of a suite
+    */
+    IMPORT_C TBool SinglePluginExecution() const;
+    
+protected:  // to be implemented by derived classes
+    /**
+    * Execute test. This is called by CDiagTestPluginBase::RunTestL()
+    *   Note that CDiagTestPluginBase takes ownership of all parameters
+    *   given in RunTestL() function. If specific parameter is needed
+    *   use the following set of functions:
+    *
+    *   Parameters are available via the following APIs.
+    *       Observer:               ExecutionParam().Observer();
+    *       Engine:                 ExecutionParam().Engine();
+    *       Dependency Execution:   IsDependencyExecution();
+    *       Skip Depdency:          IsDependencyCheckSkipped();
+    *       Custom Parameter:       CustomParam();
+    *
+    *   Also, a new instance of CDiagResultsDbItemBuilder is created and
+    *   accessible via:
+    *
+    *       Result Db Item Builder: ResultsDbItemBuilder();
+    */
+    virtual void DoRunTestL() = 0;
+
+    /**
+    * Stop current execution and free any data associated with the test.
+    *   This is called by StopAndCleanupL
+    */
+    virtual void DoStopAndCleanupL() = 0;
+
+    /**
+    * This is called by CDiagTestPluginBase::ExecutionStopL() to allow 
+    *   the derived class to provide additional behavior in ExecutionStopL().
+    *   Default implementation does nothing. For more information about
+    *   how this is called, @see CDiagTestPluginBase::ExecutionStopL()
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    * @param aTestResult - Test result to write to in database.
+    *   This is IN/OUT parameter. By default, it contains default result based on
+    *   aReason. Plug-in can provide different test result, assign new result
+    *   to this variable.
+    *
+    */
+    IMPORT_C virtual void DoExecutionStopL( MDiagTestPlugin::TStopReason aReason,
+                                            CDiagResultsDatabaseItem::TResult& aTestResult );
+
+protected:  // From CActive
+    /**
+    * RunError. Handle leaves from test. If test is currently running, 
+    * CDiagTestPluginBase will handle the error by calling 
+    * CompleteTestL( CDiagResultsDatabaseItem::EFailed ). If test was
+    * not running, it will return the error back to active scheduler.
+    * 
+    * If this behavior is not desired, derived class should override this
+    * method.
+    * 
+    * For parameters and return value, 
+    * @see CActive::RunError
+    */
+    IMPORT_C virtual TInt RunError( TInt aError );
+
+protected: // from MDiagTestPlugin
+    /**
+    * Handle execution stop.
+    *   @see MDiagTestPlugin::ExecutionStopL()
+    * 
+    *   This method does the following:
+    *       a) Call DoExecutionStopL()   
+    *       b) Call StopAndCleanupL()  -> Calls DoStopAndCleanupL()
+    *       c) Return either EWatchdogCancel or ECancelled depending on
+    *           the stop reason. 
+    *   
+    *   Note: If derived class wants override this function, be sure to 
+    *   call StopAndCleanupL() to allow proper clean up of 
+    *   CDiagTestPluginBase class. StopAndCleanupL() will call
+    *   DoStopAndCleanupL(). 
+    *
+    *   @see DoExecutionStopL()
+    *   @see StopAndCleanupL() 
+    */
+    IMPORT_C virtual CDiagResultsDatabaseItem* ExecutionStopL( TStopReason aReason );
+
+protected:    // from MDiagTestPlugin
+    /**
+    * Get the name of the service that the plug-in provides.
+    *
+    * @return The name of the service.
+    */
+    IMPORT_C virtual const TDesC& ServiceLogicalName() const;
+
+    /**
+    * Get logical dependencies. One plug-in can have multiple dependencies to 
+    * other plug-ins.
+    *
+    * @param aArray An array of logical names.
+    * @see ServiceLogicalNameL
+    */
+    IMPORT_C virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const;
+
+    /**
+    * Return the type of the plug-in. 
+    *
+    * @return The type.
+    * @see TPluginType.
+    */
+    IMPORT_C virtual TPluginType Type() const;
+
+    /**
+    * Create an icon that represents the plug-in.
+    *
+    * @return An icon. 
+    */
+    IMPORT_C virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * @see MDiagPlugin::IsSupported
+    */
+    IMPORT_C virtual TBool IsSupported() const;
+
+    /**
+    * Get the order number that this plug-in should appear in its parent list.
+    *
+    * @return TUint order number.
+    */
+    IMPORT_C virtual TUint Order() const;
+
+    /**
+    * Get UID of the parent.
+    *
+    * @return The parent UID.
+    */
+    IMPORT_C virtual TUid ParentUid() const;
+
+    /**
+    * @see MDiagPlugin::SetDTorIdKey()
+    */
+    IMPORT_C virtual void SetDtorIdKey( TUid aDtorIdKey );
+
+    /**
+    * Get title of the plugin. Default implementation in CDiagTestPluginBase 
+    *   will leave with KErrNotSupported. If plug-in has a title, plug-ins 
+    *   must override this method.
+    * @see MDiagPlugin::GetTitleL() 
+    */
+    IMPORT_C virtual HBufC* GetTitleL() const;
+
+    /**
+    * Get description of the plugin. Default implementation in 
+    *   CDiagTestPluginBase will leave with KErrNotSupported. If plug-in 
+    *   has a description, plug-in must override this method.
+    * @see MDiagPlugin::GetDescriptionL()
+    */
+    IMPORT_C virtual HBufC* GetDescriptionL() const;
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the operation.
+    * @param aParam Custom parameter. 
+    * @return TAny pointer. Custom data.
+    */
+    IMPORT_C virtual TAny* CustomOperationL( TUid aUid, TAny* aParam );
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the property
+    * @param aParam Custom parameter.
+    * @return TAny pointer. Custom data. 
+    */
+    IMPORT_C virtual TAny* GetCustomL( TUid aUid, TAny* aParam );
+
+    /**
+    * Initialization Step. This method is called before any plugin are executed.
+    * This can be used to clean up any left over data from previous execution 
+    * sessions. All plug-ins in execution plan will have a chance to clean 
+    * up before any plug-ins are run.  This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in will be executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    */
+    IMPORT_C virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                             TBool aSkipDependencyCheck,
+                                             TAny* aCustomParams );
+
+    /**
+    * Cleanup Step. This method is called after all plug-ins in the 
+    * execution plan is completed to clean up any left over data from 
+    * current sesison. This can be used to clean up any data that
+    * provides dependent service created for its dependencies.
+    * This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in as executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    */
+    IMPORT_C virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                           TBool aSkipDependencyCheck,
+                                           TAny* aCustomParams );
+
+
+    /**
+    * Execute diagnostics test.
+    * @see MDiagTestPlugin::RunTestL
+    */
+    IMPORT_C virtual void RunTestL( TDiagTestExecParam* aExecParam,
+                                    TBool aSkipDependencyCheck,
+                                    TBool aDependencyExecution,
+                                    TAny* aCustomParams );
+
+    /**
+    * Suspend test.  
+    * @see MDiagTestPlugin::SuspendL
+    */
+    IMPORT_C virtual void SuspendL();
+
+    /**
+    * Resume test. 
+    * @see MDiagTestPlugin::ResumeL
+    */
+    IMPORT_C virtual void ResumeL();
+
+    /**
+    * Create test result detail.
+    * @see CDiagTestPluginBase::CreateDetailL
+    */
+    IMPORT_C virtual MDiagResultDetail* CreateDetailL( 
+        const CDiagResultsDatabaseItem& aResult ) const;
+
+private:    // private functions
+    /**
+    * Stop and clean up CDiagTestPluginBase
+    */
+    void BaseStopAndCleanup();
+
+    /**
+    * Utility function to get all dependent test plug-ins. If suite is found,
+    * it will be expanded to test plug-ins.
+
+    * @param aEngine. Reference to engine, which provides references to
+    *   database session and plug-in pool.
+    * @param aPluginList - Output array. Upon completion, it will hold
+    *   list of test plug-ins. If this plug-in does not depend on any tests, 
+    *   it will be empty.
+    *   Ownership of individual items are not trasferred, so ResetAndDestroy()
+    *   must not be called.
+    */
+    void GetAllDependentTestsL( MDiagEngineCommon& aEngine,
+                                RPointerArray< MDiagTestPlugin >& aPluginList ) const;
+
+    /**
+    * Utility function to check results of tests in array and come up with
+    * best overall result of tests. 
+    * @param aPluginList - List of test plug-ins.
+    * @param aFailedUidList - Output array. Upon completion, it will contain
+    *   list of uids that failed.
+    * @return Overall result of dependent tets.
+    */
+    CDiagResultsDatabaseItem::TResult SummarizeOverallTestResultsL( 
+        MDiagEngineCommon& aEngine,
+        const RPointerArray< MDiagTestPlugin >& aPluginList,
+        RArray< TUid >& aFailedUidList ) const;
+
+
+private:    // Private Data Type
+    // Forward declaration.
+    class TPrivateData;
+
+private:    // Private Data
+    /**
+    * Plug-in constructor parameter.
+    * Ownership: this
+    */
+    CDiagPluginConstructionParam* iConstructionParam;
+
+    /**
+    * CCoeEnv. This is needed for handling resources. 
+    */
+    CCoeEnv& iCoeEnv;
+
+    /**
+    * Plug-in base's private data
+    */
+    TPrivateData* iData;
+    };
+
+#endif // DIAGTESTPLUGINBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/src/diagpluginbaseutils.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2007 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:  Collection of utility functions useful for plugins
+*
+*/
+
+
+// SYSTEM INCLUDE FILES
+#include <bautils.h>                        // BaflUtils
+#include <ConeResLoader.h>                  // RConeResourceLoader
+#include <f32file.h>                        // RFs
+#include <data_caging_path_literals.hrh>    // KDC_RESOURCE_FILES_DIR
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+
+// USER INCLUDE FILES
+#include "diagpluginbaseutils.h"        // CDiagPluginUtils
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// DiagPluginBaseUtils::OpenResourceFileL()
+// ---------------------------------------------------------------------------
+//
+void DiagPluginBaseUtils::OpenResourceFileL(
+        const TDesC& aResourceFileName,
+        RConeResourceLoader& aResourceLoader,
+        RFs& aFsSession )
+    {
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( aFsSession, fileName );
+
+    LOGSTRING( "CDiagPluginBaseUtils::OpenLocalizedResourceFileL: FileName:" )
+    LOGTEXT( fileName )
+
+    // Open resource file:
+    TRAPD( err, aResourceLoader.OpenL( fileName ) )
+
+#ifdef _DEBUG
+    if ( err != KErrNone )
+        {
+        // if it is a debug build, and it fails to load the resource, try 
+        // again with C: as base directory.
+        // This allows installation of plug-ins as SIS file without changing
+        // code in the plug-in itself.
+        _LIT( KCDriveName, "c" );
+        fileName.Replace( 0, 1, KCDriveName );
+
+        LOGSTRING( "CDiagPluginBaseUtils::OpenLocalizedResourceFileL: Retry:" )
+        LOGTEXT( fileName )
+        TRAP( err, aResourceLoader.OpenL( fileName ) )
+        }
+#endif // _DEBUG
+
+    if ( err != KErrNone )
+        {
+        LOGSTRING2( "CDiagPluginBaseUtils::OpenLocalizedResourceFileL:"
+            L" Failed err = %d", err )
+        User::Leave( err );
+        }
+
+    LOGSTRING( "CDiagPluginBaseUtils::OpenLocalizedResourceFileL: Resource Opened" )
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/src/diagpluginwaitingdialogwrapper.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagPluginWaitingDialogWrapper
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagpluginwaitingdialogwrapper.h"
+
+// SYSTEM INCLUDE FILES
+#include <AknDialog.h>                      // CAknDialog
+
+// USER INCLUDE FILES
+#include "diagpluginbase.pan"               // Panic Codes
+
+// LOCAL TYPES
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagPluginWaitingDialogWrapper::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginWaitingDialogWrapper* CDiagPluginWaitingDialogWrapper::NewL( 
+        CAknDialog* aWaitingDialog )
+    {
+    CleanupStack::PushL( aWaitingDialog );
+    CDiagPluginWaitingDialogWrapper* self = new ( ELeave ) 
+        CDiagPluginWaitingDialogWrapper( aWaitingDialog );
+    CleanupStack::Pop( aWaitingDialog );
+
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginWaitingDialogWrapper::CDiagPluginWaitingDialogWrapper
+// ---------------------------------------------------------------------------
+//
+CDiagPluginWaitingDialogWrapper::CDiagPluginWaitingDialogWrapper( 
+        CAknDialog* aWaitingDialog )
+    :   iWaitingDialog( aWaitingDialog ),
+        iIsObjectDeletedPtr( NULL )
+    {
+    // Dialog must not be NULL
+    __ASSERT_ALWAYS( iWaitingDialog, Panic( EDiagPluginBasePanicBadArgument ) );
+
+    // Coverity Change .....  Dialog must have EEikDialogFlagWait flag set
+    __ASSERT_ALWAYS( (iWaitingDialog->DialogFlags() & EEikDialogFlagWait),
+                     Panic( EDiagPluginBasePanicBadArgument ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginWaitingDialogWrapper::~CDiagPluginWaitingDialogWrapper
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagPluginWaitingDialogWrapper::~CDiagPluginWaitingDialogWrapper()
+    {
+    if( iIsObjectDeletedPtr )
+        {
+        // If this pointer is set, we are still in RunLD().
+        __ASSERT_DEBUG( iWaitingDialog, Panic( EDiagPluginBasePanicInternal ) );
+        
+        *iIsObjectDeletedPtr = ETrue;
+        iIsObjectDeletedPtr = NULL;
+
+        delete iWaitingDialog;
+        iWaitingDialog = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagPluginWaitingDialogWrapper::RunLD
+// ---------------------------------------------------------------------------
+EXPORT_C TBool CDiagPluginWaitingDialogWrapper::RunLD( TInt& aDialogResponse )
+    {
+    // Make sure that this function is not called twice.
+    __ASSERT_ALWAYS( iIsObjectDeletedPtr == NULL,
+        Panic( EDiagPluginBasePanicInvalidState ) );
+
+    TBool isObjectDeleted = EFalse;
+    
+    iIsObjectDeletedPtr = &isObjectDeleted;
+
+    aDialogResponse = iWaitingDialog->RunLD();
+    // Do not access local variable until isObjectDeleted
+    // value is checked first. "this" pointer may be invalid at this pointer.
+
+    if ( isObjectDeleted )
+        {
+        // this class is already deleted. Exit immediately.
+        return EFalse;
+        }
+    else
+        {
+        // iWaitingDialog->RunLD() returned with user response.
+        iIsObjectDeletedPtr = NULL;
+        iWaitingDialog = NULL;
+
+        // Self-destruct as it is a "D" function.
+        delete this;
+        return ETrue;
+        }
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/src/diagresultdetailbasic.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,378 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagResultDetailBasic
+*
+*/
+
+
+// CLASS DECLARATION
+#include "diagresultdetailbasicitem.h"  // CDiagResultDetailBasicItem
+
+// SYSTEM INCLUDE FILES
+#include <DiagResultDetailBasic.h>
+#include <s32mem.h>                     // RBufReadStream / RBufWriteStream
+
+// USER INCLUDE FILES
+#include "diagpluginbase.pan"           // panic codes
+
+
+// CONSTANTS
+static const TInt KDiagResultDetailBasicBufferSize = 1024;
+
+// ======== LOCAL FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// Compares two items by order field id
+// ---------------------------------------------------------------------------
+//
+static TInt CompareItemById( const CDiagResultDetailBasicItem& aFirst,
+                             const CDiagResultDetailBasicItem& aSecond )
+    {
+    return aFirst.FieldId() - aSecond.FieldId();
+    }
+
+// ======== MEMBER FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::CDiagResultDetailBasic()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultDetailBasic::CDiagResultDetailBasic( 
+        CDiagResultsDatabaseItem::TResult aResult )
+    :   iResult( aResult )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::~CDiagResultDetailBasic()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultDetailBasic::~CDiagResultDetailBasic()
+    {
+    iFields.ResetAndDestroy();
+    iFields.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::BaseConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::BaseConstructL( RReadStream& aReadStream )
+    {
+    InternalizeL( aReadStream );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::BaseConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::BaseConstructL( const CBufFlat& aBuf )
+    {
+    // if empty buffer, do nothing.
+    if ( aBuf.Size() == 0 )
+        {
+        return;
+        }
+
+    RBufReadStream readStream;
+
+    readStream.Open( aBuf, 0 );
+
+    InternalizeL( readStream );
+
+    readStream.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::SetResult()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::SetResult( 
+        CDiagResultsDatabaseItem::TResult aResult )
+    {
+    iResult = aResult;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::SetValueL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::SetValueL( TInt aFieldId,
+                                                 const TDesC8& aFieldName,
+                                                 TInt aValue )
+    {
+    CDiagResultDetailBasicItem* newItem = CDiagResultDetailBasicItem::NewL( 
+        aFieldId,
+        aFieldName,
+        aValue );
+
+    // no need to call clean up stack since ownership is
+    // transferred.
+    SetItemL( newItem );
+    newItem = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::SetValueL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::SetValueL( TInt aFieldId,
+                                                 const TDesC8& aFieldName,
+                                                 const TDesC8& aValue )
+                
+    {
+    CDiagResultDetailBasicItem* newItem = CDiagResultDetailBasicItem::NewL( 
+        aFieldId,
+        aFieldName,
+        aValue );
+    
+    // no need to call clean up stack since ownership is
+    // transferred.
+    SetItemL( newItem );
+    newItem = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::SetValueL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::SetValueL( TInt aFieldId,
+                                                 const TDesC8& aFieldName,
+                                                 const TDesC16& aValue )
+                
+    {
+    CDiagResultDetailBasicItem* newItem = CDiagResultDetailBasicItem::NewL( 
+        aFieldId,
+        aFieldName,
+        aValue );
+    
+    // no need to call clean up stack since ownership is
+    // transferred.
+    SetItemL( newItem );
+    newItem = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::GetValue
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagResultDetailBasic::GetValue( TInt aFieldId,
+                                                TInt& aValue ) const
+    {
+    TInt itemIndex = FindItem( aFieldId );
+
+    if ( itemIndex < 0 )
+        {
+        // item not found
+        return KErrNotFound;
+        }
+
+    return iFields[itemIndex]->GetValue( aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::GetValueL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagResultDetailBasic::GetValue( TInt aFieldId,
+                                                TPtrC8& aValue ) const
+    {
+    TInt itemIndex = FindItem( aFieldId );
+
+    if ( itemIndex < 0 )
+        {
+        // item not found
+        return KErrNotFound;
+        }
+    
+    return iFields[itemIndex]->GetValue( aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::GetValueL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagResultDetailBasic::GetValue( TInt aFieldId,
+                                                TPtrC16& aValue ) const
+    {
+    TInt itemIndex = FindItem( aFieldId );
+
+    if ( itemIndex < 0 )
+        {
+        // item not found
+        return KErrNotFound;
+        }
+    
+    return iFields[itemIndex]->GetValue( aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::InternalizeL
+// ---------------------------------------------------------------------------
+//
+void CDiagResultDetailBasic::InternalizeL( RReadStream& aReadStream )
+    {
+    iFields.ResetAndDestroy();
+
+    // Make sure that we are dealing with the correct version of data format.
+    TUint32 version = aReadStream.ReadUint32L();
+
+    if ( version != ( TUint32 )KDiagResultDetailBasicVersion )
+        {
+        User::Leave( KErrCorrupt );
+        }
+
+    // Read the number of items in the list.
+    TUint32 count = aReadStream.ReadUint32L();
+
+    // Read each item
+    for ( TUint i = 0; i < count; i++ )
+        {
+        CDiagResultDetailBasicItem* newItem = 
+            CDiagResultDetailBasicItem::NewL( aReadStream );
+
+        SetItemL( newItem ); // ownership passed.
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::ExternalizeL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::ExternalizeL(
+        RWriteStream& aWriteStream ) const
+    {
+    // write only if there is something to write..
+    if ( iFields.Count() > 0 )
+        {
+        aWriteStream.WriteUint32L( KDiagResultDetailBasicVersion );
+        aWriteStream.WriteUint32L( iFields.Count() );
+
+        for ( TInt i = 0; i < iFields.Count(); i++ )
+            {
+            iFields[i]->ExternalizeL( aWriteStream );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::ExternalizeToBufferL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CBufFlat* CDiagResultDetailBasic::ExternalizeToBufferL() const
+    {
+    CBufFlat* buffer = CBufFlat::NewL( KDiagResultDetailBasicBufferSize );
+
+    CleanupStack::PushL( buffer );
+
+    RBufWriteStream bufStream;
+    bufStream.Open( *buffer );
+
+    ExternalizeL( bufStream );
+
+    bufStream.CommitL();
+    bufStream.Close();
+
+    CleanupStack::Pop( buffer );
+
+    return buffer;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::GetSupportedOutput
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::GetSupportedOutput(
+        RArray<TOutputFormat>& /* aOutputList */ ) const
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::IsOutputSupported
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagResultDetailBasic::IsOutputSupported(
+        MDiagResultDetail::TOutputFormat /* aOutputFormat */ ) const
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::GetOutputL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultDetailBasic::GetOutputL(
+        MDiagResultDetail::TOutputFormat /* aOutputFormat */,
+        RBuf& /* aBuffer */ ) const
+    {
+    User::Leave( KErrNotSupported );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::CreateIconL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGulIcon* CDiagResultDetailBasic::CreateIconL() const
+    {
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::SetItemL
+// ---------------------------------------------------------------------------
+//
+void CDiagResultDetailBasic::SetItemL( CDiagResultDetailBasicItem* aNewItem )
+    {
+    // Check if an item with same field id already exists.
+    TInt itemIndex = FindItem( aNewItem->FieldId() );
+    
+    if ( itemIndex >= 0 )
+        {
+        // duplicate found. Remove old one.
+        CDiagResultDetailBasicItem* oldItem = iFields[itemIndex];
+        iFields.Remove( itemIndex );
+        delete oldItem;
+        }
+
+    CleanupStack::PushL( aNewItem );
+    TLinearOrder<CDiagResultDetailBasicItem> order( *CompareItemById );
+
+    // if a duplicate item is still found, leave.
+    User::LeaveIfError( iFields.InsertInOrder( aNewItem, order ) );
+    CleanupStack::Pop( aNewItem );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasic::FindItem
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultDetailBasic::FindItem( TInt aFieldId ) const
+    {
+    for ( TInt i = 0; i < iFields.Count(); i++ )
+        {
+        if ( iFields[i]->FieldId() == aFieldId )
+            {
+            return i;
+            }
+        }
+    return -1;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/src/diagresultdetailbasicitem.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,278 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagResultDetailBasicItem
+*
+*/
+
+
+// SYSTEM INCLUDE FILES
+#include <s32strm.h>            // RReadStream, RWriteStream
+
+// USER INCLUDE FILES
+#include "diagresultdetailbasicitem.h"
+
+// CONSTANTS
+const TInt KDiagResultDetailBasicMaxNameLen = 50;
+const TInt KDiagResultDetailBasicMaxFieldValueLen = 1024;
+
+// ======== MEMBER FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem* CDiagResultDetailBasicItem::NewL(
+            TInt aFieldId,
+            const TDesC8& aFieldName,
+            TInt aValue )
+    {
+    CDiagResultDetailBasicItem* self = new( ELeave )
+        CDiagResultDetailBasicItem();
+    CleanupStack::PushL( self );
+
+    self->iFieldId = aFieldId;
+    self->iFieldName = aFieldName.AllocL();
+    self->iFieldType = ETypeInt;
+    self->iValue.iInt = aValue;
+    
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem* CDiagResultDetailBasicItem::NewL(
+            TInt aFieldId,
+            const TDesC8& aFieldName,
+            const TDesC8& aValue )
+    {
+    CDiagResultDetailBasicItem* self = new( ELeave )
+        CDiagResultDetailBasicItem();
+    CleanupStack::PushL( self );
+
+    self->iFieldId = aFieldId;
+    self->iFieldName = aFieldName.AllocL();
+    self->iFieldType = ETypeDes8;
+    self->iValue.iBuffer8 = aValue.AllocL();
+    
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem* CDiagResultDetailBasicItem::NewL(
+            TInt aFieldId,
+            const TDesC8& aFieldName,
+            const TDesC16& aValue )
+    {
+    CDiagResultDetailBasicItem* self = new( ELeave )
+        CDiagResultDetailBasicItem();
+    CleanupStack::PushL( self );
+
+    self->iFieldId = aFieldId;
+    self->iFieldName = aFieldName.AllocL();
+    self->iFieldType = ETypeDes16;
+    self->iValue.iBuffer16 = aValue.AllocL();
+    
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::NewL
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem* CDiagResultDetailBasicItem::NewL(
+            RReadStream& aReadStream )
+    {
+    CDiagResultDetailBasicItem* self = new( ELeave )
+        CDiagResultDetailBasicItem();
+    CleanupStack::PushL( self );
+
+    self->InternalizeL( aReadStream );
+    
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::CDiagResultDetailBasicItem
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem::CDiagResultDetailBasicItem()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::~CDiagResultDetailBasicItem
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem::~CDiagResultDetailBasicItem()
+    {
+    delete iFieldName;
+    iFieldName = NULL;
+
+    switch ( Type() )
+        {
+        case ETypeDes16:
+            delete iValue.iBuffer16;
+            iValue.iBuffer16 = NULL;
+            break;
+        case ETypeDes8:
+            delete iValue.iBuffer8;
+            iValue.iBuffer8 = NULL;
+            break;
+        default:
+            // do nothing
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::FieldId
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultDetailBasicItem::FieldId() const
+    {
+    return iFieldId;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::FieldName
+// ---------------------------------------------------------------------------
+//
+const TDesC8& CDiagResultDetailBasicItem::FieldName() const
+    {
+    return *iFieldName;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::Type
+// ---------------------------------------------------------------------------
+//
+CDiagResultDetailBasicItem::TFieldType CDiagResultDetailBasicItem::Type() const
+    {
+    return iFieldType;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::GetValue
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultDetailBasicItem::GetValue( TInt& aValue ) const
+    {
+    if ( Type() != ETypeInt )
+        return KErrArgument;
+
+    aValue = iValue.iInt;
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::GetValue
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultDetailBasicItem::GetValue( TPtrC8& aValue ) const
+    {
+    if ( Type() != ETypeDes8 )
+        return KErrArgument;
+    
+    aValue.Set( iValue.iBuffer8->Des() );
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::GetValue
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultDetailBasicItem::GetValue( TPtrC16& aValue ) const
+    {
+    if ( Type() != ETypeDes16 )
+        return KErrArgument;
+    
+
+    aValue.Set( iValue.iBuffer16->Des() );
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::InternalizeL
+// ---------------------------------------------------------------------------
+//
+void CDiagResultDetailBasicItem::InternalizeL( RReadStream& aReadStream )
+    {
+    // first read id
+    iFieldId = aReadStream.ReadInt32L();
+
+    // read field Type
+    iFieldType = ( TFieldType ) aReadStream.ReadUint32L();
+
+    // read field name
+    iFieldName = HBufC8::NewL( aReadStream, KDiagResultDetailBasicMaxNameLen );
+
+    switch ( Type() )
+        {
+        case ETypeInt:
+            iValue.iInt = aReadStream.ReadInt32L();
+            break;
+        case ETypeDes16:
+            iValue.iBuffer16 = HBufC16::NewL( aReadStream, 
+                KDiagResultDetailBasicMaxFieldValueLen );
+            break;
+        case ETypeDes8:
+            iValue.iBuffer8 = HBufC8::NewL( aReadStream, 
+                KDiagResultDetailBasicMaxFieldValueLen );
+            break;
+        default:
+            User::Leave( KErrCorrupt );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagResultDetailBasicItem::ExternalizeL
+// ---------------------------------------------------------------------------
+//
+void CDiagResultDetailBasicItem::ExternalizeL( RWriteStream& aWriteStream ) const
+    {
+    // first field id
+    aWriteStream.WriteInt32L( iFieldId );
+
+    // write field Type
+    aWriteStream.WriteUint32L( ( TUint )Type() );
+
+    // write field name
+    aWriteStream << FieldName();
+
+    switch ( Type() )
+        {
+        case ETypeInt:
+            aWriteStream.WriteInt32L( iValue.iInt );
+            break;
+        case ETypeDes16:
+            aWriteStream << *( iValue.iBuffer16 );
+            break;
+        case ETypeDes8:
+            aWriteStream << *( iValue.iBuffer8 );
+            break;
+        default:
+            User::Leave( KErrCorrupt );
+        }
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/src/diagsuitepluginbase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,460 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagSuitePluginBase
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagSuitePluginBase.h>            // CDiagSuitePluginBase
+
+// SYSTEM INCLUDE FILES
+#include <ecom.h>                           // REComSession
+#include <coemain.h>                        // CCoeEnv::Static()
+#include <StringLoader.h>                   // StringLoader
+#include <DiagPluginConstructionParam.h>    // CDiagPluginConstructionParam
+#include <DiagSuiteExecParam.h>             // TDiagSuiteExecParam
+#include <DiagSuiteObserver.h>              // MDiagSuiteObserver
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+#include <DiagPluginWaitingDialogWrapper.h> // CDiagPluginWaitingDialogWrapper
+
+// USER INCLUDE FILES
+#include "diagpluginbaseutils.h"            // DiagPluginBaseUtils
+#include "diagpluginbase.pan"               // Panic Codes
+
+
+// LOCAL TYPES
+/**
+* Internal private data class for CDiagSuitePluginBase
+*/
+class CDiagSuitePluginBase::TPrivateData
+    {
+public:
+    /** 
+    * C++ Constructor
+    * All variables must be initialized here since this does not derive from
+    * CBase.
+    * Note that this class does not manage memory. Instead it is left to
+    * CDiagSuitePluginBase class to allocate/free memory.
+    */
+    TPrivateData( CCoeEnv& aCoeEnv )
+        :   iDtorIdKey( TUid::Null() ),
+            iWaitingDialogWrapper( NULL ),
+            iChildren(),
+            iPluginResourceLoader( aCoeEnv )
+        {
+        }
+
+public: // data
+    /**
+    * ECOM Destructor key.
+    */
+    TUid iDtorIdKey;
+
+    /**
+    * Wrapper class for displaying waiting dialogs.
+    * Ownership: Shared. Normally, dialog will dismiss itself. However,
+    * if plug-in is being deleted, it can be deleted by the plug-in as well.
+    */
+    CDiagPluginWaitingDialogWrapper* iWaitingDialogWrapper;
+
+    /**
+    * Array of children.
+    */
+    RPointerArray<MDiagPlugin> iChildren;
+
+    /**
+    * Resource loader for derived class resource.
+    */
+    RConeResourceLoader iPluginResourceLoader;
+    };
+
+
+// ======== LOCAL FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// Compares two plug-ins by order number.
+// ---------------------------------------------------------------------------
+//
+static TInt ComparePluginByOrder( const MDiagPlugin& aFirst,
+                                   const MDiagPlugin& aSecond )
+    {
+    return aFirst.Order() - aSecond.Order();
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagSuitePluginBase::CDiagSuitePluginBase
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagSuitePluginBase::CDiagSuitePluginBase( 
+        CDiagPluginConstructionParam* aParam )
+    :   CActive( EPriorityStandard ),
+        iConstructionParam( aParam ),
+        iCoeEnv( *CCoeEnv::Static() )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagSuitePluginBase::BaseConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::BaseConstructL( const TDesC& aResourceFileName )
+    {
+    iData = new ( ELeave ) TPrivateData( CoeEnv() );
+
+    DiagPluginBaseUtils::OpenResourceFileL(
+        aResourceFileName, iData->iPluginResourceLoader, CoeEnv().FsSession() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagSuitePluginBase::~CDiagSuitePluginBase
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagSuitePluginBase::~CDiagSuitePluginBase()
+    {
+    if ( iData )
+        {
+        DismissWaitingDialog();
+        iData->iChildren.Close();
+
+        if ( iData->iDtorIdKey != TUid::Null() )
+            {
+            REComSession::DestroyedImplementation( iData->iDtorIdKey );
+            }
+
+        iData->iPluginResourceLoader.Close();
+
+        delete iData;
+        iData = NULL;
+        }
+
+    delete iConstructionParam;
+    iConstructionParam = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// from MDiagPlugin
+// CDiagSuitePluginBase::ServiceLogicalName
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CDiagSuitePluginBase::ServiceLogicalName() const
+    {
+    return iConstructionParam->ServiceProvided();
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::GetLogicalDependenciesL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::GetLogicalDependenciesL( 
+        CPtrCArray& aArray ) const
+    {
+    aArray.CopyL( iConstructionParam->ServicesRequired() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::Type
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagPlugin::TPluginType CDiagSuitePluginBase::Type() const
+    {
+    return ETypeSuitePlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::CreateIconL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGulIcon* CDiagSuitePluginBase::CreateIconL() const
+    {
+        // Currently, GetTitleL() is not supported.
+        User::Leave( KErrNotSupported );
+        return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagSuitePluginBase::IsSupported
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagSuitePluginBase::IsSupported() const
+    {
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::ParentUid
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid CDiagSuitePluginBase::ParentUid() const
+    {
+    return iConstructionParam->ParentUid();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::SetDtorIdKey
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::SetDtorIdKey( TUid aDtorIdKey )
+    {
+    LOGSTRING2( "CDiagTestPluginBase::SetDtorIdKey: New=0x%x",
+        aDtorIdKey.iUid )
+
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    iData->iDtorIdKey = aDtorIdKey;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::GetTitleL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CDiagSuitePluginBase::GetTitleL() const
+    {
+    // Currently, GetTitleL() is not supported.
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::GetDescriptionL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CDiagSuitePluginBase::GetDescriptionL() const
+    {
+    // Currently, GetDescriptionL() is not supported.
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::CustomOperationL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAny* CDiagSuitePluginBase::CustomOperationL( TUid /*aUid*/, 
+                                                       TAny* /*aParam*/ )
+    {
+    LOGSTRING( "CDiagTestPluginBase::CustomOperationL: KErrNotSupported" )
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::GetCustomL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAny* CDiagSuitePluginBase::GetCustomL( TUid /* aUid */,
+                                                 TAny* /*aParam*/ )
+    {
+    LOGSTRING( "CDiagTestPluginBase::CustomOperationL: KErrNotSupported" )
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagPlugin
+// CDiagSuitePluginBase::Order
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint CDiagSuitePluginBase::Order() const
+    {
+    return iConstructionParam->Order();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::GetChildrenL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                                                  TSortOrder aOrder ) const
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( (aOrder == ENotSorted || aOrder == ESortByPosition),
+                     Panic( EDiagPluginBasePanicBadArgument ) );
+                      
+    TInt count = iData->iChildren.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        aChildren.AppendL( iData->iChildren[i] );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::AddChildL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::AddChildL( MDiagPlugin* aChild )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    TLinearOrder<MDiagPlugin> order( *ComparePluginByOrder );
+    User::LeaveIfError( iData->iChildren.InsertInOrderAllowRepeats( aChild, order ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagSuitePluginBase::TestSessionBeginL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::TestSessionBeginL( 
+        MDiagEngineCommon& /* aEngine */,
+        TBool /* aSkipDependencyCheck */,
+        TAny* /* aCustomParams */ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagSuitePluginBase::TestSessionEndL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::TestSessionEndL( 
+        MDiagEngineCommon& /* aEngine */,
+        TBool /* aSkipDependencyCheck */,
+        TAny* /* aCustomParams */ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::PrepareExecutionL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::PrepareChildrenExecutionL( 
+        TDiagSuiteExecParam* aParam,
+        TBool /* aSkipDependencyCheck */,
+        TBool /* aDependencyExecution */)
+    {
+    CleanupStack::PushL( aParam );
+    aParam->Observer().ContinueExecutionL( *this );
+    CleanupStack::PopAndDestroy ( aParam );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::FinalizeExecutionL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::FinalizeChildrenExecutionL( 
+        TDiagSuiteExecParam* aParam,
+        TBool /* aSkipDependencyCheck */,
+        TBool /* aDependencyExecution */ )
+    {
+    CleanupStack::PushL( aParam );
+    aParam->Observer().ContinueExecutionL( *this );
+    CleanupStack::PopAndDestroy ( aParam );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::GetChildrenUidsL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::GetChildrenUidsL( RArray<TUid>& aUids,
+        TSortOrder aOrder ) const
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( (aOrder == ENotSorted || aOrder == ESortByPosition),
+                     Panic( EDiagPluginBasePanicBadArgument ) );
+
+    TInt count = iData->iChildren.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        aUids.AppendL( iData->iChildren[i]->Uid() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagSuitePlugin
+// CDiagSuitePluginBase::ExecutionStopL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagSuitePluginBase::ExecutionStopL( TStopReason /* aReason */ )
+    {
+        // Currently, GetTitleL() is not supported.
+        User::Leave( KErrNotSupported );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagSuitePluginBase::RunWaitingDialogLD
+// ---------------------------------------------------------------------------
+EXPORT_C TBool CDiagSuitePluginBase::RunWaitingDialogL( CAknDialog* aDialog, 
+        TInt& aDialogResponse )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    // this function can display only one dialog at a time.
+    __ASSERT_ALWAYS( iData->iWaitingDialogWrapper == NULL,
+                     Panic( EDiagPluginBasePanicDialogAlreadyUp ) );
+
+    iData->iWaitingDialogWrapper = CDiagPluginWaitingDialogWrapper::NewL( aDialog );
+
+    TBool isUserResonse = iData->iWaitingDialogWrapper->RunLD( aDialogResponse );
+
+    if ( isUserResonse )
+        {
+        // local variable can be accessed only if it was returned due to
+        // user response.
+        iData->iWaitingDialogWrapper = NULL;
+        }
+
+    return isUserResonse;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagSuitePluginBase::DismissWaitingDialog
+// ---------------------------------------------------------------------------
+EXPORT_C void CDiagSuitePluginBase::DismissWaitingDialog()
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    if ( iData->iWaitingDialogWrapper )
+        {
+        LOGSTRING( "CDiagTestPluginBase::DismissWaitingDialog() Dialog dismissed." )
+        delete iData->iWaitingDialogWrapper;
+        iData->iWaitingDialogWrapper = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagSuitePluginBase::CoeEnv
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeEnv& CDiagSuitePluginBase::CoeEnv() 
+    {
+    return iCoeEnv;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagpluginbase/src/diagtestpluginbase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1049 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagTestPluginBase
+*
+*/
+
+
+// CLASS DECLARATION
+#include <DiagTestPluginBase.h>
+
+// SYSTEM INCLUDE FILES
+#include <coemain.h>                        // CCoeEnv::Static()
+#include <DiagTestExecParam.h>              // TDiagTestExecParam
+#include <DiagResultsDbItemBuilder.h>       // CDiagResultsDbItemBuilder
+#include <DiagTestObserver.h>               // MDiagTestObserver
+#include <DiagPluginConstructionParam.h>    // CDiagPluginConstructionParam
+#include <DiagFrameworkDebug.h>             // LOGSTRING
+#include <DiagResultDetailBasic.h>          // CDiagResultDetailBasic
+#include <DiagEngineCommon.h>               // MDiagEngineCommon
+#include <DiagPluginPool.h>                 // CDiagPluginPool
+#include <DiagResultsDatabase.h>            // RDiagResultsDatabase
+#include <DiagPluginWaitingDialogWrapper.h> // CDiagPluginWaitingDialogWrapper
+#include <DiagPluginExecPlan.h>             // MDiagPluginExecPlan
+#include <DiagSuitePlugin.h>                // MDiagSuitePlugin
+// ADO & Platformization Changes
+#include <avkon.hrh>						// EAknSoftkeyYes
+
+// USER INCLUDE FILES
+#include "diagpluginbaseutils.h"            // DiagPluginBaseUtils
+#include "diagpluginbase.pan"               // Panic Codes
+
+// CONSTANTS
+
+// priority of result value. Entries that are earlier have higher priority
+static const CDiagResultsDatabaseItem::TResult KResultPriority[] = 
+    {
+    CDiagResultsDatabaseItem::EQueuedToRun,
+    CDiagResultsDatabaseItem::EDependencyFailed,
+    CDiagResultsDatabaseItem::EFailed,       
+    CDiagResultsDatabaseItem::ECancelled,    
+    CDiagResultsDatabaseItem::ESkipped,      
+    CDiagResultsDatabaseItem::EInterrupted,  
+    CDiagResultsDatabaseItem::EWatchdogCancel,
+    CDiagResultsDatabaseItem::ENotPerformed, 
+    CDiagResultsDatabaseItem::ESuspended,    
+    CDiagResultsDatabaseItem::ESuccess
+    };
+
+static const TInt KResultPriorityCount = 
+    sizeof( KResultPriority ) / sizeof( CDiagResultsDatabaseItem::TResult );
+
+// LOCAL TYPES
+class CDiagTestPluginBase::TPrivateData
+    {
+public:     // Constructor
+    // Note that this is not a C-class, and ALL member must be explicitly initialized.
+    TPrivateData( CCoeEnv& aCoeEnv )
+        :   iDtorIdKey( TUid::Null() ),
+            iPluginResourceLoader( aCoeEnv ),
+            iWaitingDialogWrapper( NULL ),
+            iResultBuilder( NULL ),
+            iExecParam( NULL ),
+            iCustomParam( NULL ),
+            iDependencyCheckSkipped( EFalse ),
+            iDependencyExecution( EFalse ),
+            iSinglePluginExecution( EFalse ),
+            iWatchdogResultType( CDiagResultsDatabaseItem::EWatchdogCancel )
+        {}
+    
+public:
+    /**
+    * ECOM Destructor key.
+    */
+    TUid iDtorIdKey;
+
+    /**
+    * Resource loader for derived class resource.
+    */
+    RConeResourceLoader iPluginResourceLoader;
+
+    /**
+    * Wrapper class for displaying waiting dialogs.
+    * Ownership: Shared. Normally, dialog will dismiss itself. However,
+    * if plug-in is being deleted, it can be deleted by the plug-in as well.
+    */
+    CDiagPluginWaitingDialogWrapper* iWaitingDialogWrapper;
+
+    /**
+    * Results Db Item Builder. This will be used to build the result db item.
+    * Owneship: this.
+    */
+    CDiagResultsDbItemBuilder*  iResultBuilder;
+
+    /**
+    * Test execution parameter.
+    * Ownership: this.
+    */
+    TDiagTestExecParam* iExecParam;
+
+    /**
+    * Custom test execution parameter
+    * Ownership: Does not own. Owned by application.
+    */
+    TAny* iCustomParam;
+
+    /**
+    * This indicates whether this test session has skipped dependency check.
+    */
+    TBool iDependencyCheckSkipped;
+
+    /**
+    * This indicates whether this test is being executed to satisfy dependency.
+    */
+    TBool iDependencyExecution;
+
+    /**
+    * Indicates if the plugin is run as a single plugin
+    * or as a part of suite
+    */
+    TBool iSinglePluginExecution;
+
+    /**
+    * Result type to use when watchdog is timed out.
+    */
+    CDiagResultsDatabaseItem::TResult iWatchdogResultType;
+    };
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::CDiagTestPluginBase
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagTestPluginBase::CDiagTestPluginBase( 
+        CDiagPluginConstructionParam* aParam )
+    :   CActive( EPriorityStandard ),
+        iConstructionParam( aParam ),
+        iCoeEnv ( *CCoeEnv::Static() )
+    {
+    __ASSERT_ALWAYS( aParam, Panic( EDiagPluginBasePanicBadArgument ) );
+
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::BaseConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::BaseConstructL( const TDesC& aResourceFileName )
+    {
+    iData = new ( ELeave ) TPrivateData( CoeEnv() );
+        
+    DiagPluginBaseUtils::OpenResourceFileL(
+        aResourceFileName, iData->iPluginResourceLoader, CoeEnv().FsSession() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::~CDiagTestPluginBase
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagTestPluginBase::~CDiagTestPluginBase()
+    {
+    if ( iData )
+        {
+        // In case test was still running, clean up.
+        // It takes care of:
+        //  iData->iWaitingDialog
+        //  iData->iIsDialogDismessedByUserResponsePtr
+        //  iData->iResultBuilder
+        //  iData->iExecParam
+        // It must be trapped, since it is part of object destruction.
+        TRAPD( err, StopAndCleanupL() );
+        if ( err != KErrNone )
+            {
+            LOGSTRING3( "CDiagTestPluginBase::~CDiagTestPluginBase(). "
+                L"StopAndCleaupL() failed Uid = 0x%08x , err = %d",
+                Uid(),
+                err );
+            }
+
+        // Call DestroyedImplementation only if it was set.
+        // SetDtorIdKey may not have been called if it is not actually an
+        // ECOM plug-in.
+        if ( iData->iDtorIdKey != TUid::Null() )
+            {
+            REComSession::DestroyedImplementation( iData->iDtorIdKey );
+            }
+
+        iData->iPluginResourceLoader.Close();
+
+        delete iData;
+        iData = NULL;
+        }
+
+    delete iConstructionParam;
+    iConstructionParam = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CDiagTestPluginBase::RunError
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagTestPluginBase::RunError( TInt aError )
+    {
+    LOGSTRING2( "CDiagTestPluginBase::RunError( %d )", aError )
+    
+    // Check if we are executing a test.
+    if ( iData->iExecParam != NULL )
+        {
+        // Catch error from CompleteTestL. If there is an error while calling
+        // CompleteTestL(), return the error to active scheduler.
+        aError = KErrNone;
+        TRAP( aError, CompleteTestL( CDiagResultsDatabaseItem::EFailed ) );
+        }
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::GetServiceLogicalNameL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CDiagTestPluginBase::ServiceLogicalName() const
+    {
+    return iConstructionParam->ServiceProvided();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::GetLogicalDependenciesL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::GetLogicalDependenciesL( 
+        CPtrCArray& aArray ) const
+    {       
+    aArray.CopyL( iConstructionParam->ServicesRequired() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::Type
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MDiagPlugin::TPluginType CDiagTestPluginBase::Type() const
+    {
+    return ETypeTestPlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::CreateIconL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGulIcon* CDiagTestPluginBase::CreateIconL() const
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::IsSupported
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagTestPluginBase::IsSupported() const
+    {
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::ParentUid
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid CDiagTestPluginBase::ParentUid() const
+    {
+    return iConstructionParam->ParentUid();
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::Order
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint CDiagTestPluginBase::Order() const
+    {
+    return iConstructionParam->Order();
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::SetDtorIdKey
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::SetDtorIdKey( TUid aDtorIdKey )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    LOGSTRING3( "CDiagTestPluginBase::SetDtorIdKey: Old=0x%x, New=0x%x",
+        iData->iDtorIdKey.iUid, aDtorIdKey.iUid )
+    iData->iDtorIdKey = aDtorIdKey;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::GetTitleL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CDiagTestPluginBase::GetTitleL() const
+    {
+    // Currently, GetTitleL() is not supported.
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::GetDescriptionL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CDiagTestPluginBase::GetDescriptionL() const
+    {
+    // Currently, GetDescriptionL() is not supported.
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::CustomOperationL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAny* CDiagTestPluginBase::CustomOperationL( TUid /* aUid */, 
+        TAny* /* aParam */ ) 
+    {
+    LOGSTRING( "CDiagTestPluginBase::CustomOperationL: KErrNotSupported" )
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::GetCustomL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAny* CDiagTestPluginBase::GetCustomL( TUid /* aUid*/,
+                                                TAny* /* aParam */ )
+    {
+    LOGSTRING( "CDiagTestPluginBase::GetCustomL: KErrNotSupported" )
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::TestSessionBeginL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::TestSessionBeginL( 
+        MDiagEngineCommon& /* aEngine */,
+        TBool /* aSkipDependencyCheck */,
+        TAny* /* aCustomParams */ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::TestSessionEndL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::TestSessionEndL( 
+        MDiagEngineCommon& /* aEngine */,
+        TBool /* aSkipDependencyCheck */,
+        TAny* /* aCustomParams */ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From CDiagTestPluginBase
+// CDiagTestPluginBase::RunTestL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::RunTestL( 
+        TDiagTestExecParam* aExecParam,
+        TBool aSkipDependencyCheck,
+        TBool aDependencyExecution,
+        TAny* aCustomParam ) 
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_DEBUG( iData->iExecParam == NULL, Panic( EDiagPluginBasePanicInternal ) );
+    __ASSERT_DEBUG( iData->iResultBuilder == NULL, Panic( EDiagPluginBasePanicInternal ) );
+    delete iData->iExecParam;
+    delete iData->iResultBuilder;
+
+    iData->iExecParam = aExecParam;
+    iData->iCustomParam = aCustomParam;
+    iData->iDependencyCheckSkipped = aSkipDependencyCheck;
+    iData->iDependencyExecution = aDependencyExecution;
+    iData->iResultBuilder = CDiagResultsDbItemBuilder::NewL( Uid(), aDependencyExecution );
+    ResetWatchdogToDefault();
+
+    // checking if this is a single test execution or not 
+    iData->iSinglePluginExecution = 
+        ( aExecParam->Engine().ExecutionPlanL().TestCount( EFalse ) == 1 );
+
+    // verify that dependencies are satisfied.
+    RArray<TUid>* failedUids = NULL;
+    CDiagResultsDatabaseItem::TResult dependencyResult = CDiagResultsDatabaseItem::ESuccess;
+
+    if ( !aSkipDependencyCheck )
+        {
+        dependencyResult =  VerifyDependenciesL( 
+            aExecParam->Engine(),
+            failedUids );
+        }
+	
+    if(dependencyResult == CDiagResultsDatabaseItem::ESuccess)
+	LOGSTRING( "This is to remove compiler warning");
+	
+
+    if ( failedUids )
+        {
+        failedUids->Reset();
+        failedUids->Close();
+        delete failedUids;
+        failedUids = NULL;
+        }
+    DoRunTestL();
+    /*if ( dependencyResult == CDiagResultsDatabaseItem::ESuccess )
+        {
+        
+        }
+    else
+        {
+        // Create dependency failed test result and send it to engine.
+        // Note that we can't actually call CompleteTestL(), or StopAndCleanupL() 
+        // here because we haven't actually called the derived class.
+        // So, reporting and clean up must be done manually.
+
+        // Map dependent test result to what we should report.
+        switch ( dependencyResult )
+            {
+            case CDiagResultsDatabaseItem::EFailed:
+                dependencyResult = CDiagResultsDatabaseItem::EDependencyFailed;
+                break;
+            
+            case CDiagResultsDatabaseItem::EWatchdogCancel:
+            case CDiagResultsDatabaseItem::ESkipped:
+            case CDiagResultsDatabaseItem::EInterrupted:
+            case CDiagResultsDatabaseItem::ENotPerformed:
+                dependencyResult = CDiagResultsDatabaseItem::EDependencySkipped;
+                break;
+
+            default:
+                // no change is needed.
+                break;
+            }
+
+        iData->iResultBuilder->SetTestCompleted( dependencyResult );
+
+        iData->iExecParam->Observer().TestExecutionCompletedL( *this,
+            iData->iResultBuilder->ToResultsDatabaseItemL() );
+
+        BaseStopAndCleanup();
+        }*/
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::ExecutionParam
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TDiagTestExecParam& CDiagTestPluginBase::ExecutionParam()
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+    return *(iData->iExecParam);
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::IsDependencyCheckSkipped
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagTestPluginBase::IsDependencyCheckSkipped() const
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+    return iData->iDependencyCheckSkipped;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::IsDependencyExecution
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagTestPluginBase::IsDependencyExecution() const
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+    return iData->iDependencyExecution;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::CustomParam
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAny* CDiagTestPluginBase::CustomParam() const
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+    return iData->iCustomParam;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::ResultsDbItemBuilder
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDbItemBuilder& CDiagTestPluginBase::ResultsDbItemBuilder()
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iResultBuilder, Panic( EDiagPluginBasePanicInvalidState ) );
+    return *(iData->iResultBuilder);
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::ReportTestProgressL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::ReportTestProgressL( TUint aCurrentStep )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    iData->iExecParam->Observer().TestProgressL( *this, aCurrentStep );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::ResetWatchdog(
+        TDiagEngineWatchdogTypes aWatchdogType,
+        CDiagResultsDatabaseItem::TResult aWatchdogResultType )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    LOGSTRING3( "CDiagTestPluginBase::ResetWatchdog() Type = %d, result = %d",
+        aWatchdogType, aWatchdogResultType )
+
+    iData->iWatchdogResultType = aWatchdogResultType;
+    iData->iExecParam->Engine().ResetWatchdog( aWatchdogType );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::ResetWatchdog
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::ResetWatchdog(
+        TInt aTimeToCompletion,
+        CDiagResultsDatabaseItem::TResult aWatchdogResultType )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    LOGSTRING3( "CDiagTestPluginBase::ResetWatchdog() time = %d, result = %d",
+        aTimeToCompletion, aWatchdogResultType )
+
+    iData->iWatchdogResultType = aWatchdogResultType;
+    iData->iExecParam->Engine().ResetWatchdog( aTimeToCompletion );
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::ResetWatchdogToDefault
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::ResetWatchdogToDefault()
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    if ( RunMode() == EAutomatic )
+        {
+        ResetWatchdog( EDiagEngineWatchdogTypeAutomatic, 
+                       CDiagResultsDatabaseItem::EWatchdogCancel );
+        }
+    else
+        {
+        ResetWatchdog( EDiagEngineWatchdogTypeInteractive, 
+                       CDiagResultsDatabaseItem::EWatchdogCancel );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::CompleteTestL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::CompleteTestL( 
+        CDiagResultsDatabaseItem::TResult aResult )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iResultBuilder, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    iData->iResultBuilder->SetTestCompleted( aResult );
+    iData->iExecParam->Observer().TestExecutionCompletedL( *this, 
+        iData->iResultBuilder->ToResultsDatabaseItemL() );
+
+    StopAndCleanupL();
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::StopAndCleanupL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::StopAndCleanupL()
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    // Cancel active request
+    Cancel();
+
+    // Clean up only if it was already running.
+    if ( iData->iExecParam != NULL || iData->iResultBuilder != NULL )
+        {
+        // allow derived class to clean up first.
+        DoStopAndCleanupL();
+
+        BaseStopAndCleanup();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// from MDiagTestPlugin
+// CDiagTestPluginBase::ExecutionStopL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem* CDiagTestPluginBase::ExecutionStopL( 
+        MDiagTestPlugin::TStopReason aReason )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iResultBuilder, Panic( EDiagPluginBasePanicInvalidState ) );
+    __ASSERT_ALWAYS( iData->iExecParam, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    // Determine default reason.
+    CDiagResultsDatabaseItem::TResult result;
+
+    if ( aReason == MDiagTestPlugin::EWatchdog )
+        {
+        result = iData->iWatchdogResultType;
+        }
+    else
+        {
+        result = CDiagResultsDatabaseItem::EInterrupted;
+        }
+
+    // Allow derived class to provide custom behavor
+    DoExecutionStopL( aReason, result );
+
+    iData->iResultBuilder->SetTestCompleted( result );
+
+    CDiagResultsDatabaseItem* dbItem = iData->iResultBuilder->ToResultsDatabaseItemL();
+
+    // Stop and clean up before returning to the engine.
+    CleanupStack::PushL( dbItem );
+    StopAndCleanupL();
+    CleanupStack::Pop( dbItem );
+    
+    return dbItem;  // ownership transfer
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::SuspendL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::SuspendL()
+    {
+    LOGSTRING( "CDiagTestPluginBase::SuspendL: KErrNotSupported" )
+    User::Leave( KErrNotSupported );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::ResumeL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::ResumeL()
+    {
+    LOGSTRING( "CDiagTestPluginBase::ResumeL: KErrNotSupported" )
+    User::Leave( KErrNotSupported );
+    }
+
+// ---------------------------------------------------------------------------
+// From MDiagTestPlugin
+// CDiagTestPluginBase::CreateDetailL
+// ---------------------------------------------------------------------------
+EXPORT_C MDiagResultDetail* CDiagTestPluginBase::CreateDetailL(
+            const CDiagResultsDatabaseItem& aResult ) const        
+    {
+    // Use basic version by default
+    return new( ELeave )CDiagResultDetailBasic( aResult.TestResult() ); 
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::DoExecutionStopL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagTestPluginBase::DoExecutionStopL( 
+        MDiagTestPlugin::TStopReason /* aReason */,
+        CDiagResultsDatabaseItem::TResult& /* aTestResult */ )
+    {
+    // default implementation. Does nothing.
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::AreDependenciesSatisfiedL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagTestPluginBase::AreDependenciesSatisfiedL(
+            MDiagEngineCommon& aEngine,
+            RArray<TUid>*& aFailedUids ) const
+    {
+    CDiagResultsDatabaseItem::TResult result = VerifyDependenciesL( aEngine, aFailedUids );
+
+    return result == CDiagResultsDatabaseItem::ESuccess;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::VerifyDependenciesL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem::TResult CDiagTestPluginBase::VerifyDependenciesL(
+        MDiagEngineCommon& aEngine,
+        RArray< TUid >*& aFailedUids ) const
+    {
+    // Create a failed uid list array
+    RArray<TUid>* failedUids = new( ELeave )RArray<TUid>();
+    CleanupStack::PushL( failedUids );  // to delete array itself.
+    CleanupClosePushL( *failedUids );   // to call close.
+
+    // First, convert dependency list to a plugin list
+    RPointerArray< MDiagTestPlugin > pluginList;
+    CleanupClosePushL( pluginList );    // destroy not needed since elements are not owned.
+
+    // Expand suites.
+    GetAllDependentTestsL( aEngine, pluginList );
+
+    // Analyze result of each plug-in.
+    CDiagResultsDatabaseItem::TResult result = 
+        SummarizeOverallTestResultsL( aEngine, pluginList, *failedUids );
+
+    CleanupStack::PopAndDestroy( &pluginList ); // pluginList.Close()
+
+    if ( result == CDiagResultsDatabaseItem::ESuccess )
+        {
+        __ASSERT_DEBUG( failedUids->Count() == 0,
+            Panic( EDiagPluginBasePanicInternal ) );
+        CleanupStack::PopAndDestroy( failedUids ); // call close.
+        CleanupStack::PopAndDestroy( failedUids ); // delete RArray
+        failedUids = NULL;
+        }
+    else
+        {
+        __ASSERT_DEBUG( failedUids->Count() > 0,
+            Panic( EDiagPluginBasePanicInternal ) );
+        CleanupStack::Pop( failedUids ); // call close.
+        CleanupStack::Pop( failedUids ); // delete RArray
+        }
+
+    aFailedUids = failedUids;
+
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::GetAllDependentTestsL
+// ---------------------------------------------------------------------------
+//
+void CDiagTestPluginBase::GetAllDependentTestsL( 
+        MDiagEngineCommon& aEngine,
+        RPointerArray< MDiagTestPlugin >& aPluginList ) const
+    {
+    TInt i = 0;
+
+    // first create an array of dependent plug-ins.
+    RPointerArray< MDiagPlugin > mixedPluginList;
+    CleanupClosePushL( mixedPluginList );   // to call close.
+
+    CPtrCArray* dependencyList = new( ELeave )CPtrCArray( 1 );
+    CleanupStack::PushL( dependencyList );
+    GetLogicalDependenciesL( *dependencyList );
+
+    TInt count = dependencyList->Count();
+    for ( i = 0;  i < count; i++ )
+        {
+        MDiagPlugin* plugin = NULL;
+        User::LeaveIfError( aEngine.PluginPool().FindPlugin( ( *dependencyList )[i], plugin ) );
+        mixedPluginList.AppendL( plugin );
+        }
+
+    CleanupStack::PopAndDestroy( dependencyList );
+    dependencyList = NULL;
+
+    // expand suites into tests.
+    i = 0;
+    while ( i < mixedPluginList.Count() )
+        {
+        if ( mixedPluginList[i]->Type() == ETypeTestPlugin )
+            {
+            //  test plug-in. move to next item.
+            aPluginList.AppendL( static_cast< MDiagTestPlugin* >( mixedPluginList[i] ) );
+            i++;
+            }
+        else
+            {
+            // suite. remove and replace them with its children.
+            MDiagSuitePlugin& suitePlugin = 
+                static_cast< MDiagSuitePlugin& >( *mixedPluginList[i] );
+
+            mixedPluginList.Remove( i );
+            
+            RPointerArray<MDiagPlugin> children;
+            CleanupClosePushL( children ); // destroy not needed since ownership not transferred.
+
+            suitePlugin.GetChildrenL( children, MDiagSuitePlugin::ESortByPosition );
+
+            TInt childCount = children.Count();
+            for ( TInt childIndex = 0; childIndex < childCount; childIndex++ )
+                {
+                mixedPluginList.InsertL( children[childIndex], i + childIndex );
+                }
+
+            CleanupStack::PopAndDestroy( &children ); // children.Close()
+            // do not increment 'i' to allow re-examination of item just inserted.
+            }
+        }
+
+    CleanupStack::PopAndDestroy( &mixedPluginList ); // mixedPluginList.Close()
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::SummarizeOverallTestResultsL
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDatabaseItem::TResult CDiagTestPluginBase::SummarizeOverallTestResultsL(
+        MDiagEngineCommon& aEngine,
+        const RPointerArray< MDiagTestPlugin >& aPluginList,
+        RArray< TUid >& aFailedUidList ) const
+    {
+    // Check result of each item.
+    // and the result will override it.
+    // by default, we start with ESuccess.
+    CDiagResultsDatabaseItem::TResult result = CDiagResultsDatabaseItem::ESuccess;
+    TInt pluginListCount = aPluginList.Count();
+    for ( TInt i = 0; i < pluginListCount; i++ )
+        {
+        MDiagTestPlugin& plugin = *( aPluginList[i] );
+
+        CDiagResultsDatabaseItem* resultItem = NULL;
+        TInt err = aEngine.DbRecord().GetTestResult( plugin.Uid(), resultItem );
+
+        // KErrNotFound is acceptable.
+        if ( err != KErrNone && err != KErrNotFound )
+            {
+            delete resultItem;
+            User::Leave( err );
+            }
+
+        CDiagResultsDatabaseItem::TResult newResult;
+        if ( resultItem == NULL )
+            {
+            newResult = CDiagResultsDatabaseItem::EQueuedToRun; 
+            }
+        else
+            {
+            newResult = resultItem->TestResult();
+            }
+        
+        delete resultItem;
+        resultItem = NULL;
+
+        // add items to failed list if not successful.
+        if ( newResult != CDiagResultsDatabaseItem::ESuccess )
+            {
+            LOGSTRING3( "CDiagTestPluginBase::SummarizeOverallTestResultsL(): "
+                L"Failed test 0x%08x, result = %d", 
+                plugin.Uid().iUid,
+                newResult )
+            aFailedUidList.AppendL( plugin.Uid() );
+            }
+
+        // update to new result based on result priority.
+        // check for condition where newResult == result. If they are equal
+        // there is no reason to run the loop.
+        for ( TInt priorityIndex = 0; 
+              priorityIndex < KResultPriorityCount && newResult != result;
+              priorityIndex++ )
+            {
+            if ( KResultPriority[priorityIndex] == newResult )
+                {
+                result = newResult;
+                }
+            }
+        }
+
+    LOGSTRING3( "CDiagTestPluginBase::SummarizeOverallTestResultsL(): "
+        L"Plugin 0x%08x Overall depencency result = %d", 
+        Uid().iUid,
+        result )
+    return result;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::RunWaitingDialogL
+// ---------------------------------------------------------------------------
+EXPORT_C TBool CDiagTestPluginBase::RunWaitingDialogL( CAknDialog* aDialog, 
+        TInt& aDialogResponse )
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    // this function can display only one dialog at a time.
+    __ASSERT_ALWAYS( iData->iWaitingDialogWrapper == NULL,
+                     Panic( EDiagPluginBasePanicDialogAlreadyUp ) );
+
+    iData->iWaitingDialogWrapper = CDiagPluginWaitingDialogWrapper::NewL( aDialog );
+
+    TBool isUserResonse = iData->iWaitingDialogWrapper->RunLD( aDialogResponse );
+
+    if ( isUserResonse )
+        {
+        // local variable can be accessed only if it was returned due to
+        // user response.
+        iData->iWaitingDialogWrapper = NULL;
+        }
+
+    return isUserResonse;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::DismissWaitingDialog
+// ---------------------------------------------------------------------------
+EXPORT_C void CDiagTestPluginBase::DismissWaitingDialog()
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+
+    if ( iData->iWaitingDialogWrapper )
+        {
+        LOGSTRING( "CDiagTestPluginBase::DismissWaitingDialog() Dialog dismissed." )
+        delete iData->iWaitingDialogWrapper;
+        iData->iWaitingDialogWrapper = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::CoeEnv
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeEnv& CDiagTestPluginBase::CoeEnv() 
+    {
+    return iCoeEnv;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::SinglePluginExecution
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagTestPluginBase::SinglePluginExecution() const
+    {
+    __ASSERT_ALWAYS( iData, Panic( EDiagPluginBasePanicInvalidState ) );
+    return iData->iSinglePluginExecution;
+    }
+
+// ---------------------------------------------------------------------------
+// CDiagTestPluginBase::BaseStopAndCleanup
+// ---------------------------------------------------------------------------
+//
+void CDiagTestPluginBase::BaseStopAndCleanup()
+    {
+    DismissWaitingDialog();
+
+    delete iData->iResultBuilder;
+    iData->iResultBuilder = NULL;
+
+    delete iData->iExecParam;
+    iData->iExecParam = NULL;
+
+    iData->iCustomParam = NULL;
+    }
+
+// ADO & Platformization Changes
+/*
+    
+// ---------------------------------------------------------------------------
+// CDiagSpeakerPlugin::AskCancelExecutionL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagTestPluginBase::AskCancelExecutionL( TInt& aButtonId )
+    {
+    LOGSTRING( "CDiagTestPluginBase::AskCancelExecutionL() IN" )
+
+    CAknDialog* dialog;
+    TBool       result;
+
+    // set softkey for single execution
+    if ( !SinglePluginExecution() )
+        {
+    	// Create common dialog by invoking Engine
+    	dialog = ExecutionParam().Engine().
+             CreateCommonDialogLC( EDiagCommonDialogConfirmCancelAll, NULL );
+
+    	// Launch dialog and get result from it
+    	result = RunWaitingDialogL( dialog, aButtonId );
+	}	
+    else 
+       {
+       CompleteTestL( CDiagResultsDatabaseItem::ECancelled );	
+       aButtonId = EAknSoftkeyYes;
+       return ETrue;
+       }
+    
+    LOGSTRING3( "CDiagTestPluginBase::AskCancelExecutionL() OUT aButtonId=%d result=%d", aButtonId, result )
+    return result;
+    }
+    */
+// End of File
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/bwins/diagresultsdatabase.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,65 @@
+EXPORTS
+	??0RDiagResultsDatabase@@QAE@XZ @ 1 NONAME ; RDiagResultsDatabase::RDiagResultsDatabase(void)
+	??0RDiagResultsDatabaseRecord@@QAE@XZ @ 2 NONAME ; RDiagResultsDatabaseRecord::RDiagResultsDatabaseRecord(void)
+	??0TDiagResultsDatabaseTestRecordInfo@@QAE@XZ @ 3 NONAME ; TDiagResultsDatabaseTestRecordInfo::TDiagResultsDatabaseTestRecordInfo(void)
+	??0TDiagResultsDbRecordInfoArrayPacked@@QAE@AAPAVCBufFlat@@@Z @ 4 NONAME ; TDiagResultsDbRecordInfoArrayPacked::TDiagResultsDbRecordInfoArrayPacked(class CBufFlat * &)
+	??1CDiagResultsDatabaseItem@@UAE@XZ @ 5 NONAME ; CDiagResultsDatabaseItem::~CDiagResultsDatabaseItem(void)
+	??1CDiagResultsDbRecordEngineParam@@UAE@XZ @ 6 NONAME ; CDiagResultsDbRecordEngineParam::~CDiagResultsDbRecordEngineParam(void)
+	??1RDiagResultsDatabase@@QAE@XZ @ 7 NONAME ; RDiagResultsDatabase::~RDiagResultsDatabase(void)
+	??1RDiagResultsDatabaseRecord@@QAE@XZ @ 8 NONAME ; RDiagResultsDatabaseRecord::~RDiagResultsDatabaseRecord(void)
+	?CancelInitiateGetLastResults@RDiagResultsDatabase@@QBEXXZ @ 9 NONAME ; void RDiagResultsDatabase::CancelInitiateGetLastResults(void) const
+	?CancelLogTestResult@RDiagResultsDatabaseRecord@@QBEXXZ @ 10 NONAME ; void RDiagResultsDatabaseRecord::CancelLogTestResult(void) const
+	?Close@RDiagResultsDatabase@@QAEHXZ @ 11 NONAME ; int RDiagResultsDatabase::Close(void)
+	?Close@RDiagResultsDatabaseRecord@@QAEXXZ @ 12 NONAME ; void RDiagResultsDatabaseRecord::Close(void)
+	?Connect@RDiagResultsDatabase@@QAEHVTUid@@@Z @ 13 NONAME ; int RDiagResultsDatabase::Connect(class TUid)
+	?Connect@RDiagResultsDatabaseRecord@@QAEHAAVRDiagResultsDatabase@@VTUid@@H@Z @ 14 NONAME ; int RDiagResultsDatabaseRecord::Connect(class RDiagResultsDatabase &, class TUid, int)
+	?CreateNewRecord@RDiagResultsDatabaseRecord@@QAEHAAVRDiagResultsDatabase@@AAVTUid@@AAVCDiagResultsDbRecordEngineParam@@@Z @ 15 NONAME ; int RDiagResultsDatabaseRecord::CreateNewRecord(class RDiagResultsDatabase &, class TUid &, class CDiagResultsDbRecordEngineParam &)
+	?DRMTimeL@TDiagResultsDatabaseTestRecordInfo@@SA?AVTTime@@XZ @ 16 NONAME ; class TTime TDiagResultsDatabaseTestRecordInfo::DRMTimeL(void)
+	?DependencyExecution@CDiagResultsDbRecordEngineParam@@QBEHXZ @ 17 NONAME ; int CDiagResultsDbRecordEngineParam::DependencyExecution(void) const
+	?DetailsData@CDiagResultsDatabaseItem@@QBEPBVCBufFlat@@XZ @ 18 NONAME ; class CBufFlat const * CDiagResultsDatabaseItem::DetailsData(void) const
+	?ExecutionsUidArray@CDiagResultsDbRecordEngineParam@@QBEABV?$RArray@VTUid@@@@XZ @ 19 NONAME ; class RArray<class TUid> const & CDiagResultsDbRecordEngineParam::ExecutionsUidArray(void) const
+	?ExternalizeL@CDiagResultsDatabaseItem@@QBEXAAVRWriteStream@@@Z @ 20 NONAME ; void CDiagResultsDatabaseItem::ExternalizeL(class RWriteStream &) const
+	?ExternalizeL@CDiagResultsDbRecordEngineParam@@QBEXAAVRWriteStream@@@Z @ 21 NONAME ; void CDiagResultsDbRecordEngineParam::ExternalizeL(class RWriteStream &) const
+	?ExternalizeL@TDiagResultsDatabaseTestRecordInfo@@QBEXAAVRWriteStream@@@Z @ 22 NONAME ; void TDiagResultsDatabaseTestRecordInfo::ExternalizeL(class RWriteStream &) const
+	?GetAllRecordInfos@RDiagResultsDatabase@@QAEHAAV?$CArrayFixFlat@VTDiagResultsDatabaseTestRecordInfo@@@@@Z @ 23 NONAME ; int RDiagResultsDatabase::GetAllRecordInfos(class CArrayFixFlat<class TDiagResultsDatabaseTestRecordInfo> &)
+	?GetDatabaseMaximumSize@RDiagResultsDatabase@@SAHAAH@Z @ 24 NONAME ; int RDiagResultsDatabase::GetDatabaseMaximumSize(int &)
+	?GetEngineParam@RDiagResultsDatabaseRecord@@QBEHAAPAVCDiagResultsDbRecordEngineParam@@@Z @ 25 NONAME ; int RDiagResultsDatabaseRecord::GetEngineParam(class CDiagResultsDbRecordEngineParam * &) const
+	?GetLastNotCompletedRecord@RDiagResultsDatabase@@QBEHAAVTUid@@@Z @ 26 NONAME ; int RDiagResultsDatabase::GetLastNotCompletedRecord(class TUid &) const
+	?GetLastRecord@RDiagResultsDatabase@@QBEHAAVTUid@@@Z @ 27 NONAME ; int RDiagResultsDatabase::GetLastRecord(class TUid &) const
+	?GetLastResult@RDiagResultsDatabase@@QAEHAAPAVCDiagResultsDatabaseItem@@@Z @ 28 NONAME ; int RDiagResultsDatabase::GetLastResult(class CDiagResultsDatabaseItem * &)
+	?GetLastResults@RDiagResultsDatabase@@QBEHAAV?$RPointerArray@VCDiagResultsDatabaseItem@@@@@Z @ 29 NONAME ; int RDiagResultsDatabase::GetLastResults(class RPointerArray<class CDiagResultsDatabaseItem> &) const
+	?GetRecordCount@RDiagResultsDatabase@@QBEHAAI@Z @ 30 NONAME ; int RDiagResultsDatabase::GetRecordCount(unsigned int &) const
+	?GetRecordInfo@RDiagResultsDatabaseRecord@@QBEHAAVTDiagResultsDatabaseTestRecordInfo@@@Z @ 31 NONAME ; int RDiagResultsDatabaseRecord::GetRecordInfo(class TDiagResultsDatabaseTestRecordInfo &) const
+	?GetRecordUids@RDiagResultsDatabase@@QBEHAAV?$CArrayFixFlat@VTUid@@@@@Z @ 32 NONAME ; int RDiagResultsDatabase::GetRecordUids(class CArrayFixFlat<class TUid> &) const
+	?GetStatus@RDiagResultsDatabaseRecord@@QBEHAAW4TRecordStatus@1@@Z @ 33 NONAME ; int RDiagResultsDatabaseRecord::GetStatus(enum RDiagResultsDatabaseRecord::TRecordStatus &) const
+	?GetTestRecordId@RDiagResultsDatabaseRecord@@QBEHAAVTUid@@@Z @ 34 NONAME ; int RDiagResultsDatabaseRecord::GetTestRecordId(class TUid &) const
+	?GetTestResult@RDiagResultsDatabaseRecord@@QBEHVTUid@@AAPAVCDiagResultsDatabaseItem@@@Z @ 35 NONAME ; int RDiagResultsDatabaseRecord::GetTestResult(class TUid, class CDiagResultsDatabaseItem * &) const
+	?GetTestResults@RDiagResultsDatabaseRecord@@QBEHAAV?$RPointerArray@VCDiagResultsDatabaseItem@@@@@Z @ 36 NONAME ; int RDiagResultsDatabaseRecord::GetTestResults(class RPointerArray<class CDiagResultsDatabaseItem> &) const
+	?GetTestUids@RDiagResultsDatabaseRecord@@QBEHAAV?$CArrayFixFlat@VTUid@@@@@Z @ 37 NONAME ; int RDiagResultsDatabaseRecord::GetTestUids(class CArrayFixFlat<class TUid> &) const
+	?InitiateGetLastResult@RDiagResultsDatabase@@QAEXVTUid@@AAVTRequestStatus@@@Z @ 38 NONAME ; void RDiagResultsDatabase::InitiateGetLastResult(class TUid, class TRequestStatus &)
+	?InitiateGetLastResults@RDiagResultsDatabase@@QAEXABV?$CArrayFixFlat@VTUid@@@@AAVTRequestStatus@@@Z @ 39 NONAME ; void RDiagResultsDatabase::InitiateGetLastResults(class CArrayFixFlat<class TUid> const &, class TRequestStatus &)
+	?InternalizeL@CDiagResultsDatabaseItem@@AAEXAAVRReadStream@@@Z @ 40 NONAME ; void CDiagResultsDatabaseItem::InternalizeL(class RReadStream &)
+	?InternalizeL@CDiagResultsDbRecordEngineParam@@AAEXAAVRReadStream@@@Z @ 41 NONAME ; void CDiagResultsDbRecordEngineParam::InternalizeL(class RReadStream &)
+	?InternalizeL@TDiagResultsDatabaseTestRecordInfo@@QAEXAAVRReadStream@@@Z @ 42 NONAME ; void TDiagResultsDatabaseTestRecordInfo::InternalizeL(class RReadStream &)
+	?IsSuspended@RDiagResultsDatabaseRecord@@QBEHAAH@Z @ 43 NONAME ; int RDiagResultsDatabaseRecord::IsSuspended(int &) const
+	?IsTestCompleted@RDiagResultsDatabaseRecord@@QBEHAAH@Z @ 44 NONAME ; int RDiagResultsDatabaseRecord::IsTestCompleted(int &) const
+	?LogTestResult@RDiagResultsDatabaseRecord@@QAEHAAVTRequestStatus@@ABVCDiagResultsDatabaseItem@@@Z @ 45 NONAME ; int RDiagResultsDatabaseRecord::LogTestResult(class TRequestStatus &, class CDiagResultsDatabaseItem const &)
+	?NewL@CDiagResultsDatabaseItem@@SAPAV1@AAVRReadStream@@@Z @ 46 NONAME ; class CDiagResultsDatabaseItem * CDiagResultsDatabaseItem::NewL(class RReadStream &)
+	?NewL@CDiagResultsDatabaseItem@@SAPAV1@ABV1@@Z @ 47 NONAME ; class CDiagResultsDatabaseItem * CDiagResultsDatabaseItem::NewL(class CDiagResultsDatabaseItem const &)
+	?NewL@CDiagResultsDatabaseItem@@SAPAV1@VTUid@@HW4TResult@1@VTTime@@2PAVCBufFlat@@@Z @ 48 NONAME ; class CDiagResultsDatabaseItem * CDiagResultsDatabaseItem::NewL(class TUid, int, enum CDiagResultsDatabaseItem::TResult, class TTime, class TTime, class CBufFlat *)
+	?NewL@CDiagResultsDbRecordEngineParam@@SAPAV1@AAVRReadStream@@@Z @ 49 NONAME ; class CDiagResultsDbRecordEngineParam * CDiagResultsDbRecordEngineParam::NewL(class RReadStream &)
+	?NewL@CDiagResultsDbRecordEngineParam@@SAPAV1@PAV?$RArray@VTUid@@@@H@Z @ 50 NONAME ; class CDiagResultsDbRecordEngineParam * CDiagResultsDbRecordEngineParam::NewL(class RArray<class TUid> *, int)
+	?NewLC@CDiagResultsDatabaseItem@@SAPAV1@VTUid@@HW4TResult@1@VTTime@@2PAVCBufFlat@@@Z @ 51 NONAME ; class CDiagResultsDatabaseItem * CDiagResultsDatabaseItem::NewLC(class TUid, int, enum CDiagResultsDatabaseItem::TResult, class TTime, class TTime, class CBufFlat *)
+	?NewLC@CDiagResultsDbRecordEngineParam@@SAPAV1@PAV?$RArray@VTUid@@@@H@Z @ 52 NONAME ; class CDiagResultsDbRecordEngineParam * CDiagResultsDbRecordEngineParam::NewLC(class RArray<class TUid> *, int)
+	?PackArrayL@TDiagResultsDbRecordInfoArrayPacked@@QAEXABV?$CArrayFixFlat@VTDiagResultsDatabaseTestRecordInfo@@@@@Z @ 53 NONAME ; void TDiagResultsDbRecordInfoArrayPacked::PackArrayL(class CArrayFixFlat<class TDiagResultsDatabaseTestRecordInfo> const &)
+	?Size@CDiagResultsDatabaseItem@@QBEHXZ @ 54 NONAME ; int CDiagResultsDatabaseItem::Size(void) const
+	?Suspend@RDiagResultsDatabaseRecord@@QAEHXZ @ 55 NONAME ; int RDiagResultsDatabaseRecord::Suspend(void)
+	?TestCompleted@RDiagResultsDatabaseRecord@@QAEHH@Z @ 56 NONAME ; int RDiagResultsDatabaseRecord::TestCompleted(int)
+	?TestResult@CDiagResultsDatabaseItem@@QBE?AW4TResult@1@XZ @ 57 NONAME ; enum CDiagResultsDatabaseItem::TResult CDiagResultsDatabaseItem::TestResult(void) const
+	?TestUid@CDiagResultsDatabaseItem@@QBE?AVTUid@@XZ @ 58 NONAME ; class TUid CDiagResultsDatabaseItem::TestUid(void) const
+	?TimeCompleted@CDiagResultsDatabaseItem@@QBE?AVTTime@@XZ @ 59 NONAME ; class TTime CDiagResultsDatabaseItem::TimeCompleted(void) const
+	?TimeStarted@CDiagResultsDatabaseItem@@QBE?AVTTime@@XZ @ 60 NONAME ; class TTime CDiagResultsDatabaseItem::TimeStarted(void) const
+	?UnpackArrayL@TDiagResultsDbRecordInfoArrayPacked@@QAEXAAV?$CArrayFixFlat@VTDiagResultsDatabaseTestRecordInfo@@@@@Z @ 61 NONAME ; void TDiagResultsDbRecordInfoArrayPacked::UnpackArrayL(class CArrayFixFlat<class TDiagResultsDatabaseTestRecordInfo> &)
+	?Version@RDiagResultsDatabase@@QBE?AVTVersion@@XZ @ 62 NONAME ; class TVersion RDiagResultsDatabase::Version(void) const
+	?WasDependency@CDiagResultsDatabaseItem@@QBEHXZ @ 63 NONAME ; int CDiagResultsDatabaseItem::WasDependency(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/eabi/diagresultsdatabase.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,79 @@
+EXPORTS
+	_ZN20RDiagResultsDatabase13GetLastResultERP24CDiagResultsDatabaseItem @ 1 NONAME
+	_ZN20RDiagResultsDatabase17GetAllRecordInfosER13CArrayFixFlatI34TDiagResultsDatabaseTestRecordInfoE @ 2 NONAME
+	_ZN20RDiagResultsDatabase21InitiateGetLastResultE4TUidR14TRequestStatus @ 3 NONAME
+	_ZN20RDiagResultsDatabase22GetDatabaseMaximumSizeERi @ 4 NONAME
+	_ZN20RDiagResultsDatabase22InitiateGetLastResultsERK13CArrayFixFlatI4TUidER14TRequestStatus @ 5 NONAME
+	_ZN20RDiagResultsDatabase5CloseEv @ 6 NONAME
+	_ZN20RDiagResultsDatabase7ConnectE4TUid @ 7 NONAME
+	_ZN20RDiagResultsDatabaseC1Ev @ 8 NONAME
+	_ZN20RDiagResultsDatabaseC2Ev @ 9 NONAME
+	_ZN20RDiagResultsDatabaseD1Ev @ 10 NONAME
+	_ZN20RDiagResultsDatabaseD2Ev @ 11 NONAME
+	_ZN24CDiagResultsDatabaseItem12InternalizeLER11RReadStream @ 12 NONAME
+	_ZN24CDiagResultsDatabaseItem4NewLE4TUidiNS_7TResultE5TTimeS2_P8CBufFlat @ 13 NONAME
+	_ZN24CDiagResultsDatabaseItem4NewLER11RReadStream @ 14 NONAME
+	_ZN24CDiagResultsDatabaseItem4NewLERKS_ @ 15 NONAME
+	_ZN24CDiagResultsDatabaseItem5NewLCE4TUidiNS_7TResultE5TTimeS2_P8CBufFlat @ 16 NONAME
+	_ZN24CDiagResultsDatabaseItemD0Ev @ 17 NONAME
+	_ZN24CDiagResultsDatabaseItemD1Ev @ 18 NONAME
+	_ZN24CDiagResultsDatabaseItemD2Ev @ 19 NONAME
+	_ZN26RDiagResultsDatabaseRecord13LogTestResultER14TRequestStatusRK24CDiagResultsDatabaseItem @ 20 NONAME
+	_ZN26RDiagResultsDatabaseRecord13TestCompletedEi @ 21 NONAME
+	_ZN26RDiagResultsDatabaseRecord15CreateNewRecordER20RDiagResultsDatabaseR4TUidR31CDiagResultsDbRecordEngineParam @ 22 NONAME
+	_ZN26RDiagResultsDatabaseRecord5CloseEv @ 23 NONAME
+	_ZN26RDiagResultsDatabaseRecord7ConnectER20RDiagResultsDatabase4TUidi @ 24 NONAME
+	_ZN26RDiagResultsDatabaseRecord7SuspendEv @ 25 NONAME
+	_ZN26RDiagResultsDatabaseRecordC1Ev @ 26 NONAME
+	_ZN26RDiagResultsDatabaseRecordC2Ev @ 27 NONAME
+	_ZN26RDiagResultsDatabaseRecordD1Ev @ 28 NONAME
+	_ZN26RDiagResultsDatabaseRecordD2Ev @ 29 NONAME
+	_ZN31CDiagResultsDbRecordEngineParam12InternalizeLER11RReadStream @ 30 NONAME
+	_ZN31CDiagResultsDbRecordEngineParam4NewLEP6RArrayI4TUidEi @ 31 NONAME
+	_ZN31CDiagResultsDbRecordEngineParam4NewLER11RReadStream @ 32 NONAME
+	_ZN31CDiagResultsDbRecordEngineParam5NewLCEP6RArrayI4TUidEi @ 33 NONAME
+	_ZN31CDiagResultsDbRecordEngineParamD0Ev @ 34 NONAME
+	_ZN31CDiagResultsDbRecordEngineParamD1Ev @ 35 NONAME
+	_ZN31CDiagResultsDbRecordEngineParamD2Ev @ 36 NONAME
+	_ZN34TDiagResultsDatabaseTestRecordInfo12InternalizeLER11RReadStream @ 37 NONAME
+	_ZN34TDiagResultsDatabaseTestRecordInfo8DRMTimeLEv @ 38 NONAME
+	_ZN34TDiagResultsDatabaseTestRecordInfoC1Ev @ 39 NONAME
+	_ZN34TDiagResultsDatabaseTestRecordInfoC2Ev @ 40 NONAME
+	_ZN35TDiagResultsDbRecordInfoArrayPacked10PackArrayLERK13CArrayFixFlatI34TDiagResultsDatabaseTestRecordInfoE @ 41 NONAME
+	_ZN35TDiagResultsDbRecordInfoArrayPacked12UnpackArrayLER13CArrayFixFlatI34TDiagResultsDatabaseTestRecordInfoE @ 42 NONAME
+	_ZN35TDiagResultsDbRecordInfoArrayPackedC1ERP8CBufFlat @ 43 NONAME
+	_ZN35TDiagResultsDbRecordInfoArrayPackedC2ERP8CBufFlat @ 44 NONAME
+	_ZNK20RDiagResultsDatabase13GetLastRecordER4TUid @ 45 NONAME
+	_ZNK20RDiagResultsDatabase13GetRecordUidsER13CArrayFixFlatI4TUidE @ 46 NONAME
+	_ZNK20RDiagResultsDatabase14GetLastResultsER13RPointerArrayI24CDiagResultsDatabaseItemE @ 47 NONAME
+	_ZNK20RDiagResultsDatabase14GetRecordCountERj @ 48 NONAME
+	_ZNK20RDiagResultsDatabase25GetLastNotCompletedRecordER4TUid @ 49 NONAME
+	_ZNK20RDiagResultsDatabase28CancelInitiateGetLastResultsEv @ 50 NONAME
+	_ZNK20RDiagResultsDatabase7VersionEv @ 51 NONAME
+	_ZNK24CDiagResultsDatabaseItem10TestResultEv @ 52 NONAME
+	_ZNK24CDiagResultsDatabaseItem11DetailsDataEv @ 53 NONAME
+	_ZNK24CDiagResultsDatabaseItem11TimeStartedEv @ 54 NONAME
+	_ZNK24CDiagResultsDatabaseItem12ExternalizeLER12RWriteStream @ 55 NONAME
+	_ZNK24CDiagResultsDatabaseItem13TimeCompletedEv @ 56 NONAME
+	_ZNK24CDiagResultsDatabaseItem13WasDependencyEv @ 57 NONAME
+	_ZNK24CDiagResultsDatabaseItem4SizeEv @ 58 NONAME
+	_ZNK24CDiagResultsDatabaseItem7TestUidEv @ 59 NONAME
+	_ZNK26RDiagResultsDatabaseRecord11GetTestUidsER13CArrayFixFlatI4TUidE @ 60 NONAME
+	_ZNK26RDiagResultsDatabaseRecord11IsSuspendedERi @ 61 NONAME
+	_ZNK26RDiagResultsDatabaseRecord13GetRecordInfoER34TDiagResultsDatabaseTestRecordInfo @ 62 NONAME
+	_ZNK26RDiagResultsDatabaseRecord13GetTestResultE4TUidRP24CDiagResultsDatabaseItem @ 63 NONAME
+	_ZNK26RDiagResultsDatabaseRecord14GetEngineParamERP31CDiagResultsDbRecordEngineParam @ 64 NONAME
+	_ZNK26RDiagResultsDatabaseRecord14GetTestResultsER13RPointerArrayI24CDiagResultsDatabaseItemE @ 65 NONAME
+	_ZNK26RDiagResultsDatabaseRecord15GetTestRecordIdER4TUid @ 66 NONAME
+	_ZNK26RDiagResultsDatabaseRecord15IsTestCompletedERi @ 67 NONAME
+	_ZNK26RDiagResultsDatabaseRecord19CancelLogTestResultEv @ 68 NONAME
+	_ZNK26RDiagResultsDatabaseRecord9GetStatusERNS_13TRecordStatusE @ 69 NONAME
+	_ZNK31CDiagResultsDbRecordEngineParam12ExternalizeLER12RWriteStream @ 70 NONAME
+	_ZNK31CDiagResultsDbRecordEngineParam18ExecutionsUidArrayEv @ 71 NONAME
+	_ZNK31CDiagResultsDbRecordEngineParam19DependencyExecutionEv @ 72 NONAME
+	_ZNK34TDiagResultsDatabaseTestRecordInfo12ExternalizeLER12RWriteStream @ 73 NONAME
+	_ZTI24CDiagResultsDatabaseItem @ 74 NONAME ; #<TI>#
+	_ZTI31CDiagResultsDbRecordEngineParam @ 75 NONAME ; #<TI>#
+	_ZTV24CDiagResultsDatabaseItem @ 76 NONAME ; #<VT>#
+	_ZTV31CDiagResultsDbRecordEngineParam @ 77 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for Diagnostics Results Database
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+diagresultsdatabase.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/group/diagresultsdatabase.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification for DiagResultsDatabase.dll
+*
+*/
+
+
+//#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET      diagresultsdatabase.dll
+TARGETTYPE  dll
+
+#ifndef RD_APPS_TO_EXES
+	TARGETPATH		/system/libs
+#endif
+
+UID	        0x1000008d 0x10282CD8
+
+CAPABILITY  CAP_GENERAL_DLL
+VENDORID    VID_DEFAULT
+
+SOURCEPATH  ../src
+SOURCE      diagresultsdatabase.cpp
+SOURCE      diagresultsdatabaseItem.cpp
+SOURCE      diagresultsdbrecordinfoarraypacked.cpp
+SOURCE      diagresultsdatabasetestrecordInfo.cpp
+SOURCE      diagresultsdbrecordengineparam.cpp
+
+
+USERINCLUDE ../inc
+USERINCLUDE ../../common
+
+// System Include Paths
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib
+LIBRARY estor.lib
+LIBRARY drmserviceapi.lib
+LIBRARY centralrepository.lib
+LIBRARY flogger.lib
+#if defined(WINSCW)
+    deffile ../bwins/diagresultsdatabase.def
+#elif defined(ARM)
+    deffile ../EABI/DiagResultsDatabase.def
+#endif
+
+nostrictdef 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/group/diagresultsdatabase.xml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,2018 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!DOCTYPE PROJECT [
+ <!ELEMENT PROJECT (TARGETLIST, TARGETORDER, GROUPLIST, DESIGNLIST?)>
+ <!ELEMENT TARGETLIST (TARGET+)>
+ <!ELEMENT TARGET (NAME, SETTINGLIST, FILELIST?, LINKORDER?, SEGMENTLIST?, OVERLAYGROUPLIST?, SUBTARGETLIST?, SUBPROJECTLIST?, FRAMEWORKLIST?, PACKAGEACTIONSLIST?)>
+ <!ELEMENT NAME (#PCDATA)>
+ <!ELEMENT USERSOURCETREETYPE (#PCDATA)>
+ <!ELEMENT PATH (#PCDATA)>
+ <!ELEMENT FILELIST (FILE*)>
+ <!ELEMENT FILE (PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?, ROOTFILEREF?, FILEKIND?, FILEFLAGS?)>
+ <!ELEMENT PATHTYPE (#PCDATA)>
+ <!ELEMENT PATHROOT (#PCDATA)>
+ <!ELEMENT ACCESSPATH (#PCDATA)>
+ <!ELEMENT PATHFORMAT (#PCDATA)>
+ <!ELEMENT ROOTFILEREF (PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?)>
+ <!ELEMENT FILEKIND (#PCDATA)>
+ <!ELEMENT FILEFLAGS (#PCDATA)>
+ <!ELEMENT FILEREF (TARGETNAME?, PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?)>
+ <!ELEMENT TARGETNAME (#PCDATA)>
+ <!ELEMENT SETTINGLIST ((SETTING|PANELDATA)+)>
+ <!ELEMENT SETTING (NAME?, (VALUE|(SETTING+)))>
+ <!ELEMENT PANELDATA (NAME, VALUE)>
+ <!ELEMENT VALUE (#PCDATA)>
+ <!ELEMENT LINKORDER (FILEREF*)>
+ <!ELEMENT SEGMENTLIST (SEGMENT+)>
+ <!ELEMENT SEGMENT (NAME, ATTRIBUTES?, FILEREF*)>
+ <!ELEMENT ATTRIBUTES (#PCDATA)>
+ <!ELEMENT OVERLAYGROUPLIST (OVERLAYGROUP+)>
+ <!ELEMENT OVERLAYGROUP (NAME, BASEADDRESS, OVERLAY*)>
+ <!ELEMENT BASEADDRESS (#PCDATA)>
+ <!ELEMENT OVERLAY (NAME, FILEREF*)>
+ <!ELEMENT SUBTARGETLIST (SUBTARGET+)>
+ <!ELEMENT SUBTARGET (TARGETNAME, ATTRIBUTES?, FILEREF?)>
+ <!ELEMENT SUBPROJECTLIST (SUBPROJECT+)>
+ <!ELEMENT SUBPROJECT (FILEREF, SUBPROJECTTARGETLIST)>
+ <!ELEMENT SUBPROJECTTARGETLIST (SUBPROJECTTARGET*)>
+ <!ELEMENT SUBPROJECTTARGET (TARGETNAME, ATTRIBUTES?, FILEREF?)>
+ <!ELEMENT FRAMEWORKLIST (FRAMEWORK+)>
+ <!ELEMENT FRAMEWORK (FILEREF, DYNAMICLIBRARY?, VERSION?)>
+ <!ELEMENT PACKAGEACTIONSLIST (PACKAGEACTION+)>
+ <!ELEMENT PACKAGEACTION (#PCDATA)>
+ <!ELEMENT LIBRARYFILE (FILEREF)>
+ <!ELEMENT VERSION (#PCDATA)>
+ <!ELEMENT TARGETORDER (ORDEREDTARGET|ORDEREDDESIGN)*>
+ <!ELEMENT ORDEREDTARGET (NAME)>
+ <!ELEMENT ORDEREDDESIGN (NAME, ORDEREDTARGET+)>
+ <!ELEMENT GROUPLIST (GROUP|FILEREF)*>
+ <!ELEMENT GROUP (NAME, (GROUP|FILEREF)*)>
+ <!ELEMENT DESIGNLIST (DESIGN+)>
+ <!ELEMENT DESIGN (NAME, DESIGNDATA)>
+ <!ELEMENT DESIGNDATA (#PCDATA)>
+]>
+<?codewarrior exportversion="1.0.1" ideversion="5.0" ?>
+<PROJECT>
+    <TARGETLIST>
+        <TARGET>
+            <NAME>WINSCW UDEB</NAME>
+            <SETTINGLIST>
+
+                <!-- Settings for "Source Trees" panel -->
+                <SETTING><NAME>UserSourceTrees</NAME></SETTING>
+
+                <!-- Settings for "Access Paths" panel -->
+                <SETTING><NAME>AlwaysSearchUserPaths</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>InterpretDOSAndUnixPaths</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RequireFrameworkStyleIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SourceRelativeIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UserSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\inc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Common</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\BWINS</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\src</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+                <SETTING><NAME>SystemSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\oem</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\UDEB</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Win32-x86 Support\Libraries\Win32 SDK</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+
+                <!-- Settings for "Debugger Runtime" panel -->
+                <SETTING><NAME>MWRuntimeSettings_WorkingDirectory</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_CommandLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_HostApplication</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb\epoc.exe</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>MWRuntimeSettings_EnvVars</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Target Settings" panel -->
+                <SETTING><NAME>Linker</NAME><VALUE>Symbian Linker v2</VALUE></SETTING>
+                <SETTING><NAME>PreLinker</NAME><VALUE/></SETTING>
+                <SETTING><NAME>PostLinker</NAME><VALUE>Symbian Installer v2</VALUE></SETTING>
+                <SETTING><NAME>Targetname</NAME><VALUE>WINSCW UDEB</VALUE></SETTING>
+                <SETTING><NAME>OutputDirectory</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SaveEntriesUsingRelativePaths</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "File Mappings" panel -->
+                <SETTING><NAME>FileMappings</NAME>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.c</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cfg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cia</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cpp</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cwlink</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cxx</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.def</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.h</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.hrh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.iby</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inf</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ini</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inl</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.loc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.mmpi</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pch++</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pkg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.policy</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ra</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.resources</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Resource v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rls</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rss</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rsg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.s</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.script</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.txt</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.a</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.lib</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.dso</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.o</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                </SETTING>
+
+                <!-- Settings for "Build Extras" panel -->
+                <SETTING><NAME>CacheModDates</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>DumpBrowserInfo</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSubprojects</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>UseThirdPartyDebugger</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>BrowserGenerator</NAME><VALUE>2</VALUE></SETTING>
+                <SETTING><NAME>DebuggerAppPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DebuggerCmdLineArgs</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DebuggerWorkingDir</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CodeCompletionPrefixFileName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CodeCompletionMacroFileName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Debugger Target" panel -->
+                <SETTING><NAME>ConsoleEncoding</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>LogSystemMessages</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>AutoTargetDLLsPopUp</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>StopAtWatchpoints</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>PauseWhileRunning</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>PauseInterval</NAME><VALUE>5</VALUE></SETTING>
+                <SETTING><NAME>PauseUIFlags</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>AltExePath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>StopAtTempBPOnLaunch</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSymbolics</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>TempBPFunctionName</NAME><VALUE>E32Main</VALUE></SETTING>
+                <SETTING><NAME>TempBPType</NAME><VALUE>1</VALUE></SETTING>
+
+                <!-- Settings for "Remote Debug" panel -->
+                <SETTING><NAME>Enabled</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>ConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>LaunchRemoteApp</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RemoteAppPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CoreID</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>JTAGClockSpeed</NAME><VALUE>8000</VALUE></SETTING>
+                <SETTING><NAME>IsMultiCore</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UseGlobalOSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownloadConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>OSDownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>AltDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>AltDownloadConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "x86 Exceptions" panel -->
+                <SETTING><NAME>MWDebugger_X86_Exceptions</NAME>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                
+                <!-- Settings for "Auto-target" panel -->
+                <SETTING><NAME>OtherExecutables</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Analyzer Connections" panel -->
+                <SETTING><NAME>AnalyzerConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Custom Keywords" panel -->
+                <SETTING><NAME>CustomColor1</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor2</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor3</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor4</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>BraekPoinType_II</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>SDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>VerifyMemWrites</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ShowMPC107regs</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>BreakpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>WatchpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ByteOrderType</NAME><VALUE>0</VALUE></SETTING>
+                <PANELDATA><NAME>CodeTest SYMBIAN Instrumenter</NAME><VALUE>
+                    0200020000000100000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000433A5C0000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000637466696C657300000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000636F6465746573742E6964620000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000
+                </VALUE></PANELDATA>
+
+                <!-- Settings for "Symbian Installation" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Installer Panel v2" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Resource Panel" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Resources Panel v2" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Remote Download" panel -->
+                <SETTING><NAME>FileList</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ResetTarget</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Common Panel" panel -->
+                <SETTING><NAME>ShowCommandLine</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SymbianEpocToolsPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Compiler Panel" panel -->
+                <SETTING><NAME>PrefixFile</NAME><VALUE>feature_settings.hrh</VALUE></SETTING>
+                <SETTING><NAME>CompilerXMLDescriptor</NAME><VALUE>Metrowerks x86 Compiler</VALUE></SETTING>
+                <SETTING><NAME>Macros</NAME><VALUE>__SYMBIAN32__,__CW32__,__WINS__,__WINSCW__,__DLL__,_DEBUG,_UNICODE,__SUPPORT_CPP_EXCEPTIONS__,</VALUE></SETTING>
+                <SETTING><NAME>CodeTEST</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>EnableSWIC</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Arguments</NAME><VALUE>-wchar_t off -align 4 -warnings on -w nohidevirtual, nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -O0 -inline off -nostdinc</VALUE></SETTING>
+                <SETTING><NAME>CIAArgs</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Debugging" panel -->
+                <SETTING><NAME>Parse Log File</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log File Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Symbian SDK Folder</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Log Unresolved Modules</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log Unresolved Sym Files</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Non-XIP Executables</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Kernel Debugging" panel -->
+                <SETTING><NAME>Start Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Run From Start Address</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Download Image</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OS Image Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Download Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Ask First</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Bootrom</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Bootrom Sym File</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Linker Panel" panel -->
+                <SETTING><NAME>LinkOutputFile</NAME><VALUE>DiagResultsDatabase.dll</VALUE></SETTING>
+                <SETTING><NAME>LinkCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibrary</NAME><VALUE>DiagResultsDatabase.lib</VALUE></SETTING>
+                <SETTING><NAME>canDebug</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>canRun</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian RomBuild Panel" panel -->
+                <SETTING><NAME>CommandLine</NAME><VALUE>buildrom -D_DEBUG devkit lubbock techview -olubbock_gui.img</VALUE></SETTING>
+                <SETTING><NAME>OutputPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DisplayMessages</NAME><VALUE>true</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Target" panel -->
+                <SETTING><NAME>TargetArchitecture</NAME><VALUE>WINSCW</VALUE></SETTING>
+                <SETTING><NAME>LogMessages</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SuppressWarnings</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>GenerateSymbolics</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CompilerPrefix</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CompilerCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibraryPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Tools" panel -->
+                <SETTING><NAME>Gnu Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Epoc32 Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+            </SETTINGLIST>
+            <FILELIST>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.def</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>EDLL.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseCommon.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbPrivateCRKeys.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseWINSCWUDEB.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+</FILELIST>
+            <LINKORDER>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.def</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>EDLL.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseCommon.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbPrivateCRKeys.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseWINSCWUDEB.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</LINKORDER>
+        </TARGET><TARGET>
+            <NAME>WINSCW UREL</NAME>
+            <SETTINGLIST>
+
+                <!-- Settings for "Source Trees" panel -->
+                <SETTING><NAME>UserSourceTrees</NAME></SETTING>
+
+                <!-- Settings for "Access Paths" panel -->
+                <SETTING><NAME>AlwaysSearchUserPaths</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>InterpretDOSAndUnixPaths</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RequireFrameworkStyleIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SourceRelativeIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UserSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\inc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Common</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\BWINS</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\src</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+                <SETTING><NAME>SystemSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\oem</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\UREL</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\release\WINSCW\UDEB</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Win32-x86 Support\Libraries\Win32 SDK</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+
+                <!-- Settings for "Debugger Runtime" panel -->
+                <SETTING><NAME>MWRuntimeSettings_WorkingDirectory</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_CommandLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_HostApplication</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel\epoc.exe</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>MWRuntimeSettings_EnvVars</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Target Settings" panel -->
+                <SETTING><NAME>Linker</NAME><VALUE>Symbian Linker v2</VALUE></SETTING>
+                <SETTING><NAME>PreLinker</NAME><VALUE/></SETTING>
+                <SETTING><NAME>PostLinker</NAME><VALUE>Symbian Installer v2</VALUE></SETTING>
+                <SETTING><NAME>Targetname</NAME><VALUE>WINSCW UREL</VALUE></SETTING>
+                <SETTING><NAME>OutputDirectory</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SaveEntriesUsingRelativePaths</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "File Mappings" panel -->
+                <SETTING><NAME>FileMappings</NAME>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.c</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cfg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cia</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cpp</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cwlink</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cxx</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.def</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.h</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.hrh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.iby</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inf</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ini</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inl</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.loc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.mmpi</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pch++</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pkg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.policy</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ra</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.resources</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Resource v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rls</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rss</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rsg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.s</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.script</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.txt</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.a</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.lib</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.dso</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.o</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                </SETTING>
+
+                <!-- Settings for "Build Extras" panel -->
+                <SETTING><NAME>CacheModDates</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>DumpBrowserInfo</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSubprojects</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>UseThirdPartyDebugger</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>BrowserGenerator</NAME><VALUE>2</VALUE></SETTING>
+                <SETTING><NAME>DebuggerAppPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DebuggerCmdLineArgs</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DebuggerWorkingDir</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CodeCompletionPrefixFileName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CodeCompletionMacroFileName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Debugger Target" panel -->
+                <SETTING><NAME>ConsoleEncoding</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>LogSystemMessages</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>AutoTargetDLLsPopUp</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>StopAtWatchpoints</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>PauseWhileRunning</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>PauseInterval</NAME><VALUE>5</VALUE></SETTING>
+                <SETTING><NAME>PauseUIFlags</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>AltExePath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>StopAtTempBPOnLaunch</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSymbolics</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>TempBPFunctionName</NAME><VALUE>E32Main</VALUE></SETTING>
+                <SETTING><NAME>TempBPType</NAME><VALUE>1</VALUE></SETTING>
+
+                <!-- Settings for "Remote Debug" panel -->
+                <SETTING><NAME>Enabled</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>ConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>LaunchRemoteApp</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RemoteAppPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CoreID</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>JTAGClockSpeed</NAME><VALUE>8000</VALUE></SETTING>
+                <SETTING><NAME>IsMultiCore</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UseGlobalOSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownloadConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>OSDownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>AltDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>AltDownloadConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "x86 Exceptions" panel -->
+                <SETTING><NAME>MWDebugger_X86_Exceptions</NAME>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                
+                <!-- Settings for "Auto-target" panel -->
+                <SETTING><NAME>OtherExecutables</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Analyzer Connections" panel -->
+                <SETTING><NAME>AnalyzerConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Custom Keywords" panel -->
+                <SETTING><NAME>CustomColor1</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor2</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor3</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor4</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>BraekPoinType_II</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>SDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>VerifyMemWrites</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ShowMPC107regs</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>BreakpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>WatchpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ByteOrderType</NAME><VALUE>0</VALUE></SETTING>
+                <PANELDATA><NAME>CodeTest SYMBIAN Instrumenter</NAME><VALUE>
+                    0200020000000100000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000433A5C0000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000637466696C657300000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000636F6465746573742E6964620000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000
+                </VALUE></PANELDATA>
+
+                <!-- Settings for "Symbian Installation" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Installer Panel v2" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Resource Panel" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Resources Panel v2" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Remote Download" panel -->
+                <SETTING><NAME>FileList</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ResetTarget</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Common Panel" panel -->
+                <SETTING><NAME>ShowCommandLine</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SymbianEpocToolsPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Compiler Panel" panel -->
+                <SETTING><NAME>PrefixFile</NAME><VALUE>feature_settings.hrh</VALUE></SETTING>
+                <SETTING><NAME>CompilerXMLDescriptor</NAME><VALUE>Metrowerks x86 Compiler</VALUE></SETTING>
+                <SETTING><NAME>Macros</NAME><VALUE>__SYMBIAN32__,__CW32__,__WINS__,__WINSCW__,__DLL__,NDEBUG,_UNICODE,__SUPPORT_CPP_EXCEPTIONS__,</VALUE></SETTING>
+                <SETTING><NAME>CodeTEST</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>EnableSWIC</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Arguments</NAME><VALUE>-wchar_t off -align 4 -warnings on -w nohidevirtual, nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -O4,s -nostdinc</VALUE></SETTING>
+                <SETTING><NAME>CIAArgs</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Debugging" panel -->
+                <SETTING><NAME>Parse Log File</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log File Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Symbian SDK Folder</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Log Unresolved Modules</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log Unresolved Sym Files</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Non-XIP Executables</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Kernel Debugging" panel -->
+                <SETTING><NAME>Start Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Run From Start Address</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Download Image</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OS Image Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Download Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Ask First</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Bootrom</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Bootrom Sym File</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Linker Panel" panel -->
+                <SETTING><NAME>LinkOutputFile</NAME><VALUE>DiagResultsDatabase.dll</VALUE></SETTING>
+                <SETTING><NAME>LinkCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibrary</NAME><VALUE>DiagResultsDatabase.lib</VALUE></SETTING>
+                <SETTING><NAME>canDebug</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>canRun</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian RomBuild Panel" panel -->
+                <SETTING><NAME>CommandLine</NAME><VALUE>buildrom -D_DEBUG devkit lubbock techview -olubbock_gui.img</VALUE></SETTING>
+                <SETTING><NAME>OutputPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DisplayMessages</NAME><VALUE>true</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Target" panel -->
+                <SETTING><NAME>TargetArchitecture</NAME><VALUE>WINSCW</VALUE></SETTING>
+                <SETTING><NAME>LogMessages</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SuppressWarnings</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>GenerateSymbolics</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CompilerPrefix</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CompilerCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibraryPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Tools" panel -->
+                <SETTING><NAME>Gnu Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Epoc32 Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+            </SETTINGLIST>
+            <FILELIST>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.def</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>EDLL.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseWINSCWUREL.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+</FILELIST>
+            <LINKORDER>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.def</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>EDLL.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseWINSCWUREL.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</LINKORDER>
+        </TARGET><TARGET>
+<NAME>Build All</NAME><SETTINGLIST><SETTING><NAME>Linker</NAME><VALUE>None</VALUE></SETTING>
+<SETTING><NAME>Targetname</NAME><VALUE>Build All</VALUE></SETTING>
+</SETTINGLIST>
+<FILELIST></FILELIST>
+<LINKORDER></LINKORDER>
+<SUBTARGETLIST><SUBTARGET><TARGETNAME>WINSCW UDEB</TARGETNAME></SUBTARGET>
+<SUBTARGET><TARGETNAME>WINSCW UREL</TARGETNAME></SUBTARGET>
+</SUBTARGETLIST></TARGET></TARGETLIST>
+
+    <TARGETORDER>
+<ORDEREDTARGET><NAME>WINSCW UDEB</NAME></ORDEREDTARGET>
+<ORDEREDTARGET><NAME>WINSCW UREL</NAME></ORDEREDTARGET>
+<ORDEREDTARGET><NAME>Build All</NAME></ORDEREDTARGET>
+</TARGETORDER>
+
+    <GROUPLIST><FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<GROUP><NAME>Source</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.def</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+<GROUP><NAME>Headers</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseCommon.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbPrivateCRKeys.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+<GROUP><NAME>Link</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseWINSCWUDEB.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UREL</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseWINSCWUREL.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+<GROUP><NAME>Libraries</NAME>
+<GROUP><NAME>WINSCW</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>EDLL.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UREL</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>EDLL.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+</GROUP>
+</GROUPLIST>
+
+</PROJECT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdatabase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,520 @@
+/*
+* Copyright (c) 2007-2007 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:  Results database client interfaces.
+*                Provides results database session and subsession.
+*  libraries   : DiagResultsDatabase.lib DiagResultsDatabase.dll
+*
+*/
+
+
+#ifndef DIAGNOSTICS_RESULTS_DATABASE_CLIENT_H
+#define DIAGNOSTICS_RESULTS_DATABASE_CLIENT_H
+
+#include <e32base.h>
+
+class CDiagResultsDatabaseItem;
+class TDiagResultsDatabaseTestRecordInfo;
+class CDiagResultsDbRecordEngineParam;
+
+/**
+* Diagnostics Results Database. Stores test results and more information.
+* Provides methods to retrieve and fetch new data.
+* Requires ReadDeviceData and WriteDeviceData capabilities even if the
+* session does not write anything.
+*
+* Results database is a permanent file store based solution.
+* Database files are stored under WINSCW\C\private\10282cd9 in emulator
+* environment.
+*
+* It is recommended to have only one open RDiagResultsDatabase per thread.
+* There should be only one writer and multiple readers at the same time
+* accessing the same database file. It is possible that there are multiple
+* DB files for example when there are two diagnostics applications in the
+* system.
+*
+* @since S60 v5.0
+**/
+class RDiagResultsDatabase : public RSessionBase
+    {
+public:
+
+    /**
+    * Constructor
+    **/
+    IMPORT_C RDiagResultsDatabase();
+    
+    /**
+    * Destructor
+    **/
+    IMPORT_C ~RDiagResultsDatabase();
+
+    /**
+    * Connect to the results database to a DB file. This must be called before 
+    * trying to use this class, otherwise KERN-EXEC 0 will crash your app. 
+    * Only one RDiagResultsDatabase connection is recommended per application,
+    * because server sessions consume significant amount of system resources.
+    * Share the session inside your thread! Subsessions are much more lighter. 
+    *
+    * Calling connect creates the DB file inside server's private directory.
+    * If for some reason database is corrupted, the DB file should be deleted
+    * manually.
+    *
+    * @param aAppUid Unique identifier of the application. Each application has 
+    *   its own store.  Applications can access to another 
+    *   applications's database if they know their UID.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. If calling process does not have access rights, 
+    *   KErrPermissionDenied is returned. ReadDeviceData+WriteDeviceData are
+    *   required. KErrDiskFull is returned if there is not enough space 
+    *   on c-drive.
+    **/
+    IMPORT_C TInt Connect( TUid aAppUid );
+
+    /**
+    * Close the session with the server. Handle is not valid anymore.
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt Close();
+
+    /**
+    * Returns the version number of the server.
+    *
+    * @return The version number.
+    **/
+    IMPORT_C TVersion Version() const;
+
+    /**
+    * Get the current number of test records in the database.
+    *
+    * @param aCount the number of records.
+    * @return KErrNone, if successful, otherwise one of the other system-wide 
+    *   error codes.
+    **/
+    IMPORT_C TInt GetRecordCount ( TUint& aCount ) const;
+
+    /**
+    * Returns the maximum number of records for each application. The number 
+    * is defined in the central repository and it is static for all applications. 
+    * It is guarenteed that the DB file contains only the maxsize records and
+    * not more. Old test records are deleted when new test records are 
+    * completed.
+    *
+    * @param aMaxSize The maximum number of test records.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C static TInt GetDatabaseMaximumSize( TInt& aMaxSize );
+
+    /**
+    * Returns an array of record Ids. The oldest records are at the beginning
+    * of the array. Test record are sorted based on creation time.
+    *
+    * @param aSortedRecordUidArray An array of UIds. The array is sorted 
+    *   based on time.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetRecordUids ( CArrayFixFlat<TUid>& aSortedRecordUidArray ) const;
+
+    /**
+    * Returns id to last test record. The last record cannot be 
+    * still open for writing! Test record are sorted based on creation time.
+    *
+    * @param aRecordUid Unique identifier of the record.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrNotFound if there are no records.
+    **/
+    IMPORT_C TInt GetLastRecord ( TUid& aRecordUid ) const;
+    
+    /**
+    * Returns id to last suspended or incompleted test record. 
+    * The last record cannot be still open for writing! Returns KErrNotFound 
+    * if there are no suspended or incomplete test records.
+    *
+    * @param aRecordUid Unique identifier of the record.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrNotFound if there are no suspended test records.
+    **/
+    IMPORT_C TInt GetLastNotCompletedRecord ( TUid& aRecordUid ) const;
+    
+    /**
+    * Returns an overview from all records. 
+    *
+    * @param aInfoArray returns an array of record infos.
+    * @see TDiagResultsDatabaseTestRecordInfo.
+    **/
+    IMPORT_C TInt GetAllRecordInfos ( 
+               CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray );
+
+    /**
+    * Initiate retrieving of last results.  After request is completed,
+    * data can be fetched using GetLastResults method.
+    *
+    * @param aUidArray An array of uid used to identify plug-ins.
+    * @param aStatus Completion status. 
+    **/
+    IMPORT_C void InitiateGetLastResults ( const CArrayFixFlat<TUid>& aUidArray,
+                                                TRequestStatus& aStatus );
+                                                
+    /**
+    * Cancel InitiateGetLastResults.
+    **/                                                
+    IMPORT_C void CancelInitiateGetLastResults () const;
+    
+    /**
+    * Get list of last results. Last result means that the plug-in has passed / failed
+    * test result. 
+    * 
+    * GetLastResults deletes data after this function 
+    * is called, so InitiateGetLastResults must be called if data is needed 
+    * again. Client is responsible for deleting the returned array. Contains
+    * null values if the searched uid was not found. There should be the same
+    * number of cells in UidArray and in the results array.   
+    *
+    * @param aResults Returned results array. Client is responsible for 
+    *                 deleting the array.
+    *
+    * @return KErrNotReady if this is called before InitiateGetLastResults.
+    */
+    IMPORT_C TInt GetLastResults ( RPointerArray<CDiagResultsDatabaseItem>& aResults ) const;
+    
+    /**
+    * Get last (the newest) test result of a test plug-in. The algorithm searches for a 
+    * test result that is either passed or failed. This is also asynchronous operation,
+    * because all records have to be browsed in worst case scenario (that is, when
+    * the plug-in uid is not found). Call GetLastResult when test result is needed.
+    *
+    *
+    * @param aTestPluginUid UID of a plug-in.    
+    * @param aStatus Asynchronous request status.
+    * 
+    */
+    IMPORT_C void InitiateGetLastResult ( TUid aTestPluginUid, 
+                                          TRequestStatus& aStatus );
+    
+
+    /**
+    * Get last result of a test plug-in.
+    *
+    * @param aItem Test result or NULL if not found.
+    * @retrun KErrNotReady if this is called before InitiateGetLastResult.
+    **/                                          
+    IMPORT_C TInt GetLastResult ( CDiagResultsDatabaseItem*& aItem );
+
+private:
+    
+    /**
+    * Leaving version of the service functions. Look above for explanations.
+    **/                    
+    void DoConnectL (TUid aAppUid);
+    
+    void DoGetRecordUidsL( CArrayFixFlat<TUid>& aSortedRecordUidArray ) const;
+
+    /*
+    * @see GetDatabaseMaximumSize()
+    */
+    static void DoGetDatabaseMaximumSizeL( TInt& aMaxSize );
+    
+    void DoGetAllRecordInfosL ( CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray);
+    
+    void DoGetLastResultsL ( RPointerArray<CDiagResultsDatabaseItem>& aResults ) const;
+    
+    void WriteArrayIntoBufferL( const CArrayFixFlat<TUid>& aUidArray );   
+    
+    void DoGetLastResultL ( CDiagResultsDatabaseItem*& aItem );                                    
+
+private: 
+
+    // Flat dynamic buffer.
+    CBufFlat* iBuffer;
+    
+    // is the connection already open.
+    TBool iOpen;     
+    
+    //Buffer pointer
+    TPtr8 iPtr;                 
+    };
+   
+/**
+* Sub-session to Diagnostics Results Database. This API is used to
+* handle a Test record. A test record is a collection of test results.
+*
+* Test record is always written into the file, when updates are necessary. 
+* 
+*
+* @since S60 v5.0 
+**/
+class RDiagResultsDatabaseRecord : public RSubSessionBase
+    {
+public:
+
+    /**
+    * Test record status. 
+    **/
+     enum TRecordStatus
+        {    	      
+        EOpen,                // Currently open for writing.
+        ESuspended,   	      // ::Suspend() is called. 
+        ECrashed,		      // It was open previously, and it was not 
+                              // closed properly.
+        EPartiallyCompleted,  // Record is completed (not resumable), but not
+                              // all tests were completed.
+        ECompleted	          // Record is completed (not resumable), and all 
+                              // tests were completed. 
+        };
+
+    /**
+    * Constructor
+    **/
+    IMPORT_C RDiagResultsDatabaseRecord();
+    
+    /**
+    * Destructor
+    **/
+    IMPORT_C ~RDiagResultsDatabaseRecord();
+
+    /**
+    * Connects to a test record. There must be at least one created record.
+    * If the specified record is not found, KErrNotFound is returned.
+    * Opened test record can be modified if the test record has not been
+    * completed (= TestCompleted called).
+    *
+    * @param aSession open database session.
+    * @param aRecordId specifies the record where we want to connect.
+    * @param aReadOnly Indicates is the test record opened in read-only mode.
+    *                  If read-only = EFalse, the test record can overwrite
+    *                  test records that are not completed already. If 
+    *                  the test record is completed it can be opened only 
+    *                  in read-mode. 
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrAlreadyExists if subsession is connected.
+    **/
+    IMPORT_C TInt Connect( RDiagResultsDatabase& aSession, 
+                           TUid aRecordId, 
+                           TBool aReadOnly );
+    
+    /**
+    * Creates a new record and returns the uid of that record. 
+    * Writes empty test record into the file. Create new record opens the record
+    * always in Write mode.
+    *
+    * @param aSession open database session.
+    * @param aRecordId a new unique identifier is returned that is used to
+    *   identify particular test record. Client can use the record ID to access
+    *   the same record again.
+    * @param aEngineParam Engine parameters. 
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrAlreadyExists if subsession is connected.
+    *   KErrDiskFull is returned if there is not enough space on c-drive.
+    **/
+    IMPORT_C TInt CreateNewRecord( RDiagResultsDatabase& aSession, 
+                                   TUid& aRecordId,
+                                   CDiagResultsDbRecordEngineParam& aEngineParam );
+    
+    /**
+    * Retrieve parameters of the diagnostics engine. These are needed in
+    * Suspend/Resume functionality. 
+    *
+    * @param aEngineParam Engine parameters. Ownership is transferred.
+    *                     Client is responsible for deleting the object.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetEngineParam( CDiagResultsDbRecordEngineParam*& aEngineParam ) const;
+
+
+    /**
+    * Get record status.
+    *
+    * @param aRecordStatus The status of the record. 
+    * @see TRecordStatus in the beginning of the class declaration.
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetStatus( TRecordStatus& aRecordStatus ) const;
+
+    /**
+    * Close subsession. Does not write test record into the file.
+    *
+    * @return Symbian error code or KErrNone.
+    **/
+    IMPORT_C void Close();
+    
+    /**
+    * Suspend test record. Same as complete, but the test record can be modified
+    * on next connect.Writes test suspend time into test record info.
+    *
+    * @return Symbian error code or KErrNone.
+    **/
+    IMPORT_C TInt Suspend();
+    
+    /**
+    * Indicates has this test record been suspended.
+    * @param aSuspended Returns has this test record been suspended(ETrue), 
+    *                   otherwise EFalse.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt IsSuspended( TBool& aSuspended ) const;
+
+    /**
+    * Returns the record UID of this subsession.
+    *
+    * @param aRecordUid Record ID of the subsession.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetTestRecordId( TUid& aRecordUid ) const;
+
+    /**
+    * Write test completion time/date to the record and prevent further 
+    * writing. Handle is still valid. However, it cannot be used for adding
+    * any more test results. During completion database file is cleaned up from
+    * old test records (limited by GetDatabaseMaximumSize method).
+    *
+    * Test completion is synchronous operation because only record handle must be
+    * updated (fixed size stream).
+    *
+    * @param aFullyComplete If ETrue (default), test record is completed with
+    *                       status fully completed. Otherwise the test record is 
+    *                       considered partially completed. 
+    *
+    * @return Symbian error code or KErrNone. KErrDiskFull is returned if there 
+    |         is not enough space on c-drive.   
+    **/
+    IMPORT_C TInt TestCompleted( TBool aFullyComplete = ETrue );
+    
+    /**
+    * Indicates has this record been written into the DB file or not. 
+    *
+    * @param aCompleted Has the test record been completed.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/ 
+    IMPORT_C TInt IsTestCompleted( TBool& aCompleted ) const;
+    
+    /**
+    * Returns information about the record. If the record is not finalized,
+    * iFinishTimes contains unknown values. 
+    *
+    * @param aInfo returns an overview of the test record.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetRecordInfo ( TDiagResultsDatabaseTestRecordInfo& aInfo ) const;
+    
+    /**
+    * Get list of test UIDs inside the test record.
+    *
+    * @param aTestUidArray An array of test uids.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetTestUids ( CArrayFixFlat<TUid>& aTestUidArray ) const;
+    
+    /**
+    * Logs results of a test into the database including more information
+    * that there might be. See class CDiagResultsDatabaseItem. Result Item
+    * is written into the file immediately after TRequestStatus completes.
+    *
+    * @param aResultItem This structure is stored into the database. 
+    *   Client is responsible for creating the object. Also client is responsible 
+    *   for setting item's values.
+    *
+    * @param aStatus Asynchronous status. Completes when process is finished.
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrAlreadyExists if record is already completed.
+    *   KErrDiskFull is returned if there is not enough space on c-drive. 
+    *   If KErrDiskFull is received, the test result is not logged.
+    *
+    **/ 
+    IMPORT_C TInt LogTestResult ( TRequestStatus& aStatus, 
+                                  const CDiagResultsDatabaseItem& aResultItem );
+
+    /**
+    * Cancel LogTestResult. Server continues to write result item into the DB.
+    * Cancelling only completes client's request.
+    **/                                  
+    IMPORT_C void CancelLogTestResult() const;                                  
+    
+    /**
+    * Get single test result from this test record identified by an uid. 
+    * 
+    * @param aPluginUid Unique identifier of the plug-in whose results are needed.
+    * @param aResultItem Contains test results.
+    * @return KErrNone, if successful, otherwise one of the other system-wide 
+    *   error codes.KErrNotFound is returned if the plug-in is not found
+    *   from the record.
+    **/
+    IMPORT_C TInt GetTestResult ( TUid aPluginUid, 
+                                  CDiagResultsDatabaseItem*& aResultItem ) const;
+   
+    /**
+    * Get all test results inside the test record. Client is responsible for 
+    * reseting/destroying the array.
+    *
+    * @param aResultsArray Returns test results for this record. 
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    */
+    IMPORT_C TInt GetTestResults ( RPointerArray<CDiagResultsDatabaseItem>& aResultsArray ) const;
+ 
+private:
+    
+    /**
+    * Leaving version of the functions and helper functions.
+    **/ 
+    void DoConnectL ( RDiagResultsDatabase& aSession, 
+                      TUid aRecordId,
+                      TBool aReadOnly );
+        
+    void DoCreateNewRecordL ( RDiagResultsDatabase& aSession, TUid& aRecordId,
+                              CDiagResultsDbRecordEngineParam& aEngineParam );
+    
+    void DoGetTestUidsL ( CArrayFixFlat<TUid>& aTestUidArray ) const;
+    
+    void DoLogTestResultL ( TRequestStatus& aStatus, 
+                            const CDiagResultsDatabaseItem& aResultItem );
+    
+    void DoGetTestResultsL ( RPointerArray<CDiagResultsDatabaseItem>& aResultsArray ) const;
+    
+    void DoGetTestResultL ( TUid aPluginUid, CDiagResultsDatabaseItem*& aResultItem ) const;
+    
+    void WriteDatabaseItemIntoBufferL( const CDiagResultsDatabaseItem& aResultItem );
+    
+    void WriteEngineParamIntoBufferL( CDiagResultsDbRecordEngineParam& aEngineParam );
+    
+    void DoGetEngineParamL( CDiagResultsDbRecordEngineParam*& aEngineParam ) const;
+    
+private: 
+
+    // Dynamic flat buffer.
+    CBufFlat* iBuffer;  
+    
+    // Is the connection already open.
+    TBool iOpen;  
+    
+    //Buffer pointer
+    TPtr8 iPtr;
+    };
+
+#endif  // DIAGNOSTICS_RESULTS_DATABASE_CLIENT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdatabaseitem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2007-2007 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:  Results database item
+*
+*/
+
+
+#ifndef DIAGRESULTSDATABASEITEM_H
+#define DIAGRESULTSDATABASEITEM_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+class TTime;
+class TStreamId;
+class CStreamStore;
+class CBufFlat;
+
+/**
+* Results database item.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDatabaseItem : public CBase
+    {
+public:
+    /** 
+    * Result of test.
+    */
+    enum TResult
+        {
+        ESuccess = 0,
+        EFailed,            // Test failed
+        ESkipped,           // Test was never executed because it was skipped 
+                            // before it is started. (e.g. during initial delay timer)
+        ECancelled,         // Test session was cancelled. ( ECancelAll )
+        EInterrupted,       // Interrupted. Test was already running, but interrupted 
+                            // by end user, or other external cause.
+        ENotPerformed,      // Not performed due to invalid set up. 
+        EDependencyFailed,  // Failed because dependent test failed.
+        EWatchdogCancel,    // Watchdog cancelled testing.
+        ESuspended,         // Test is scheduled to run later.
+        EQueuedToRun,       // Test is waiting for execution. It is possible that 
+                            // EQueuedToRun is never overwritten.
+        EDependencySkipped  // Skipped because common dependency was not executed
+                            // either due to it was skipped or interrupted.
+        };
+
+public:
+
+    /**
+    * NewL. Construct from a stream.
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewL ( RReadStream& aStream );
+        
+    /**
+    * NewL. 
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewL (
+                                        TUid            aTestUid,
+                                        TBool           aDependencyExecution,
+                                        TResult         aResult,
+                                        TTime           aStartTime,
+                                        TTime           aEndTime,
+                                        CBufFlat*       aDetailsData );
+    /**
+    * NewLC.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewLC (
+                                        TUid            aTestUid,
+                                        TBool           aDependencyExecution,
+                                        TResult         aResult,
+                                        TTime           aStartTime,
+                                        TTime           aEndTime,
+                                        CBufFlat*       aDetailsData );
+
+    /**
+    * NewL. Copy constructor. This will do a deep copy.
+    *
+    * @param aOriginal - Original to copy data from.
+    * @return a new instance of CDiagResultsDatabaseItem that is a deep
+    *   copy of the original given. Ownership is transferred.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewL ( 
+        const CDiagResultsDatabaseItem& aOriginal );
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagResultsDatabaseItem();
+   
+    /**
+    * Get Uid of test plug-in. 
+    *
+    * @return TUid - uid of the test plug-in.
+    */
+    IMPORT_C TUid TestUid() const;
+    
+    /**
+    * Whether the test was executed to satisfy dependency or not.
+    *
+    * @return ETrue if executed as dependency.
+    *         EFalse otherwise.
+    */
+    IMPORT_C TBool WasDependency() const;
+    
+    /**
+    * Get Test Result.
+    *
+    * @return TResult.
+    */
+    IMPORT_C TResult TestResult() const;
+
+    /**
+    * Time that test execution was started.
+    * Universal time is used.
+    *
+    * @return Time that execution was started.
+    */
+    IMPORT_C TTime TimeStarted() const;
+
+    /**
+    * Time that test execution was completed.
+    * Universal time is used.
+    *
+    * @return Time that execution was completed.
+    */
+    IMPORT_C TTime TimeCompleted() const;
+
+    /**
+    * Details data. This must be interpreted by the plug-ins before
+    * it can be used. Data is in object form.
+    */
+    IMPORT_C const CBufFlat* DetailsData() const;
+
+    /**
+    * Calculate stream size in bytes. Size can be used to evaluate needed
+    * stream size. 
+    *
+    * @return Size in bytes.
+    */
+    IMPORT_C TInt Size() const;
+
+public: 
+
+    /**
+    * Externalize the test result to a stream.
+    *
+    * @param aStream   Stream to write to.
+    */
+    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; 
+    
+    
+private: //internalization methods   
+
+    /**
+    * Internalize the test result from a stream.
+    *
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C void InternalizeL( RReadStream& aStream );
+    
+    /**
+    * Write TTime into write stream.
+    * 
+    * @param aStream Stream to write to.
+    * @param aTime TTime that is written into the stream.
+    **/
+    void WriteTimeToStreamL( RWriteStream& aStream, const TTime& aTime ) const;
+    
+    /**
+    * Read TTime from read stream.
+    * 
+    * @param aStream read stream.
+    * @param aTime Contains time after stream is read.
+    **/
+    void ReadTimeFromStreamL( RReadStream& aStream, TTime& aTime );
+
+private:
+    
+    /**
+    * C++ Constructors.
+    */
+    CDiagResultsDatabaseItem (
+                        TUid            aTestUid,
+                        TBool           aDependencyExecution,
+                        TResult         aResult,
+                        TTime           aStartTime,
+                        TTime           aEndTime,
+                        CBufFlat*       aDetailsData );
+    
+    /**
+    * Construct from a stream.
+    *
+    * @param aStream Read stream.
+    */ 
+    void ConstructL ( RReadStream& aStream );
+    
+    /**
+    * Default C++ constructor.
+    **/
+    CDiagResultsDatabaseItem ();
+    
+private:    // data
+
+    // Uid of the test plug-in.
+    TUid            iTestUid;
+    
+    // Has this been executed as a part of another execution (precondition).
+    TBool           iDependencyExecution;
+    
+    // Test result
+    TResult         iResult;
+    
+    // When the test began.
+    TTime           iStartTime;
+    
+    // When the test ended
+    TTime           iEndTime;
+    
+    // Contains flat buffer that can hold additional data 
+    // For example debugging data or further analysis.
+    CBufFlat*       iDetailsData;
+
+    };
+
+#endif // DIAGRESULTSDATABASEITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdatabasetestrecordinfo.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007-2007 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:  Contains overview of the test record, not actual test results.
+*  libraries   : DiagResultsDatabase.lib DiagResultsDatabase.dll
+*
+*/
+
+
+#ifndef DIAGNOSTICS_RESULTS_DATABASE_TEST_RECORD_INFO_H
+#define DIAGNOSTICS_RESULTS_DATABASE_TEST_RECORD_INFO_H
+
+#include <e32base.h>
+
+class RReadStream;
+class RWriteStream;
+
+/**
+* Results database record info. Contains information about one record.
+*
+* @since S60 v5.0
+**/
+class TDiagResultsDatabaseTestRecordInfo
+    {
+public:
+
+    enum TDbRecordStatus
+        {      
+        EOpen,                // Currently open for writing.
+        ESuspended,   	      // ::Suspend() is called. 
+        ECompleted	          // Record is completed (not resumable), and all 
+                              // tests were completed. 
+        };
+
+
+    /**
+    * Constructor
+    **/
+    IMPORT_C TDiagResultsDatabaseTestRecordInfo();
+    
+    /**
+    * Internalize from a stream.
+    *
+    * @param aStream Stream to be read from.
+    **/
+    IMPORT_C void InternalizeL( RReadStream& aStream );
+
+    /**
+    * Externalize into a stream.
+    *
+    * @param aStream Stream to be written into.
+    **/
+    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
+    
+    /**
+    * Returns DRM time.
+    *
+    * @return DRM time.
+    **/
+    IMPORT_C static TTime DRMTimeL();
+
+    //Public member data.
+    TUid            iRecordId;   // Identifies this record.
+    TTime 		    iDrmStartTime;  //When the record was opened (DRM time).
+    TTime 		    iDrmFinishTime; //when the record was completed (DRM time).
+    TTime 		    iStartTime;  //When the record was opened (Home time).
+    TTime 		    iFinishTime; //when the record was completed (Home time).
+    TUid 	        iDbUid; 	 //UID3 of the database.
+    TUint 		    iTestCount;  //The number of tests in this record.
+    TDbRecordStatus iRecordStatus; //Stored record status. 
+    TBool           iCompleted; //Writable or read-only test record
+    
+
+private:
+
+    /**
+    * Writes time(TTime) into a stream. Time has to be written into a stream 
+    * using two 32-bit values since there is no method to write 64-bit value.
+    *
+    * @param aStream Stream to be written into.
+    * @param aTime Time that is written into the stream.
+    **/
+    void WriteTimeToStreamL( RWriteStream& aStream, const TTime& aTime ) const;
+    
+    /**
+    * Reads time (TTime) from a stream. 
+    *
+    * @param aStream Stream to be read from.
+    * @param aTime Time that was read from the stream.
+    **/
+    void ReadTimeFromStreamL( RReadStream& aStream, TTime& aTime );
+    
+    };
+    
+#endif    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdbrecordengineparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2007-2007 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:  Capsulates parameters of the diagnostics engine.
+*
+*/
+
+
+#ifndef DIAGRESULTSDBRECORDENGINEPARAM_H
+#define DIAGRESULTSDBRECORDENGINEPARAM_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+
+/**
+* Contains parameters of the diagnostics engine.
+* Parameters are needed only in suspend/resume functionality.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbRecordEngineParam : public CBase
+    {
+public:
+
+
+    /**
+    * NewL. Construct from a stream.
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C static CDiagResultsDbRecordEngineParam* NewL ( RReadStream& aStream );
+        
+    /**
+    * NewL. Ownership of RArray is transferred.
+    *
+    * @param aInitialUids Execution Uid array. Should not be null. 
+    *                     Use empty array if there are no uids.
+    * @param aDependencyExecution This value is needed when resuming 
+    *                             in order to create proper test resume plan.
+    */
+    IMPORT_C static CDiagResultsDbRecordEngineParam* NewL (
+                                        RArray<TUid>*   aInitialUids,
+                                        TBool           aDependencyExecution
+                                        );
+    /**
+    * NewLC. Ownership of RArray is transferred.
+    *
+    * @param aInitialUids Execution Uid array. Should not be null. 
+    *                     Use empty array if there are no uids.
+    * @param aDependencyExecution This value is needed when resuming 
+    *                             in order to create proper test resume plan.
+    */
+    IMPORT_C static CDiagResultsDbRecordEngineParam* NewLC (
+                                        RArray<TUid>*   aInitialUids,
+                                        TBool           aDependencyExecution
+                                        );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagResultsDbRecordEngineParam();
+   
+    /**
+    * Return execution uids. These can be used to store for example 
+    * user selections. User selections are needed when test run is suspended 
+    * or test session crashed the phone.
+    *
+    * @return Array of uids. Empty if none.
+    */
+    IMPORT_C const RArray<TUid>& ExecutionsUidArray() const;
+    
+    /**
+    * Indicates were dependencies resolved when diagnostics engine executed tests.
+    *
+    * @return ETrue if dependencies were resolved, EFalse otherwise.
+    */
+    IMPORT_C TBool DependencyExecution() const;
+    
+public: 
+
+    /**
+    * Externalize the test result to a stream.
+    *
+    * @param aStream   Stream to write to.
+    */
+    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; 
+
+
+private: //internalization methods   
+
+    /**
+    * Internalize the test result from a stream.
+    *
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C void InternalizeL( RReadStream& aStream );
+    
+  
+private:
+    
+    /**
+    * C++ Constructors.
+    */
+    CDiagResultsDbRecordEngineParam ( RArray<TUid>* aInitialUids,
+                                      TBool         aDependencyExecution );
+    
+    /**
+    * Construct from a stream.
+    *
+    * @param aStream Read stream.
+    */ 
+    void ConstructL ( RReadStream& aStream );
+    
+    /**
+    * Default constructL. Does nothing.
+    */ 
+    void ConstructL ();
+    
+    /**
+    * Default C++ constructor.
+    **/
+    CDiagResultsDbRecordEngineParam ();
+    
+private:    // data
+
+    // Execution uid array
+    RArray<TUid>*               iExecutionUids;
+    
+    //Dependency resolving state.
+    TBool                       iDependencyExecution;
+    
+    };
+
+#endif // DIAGRESULTSDBRECORDENGINEPARAM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/inc/diagresultsdbrecordinfoarraypacked.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2007-2007 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:  Contains functions to pack or unpack test record info array.
+*  libraries   : DiagResultsDatabase.lib DiagResultsDatabase.dll
+*
+*/
+
+
+#ifndef DIAGNOSTICS_RESULTS_DB_RECORD_INFO_ARRAY_PACKED_H
+#define DIAGNOSTICS_RESULTS_DB_RECORD_INFO_ARRAY_PACKED_H
+
+#include "diagresultsdatabasetestrecordinfo.h"
+
+class CBufFlat;
+
+/**
+* Pack or unpack a CBufFlat buffer. This can be used to deliver data
+* across process boundaries using a flat buffer.
+*
+* @since S60 v5.0
+**/
+class TDiagResultsDbRecordInfoArrayPacked
+    {
+public:
+
+    /**
+    * Constructor
+    * @param aBuffer Flat buffer where the array of test records is written.
+    **/
+    IMPORT_C TDiagResultsDbRecordInfoArrayPacked(CBufFlat*& aBuffer);
+
+    /**
+    * Packs a test record into the flat buffer.
+    * @param aInfoArray An array of test records that are written into the buffer.
+    **/
+    IMPORT_C void PackArrayL(const CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray);
+    
+    /**
+    * Unpack array from the buffer.
+    * @param aInfoArray Contains the unpacked array after function finishes.
+    **/
+    IMPORT_C void UnpackArrayL(CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray);
+        
+private:
+
+    // Buffer that contains data.
+    CBufFlat *& iBuffer;
+    
+    };
+    
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1114 @@
+/*
+* Copyright (c) 2007 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:  Class definition of RDiagResultsDatabase
+*
+*/
+
+
+
+// USER INCLUDE FILES
+
+#include "diagresultsdatabase.h"
+#include "diagresultsdatabaseitem.h"
+#include "diagresultsdbrecordinfoarraypacked.h"
+#include "diagresultsdatabasetestrecordinfo.h"
+#include "diagresultsdbprivatecrkeys.h"
+#include "diagresultsdbrecordengineparam.h"
+#include "diagresultsdatabasecommon.h"
+//#include <diagframeworkdebug.h>
+// SYSTEM INCLUDE FILES
+#include <s32mem.h> 
+#include <centralrepository.h> 
+
+const TInt KResultsDatabaseBufferLength = 0x700;
+const TInt KResultsDatabaseSubsessionBufferLength = 0x250;
+const TInt KResultsDatabaseGranuality = 50;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RDiagResultsDatabase::RDiagResultsDatabase(): 
+         iBuffer(NULL), iOpen(EFalse)
+       , iPtr( NULL, 0 )
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RDiagResultsDatabase::~RDiagResultsDatabase()
+    {
+    if ( iBuffer )
+        {
+        iBuffer->Reset();
+        delete iBuffer;
+        iBuffer = NULL;    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Create connection to the results DB server
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::Connect( TUid aAppUid )
+    {
+    LOGME("RDiagResultsDatabase::Connect");
+	TRAPD( err, DoConnectL( aAppUid));
+	
+	return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Start server, create flat buffer and send request.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabase::DoConnectL (TUid aAppUid)
+    {
+    LOGME("RDiagResultsDatabase::DoConnectL");
+    if (iBuffer==NULL) {
+		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
+		
+		if (iBuffer==NULL) {
+			User::Leave( KErrNoMemory );
+		}
+		
+		iBuffer->ResizeL(KResultsDatabaseBufferLength);
+	}
+    
+    TInt r = DiagResultsDbCommon::StartServer();
+    LOGME1("RDiagResultsDatabase::StartServer %d",r);
+	if( r==KErrNone )
+	    // Use default message slots
+		r = CreateSession( KDiagResultsDatabaseServerName, Version() );
+	LOGME1("RDiagResultsDatabase::Createsession %d",r); 
+	if ( r != KErrNone )
+	    {
+	    User::Leave (r);
+	    }
+	
+	iOpen = ETrue;
+	
+    TPckgBuf<TUid> uid( aAppUid );
+    TInt srret = SendReceive (DiagResultsDbCommon::EConnect,TIpcArgs(&uid) );
+    LOGME1("Rsession sendreceive %d",srret);
+    if (srret != KErrNone)
+	User::Leave( srret );
+    }
+
+// ---------------------------------------------------------------------------
+// Close connection with the server.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::Close()
+    {
+    LOGME("RDiagResultsDatabase::Close");
+    if ( iOpen )
+        {
+        TInt err = SendReceive( DiagResultsDbCommon::EClose );
+        RHandleBase::Close();
+        iOpen = EFalse;
+        delete iBuffer;
+        iBuffer = NULL;
+        return err;    
+        }
+    else 
+        {
+        iOpen = EFalse;
+        return KErrNone;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the version of this server.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TVersion RDiagResultsDatabase::Version() const
+    {
+    return( TVersion( KDiagResultsDatabaseServerMajor, 
+                      KDiagResultsDatabaseServerMinor,
+		              KDiagResultsDatabaseServerBuild ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns test record count.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::GetRecordCount( TUint& aCount ) const
+    {
+	TPckgBuf<TUint> pckg;
+	TInt error = SendReceive( DiagResultsDbCommon::EGetRecordCount, TIpcArgs(&pckg) );
+	aCount = pckg();
+	
+	return error;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Fetch maximum number of test records from the central repository.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::GetDatabaseMaximumSize( TInt& aMaxSize )
+    {
+    TRAPD( err, DoGetDatabaseMaximumSizeL( aMaxSize ) );
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Fetch maximum number of test records from the central repository.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabase::DoGetDatabaseMaximumSizeL( TInt& aMaxSize )
+    {
+    CRepository* cr = CRepository::NewLC( KCRUidDiagnosticsResults );
+        
+    User::LeaveIfError( cr->Get( KDiagDatabaseMaxRecordCount, aMaxSize ) );
+    
+    CleanupStack::PopAndDestroy( cr );
+    }
+
+// ---------------------------------------------------------------------------
+// Get available record uids.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::GetRecordUids( 
+            CArrayFixFlat<TUid>& aSortedRecordUidArray ) const
+    {
+    TRAPD( err, DoGetRecordUidsL( aSortedRecordUidArray ));
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Resize buffer and then start query. Overflow means that the buffer was not
+// large enough.
+// ---------------------------------------------------------------------------
+//    
+void RDiagResultsDatabase::DoGetRecordUidsL( 
+                           CArrayFixFlat<TUid>& aSortedRecordUidArray ) const
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseBufferLength );
+    
+    TPtr8 ptr ( iBuffer->Ptr(0) );
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::EGetRecordList, 
+                            TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + KResultsDatabaseBufferLength );
+        ptr.Set( iBuffer->Ptr(0) );
+        ret = SendReceive( DiagResultsDbCommon::EGetRecordList, 
+                           TIpcArgs(&ptr) );
+        }
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+        
+    RBufReadStream readStream ( *iBuffer );   
+    CleanupClosePushL( readStream ) ;
+    TInt count = readStream.ReadInt16L();
+    
+    for ( TInt i = 0; i < count; ++i )
+        {
+        aSortedRecordUidArray.AppendL ( TUid::Uid( readStream.ReadInt32L()) );
+        }
+   
+   CleanupStack::PopAndDestroy( &readStream );
+    }    
+
+// ---------------------------------------------------------------------------
+// Returns last completed record.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::GetLastRecord( TUid& aRecordUid ) const
+    {
+    TPckgBuf<TUid> pckg;
+	TInt err = SendReceive( DiagResultsDbCommon::EGetLastRecord, 
+	                        TIpcArgs(&pckg) );
+	aRecordUid = pckg();
+	return err;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Get last incomplete record. It could suspended or application crashed
+// when running the test.
+// ---------------------------------------------------------------------------
+//       
+EXPORT_C TInt RDiagResultsDatabase::GetLastNotCompletedRecord ( 
+                                                    TUid& aRecordUid ) const
+    {
+    TPckgBuf<TUid> pckg;
+    TInt err = SendReceive( DiagResultsDbCommon::EGetLastNotCompletedRecord, 
+	                        TIpcArgs(&pckg) );
+	aRecordUid = pckg();
+	return err;
+                                                        
+    }
+
+// ---------------------------------------------------------------------------
+// Get all test record overviews.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::GetAllRecordInfos ( 
+            CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray) 
+    {
+    TRAPD( err, DoGetAllRecordInfosL( aInfoArray ));
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Send client request to the server. If overflow, then resize buffer and
+// try again. 
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabase::DoGetAllRecordInfosL ( 
+            CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray) 
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseBufferLength );
+    
+    TPtr8 ptr ( iBuffer->Ptr(0) );
+    
+    TInt ret = SendReceive( DiagResultsDbCommon::EGetRecordInfoList, 
+                            TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + KResultsDatabaseBufferLength );
+        ptr.Set( iBuffer->Ptr(0) );
+        ret = SendReceive( DiagResultsDbCommon::EGetRecordInfoList, 
+                           TIpcArgs(&ptr) );
+        }
+    
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+            
+    TDiagResultsDbRecordInfoArrayPacked packedArray( iBuffer );    
+    packedArray.UnpackArrayL( aInfoArray );
+    }
+
+// ---------------------------------------------------------------------------
+// Asynchronous get last results.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RDiagResultsDatabase::InitiateGetLastResults ( 
+                                          const CArrayFixFlat<TUid>& aUidArray,
+                                          TRequestStatus& aStatus )
+    {    
+    TRAPD( error, WriteArrayIntoBufferL( aUidArray ));
+    
+    if ( error != KErrNone )
+        {         
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete( status, error );
+        return;
+        }
+    
+            
+    iPtr.Set( iBuffer->Ptr(0) );
+    
+	SendReceive( DiagResultsDbCommon::EInitiateGetLastResults, 
+	             TIpcArgs( &iPtr ), 
+	             aStatus);
+    }
+
+// ---------------------------------------------------------------------------
+// Write Array into Buffer:
+// ---------------------------------------------------------------------------
+//    
+void RDiagResultsDatabase::WriteArrayIntoBufferL( const CArrayFixFlat<TUid>& aUidArray )
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseBufferLength );     
+
+    RBufWriteStream writeStream ( *iBuffer );
+    CleanupClosePushL( writeStream );
+        
+    writeStream.WriteInt8L( aUidArray.Count() );
+    
+    for ( TInt i=0; i < aUidArray.Count(); ++i )
+        {
+        writeStream.WriteInt32L( aUidArray[i].iUid );
+        }
+     
+    writeStream.CommitL();  
+    
+    CleanupStack::PopAndDestroy();
+    }
+    
+// ---------------------------------------------------------------------------
+// Cancel asynchronous request.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RDiagResultsDatabase::CancelInitiateGetLastResults () const
+    {
+    SendReceive( DiagResultsDbCommon::ECancelInitiateGetLastResults );
+    }
+
+// ---------------------------------------------------------------------------
+// See InitiateGetLastResults. After InitiateGetLastResults finishes ok, 
+// this method can be called to retrieve data.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt RDiagResultsDatabase::GetLastResults ( 
+                    RPointerArray<CDiagResultsDatabaseItem>& aResults ) const
+    {
+    TRAPD( err, DoGetLastResultsL( aResults ) );
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Resize buffer and make the request. Data is serialized in the buffer so it 
+// must be read using a read stream.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabase::DoGetLastResultsL ( 
+                    RPointerArray<CDiagResultsDatabaseItem>& aResults ) const
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseBufferLength );
+    
+    TPtr8 ptr ( iBuffer->Ptr(0));
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::EGetLastResults, 
+                            TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + KResultsDatabaseBufferLength );
+        ptr.Set ( iBuffer->Ptr(0) );
+        ret = SendReceive( DiagResultsDbCommon::EGetLastResults, 
+                           TIpcArgs(&ptr) );
+        }
+        
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+        
+    RBufReadStream readStream ( *iBuffer );    
+    TInt count = readStream.ReadInt16L();
+    
+    for ( TInt i = 0; i < count; ++i )
+        {
+        
+        TUint8 value = readStream.ReadUint8L();
+        if ( value == 0 )
+            {
+            aResults.AppendL( NULL );
+            }
+        else 
+            {
+            aResults.AppendL (CDiagResultsDatabaseItem::NewL( readStream ) );
+            }
+        }
+        
+    readStream.Close();    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Initiate asynchronous operation. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RDiagResultsDatabase::InitiateGetLastResult ( TUid aTestPluginUid, 
+                                      TRequestStatus& aStatus )
+    {
+    TPckgBuf<TUid> uidpckg( aTestPluginUid );
+    
+    SendReceive( DiagResultsDbCommon::EInitiateGetSingleLastResult, 
+	             TIpcArgs( &uidpckg ), 
+	             aStatus);
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Get last result that was fetched using InitiateGetLastResult method.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabase::GetLastResult ( 
+                                       CDiagResultsDatabaseItem*& aItem )    
+    {
+    
+    TRAPD( err, DoGetLastResultL( aItem ) );
+    return err;            
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Leaving version of the function.
+// ---------------------------------------------------------------------------
+//    
+void RDiagResultsDatabase::DoGetLastResultL ( 
+                                        CDiagResultsDatabaseItem*& aItem )    
+    {    
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseBufferLength );
+     	              
+    TPtr8 ptr ( iBuffer->Ptr(0));
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::EGetSingleLastResult, 
+                            TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + KResultsDatabaseBufferLength );
+        ptr.Set ( iBuffer->Ptr(0) );
+        ret = SendReceive( DiagResultsDbCommon::EGetSingleLastResult, 
+                           TIpcArgs(&ptr) );
+        }
+        
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+        
+    RBufReadStream readStream ( *iBuffer );  
+    
+    TInt count = readStream.ReadInt8L();  
+   
+    if ( count == 0 )
+        {
+        aItem = NULL;
+        }
+    else 
+        {
+        aItem = CDiagResultsDatabaseItem::NewL ( readStream );    
+        }
+          
+    readStream.Close();
+    }
+    
+// ---------------------------------------------------------------------------
+// Subsession constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RDiagResultsDatabaseRecord::RDiagResultsDatabaseRecord(): 
+                                        iBuffer(NULL), 
+                                        iOpen(EFalse)
+                                        ,iPtr( NULL, 0 )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Subsession destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RDiagResultsDatabaseRecord::~RDiagResultsDatabaseRecord()
+    {
+     if ( iBuffer )
+        {
+        iBuffer->Reset();
+        delete iBuffer;
+        iBuffer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if connection is already open.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::Connect( 
+            RDiagResultsDatabase& aSession,
+            TUid aRecordId,
+            TBool aReadOnly ) 
+    {
+    LOGME("RDiagResultsDatabaseRecord::Connect");
+    if ( iOpen )
+        {
+        return KErrAlreadyExists;
+        }
+    
+    TRAPD( err, DoConnectL( aSession, aRecordId, aReadOnly ) );
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Creates the flat buffer and connects the subsession to a test record.
+// The test record must exist.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoConnectL( 
+            RDiagResultsDatabase& aSession,
+            TUid aRecordId,
+            TBool aReadOnly ) 
+    {
+    LOGME("RDiagResultsDatabaseRecord::DoConnectL");
+    if (iBuffer==NULL)
+		{
+		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
+		
+		if (iBuffer==NULL) {
+			User::Leave( KErrNoMemory );
+		}
+		
+		iBuffer->ResizeL(KResultsDatabaseSubsessionBufferLength);
+		}
+    
+    iOpen = ETrue;
+    
+    TPckgBuf<TUid> uid( aRecordId );
+    TPckgBuf<TBool> readonlyPckg( aReadOnly );
+    User::LeaveIfError( CreateSubSession( aSession, 
+                                      DiagResultsDbCommon::EConnectSubsession, 
+                                      TIpcArgs(&uid, &readonlyPckg) ));
+    }
+
+
+// ---------------------------------------------------------------------------
+// Create a new subsession and create a new test record.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::CreateNewRecord (
+                                            RDiagResultsDatabase& aSession, 
+                                            TUid& aRecordId,
+                                            CDiagResultsDbRecordEngineParam& aEngineParam )
+    {
+    if ( iOpen )
+        {
+        return KErrAlreadyExists;
+        }
+        
+    TRAPD( err, DoCreateNewRecordL( aSession, aRecordId, aEngineParam) );
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Get parameters that are needed when resuming test session.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::GetEngineParam( 
+                        CDiagResultsDbRecordEngineParam*& aEngineParam ) const
+    {
+    TRAPD(err, DoGetEngineParamL( aEngineParam ) );
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Leaving version of GetEngineParam. Serialize EngineParam class.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoGetEngineParamL( 
+                        CDiagResultsDbRecordEngineParam*& aEngineParam ) const
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
+	
+    TPtr8 ptr ( iBuffer->Ptr(0) );
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::ESubsessionGetEngineParam, 
+                                                 TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() 
+                                + KResultsDatabaseSubsessionBufferLength );
+        ptr.Set( iBuffer->Ptr(0) );                                
+        ret = SendReceive( DiagResultsDbCommon::ESubsessionGetEngineParam, 
+                           TIpcArgs(&ptr) );
+        }
+    
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+     
+    //Stream contains the serialized array
+    RBufReadStream readStream ( *iBuffer );
+    CleanupClosePushL ( readStream );
+    
+    //Construct new test result.
+    CDiagResultsDbRecordEngineParam* params = 
+                                CDiagResultsDbRecordEngineParam::NewL( readStream );
+    aEngineParam = params;
+   
+    CleanupStack::PopAndDestroy( &readStream );
+    
+    iBuffer->Delete(0, iBuffer->Size() );      
+    }     
+// ---------------------------------------------------------------------------
+// Create the flat buffer and create the subsession.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoCreateNewRecordL (
+            RDiagResultsDatabase& aSession,
+            TUid& aRecordId,
+            CDiagResultsDbRecordEngineParam& aEngineParam )
+    {
+     if (iBuffer==NULL) {
+		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
+		
+		if (iBuffer==NULL) {
+			User::Leave( KErrNoMemory );
+		}
+		
+		iBuffer->ResizeL(KResultsDatabaseSubsessionBufferLength);
+    }
+        
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
+    
+    TPtr8 ptr ( iBuffer->Ptr(0) );    
+        
+    TRAPD( error, WriteEngineParamIntoBufferL( aEngineParam ) );
+     
+    while ( error == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + KResultsDatabaseSubsessionBufferLength ); 
+        ptr.Set( iBuffer->Ptr(0) );
+        TRAP( error, WriteEngineParamIntoBufferL( aEngineParam) );
+        }
+        
+    User::LeaveIfError ( error );
+    
+    TPckgBuf<TUid> pckg;
+    
+    TInt err = CreateSubSession( aSession, 
+                              DiagResultsDbCommon::ESubsessionCreateNewRecord, 
+                              TIpcArgs(&pckg, &ptr) );
+    aRecordId = pckg();
+    if ( err == KErrNone )
+        {
+        iOpen = ETrue;
+        }
+        
+    User::LeaveIfError( err );
+    }
+
+// ---------------------------------------------------------------------------
+// Write engine parameters into the buffer.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::WriteEngineParamIntoBufferL( 
+                CDiagResultsDbRecordEngineParam& aEngineParam ) 
+    {
+    RBufWriteStream writeStream ( *iBuffer );
+    CleanupClosePushL( writeStream );
+    
+    aEngineParam.ExternalizeL( writeStream );
+    
+    writeStream.CommitL();
+    CleanupStack::PopAndDestroy();    
+    }
+
+// ---------------------------------------------------------------------------
+// Close the subsession.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RDiagResultsDatabaseRecord::Close()
+    {
+    if ( iOpen )
+        {
+        CloseSubSession( DiagResultsDbCommon::ECloseSubsession );    
+        }
+        
+    iOpen = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+
+// See ResumeTestRecord.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::Suspend()
+    {
+    return SendReceive ( DiagResultsDbCommon::ESubsessionSuspend );
+    }
+    
+// ---------------------------------------------------------------------------
+// Has this test record been suspended. 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt RDiagResultsDatabaseRecord::IsSuspended( TBool& aSuspended ) const
+    {
+    TPckgBuf<TBool> pckg;
+	TInt err = SendReceive( DiagResultsDbCommon::ESubsessionIsSuspended, 
+	                        TIpcArgs(&pckg) );
+	aSuspended = pckg();
+	return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns test record Id that this subsession represents.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::GetTestRecordId( 
+                                                TUid& aRecordUid ) const
+    {
+    TPckgBuf<TUid> pckg;
+	TInt err = SendReceive( DiagResultsDbCommon::ESubsessionGetTestRecordId, 
+	                        TIpcArgs(&pckg) );
+	aRecordUid = pckg();
+	return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Test record completion. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::TestCompleted( 
+                                                TBool aFullyComplete )
+    {
+    TPckgBuf<TBool> pckg (aFullyComplete);
+    return SendReceive ( DiagResultsDbCommon::ESubsessionTestCompleted, 
+                         TIpcArgs(&pckg) );
+    }
+
+// ---------------------------------------------------------------------------
+// GetStatus returns current record status.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::GetStatus( 
+                                        TRecordStatus& aRecordStatus ) const
+    {
+    TPckgBuf<TRecordStatus> pckg;
+	TInt err = SendReceive( DiagResultsDbCommon::ESubsessionGetStatus, 
+	                        TIpcArgs(&pckg) );
+	aRecordStatus = pckg();
+	return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Indicates has the subsession been written into the DB file.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::IsTestCompleted( 
+                                                    TBool& aCompleted ) const
+    {
+    TPckgBuf<TBool> pckg;
+	TInt err = SendReceive( DiagResultsDbCommon::ESubsessionIsTestCompleted, 
+	                        TIpcArgs(&pckg) );
+	aCompleted = pckg();
+	return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns record overview.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::GetRecordInfo ( 
+        TDiagResultsDatabaseTestRecordInfo& aInfo ) const
+    {
+    TPckgBuf<TDiagResultsDatabaseTestRecordInfo> pckg;
+	TInt err = SendReceive( DiagResultsDbCommon::ESubsessionGetRecordInfo, 
+	                        TIpcArgs(&pckg) );
+	aInfo = pckg();
+	return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Get all test plug-in uids that are stored in the test record. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::GetTestUids ( 
+                                    CArrayFixFlat<TUid>& aTestUidArray ) const
+    {    
+    TRAPD( err, DoGetTestUidsL( aTestUidArray ));
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Resize flat buffer, make the request. If flat buffer is not large enough
+// grow the size and make the request again.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoGetTestUidsL ( 
+                                    CArrayFixFlat<TUid>& aTestUidArray ) const
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
+    
+    TPtr8 ptr ( iBuffer->Ptr(0) );
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::ESubsessionGetTestUids, 
+                            TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + 
+                                KResultsDatabaseSubsessionBufferLength );
+        ptr.Set( iBuffer->Ptr(0) );                                
+        ret = SendReceive( DiagResultsDbCommon::ESubsessionGetTestUids, 
+                           TIpcArgs(&ptr) );
+        }
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+        
+    RBufReadStream readStream ( *iBuffer );  
+    CleanupClosePushL( readStream );
+    TInt count = readStream.ReadInt16L();
+    
+    for ( TInt i = 0; i < count; ++i )
+        {
+        aTestUidArray.AppendL ( TUid::Uid( readStream.ReadInt32L() ));
+        }
+   
+    CleanupStack::PopAndDestroy( &readStream );
+    } 
+
+// ---------------------------------------------------------------------------
+// Store one test result into the test record. The method does not write 
+// anything.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::LogTestResult ( 
+            TRequestStatus& aStatus,  
+            const CDiagResultsDatabaseItem& aResultItem )
+    {
+    TRAPD(err, DoLogTestResultL( aStatus, aResultItem ) );
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel LogTestResultL.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RDiagResultsDatabaseRecord::CancelLogTestResult() const
+    {
+    SendReceive( DiagResultsDbCommon::ESubsessionCancelLogTestResult );
+    }
+
+// ---------------------------------------------------------------------------
+// Resize flat buffer and serialize the object that needs to be transferred.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoLogTestResultL ( 
+            TRequestStatus& aStatus, 
+            const CDiagResultsDatabaseItem& aResultItem )
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    
+    //Make sure that the buffer is big enough for the item.
+    iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );  
+                                               
+    TRAPD( error, WriteDatabaseItemIntoBufferL( aResultItem ));
+    
+    while ( error == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + aResultItem.Size() ); 
+        TRAP( error, WriteDatabaseItemIntoBufferL( aResultItem ));
+        }
+            
+    if ( error != KErrNone )
+        {
+        TRequestStatus* status = &aStatus;
+        User::RequestComplete( status, error );
+        return;
+        }
+    
+    //Note that iPtr has to be member variable. If a new TPtr8 is defined in 
+    //here it can go out of scope i.e. reading will fail in the server side.
+    //Synchronous SendReceive would not have that problem.
+    iPtr.Set( iBuffer->Ptr(0) );
+	SendReceive( DiagResultsDbCommon::ESubsessionLogTestResult, 
+	                        TIpcArgs(&iPtr), aStatus );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// Write CDiagResultsDatabaseItem into a buffer.
+// ---------------------------------------------------------------------------
+//  
+void RDiagResultsDatabaseRecord::WriteDatabaseItemIntoBufferL( 
+                                 const CDiagResultsDatabaseItem& aResultItem )
+    {
+    RBufWriteStream writeStream ( *iBuffer );
+    CleanupClosePushL( writeStream );
+    aResultItem.ExternalizeL( writeStream );
+    writeStream.CommitL();
+    CleanupStack::PopAndDestroy();
+    }
+
+// ---------------------------------------------------------------------------
+// Get test results of the test record. 
+// ---------------------------------------------------------------------------
+//    
+ EXPORT_C TInt RDiagResultsDatabaseRecord::GetTestResults ( 
+                RPointerArray<CDiagResultsDatabaseItem>& aResultsArray ) const
+    {
+
+    TRAPD( err, DoGetTestResultsL( aResultsArray ) );
+    return err;
+    }  
+
+// ---------------------------------------------------------------------------
+// Retrieve test results. Server serializes data into the flat buffer. 
+// Read stream can be used to deserialize data.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoGetTestResultsL ( 
+                RPointerArray<CDiagResultsDatabaseItem>& aResultsArray ) const
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
+    
+    TPtr8 ptr ( iBuffer->Ptr(0));
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::ESubsessionGetTestResults, 
+                            TIpcArgs(&ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() + 
+                          KResultsDatabaseSubsessionBufferLength );
+        ptr.Set( iBuffer->Ptr(0) ); 
+        ret = SendReceive( DiagResultsDbCommon::ESubsessionGetTestResults, 
+                           TIpcArgs(&ptr) );
+        }
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+        
+    RBufReadStream readStream ( *iBuffer );    
+    TInt count = readStream.ReadInt16L();
+    
+    for ( TInt i = 0; i < count; ++i )
+        {
+        aResultsArray.AppendL (CDiagResultsDatabaseItem::NewL( readStream ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Get only one result from the test record.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RDiagResultsDatabaseRecord::GetTestResult ( 
+            TUid aPluginUid, 
+            CDiagResultsDatabaseItem*& aResultItem ) const
+    {    
+    TRAPD( err, DoGetTestResultL ( aPluginUid, aResultItem ) );
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Resize flat buffer and use read stream to retrieve data into DB item.
+// ---------------------------------------------------------------------------
+//
+void RDiagResultsDatabaseRecord::DoGetTestResultL ( 
+            TUid aPluginUid, 
+            CDiagResultsDatabaseItem*& aResultItem ) const
+    {
+    iBuffer->Delete( 0, iBuffer->Size() );
+    iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
+	
+    TPtr8 ptr ( iBuffer->Ptr(0) );
+    TPckgBuf<TUid> uid( aPluginUid );
+    //Now ask server to serialize object into this buffer
+    TInt ret = SendReceive( DiagResultsDbCommon::ESubsessionGetTestResult, 
+                                                 TIpcArgs(&uid, &ptr) );
+    
+    while ( ret == KErrOverflow )
+        {
+        iBuffer->ResizeL( iBuffer->Size() 
+                                + KResultsDatabaseSubsessionBufferLength );
+        ptr.Set( iBuffer->Ptr(0) );                              
+        ret = SendReceive( DiagResultsDbCommon::ESubsessionGetTestResult, 
+                           TIpcArgs(&uid, &ptr) );
+        }
+    
+    if ( ret != KErrNone )
+        {
+        User::Leave (ret);
+        }
+     
+    //Stream contains the serialized array
+    RBufReadStream readStream ( *iBuffer );
+    CleanupClosePushL( readStream );
+    
+    //Construct new test result.
+    CDiagResultsDatabaseItem* item = 
+                                CDiagResultsDatabaseItem::NewL( readStream );
+    aResultItem = item;
+    
+    CleanupStack::PopAndDestroy( &readStream );
+    
+    iBuffer->Delete(0, iBuffer->Size() );      
+    }               
+                              
+// ---------------------------------------------------------------------------
+// Starts server if it's not already running. 
+// ---------------------------------------------------------------------------
+//
+TInt DiagResultsDbCommon::StartServer()
+    {
+    LOGME("DiagResultsDbCommon::StartServer");
+	TInt res(KErrNone);
+	// create server - if one of this name does not already exist
+	TFindServer findServer(KDiagResultsDatabaseServerName);
+	TFullName name;
+	if (findServer.Next(name)!=KErrNone) // we don't exist already
+		{
+		TRequestStatus status;
+		RProcess server;
+		// Create the server process
+		res = server.Create(KDiagResultsDatabaseServerExe, KNullDesC);		
+
+		if( res!=KErrNone ) // thread created ok - now start it going
+			{
+			return res;
+			}
+
+		server.Rendezvous( status );
+		if( status != KRequestPending )
+		    {
+		    server.Kill(0); // abort start-up
+		    }
+        else
+            {
+            server.Resume(); // // wait for server start-up.
+            }
+                
+		// Wait until the completion of the server creation
+		User::WaitForRequest( status );
+		if( status != KErrNone )
+			{
+			server.Close();
+			return status.Int();
+			}
+		// Server created successfully
+		server.Close(); // we're no longer interested in the other process
+		}
+	LOGME1("startserver %d",res);
+    return res;
+    }
+    
+// ---------------------------------------------------------------------------
+// DLL entry point
+// ---------------------------------------------------------------------------
+//
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+	{
+	return(KErrNone);
+   	}
+#endif
+
+   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabaseItem.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,332 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagResultsDatabaseItem
+*
+*/
+
+
+#include <s32std.h> 
+
+#include "diagresultsdatabaseitem.h"
+
+// ---------------------------------------------------------------------------
+// NewL.Used when creating the object from a stream that contains the
+// serialized object.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CDiagResultsDatabaseItem* CDiagResultsDatabaseItem::NewL ( 
+                                                        RReadStream& aStream )
+    {
+    CDiagResultsDatabaseItem* self = new( ELeave ) CDiagResultsDatabaseItem();
+    CleanupStack::PushL( self );
+    self->ConstructL( aStream );
+    CleanupStack::Pop();
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// NewL. 
+// ---------------------------------------------------------------------------
+//        
+EXPORT_C CDiagResultsDatabaseItem* CDiagResultsDatabaseItem::NewL (
+                                        TUid            aTestUid,
+                                        TBool           aDependencyExecution,
+                                        TResult         aResult,
+                                        TTime           aStartTime,
+                                        TTime           aEndTime,
+                                        CBufFlat*       aDetailsData )
+    {
+    
+    CDiagResultsDatabaseItem* self = new( ELeave ) CDiagResultsDatabaseItem( 
+                                    aTestUid, aDependencyExecution, aResult, 
+                                    aStartTime, aEndTime, aDetailsData );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC.
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CDiagResultsDatabaseItem* CDiagResultsDatabaseItem::NewLC (
+                                        TUid            aTestUid,
+                                        TBool           aDependencyExecution,
+                                        TResult         aResult,
+                                        TTime           aStartTime,
+                                        TTime           aEndTime,
+                                        CBufFlat*       aDetailsData )
+    {
+    CDiagResultsDatabaseItem* self = new( ELeave ) CDiagResultsDatabaseItem( 
+                                        aTestUid, aDependencyExecution, aResult, 
+                                        aStartTime, aEndTime, aDetailsData );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewL. Copy constructor
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CDiagResultsDatabaseItem* CDiagResultsDatabaseItem::NewL (
+        const CDiagResultsDatabaseItem& aOriginal )
+    {
+    const CBufFlat* detailData = aOriginal.DetailsData();
+
+    CBufFlat* detailDataCopy = NULL;
+
+    if ( detailData )
+        {
+        detailDataCopy = CBufFlat::NewL( detailData->Size() );
+        CleanupStack::PushL( detailDataCopy );
+
+        TPtr8 ptr = detailDataCopy->Ptr( 0 );
+        detailData->Read( 0, ptr );
+        }
+
+    CDiagResultsDatabaseItem* self = CDiagResultsDatabaseItem::NewL(
+        aOriginal.TestUid(),
+        aOriginal.WasDependency(),
+        aOriginal.TestResult(),
+        aOriginal.TimeStarted(),
+        aOriginal.TimeCompleted(),
+        detailDataCopy );
+
+    if ( detailDataCopy )
+        {
+        CleanupStack::Pop( detailDataCopy );
+        }
+
+    return self;
+    }
+
+// ConstructL.
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDatabaseItem::ConstructL ( RReadStream& aStream )
+    {
+    InternalizeL( aStream );
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem::~CDiagResultsDatabaseItem()
+    {
+    if ( iDetailsData )
+        {
+        iDetailsData->Reset();
+        }
+        
+    delete iDetailsData;
+    iDetailsData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// C++ default constructor.
+// ---------------------------------------------------------------------------
+//    
+CDiagResultsDatabaseItem::CDiagResultsDatabaseItem()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TUid CDiagResultsDatabaseItem::TestUid() const
+    {
+    return iTestUid;
+    }
+    
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CDiagResultsDatabaseItem::WasDependency() const
+    {
+    return iDependencyExecution;
+    }
+    
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDatabaseItem::TResult 
+                   CDiagResultsDatabaseItem::TestResult() const
+    {
+    return iResult;
+    }
+
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TTime CDiagResultsDatabaseItem::TimeStarted() const
+    {
+    return iStartTime;
+    }
+
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TTime CDiagResultsDatabaseItem::TimeCompleted() const
+    {
+    return iEndTime;
+    }
+
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C const CBufFlat* CDiagResultsDatabaseItem::DetailsData() const
+    {
+    return iDetailsData;
+    }
+
+// ---------------------------------------------------------------------------
+// Externalize the object into writestream.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDatabaseItem::ExternalizeL(
+                                             RWriteStream& aStream ) const
+    {
+    aStream.WriteInt32L ( iTestUid.iUid );
+    aStream.WriteUint8L ( iDependencyExecution );
+    aStream.WriteInt16L ( iResult );
+    
+    WriteTimeToStreamL( aStream, iStartTime );
+    WriteTimeToStreamL( aStream, iEndTime );
+    
+    if ( iDetailsData == NULL )
+        {
+        aStream.WriteUint32L ( 0 );
+        }
+    else 
+        {
+        aStream.WriteUint32L ( iDetailsData->Size() );
+    
+        if ( iDetailsData->Size() > 0 )
+            {
+            aStream.WriteL( iDetailsData->Ptr(0), iDetailsData->Size() );    
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Bytes are calculated from ExternalizeL method. (216 bits = 27 bytes).
+// 32 + 8 + 16 + 64 + 64 + 32 = 216 bits.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CDiagResultsDatabaseItem::Size() const
+    {
+    if ( iDetailsData == NULL )
+        {
+        return 27;
+        }
+    
+    return (27 + iDetailsData->Size() );
+    }
+
+// ---------------------------------------------------------------------------
+// Internalize the object from a stream.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDatabaseItem::InternalizeL( RReadStream& aStream )
+    {
+    iTestUid = TUid::Uid( aStream.ReadInt32L () );
+    iDependencyExecution = aStream.ReadUint8L(); 
+    iResult = (TResult ) aStream.ReadInt16L();
+    
+    ReadTimeFromStreamL( aStream, iStartTime );
+    ReadTimeFromStreamL( aStream, iEndTime );
+    
+    TInt size = aStream.ReadUint32L();
+    
+    if ( size == 0 )
+        {
+        iDetailsData = NULL;
+        }
+    else 
+        {
+        iDetailsData = CBufFlat::NewL( 50 );
+        iDetailsData->ResizeL( size );
+        }
+    
+    
+    if ( size > 0 )
+        {
+        TPtr8 ptr = iDetailsData->Ptr(0);
+        aStream.ReadL( ptr, size);    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Helper function.
+// ---------------------------------------------------------------------------
+//    
+void CDiagResultsDatabaseItem::WriteTimeToStreamL( 
+                                            RWriteStream& aStream, 
+                                            const TTime& aTime ) const
+    {
+    TInt64 time = aTime.Int64(); 
+ 
+    TInt32 low_time = I64LOW( time );
+    TInt32 high_time = I64HIGH( time );
+ 
+    aStream.WriteInt32L( low_time );
+    aStream.WriteInt32L( high_time );
+    }    
+
+// ---------------------------------------------------------------------------
+// Helper function.
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDatabaseItem::ReadTimeFromStreamL( 
+                                           RReadStream& aStream, 
+                                           TTime& aTime ) 
+    {
+    TInt32 low_time = aStream.ReadInt32L();
+    TInt32 high_time = aStream.ReadInt32L();
+    
+    TInt64 readTime = MAKE_TINT64(high_time,low_time);
+    
+    aTime = TTime(readTime);
+    }  
+
+// ---------------------------------------------------------------------------
+// Constructor that sets the values.
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDatabaseItem::CDiagResultsDatabaseItem (
+                        TUid            aTestUid,
+                        TBool           aDependencyExecution,
+                        TResult         aResult,
+                        TTime           aStartTime,
+                        TTime           aEndTime,
+                        CBufFlat*       aDetailsData )
+    {
+    iTestUid = aTestUid;
+    iDependencyExecution = aDependencyExecution;
+    iResult = aResult;
+    iStartTime = aStartTime;
+    iEndTime = aEndTime;
+    iDetailsData = aDetailsData;
+    }
+    
+  
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabasetestrecordInfo.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2007 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:  Class definition of TDiagResultsDatabaseTestRecordInfo
+*
+*/
+
+
+// SYSTEM INCLUDE FILES
+#include <s32strm.h>
+#include <s32std.h>
+#include <drmserviceapi.h>
+
+// USER INCLUDE FILES
+#include "diagresultsdatabasetestrecordinfo.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TDiagResultsDatabaseTestRecordInfo::TDiagResultsDatabaseTestRecordInfo()
+    {
+    iRecordId = TUid::Null();
+    iDbUid = TUid::Null();
+    iTestCount = 0;
+    iCompleted = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Read TDiagResultsDatabaseTestRecordInfo object from a stream.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void TDiagResultsDatabaseTestRecordInfo::InternalizeL( 
+                                                RReadStream& aStream )
+    {
+    iRecordId = TUid::Uid( aStream.ReadInt32L() );
+    
+    ReadTimeFromStreamL( aStream, iDrmStartTime ); 
+    ReadTimeFromStreamL( aStream, iDrmFinishTime );
+    
+    ReadTimeFromStreamL( aStream, iStartTime ); 
+    ReadTimeFromStreamL( aStream, iFinishTime );
+    
+    iDbUid = TUid::Uid( aStream.ReadInt32L() );
+    iTestCount = aStream.ReadInt32L();
+    
+    iRecordStatus = (TDbRecordStatus) aStream.ReadUint8L();
+    
+    iCompleted = (TBool) aStream.ReadUint8L();
+    }    
+
+// ---------------------------------------------------------------------------
+// Write TDiagResultsDatabaseTestRecordInfo object into a stream.
+// ---------------------------------------------------------------------------
+//       
+EXPORT_C void TDiagResultsDatabaseTestRecordInfo::ExternalizeL( 
+                                                RWriteStream& aStream ) const
+    {
+    aStream.WriteInt32L( iRecordId.iUid );
+    
+    WriteTimeToStreamL( aStream, iDrmStartTime );
+    WriteTimeToStreamL( aStream, iDrmFinishTime );
+    
+    WriteTimeToStreamL( aStream, iStartTime );
+    WriteTimeToStreamL( aStream, iFinishTime );
+    
+    aStream.WriteInt32L( iDbUid.iUid );
+    aStream.WriteInt32L( iTestCount );
+
+    aStream.WriteUint8L( iRecordStatus );
+
+    aStream.WriteUint8L( iCompleted );
+    }   
+
+// ---------------------------------------------------------------------------
+// Helper function to write TTime into a stream.
+// ---------------------------------------------------------------------------
+//       
+void TDiagResultsDatabaseTestRecordInfo::WriteTimeToStreamL( 
+                                                RWriteStream& aStream, 
+                                                const TTime& aTime ) const
+    {
+    TInt64 time = aTime.Int64(); 
+ 
+    TInt32 low_time = I64LOW( time );
+    TInt32 high_time = I64HIGH( time );
+ 
+    aStream.WriteInt32L( low_time );
+    aStream.WriteInt32L( high_time );
+    }    
+
+// ---------------------------------------------------------------------------
+// Helper function to read TTime from a stream.
+// ---------------------------------------------------------------------------
+//  
+void TDiagResultsDatabaseTestRecordInfo::ReadTimeFromStreamL( 
+                                                RReadStream& aStream, 
+                                                TTime& aTime ) 
+    {
+    TInt32 low_time = aStream.ReadInt32L();
+    TInt32 high_time = aStream.ReadInt32L();
+    
+    TInt64 readTime = MAKE_TINT64(high_time,low_time);
+    
+    aTime = TTime(readTime);
+    }      
+
+// ---------------------------------------------------------------------------
+// Get secure DRM time.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TTime TDiagResultsDatabaseTestRecordInfo::DRMTimeL()
+    {
+    // Get the current time.
+    TTime currTime = 0;
+    DRM::CDrmServiceApi* drmApi = DRM::CDrmServiceApi::NewLC();
+    TInt timeZone = 0;
+    DRMClock::ESecurityLevel secLevel = DRMClock::KInsecure;
+    TInt err = drmApi->GetSecureTime( currTime, timeZone, secLevel );
+    CleanupStack::PopAndDestroy( drmApi );
+    User::LeaveIfError( err );
+    return currTime;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/src/diagresultsdbrecordengineparam.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagResultsDbRecordEngineParam
+*
+*/
+
+
+#include <s32std.h> 
+
+#include "diagresultsdbrecordengineparam.h"
+
+
+// ---------------------------------------------------------------------------
+// NewL.Used when creating the object from a stream that contains the
+// serialized object.
+// ---------------------------------------------------------------------------
+//        
+EXPORT_C CDiagResultsDbRecordEngineParam* CDiagResultsDbRecordEngineParam::NewL (
+                                        RReadStream& aStream )
+    {
+    CDiagResultsDbRecordEngineParam* self = 
+                     new( ELeave ) CDiagResultsDbRecordEngineParam();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aStream );
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CDiagResultsDbRecordEngineParam* CDiagResultsDbRecordEngineParam::NewL
+                                            ( 
+                                            RArray<TUid>*   aInitialUids,
+                                            TBool           aDependencyExecution
+                                            )
+    {
+    CDiagResultsDbRecordEngineParam* self = 
+                     new( ELeave ) CDiagResultsDbRecordEngineParam( 
+                                                        aInitialUids, 
+                                                        aDependencyExecution );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+    
+
+
+// ---------------------------------------------------------------------------
+// NewLC.
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CDiagResultsDbRecordEngineParam* CDiagResultsDbRecordEngineParam::NewLC (
+                                          RArray<TUid>*   aInitialUids,
+                                          TBool           aDependencyExecution
+                                          )
+    {
+    CDiagResultsDbRecordEngineParam* self = 
+                                new( ELeave ) CDiagResultsDbRecordEngineParam( 
+                                        aInitialUids, 
+                                        aDependencyExecution );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL.
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDbRecordEngineParam::ConstructL ( RReadStream& aStream )
+    {
+    InternalizeL( aStream );
+    }
+    
+// ---------------------------------------------------------------------------
+// ConstructL.
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDbRecordEngineParam::ConstructL ()
+    {
+    if ( !iExecutionUids )
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    }
+    
+  
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CDiagResultsDbRecordEngineParam::~CDiagResultsDbRecordEngineParam()
+    {
+    iExecutionUids->Close();
+    delete iExecutionUids;
+    iExecutionUids = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// C++ default constructor.
+// ---------------------------------------------------------------------------
+//    
+CDiagResultsDbRecordEngineParam::CDiagResultsDbRecordEngineParam()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Return execution uid array.
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C const RArray<TUid>& CDiagResultsDbRecordEngineParam::ExecutionsUidArray() const
+    {
+    return *iExecutionUids;
+    }
+    
+// ---------------------------------------------------------------------------
+// Return dependency execution.
+// ---------------------------------------------------------------------------
+//       
+EXPORT_C TBool CDiagResultsDbRecordEngineParam::DependencyExecution() const
+    {
+    return iDependencyExecution;
+    }
+    
+// ---------------------------------------------------------------------------
+// Externalize this object into a stream.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CDiagResultsDbRecordEngineParam::ExternalizeL(
+                                             RWriteStream& aStream ) const
+    {
+    aStream.WriteInt16L( iExecutionUids->Count() );
+    
+    for (TInt i=0; i < iExecutionUids->Count(); ++i )
+        {
+        aStream.WriteInt32L( (*iExecutionUids)[i].iUid );
+        }
+        
+    aStream.WriteUint8L ( iDependencyExecution );   
+    }
+
+
+// ---------------------------------------------------------------------------
+// Internalize the object from a stream.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CDiagResultsDbRecordEngineParam::InternalizeL( RReadStream& aStream )
+    {
+    iExecutionUids = new (ELeave) RArray<TUid>(10);
+    
+    TInt length = aStream.ReadInt16L();
+    
+    for ( TInt i=0; i < length; ++i )
+        {
+        
+        iExecutionUids->AppendL( TUid::Uid( aStream.ReadInt32L() ) );
+        }
+    
+    iDependencyExecution = aStream.ReadUint8L();     
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+CDiagResultsDbRecordEngineParam::CDiagResultsDbRecordEngineParam (
+                                RArray<TUid>*   aInitialUids,
+                                TBool           aDependencyExecution )
+    {
+    iExecutionUids = aInitialUids;
+    iDependencyExecution = aDependencyExecution;
+    }
+    
+  
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/client/src/diagresultsdbrecordinfoarraypacked.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007 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:  Class definition of 
+*
+*/
+
+
+// SYSTEM INCLUDE FILES
+#include <s32strm.h>
+#include <s32mem.h>
+
+// USER INCLUDE FILES
+#include "diagresultsdbrecordinfoarraypacked.h"
+#include "diagresultsdatabasetestrecordinfo.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TDiagResultsDbRecordInfoArrayPacked::TDiagResultsDbRecordInfoArrayPacked(
+                                         CBufFlat*& aBuffer): iBuffer(aBuffer)
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Packs the array for sending across IPC. Flat buffer is used to deliver data.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TDiagResultsDbRecordInfoArrayPacked::PackArrayL(
+        const CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray)
+    {   
+    RBufWriteStream writeStream ( *iBuffer );
+    CleanupClosePushL( writeStream );
+    writeStream.WriteInt16L( aInfoArray.Count() );
+    
+    for (TInt i=0; i < aInfoArray.Count(); ++i )
+        {
+        aInfoArray[i].ExternalizeL( writeStream );
+        }
+        
+    CleanupStack::PopAndDestroy( &writeStream );
+    }
+
+// ---------------------------------------------------------------------------
+// Unpack the array. 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void TDiagResultsDbRecordInfoArrayPacked::UnpackArrayL(
+            CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray)
+    {
+    RBufReadStream readStream ( *iBuffer );
+    CleanupClosePushL( readStream );
+    
+    //how many cells needs to be unpacked
+    TInt length = readStream.ReadInt16L();
+    
+    for ( TInt i=0; i < length; ++i )
+        {
+        TDiagResultsDatabaseTestRecordInfo info = 
+                    TDiagResultsDatabaseTestRecordInfo(); 
+        info.InternalizeL( readStream );
+        aInfoArray.AppendL( info ) ;
+        }
+    CleanupStack::PopAndDestroy( &readStream );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/common/diagresultsdatabasecommon.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2007-2007 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:  Contains common datatypes.
+*
+*/
+
+
+#ifndef DIAG_RESULTS_DATABASE_COMMON_H
+#define DIAG_RESULTS_DATABASE_COMMON_H
+
+#include <e32std.h>             // TTime
+#include <flogger.h>
+
+// CONSTANTS
+_LIT( KDiagLogFolder,  "DiagFramework" );
+_LIT( KDiagLogFile1,    "LOG1.TXT" );
+
+#define LOGME( aFormat )                                \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::Write( KDiagLogFolder(),          \
+                        KDiagLogFile1(),            \
+                        EFileLoggingModeAppend,             \
+                        KFormat() );                        \
+    }
+    
+#define LOGME1( aFormat, a )                            \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagLogFolder(),    \
+                              KDiagLogFile1(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a );                          \
+    }
+    
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+const TUint KDiagResultsDatabaseServerMajor(1);
+const TUint KDiagResultsDatabaseServerMinor(1);
+const TUint KDiagResultsDatabaseServerBuild(0);
+
+_LIT(KDiagResultsDatabaseServerName,"diagresultsdatabaseserver");
+_LIT(KDiagResultsDatabaseServerExe,"diagresultsdatabaseserver.exe");
+
+/**
+* Namespace for results database common datatypes.
+*
+* @since S60 v5.0
+*/
+namespace DiagResultsDbCommon
+    {
+
+    // Server start function
+    TInt StartServer();
+
+    // ENUMERATIONS
+    enum TServerOpCodes
+        {
+        EConnect,
+        EClose,
+        EGetRecordCount,
+        EConnectSubsession,
+        ECloseSubsession,
+        EGetLastRecord,
+        EGetLastNotCompletedRecord,
+        EGetRecordList,
+        EGetRecordInfoList,
+        EInitiateGetLastResults,
+        ECancelInitiateGetLastResults,
+        EGetLastResults,
+        EInitiateGetSingleLastResult,
+        EGetSingleLastResult,
+        
+        ESubsessionGetTestRecordId,
+        ESubsessionTestCompleted,
+        ESubsessionSuspend,
+        ESubsessionIsTestCompleted,
+        ESubsessionIsSuspended,
+        ESubsessionCreateNewRecord,
+        ESubsessionGetRecordInfo,
+        ESubsessionGetTestUids,
+        ESubsessionGetEngineParam,
+        ESubsessionLogTestResult,
+        ESubsessionCancelLogTestResult,
+        ESubsessionGetStatus,
+        ESubsessionGetTestResult,
+        ESubsessionGetTestResults,
+        ENotSupported
+        };
+        
+    // reasons for server panic
+    enum TPanics
+	    {
+	    EBadRequest,
+	    EBadDescriptor,
+	    EMainSchedulerError,
+	    ESvrCreateServer,
+	    ESvrStartServer,
+	    ESvrCreateSubsession,
+	    EServerCorruptFileDelete,
+	    EServerFileCreationError,
+	    EServerStoreRevertError,
+	    ECreateTrapCleanup,
+	    EDatabaseCompact,
+	    EDatabaseCompactCommit,
+	    EGetLastResultsMismatch,
+	    ECentralRepositoryFailure,
+	    EDoCompleteTestResultL,
+	    EDoCompleteTestRecordL,
+	    EStoreTestResultRevertLError,
+	    EStoreRecordCompleteRevertLError,
+	    EStoreNullPointer,
+	    EGetStatusPanic,
+	    EUnknownLastResultState,
+	    EIncorrectExtendNumberForLastResults,
+	    EIncorrectStreamId,
+	    EUnableToDelete,
+	    EMaximumFileSizeExceeded,
+	    EUnknownDeletionAlgorithm,
+	    ENotImplementedYet,
+	    };
+
+    }
+	
+#endif //DIAG_RESULTS_DATABASE_COMMON_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/common/diagresultsdbprivatecrkeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2007 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:  Private Central Repository keys.
+*
+*/
+
+
+#ifndef DIAGRESULTSDBPRIVATECRKEYS_H
+#define DIAGRESULTSDBPRIVATECRKEYS_H
+
+//  INCLUDES
+
+#include <e32std.h>
+
+// =============================================================================
+// Diagnostics Results DB
+// =============================================================================
+
+const TUid KCRUidDiagnosticsResults = { 0x2000B45D };
+
+/**
+* The maximum number of test records inside each DB file. 
+**/
+const TUint32 KDiagDatabaseMaxRecordCount = 0x00000001;
+
+/**
+* The maximum file size for DB file in bytes. 
+**/
+const TUint32 KDiagDatabaseMaxFileSize = 0x00000002;
+
+/**
+* The value indicates which deletion algorithm the DB uses. The First alternative 
+* deletes test records when max record count is exceeded (0). The other uses a buffer 
+* to store last results (1) and keeps the max record count.
+**/
+const TUint32 KDiagDatabaseDeletionAlgorithm = 0x00000003;
+
+
+#endif      // DIAGRESULTSDBPRIVATECRKEYS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/cenrep_files/clean_cenrep.bat	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,17 @@
+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 "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+rd /s /q output
Binary file devicediagnosticsfw/diagresultsdb/server/cenrep_files/keys_diagresultsdb.xls has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/cenrep_files/make_cenrep.bat	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,34 @@
+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 "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+@set XLS_FILE=keys_diagresultsdb.xls
+@set INI_FILE=2000B45D.txt
+@set RELEASE=3.2
+
+@set CENREP_DIR=%CD%
+@cd \epoc32\tools\cenrep
+
+cenrep.pl -o "%CENREP_DIR%\output" -l "%CENREP_DIR%\%XLS_FILE%" -p %RELEASE%
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\winscw\udeb\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\winscw\udeb\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\winscw\urel\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\armv5\udeb\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\RELEASE\armv5\urel\Z\private\10202be9\
+copy "%CENREP_DIR%\output\inifiles\%INI_FILE%" \epoc32\data\Z\private\10202be9\
+@cd "%CENREP_DIR%"
+
+@echo ================= done. Hit any key to continue ==================
+@pause
Binary file devicediagnosticsfw/diagresultsdb/server/cenrep_files/output/inifiles/2000B45D.txt has changed
Binary file devicediagnosticsfw/diagresultsdb/server/cenrep_files/output/key_sheets_info.storable has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/cenrep_files/output/rfs/cenrep_rfs.txt	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1 @@
+ÿþ
\ No newline at end of file
Binary file devicediagnosticsfw/diagresultsdb/server/conf/diagresultsdb.confml has changed
Binary file devicediagnosticsfw/diagresultsdb/server/conf/diagresultsdb_2000B45d.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for Diagnostics Results Database
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// Generic configuration interface for component cenrep settings  
+../conf/diagresultsdb.confml                    MW_LAYER_CONFML(diagresultsdb.confml)
+../conf/diagresultsdb_2000B45d.crml	        MW_LAYER_CRML(diagresultsdb_2000B45D.crml)
+
+PRJ_MMPFILES
+diagresultsdbserver.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/group/diagresultsdbserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification for diagresultsdatabaseserver.exe
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET        diagresultsdatabaseserver.exe
+TARGETTYPE    exe
+
+UID	          0x1000008d 0x10282CD9
+VENDORID      VID_DEFAULT
+
+CAPABILITY    CAP_SERVER
+
+SOURCEPATH    ../src
+SOURCE        diagresultsdbserver.cpp
+SOURCE        diagresultsdbsession.cpp
+SOURCE        diagresultsdbtestrecordsubsession.cpp
+SOURCE        diagresultsdbstore.cpp
+SOURCE        diagresultsdbtestrecord.cpp
+SOURCE        diagresultsdbtestrecordhandle.cpp
+
+SOURCEPATH    ../../client/src
+SOURCE        diagresultsdatabasetestrecordInfo.cpp
+
+USERINCLUDE   .
+USERINCLUDE   ../inc
+USERINCLUDE   ../../common
+USERINCLUDE   ../../client/inc
+
+// MW Common System Include. 
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       euser.lib
+LIBRARY       efsrv.lib
+LIBRARY       estor.lib
+LIBRARY       flogger.lib
+LIBRARY       diagresultsdatabase.lib //common items 
+LIBRARY       drmserviceapi.lib
+LIBRARY       sysutil.lib centralrepository.lib
+
+EPOCSTACKSIZE 0x4000
+//EPOCHEAPSIZE 0x1000 0x400000
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/group/diagresultsdbserver.xml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,2075 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!DOCTYPE PROJECT [
+ <!ELEMENT PROJECT (TARGETLIST, TARGETORDER, GROUPLIST, DESIGNLIST?)>
+ <!ELEMENT TARGETLIST (TARGET+)>
+ <!ELEMENT TARGET (NAME, SETTINGLIST, FILELIST?, LINKORDER?, SEGMENTLIST?, OVERLAYGROUPLIST?, SUBTARGETLIST?, SUBPROJECTLIST?, FRAMEWORKLIST?, PACKAGEACTIONSLIST?)>
+ <!ELEMENT NAME (#PCDATA)>
+ <!ELEMENT USERSOURCETREETYPE (#PCDATA)>
+ <!ELEMENT PATH (#PCDATA)>
+ <!ELEMENT FILELIST (FILE*)>
+ <!ELEMENT FILE (PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?, ROOTFILEREF?, FILEKIND?, FILEFLAGS?)>
+ <!ELEMENT PATHTYPE (#PCDATA)>
+ <!ELEMENT PATHROOT (#PCDATA)>
+ <!ELEMENT ACCESSPATH (#PCDATA)>
+ <!ELEMENT PATHFORMAT (#PCDATA)>
+ <!ELEMENT ROOTFILEREF (PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?)>
+ <!ELEMENT FILEKIND (#PCDATA)>
+ <!ELEMENT FILEFLAGS (#PCDATA)>
+ <!ELEMENT FILEREF (TARGETNAME?, PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?)>
+ <!ELEMENT TARGETNAME (#PCDATA)>
+ <!ELEMENT SETTINGLIST ((SETTING|PANELDATA)+)>
+ <!ELEMENT SETTING (NAME?, (VALUE|(SETTING+)))>
+ <!ELEMENT PANELDATA (NAME, VALUE)>
+ <!ELEMENT VALUE (#PCDATA)>
+ <!ELEMENT LINKORDER (FILEREF*)>
+ <!ELEMENT SEGMENTLIST (SEGMENT+)>
+ <!ELEMENT SEGMENT (NAME, ATTRIBUTES?, FILEREF*)>
+ <!ELEMENT ATTRIBUTES (#PCDATA)>
+ <!ELEMENT OVERLAYGROUPLIST (OVERLAYGROUP+)>
+ <!ELEMENT OVERLAYGROUP (NAME, BASEADDRESS, OVERLAY*)>
+ <!ELEMENT BASEADDRESS (#PCDATA)>
+ <!ELEMENT OVERLAY (NAME, FILEREF*)>
+ <!ELEMENT SUBTARGETLIST (SUBTARGET+)>
+ <!ELEMENT SUBTARGET (TARGETNAME, ATTRIBUTES?, FILEREF?)>
+ <!ELEMENT SUBPROJECTLIST (SUBPROJECT+)>
+ <!ELEMENT SUBPROJECT (FILEREF, SUBPROJECTTARGETLIST)>
+ <!ELEMENT SUBPROJECTTARGETLIST (SUBPROJECTTARGET*)>
+ <!ELEMENT SUBPROJECTTARGET (TARGETNAME, ATTRIBUTES?, FILEREF?)>
+ <!ELEMENT FRAMEWORKLIST (FRAMEWORK+)>
+ <!ELEMENT FRAMEWORK (FILEREF, DYNAMICLIBRARY?, VERSION?)>
+ <!ELEMENT PACKAGEACTIONSLIST (PACKAGEACTION+)>
+ <!ELEMENT PACKAGEACTION (#PCDATA)>
+ <!ELEMENT LIBRARYFILE (FILEREF)>
+ <!ELEMENT VERSION (#PCDATA)>
+ <!ELEMENT TARGETORDER (ORDEREDTARGET|ORDEREDDESIGN)*>
+ <!ELEMENT ORDEREDTARGET (NAME)>
+ <!ELEMENT ORDEREDDESIGN (NAME, ORDEREDTARGET+)>
+ <!ELEMENT GROUPLIST (GROUP|FILEREF)*>
+ <!ELEMENT GROUP (NAME, (GROUP|FILEREF)*)>
+ <!ELEMENT DESIGNLIST (DESIGN+)>
+ <!ELEMENT DESIGN (NAME, DESIGNDATA)>
+ <!ELEMENT DESIGNDATA (#PCDATA)>
+]>
+<?codewarrior exportversion="1.0.1" ideversion="5.0" ?>
+<PROJECT>
+    <TARGETLIST>
+        <TARGET>
+            <NAME>WINSCW UDEB</NAME>
+            <SETTINGLIST>
+
+                <!-- Settings for "Source Trees" panel -->
+                <SETTING><NAME>UserSourceTrees</NAME></SETTING>
+
+                <!-- Settings for "Access Paths" panel -->
+                <SETTING><NAME>AlwaysSearchUserPaths</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>InterpretDOSAndUnixPaths</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RequireFrameworkStyleIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SourceRelativeIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UserSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\inc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\common</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\Inc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\Src</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\src</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+                <SETTING><NAME>SystemSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\oem</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\UDEB</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Win32-x86 Support\Libraries\Win32 SDK</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+
+                <!-- Settings for "Debugger Runtime" panel -->
+                <SETTING><NAME>MWRuntimeSettings_WorkingDirectory</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_CommandLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_HostApplication</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb\diagresultsdatabaseserver.exe</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>MWRuntimeSettings_EnvVars</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Target Settings" panel -->
+                <SETTING><NAME>Linker</NAME><VALUE>Symbian Linker v2</VALUE></SETTING>
+                <SETTING><NAME>PreLinker</NAME><VALUE/></SETTING>
+                <SETTING><NAME>PostLinker</NAME><VALUE>Symbian Installer v2</VALUE></SETTING>
+                <SETTING><NAME>Targetname</NAME><VALUE>WINSCW UDEB</VALUE></SETTING>
+                <SETTING><NAME>OutputDirectory</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SaveEntriesUsingRelativePaths</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "File Mappings" panel -->
+                <SETTING><NAME>FileMappings</NAME>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.c</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cfg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cia</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cpp</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cwlink</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cxx</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.def</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.h</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.hrh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.iby</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inf</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ini</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inl</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.loc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.mmpi</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pch++</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pkg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.policy</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ra</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.resources</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Resource v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rls</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rss</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rsg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.s</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.script</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.txt</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.a</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.lib</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.dso</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.o</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                </SETTING>
+
+                <!-- Settings for "Build Extras" panel -->
+                <SETTING><NAME>CacheModDates</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>DumpBrowserInfo</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSubprojects</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>UseThirdPartyDebugger</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>BrowserGenerator</NAME><VALUE>2</VALUE></SETTING>
+                <SETTING><NAME>DebuggerAppPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DebuggerCmdLineArgs</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DebuggerWorkingDir</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CodeCompletionPrefixFileName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CodeCompletionMacroFileName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Debugger Target" panel -->
+                <SETTING><NAME>ConsoleEncoding</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>LogSystemMessages</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>AutoTargetDLLsPopUp</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>StopAtWatchpoints</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>PauseWhileRunning</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>PauseInterval</NAME><VALUE>5</VALUE></SETTING>
+                <SETTING><NAME>PauseUIFlags</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>AltExePath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>StopAtTempBPOnLaunch</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSymbolics</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>TempBPFunctionName</NAME><VALUE>E32Main</VALUE></SETTING>
+                <SETTING><NAME>TempBPType</NAME><VALUE>1</VALUE></SETTING>
+
+                <!-- Settings for "Remote Debug" panel -->
+                <SETTING><NAME>Enabled</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>ConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>LaunchRemoteApp</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RemoteAppPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CoreID</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>JTAGClockSpeed</NAME><VALUE>8000</VALUE></SETTING>
+                <SETTING><NAME>IsMultiCore</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UseGlobalOSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownloadConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>OSDownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>AltDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>AltDownloadConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "x86 Exceptions" panel -->
+                <SETTING><NAME>MWDebugger_X86_Exceptions</NAME>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                
+                <!-- Settings for "Auto-target" panel -->
+                <SETTING><NAME>OtherExecutables</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Analyzer Connections" panel -->
+                <SETTING><NAME>AnalyzerConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Custom Keywords" panel -->
+                <SETTING><NAME>CustomColor1</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor2</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor3</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor4</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>BraekPoinType_II</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>SDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>VerifyMemWrites</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ShowMPC107regs</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>BreakpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>WatchpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ByteOrderType</NAME><VALUE>0</VALUE></SETTING>
+                <PANELDATA><NAME>CodeTest SYMBIAN Instrumenter</NAME><VALUE>
+                    0200020000000100000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000433A5C0000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000637466696C657300000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000636F6465746573742E6964620000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000
+                </VALUE></PANELDATA>
+
+                <!-- Settings for "Symbian Installation" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Installer Panel v2" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Resource Panel" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Resources Panel v2" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\udeb</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Remote Download" panel -->
+                <SETTING><NAME>FileList</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ResetTarget</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Common Panel" panel -->
+                <SETTING><NAME>ShowCommandLine</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SymbianEpocToolsPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Compiler Panel" panel -->
+                <SETTING><NAME>PrefixFile</NAME><VALUE>feature_settings.hrh</VALUE></SETTING>
+                <SETTING><NAME>CompilerXMLDescriptor</NAME><VALUE>Metrowerks x86 Compiler</VALUE></SETTING>
+                <SETTING><NAME>Macros</NAME><VALUE>__SYMBIAN32__,__CW32__,__WINS__,__WINSCW__,__EXE__,_DEBUG,_UNICODE,__SUPPORT_CPP_EXCEPTIONS__,</VALUE></SETTING>
+                <SETTING><NAME>CodeTEST</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>EnableSWIC</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Arguments</NAME><VALUE>-wchar_t off -align 4 -warnings on -w nohidevirtual, nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -O0 -inline off -nostdinc</VALUE></SETTING>
+                <SETTING><NAME>CIAArgs</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Debugging" panel -->
+                <SETTING><NAME>Parse Log File</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log File Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Symbian SDK Folder</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Log Unresolved Modules</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log Unresolved Sym Files</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Non-XIP Executables</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Kernel Debugging" panel -->
+                <SETTING><NAME>Start Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Run From Start Address</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Download Image</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OS Image Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Download Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Ask First</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Bootrom</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Bootrom Sym File</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Linker Panel" panel -->
+                <SETTING><NAME>LinkOutputFile</NAME><VALUE>diagresultsdatabaseserver.exe</VALUE></SETTING>
+                <SETTING><NAME>LinkCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibrary</NAME><VALUE>diagresultsdatabaseserver.lib</VALUE></SETTING>
+                <SETTING><NAME>canDebug</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>canRun</NAME><VALUE>true</VALUE></SETTING>
+
+                <!-- Settings for "Symbian RomBuild Panel" panel -->
+                <SETTING><NAME>CommandLine</NAME><VALUE>buildrom -D_DEBUG devkit lubbock techview -olubbock_gui.img</VALUE></SETTING>
+                <SETTING><NAME>OutputPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DisplayMessages</NAME><VALUE>true</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Target" panel -->
+                <SETTING><NAME>TargetArchitecture</NAME><VALUE>WINSCW</VALUE></SETTING>
+                <SETTING><NAME>LogMessages</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SuppressWarnings</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>GenerateSymbolics</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CompilerPrefix</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CompilerCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibraryPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Tools" panel -->
+                <SETTING><NAME>Gnu Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Epoc32 Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+            </SETTINGLIST>
+            <FILELIST>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>EEXE.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserver_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>efsrv.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>sysutil.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND><FILEFLAGS>Debug</FILEFLAGS></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseCommon.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbCRDC.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbPrivateCRKeys.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.h</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserverWINSCWUDEB.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+</FILELIST>
+            <LINKORDER>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>EEXE.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserver_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>efsrv.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>sysutil.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseCommon.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbCRDC.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbPrivateCRKeys.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserverWINSCWUDEB.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</LINKORDER>
+        </TARGET><TARGET>
+            <NAME>WINSCW UREL</NAME>
+            <SETTINGLIST>
+
+                <!-- Settings for "Source Trees" panel -->
+                <SETTING><NAME>UserSourceTrees</NAME></SETTING>
+
+                <!-- Settings for "Access Paths" panel -->
+                <SETTING><NAME>AlwaysSearchUserPaths</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>InterpretDOSAndUnixPaths</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RequireFrameworkStyleIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SourceRelativeIncludes</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UserSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\inc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\common</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\Inc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Client\Src</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\src</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+                <SETTING><NAME>SystemSearchPaths</NAME>
+                    <SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\oem</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\osextensions\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\include\domain\middleware\loc\sc</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\UREL</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>epoc32\release\WINSCW\UDEB</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Win32-x86 Support\Libraries\Win32 SDK</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING><SETTING>
+<SETTING><NAME>SearchPath</NAME>
+<SETTING><NAME>Path</NAME><VALUE>Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
+</SETTING><SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
+<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
+</SETTING></SETTING>
+
+                <!-- Settings for "Debugger Runtime" panel -->
+                <SETTING><NAME>MWRuntimeSettings_WorkingDirectory</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_CommandLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>MWRuntimeSettings_HostApplication</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel\diagresultsdatabaseserver.exe</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>MWRuntimeSettings_EnvVars</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Target Settings" panel -->
+                <SETTING><NAME>Linker</NAME><VALUE>Symbian Linker v2</VALUE></SETTING>
+                <SETTING><NAME>PreLinker</NAME><VALUE/></SETTING>
+                <SETTING><NAME>PostLinker</NAME><VALUE>Symbian Installer v2</VALUE></SETTING>
+                <SETTING><NAME>Targetname</NAME><VALUE>WINSCW UREL</VALUE></SETTING>
+                <SETTING><NAME>OutputDirectory</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SaveEntriesUsingRelativePaths</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "File Mappings" panel -->
+                <SETTING><NAME>FileMappings</NAME>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>._ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.c</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cfg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cia</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cpp</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cwlink</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.cxx</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.def</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.h</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.hrh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.i</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.iby</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ii</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inf</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ini</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.inl</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.loc</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.mmpi</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pch++</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.pkg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.policy</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.ra</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.resources</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Resource v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>XML</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rh</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rls</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rss</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.rsg</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.s</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Compiler v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.script</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.txt</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.a</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.lib</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.dso</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                    <SETTING>
+                        <SETTING><NAME>FileExtension</NAME><VALUE>.o</VALUE></SETTING>
+                        <SETTING><NAME>Compiler</NAME><VALUE>Symbian Object Importer v2</VALUE></SETTING>
+                        <SETTING><NAME>EditLanguage</NAME><VALUE/></SETTING>
+                        <SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
+                        <SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
+                    </SETTING>
+                </SETTING>
+
+                <!-- Settings for "Build Extras" panel -->
+                <SETTING><NAME>CacheModDates</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>DumpBrowserInfo</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSubprojects</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>UseThirdPartyDebugger</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>BrowserGenerator</NAME><VALUE>2</VALUE></SETTING>
+                <SETTING><NAME>DebuggerAppPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DebuggerCmdLineArgs</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DebuggerWorkingDir</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CodeCompletionPrefixFileName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CodeCompletionMacroFileName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Debugger Target" panel -->
+                <SETTING><NAME>ConsoleEncoding</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>LogSystemMessages</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>AutoTargetDLLsPopUp</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>StopAtWatchpoints</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>PauseWhileRunning</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>PauseInterval</NAME><VALUE>5</VALUE></SETTING>
+                <SETTING><NAME>PauseUIFlags</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>AltExePath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>StopAtTempBPOnLaunch</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CacheSymbolics</NAME><VALUE>true</VALUE></SETTING>
+                <SETTING><NAME>TempBPFunctionName</NAME><VALUE>E32Main</VALUE></SETTING>
+                <SETTING><NAME>TempBPType</NAME><VALUE>1</VALUE></SETTING>
+
+                <!-- Settings for "Remote Debug" panel -->
+                <SETTING><NAME>Enabled</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>ConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>DownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>LaunchRemoteApp</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>RemoteAppPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CoreID</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>JTAGClockSpeed</NAME><VALUE>8000</VALUE></SETTING>
+                <SETTING><NAME>IsMultiCore</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>UseGlobalOSDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OSDownloadConnectionName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>OSDownloadPath</NAME><VALUE/></SETTING>
+                <SETTING><NAME>AltDownload</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>AltDownloadConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "x86 Exceptions" panel -->
+                <SETTING><NAME>MWDebugger_X86_Exceptions</NAME>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                    <SETTING><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                
+                <!-- Settings for "Auto-target" panel -->
+                <SETTING><NAME>OtherExecutables</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Analyzer Connections" panel -->
+                <SETTING><NAME>AnalyzerConnectionName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Custom Keywords" panel -->
+                <SETTING><NAME>CustomColor1</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor2</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor3</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>CustomColor4</NAME>
+                    <SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
+                    <SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
+                    <SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>BraekPoinType_II</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>IDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>IDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDexecutable</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDinitialized</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>SDuninitialized</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>SDconstant</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>VerifyMemWrites</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ShowMPC107regs</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME><VALUE/></SETTING>
+                <SETTING><NAME>BreakpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>WatchpointType</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+                <SETTING><NAME>ByteOrderType</NAME><VALUE>0</VALUE></SETTING>
+                <PANELDATA><NAME>CodeTest SYMBIAN Instrumenter</NAME><VALUE>
+                    0200020000000100000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000433A5C0000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000637466696C657300000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000636F6465746573742E6964620000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    0000000000000000000000000000000000000000000000000000000000000000
+                    000000000000000000000000
+                </VALUE></PANELDATA>
+
+                <!-- Settings for "Symbian Installation" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Installer Panel v2" panel -->
+                <SETTING><NAME>SymbianInstallationOutputFilename</NAME><VALUE>Application.sis</VALUE></SETTING>
+                <SETTING><NAME>SymbianInstallationOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>SymbianInstallationContentSearchLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianInstallationPassword</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianInstallationCreateStubFile</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Resource Panel" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Resources Panel v2" panel -->
+                <SETTING><NAME>SymbianResourcesMMPFileLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>s60\mw\devicecontentservices\devicediagnostics\diagnosticsfw\diagresultsdb\Server\group</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesBinaryOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\release\winscw\urel</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+                <SETTING><NAME>SymbianResourcesHeaderFileOutputLocation</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>epoc32\include</VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Remote Download" panel -->
+                <SETTING><NAME>FileList</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian ARM Debugger" panel -->
+                <SETTING><NAME>Processor</NAME><VALUE>Generic</VALUE></SETTING>
+                <SETTING><NAME>UseInitFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>UseConfigFile</NAME><VALUE>0</VALUE></SETTING>
+                <SETTING><NAME>ResetTarget</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>InitializationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>ConfigurationFile</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>TargetOS</NAME><VALUE>1</VALUE></SETTING>
+                <SETTING><NAME>RTOSPluginName</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Common Panel" panel -->
+                <SETTING><NAME>ShowCommandLine</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SymbianEpocToolsPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
+<SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+<SETTING><NAME>PathRoot</NAME><VALUE>2 SDKTube</VALUE></SETTING>
+</SETTING>
+
+                <!-- Settings for "Symbian Compiler Panel" panel -->
+                <SETTING><NAME>PrefixFile</NAME><VALUE>feature_settings.hrh</VALUE></SETTING>
+                <SETTING><NAME>CompilerXMLDescriptor</NAME><VALUE>Metrowerks x86 Compiler</VALUE></SETTING>
+                <SETTING><NAME>Macros</NAME><VALUE>__SYMBIAN32__,__CW32__,__WINS__,__WINSCW__,__EXE__,NDEBUG,_UNICODE,__SUPPORT_CPP_EXCEPTIONS__,</VALUE></SETTING>
+                <SETTING><NAME>CodeTEST</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>EnableSWIC</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Arguments</NAME><VALUE>-wchar_t off -align 4 -warnings on -w nohidevirtual, nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -O4,s -nostdinc</VALUE></SETTING>
+                <SETTING><NAME>CIAArgs</NAME><VALUE/></SETTING>
+
+                <!-- Settings for "Symbian Debugging" panel -->
+                <SETTING><NAME>Parse Log File</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log File Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Symbian SDK Folder</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Log Unresolved Modules</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Log Unresolved Sym Files</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Non-XIP Executables</NAME><VALUE>false</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Kernel Debugging" panel -->
+                <SETTING><NAME>Start Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Run From Start Address</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Download Image</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>OS Image Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Download Address</NAME><VALUE>0x00000000</VALUE></SETTING>
+                <SETTING><NAME>Ask First</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Debug Bootrom</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>Bootrom Sym File</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE/></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Linker Panel" panel -->
+                <SETTING><NAME>LinkOutputFile</NAME><VALUE>diagresultsdatabaseserver.exe</VALUE></SETTING>
+                <SETTING><NAME>LinkCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibrary</NAME><VALUE>diagresultsdatabaseserver.lib</VALUE></SETTING>
+                <SETTING><NAME>canDebug</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>canRun</NAME><VALUE>true</VALUE></SETTING>
+
+                <!-- Settings for "Symbian RomBuild Panel" panel -->
+                <SETTING><NAME>CommandLine</NAME><VALUE>buildrom -D_DEBUG devkit lubbock techview -olubbock_gui.img</VALUE></SETTING>
+                <SETTING><NAME>OutputPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>DisplayMessages</NAME><VALUE>true</VALUE></SETTING>
+
+                <!-- Settings for "Symbian Target" panel -->
+                <SETTING><NAME>TargetArchitecture</NAME><VALUE>WINSCW</VALUE></SETTING>
+                <SETTING><NAME>LogMessages</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>SuppressWarnings</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>GenerateSymbolics</NAME><VALUE>false</VALUE></SETTING>
+                <SETTING><NAME>CompilerPrefix</NAME><VALUE/></SETTING>
+                <SETTING><NAME>CompilerCmdLine</NAME><VALUE/></SETTING>
+                <SETTING><NAME>SymbianImportLibraryPath</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+
+                <!-- Settings for "Symbian Tools" panel -->
+                <SETTING><NAME>Gnu Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+                <SETTING><NAME>Epoc32 Tools Path</NAME>
+                    <SETTING><NAME>Path</NAME><VALUE>C:\</VALUE></SETTING>
+                    <SETTING><NAME>PathFormat</NAME><VALUE>Windows</VALUE></SETTING>
+                    <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
+                </SETTING>
+            </SETTINGLIST>
+            <FILELIST>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>EEXE.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserver_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>efsrv.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>sysutil.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Library</FILEKIND></FILE>
+<FILE><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserverWINSCWUREL.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT><FILEKIND>Text</FILEKIND></FILE>
+</FILELIST>
+            <LINKORDER>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>EEXE.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserver_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>efsrv.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>sysutil.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserverWINSCWUREL.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</LINKORDER>
+        </TARGET><TARGET>
+<NAME>Build All</NAME><SETTINGLIST><SETTING><NAME>Linker</NAME><VALUE>None</VALUE></SETTING>
+<SETTING><NAME>Targetname</NAME><VALUE>Build All</VALUE></SETTING>
+</SETTINGLIST>
+<FILELIST></FILELIST>
+<LINKORDER></LINKORDER>
+<SUBTARGETLIST><SUBTARGET><TARGETNAME>WINSCW UDEB</TARGETNAME></SUBTARGET>
+<SUBTARGET><TARGETNAME>WINSCW UREL</TARGETNAME></SUBTARGET>
+</SUBTARGETLIST></TARGET></TARGETLIST>
+
+    <TARGETORDER>
+<ORDEREDTARGET><NAME>WINSCW UDEB</NAME></ORDEREDTARGET>
+<ORDEREDTARGET><NAME>WINSCW UREL</NAME></ORDEREDTARGET>
+<ORDEREDTARGET><NAME>Build All</NAME></ORDEREDTARGET>
+</TARGETORDER>
+
+    <GROUPLIST><FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.mmp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<GROUP><NAME>Source</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserver_UID_.cpp</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+<GROUP><NAME>Headers</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseCommon.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseItem.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabaseTestRecordInfo.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbCRDC.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbPrivateCRKeys.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordEngineParam.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbRecordInfoArrayPacked.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbServer.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbSession.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbStore.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecord.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordHandle.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDbTestRecordSubsession.h</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+<GROUP><NAME>Link</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserverWINSCWUDEB.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UREL</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>diagresultsdatabaseserverWINSCWUREL.cwlink</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+<GROUP><NAME>Libraries</NAME>
+<GROUP><NAME>WINSCW</NAME>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>EEXE.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>euser.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>efsrv.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>estor.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>flogger.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>DiagResultsDatabase.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>drmserviceapi.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>sysutil.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UDEB</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>centralrepository.lib</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+<FILEREF><TARGETNAME>WINSCW UREL</TARGETNAME><PATHTYPE>Name</PATHTYPE><PATH>EEXE.LIB</PATH><PATHFORMAT>Windows</PATHFORMAT></FILEREF>
+</GROUP>
+</GROUP>
+</GROUPLIST>
+
+</PROJECT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbcrdc.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007-2007 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:  Real cleanup stack for RPointerArrays.
+*                ResetAndDestroy + Close must be called, instead of just Close.
+*  libraries   : 
+*
+*/
+
+
+/**
+* Template class for destroying RPointerArrays
+*
+* @since S60 v5.0
+**/
+template <class T>
+class CleanupResetAndDestroyClose
+    {
+public:
+    inline static void PushL(T& aRef)
+        { 
+        CleanupStack::PushL(TCleanupItem(&Close,&aRef)); 
+        }
+
+    static void Close(TAny *aPtr) 
+        {
+        (STATIC_CAST(T*,aPtr))->ResetAndDestroy();
+        (STATIC_CAST(T*,aPtr))->Close();
+        }
+    };
+    
+/**
+* Use for pushing RPointerArrays onto a cleanupstack.
+*
+* @since S60 v5.0
+**/    
+template <class T>
+inline void CleanupResetAndDestroyClosePushL(T& aRef)
+    {
+    CleanupResetAndDestroyClose<T>::PushL(aRef);
+    }    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2007-2007 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:  Symbian OS server results database.
+*  libraries   : 
+*
+*/
+
+
+#ifndef DIAG_RESULTS_DB_SERVER_H
+#define DIAG_RESULTS_DB_SERVER_H
+
+#include "diagresultsdatabasecommon.h"
+
+//System includes
+#include <e32base.h>
+#include <f32file.h>
+
+/**
+* Results database symbian OS server class. Creates server sessions and keeps
+* track of the session counts.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbServer : public CPolicyServer
+	{
+public:
+
+    /**
+    * Destructor
+    **/ 
+	~CDiagResultsDbServer();
+	
+	/**
+	* NewLC. 
+	* @param aPolicy Security policy that is defined at the end of this file.
+	**/
+	static void NewLC(const TPolicy &aPolicy);
+	
+	/**
+	* Create a new server session.
+	* @param aVersion version of the server.
+	* @param aMessage
+	* @return a new session.
+	**/
+	virtual CSession2 *NewSessionL(const TVersion &aVersion, const RMessage2 &/*aMessage*/) const;
+	
+	/**
+	* Run server i.e. first create cleanup stack and active scheduler. This server is CActive based.
+	* @return Symbian error code or KErrNone.
+	**/
+	static TInt RunServer();
+	static void RunServerL();
+	
+public: // New methods
+
+    /**
+    * Create object container that is needed when handling subsession.
+    * @return object container.
+    **/
+	CObjectCon* NewContainerL();
+	
+	/**
+	* Remove object container from container index.
+	* @param aCon container to be removed.
+	**/
+	void RemoveContainer(CObjectCon* aCon);
+	
+    /**
+	* Decrease session count by one. ServerSession uses this function when client dies.
+	**/
+	void DecreaseSessionCount();
+	
+	/**
+	* Increase session count by one. ServerSession uses this function when client dies.
+	**/
+	void IncreaseSessionCount();
+	
+	/**
+	* Returns the number of active sessions.
+	* @return Session count.
+	**/
+	TInt SessionCount();
+	
+	/**
+	* Custom security check. From CPolicyServer.
+	**/
+	TCustomResult CustomSecurityCheckL(const RMessage2 &aMsg, TInt &aAction, TSecurityInfo &aMissing);
+	
+protected:
+    /**
+    * Constructor.
+    * @param aPriority Priority of this server. Should be pretty high.
+    * @param aPolicy Security policy of this server.
+    **/
+	CDiagResultsDbServer(TInt aPriority, const TPolicy &aPolicy);
+
+private:
+
+    /**
+    * ConstructL.
+    **/
+	void ConstructL();
+	
+private: // Data
+
+    // For creating object container instances
+	CObjectConIx* iContainerIndex;  
+	
+	// The number of active sessions 
+	TInt iSessionCount;
+	};
+
+// Security policy definition.
+// ReadDeviceData + WriteDeviceData is needed.
+const CPolicyServer::TPolicyElement elements[] = 
+	{
+		{_INIT_SECURITY_POLICY_C2(ECapabilityReadDeviceData, ECapabilityWriteDeviceData),
+			 CPolicyServer::EFailClient},
+	};
+
+const TInt ranges[2] = 
+		{
+		0,
+		DiagResultsDbCommon::ENotSupported,
+		
+		};
+
+const TUint8 elementsIndex[2] = 
+		{
+		CPolicyServer::ECustomCheck, //ReadDeviceData + WriteDeviceData for all clients.
+        CPolicyServer::ENotSupported,
+		};
+
+const CPolicyServer::TPolicy policy = 
+	{
+	CPolicyServer::EAlwaysPass,	// on connect
+	2,		// range count
+	ranges, 
+  	elementsIndex,
+	elements,
+  	};    
+    
+#endif //DIAG_RESULTS_DB_SERVER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbsession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2007-2007 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:  Symbian OS server session.
+*  libraries   : 
+*
+*/
+
+
+#ifndef DIAGRESULTSDBSESSION_H
+#define DIAGRESULTSDBSESSION_H
+
+class CDiagResultsDbServer;
+class CDiagResultsDbTestRecord;
+
+#include "diagresultsdbstore.h"
+
+//System includes
+#include <e32cmn.h> //TUid
+#include <e32base.h>
+
+/**
+* Server session. Represents a session (version 2) 
+* for a client thread on the server-side.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbSession : 
+                        public CSession2, 
+                        public MRecordLoadingObserver
+	{
+public:
+
+    /**
+    * Destructor.
+    **/
+	~CDiagResultsDbSession();
+		
+	/**
+	* NewL. 
+	*
+	* @param aServer Server object.
+	* @return DB session.
+	**/	
+	static CDiagResultsDbSession* NewL(CDiagResultsDbServer * aServer);
+	
+public: // From CSession
+    
+    /**
+    * Handles the servicing of a client request that has been 
+    * passed to the server.
+    *
+    * @param aMessage The message containing the details of the client request.
+    **/
+	void ServiceL(const RMessage2 &aMessage);
+
+public: // New methods
+
+    /**
+    * Handle the client message.
+    *
+    * @param aMessage Details of the client request.
+    * @return ETrue if client request is asynchronous, EFalse is synchronous.
+    **/
+	TBool DispatchMessageL(const RMessage2 &aMessage);
+	
+	/**
+	* Create a new subsession.
+	*
+	* @param aTestRecord Test record that represents the subsession.
+	**/
+	void CreateSubsessionL(CDiagResultsDbTestRecordHandle* aTestRecordHandle,
+	                       TBool aReadonly );
+	
+	/**
+	* Close the subsession.
+	**/
+	void CloseSubsessionL();
+   
+    /**
+    * Returns the Uid of the results database file.
+    *
+    * @return TUid of the database file.
+    **/
+    TUid DbUid() const;
+    
+    /**
+    * Returns the results store.
+    *
+    * @return Results store.
+    **/
+    CDiagResultsDbStore& Store();
+    
+    /**
+    * Helper function to read buffer from client side.
+    *
+    * @param aMessage Details of the client request.
+    * @param aParam Message argument number.
+    * @param aBuffer Buffer that is filled with client side data.
+    **/
+    void ReadBufferL(const RMessage2& aMessage, TInt aParam, 
+                     CBufFlat*& aBuffer);
+    
+    /**
+    * Subsession must tell to the session has it written data.
+    **/
+    void HasWritten();
+            
+    /**
+    * Indicates has the session wrote any data.
+    * @return ETrue if session has wrote data, EFalse otherwise.
+    **/
+    TBool SessionHasWritten() const;    
+    
+    /**
+    * Turn off compacting. For example KErrDiskFull causes compacting to fail.
+    **/
+    void DoNotCompact();   
+    
+    
+public: //From MRecordLoadingObserver
+    
+    /**
+    * Returns an array of test records. Contains all test records 
+    * from a single database file.
+    *
+    * @param aError Indicates if there were any errors.
+    * @param aArray An array of test records. Ownership is transferred.
+    **/
+    void ExistingRecordsL( TInt aError, 
+                           RPointerArray<CDiagResultsDbTestRecord>* aArray );
+    
+protected: // service functions for client requests    
+           // Look at DiagResultsDatabaseCommon.h for the client requests.
+
+    void ConnectSubsessionL( const RMessage2 &aMessage );
+     
+    void CreateNewRecordL ( const RMessage2 &aMessage );
+    
+    void GetLastRecordL( const RMessage2 &aMessage );
+    
+    void GetLastNotCompletedRecordL( const RMessage2 &aMessage );
+    
+    void GetRecordListL( const RMessage2 &aMessage );
+    
+    void GetRecordInfoListL( const RMessage2 &aMessage );
+    
+    void GetLastResultsL( const RMessage2 &aMessage );
+    
+    void CancelLastResultsL(const RMessage2 &aMessage);
+    
+    void GetSingleLastResultL( const RMessage2 &aMessage );
+    
+private:
+
+    /**
+	* Constructor.
+	*
+	* @param aServer Server object.
+	**/
+	CDiagResultsDbSession(CDiagResultsDbServer * aServer);
+
+    /**
+    * ConstructL.
+    **/
+	void ConstructL();
+	
+	/**
+	* Find database item from the array based on uid.
+	*
+	* @param aUid Uid of the database item.
+	* @param aArray Pointer array that contains test records.
+	* @return Database item or NULL if not found.
+	**/
+	CDiagResultsDatabaseItem* FindDatabaseItemL( 
+	                        TUid aUid, 
+	                        RPointerArray<CDiagResultsDbTestRecord>* aArray );
+	
+    /**
+	* Search for the newest test results.
+	*
+	* @param aUidArray Contains the uids to be searched.
+	* @param aTestRecordArray Contains all test records.
+	* @param aResultsArray Contains the found results or NULL if the test 
+	*                      result was not found.	
+	**/                        
+    void SearchLastResultsL( 
+                         const CArrayFixFlat<TUid>& aUidArray, 
+                         RPointerArray<CDiagResultsDbTestRecord>& aTestRecordArray, 
+                         RPointerArray<CDiagResultsDatabaseItem>& aResultsArray );
+        
+    /**
+    * Reads uids that are searched from the buffer and creates the test result array.
+    *
+    * @param aArray Contains all test records.
+    **/                         
+    void FindLastResultsL( RPointerArray<CDiagResultsDbTestRecord>& aArray );     
+    
+    /**
+    * Read last results buffer if there would be any additional test results.
+    *
+    * @param aUidArray Test results to be searched.
+    * @param aResultsArray results array. Found test results are appended into this.
+    **/
+    void CheckLastResultsBufferL( 
+                         const CArrayFixFlat<TUid>& aUidArray,                           
+                         RPointerArray<CDiagResultsDatabaseItem>& aResultsArray );
+    
+    /**
+    * Read last results buffer if there would be any additional test results.
+    *
+    * @param aTestUid UID to be searched from the last buffer.
+    * @param aResult Returns the last result if found. Otherwise NULL.
+    **/
+    void CheckLastResultsBufferL(
+                         TUid aTestUid,                           
+                         CDiagResultsDatabaseItem*& aResult );
+                        	                        
+	
+private: // Data
+
+    // Server pointer.
+	CDiagResultsDbServer *iServer;
+	
+	// Counts subsession.
+	CObjectCon* iSubsessionContainer;
+	
+	// Index to the container.
+	CObjectIx* iSubsessionIndex; 
+	
+	// Client request details.
+	RMessage2 iMsg;
+	
+	//Indicates are we handling InitiateGetLastResults or InitiateGetLastResult
+	TInt iLastResultCommand;
+	
+	// This is needed when InitiateGetLastResults is called.
+	RMessage2 iLastResultsMsg;
+	
+    // This is needed when InitiateGetLastResult is called.
+	RMessage2 iLastSingleResultsMsg;
+    
+    // Database uid. 
+    TUid iDbUid; 
+    
+    // Contains the permanent file store.
+    CDiagResultsDbStore* iStore;
+    
+    // GetLastResultsL operation needs this.
+    RPointerArray<CDiagResultsDatabaseItem>* iBufferedLastResults;
+    
+    // Contains buffered test result.
+    // 
+    CDiagResultsDatabaseItem* iBufferedSingleResult;
+    
+    // Indicates has this session wrote any data.
+    TBool iHasWrittenData;
+    
+    // Dynamic flat buffer for transmitting data across IPC.
+    CBufFlat* iBuffer;
+	};
+
+#endif // DIAGRESULTSDBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbstore.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,453 @@
+/*
+* Copyright (c) 2007-2007 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:  Permanent File Store for diagnostics test records.
+*  libraries   : 
+*
+*/
+
+
+#ifndef DIAGRESULTSDBSTORE_H
+#define DIAGRESULTSDBSTORE_H
+
+//System includes
+#include <s32file.h> //CPermanentFileStore
+#include <f32file.h> //Rfs, RFile
+#include <e32base.h>
+
+class CDiagResultsDatabaseItem;
+class CDiagResultsDbTestRecord;
+class CDiagResultsDbTestRecordHandle;
+class TDiagResultsDatabaseTestRecordInfo;
+class CDiagResultsDbRecordEngineParam;
+
+/**
+* An interface that must be implemented in order to call
+* ExistingRecordsAsyncL that is an asynchronous method.
+*
+* @since S60 v5.0
+**/
+class MRecordLoadingObserver
+    {
+public:
+    /**
+    * Returns an array of test records. Contains all test records from a 
+    * single database file.
+    *
+    * @param aError Indicates if there were any errors.
+    * @param aArray An array of test records. Ownership is transferred.
+    **/
+    virtual void ExistingRecordsL( TInt aError, 
+                       RPointerArray<CDiagResultsDbTestRecord>* aArray ) = 0;
+   
+    };
+    
+/**
+* An interface that must be implemented in order to call CompleteRecordAsyncL.
+*
+* @since S60 v5.0
+**/    
+class MRecordCompletionObserver
+    {
+public:
+
+    /**
+    * This is called when test record is completed.
+    *
+    * @param aError Symbian error code or KErrNone.
+    **/
+    virtual void CompletedRecordL( TInt aError ) = 0;
+    };    
+
+/**
+* Permanent file store class that manipulates results database file.
+* Database files are saved under server's private directory. 
+* For example epoc32\WINSCW\C\private\10282cd9\ in WINSCW.
+* Provides functions to load, save, compact and cleanup data.
+*
+* Files have format [UID].dat e.g. [21234563].dat
+*
+* Stream Ids of the test record handle are stored into the root stream.
+* Handles contain the stream ids to the test results.
+*
+* Implementation uses 3 kinds of streams:
+* 1) root stream 
+* 2) Test record handle stream
+* 3) Test result stream
+* 4) Last results buffer (buffer for overflowing test results)
+*
+* In order to retrieve a test result, we must first know which record
+* is needed and then ask from the handle where test result is. 
+* Of course we can browse all test records, because root stream
+* contains stream ids into test record handles.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbStore : public CActive
+	{
+public:
+
+    /**
+    * Destructor
+    **/
+	~CDiagResultsDbStore();
+	
+	/**
+	* NewL.
+	*
+	* @param aUid UID of the database file. This class manipulates only one 
+	*             database file at a time. If multiple database files needs
+	*             to be open, use another instance.
+	* @return New object.
+	**/
+	static CDiagResultsDbStore* NewL( TUid aUid );
+    static CDiagResultsDbStore* NewLC( TUid aUid );
+	
+	/**
+	* Create and return a new record. Ownership is transferred.
+	*
+	* @return a new test record.
+	**/
+    CDiagResultsDbTestRecordHandle* CreateNewRecordL( 
+                             CDiagResultsDbRecordEngineParam* aEngineParam );
+    
+    /**
+    * Write test record into the database.
+    *
+    * @param aHandle The test record to be written into the database.
+    * @return KErrNone or symbian error code.                        
+    **/
+    TInt CompleteRecord( CDiagResultsDbTestRecordHandle& aHandle );
+               
+    /**
+    * Write one test item into the DB.
+    *
+    * @param aCommit Indicates should we commit the store.
+    * @param aHandle Handle that is updated to contain the item.
+    * @param aTestItem An item to be added.
+    *
+    * @return Symbian error code or KErrNone.
+    **/                         
+    TInt CompleteTestResult( TBool aCommit, 
+                             CDiagResultsDbTestRecordHandle& aHandle, 
+                             CDiagResultsDatabaseItem& aTestItem );                         
+                                                                                                           
+    /**
+    * Search database for a test record handle.
+    * Handle does not contain test results directly. It only contains
+    * stream ids to the test results and general record info.
+    *
+    * @param aUid test record is searched based on the uid.
+    * @return The found test record or NULL.
+    **/
+    CDiagResultsDbTestRecordHandle* OpenExistingHandleL( TUid aUid );
+    
+    
+    /**
+    * Search database for a test record.
+    *
+    * @param aUid test record is searched based on the uid.
+    * @param aReadOnly indicates should we allow writing.
+    * @return The found test record or NULL.
+    */
+    CDiagResultsDbTestRecord* OpenExistingRecordL( TUid aUid, 
+                                                   TBool aReadOnly );
+    
+    /**
+    * Opens a single database item. 
+    * @param aId Stream id that represents the item.
+    *
+    * @return The found item or NULL.
+    **/
+    CDiagResultsDatabaseItem* OpenExistingTestResultL( TStreamId aId );
+       
+    /**
+    * Returns all record infos. Client is responsible for deleting the array.
+    *
+    * @return Record info array.
+    **/
+    RArray<TDiagResultsDatabaseTestRecordInfo>* ExistingRecordInfosL();
+    
+    /**
+    * Retrieve all test records from the database asynchronously.
+    *
+    * @param aObserver Observer is notified after test records have 
+    *                  been loaded.
+    **/
+    void ExistingRecordsAsyncL( MRecordLoadingObserver& aObserver );
+    
+
+        
+    /**
+    * Open last results buffer. It contains the test results that would have
+    * been otherwise deleted. These are needed when all last results are
+    * retrieved. Use with CleanUpDatabaseUseLastResultsBufferL.
+    *
+    * @return Test record. 
+    **/
+    CDiagResultsDbTestRecord* OpenExistingLastResultsBufferL(); 
+    
+    /**
+    * Compacts database to have only necessary information. This should be 
+    * done as often as necessary after writing. Compacting should not be
+    * done after reading!
+    * However note that this operation could take a long time. 
+    **/
+    void CompactDatabase();
+    
+	/**
+	 * Cleanup database. Used deletion algorithm is taken from the
+	 * Central Repository.
+	 *
+	 * @param aCommit ETrue commits the store.
+	 **/ 	   
+	void CleanUpDatabaseL( TBool aCommit );
+    
+    /**
+    * Read available test record handle uids.
+    *
+    * @param aUids Contains available test record handle uids.
+    **/
+    void RecordUidsL( RArray<TUid>& aUids );
+    
+protected: //From CActive
+    
+    /**
+    * Called from CActive::Cancel.
+    **/
+    virtual void DoCancel();
+
+    /**
+    * Asynchronous service function.
+    **/
+    virtual void RunL();
+    
+    /**
+    * Called if error happens in RunL.
+    **/
+    virtual TInt RunError(TInt aError);
+    
+private:     
+    
+	/**
+	 * Cleanup database to have only certain amount of test records 
+	 * inside per each database file.
+	 *
+	 * @param aCommit ETrue commits the store.
+	 **/ 	   
+	void CleanUpDatabaseNoLastResultsL( TBool aCommit );
+       
+ 	/**
+ 	 * Cleanup database and move some of the test results into the
+ 	 * last results buffer. This function guarantees that the DB
+ 	 * keeps last results. CleanUpDatabase does not do that.    
+ 	 *
+ 	 * @param aCommit ETrue commits the store. 
+ 	 **/ 
+ 	void CleanUpDatabaseUseLastResultsBufferL( TBool aCommit );
+
+    /**
+    * Read all stream ids from the root stream.
+    * 
+    * @param aIds StreamId array.
+    **/    
+    void ReadRootStreamL( RArray<TStreamId>& aIds );
+        
+    /**
+    * Create empty root stream.
+    *
+    * @param aStore Root stream is created into this store.
+    **/
+    void CreateEmptyRootStreamL( CPermanentFileStore& aStore );
+    
+    /**
+    * Replace root stream with an array.
+    *
+    * @param aArray Array that replaces any existing root stream.
+    **/
+    void ReplaceRootStreamL( RArray<TStreamId>& aArray );
+    
+    /**
+    * Write test record into the database file.
+    *
+    * @param aCompletedRecord is the record closed/completed or not.
+    * @param aCommit Commit the store or not.
+    * @param aTestRecord The test record to be written into the file.
+    **/
+    void DoCompleteRecordL( CDiagResultsDbTestRecordHandle& aHandle );
+                        
+    /**
+    * Complete test result i.e. write it into the store.
+    * @param aHandle Handle to be written.
+    * @param aTestItem Contains test results that are written into the store.
+    **/                            
+    void DoCompleteTestResultL( TBool aCommit, 
+                                CDiagResultsDbTestRecordHandle& aHandle, 
+                                CDiagResultsDatabaseItem& aTestItem );                            
+                                   
+    
+    /**
+    * Constructor.
+    * 
+    * @param aDbUid Database file uid.
+    **/
+    CDiagResultsDbStore( TUid aDbUid );
+    
+    /**
+    * ConstructL.
+    **/
+    void ConstructL();
+    
+    /**
+    * Complete own request is needed in some cases because this class uses 
+    * CActive to partition tasks into smaller pieces. This function completes
+    * TRequestStatus so that the RunL is called.
+    **/
+    void CompleteOwnRequest();
+    
+    //State of this class. These are used only in asynchronous methods.
+    enum EState
+        {
+        ENotRunning,
+        EGetRootStream,
+        EGetRecord,
+        ERecordsReady,
+        };
+    
+    enum EDeletionAlgorithm
+        {
+        EMaxRecordCountAlgorithm,
+        ELastResultsAlgorithm,
+        };
+     
+     /**
+     * Write handle into the store. Handle knows where test results are.
+     * @param aHandle The handle that is written into the store.
+     **/   
+     void WriteHandleIntoDbL( CDiagResultsDbTestRecordHandle& aHandle );
+     
+     
+     /**
+     * Append one ID into the root stream.
+     * @param aId ID to be added.
+     **/
+     void AppendRootStreamL( TStreamId& aId );
+     
+          
+     /**
+     * Deletes the oldest handle from the store.
+     *
+     * @param aIds Root stream.
+     **/
+     void DeleteOldestHandleL( RArray<TStreamId>& aIds );
+             
+     /**
+     * Delete handle and its test results.
+     *
+     * @param aIndex Index of the handle in the root stream.
+     * @param aIds Root stream.
+     * 
+     **/             
+     void DeleteHandleL( TInt aIndex, RArray<TStreamId>& aIds );
+     
+     /**
+     * Create last results buffer. It can be used to store test results
+     * that would be deleted otherwise. 
+     **/
+     void CreateLastResultsBufferStreamL();
+     
+     /**
+     * Open test record handle and its test results.
+     *
+     * @param aId Handle root stream ID.
+     * @param aRecord Returned test record.
+     * @param aHandle Returned test record handle.
+     **/
+     void OpenExistingRecordAndHandleL( TStreamId aId, 
+                                        CDiagResultsDbTestRecord*& aRecord,
+                                        CDiagResultsDbTestRecordHandle*& aHandle );
+
+    /**
+    * Check last results buffer and add test results into it if needed.
+    *
+    * @param aIds Root stream.
+    **/                                        
+     ///@@@KSR: changes for Codescanner error val = High 
+     //void CheckOverflowingTestResults( RArray<TStreamId>& aIds );
+     void CheckOverflowingTestResultsL( RArray<TStreamId>& aIds );
+
+    /**
+     * Return maximum file size defined in the Central Repository.
+     * This can be used to prevent a DB file from using too much disk space.
+     * 
+     * @return Maximum file size in bytes.
+     **/
+    TInt GetMaximumFileSizeL();
+    
+    /**
+     * Return the deletion algorithm defined in the central repository.
+     * 
+     * @return The type of the deletion algorithm.
+     **/
+    TInt GetDeletionAlgorithmL();
+    
+    /**
+     * Get maximum file size from the central repository and check the file size.
+     * 
+     * @param aRfs Opened file server session.
+     * @param aFileName File name of the DB file.
+     * @param aFileSize Size of the DB file in bytes.
+     **/
+    void CheckMaximumFileSizeLimitL( RFs& aRfs, 
+			  						 const TDesC& aFileName,
+			  						 TInt aFileSize );
+
+private: // Data
+
+    // Store that is owned by this class. Performs many file manipulation operations.
+	CPermanentFileStore* iStore;  
+    
+    // File DB uid. [UID].dat
+    TUid iDbUid;
+
+    // File server session
+    RFs iRfs;
+    
+    // The database file.
+    RFile iFile;
+    
+    // Loading observer to be notified async.
+    MRecordLoadingObserver* iLoadingObserver;
+    
+    // Completion observer (notified async).
+    MRecordCompletionObserver* iCompletionObserver;
+    
+    // Pointer to test record arrays. Used in async methods.
+    RPointerArray<CDiagResultsDbTestRecord>* iRecordArray;
+    
+    // Contains available record ids. Used in async methods.
+    RArray<TStreamId>* iRecordIds;
+    
+    // Used in async methods to remember what record was loaded.
+    TInt iRecordNumber;
+    
+    // Contains the test record to be completed (Used only in async methods).
+    CDiagResultsDbTestRecord* iTestRecord;
+    
+    // State of the asynchronous operation.
+    EState iState;
+    
+    EDeletionAlgorithm iDeletionAlgorithm;
+	};
+
+#endif // DIAGRESULTSDBSTORE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbtestrecord.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2007-2007 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:  Represents test record.
+*  libraries   : 
+*
+*/
+
+
+#ifndef DIAGRESULTSDBTESTRECORD_H
+#define DIAGRESULTSDBTESTRECORD_H
+
+#include "diagresultsdatabaseitem.h"
+#include "diagresultsdatabasetestrecordinfo.h"
+
+/**
+* Class represents a test record. Contains N amount of 
+* test results (CDiagResultsDatabaseItem).
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbTestRecord : public CBase
+	{
+public:
+
+    /**
+    * Destructor.
+    **/
+	~CDiagResultsDbTestRecord();
+    
+    /**
+    * NewL.
+    * 
+    * @param aReadOnly Indicates are we creating already completed test record.
+    * @param aRecordUid The Uid of this test record. The test record can be
+    *                   searched based on the UID. Very important to remember.
+    * @param aDbUid Identifies what DB file the test record should be written 
+    *               to (when test record is completed).
+    * @return New record.
+    **/
+	static CDiagResultsDbTestRecord* NewL( TBool aReadOnly, 
+	                                       TUid aRecordUid );
+
+    /**
+    * Return overview of the test record. 
+    *
+    * @return Overview of the test record.
+    **/
+    //TDiagResultsDatabaseTestRecordInfo& RecordInfo();
+    
+    /**
+    * Add one test result into the test record.
+    *
+    * @param aItem Test result to be added.
+    **/
+    void AddL( CDiagResultsDatabaseItem* aItem );
+    
+    /**
+    * Operator that returns the database item. 
+    * Panics if index is out of boundaries.
+    *
+    * @param aIndex Index of the item in the test record.
+    * @return Test result / databaseitem.
+    **/
+    const CDiagResultsDatabaseItem& operator[] (TInt aIndex) const;
+    
+    /**
+    * Returns a pointer to a database item. 
+    *
+    * @param aIndex Index of the item in the test record.
+    * @return NULL or database item.
+    **/
+    CDiagResultsDatabaseItem* GetItem(TInt aIndex) const;
+    
+    /**
+    * Return the number of test results in the test record.
+    *
+    * @return The number of items.
+    **/
+    TInt Count() const;
+    
+    /**
+    * Indicates has the test record been written into the DB file or not.
+    *
+    * @return ETrue if the test record is written, otherwise EFalse.
+    **/
+    TBool ReadOnly() const;
+    
+    /**
+    * Remove one item from the test record. Note that the removed 
+    * item is not deleted.
+    *
+    * @param aIndex Index of the item to be removed.
+    **/
+    void RemoveL( TInt aIndex );
+    
+    /**
+    * Remove one item from the test record. 
+    *
+    * @param aTestUid UID of the test.
+    **/
+    void RemoveL( TUid aTestUid );
+    
+    /**
+    * Check is this kind of test result already in the test record.
+    * Matching is done using test result UID.
+    *
+    * @param aItem The item to be searched.
+    * @return Index in the record or -1 if not found.
+    **/    
+    TInt FindTestRecord( const CDiagResultsDatabaseItem& aItem ) const;
+    
+    CDiagResultsDatabaseItem* FindTestRecord( TUid aUid );
+            
+private:     
+
+    /**
+    * Constructor.
+    *
+    * @param aReadOnly Indicates are we creating already completed test record.
+    * @param aRecordUid The Uid of this test record. The test record can be 
+    *                   searched based on the UID. Very important to remember.
+    * @param aDbUid Identifies what DB file the test record should be written
+    *               to (when test record is completed).
+    * @return New record.
+    **/ 
+    CDiagResultsDbTestRecord( TBool aReadOnly, TUid aRecordUid );
+    
+    /**
+    * ConstructL.
+    **/   
+    void ConstructL();
+
+private: // Data
+    
+    // Array containing the test results.
+    RPointerArray<CDiagResultsDatabaseItem>  iTestArray;
+    
+    // The record uid.
+    TUid iRecordUid;
+    
+    // Database file uid.
+    //TUid iDbUid;
+    
+    // Indicates has the test record been written into the DB file.
+    TBool iReadOnly;
+	};
+
+#endif //DIAGRESULTSDBTESTRECORD_H	
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbtestrecordhandle.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2007-2007 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:  Represents test record handle. The handle contains 
+* 			     stream ids to test results.
+*  libraries   : 
+*
+*/
+
+
+#ifndef DIAGRESULTSDBTESTRECORDHANDLE_H
+#define DIAGRESULTSDBTESTRECORDHANDLE_H
+
+#include "diagresultsdatabasetestrecordinfo.h"
+
+#include <s32std.h> //TStreamId 
+
+class CDiagResultsDbRecordEngineParam;
+
+/**
+* Test handle contains test result stream IDs.
+* Contains also general record info.
+* Stream ids can be used to store and load 
+* test results ( CDiagResultsDatabaseItem ). 
+* 
+* This class is only in the server side.
+* 
+* Handle contains one stream Id per test result that is stored.
+* Handle is stored into the root stream.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbTestRecordHandle : public CBase
+	{
+public:
+
+    /**
+    * Maps stream ids into test case Uids.
+    **/
+    struct TTestResultHandle
+        {
+        TStreamId iStreamId;
+        TUid iTestUid;
+        };
+
+    /**
+    * Destructor.
+    **/
+	~CDiagResultsDbTestRecordHandle();
+    
+    /**
+    * NewL.
+    **/
+	static CDiagResultsDbTestRecordHandle* NewL(
+	                           TStreamId aRecordUid, 
+	                           TUid aDbUid,
+	                           CDiagResultsDbRecordEngineParam* aEngineParam );
+	                                                 
+    /**
+    * NewL.
+    **/
+	static CDiagResultsDbTestRecordHandle* NewL( RReadStream& aStream );	                                                 
+
+    /**
+    * Return overview of the test record. 
+    *
+    * @return Overview of the test record.
+    **/
+    TDiagResultsDatabaseTestRecordInfo& RecordInfo();
+    
+    
+    /**
+    * Return Engine parameters. These are needed by the
+    * Diagnostics framework.
+    *
+    * @return Engine parameters.
+    **/
+    const CDiagResultsDbRecordEngineParam& GetEngineParam() const;
+    
+    /**
+    * Root stream ID.
+    *
+    * @return StreamID that represents this handle in the root stream.
+    **/
+    TStreamId RecordId() const;
+    
+    /**
+    * Add one test result into the test record.
+    *
+    * @param aItem Test result to be added.
+    **/
+    void AddL( TTestResultHandle& aItem );
+    
+    /**
+    * Update one test result handle. Assumes
+    * that this kind of result handle already exists. 
+    * Leaves with KErrNotFound if the resulthandle is not found
+    * (checked using the UID).
+    * 
+    * @param aResultHandle Contains updated stream ID.
+    **/
+    void UpdateL( TTestResultHandle& aResultHandle );
+        
+    /**
+    * Operator that returns the database item. 
+    * Panics if index is out of boundaries.
+    *
+    * @param aIndex Index of the item in the test record.
+    * @return Test result / databaseitem.
+    **/
+    const TStreamId& operator[] (TInt aIndex) const;
+    
+    
+    /**
+    * Get result handle.
+    *
+    * @param aIndex Index of the handle.
+    * @return Return handle that corresponds the index.
+    * 
+    **/
+    TTestResultHandle Get( TInt aIndex ) const;
+    
+    /**
+    * Convert Test Uids into stream Ids. Stream ids can be used
+    * to load actual results from the store.
+    *
+    * @param aTestUid Plug-in Uid.
+    * @param aStreamId StreamId that matches plug-in Uid.
+    * @return KErrNotFound or KErrNone.
+    *
+    **/
+    TInt MatchingStreamId( TUid aTestUid, TStreamId& aStreamId ) const;
+    
+    /**
+    * Return the number of test results in the test record.
+    *
+    * @return The number of items.
+    **/
+    TInt Count() const;
+    
+    /**
+    * Remove one item from the test record. 
+    *
+    * @param aItem ID to be removed.
+    **/
+    void RemoveL( TStreamId& aItem );
+    
+    /**
+    * Remove one item from the test record. 
+    *
+    * @param aItemUid UID to be removed.
+    **/
+    void RemoveL( TUid aItemUid );
+    
+    /**
+    * Check does the handle already exist.
+    *
+    * @param aTestUid Plug-in uid to be searched.
+    * @return Index of the found plug-in uid.
+    **/
+    TInt FindIndex ( TUid aTestUid ) const;
+    
+    /**
+    * Check does the handle already exist.
+    *
+    * @param aTestUid Plug-in Uid to be searched.
+    * @return ETrue if plug-in Uid is found, EFalse otherwise.
+    **/
+    TBool Find ( TUid aTestUid ) const;
+        
+    /**
+    * Externalize the test result to a stream.
+    *
+    * @param aStream   Stream to write to.
+    */
+    void ExternalizeL( RWriteStream& aStream ) const; 
+            
+private:     
+
+    /**
+    * Constructor.
+    **/ 
+    CDiagResultsDbTestRecordHandle(
+                              TStreamId aRecordUid, 
+	                          TUid aDbUid,
+	                          CDiagResultsDbRecordEngineParam* aEngineParam );
+	                                   
+	/**
+    * Constructor.
+    **/ 
+    CDiagResultsDbTestRecordHandle();
+	                                   
+    /**
+    * ConstructL.
+    **/   
+    void ConstructL();
+    
+    /**
+    * ConstructL.
+    **/   
+    void ConstructL( RReadStream& aStream );
+    
+    /**
+    * Internalize the test result from a stream.
+    *
+    * @param aStream   Stream to read from.
+    */
+    void InternalizeL( RReadStream& aStream );
+
+private: // Data
+
+    // Test record overview.
+    TDiagResultsDatabaseTestRecordInfo  iTestRecordInfo;
+    
+    // Array containing the streans IDs of test results.
+    // These can be used to reload test records.
+    RArray<TTestResultHandle>  iHandleArray;
+    
+    // Represents root stream ID.
+    TStreamId iRecordId;
+    
+    // Engine parameters. 
+    CDiagResultsDbRecordEngineParam* iEngineParam;
+	};
+
+#endif //DIAGRESULTSDBTESTRECORDHANDLE_H	
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/inc/diagresultsdbtestrecordsubsession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2007-2007 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:  Symbian OS server subsession.
+*  libraries   : 
+*
+*/
+
+
+#ifndef DIAGRESULTSDBTESTRECORDSUBSESSION_H
+#define DIAGRESULTSDBTESTRECORDSUBSESSION_H
+
+//System includes
+#include <e32cmn.h> //RMessage2
+#include <e32base.h> //CObject 
+
+//Forward declarations
+class CDiagResultsDbSession;
+class CDiagResultsDbTestRecordHandle;
+class MRecordCompletionObserver;
+
+/**
+* Server Subsession 
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbTestRecordSubsession: public CObject, 
+                                          public MRecordCompletionObserver
+	{
+public:  
+
+    /**
+    * NewL.
+    * 
+    * @param aSession Main Database session.
+    * @param aTestRecord The test record that this subsession handles.
+    *                    The record is either totally empty or contains data.
+    * @param aResumeTestRecord Indicates can opened test record modified.
+    *
+    * @return Test record subsession.                    
+    **/
+	static CDiagResultsDbTestRecordSubsession* NewL(
+	                                 CDiagResultsDbSession* aSession, 
+	                                 CDiagResultsDbTestRecordHandle* aTestRecordHandle,
+	                                 TBool aReadonly
+	                                 );
+	                                 
+    /**
+    * Destructor.
+    **/
+    ~CDiagResultsDbTestRecordSubsession();
+
+    /**
+    * Handles the client request. 
+    *
+    * @param aMessage Details of the client request.
+    * @return ETrue if request was asynchronous, EFalse otherwise.
+    **/
+    TBool DispatchMessageL(const RMessage2& aMessage);
+    
+    /**
+    * Returns the test record that this subsession represents.
+    *
+    * @return The test record.
+    **/
+    CDiagResultsDbTestRecordHandle* CurrentTestRecordHandle();
+    
+    /**
+    * Returns the value that client send when connecting.
+    * ETrue = Readonly subsession.
+    * EFalse = Writable subsession.
+    **/ 
+    TBool ReadonlySubsession() const;
+    
+public: //MRecordCompletionObserver
+        
+    /**
+    * This is called when test record is completed.
+    *
+    * @param aError Symbian error code or KErrNone.
+    **/   
+    void CompletedRecordL( TInt aError );    
+
+protected:
+
+    /**
+    * C++ Constructor
+    *
+    * @param aSession Main Database session.
+    * @param aTestRecord The test record that this subsession handles.
+    *                    The record is either totally empty or contains data.
+    **/
+    CDiagResultsDbTestRecordSubsession(
+                        CDiagResultsDbSession* aSession, 
+                        CDiagResultsDbTestRecordHandle* aTestRecord,
+                        TBool aReadonly
+                        );
+                      
+    /**
+    * ConstructL.
+    **/                    
+    void ConstructL();                    
+    
+private: // Client request handling functions. 
+         // Look at DiagResultsDatabaseCommon.h for the client requests.
+
+    void LogTestResultL( const RMessage2& aMessage );
+    
+    void GetTestResultL( const RMessage2& aMessage );
+    
+    void CompleteTestRecordL( const RMessage2& aMessage );
+    
+    void GetTestResultsL( CDiagResultsDbTestRecordHandle* aTestRecord, 
+                          const RMessage2& aMessage );
+    
+    void GetTestUidsL( const RMessage2& aMessage );
+       
+    void GetEngineParamL( const RMessage2& aMessage );
+    
+    TBool Completed() const;
+    
+    void GetStatusL ( const RMessage2& aMessage );
+    
+    void SuspendTestRecordL( const RMessage2& aMessage );
+    
+    void CancelLogTestResult( const RMessage2& aMessage );
+    
+private: // Data
+
+    // Main DB session
+    CDiagResultsDbSession* iSession;
+    
+    // Test record that represents this subsession.
+    CDiagResultsDbTestRecordHandle* iTestRecordHandle;
+    
+    // Details of the client request.
+    RMessage2 iMsg;
+    
+    // Dynamic flat buffer for transmitting data across IPC.
+    CBufFlat* iBuffer;
+    
+    // Read or Write-mode 
+    TBool iReadonly;
+    
+    TBool iCompletedLogTest;
+	};
+	
+#endif // DIAGRESULTSDBTESTRECORDSUBSESSION_H	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbserver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2007 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:  Class definition of 
+*
+*/
+
+
+#include "diagresultsdatabasecommon.h"
+#include "diagresultsdbserver.h"
+#include "diagresultsdbsession.h"
+
+#include <e32base.h>
+#include <e32uid.h>
+
+//Enter any new accepted UIDs here.
+const TInt KAcceptedUids[] = 
+    { 
+    0x2000B0E8, //Phone Doctor
+    0x2000E542, //Diagnostics application
+    0x102073E4,    // STIF
+#if defined( _DEBUG ) || defined( __WINSCW__ )
+    0x10282CDA,   //Results DB test app
+    0x20000FB1,   //EUnitAppEnv
+    0x20000FB2,   //EUnitEikApp
+    0x20000FB3,   //EUnitExeEnv
+    0xED80F513,   // DiagFramework Test app
+#endif // _DEBUG || __WINSCW__
+    0x2000F8E8    // donno
+    };
+
+const TInt KAcceptedUidCount = sizeof( KAcceptedUids ) / sizeof( TInt );
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//  
+CDiagResultsDbServer::CDiagResultsDbServer(TInt aPriority, 
+                                            const TPolicy &aPolicy)
+: CPolicyServer(aPriority, aPolicy), iContainerIndex( NULL ), iSessionCount(0)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//  
+CDiagResultsDbServer::~CDiagResultsDbServer()
+	{
+	delete iContainerIndex;
+	}
+
+// ---------------------------------------------------------------------------
+// NewLC.
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbServer::NewLC(const TPolicy &aPolicy)
+	{
+	CDiagResultsDbServer *pS = new CDiagResultsDbServer( 
+	                                        CActive::EPriorityHigh, aPolicy );
+	CleanupStack::PushL( pS ); 
+	pS->StartL( KDiagResultsDatabaseServerName );
+	pS->ConstructL();
+	}
+
+// ---------------------------------------------------------------------------
+// ConstructL.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbServer::ConstructL()
+	{
+	iContainerIndex = CObjectConIx::NewL();
+	}
+
+
+// ---------------------------------------------------------------------------
+// Create a new server session.
+// ---------------------------------------------------------------------------
+// 
+CSession2 *CDiagResultsDbServer::NewSessionL(const TVersion &aVersion, 
+                                        const RMessage2 &/*aMessage*/) const
+	{
+	// check we're the right version
+	TVersion v(KDiagResultsDatabaseServerMajor, KDiagResultsDatabaseServerMinor, 
+	                                            KDiagResultsDatabaseServerBuild);
+	if( !User::QueryVersionSupported( v, aVersion ) )
+		User::Leave( KErrNotSupported );
+	// make new session
+	return CDiagResultsDbSession::NewL((CDiagResultsDbServer*)this);
+	}
+
+// ---------------------------------------------------------------------------
+// Create new object container.
+// ---------------------------------------------------------------------------
+//
+CPolicyServer::TCustomResult CDiagResultsDbServer::CustomSecurityCheckL(
+                        const RMessage2 &aMsg, 
+                        TInt &/*aAction*/, 
+                        TSecurityInfo &/*aMissing*/)
+	{
+	CPolicyServer::TCustomResult result = EFail;
+	TInt sid = aMsg.SecureId();
+
+    for ( TInt i = 0; i < KAcceptedUidCount; ++i )
+        {
+        if ( sid == KAcceptedUids[i] )
+            {
+            if ( aMsg.HasCapability( ECapabilityReadDeviceData ) &&
+	             aMsg.HasCapability( ECapabilityWriteDeviceData ) )
+	            {
+	            result = EPass;   
+	            break; 
+	            }    
+            }
+        }
+	    
+	return result;
+	}
+
+// ---------------------------------------------------------------------------
+// Create new object container.
+// ---------------------------------------------------------------------------
+//
+CObjectCon* CDiagResultsDbServer::NewContainerL()
+	{
+	return iContainerIndex->CreateL();
+	}
+	
+
+// ---------------------------------------------------------------------------
+// Remove object from a container index,
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbServer::RemoveContainer(CObjectCon* aCon)
+	{
+	iContainerIndex->Remove( aCon );
+	}	
+
+// ---------------------------------------------------------------------------
+// Return the total amount of client sessions.
+// ---------------------------------------------------------------------------
+// 	
+TInt CDiagResultsDbServer::SessionCount()
+	{
+	return iSessionCount;
+	}
+
+// ---------------------------------------------------------------------------
+// Decrease session count when one client leaves and stop server if there are
+// no more clients.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbServer::DecreaseSessionCount()
+	{
+	iSessionCount--;
+	if (iSessionCount == 0)
+		{
+		CActiveScheduler::Stop();
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// One new session created.
+// ---------------------------------------------------------------------------
+// 	
+void CDiagResultsDbServer::IncreaseSessionCount()
+	{
+	iSessionCount++;
+	}		
+    
+// ---------------------------------------------------------------------------
+// Create cleanupStack and call RunserverL.
+// ---------------------------------------------------------------------------
+// 
+TInt CDiagResultsDbServer::RunServer()
+	{
+	__UHEAP_MARK;
+	//
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	TInt ret = KErrNoMemory;
+	if( cleanup )
+		{
+		TRAP( ret, CDiagResultsDbServer::RunServerL() );
+		delete cleanup;
+		}
+	//
+	__UHEAP_MARKEND;
+	if( ret != KErrNone )
+		{
+		// Signal the client that server creation failed
+		RProcess::Rendezvous( ret );
+		}
+	return ret;
+	}
+
+// ---------------------------------------------------------------------------
+// Create active scheduler and run server.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbServer::RunServerL()
+	{
+	User::RenameThread(KDiagResultsDatabaseServerName);
+	
+	// Create and install the active scheduler we need
+	CActiveScheduler *as=new (ELeave)CActiveScheduler;
+	CleanupStack::PushL( as );
+	CActiveScheduler::Install(as);
+
+	// Create server
+	CDiagResultsDbServer::NewLC(policy);
+
+	// Initialisation complete, now signal the client
+
+	RProcess::Rendezvous(KErrNone);
+
+	// Ready to run
+	CActiveScheduler::Start();
+
+	// Cleanup the server and scheduler
+	CleanupStack::PopAndDestroy(2, as);
+	}
+
+
+// ---------------------------------------------------------------------------
+// Main function that is called when server(.EXE) is launched.
+// ---------------------------------------------------------------------------
+// 
+TInt E32Main()
+	{
+	TInt error(KErrNone);
+	error = CDiagResultsDbServer::RunServer();
+	return error;
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbsession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1042 @@
+/*
+* Copyright (c) 2007 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:  Class definition of CDiagResultsDbSession
+*
+*/
+
+
+#include "diagresultsdatabasecommon.h"
+#include "diagresultsdbsession.h"
+#include "diagresultsdbserver.h"
+#include "diagresultsdbtestrecordsubsession.h"
+#include "diagresultsdatabasetestrecordinfo.h"
+#include "diagresultsdbtestrecordhandle.h"
+#include "diagresultsdbtestrecord.h"
+#include "diagresultsdatabaseitem.h"
+#include "diagresultsdbrecordinfoarraypacked.h"
+#include "diagresultsdbcrdc.h"
+#include "diagresultsdbrecordengineparam.h"
+
+//System includes
+#include <s32mem.h>
+
+const TInt KArrayGranuality = 50;
+const TInt KResultsDatabaseBufferLength=0x700;
+
+// ---------------------------------------------------------------------------
+// constructor - must pass client to CSession
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbSession::CDiagResultsDbSession(CDiagResultsDbServer * aServer): 
+       iServer(aServer), iSubsessionContainer( NULL ), iSubsessionIndex(NULL), 
+       iLastResultCommand( 0 ),
+       iStore(NULL), iBufferedLastResults(NULL), iBufferedSingleResult(NULL),
+       iHasWrittenData(EFalse)
+	{
+	aServer->IncreaseSessionCount();
+	}
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbSession* CDiagResultsDbSession::NewL(CDiagResultsDbServer * aServer)
+	{
+	CDiagResultsDbSession* pSession= new (ELeave) CDiagResultsDbSession( aServer );
+	CleanupStack::PushL( pSession );
+	pSession->ConstructL();
+	CleanupStack::Pop();
+	return pSession;
+	}
+
+// ---------------------------------------------------------------------------
+// ConstructL.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::ConstructL()
+	{
+	iSubsessionContainer = iServer->NewContainerL();
+	iSubsessionIndex = CObjectIx::NewL();
+	
+	// buffer for IPC. Objects are transmitted in this buffer.
+	// Size of the buffer has to be selected carefully.
+	// It should be 'large enough' but not too large.
+	// If you see too many overflows, increase the size.
+	iBuffer = CBufFlat::NewL(KArrayGranuality);
+	iBuffer->ResizeL(KResultsDatabaseBufferLength);
+	}
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+// 	
+CDiagResultsDbSession::~CDiagResultsDbSession()
+	{
+    if ( iBuffer )
+        {
+        iBuffer->Reset();
+        delete iBuffer;
+        iBuffer = NULL;
+        }
+    
+	// NOTE!
+	// The deletion order is important here. You must
+	// delete object indexes first, because this zeros the
+	// number of references to any CObject type objects. Trying 
+	// to delete object container first, you get panic
+	// E32USER-CBase 33: an attempt is made to delete the CObject 
+	// when the reference count is not zero.
+	delete iSubsessionIndex;
+
+    if ( iSubsessionContainer )
+        {
+        iServer->RemoveContainer( iSubsessionContainer );
+        }
+	
+	delete iStore;
+	
+    if ( iServer )
+        {
+        iServer->DecreaseSessionCount();
+        }
+	
+	if ( iBufferedLastResults )
+	    {
+	    iBufferedLastResults->ResetAndDestroy();
+	    iBufferedLastResults->Close();
+	    delete iBufferedLastResults;
+	    iBufferedLastResults = 0;
+	    }
+	    
+    if ( iBufferedSingleResult )
+        {
+        delete iBufferedSingleResult;
+        iBufferedSingleResult = NULL;
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// Service client requests.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::ServiceL(const RMessage2& aMessage)
+	{
+	LOGME("CDiagResultsDbSession::ServiceL");
+	TBool async = EFalse;
+	TRAPD( err, async = DispatchMessageL( aMessage ) );
+	LOGME1("CDiagResultsDbSession::ServiceL %d",err);
+	if ( !async ) 
+	    {
+	    aMessage.Complete( err );
+	    }
+	}
+
+// ---------------------------------------------------------------------------
+// service a client request; test the opcode and then do appropriate servicing
+// ---------------------------------------------------------------------------
+//     
+TBool CDiagResultsDbSession::DispatchMessageL(const RMessage2 &aMessage)
+	{
+	LOGME("CDiagResultsDbSession::DispatchMessageL");
+	iMsg = aMessage;
+	TInt function = aMessage.Function();
+	LOGME1("CDiagResultsDbSession::DispatchMessageL - %d",function);
+	TInt handle(0);
+	CObject* subsession = NULL;
+	switch( function )
+        {
+	case DiagResultsDbCommon::EConnect:
+	    {
+	    LOGME("CDiagResultsDbSession::EConnect");
+	    TPckgBuf<TUid> uidpckg;
+	    aMessage.Read(0, uidpckg);
+        iDbUid = uidpckg();
+        
+        iStore = CDiagResultsDbStore::NewL( iDbUid );
+		return EFalse;
+	    }
+        
+    case DiagResultsDbCommon::EClose:
+        {        
+        LOGME("CDiagResultsDbSession::EClose");
+        aMessage.Complete (KErrNone);
+                      
+        return ETrue;
+        }
+        
+    case DiagResultsDbCommon::EGetRecordCount:
+        {        
+        LOGME("CDiagResultsDbSession::EGetRecordCount");
+        RArray<TUid> uids;
+        CleanupClosePushL ( uids );
+        iStore->RecordUidsL( uids );
+        
+        TPckgBuf<TUint> pckg( uids.Count() );
+        aMessage.Write(0, pckg);
+        
+        CleanupStack::PopAndDestroy( &uids );
+        return EFalse;
+        }
+        
+	case DiagResultsDbCommon::EConnectSubsession:
+			LOGME("CDiagResultsDbSession::EConnectSubsession");
+	    ConnectSubsessionL( aMessage );
+		return EFalse;			
+		
+	case DiagResultsDbCommon::ESubsessionCreateNewRecord:
+			LOGME("CDiagResultsDbSession::ESubsessionCreateNewRecord");
+	    CreateNewRecordL( aMessage );
+	    HasWritten();
+		return EFalse;
+		
+	case DiagResultsDbCommon::ECloseSubsession:
+		LOGME("CDiagResultsDbSession::ECloseSubsession");
+		CloseSubsessionL();
+		return EFalse;
+		
+    case DiagResultsDbCommon::EGetLastRecord:  
+    		LOGME("CDiagResultsDbSession::EGetLastRecord");
+        GetLastRecordL( aMessage );
+        return EFalse;
+        
+    case DiagResultsDbCommon::EGetLastNotCompletedRecord:
+    		LOGME("CDiagResultsDbSession::EGetLastNotCompletedRecord");
+        GetLastNotCompletedRecordL( aMessage );
+        return EFalse;
+    
+    case DiagResultsDbCommon::EGetRecordList: //record uids 
+    		LOGME("CDiagResultsDbSession::EGetRecordList");
+        GetRecordListL( aMessage );
+        return EFalse;
+
+    case DiagResultsDbCommon::EGetRecordInfoList:
+    		LOGME("CDiagResultsDbSession::EGetRecordInfoList");
+        GetRecordInfoListL( aMessage );
+        return EFalse;
+
+    case DiagResultsDbCommon::EInitiateGetLastResults:  //Async
+        {     
+        LOGME("CDiagResultsDbSession::EInitiateGetLastResults");
+        ReadBufferL( aMessage, 0, iBuffer );
+               
+        iLastResultsMsg = iMsg;
+        	
+        iLastResultCommand = DiagResultsDbCommon::EInitiateGetLastResults;	
+        	
+        if ( iBufferedLastResults )
+	        {
+	        iBufferedLastResults->ResetAndDestroy();
+	        iBufferedLastResults->Close();
+	        delete iBufferedLastResults;
+	        iBufferedLastResults = 0;
+	        }
+	        
+        iStore->ExistingRecordsAsyncL( *this );
+        return ETrue;
+        }
+    
+    case DiagResultsDbCommon::EInitiateGetSingleLastResult: //Async
+        {           
+        LOGME("CDiagResultsDbSession::EInitiateGetSingleLastResult");     
+        iLastSingleResultsMsg = iMsg;
+        
+        iLastResultCommand = DiagResultsDbCommon::EInitiateGetSingleLastResult;	
+        
+        if ( iBufferedSingleResult )
+            {
+            delete iBufferedSingleResult;
+            iBufferedSingleResult = NULL;
+            }
+            
+        iStore->ExistingRecordsAsyncL( *this );
+        return ETrue;  
+        }
+    
+    
+    case DiagResultsDbCommon::EGetLastResults:    
+    		LOGME("CDiagResultsDbSession::EGetLastResults");     
+        GetLastResultsL( aMessage );
+        return EFalse;
+        
+    case DiagResultsDbCommon::EGetSingleLastResult: 
+    		LOGME("CDiagResultsDbSession::EGetSingleLastResult");        
+        GetSingleLastResultL( aMessage );
+        return EFalse;    
+        
+    case DiagResultsDbCommon::ECancelInitiateGetLastResults:
+        {
+        LOGME("CDiagResultsDbSession::ECancelInitiateGetLastResults");        
+        CancelLastResultsL( aMessage );
+        return EFalse;
+        }
+       
+	// Sub-session requests. See CDiagResultsDbTestRecordSubsession.
+    case DiagResultsDbCommon::ESubsessionGetTestRecordId:
+    case DiagResultsDbCommon::ESubsessionTestCompleted:
+    case DiagResultsDbCommon::ESubsessionIsTestCompleted:
+    case DiagResultsDbCommon::ESubsessionGetRecordInfo:
+    case DiagResultsDbCommon::ESubsessionGetTestUids:
+    case DiagResultsDbCommon::ESubsessionSuspend:
+    case DiagResultsDbCommon::ESubsessionIsSuspended:
+    case DiagResultsDbCommon::ESubsessionLogTestResult:
+    case DiagResultsDbCommon::ESubsessionGetTestResult:
+    case DiagResultsDbCommon::ESubsessionGetTestResults:
+    case DiagResultsDbCommon::ESubsessionGetEngineParam:
+    case DiagResultsDbCommon::ESubsessionGetStatus:
+    case DiagResultsDbCommon::ESubsessionCancelLogTestResult:
+    LOGME("CDiagResultsDbSession::ESubsessionCancelLogTestResult");        
+		handle = aMessage.Int3();
+		subsession = iSubsessionIndex->At( handle );
+		return static_cast<CDiagResultsDbTestRecordSubsession*>(subsession)
+		                                    ->DispatchMessageL( aMessage );
+	default:
+		aMessage.Panic( _L("DiagSrv panic: unknown command"), 
+		                    DiagResultsDbCommon::EBadRequest );
+		return EFalse;
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// Get function.
+// ---------------------------------------------------------------------------
+// 
+TBool CDiagResultsDbSession::SessionHasWritten() const
+    {
+    return iHasWrittenData;
+    }
+            
+// ---------------------------------------------------------------------------
+// Connect to a subsession. Test record represents the connected subsession.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::ConnectSubsessionL( const RMessage2 &aMessage )    
+    {
+    TPckgBuf<TUid> uidpckg;
+	aMessage.Read(0, uidpckg);
+    TUid recordUid = uidpckg(); 
+    
+    TPckgBuf<TBool> readOnlyPckg;
+	aMessage.Read(1, readOnlyPckg);
+    TBool readonly = readOnlyPckg();
+    
+	CDiagResultsDbTestRecordHandle* handle = iStore->OpenExistingHandleL( 
+	                                           recordUid );
+	                                           
+    if ( readonly ) 
+        {
+        // keep the record as it is.
+        }
+    else
+        {
+        if ( handle->RecordInfo().iCompleted )
+            {
+            delete handle;
+            handle = 0;
+            User::Leave( KErrAlreadyExists );
+            }
+        
+        handle->RecordInfo().iRecordStatus = 
+                TDiagResultsDatabaseTestRecordInfo::EOpen;
+        }
+	                                           
+    CreateSubsessionL( handle, readonly );
+    }
+
+// ---------------------------------------------------------------------------
+// Create a new record. This does not write data into the db file.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::CreateNewRecordL ( const RMessage2 &aMessage )
+    {
+    
+    ReadBufferL( aMessage, 1, iBuffer );
+    
+    RBufReadStream stream( *iBuffer );
+    CleanupClosePushL ( stream );
+    
+    CDiagResultsDbRecordEngineParam* params = 
+                            CDiagResultsDbRecordEngineParam::NewL ( stream );
+    CleanupStack::PushL( params );                         
+
+    CDiagResultsDbTestRecordHandle* handle = iStore->CreateNewRecordL( params );
+
+    handle->RecordInfo().iRecordStatus = 
+                                TDiagResultsDatabaseTestRecordInfo::EOpen;
+
+    CleanupStack::Pop(); //params    
+    CleanupStack::PopAndDestroy( &stream );
+
+	CreateSubsessionL(handle, EFalse);
+		
+	TPckgBuf<TUid> recorduidpckg( handle->RecordInfo().iRecordId );
+		
+	aMessage.Write(0, recorduidpckg );
+    }
+    
+// ---------------------------------------------------------------------------
+// Return the database file uid.
+// ---------------------------------------------------------------------------
+//      
+TUid CDiagResultsDbSession::DbUid() const
+    {
+    return iDbUid;
+    }
+
+// ---------------------------------------------------------------------------
+// Create a new subsession.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::CreateSubsessionL( 
+                            CDiagResultsDbTestRecordHandle* aTestRecordHandle,
+                            TBool aReadonly )
+	{
+    TInt handle(0);
+    CObject* subsession = NULL;
+    
+	// Create sub-session object
+	subsession = CDiagResultsDbTestRecordSubsession::NewL( this, 
+	                                                    aTestRecordHandle,
+	                                                    aReadonly );
+    CleanupStack::PushL( subsession );
+    iSubsessionContainer->AddL( subsession );
+    CleanupStack::Pop();
+
+	// Create sub-session handle
+	TRAPD( err, handle = iSubsessionIndex->AddL( subsession ) );
+
+	// Remember to remove session object from object container
+	if( err != KErrNone )
+		{
+		iSubsessionContainer->Remove( subsession ); 
+		User::Leave( DiagResultsDbCommon::ESvrCreateSubsession );
+		}
+
+    // Package to pass information to the client
+    TPckgC<TInt> handlePckg(handle);
+    
+    // Send handle to the client
+    TRAP( err, iMsg.WriteL( 3, handlePckg ) );
+	if( err != KErrNone )
+		{
+		iSubsessionIndex->Remove(handle);
+		User::Leave( DiagResultsDbCommon::ESvrCreateSubsession );
+		}
+
+	return;
+	}
+
+// ---------------------------------------------------------------------------
+// Close existing subsession.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::CloseSubsessionL()
+	{
+	TInt handle = iMsg.Int3();
+	iSubsessionIndex->Remove(handle);
+	}
+
+// ---------------------------------------------------------------------------
+// Return store that is responsible for handling the database file.
+// ---------------------------------------------------------------------------
+// 	
+CDiagResultsDbStore& CDiagResultsDbSession::Store()
+    {
+    return *iStore;
+    }
+
+// ---------------------------------------------------------------------------
+// Service function. Searches for newest test results. 
+//    Related functions: 
+//    ExistingRecordsAsyncL (initiates async fetch of test records)
+//    CancelLastResultsL (cancel async fetch)
+//    ExistingRecordsL (retrieves test records)
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::GetLastResultsL( const RMessage2 &aMessage )
+    {
+    if ( iBufferedLastResults == NULL )
+        {
+        User::Leave ( KErrNotFound );
+        }
+       
+    ReadBufferL( aMessage, 0, iBuffer );
+      
+    RBufWriteStream stream ( *iBuffer );
+    CleanupClosePushL( stream );
+    
+    stream.WriteInt16L( iBufferedLastResults->Count() );
+    
+    for ( TInt i = 0; i < iBufferedLastResults->Count(); ++i )
+        {    
+        CDiagResultsDatabaseItem* item = (*iBufferedLastResults)[i];
+        
+        if ( item == NULL )
+            {
+            stream.WriteUint8L(0); 
+            }
+        else 
+            {
+            stream.WriteUint8L(1);
+            (*iBufferedLastResults)[i]->ExternalizeL( stream );
+            }
+        }
+
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(0) )
+        {
+        User::Leave( KErrOverflow );
+        }
+   
+    stream.CommitL();
+     
+    CleanupStack::PopAndDestroy( &stream );
+    
+    aMessage.Write( 0, iBuffer->Ptr(0) ); //write to client's address space 
+         
+    iBufferedLastResults->ResetAndDestroy();
+    iBufferedLastResults->Close();
+    delete iBufferedLastResults;
+    iBufferedLastResults = NULL;   
+    }
+
+
+// ---------------------------------------------------------------------------
+// Service function. Get single test result (the newest).
+// ---------------------------------------------------------------------------
+//   
+void CDiagResultsDbSession::GetSingleLastResultL( const RMessage2 &aMessage )
+    {
+    ReadBufferL( aMessage, 0, iBuffer );
+          
+    RBufWriteStream stream ( *iBuffer );
+    CleanupClosePushL( stream );
+    
+    if ( iBufferedSingleResult )
+        {
+        stream.WriteInt8L( 1 );
+        
+        iBufferedSingleResult->ExternalizeL( stream );
+        
+        }
+    else //NULL
+        {
+        stream.WriteInt8L( 0 );
+        }
+    
+    stream.CommitL();
+    CleanupStack::PopAndDestroy( &stream );
+    
+    aMessage.Write( 0, iBuffer->Ptr(0) );
+            
+    delete iBufferedSingleResult;
+    iBufferedSingleResult = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Service function. Cancel InitiateGetLastResults method.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::CancelLastResultsL( const RMessage2 & /*aMessage*/ )
+    {
+      if ( !iLastResultsMsg.IsNull() )
+        {
+        iStore->Cancel();    
+        iLastResultsMsg.Complete( KErrCancel );  
+        
+        if ( iBufferedLastResults )
+            {
+            iBufferedLastResults->ResetAndDestroy();
+            delete iBufferedLastResults;
+            iBufferedLastResults = NULL;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Service function. Retrieve uid of the newest test record.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::GetLastRecordL( const RMessage2 &aMessage )
+    {
+    RArray<TUid> uids;
+    CleanupClosePushL ( uids );
+    iStore->RecordUidsL( uids );
+    
+    if ( uids.Count() == 0 )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    TPckgBuf<TUid> pckg( uids[uids.Count() -1] ); //newest record is the last
+    aMessage.Write( 0, pckg );
+    
+    CleanupStack::PopAndDestroy( &uids );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Service function. Try to find a test record that was suspended.
+// Leave with KErrNotFound if such test record is not found.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::GetLastNotCompletedRecordL( const RMessage2 &aMessage )
+    {
+    RArray<TUid> uids;
+    CleanupClosePushL ( uids );
+    iStore->RecordUidsL( uids );
+    
+    TBool found = EFalse;
+    
+    // newest record are on the top.
+	for (TInt i = uids.Count() -1; i >= 0; --i)
+	    {
+	    CDiagResultsDbTestRecordHandle* handle = 
+	                                iStore->OpenExistingHandleL( uids[i] );
+	    
+	    CleanupStack::PushL (handle);
+        
+        if( handle->RecordInfo().iRecordStatus != 
+                                 TDiagResultsDatabaseTestRecordInfo::ECompleted &&
+               !handle->RecordInfo().iCompleted )
+                                 
+            {
+            TPckgBuf<TUid> pckg( handle->RecordInfo().iRecordId ); 
+            aMessage.Write( 0, pckg );
+            found = ETrue;
+            CleanupStack::PopAndDestroy( handle );
+            break;
+            }     
+        
+        CleanupStack::PopAndDestroy( handle );
+	    }
+	
+    CleanupStack::PopAndDestroy( &uids );
+	 
+    if ( !found )
+        {
+        User::Leave ( KErrNotFound );
+        }  
+    }
+
+// ---------------------------------------------------------------------------
+// Service function. Retrieve all test record uids that there are.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::GetRecordListL( const RMessage2 &aMessage )
+    {    
+    ReadBufferL( aMessage, 0, iBuffer );
+   
+    RArray<TUid> uids; 
+    CleanupClosePushL( uids );
+    iStore->RecordUidsL( uids );
+    
+    RBufWriteStream stream ( *iBuffer );
+    CleanupClosePushL( stream );
+    stream.WriteInt16L( uids.Count() );
+    
+    for ( TInt i = 0; i < uids.Count(); ++i )
+        {    
+        stream.WriteInt32L( uids[i].iUid );  
+        }
+
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(0) )
+        {
+        User::Leave( KErrOverflow );
+        }
+    
+    aMessage.Write( 0, iBuffer->Ptr(0) ); //write to client's address space 
+   
+    CleanupStack::PopAndDestroy( &stream );
+    CleanupStack::PopAndDestroy( &uids );
+
+    }
+
+// ---------------------------------------------------------------------------
+// Service function. Return overviews of test records.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::GetRecordInfoListL( const RMessage2 &aMessage )
+    {
+    ReadBufferL( aMessage, 0, iBuffer );
+    
+    CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>* array = new (ELeave) 
+        CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>(KArrayGranuality);
+    CleanupStack::PushL (array);
+    
+    RArray<TUid> uids;
+    CleanupClosePushL ( uids );
+    iStore->RecordUidsL( uids );
+    
+	for (TInt i = 0; i < uids.Count(); ++i)
+	    {
+	    CDiagResultsDbTestRecordHandle* handle = 
+	                                iStore->OpenExistingHandleL( uids[i] );
+	    
+	    CleanupStack::PushL (handle);
+        array->AppendL( handle->RecordInfo() );
+        
+        CleanupStack::PopAndDestroy( handle );
+	    }
+	
+	CleanupStack::PopAndDestroy( &uids );
+	
+    TDiagResultsDbRecordInfoArrayPacked packedArray ( iBuffer );
+    packedArray.PackArrayL ( *array );
+    
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(0) )
+        {
+        User::Leave( KErrOverflow );
+        }
+	
+    aMessage.Write( 0, iBuffer->Ptr(0) ); //write to client's address space 
+   
+    CleanupStack::PopAndDestroy( array );
+    
+    }
+ 
+// ---------------------------------------------------------------------------
+// Helper function to read a buffer from client side. Leaves the buffer
+// onto cleanup stack IF it has to create a new one.
+// ---------------------------------------------------------------------------
+//    
+void CDiagResultsDbSession::ReadBufferL(const RMessage2& aMessage, TInt aParam, 
+                                                            CBufFlat*& aBuffer)
+	{
+	TInt desLen = aMessage.GetDesLengthL(aParam);
+
+	if(desLen >= 0)
+		{		
+		if (aBuffer==NULL)
+			{
+			aBuffer = CBufFlat::NewL(KArrayGranuality);
+			aBuffer->ResizeL(desLen);
+			CleanupStack::PushL(aBuffer);
+			}
+		else if (desLen > aBuffer->Ptr(0).MaxLength())
+			{
+			iBuffer->Delete( 0, iBuffer->Size() ); // delete old data.
+			// we have to increase the size of aBuffer	
+			aBuffer->ResizeL(desLen);		
+			}
+
+		TPtr8 desPtr = aBuffer->Ptr(0);
+		aMessage.ReadL(aParam, desPtr);
+
+		}
+	else
+		{
+		// desLen is negative leave with an error.
+		User::Leave(KErrArgument);
+		}
+	}   
+
+// ---------------------------------------------------------------------------
+// Store observer method. This is called after store has retrieved
+// test records from the DB file.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::ExistingRecordsL( TInt aError, 
+                            RPointerArray<CDiagResultsDbTestRecord>* aArray )
+    {
+    CleanupStack::PushL ( aArray );
+    CleanupResetAndDestroyClosePushL( *aArray );
+
+    //Check if there were any errors during loading the test records.
+    if ( aError != KErrNone )
+        {
+        
+        if ( iLastResultCommand == 
+             DiagResultsDbCommon::EInitiateGetLastResults )
+            {
+            iLastResultsMsg.Complete ( aError );            
+            }
+        else if ( iLastResultCommand == 
+                  DiagResultsDbCommon::EInitiateGetSingleLastResult  )
+            {
+            iLastSingleResultsMsg.Complete ( aError );
+            }        
+        
+        CleanupStack::PopAndDestroy( aArray );
+        CleanupStack::PopAndDestroy( aArray ); //delete the pointer  
+        return;
+        }
+        	
+	switch( iLastResultCommand )
+        {
+	
+	//Find multiple last results
+	//buffer contains the uids to be searched.
+	//See RDiagResultsDatabase::InitiateGetLastResults.
+	case DiagResultsDbCommon::EInitiateGetLastResults:
+	    {
+        //Trap is needed so that we can complete client's request
+        //if any errors occur.
+        TRAPD(error, FindLastResultsL( *aArray ));	        
+	        	    
+	    if ( error != KErrNone )
+	        {	        
+	        iLastResultsMsg.Complete (error);	        
+	        break;
+	        }
+	    else 
+	        {
+	        iLastResultsMsg.Complete (KErrNone);    
+	        }
+	    	    	  
+	    break;
+	    }
+	    
+	  // Find single test result  
+	  // see RDiagResultsDatabase::InitiateGetLastResult.
+     case DiagResultsDbCommon::EInitiateGetSingleLastResult:
+        {        
+        TPckgBuf<TUid> uidpckg;
+	    iLastSingleResultsMsg.Read(0, uidpckg);
+        TUid resultsItemUid = uidpckg();
+                 	    	            
+        CDiagResultsDatabaseItem* item = NULL;
+        
+        // Trap any errors and complete client's request if there
+        // are any errors.
+        TRAPD(error, item = FindDatabaseItemL( resultsItemUid, aArray)) ;	                            	                           
+
+        if ( error != KErrNone )
+            {
+            delete item;
+            item = NULL;
+            
+            iLastSingleResultsMsg.Complete (error);
+            break;
+            }
+	        
+	    if ( item == NULL ) //Not found
+	        {
+	        iBufferedSingleResult = NULL;
+	        
+	        //Check also the last results buffer  
+	        CheckLastResultsBufferL( resultsItemUid, iBufferedSingleResult );
+	        }
+	    else 
+	        {	                	                
+	        iBufferedSingleResult = item;
+	        }          
+	       
+	   
+	       
+	    iLastSingleResultsMsg.Complete (KErrNone);
+	    break;
+        }  
+	  
+	  default:
+	    {
+	    User::Panic ( _L("Diag results DB"), 
+	                  DiagResultsDbCommon::EUnknownLastResultState );
+	    }	    	    
+      }
+    
+    iLastResultCommand = 0;  
+      
+    CleanupStack::PopAndDestroy( aArray ); //call reset and destroy + close
+    CleanupStack::PopAndDestroy( aArray ); //delete the pointer
+    }
+
+
+// ---------------------------------------------------------------------------
+// Read UIDs from a stream and search last results.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::FindLastResultsL( 
+                            RPointerArray<CDiagResultsDbTestRecord>& aArray )
+    {
+    
+	CArrayFixFlat<TUid>* uidArray = new (ELeave) 
+	                                    CArrayFixFlat<TUid>(KArrayGranuality);
+	CleanupStack::PushL( uidArray );
+	     
+    RBufReadStream stream( *iBuffer );
+    CleanupClosePushL ( stream );
+        
+    TInt8 count = stream.ReadInt8L();
+        
+    for ( TInt i = 0; i < count; ++i )
+        {
+        TInt32 uid = stream.ReadInt32L();
+            
+        uidArray->AppendL( TUid::Uid( uid ));
+        }
+	    
+    CleanupStack::PopAndDestroy( &stream );	 
+	    	    
+	iBufferedLastResults = new (ELeave) RPointerArray<CDiagResultsDatabaseItem>;
+	    	    
+	SearchLastResultsL( *uidArray, aArray, *iBufferedLastResults  );
+	
+	//last results could be also in the last results buffer.
+	CheckLastResultsBufferL( *uidArray, *iBufferedLastResults );
+	    
+	  // there must be exactly the same number of cells in both arrays. 
+	if ( uidArray->Count() != iBufferedLastResults->Count() ) 
+	    {
+	    User::Panic ( _L("Diag results DB"), 
+	                  DiagResultsDbCommon::EGetLastResultsMismatch );
+	    }
+	    
+	CleanupStack::PopAndDestroy( uidArray );   
+    }
+
+
+// ---------------------------------------------------------------------------
+// Check last result buffer for test results.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::CheckLastResultsBufferL( 
+                         const CArrayFixFlat<TUid>& aUidArray,                           
+                         RPointerArray<CDiagResultsDatabaseItem>& aResultsArray )
+    {        
+    CDiagResultsDbTestRecord* buffer = iStore->OpenExistingLastResultsBufferL(); 
+    CleanupStack::PushL( buffer );
+    
+    for (TInt i = 0; i < aResultsArray.Count(); ++i)
+        {        
+        if ( aResultsArray[i] == NULL )
+            {
+            TUid uid = aUidArray[i];
+            
+            CDiagResultsDatabaseItem* item = buffer->FindTestRecord( uid );
+            
+            if ( item )
+                {
+                buffer->RemoveL( uid );
+                aResultsArray[i] = item;
+                }            
+            }        
+        }
+    
+    CleanupStack::PopAndDestroy( buffer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Check last result buffer for test result.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::CheckLastResultsBufferL( 
+                         TUid aTestUid,                           
+                         CDiagResultsDatabaseItem*& aResult )
+    {
+    
+    
+    CDiagResultsDbTestRecord* buffer = iStore->OpenExistingLastResultsBufferL(); 
+    CleanupStack::PushL( buffer );
+ 
+    CDiagResultsDatabaseItem* item = buffer->FindTestRecord( aTestUid );
+            
+    if ( item )
+        {
+        buffer->RemoveL( aTestUid );
+        aResult = item;                                                
+        }
+    
+    CleanupStack::PopAndDestroy( buffer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Searches for the newest test results.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbSession::SearchLastResultsL( 
+                         const CArrayFixFlat<TUid>& aUidArray, 
+                         RPointerArray<CDiagResultsDbTestRecord>& aTestRecordArray, 
+                         RPointerArray<CDiagResultsDatabaseItem>& aResultsArray )
+            
+    {   
+    //Search all records for certain uid.
+	for ( TInt i = 0; i < aUidArray.Count(); ++i )
+	    {
+	      
+	    CDiagResultsDatabaseItem* item = 
+	                            FindDatabaseItemL( aUidArray[i], &aTestRecordArray );	                            	                           
+	        
+	    if ( item == NULL ) //Not found
+	        {
+	        aResultsArray.Append(NULL);
+	        }
+	     else 
+	        {	                	                
+	        aResultsArray.Append( item );
+	        }          
+	    }
+    }
+	     
+
+// ---------------------------------------------------------------------------
+// Indicates has session written any data into the DB file. 
+// To be exact only subsession writes data into the file.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbSession::HasWritten()
+    {
+    iHasWrittenData = ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// Turn off compacting.
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbSession::DoNotCompact()
+    {
+    iHasWrittenData = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Helper function to seach an item from a pointer array.
+// Starts from the newest record to search for an UID.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDatabaseItem* CDiagResultsDbSession::FindDatabaseItemL( TUid aUid, 
+                             RPointerArray<CDiagResultsDbTestRecord>* aArray )    
+    {
+    
+    //Check that there is a test record.
+    if ( !aArray || aArray->Count() == 0 )
+        {
+        return NULL;
+        }
+    
+    // start from the newest record
+    for (TInt x = aArray->Count() -1; x >= 0 ; --x ) 
+	    {
+	    CDiagResultsDbTestRecord* record = (*aArray)[x];
+	    
+	    //Assumes that there is only MAX one specific UID in the test record.        
+	    for ( TInt y = 0; y < record->Count(); ++y )
+	        {
+	        CDiagResultsDatabaseItem* item = record->GetItem( y );
+	                 
+             //	 Search for a test result that is not skipped / cancelled.                 
+	         if (  item->TestUid() == aUid && 
+	              (item->TestResult() == CDiagResultsDatabaseItem::ESuccess ||
+	               item->TestResult() == CDiagResultsDatabaseItem::EFailed ))
+	            {
+	            //Remove the found item to speed up look up times.
+	            //This does not remove it from the DB file.
+	            record->RemoveL( y ); 
+	            return item;
+	            }
+	        }     
+	    }
+	     
+	return NULL;  
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbstore.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1267 @@
+/*
+* Copyright (c) 2007 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:  Class definition of 
+*
+*/
+
+#include <s32std.h>
+#include <sysutil.h> 
+#include <f32file.h> 
+#include <centralrepository.h>
+
+#include "diagresultsdbtestrecord.h"
+#include "diagresultsdbstore.h"
+#include "diagresultsdatabasecommon.h"
+#include "diagresultsdbcrdc.h"
+#include "diagresultsdatabase.h"
+#include "diagresultsdbtestrecordhandle.h"
+#include "diagresultsdbrecordengineparam.h"
+#include "diagresultsdbprivatecrkeys.h"
+
+_LIT( KFileType, ".dat" );
+_LIT( KDriveC, "C:" );
+
+const TInt KMininumDiskSpace = 500;
+
+const TInt KFirstStreamId = 2;
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbStore::CDiagResultsDbStore( TUid aDbUid ): 
+        CActive( CActive::EPriorityStandard ), iStore( NULL ), 
+        iDbUid( aDbUid ), iLoadingObserver( NULL ), iCompletionObserver( NULL ),
+        iRecordArray( NULL ), iRecordIds(NULL), iRecordNumber(0), 
+        iTestRecord( NULL ), iState( ENotRunning )
+	{
+	CActiveScheduler::Add(this);
+	}
+
+// ---------------------------------------------------------------------------
+// NewL. Creates a DB file based on aDbUid if it does not exist.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbStore* CDiagResultsDbStore::NewL( TUid aDbUid )
+	{
+	LOGME("CDiagResultsDbStore* CDiagResultsDbStore::NewL");
+	CDiagResultsDbStore* store = new (ELeave) CDiagResultsDbStore( aDbUid );
+	CleanupStack::PushL( store );
+	store->ConstructL();
+	CleanupStack::Pop();
+	return store;
+	}
+
+// ---------------------------------------------------------------------------
+// NewLC.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbStore* CDiagResultsDbStore::NewLC( TUid aDbUid )
+	{
+	LOGME("CDiagResultsDbStore::NewLC");
+	CDiagResultsDbStore* store = new (ELeave) CDiagResultsDbStore( aDbUid );
+	CleanupStack::PushL( store );
+	store->ConstructL();
+	return store;
+	}	
+
+// ---------------------------------------------------------------------------
+// Starts asynchronous loading of all test records from the DB.
+// Observer is notified when test records have been loaded.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::ExistingRecordsAsyncL( MRecordLoadingObserver& aObserver )
+    {
+    if ( IsActive() )
+        {
+        User::Leave( KErrInUse );
+        }
+    
+    iLoadingObserver = &aObserver;
+    
+    iState = EGetRootStream;
+    iRecordNumber = 0;
+    
+    CompleteOwnRequest();
+    
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// Cancel asynchronous functionality. Do not call this directly (use Cancel())
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::DoCancel()
+    {
+    if ( iRecordArray )
+        {
+        iRecordArray->ResetAndDestroy(); 
+           
+        delete iRecordArray;
+        iRecordArray = NULL;   
+        }
+              
+    //Note that Store is not responsible for deleting the iTestRecord.
+    //iTestRecord is deleted by subsession.
+            
+    delete iRecordIds;
+    iRecordIds = NULL;
+    
+    iState = ENotRunning;
+    iRecordNumber = 0;
+    }
+
+// ---------------------------------------------------------------------------
+// This is called if there are leaves or errors in RunL.
+// ---------------------------------------------------------------------------
+// 
+TInt CDiagResultsDbStore::RunError(TInt aError)
+    {
+    TInt err = KErrNone;
+
+    switch ( iState )
+    	{
+        case EGetRootStream:
+        case EGetRecord:            
+        case ERecordsReady:
+            {
+            TRAP( err, iLoadingObserver->ExistingRecordsL( aError, NULL ) );
+            }
+        break;
+        default:
+        	{
+        	///@@@KSR: changes for Codescanner error val = High 
+        	//User::Leave( aError );
+        	}
+    	}
+
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Keeps the database file small as possible. Compacting must be done often as
+// possible keeping in mind that compacting could take a long time.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::CompactDatabase()
+    {    
+    TRAPD( error, iStore->CompactL());
+    
+    if ( error != KErrNone )
+        {
+        User::Panic(_L("compact error"), 
+            DiagResultsDbCommon::EDatabaseCompact );
+        }    
+    else 
+        {
+        //Commit must be called in order to really reduce the size of DB file.
+        TRAP( error, iStore->CommitL() ); 
+        if ( error != KErrNone )
+           {
+           User::Panic(_L("compact/commit error"), 
+           DiagResultsDbCommon::EDatabaseCompactCommit );
+           }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Completes own request. This changes the value of TRequestStatus and causes
+// RunL to be called afterwards (if CActive is active).
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::CompleteOwnRequest()
+    {
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// Asynchronous handling function. States are needed to separate two different
+// tasks. The first one is loading test records from the db file. The second
+// is writing a test record into the DB file.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbStore::RunL()
+    {
+    
+    switch ( iState )
+        {
+        case EGetRootStream:
+            {
+            iRecordArray = new (ELeave) RPointerArray<CDiagResultsDbTestRecord>;
+            iRecordIds = new (ELeave) RArray<TStreamId>;
+            // Find available stream ids
+            ReadRootStreamL( *iRecordIds );
+                                   
+            if ( iRecordIds->Count() == 0 ) //no records, no need to continue
+                {
+                 //Ownership is transferred
+                iLoadingObserver->ExistingRecordsL( KErrNone, iRecordArray );
+                iRecordArray = NULL; //do not delete
+            
+                iRecordIds->Close();
+                delete iRecordIds;
+                iRecordIds = NULL;
+    
+                iState = ENotRunning;
+                iRecordNumber = 0;   
+            
+                iLoadingObserver = NULL;
+                return;
+                }
+            
+            iState = EGetRecord;
+            
+            CompleteOwnRequest();
+            SetActive();
+            }
+            break;
+            
+        case EGetRecord:
+            {            
+            iRecordArray->Append ( OpenExistingRecordL( 
+                            TUid::Uid( (*iRecordIds)[iRecordNumber].Value()), ETrue ) );
+            iRecordNumber++;
+            if ( iRecordNumber < iRecordIds->Count() )
+                {
+                iState = EGetRecord;
+                }
+            else 
+                {
+                iState = ERecordsReady;
+                }
+            
+            CompleteOwnRequest();
+            SetActive();
+            }
+            break;
+            
+        case ERecordsReady:
+            {
+             //Ownership is transferred
+            iLoadingObserver->ExistingRecordsL( KErrNone, iRecordArray );
+            iRecordArray = NULL; //do not delete
+            
+            iRecordIds->Close();
+            delete iRecordIds;
+            iRecordIds = NULL;
+    
+            iState = ENotRunning;
+            iRecordNumber = 0;   
+            
+            iLoadingObserver = NULL;
+            }
+            break;
+  
+        
+        default:
+            User::Leave( KErrNotFound );
+            break;
+            
+        }
+        
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the store. Creates the DB file if it does not exist or opens it. 
+// Also creates an empty root stream into the store if file was created.
+// There is some exception handling included for example if file exist but it
+// cannot be opened.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::ConstructL()
+	{	
+	LOGME("CDiagResultsDbStore::ConstructL");		
+	//Read from central repository.
+	TInt algorithm = GetDeletionAlgorithmL();
+	
+	if ( algorithm == 0 )
+		{
+		iDeletionAlgorithm = EMaxRecordCountAlgorithm;
+		}
+	else if ( algorithm == 1 )
+		{
+		iDeletionAlgorithm = ELastResultsAlgorithm;
+		}
+	else 
+		{
+		User::Panic( _L("Unknown Deletion Algorithm"), 
+                DiagResultsDbCommon::EUnknownDeletionAlgorithm);  
+		}
+	
+	LOGME("resultdbstore::Before irfs.connect");
+    User::LeaveIfError(iRfs.Connect());
+    LOGME("iRfs.connect");
+    TBool tooLowSpace = SysUtil::DiskSpaceBelowCriticalLevelL( 
+                                                    &iRfs, 
+                                                    KMininumDiskSpace, 
+                                                    EDriveC );
+    LOGME1("tooLowSpace %d",tooLowSpace);
+    if ( tooLowSpace )        
+        {
+        User::Leave( KErrDiskFull );
+        }
+    
+    TInt err = iRfs.CreatePrivatePath( EDriveC );
+    
+    LOGME1("privatepathcreate %d",err);
+    //Create private path if it does not exists
+    if ( err != KErrAlreadyExists && err != KErrNone )
+        {
+        User::Leave ( err ); //Unexpected error
+        }
+    
+    TBuf<256> filename;
+    iRfs.PrivatePath( filename );
+    filename.Insert( 0, KDriveC );
+    filename.Append( iDbUid.Name() );
+    filename.Append( KFileType );
+
+    //Check is the File already there
+    //open for reading and writing.
+    err = iFile.Open( iRfs, filename, EFileShareAny|EFileWrite );  
+
+    LOGME1("ifile.open %d",err);
+    TInt fileError = KErrNotFound;
+    TInt fileSize = 0;
+
+    if ( err == KErrNone )
+        {        
+        fileError = iFile.Size( fileSize );    
+        }
+    
+    
+    //Checking is done when the file exists. 
+    //File size reading error should never happen.
+    //if the file is too large, the function will panic.
+    if ( err == KErrNone && fileError == KErrNone )
+    	{
+    	CheckMaximumFileSizeLimitL( iRfs, filename, fileSize ); 
+    	}
+    
+    iFile.Close();
+    
+    // File exist
+    if ( err == KErrNone )
+        {                           
+        TRAPD( err, iStore = CPermanentFileStore::OpenL(iRfs, filename, 
+                        EFileShareAny|EFileWrite|EFileRead|EFileStream ));
+        
+        if ( err != KErrNone )
+            {           
+            err = iRfs.Delete ( filename );
+            
+            if ( err != KErrNone )
+                {
+                User::Panic( _L("DiagServer corrupt file delete failed"), 
+                        DiagResultsDbCommon::EServerCorruptFileDelete);
+                }
+                
+            User::Leave( KErrCorrupt );
+            }
+            
+        //This must be called, otherwise RStoreWriteStream write will fail.
+        iStore->SetTypeL( iStore->Layout() );
+        }
+       
+    else if ( err == KErrNotFound ) //Create new file  if the file is not found
+        {
+        LOGME("createnewfile");
+        TRAPD( err, iStore = CPermanentFileStore::CreateL(iRfs, filename, 
+                        EFileShareAny|EFileWrite|EFileRead|EFileStream ));
+        
+        LOGME1("createnewfile = %d",err);
+        if ( err != KErrNone ) //File could not be created for some reason
+            { 
+             LOGME1("createnewfile panic = %d",err);
+            User::Panic( _L("DiagServer unable to create DB file"), 
+                            DiagResultsDbCommon::EServerFileCreationError);          
+            }
+            
+        //This must be called, otherwise RStoreWriteStream write will fail.
+        iStore->SetTypeL( iStore->Layout() );
+        CreateEmptyRootStreamL( *iStore );
+        
+        if ( iDeletionAlgorithm == ELastResultsAlgorithm )
+        	{
+        	CreateLastResultsBufferStreamL();
+        	}
+        
+        iStore->CommitL();
+     
+        }
+    else 
+        {
+        LOGME1("else userleave = %d",err);
+        User::Leave( err );
+        }
+	}
+
+
+// ---------------------------------------------------------------------------
+// Get central repository key that controls maximum file size.
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultsDbStore::GetMaximumFileSizeL()
+	{
+	CRepository* cr = CRepository::NewLC( KCRUidDiagnosticsResults );
+
+	TInt result = 0;	
+	TInt error = cr->Get( KDiagDatabaseMaxFileSize, result );
+	
+	CleanupStack::PopAndDestroy();
+	
+	if ( error != KErrNone )
+		{
+		User::Leave(error);
+		}
+	return result;
+	}
+
+
+// ---------------------------------------------------------------------------
+// Get central repository key that controls usage of the deletion algorithm.
+// ---------------------------------------------------------------------------
+//
+TInt CDiagResultsDbStore::GetDeletionAlgorithmL()
+	{
+	CRepository* cr = CRepository::NewLC( KCRUidDiagnosticsResults );
+
+	TInt result = 0;	
+	TInt error = cr->Get( KDiagDatabaseDeletionAlgorithm, result );
+	
+	CleanupStack::PopAndDestroy();
+	
+	if ( error != KErrNone )
+		{
+		User::Leave(error);
+		}
+	return result;
+	}
+
+
+// ---------------------------------------------------------------------------
+// Check DB file size and delete the file if it is too big.
+// Checking is controlled by a central repository key.
+//
+// Note that this function deletes the file and after that panics, because
+// the error is very serious. 
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDbStore::CheckMaximumFileSizeLimitL( RFs& aRfs, 
+													  const TDesC& aFileName,
+													  TInt aFileSize )
+	{
+	//Read central repository value
+	TInt maxFileSize = GetMaximumFileSizeL();
+	
+	//If == 0, feature is disabled i.e. there is no limitation
+	//to the size of DB files.
+	if ( maxFileSize == 0 )
+		{
+		return;		
+		}
+	else
+		{
+		if ( aFileSize > maxFileSize )
+			{
+			//Delete the file. 
+			aRfs.Delete( aFileName );		
+			User::Panic(_L("Maxfile Size exceeded"), 
+			            DiagResultsDbCommon::EMaximumFileSizeExceeded );
+			}
+		}	
+	}
+
+// ---------------------------------------------------------------------------
+// Create a stream for last results.
+// The stream is created when DB file is created.
+// 
+// Because this is the first stream in the PermanentFileStore,
+// we do not need to store the stream ID anywhere. Consider it as a constant.
+// ---------------------------------------------------------------------------
+//
+void CDiagResultsDbStore::CreateLastResultsBufferStreamL()
+    {        
+    RArray<TUid>* uids = new (ELeave) RArray<TUid>;
+    
+    CDiagResultsDbRecordEngineParam* params = 
+        CDiagResultsDbRecordEngineParam::NewL( uids, EFalse );
+    CleanupStack::PushL( params );
+                
+    TStreamId id = iStore->ExtendL();
+    
+    //We assume that the permanent file store uses this as the first stream ID.
+    __ASSERT_ALWAYS( id == TStreamId( KFirstStreamId ), 
+                        User::Panic( _L("DiagServer Incorrect Last Results Buffer"), 
+                        DiagResultsDbCommon::EIncorrectExtendNumberForLastResults)  );
+
+    CleanupStack::Pop();
+      
+    CDiagResultsDbTestRecordHandle* handle = CDiagResultsDbTestRecordHandle::NewL( 
+                                                    id, 
+                                                    iDbUid, 
+                                                    params );
+                                                    
+    CleanupStack::PushL( handle );
+    
+    WriteHandleIntoDbL( *handle ); //writes a new stream
+         
+    //Do not append on to the root stream!!
+    //this should be visible only for the server.                  
+    
+    CleanupStack::PopAndDestroy();                                
+        
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+// 	
+CDiagResultsDbStore::~CDiagResultsDbStore()
+	{
+	if ( iRecordIds )
+	    {
+	    iRecordIds->Close();
+	    delete iRecordIds;
+        iRecordIds = NULL;    
+	    }
+
+    Cancel();
+        
+    delete iStore;
+    iStore = NULL;
+    
+    iFile.Close();
+    iRfs.Close();
+	}
+
+// ---------------------------------------------------------------------------
+// Create a new record. 
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle* CDiagResultsDbStore::CreateNewRecordL( 
+                                CDiagResultsDbRecordEngineParam* aEngineParam )
+    {
+    
+    TBool tooLowSpace = SysUtil::DiskSpaceBelowCriticalLevelL( 
+                                                    &iRfs, 
+                                                    KMininumDiskSpace, 
+                                                    EDriveC );
+    if ( tooLowSpace )        
+        {
+        User::Leave( KErrDiskFull );
+        }
+    
+    
+    
+    TStreamId id = iStore->ExtendL();
+  
+    CDiagResultsDbTestRecordHandle* handle = CDiagResultsDbTestRecordHandle::NewL( 
+                                                    id, 
+                                                    iDbUid, 
+                                                    aEngineParam );
+    CleanupStack::PushL( handle );
+    
+    WriteHandleIntoDbL( *handle ); //writes a new stream
+    
+    AppendRootStreamL( id ); //update root stream
+    
+    iStore->CommitL(); 
+    
+    CleanupStack::Pop();                                
+    return handle;
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Write test record handle into the store.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::WriteHandleIntoDbL( CDiagResultsDbTestRecordHandle& aHandle )
+    {
+    RStoreWriteStream writestream;
+    
+    writestream.ReplaceLC( *iStore, aHandle.RecordId() );    
+        
+    aHandle.ExternalizeL( writestream );
+    
+    writestream.CommitL();
+       
+    CleanupStack::PopAndDestroy( &writestream );
+    }
+
+// ---------------------------------------------------------------------------
+// Writes data into the DB file (.dat file). 
+// ---------------------------------------------------------------------------
+//     
+TInt CDiagResultsDbStore::CompleteTestResult( TBool aCommit, 
+                                    CDiagResultsDbTestRecordHandle& aHandle,  
+                                    CDiagResultsDatabaseItem& aTestItem )
+    {        
+    TRAPD( err, DoCompleteTestResultL( aCommit, aHandle, aTestItem ));
+    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Writes handle into the DB. Test results items have been written already.
+// see CompleteTestResult.
+// ---------------------------------------------------------------------------
+// 
+TInt CDiagResultsDbStore::CompleteRecord(  
+                                CDiagResultsDbTestRecordHandle& aHandle )
+    {
+    // ignore DRM error.
+    TRAP_IGNORE( aHandle.RecordInfo().iDrmFinishTime = 
+        TDiagResultsDatabaseTestRecordInfo::DRMTimeL() );
+
+    aHandle.RecordInfo().iFinishTime.HomeTime();
+    
+    TRAPD( error, DoCompleteRecordL( aHandle ));
+    
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// Writes handle into the DB. Test results items have been written already.
+// see CompleteTestResult.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::DoCompleteRecordL(  
+                                CDiagResultsDbTestRecordHandle& aHandle )
+    {
+    
+    TBool tooLowSpace = SysUtil::DiskSpaceBelowCriticalLevelL( 
+                                                    &iRfs, 
+                                                    KMininumDiskSpace, 
+                                                    EDriveC );
+    if ( tooLowSpace )        
+        {
+        User::Leave( KErrDiskFull );
+        }
+    
+    WriteHandleIntoDbL( aHandle );
+    
+    iStore->CommitL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Write aTestItem and aHandle into the DB. These must be in sync.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbStore::DoCompleteTestResultL( TBool aCommit, 
+                                        CDiagResultsDbTestRecordHandle& aHandle, 
+                                        CDiagResultsDatabaseItem& aTestItem )
+    {   
+    
+    TBool tooLowSpace = SysUtil::DiskSpaceBelowCriticalLevelL( 
+                                                    &iRfs, 
+                                                    aTestItem.Size() *2, 
+                                                    EDriveC );
+    if ( tooLowSpace )        
+        {
+        User::Leave( KErrDiskFull );
+        }
+    
+    RStoreWriteStream writestream;
+    
+    CDiagResultsDbTestRecordHandle::TTestResultHandle testresulthandle;
+    
+    TBool found = aHandle.Find( aTestItem.TestUid() );
+    
+    
+    if ( found ) //Replace old test result
+        {
+        TStreamId id;
+        TInt error = aHandle.MatchingStreamId( aTestItem.TestUid(), id);
+        User::LeaveIfError ( error );
+        writestream.ReplaceLC( *iStore, id );
+        }
+    else //New test result
+        {
+        TStreamId newstreamid = writestream.CreateLC( *iStore );   
+        testresulthandle.iStreamId = newstreamid;
+        testresulthandle.iTestUid = aTestItem.TestUid();
+        }
+
+    aTestItem.ExternalizeL( writestream );
+    writestream.CommitL();
+    CleanupStack::PopAndDestroy( &writestream );
+  
+    if ( !found )
+        {
+        aHandle.AddL( testresulthandle );
+        }
+    
+    WriteHandleIntoDbL( aHandle );
+    
+    if ( aCommit )
+        {
+        iStore->CommitL();       
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// Read a test record from the DB. The record should not be ever written into
+// the same DB again. First read the number of items there are in the record.
+// After that read the items and the record info. 
+// ---------------------------------------------------------------------------
+//     
+CDiagResultsDbTestRecord* CDiagResultsDbStore::OpenExistingRecordL( TUid aUid, 
+                                                            TBool aReadOnly )
+    {    
+    TStreamId id = TStreamId ( aUid.iUid );
+    
+    RStoreReadStream handlereadstream;
+    handlereadstream.OpenLC( *iStore, id );
+    
+    CDiagResultsDbTestRecord* testrecord = CDiagResultsDbTestRecord::NewL( aReadOnly, 
+	                                       aUid );
+    CleanupStack::PushL ( testrecord );
+    
+    CDiagResultsDbTestRecordHandle* handle = 
+                            CDiagResultsDbTestRecordHandle::NewL( handlereadstream );
+                                                       
+    CleanupStack::PushL ( handle );
+    
+    for ( TInt i = 0; i < handle->Count(); ++i )
+        {
+        RStoreReadStream readstream;
+        readstream.OpenLC( *iStore, ((*handle)[i]) ); 
+                
+        testrecord->AddL( CDiagResultsDatabaseItem::NewL ( readstream ) );
+        
+        CleanupStack::PopAndDestroy( &readstream );  
+        }
+
+    CleanupStack::PopAndDestroy(); //handle
+    CleanupStack::Pop(); //testrecord
+    
+    CleanupStack::PopAndDestroy( &handlereadstream ); 
+    
+    return testrecord;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Open last results buffer. It contains the test results that would have
+// been otherwise deleted. 
+// ---------------------------------------------------------------------------
+//   
+CDiagResultsDbTestRecord* CDiagResultsDbStore::OpenExistingLastResultsBufferL()
+    {      
+    CDiagResultsDbTestRecord* testrecord = 
+                            OpenExistingRecordL( TUid::Uid(KFirstStreamId),
+                                                 ETrue );                                                                                                                                       
+    return testrecord;
+    }
+
+
+void CDiagResultsDbStore::OpenExistingRecordAndHandleL( TStreamId aId, 
+                                                        CDiagResultsDbTestRecord*& aRecord,
+                                                        CDiagResultsDbTestRecordHandle*& aHandle )
+    {            
+    RStoreReadStream handlereadstream;
+    handlereadstream.OpenLC( *iStore, aId );
+    
+    CDiagResultsDbTestRecord* testrecord = CDiagResultsDbTestRecord::NewL( ETrue, 
+	                                       TUid::Uid( aId.Value() ));
+    CleanupStack::PushL ( testrecord );
+    
+    CDiagResultsDbTestRecordHandle* handle = 
+                            CDiagResultsDbTestRecordHandle::NewL( handlereadstream );
+                                                       
+    CleanupStack::PushL ( handle );
+    
+    for ( TInt i = 0; i < handle->Count(); ++i )
+        {
+        RStoreReadStream readstream;
+        readstream.OpenLC( *iStore, ((*handle)[i]) ); 
+                
+        testrecord->AddL( CDiagResultsDatabaseItem::NewL ( readstream ) );
+        
+        CleanupStack::PopAndDestroy( &readstream );  
+        }
+
+    CleanupStack::Pop(); //handle
+    CleanupStack::Pop(); //testrecord
+    
+    aRecord = testrecord;
+    aHandle = handle;
+    
+    CleanupStack::PopAndDestroy( &handlereadstream ); 
+    
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Retrieve all record infos from the store.
+// ---------------------------------------------------------------------------
+// 
+RArray<TDiagResultsDatabaseTestRecordInfo>* CDiagResultsDbStore::ExistingRecordInfosL()
+    {
+    RArray<TStreamId> ids;
+    CleanupClosePushL( ids );
+    // Find available stream ids
+    ReadRootStreamL( ids );
+    
+    RArray<TDiagResultsDatabaseTestRecordInfo>* infos = new (ELeave) 
+                                            RArray<TDiagResultsDatabaseTestRecordInfo>;
+    CleanupClosePushL( *infos );                                            
+    
+    
+    for ( TInt i = 0; i < ids.Count(); ++i )
+        {
+        CDiagResultsDbTestRecordHandle* handle = OpenExistingHandleL( TUid::Uid( ids[i].Value() ));
+      
+        TDiagResultsDatabaseTestRecordInfo info = handle->RecordInfo();
+        
+        infos->Append( info );
+        }  
+        
+    CleanupStack::PopAndDestroy( &ids );
+    CleanupStack::Pop();
+    
+    return infos;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Open a test result from the DB.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDatabaseItem* CDiagResultsDbStore::OpenExistingTestResultL( TStreamId aId )
+    {
+    RStoreReadStream readstream;
+    readstream.OpenLC( *iStore, aId ); 
+    
+    CDiagResultsDatabaseItem* item = CDiagResultsDatabaseItem::NewL ( readstream );
+    
+    CleanupStack::PopAndDestroy( &readstream );
+    
+    return item;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Open handle from the DB. Uid matches the handle's stream Id.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle* CDiagResultsDbStore::OpenExistingHandleL( 
+                                                    TUid aUid )
+    {
+    TStreamId id = TStreamId ( aUid.iUid );
+    
+    RStoreReadStream handlereadstream;
+    handlereadstream.OpenLC( *iStore, id );
+    
+    
+    CDiagResultsDbTestRecordHandle* handle = 
+                            CDiagResultsDbTestRecordHandle::NewL( handlereadstream );
+                            
+    CleanupStack::PopAndDestroy( &handlereadstream );                           
+    
+    return handle;   
+    }
+    
+// ---------------------------------------------------------------------------
+// Cleanup Database if there are two many test records.    
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::CleanUpDatabaseL(TBool aCommit)
+	{
+	if ( iDeletionAlgorithm == EMaxRecordCountAlgorithm )
+		{
+		CleanUpDatabaseNoLastResultsL( aCommit );
+		}
+	else if ( iDeletionAlgorithm == ELastResultsAlgorithm )
+		{
+		CleanUpDatabaseUseLastResultsBufferL( aCommit );
+		}
+	else 
+		{
+		User::Panic( _L("Unknown Deletion Algorithm"), 
+                DiagResultsDbCommon::EUnknownDeletionAlgorithm);  
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// Cleanup Database if there are two many test records.    
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::CleanUpDatabaseNoLastResultsL(TBool aCommit)
+    {    
+    RArray<TStreamId> ids;
+    CleanupClosePushL( ids );
+    ReadRootStreamL( ids );
+    
+    //Fetch the maximum number of test records from Central Repository. Panic if
+    //the value is not found. Also panic if value is less than zero.
+    TInt maxsize = 0;
+    TInt err = RDiagResultsDatabase::GetDatabaseMaximumSize( maxsize ) ;
+    
+    if ( err != KErrNone || maxsize < 0 )
+        {
+        User::Panic ( _L("Diag ResultsDB panic"), 
+                    DiagResultsDbCommon::ECentralRepositoryFailure );
+        }
+            
+    TBool cleanedUp = EFalse;   
+        
+    while ( ids.Count() > maxsize ) //Do cleanup
+        {                
+        DeleteOldestHandleL( ids );
+                   
+        cleanedUp = ETrue;
+        }
+      
+    if ( cleanedUp && aCommit )
+        {
+        iStore->CommitL();       
+        }      
+      
+    CleanupStack::PopAndDestroy( &ids );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cleanup Database if there are two many test records.    
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::CleanUpDatabaseUseLastResultsBufferL(TBool aCommit)
+    {    
+    RArray<TStreamId> ids;
+    CleanupClosePushL( ids );
+    ReadRootStreamL( ids );
+
+    //Fetch the maximum number of test records from Central Repository. Panic if
+    //the value is not found. Also panic if value is less than zero.
+    TInt maxsize = 0;
+    TInt err = RDiagResultsDatabase::GetDatabaseMaximumSize( maxsize ) ;
+    
+    if ( err != KErrNone || maxsize < 0 )
+        {
+        User::Panic ( _L("Diag ResultsDB panic"), 
+                    DiagResultsDbCommon::ECentralRepositoryFailure );
+        }
+            
+    TBool cleanedUp = EFalse;   
+        
+    while ( ids.Count() > maxsize ) //Do cleanup
+        {                     
+        TInt count = ids.Count();
+                   
+        ///@@@KSR: changes for Codescanner error val = High 
+        //CheckOverflowingTestResults( ids );
+        CheckOverflowingTestResultsL( ids );
+                                  
+        cleanedUp = ETrue;
+        
+        __ASSERT_ALWAYS( ids.Count() == count - 1, User::Panic( _L("Diag ResultsDB panic"), 
+                    DiagResultsDbCommon::EUnableToDelete ) );
+        }
+    
+    if ( cleanedUp && aCommit )
+        {
+        iStore->CommitL();       
+        }      
+      
+    CleanupStack::PopAndDestroy( &ids );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Load last results buffer and add test results if needed.
+// 
+// Test results are only moved to the last results buffer.
+//
+// We want to preserve only test results that have Pass/fail result.
+//
+// The algorithm.
+//
+// 1. Open the test record that is going to be removed (handle + test results)
+// 2. Open last results buffer
+// 3. Go through the test record and search for test results that have pass/fail
+// 4. If found, then check last results buffer is there a similar result.
+// 5. If similar test results are found from the last results buffer, delete the old
+//    result and add the new one.
+// 6. If similar test result is not found, then append the test result into the
+//    buffer.
+// 7. Finally update the last result buffer 
+// 8. delete the test record and any of the test results that did not go into
+//    the last results buffer.
+// ---------------------------------------------------------------------------
+//
+//void CDiagResultsDbStore::CheckOverflowingTestResults( RArray<TStreamId>& aIds )
+///@@@KSR: changes for Codescanner error val = High
+void CDiagResultsDbStore::CheckOverflowingTestResultsL( RArray<TStreamId>& aIds )
+    {    
+    TStreamId id = aIds[0];
+    
+    CDiagResultsDbTestRecordHandle* handleToBeRemoved = NULL;
+    CDiagResultsDbTestRecord* recordToBeRemoved = NULL;
+    
+    
+    OpenExistingRecordAndHandleL( id, 
+                                  recordToBeRemoved,
+                                  handleToBeRemoved );
+    
+    CleanupStack::PushL( handleToBeRemoved );
+    CleanupStack::PushL( recordToBeRemoved );
+  
+    
+    CDiagResultsDbTestRecordHandle*  lastResultsBufferHandle = NULL;
+                                                                                                         
+    lastResultsBufferHandle = OpenExistingHandleL( TUid::Uid( KFirstStreamId ) );
+          
+    TInt testCount = recordToBeRemoved->Count();
+   
+    TInt movedCount = 0;
+   
+    CleanupStack::PushL( lastResultsBufferHandle );                                  
+                                             
+    for ( TInt x = 0; x < recordToBeRemoved->Count(); ++x )
+        {
+        
+        CDiagResultsDatabaseItem* item = recordToBeRemoved->GetItem(x);
+        
+        //We are looking for only results that are either ESuccess or
+        //EFailed.
+        if ( item->TestResult() == CDiagResultsDatabaseItem::ESuccess ||
+             item->TestResult() == CDiagResultsDatabaseItem::EFailed )
+            {            
+            TBool found = lastResultsBufferHandle->Find( item->TestUid() );
+            TInt  index = lastResultsBufferHandle->FindIndex( item->TestUid() );
+            
+            CDiagResultsDbTestRecordHandle::TTestResultHandle resulthandle = 
+                         handleToBeRemoved->Get( handleToBeRemoved->FindIndex( item->TestUid() ));
+                                                
+            if ( resulthandle.iTestUid != item->TestUid() ) 
+                {
+                User::Panic( _L("Diag ResultsDB panic"), DiagResultsDbCommon::EIncorrectStreamId);
+                }
+                                                        
+            if ( found )
+                {                                
+                //remove old result from last results buffer, because we add new one.
+                iStore->DeleteL ( lastResultsBufferHandle->Get(index).iStreamId );
+                                
+                lastResultsBufferHandle->RemoveL( item->TestUid() );
+                lastResultsBufferHandle->AddL( resulthandle );                               
+                }
+            else 
+                {
+                lastResultsBufferHandle->AddL( resulthandle );                              
+                }
+                
+            movedCount++;
+            
+            handleToBeRemoved->RemoveL( item->TestUid() );    
+                
+            }                                             
+        }
+            
+    WriteHandleIntoDbL( *lastResultsBufferHandle );
+                    
+    iStore->DeleteL( aIds[0] ); //delete oldest first
+    aIds.Remove( 0 );
+        
+    ReplaceRootStreamL( aIds );
+                
+    //Delete test results streams as well.    
+    for (TInt i=0; i < handleToBeRemoved->Count(); ++i)
+        {
+        iStore->DeleteL ( handleToBeRemoved->Get(i).iStreamId );
+        movedCount++;
+        }        
+        
+    if ( movedCount != testCount )    
+        {
+        User::Panic( _L("EIncorrectStreamId"), DiagResultsDbCommon::EIncorrectStreamId);
+        }
+        
+    CleanupStack::PopAndDestroy( lastResultsBufferHandle );
+    CleanupStack::PopAndDestroy( recordToBeRemoved );
+    CleanupStack::PopAndDestroy( handleToBeRemoved );       
+    }
+
+
+// ---------------------------------------------------------------------------
+// Deletes the oldest handle from the store.
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbStore::DeleteOldestHandleL( RArray<TStreamId>& aIds )
+    {        
+    CDiagResultsDbTestRecordHandle* handle = OpenExistingHandleL( 
+                                                TUid::Uid( aIds[0].Value() ) );
+    CleanupStack::PushL( handle );
+        
+    iStore->DeleteL( aIds[0] ); //delete oldest first
+    aIds.Remove( 0 );
+        
+    ReplaceRootStreamL( aIds );
+                
+    //Delete test results streams as well.    
+    for (TInt i=0; i < handle->Count(); ++i)
+        {
+        iStore->DeleteL ( handle->Get(i).iStreamId );
+        }
+                              
+    CleanupStack::PopAndDestroy( handle );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Delete handle and its test results.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::DeleteHandleL( TInt aIndex, RArray<TStreamId>& aIds )
+    {        
+    CDiagResultsDbTestRecordHandle* handle = OpenExistingHandleL( 
+                                                TUid::Uid( aIds[aIndex].Value() ) );
+    CleanupStack::PushL( handle );
+        
+    iStore->DeleteL( aIds[aIndex] ); 
+    aIds.Remove( aIndex );
+        
+    ReplaceRootStreamL( aIds );
+                
+    //Delete test results streams as well.    
+    for (TInt i=0; i < handle->Count(); ++i)
+        {
+        iStore->DeleteL ( handle->Get(i).iStreamId );
+        }
+                              
+    CleanupStack::PopAndDestroy( handle );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Reads the root stream from the DB. Root stream contains uids of the 
+// test records. TUid is convertible to TStreamId and opposite.
+// ---------------------------------------------------------------------------
+//             
+void CDiagResultsDbStore::ReadRootStreamL( RArray<TStreamId>& aIds )
+    {    
+    
+    if (!iStore)
+        {
+        User::Panic( _L("Store is null"), 
+                        DiagResultsDbCommon::EStoreNullPointer );
+        }
+    
+    RStoreReadStream readstream;
+ 
+    TStreamId rootId = iStore->Root();
+    readstream.OpenLC( *iStore, rootId );
+    
+    TInt count = readstream.ReadInt16L();
+        
+    for ( TInt i = 0; i < count; ++i )
+        {
+        TStreamId id;
+        id.InternalizeL( readstream );
+        aIds.AppendL ( id  );
+               
+        }
+    
+    CleanupStack::PopAndDestroy( &readstream );
+    }
+  
+// ---------------------------------------------------------------------------
+// Add one stream Id into the root stream.
+// ---------------------------------------------------------------------------
+//    
+void CDiagResultsDbStore::AppendRootStreamL( TStreamId& aId )
+    {    
+    RArray<TStreamId> ids;
+    CleanupClosePushL( ids );
+    
+    ReadRootStreamL( ids );
+    
+    ids.Append( aId );
+    
+    ReplaceRootStreamL( ids );
+
+    CleanupStack::PopAndDestroy( &ids);
+    }
+
+// ---------------------------------------------------------------------------
+// Returns TUids from the root stream.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbStore::RecordUidsL(RArray<TUid>& aUids)
+    {
+    RArray<TStreamId> ids;
+    CleanupClosePushL ( ids );
+ 
+    ReadRootStreamL( ids );
+    
+    for (TInt i = 0; i < ids.Count(); ++i)
+        {
+        aUids.Append( TUid::Uid( ids[i].Value() ));
+        }
+        
+    CleanupStack::PopAndDestroy( &ids );
+    }
+
+        
+// ---------------------------------------------------------------------------
+// Replace the current root stream with a new array.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbStore::ReplaceRootStreamL( RArray<TStreamId>& aArray )
+    {
+    RStoreWriteStream writestream;
+    writestream.ReplaceLC( *iStore, iStore->Root() );    
+        
+    TInt count =  aArray.Count();    
+        
+    writestream.WriteInt16L(  count );
+    
+    for ( TInt i = 0; i < count; ++i )
+        {
+        writestream << aArray[i];
+        }
+        
+    writestream.CommitL();
+       
+    CleanupStack::PopAndDestroy( &writestream );
+    }     
+
+// ---------------------------------------------------------------------------
+// Empty root stream is needed when DB file is created for the first time.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbStore::CreateEmptyRootStreamL(CPermanentFileStore& aStore)
+    {
+    RStoreWriteStream writestream;
+   
+    TStreamId id = writestream.CreateLC( *iStore );  
+    writestream.WriteInt16L( 0 ); // stream id count = 0
+    
+    writestream.CommitL();  
+    
+    aStore.SetRootL( id );
+    
+    aStore.CommitL();
+    
+    CleanupStack::PopAndDestroy( &writestream );
+    }
+        
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbtestrecord.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2007 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:  Class definition of 
+*
+*/
+
+
+#include "diagresultsdatabasetestrecordinfo.h"
+#include "diagresultsdbtestrecord.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructor. 
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecord::CDiagResultsDbTestRecord( TBool aReadOnly, 
+        TUid aRecordUid ): iRecordUid(aRecordUid), iReadOnly(aReadOnly)
+	{
+	/*
+	RecordInfo().iRecordId = iRecordUid;
+	RecordInfo().iDbUid = iDbUid;
+	RecordInfo().iCompleted = EFalse;
+	*/
+	}
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecord* CDiagResultsDbTestRecord::NewL( TBool aReadOnly, 
+        TUid aRecordUid )
+	{
+	CDiagResultsDbTestRecord* testrecord =	
+	    new (ELeave) CDiagResultsDbTestRecord( aReadOnly, aRecordUid  );
+	CleanupStack::PushL( testrecord );
+	testrecord->ConstructL();
+	CleanupStack::Pop();
+	return testrecord;
+	}
+
+// ---------------------------------------------------------------------------
+// ConstructL. Set test record overview's DRM and home times.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecord::ConstructL()
+	{
+	//Time when this test record was created.
+//	iTestRecordInfo.iDrmStartTime = 
+	                            //TDiagResultsDatabaseTestRecordInfo::DRMTimeL();
+	//iTestRecordInfo.iStartTime.HomeTime();
+	}
+
+// ---------------------------------------------------------------------------
+// Getter.
+// ---------------------------------------------------------------------------
+// 
+TBool CDiagResultsDbTestRecord::ReadOnly() const
+    {
+    return iReadOnly;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor. 
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecord::~CDiagResultsDbTestRecord()
+    {
+    iTestArray.ResetAndDestroy();
+    iTestArray.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// AddL. 
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbTestRecord::AddL( CDiagResultsDatabaseItem* aItem )
+    {
+    for (TInt i=0; i < iTestArray.Count(); ++i)
+        {
+        
+        //Found same item inside the array. Delete the found item.
+        if ( aItem->TestUid() == iTestArray[i]->TestUid() )
+            {
+            CDiagResultsDatabaseItem* item = iTestArray[i];
+            iTestArray.Remove( i );
+            delete item;
+            item = 0;
+            break;
+            }
+        }
+        
+    iTestArray.AppendL( aItem );
+    }
+
+// ---------------------------------------------------------------------------
+// Operator [].
+// ---------------------------------------------------------------------------
+//     
+const CDiagResultsDatabaseItem& CDiagResultsDbTestRecord::operator[] (TInt aIndex) const
+    {
+    return *(iTestArray[aIndex]);
+    }
+
+// ---------------------------------------------------------------------------
+// Getter. This can be also NULL.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDatabaseItem* CDiagResultsDbTestRecord::GetItem(TInt aIndex) const
+    {
+    return iTestArray[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// Count().
+// ---------------------------------------------------------------------------
+// 
+TInt CDiagResultsDbTestRecord::Count() const
+    {
+    return iTestArray.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveL().
+// ---------------------------------------------------------------------------
+//         
+void CDiagResultsDbTestRecord::RemoveL( TInt aIndex )
+    {
+    iTestArray.Remove( aIndex );
+    }
+
+
+// ---------------------------------------------------------------------------
+// RemoveL().
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbTestRecord::RemoveL( TUid aTestUid )
+    {
+     for ( TInt i = 0; i < iTestArray.Count(); ++i )
+        {        
+        if ( iTestArray[i]->TestUid() == aTestUid )
+            {
+            iTestArray.Remove( i );
+            }            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Find test record
+// ---------------------------------------------------------------------------
+//  
+TInt CDiagResultsDbTestRecord::FindTestRecord( 
+                                const CDiagResultsDatabaseItem& aItem ) const
+    {
+    TInt index = -1;
+    
+    for (TInt i = 0; i < iTestArray.Count(); ++i)
+        {
+        
+        if ( iTestArray[i]->TestUid() == aItem.TestUid() )
+            {
+            index = i;
+            break;
+            }
+        }
+     
+    return index;
+    }
+
+// ---------------------------------------------------------------------------
+// Find test record
+// ---------------------------------------------------------------------------
+//  
+CDiagResultsDatabaseItem* CDiagResultsDbTestRecord::FindTestRecord( TUid aUid )
+    {
+     for (TInt i = 0; i < iTestArray.Count(); ++i)
+        {        
+        if ( iTestArray[i]->TestUid() == aUid )
+            {
+            return iTestArray[i];
+            }
+        }
+        
+    return NULL;
+    }
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbtestrecordhandle.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,349 @@
+/*
+* Copyright (c) 2007 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:  Class definition of 
+*
+*/
+
+
+#include "diagresultsdbtestrecordhandle.h"
+#include "diagresultsdbrecordengineparam.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructor. 
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle::CDiagResultsDbTestRecordHandle(
+                               TStreamId aRecordUid, 
+	                           TUid aDbUid,
+	                           CDiagResultsDbRecordEngineParam* aEngineParam )
+	{
+	iRecordId = aRecordUid;
+    RecordInfo().iRecordId = TUid::Uid(aRecordUid.Value());
+	RecordInfo().iDbUid = aDbUid;
+	iEngineParam = aEngineParam;
+	}
+
+// ---------------------------------------------------------------------------
+// Constructor. 
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle::CDiagResultsDbTestRecordHandle()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// Return record ID.
+// ---------------------------------------------------------------------------
+// 
+TStreamId CDiagResultsDbTestRecordHandle::RecordId() const
+    {
+    return iRecordId;
+    }
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle* CDiagResultsDbTestRecordHandle::NewL(
+                               TStreamId aRecordUid, 
+	                           TUid aDbUid,
+	                           CDiagResultsDbRecordEngineParam* aEngineParam )
+	{
+	CDiagResultsDbTestRecordHandle* testrecord =	
+	    new (ELeave) CDiagResultsDbTestRecordHandle( 
+	                                            aRecordUid, 
+	                                            aDbUid,
+	                                            aEngineParam );
+	CleanupStack::PushL( testrecord );
+	testrecord->ConstructL();
+	CleanupStack::Pop();
+	return testrecord;
+	}
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle* CDiagResultsDbTestRecordHandle::NewL( RReadStream& aStream )
+    {
+    
+    CDiagResultsDbTestRecordHandle* testrecord =	
+	    new (ELeave) CDiagResultsDbTestRecordHandle( );
+	CleanupStack::PushL( testrecord );
+	testrecord->ConstructL( aStream );
+	CleanupStack::Pop();
+	return testrecord;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//    
+void CDiagResultsDbTestRecordHandle::ConstructL( RReadStream& aStream )
+    {
+    InternalizeL ( aStream );
+    }
+   
+   
+// ---------------------------------------------------------------------------
+// ConstructL. Set test record overview's DRM and home times.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordHandle::ConstructL()
+	{
+	//Time when this test record was created.
+	iTestRecordInfo.iDrmStartTime = 
+	                            TDiagResultsDatabaseTestRecordInfo::DRMTimeL();
+	iTestRecordInfo.iStartTime.HomeTime();
+	}
+
+
+
+// ---------------------------------------------------------------------------
+// Destructor. 
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle::~CDiagResultsDbTestRecordHandle()
+    {
+    iHandleArray.Close();
+    
+    delete iEngineParam;
+    iEngineParam = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Return record info.
+// ---------------------------------------------------------------------------
+//    
+TDiagResultsDatabaseTestRecordInfo& CDiagResultsDbTestRecordHandle::RecordInfo()
+    {
+    return iTestRecordInfo;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Add one result handle into the record.
+// We can use aItem to search the item from the store.
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbTestRecordHandle::AddL( TTestResultHandle& aItem )
+    {
+    iTestRecordInfo.iTestCount++;
+    iHandleArray.AppendL( aItem );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Return matching streamId.
+// ---------------------------------------------------------------------------
+//        
+const TStreamId& CDiagResultsDbTestRecordHandle::operator[] (TInt aIndex) const
+    {
+    return iHandleArray[aIndex].iStreamId;
+    }
+   
+
+// ---------------------------------------------------------------------------
+// Get handle to a test result.
+// ---------------------------------------------------------------------------
+//     
+CDiagResultsDbTestRecordHandle::TTestResultHandle 
+                        CDiagResultsDbTestRecordHandle::Get( TInt aIndex ) const
+    {
+    return iHandleArray[aIndex];
+    }   
+   
+// ---------------------------------------------------------------------------
+// Convert plug-in uid into stream id.
+// ---------------------------------------------------------------------------
+//  
+ TInt CDiagResultsDbTestRecordHandle::MatchingStreamId( TUid aTestUid, TStreamId& aStreamId ) const
+    {
+     
+    for ( TInt i=0; i < iHandleArray.Count(); ++i )
+        {
+        if ( iHandleArray[i].iTestUid == aTestUid )
+            {
+            aStreamId = iHandleArray[i].iStreamId;
+            return KErrNone;
+            }
+        }    
+    
+    aStreamId = 0;
+    return KErrNotFound;    
+    }   
+    
+
+// ---------------------------------------------------------------------------
+// Returns count.
+// ---------------------------------------------------------------------------
+//     
+TInt CDiagResultsDbTestRecordHandle::Count() const
+    {
+    return iHandleArray.Count();
+    }
+   
+
+// ---------------------------------------------------------------------------
+// Return the index of uid.
+// ---------------------------------------------------------------------------
+//       
+TInt CDiagResultsDbTestRecordHandle::FindIndex ( TUid aTestUid ) const
+    {
+    
+    for ( TInt i=0; i < iHandleArray.Count(); ++i )
+        {
+        if ( iHandleArray[i].iTestUid == aTestUid )
+            {
+            return i;
+            }
+        }
+        
+    return KErrNotFound;
+    }    
+
+// ---------------------------------------------------------------------------
+// Check does the uid exists in the array.
+// ---------------------------------------------------------------------------
+//     
+TBool CDiagResultsDbTestRecordHandle::Find ( TUid aTestUid ) const
+    {
+    
+    for ( TInt i=0; i < iHandleArray.Count(); ++i )
+        {
+        if ( iHandleArray[i].iTestUid == aTestUid )
+            {
+            return ETrue;
+            }
+        }
+        
+    return EFalse;
+    }      
+   
+   
+// ---------------------------------------------------------------------------
+// Remove result handle from the array.
+// ---------------------------------------------------------------------------
+//    
+void CDiagResultsDbTestRecordHandle::RemoveL( TStreamId& aItem )
+    {
+    
+    for (TInt i=0; i < iHandleArray.Count(); ++i)
+        {
+        if ( iHandleArray[i].iStreamId == aItem )
+            {
+            iHandleArray.Remove( i );
+            break;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Remove result handle from the array.
+// ---------------------------------------------------------------------------
+//    
+void  CDiagResultsDbTestRecordHandle::RemoveL( TUid aItemUid )
+    {
+     for (TInt i=0; i < iHandleArray.Count(); ++i)
+        {
+        if ( iHandleArray[i].iTestUid == aItemUid )
+            {
+            iHandleArray.Remove( i );
+            break;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Update one result handle. This can be done when one stream(test result)
+// is moved into the last results buffer.
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbTestRecordHandle::UpdateL( TTestResultHandle& aResultHandle )
+    {
+    TInt index = FindIndex( aResultHandle.iTestUid );
+    
+    if ( index != KErrNone )
+        {
+        User::Leave( KErrNotFound );
+        }
+        
+    iHandleArray[index] = aResultHandle;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Simple Get.
+// ---------------------------------------------------------------------------
+//  
+const CDiagResultsDbRecordEngineParam& CDiagResultsDbTestRecordHandle::GetEngineParam() const
+    {
+    return *iEngineParam;
+    }
+  
+  
+// ---------------------------------------------------------------------------
+// Externalize Handle into a stream. Typically this is used when
+// handle is externalized into the store.
+// ---------------------------------------------------------------------------
+//   
+void CDiagResultsDbTestRecordHandle::ExternalizeL( RWriteStream& aStream ) const
+    {
+    iRecordId.ExternalizeL( aStream );
+    iTestRecordInfo.ExternalizeL( aStream );
+    
+    TInt count =  Count();
+    aStream.WriteInt16L( count );
+    
+    for (TInt i = 0; i < count; ++i)
+        {
+        // Write the streamId
+        iHandleArray[i].iStreamId.ExternalizeL( aStream ); 
+        // Write the plug-uid
+        aStream.WriteInt32L( iHandleArray[i].iTestUid.iUid ); 
+        }
+        
+    iEngineParam->ExternalizeL(aStream);
+    } 
+
+
+// ---------------------------------------------------------------------------
+// Internalize from a stream. Typically this is used when handle is read
+// from the store.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbTestRecordHandle::InternalizeL( RReadStream& aStream )
+    {
+    iRecordId.InternalizeL( aStream );
+    iTestRecordInfo.InternalizeL( aStream );
+    
+    TInt count = aStream.ReadInt16L();
+    
+    for (TInt i = 0; i < count; ++i)
+        {
+        TTestResultHandle handle;
+        handle.iStreamId.InternalizeL( aStream );
+        handle.iTestUid.iUid = aStream.ReadInt32L();
+        iHandleArray.Append( handle );
+        }
+    
+    iEngineParam = CDiagResultsDbRecordEngineParam::NewL ( aStream );
+    
+    }
+            
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/diagresultsdb/server/src/diagresultsdbtestrecordsubsession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,645 @@
+/*
+* Copyright (c) 2007 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:  Class definition of 
+*
+*/
+
+
+#include "diagresultsdatabasecommon.h"
+#include "diagresultsdbsession.h"
+#include "diagresultsdbtestrecordsubsession.h"
+#include "diagresultsdbtestrecord.h"
+#include "diagresultsdbtestrecordhandle.h"
+#include "diagresultsdbrecordengineparam.h"
+#include "diagresultsdatabase.h"
+
+#include <s32mem.h> 
+
+//this matches the size in the client side.
+const TInt KResultsDatabaseSubsessionBufferLength = 0x250;
+const TInt KResultsDatabaseSubsessionGranuality = 50;
+
+// ---------------------------------------------------------------------------
+// NewL.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordSubsession* CDiagResultsDbTestRecordSubsession::NewL(
+                             CDiagResultsDbSession* aSession, 
+                             CDiagResultsDbTestRecordHandle* aTestRecordHandle,
+                             TBool aReadonly
+                             )
+    {
+    CDiagResultsDbTestRecordSubsession* self = new( ELeave ) 
+                CDiagResultsDbTestRecordSubsession( aSession, 
+                                                    aTestRecordHandle,
+                                                    aReadonly
+                                                    );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor. Checks has the test record been written into the DB.
+// If it hasn't been written, destructor writes the data. 
+// This situation happens when for example client dies suddenly.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordSubsession::~CDiagResultsDbTestRecordSubsession()
+    {
+    delete iTestRecordHandle;
+    iTestRecordHandle = NULL;
+    
+    if ( iBuffer )
+        {
+        iBuffer->Reset();
+        delete iBuffer;
+        iBuffer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL. Creates the server side buffer.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::ConstructL()
+    {
+    // buffer for IPC. Objects are transmitted in this buffer.
+	// Size of the buffer has to be selected carefully.
+	// It should be 'large enough' but not too large.
+	// If you see too many overflows, increase the size.
+	// Subsession buffer can be smaller than the session buffer
+	iBuffer = CBufFlat::NewL( KResultsDatabaseSubsessionGranuality  );
+	iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handles subsession requests. 
+// ---------------------------------------------------------------------------
+// 
+TBool CDiagResultsDbTestRecordSubsession::DispatchMessageL(
+                                                    const RMessage2& aMessage)
+    {
+    TInt function = aMessage.Function();
+    switch( function )
+		{
+        case DiagResultsDbCommon::ESubsessionGetTestRecordId:
+            {            
+            TPckgBuf<TUid> uid( iTestRecordHandle->RecordInfo().iRecordId);
+            aMessage.Write( 0, uid );
+            return EFalse;
+            }
+        
+        case DiagResultsDbCommon::ESubsessionTestCompleted: //SYNC
+            {
+            iMsg = aMessage;
+           
+            CompleteTestRecordL( aMessage );
+            
+            aMessage.Complete( KErrNone );
+            
+            //Do compacting after subsession is completed to
+            //minimize disk space usage
+            if ( iSession->SessionHasWritten() )
+                {
+                iSession->Store().CompactDatabase();
+                }
+            
+            //Not asynchronous, but this prevents calling Complete again.
+            return ETrue;
+            }
+  
+        case DiagResultsDbCommon::ESubsessionGetStatus:
+            {
+            GetStatusL ( aMessage );
+            return EFalse;
+            }
+		case DiagResultsDbCommon::ESubsessionSuspend: //SYNC
+		    {
+		    iMsg = aMessage;
+           
+            SuspendTestRecordL( aMessage );
+            
+            aMessage.Complete( KErrNone );
+            
+            //Do compacting after subsession is completed to
+            //minimize disk space usage
+            if ( iSession->SessionHasWritten() )
+                {
+                iSession->Store().CompactDatabase();
+                }
+            
+            //Not asynchronous, but this prevents calling Complete again.
+            return ETrue;
+		    }
+            
+        case DiagResultsDbCommon::ESubsessionIsTestCompleted:
+            {
+            TPckgBuf<TBool> pckg ( Completed() );
+            aMessage.Write( 0, pckg );
+            return EFalse;
+            }
+        case DiagResultsDbCommon::ESubsessionGetRecordInfo:
+            {
+            TPckgBuf<TDiagResultsDatabaseTestRecordInfo> pckg(
+                                                 iTestRecordHandle->RecordInfo());
+            aMessage.Write( 0, pckg );
+            return EFalse;
+            }
+        case DiagResultsDbCommon::ESubsessionGetTestUids:
+            {
+            GetTestUidsL( aMessage );
+            return EFalse;
+            }
+            
+		case DiagResultsDbCommon::ESubsessionIsSuspended:
+		    {
+		    TBool suspended = EFalse;
+            if ( iTestRecordHandle->RecordInfo().iRecordStatus ==
+                    TDiagResultsDatabaseTestRecordInfo::ESuspended )
+                {
+                suspended = ETrue;
+                }
+                
+            TPckgBuf<TBool> pckg ( suspended );
+            aMessage.Write( 0, pckg );
+            return EFalse;
+		    }
+		
+		case DiagResultsDbCommon::ESubsessionGetEngineParam:
+		    {
+		    GetEngineParamL( aMessage );
+            return EFalse;
+		    }    
+		    
+        case DiagResultsDbCommon::ESubsessionLogTestResult: //ASYNC
+            {
+            iMsg = aMessage;
+            iCompletedLogTest = EFalse;
+            LogTestResultL( aMessage );
+            return ETrue;
+            }
+        
+        case DiagResultsDbCommon::ESubsessionCancelLogTestResult: 
+            {
+            CancelLogTestResult( aMessage );
+            
+            return EFalse;
+            }
+
+        case DiagResultsDbCommon::ESubsessionGetTestResult:
+            {
+            GetTestResultL( aMessage );
+            return EFalse;
+            }
+            
+        case DiagResultsDbCommon::ESubsessionGetTestResults:
+            {
+            GetTestResultsL( iTestRecordHandle, aMessage );
+            return EFalse;
+            }
+        default:
+            break;
+		}
+	aMessage.Panic( _L("DiagSrv panic: unknown command"), 
+	                    DiagResultsDbCommon::EBadRequest );
+	return EFalse;
+	}
+
+
+// ---------------------------------------------------------------------------
+// Returns record complete status.
+// ---------------------------------------------------------------------------
+// 
+TBool CDiagResultsDbTestRecordSubsession::Completed() const
+    {
+    TBool completed = EFalse;
+     
+    if ( iTestRecordHandle->RecordInfo().iCompleted )
+        {
+        completed = ETrue;
+        }
+    return completed;         
+    }
+
+
+// ---------------------------------------------------------------------------
+// Maps server side status into user side status.
+// ---------------------------------------------------------------------------
+//  
+void CDiagResultsDbTestRecordSubsession::GetStatusL ( const RMessage2& aMessage )
+    {
+    
+    RDiagResultsDatabaseRecord::TRecordStatus status;
+    
+    if ( iTestRecordHandle->RecordInfo().iCompleted )
+        {
+        
+        if ( iTestRecordHandle->RecordInfo().iRecordStatus == 
+                                    TDiagResultsDatabaseTestRecordInfo::EOpen )
+            {
+            
+            status = RDiagResultsDatabaseRecord::EPartiallyCompleted;
+            }
+        else if ( iTestRecordHandle->RecordInfo().iRecordStatus == 
+                                    TDiagResultsDatabaseTestRecordInfo::ESuspended )
+            {
+            status = RDiagResultsDatabaseRecord::EPartiallyCompleted;
+            }
+        else if (  iTestRecordHandle->RecordInfo().iRecordStatus == 
+                                    TDiagResultsDatabaseTestRecordInfo::ECompleted )   
+            {
+            status = RDiagResultsDatabaseRecord::ECompleted;
+            }     
+        else 
+        	{        		  
+            User::Panic( _L("DiagDbServer error"), DiagResultsDbCommon::EGetStatusPanic);                  
+			status = RDiagResultsDatabaseRecord::ECrashed;	
+        	}
+        }
+    else // iCompleted == EFalse
+        {
+         if ( iTestRecordHandle->RecordInfo().iRecordStatus == 
+                                    TDiagResultsDatabaseTestRecordInfo::EOpen )
+            {
+            if ( iSession->SessionHasWritten() )
+                {
+                status = RDiagResultsDatabaseRecord::EOpen;
+                }
+            else
+                {
+                status = RDiagResultsDatabaseRecord::ECrashed;
+                }
+            }
+        else if ( iTestRecordHandle->RecordInfo().iRecordStatus == 
+                                    TDiagResultsDatabaseTestRecordInfo::ESuspended )
+            {
+            status = RDiagResultsDatabaseRecord::ESuspended;
+            }
+         // TDiagResultsDatabaseTestRecordInfo::ECompleted is not valid combination either
+        else     
+            {
+            User::Panic( _L("DiagDbServer error"), DiagResultsDbCommon::EGetStatusPanic);
+			status = RDiagResultsDatabaseRecord::ECrashed;
+            }        
+        }
+        
+    TPckgBuf<RDiagResultsDatabaseRecord::TRecordStatus> pckg( status );
+    aMessage.Write( 0, pckg );    
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//     
+CDiagResultsDbTestRecordSubsession::CDiagResultsDbTestRecordSubsession(
+                            CDiagResultsDbSession* aSession, 
+                            CDiagResultsDbTestRecordHandle* aTestRecordHandle,
+                            TBool aReadonly
+                            ):
+        iSession( aSession ), iTestRecordHandle( aTestRecordHandle ), 
+        iReadonly (aReadonly), iCompletedLogTest( EFalse )
+    {
+	
+    }
+
+// ---------------------------------------------------------------------------
+// Read-only subsession or not
+// ---------------------------------------------------------------------------
+// 
+TBool CDiagResultsDbTestRecordSubsession::ReadonlySubsession() const
+    {
+    return iReadonly;
+    }
+
+// ---------------------------------------------------------------------------
+// Retrieve session params.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::GetEngineParamL( const RMessage2& aMessage )
+    {    
+    iSession->ReadBufferL( aMessage, 0, iBuffer );
+
+	RBufWriteStream stream ( *iBuffer );
+	CleanupClosePushL( stream );
+
+    iTestRecordHandle->GetEngineParam().ExternalizeL( stream );    
+    
+    stream.CommitL();
+    
+	CleanupStack::PopAndDestroy( &stream );
+	
+	 // if client buffer is not big enough	    
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(0) )
+        {
+        User::Leave( KErrOverflow );
+        }
+    
+    aMessage.Write( 0, iBuffer->Ptr(0) ); //write to client's address space 
+    }
+
+
+// ---------------------------------------------------------------------------
+// Log data into the store. This does not write data into the file.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::LogTestResultL( 
+                                                const RMessage2& aMessage )
+    {
+    if ( Completed() )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+        
+    if ( ReadonlySubsession() )
+        {
+        User::Leave( KErrAccessDenied  );
+        }
+        
+    //Writing anymore results into suspended record is considered as resume   
+    iTestRecordHandle->RecordInfo().iRecordStatus = 
+                                    TDiagResultsDatabaseTestRecordInfo::EOpen;
+        
+    iSession->ReadBufferL( aMessage, 0, iBuffer );
+    
+    RBufReadStream stream( *iBuffer );
+    CleanupClosePushL ( stream );
+    
+    CDiagResultsDatabaseItem * item = 
+                            CDiagResultsDatabaseItem::NewL ( stream );
+    CleanupStack::PushL( item );    
+
+    //Update handle + write data into the file. Handle and DB must be in sync.
+    TInt error = iSession->Store().CompleteTestResult( ETrue, 
+                                                       *iTestRecordHandle, 
+                                                       *item );
+    
+    //item has been written, so delete the object
+    CleanupStack::PopAndDestroy( item ); 
+    CleanupStack::PopAndDestroy( &stream );
+    
+    iCompletedLogTest = ETrue;
+    
+    // LogTestResult is asynchronous.
+    if( error == KErrNone )
+        {
+        iSession->HasWritten();
+        aMessage.Complete( KErrNone );   
+        }
+    else 
+        {
+        if ( error == KErrDiskFull )
+            {
+            iSession->DoNotCompact();
+            }
+            
+        aMessage.Complete ( error );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Cancel LogTestResultL.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::CancelLogTestResult( 
+                                               const RMessage2& /*aMessage*/ )
+    {
+    if (!iMsg.IsNull() && !iCompletedLogTest )
+        {  
+        iMsg.Complete( KErrCancel ); //Complete client's request. 
+        }
+    }
+
+    
+// ---------------------------------------------------------------------------
+// Returns the test record.
+// ---------------------------------------------------------------------------
+// 
+CDiagResultsDbTestRecordHandle* CDiagResultsDbTestRecordSubsession::CurrentTestRecordHandle()
+    {
+    return iTestRecordHandle;
+    }
+
+// ---------------------------------------------------------------------------
+// Finds one test result and serialize it. If it is not found, return KErrNone
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::GetTestResultL( 
+                                                   const RMessage2& aMessage )
+    {
+    iSession->ReadBufferL( aMessage, 1, iBuffer );
+    
+    TPckgBuf<TUid> uidpckg;
+	aMessage.Read(0, uidpckg);
+    TUid testUid = uidpckg(); 
+	
+	//Find right stream Id from the handle
+	TStreamId id;
+	TInt error = iTestRecordHandle->MatchingStreamId( testUid, id );
+	
+	User::LeaveIfError ( error );
+	
+	CDiagResultsDatabaseItem* item = 
+	     iSession->Store().OpenExistingTestResultL( id );
+	CleanupStack::PushL( item );
+	  
+	RBufWriteStream stream ( *iBuffer );
+	CleanupClosePushL( stream );
+	item->ExternalizeL( stream );
+	stream.CommitL();
+	CleanupStack::PopAndDestroy( &stream );
+	
+	CleanupStack::PopAndDestroy( item );
+	          
+	if ( iBuffer->Size() == 0 ) // Item was not found
+	    {
+	    User::Leave ( KErrNotFound );
+	    }
+	
+	 // if client buffer is not big enough	    
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(1) )
+        {
+        User::Leave( KErrOverflow );
+        }
+    
+    aMessage.Write( 1, iBuffer->Ptr(0) ); //write to client's address space 
+   
+    }
+
+// ---------------------------------------------------------------------------
+// Complete test record i.e. write it to file in parts.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::CompleteTestRecordL( 
+                                                   const RMessage2& aMessage )
+    {
+    if ( Completed() )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+    if ( ReadonlySubsession() )
+        {
+        User::Leave( KErrAccessDenied  );
+        }    
+    
+    TPckgBuf<TBool> completeFullyPckg;
+	aMessage.Read(0, completeFullyPckg);
+    TBool completeFully = completeFullyPckg();
+    
+    if ( completeFully )
+        {
+        iTestRecordHandle->RecordInfo().iRecordStatus = 
+                                TDiagResultsDatabaseTestRecordInfo::ECompleted;
+                                
+        iTestRecordHandle->RecordInfo().iCompleted = ETrue;
+        }
+    else // partial complete. iRecordStatus is not changed.
+        {
+        iTestRecordHandle->RecordInfo().iCompleted = ETrue;
+        }
+    
+    //Cleanup is not necessary if logging failed.
+    TInt error = iSession->Store().CompleteRecord( *iTestRecordHandle );
+    
+    if ( error == KErrDiskFull )
+            {
+            iSession->DoNotCompact();
+            }
+   
+    User::LeaveIfError ( error );         
+    
+    iSession->HasWritten();
+    
+    iSession->Store().CleanUpDatabaseL( ETrue );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Suspend test record i.e. write it to file in parts.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::SuspendTestRecordL( 
+                                                   const RMessage2& /*aMessage*/ )
+    {
+    if ( Completed() )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+    if ( ReadonlySubsession() )
+        {
+        User::Leave( KErrAccessDenied  );
+        }    
+    
+    iTestRecordHandle->RecordInfo().iRecordStatus = 
+                                TDiagResultsDatabaseTestRecordInfo::ESuspended;
+
+    iTestRecordHandle->RecordInfo().iCompleted = EFalse;
+                                
+    TInt error = iSession->Store().CompleteRecord( *iTestRecordHandle );
+    
+     if ( error == KErrDiskFull )
+            {
+            iSession->DoNotCompact();
+            }
+   
+    User::LeaveIfError ( error );         
+        
+    iSession->Store().CleanUpDatabaseL( ETrue );
+    
+    iSession->HasWritten();
+    }
+
+// ---------------------------------------------------------------------------
+// Observers function. Observers store after CompleteTestRecordL has been
+// called.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::CompletedRecordL( TInt aError )
+    {
+    iMsg.Complete( aError ); // complete async function
+    }
+
+
+// ---------------------------------------------------------------------------
+// Get test results of a test record.
+// ---------------------------------------------------------------------------
+// 
+void CDiagResultsDbTestRecordSubsession::GetTestResultsL( 
+                                        CDiagResultsDbTestRecordHandle* aHandle, 
+                                        const RMessage2& aMessage )
+    {
+    iSession->ReadBufferL( aMessage, 0, iBuffer );
+    
+    	
+    RBufWriteStream stream ( *iBuffer );
+    CleanupClosePushL ( stream );
+    stream.WriteInt16L( aHandle->Count() );
+	
+	CDiagResultsDbTestRecord* testrecord = 
+	    iSession->Store().OpenExistingRecordL( TUid::Uid(aHandle->RecordId().Value()), ETrue );
+	CleanupStack::PushL (testrecord);
+	
+	for ( TInt i = 0; i < aHandle->Count(); ++i )
+	    {
+	    const CDiagResultsDatabaseItem& item = (*testrecord)[i];
+	    item.ExternalizeL( stream );
+	    }
+	    
+    CleanupStack::PopAndDestroy( testrecord );
+    
+    // if client buffer is not big enough
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(0) ) 
+        {
+        User::Leave( KErrOverflow );
+        }
+
+    aMessage.Write( 0, iBuffer->Ptr(0) );  //write to client's address space
+    
+    CleanupStack::PopAndDestroy( &stream );
+    } 
+
+// ---------------------------------------------------------------------------
+// Get UIDs of test results that are stored inside the test record.
+// ---------------------------------------------------------------------------
+//     
+void CDiagResultsDbTestRecordSubsession::GetTestUidsL( 
+                                            const RMessage2& aMessage )
+    {
+    iSession->ReadBufferL( aMessage, 0, iBuffer );
+    
+   	RBufWriteStream stream ( *iBuffer );
+   	CleanupClosePushL( stream );
+
+   	//Write how many uids there are.
+   	stream.WriteInt16L( iTestRecordHandle->Count() );
+   	
+	for (TInt i = 0; i < iTestRecordHandle->Count(); ++i)
+	    {
+	    stream.WriteInt32L( iTestRecordHandle->Get(i).iTestUid.iUid ) ;        
+	    }
+	        
+	// if client buffer is not big enough        
+    if ( iBuffer->Ptr(0).Length() > aMessage.GetDesMaxLength(0) ) 
+        {
+        User::Leave( KErrOverflow );
+        }
+    
+    
+    aMessage.Write( 0, iBuffer->Ptr(0) ); //write to client's address space 
+   
+    CleanupStack::PopAndDestroy( &stream );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2007 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:  Bldmake file
+*
+*/
+
+#include <platform_paths.hrh>
+
+
+	#include "../diagframework/group/bld.inf"
+	#include "../diagpluginbase/group/bld.inf"
+	#include "../diagresultsdb/client/group/bld.inf"
+	#include "../diagresultsdb/server/group/bld.inf"
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+ 
+	../rom_files/diagframework.iby						CORE_MW_LAYER_IBY_EXPORT_PATH(diagframework.iby)        
+	../rom_files/diagpluginbase.iby						CORE_MW_LAYER_IBY_EXPORT_PATH(diagpluginbase.iby)
+	../rom_files/diagresultsdatabase.iby			CORE_MW_LAYER_IBY_EXPORT_PATH(diagresultsdatabase.iby)
+	../rom_files/diagresultsdatabaseserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH(diagresultsdatabaseserver.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/rom_files/diagframework.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 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:  Image description file for project Diagnostis Framework
+*
+*/
+
+
+#ifndef DIAGFRAMEWORK_IBY
+#define DIAGFRAMEWORK_IBY
+
+#ifdef FF_DEVICE_DIAGNOSTICS_APP 
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\diagframework.dll          SHARED_LIB_DIR\diagframework.dll
+
+#endif
+
+#endif // DIAGFRAMEWORK_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/rom_files/diagpluginbase.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 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:  Image description file for project Diagnostics Plugin Base
+*
+*/
+
+
+#ifndef DIAGPLUGINBASE_IBY
+#define DIAGPLUGINBASE_IBY
+
+#ifdef FF_DEVICE_DIAGNOSTICS_APP 
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\diagpluginbase.dll          SHARED_LIB_DIR\diagpluginbase.dll
+
+#endif
+
+#endif // DIAGPLUGINBASE_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/rom_files/diagresultsdatabase.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 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:  Image description file for project Diagnostics Plugin Base
+*
+*/
+
+
+#ifndef DIAGRESULTSDATABASE_IBY
+#define DIAGRESULTSDATABASE_IBY
+
+#ifdef FF_DEVICE_DIAGNOSTICS_APP 
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\diagresultsdatabase.dll          SHARED_LIB_DIR\diagresultsdatabase.dll
+
+#endif
+
+#endif // DIAGRESULTSDATABASE_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicediagnosticsfw/rom_files/diagresultsdatabaseserver.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 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:  Image description file for project Diagnostics Plugin Base
+*
+*/
+
+
+#ifndef DIAGRESULTSDATABASESERVER_IBY
+#define DIAGRESULTSDATABASESERVER_IBY
+
+#ifdef FF_DEVICE_DIAGNOSTICS_APP 
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\diagresultsdatabaseserver.exe        PROGRAMS_DIR\diagresultsdatabaseserver.exe
+
+#endif
+
+#endif // DIAGRESULTSDATABASESERVER_IBY
--- a/devicemgmtnotifications/dmdevdialogclient/bld/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of syncml dm device dialogs
-*
-*/
-
-// BLD.INF
-// Component description file 
-//
-
-PRJ_MMPFILES
-
-dmdevdialogclient.mmp
-
--- a/devicemgmtnotifications/dmdevdialogclient/bld/dmdevdialogclient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of dm device dialogs
-*
-*/
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-
-CAPABILITY	CAP_CLIENT_DLL 
-
-TARGET        dmdevdialogclient.dll
-TARGETTYPE    dll
-UID 0x1000008D 0x2002FF67
-VENDORID 			VID_DEFAULT
-
-SOURCEPATH    ../src
-SOURCE        dmdevdialogclient.cpp
-
-USERINCLUDE   ../inc
-USERINCLUDE   ../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY       euser.lib  
-LIBRARY 	  efsrv.lib 
-DEBUGLIBRARY       flogger.lib
--- a/devicemgmtnotifications/dmdevdialogclient/bwins/dmdevdialogclientu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
-	?ShowConnectDialog@RDmDevDialog@@QAEHXZ @ 1 NONAME ; int RDmDevDialog::ShowConnectDialog(void)
-	?IsPkgZeroConnectNoteShown@RDmDevDialog@@QAEHAAH@Z @ 2 NONAME ; int RDmDevDialog::IsPkgZeroConnectNoteShown(int &)
-	?ShowConfirmationAlert@RDmDevDialog@@QAEXABHABVTDesC16@@1AAVTRequestStatus@@@Z @ 3 NONAME ; void RDmDevDialog::ShowConfirmationAlert(int const &, class TDesC16 const &, class TDesC16 const &, class TRequestStatus &)
-	?Close@RDmDevDialog@@QAEXXZ @ 4 NONAME ; void RDmDevDialog::Close(void)
-	?LaunchPkgZero@RDmDevDialog@@QAEXABH00AAVTDes8@@AAVTRequestStatus@@@Z @ 5 NONAME ; void RDmDevDialog::LaunchPkgZero(int const &, int const &, int const &, class TDes8 &, class TRequestStatus &)
-	?OpenL@RDmDevDialog@@QAEHXZ @ 6 NONAME ; int RDmDevDialog::OpenL(void)
-	?DismissConnectDialog@RDmDevDialog@@QAEHXZ @ 7 NONAME ; int RDmDevDialog::DismissConnectDialog(void)
-	?ShowDisplayAlert@RDmDevDialog@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 8 NONAME ; void RDmDevDialog::ShowDisplayAlert(class TDesC16 const &, class TRequestStatus &)
-	?CancelPkgZeroNote@RDmDevDialog@@QAEHXZ @ 9 NONAME ; int RDmDevDialog::CancelPkgZeroNote(void)
-
--- a/devicemgmtnotifications/dmdevdialogclient/eabi/dmdevdialogclientu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
-	_ZN12RDmDevDialog13LaunchPkgZeroERKiS1_S1_R5TDes8R14TRequestStatus @ 1 NONAME
-	_ZN12RDmDevDialog16ShowDisplayAlertERK7TDesC16R14TRequestStatus @ 2 NONAME
-	_ZN12RDmDevDialog17CancelPkgZeroNoteEv @ 3 NONAME
-	_ZN12RDmDevDialog17ShowConnectDialogEv @ 4 NONAME
-	_ZN12RDmDevDialog20DismissConnectDialogEv @ 5 NONAME
-	_ZN12RDmDevDialog21ShowConfirmationAlertERKiRK7TDesC16S4_R14TRequestStatus @ 6 NONAME
-	_ZN12RDmDevDialog25IsPkgZeroConnectNoteShownERi @ 7 NONAME
-	_ZN12RDmDevDialog5CloseEv @ 8 NONAME
-	_ZN12RDmDevDialog5OpenLEv @ 9 NONAME
-
--- a/devicemgmtnotifications/dmdevdialogclient/inc/dmdevdialogclientdebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Dm device dialog client
-*
-*/
-
-#ifndef DEVDIALOG_CLIENT_DEBUG_H_
-#define DEVDIALOG_CLIENT_DEBUG_H_
-#ifdef _DEBUG
-   #ifdef _DEVDIALOG_DEBUG
-#endif
-        #include <e32std.h>
-        #include <f32file.h>
-        #include <flogger.h>
-        #include <e32svr.h>
-
-        _LIT( KLogFile, "devdiag.log" );
-        _LIT( KLogDirFullName, "c:\\logs\\" );
-        _LIT( KLogDir, "DMDD" );
-
-        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
-            {
-            VA_LIST list;
-            VA_START( list, aFmt );
-            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
-            }
-
-
-        #ifdef __DEVDIALOG_DEBUG_RDEBUG 
-            #ifndef __GNUC__          
-                #define FLOG            RDebug::Print
-            #else   // __GNUC__       
-                #define FLOG(arg...)    RDebug::Print(arg);
-            #endif // __GNUC__        
-        #else //__DEVDIALOG_DEBUG_RDEBUG
-            #ifndef __GNUC__          
-                #define FLOG            FWrite
-            #else   // __GNUC__       
-                #define FLOG(arg...)    FWrite(arg);
-            #endif // __GNUC__        
-        #endif // __DEVDIALOG_DEBUG_RDEBUG
-
-    #else   // _DEVDIALOG_DEBUG
-        #ifndef __GNUC__
-            #define FLOG
-        #else
-            #define FLOG(arg...)
-        #endif // __GNUC__
-    #endif // _DEVDIALOG_DEBUG
-
-
-#endif /*FMSCLIENTDEBUG_H_*/
--- a/devicemgmtnotifications/dmdevdialogclient/src/dmdevdialogclient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <dmdevdialogclient.h>
-#include "dmdevdialogclientserver.h"
-#include "dmdevdialogclientdebug.h"
-
-// ---------------------------------------------------------------------------
-// StartServerL()  
-// Starts DM device Dialog server
-// ---------------------------------------------------------------------------
-TInt StartServerL()
-	{
-	FLOG(_L("StartServerLt Started"));
-	TInt res = KErrNone;
-	RProcess server;
-	res=server.Create(KDMDEVDIALOGSERVER,KNullDesC);
-	FLOG(_L("StartServerL-- create server error as %d"),res);
-	if (res!=KErrNone)
-		{		
-		return res;
-		}
-	TRequestStatus stat;
-	server.Rendezvous(stat);
-	if (stat!=KRequestPending)
-		server.Kill(0);		// abort startup
-	else
-		server.Resume();	// logon OK - start the server
-	User::WaitForRequest(stat);		// wait for start or death
-	res=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
-	FLOG(_L("StartServerL-- server.ExitType() returns %d"),res);
-	server.Close();
-	return res;
-	}
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::OpenL()
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RDmDevDialog::OpenL()
-	{	
-	FLOG(_L("RDmDevDialog::OpenL()- Begin"));
-	TInt res = KErrNone;
-		FLOG(_L("RDmDevDialog::OpenL()- Secured client"));
-		res = CreateSession( KDMDEVDIALOGSERVER,TVersion(KDmDevDialogServerVersionMajor,
-		        KDmDevDialogServerVersionMinor,0),KDefaultMessageSlots );
-		if ( res != KErrNone )
-			{
-			FLOG(_L("RDmDevDialog::OpenL()- session not created"));
-			res = StartServerL();
-			User::LeaveIfError( res );
-			res = CreateSession( KDMDEVDIALOGSERVER,TVersion(KDmDevDialogServerVersionMajor,
-	                KDmDevDialogServerVersionMinor,0),KDefaultMessageSlots );
-			}							
-	FLOG(_L("RDmDevDialog::OpenL()- End %d"),res);	
-	return res;
-	}
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::Close()
-// ---------------------------------------------------------------------------
-EXPORT_C void RDmDevDialog::Close()
-	{
-    FLOG(_L(" RDmDevDialog::Close"));
-	RSessionBase::Close();
-	}
-	
-// ----------------------------------------------------------------------------
-// RDmDevDialog::LaunchPkgZeroL()
-// ----------------------------------------------------------------------------	
-EXPORT_C void RDmDevDialog::LaunchPkgZero(const TInt& aProfileId, 
-        const TInt& ajobId, const TInt& aUimode, 
-        TDes8& aResponse, TRequestStatus& aStatus )
-	{		
-    FLOG(_L(" RDmDevDialog::LaunchPkgZero--Begin"));
-    SendReceive( EServerAlert, TIpcArgs(aProfileId,ajobId,aUimode,&aResponse),
-            aStatus);
-    FLOG(_L(" RDmDevDialog::LaunchPkgZero end "));
-	}
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::IsPkgZeroConnectNoteShown() 
-// ---------------------------------------------------------------------------  
-EXPORT_C TInt RDmDevDialog::IsPkgZeroConnectNoteShown(TInt& aConectNoteShown)
-    {
-    FLOG(_L(" RDmDevDialog::IsPkgZeroConnectNoteShown--Begin"));
-    TPckgBuf<TInt> result(aConectNoteShown);
-    TInt err = SendReceive( EPkgConnectNoteIsActive,TIpcArgs(&result));    
-    aConectNoteShown = result();
-    FLOG(_L(" RDmDevDialog::IsPkgZeroConnectNoteShown--End as %d,%d"),err,
-            aConectNoteShown);
-    return err;    
-    }
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::DismissConnectDialog() 
-// --------------------------------------------------------------------------- 
-EXPORT_C TInt RDmDevDialog::DismissConnectDialog()
-    {
-    FLOG(_L(" RDmDevDialog::DismissConnectDialog--Begin"));    
-    TInt err = SendReceive( EPkgZeroConnectNoteDismiss,TIpcArgs());        
-    FLOG(_L(" RDmDevDialog::DismissConnectDialog--End as %d,%d"),err);    
-		return err;
-    }
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::ShowConnectDialog() 
-// --------------------------------------------------------------------------- 
-EXPORT_C TInt RDmDevDialog::ShowConnectDialog()
-    {
-    FLOG(_L(" RDmDevDialog::ShowConnectDialog--Begin"));    
-    TInt err = SendReceive( EPkgZeroConnectNoteShowAgain,TIpcArgs());        
-    FLOG(_L(" RDmDevDialog::ShowConnectDialog--error is %d"),err);
-    return err;    
-    }
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::ShowDisplayAlert() 
-// --------------------------------------------------------------------------- 
-EXPORT_C void RDmDevDialog::ShowDisplayAlert(const TDesC& aNoteDisplayText,
-            TRequestStatus& aStatus)
-    {
-    FLOG(_L(" RDmDevDialog::ShowDisplayAlert--Begin"));      
-    SendReceive( EShowDisplayAlert,TIpcArgs(&aNoteDisplayText),aStatus);        
-    FLOG(_L(" RDmDevDialog::ShowDisplayAlert end" ));
-    }
-
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::ShowConfirmationAlert() 
-// --------------------------------------------------------------------------- 
-EXPORT_C void RDmDevDialog::ShowConfirmationAlert(const TInt& aTimeout,
-        const TDesC& aNoteHeader, const TDesC& aNoteDisplayText, 
-        TRequestStatus& aStatus)
-    {
-    FLOG(_L(" RDmDevDialog::ShowConfirmationAlert--Begin"));
-    SendReceive( EShowConfirmationalert,TIpcArgs(aTimeout,&aNoteHeader,
-            &aNoteDisplayText),aStatus);
-    FLOG(_L(" RDmDevDialog::ShowConfirmationAlert--End "));    
-    }
-
-// ---------------------------------------------------------------------------
-// RDmDevDialog::CancelPkgZeroNote() 
-// --------------------------------------------------------------------------- 
-EXPORT_C TInt RDmDevDialog::CancelPkgZeroNote()
-    {
-    FLOG(_L(" RDmDevDialog::CancelPkgZeroNote--Begin"));
-    TInt err = SendReceive(ECancelServerAlert, TIpcArgs());    
-    FLOG(_L(" RDmDevDialog::CancelPkgZeroNote--End "));    
-    return err;
-    }
-
-//End of file
--- a/devicemgmtnotifications/dmdevdialogserver/bld/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of DM Device Dialogs
-* 	This is part of syncmlfw.
-*
-*/
-
-// BLD.INF
-// Component description file 
-//
-
-PRJ_MMPFILES
-
-dmdevicedialog.mmp
-
-
--- a/devicemgmtnotifications/dmdevdialogserver/bld/dmdevicedialog.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of DM Device Dialogs
-*
-*/
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-
-
-CAPABILITY    CAP_SERVER
-
-TARGET        dmdevicedialog.exe
-TARGETTYPE    exe
-
-UID 0 0x2002FF68
-VENDORID 			VID_DEFAULT
-
-SOURCEPATH    ../src
-SOURCE		  dmdevicedialogserver.cpp
-SOURCE		  dmdevicedialogsession.cpp 
-
-USERINCLUDE   ../inc
-USERINCLUDE   ../../inc
-USERINCLUDE   ../../cenrep
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbcore 
-
-LIBRARY       euser.lib
-LIBRARY       efsrv.lib 
-LIBRARY       HbCore.lib
-LIBRARY 	  	syncmlclientapi.lib
-LIBRARY 	  	centralrepository.lib
-DEBUGLIBRARY  flogger.lib 
-
-
--- a/devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogdebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of DM Device Dialogs
-*/
-
-#ifndef __DMDEVDEBUG_H_
-#define __DMDEVDEBUG_H_
-#include <e32debug.h>
-#if 0
-#ifdef _DEBUG
-	#define _DMDEV_DEBUG
-#endif
-
-   #ifdef _DMDEV_DEBUG
-
-        #include <e32std.h>
-        #include <f32file.h>
-        #include <flogger.h>
-        #include <e32svr.h>
-
-        _LIT( KLogFile, "dmdevdialog.log" );
-        _LIT( KLogDirFullName, "c:\\logs\\" );
-        _LIT( KLogDir, "Dmdd" );
-
-        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
-            {
-            VA_LIST list;
-            VA_START( list, aFmt );
-            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
-            }
-
-
-        #ifdef _DMDEV_DEBUG_RDEBUG 
-            #ifndef __GNUC__          
-                #define FLOG            RDebug::Print
-            #else   // __GNUC__       
-                #define FLOG(arg...)    RDebug::Print(arg);
-            #endif // __GNUC__        
-        #else // _DMDEV_DEBUG_RDEBUG
-            #ifndef __GNUC__          
-                #define FLOG            FWrite
-            #else   // __GNUC__       
-                #define FLOG(arg...)    FWrite(arg);
-            #endif // __GNUC__        
-        #endif // _DMDEV_DEBUG_RDEBUG
-
-    #else   // _DMDEV_DEBUG    
-        #ifndef __GNUC__
-            #define FLOG
-        #else
-            #define FLOG(arg...)
-        #endif // __GNUC__
-    #endif // _DMDEV_DEBUG
-#endif
-#define FLOG(arg...)    RDebug::Print(arg);
-#endif /*DMDEVDEBUG_H_*/
--- a/devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,345 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
-* Description: Implementation of DM Device Dialogs
- */
-
-#ifndef __DMDEVDIALOGSERVER_H__
-#define __DMDEVDIALOGSERVER_H__
-
-#include <e32base.h>
-#include <e32std.h>
-#include <hbdevicedialogsymbian.h>
-#include <hbindicatorsymbian.h>
-#include <hbsymbianvariant.h>
-#include <SyncMLObservers.h>
-#include <SyncMLClient.h>
-#include <SyncMLClientDM.h>
-#include "dmdevdialogclientserver.h"
-#include "dmdevicedialogdebug.h"
-
-class CDmDeviceDialogSession;
-class CDmDeviceDialogServer;
-class CHbIndicatorSymbian;
-
-
-_LIT(KDeviceDialogType,"com.nokia.hb.devicemanagementdialog/1.0");
-_LIT(KNotifierType, "syncmlfw");
-_LIT(KProfileId, "profileid");
-_LIT(KUImode, "uimode");
-_LIT(KServerdisplayname, "serverdisplayname");
-_LIT(KDMJobId, "jobid");
-_LIT(KServerpushalertInfo, "serverpushinformative");
-_LIT(KServerpushalertConfirm, "serverpushconfirmative");
-_LIT(KDMProgressIndicatorType, "com.nokia.devicemanagement.progressindicatorplugin/1.0");
-_LIT(KFotaDefaultProfile, "fotadefaultprofile");
-_LIT(KPkgZeroTimeout, "pkgzerotimeout");
-
-
-const TInt KRequestTriggerWaitTime(1000000);
-
-const TInt KDefaultNotifierId = 1000000;
-const TInt KConnectNotifierId = 1000001;
-// Device manager key UID
-const TUid KCRUidNSmlDMSyncApp = {0x101f6de5};
-// CenRep keys for default dm profile used in the
-// firmware update over the air.
-const TUint32 KNSmlDMDefaultFotaProfileKey = 0x00000002;
-
-#define KSosServerUid   0x101f99fb
-#define KFotaServerUid  0x102072C4
-#define KScomoServerUid 0x200267FB
-
-
-
-class CDmDeviceDialogServer : public CServer2,
-        public MHbDeviceDialogObserver,
-        public MSyncMLEventObserver,
-        public MHbIndicatorSymbianObserver
-    {
-    friend class CDmDeviceDialogSession;
-
-public:
-    enum TNoteType
-        {
-        EPkgZeroNote,
-        EConnectNote,
-        EInformativeAlertNote,
-        EConfirmationAlertNote
-        };
-    
-    enum TSyncMLSANSupport
-        {
-        ESANNotSpecified,
-        ESANSilent,
-        ESANUserInformative,
-        ESANUserInteractive
-        };
-    /**
-     * Destructor
-     */
-    virtual ~CDmDeviceDialogServer();
-
-    /**
-     * Static method which creates the server instance
-     * @param None
-     * @return CServer2*
-     */
-    static CServer2* NewLC();
-
-    /**
-     * Stops the session and closes the server
-     * @param None
-     * @return None
-     */
-    void CloseServer();
-
-    /**
-     * For asynchronous network request to be 
-     * logged on active object, using CPeriodic
-     * @param None
-     * @return None
-     */
-     void PeriodicServerCloseL();
-    
-    /**
-     * Launches package zero device dialog
-     * @param aProfileId, ProfileId of the DM server
-     * @param ajobId, Id of the DM job created due to package zero
-     * @param aUimode, Server alert ui mode type
-     * @param aReplySlot, Response to Sos server
-     * @param aMessage, reference to RMessage2 of current session.
-     * @return None.
-     */
-    void LaunchPkgZeroNoteL(TInt &aProfileId, TInt &aJobId,
-                    const TInt &aReplySlot, TInt &aUimode,
-                    const RMessage2& aMessage);
-    
-    /**
-     * Launches display alert specific device dialog
-     * @param aAlertText, Text to be dsiplayed on display alert     
-     * @param aMessage, reference to RMessage2 of current session.
-     * @return None.
-     */   
-    void ShowDisplayalertL(const TDesC &aAlertText,
-                    const RMessage2& aMessage);
-    
-    /**
-     * Launches Confirmation(1101) alert dialog
-     * @param aTimeout, Timeout of the dialog. 
-     * @param aNoteDisplayText, Text to be displayed on the note           
-     * @param aNoteHeader, Text to be displayed as dialog header  
-     * @param aMessage, reference to RMessage2 of current session.       
-     * @return None.        
-     */   
-    void ShowConfirmationalertL(const TInt& aTimeOut, const TDesC& aHeader,
-            const TDesC& aText, const RMessage2& aMessage);
-    
-    /**
-     * Keeps track of number of asynchronous requests
-     * @param None.      
-     * @return None.        
-     */    
-    void NewAsyncRequest();
-    
-    /**
-     * Tells any request pending or not
-     * @param None.      
-     * @return None.        
-     */    
-    TBool RequestPending();
-    
-    /**
-     * Cancels the earlier requested server shutdown
-     * annd serves for the incoming request.
-     * @param None.      
-     * @return None.        
-     */
-    void CancelServerCloseRequest(); 
-    
-    /**
-     * Callback method from Device dialog plugin for user action.
-     * @param aData, User response to the device dialog note            
-     * @return None.        
-     */   
-    virtual void DataReceived(CHbSymbianVariantMap& aData);
-
-    /**
-     * Callback method from Device dialog plugin when dialog gets closed.
-     * @param aCompletionCode, Error code.            
-     * @return None.        
-     */    
-    virtual void DeviceDialogClosed(TInt aCompletionCode);
-
-    /**
-    * From MSyncMLEventObserver
-    * Called when SyncML session events oocur.
-    * @param aEvent Sync event
-    * @param aIdentifier Identifier for the sync event
-    * @param aError Synce event error
-    * @param aAdditionalData.
-    * @return None.
-    */    
-    virtual void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier,
-            TInt aError, TInt aAdditionalData);
-    
-    /**
-     * Tells whether package zero query is currently shown or not.
-     * @param None.            
-     * @return TBool, status of package zero note display.        
-     */
-    TBool IsPkgZeroNoteDisplaying();
-    
-    /**
-     * Cancels outstanding package zero request.
-     * @param None.            
-     * @return None.        
-     */
-    void CancelPendingServerAlert();
-    
-    /**
-     * Callback method from Device dialog Indicator when user taps on Indicator.
-     * @param aType - Type of the indicator that user interacted with.
-     * @param aData - Data sent by the indicator.               
-     * @return None.        
-     */    
-    virtual void  IndicatorUserActivated (const TDesC &aType,
-                        CHbSymbianVariantMap &aData); 
-
-private:
-
-    /**
-     * second phase constructor
-     * @param None
-     */
-    void ConstructL();
-
-    /**
-     * Default constructor
-     * @param None
-     */
-    CDmDeviceDialogServer();
-
-    /**
-    * Called to close the server.
-    * @param None.    
-    * @return None.
-    */    
-    void StopServer();
-    
-    /**    
-    * Dsimisses the Connect device dialog
-    * @param None.
-    * @return None.
-    */     
-    void DismissDialog();
-    
-    /**
-    * Starts DM Job after user accepted the package zero message.
-    * @param None.
-    * @return None.
-    */     
-    void GetDMJobStatusL();
-    
-    /**
-     * Tells whether connect dialog is currently shown or not.
-     * @param None.
-     * @return boolean, status of the connect dialog.
-     */
-    TBool IsConenctDialogDisplaying();
-    
-    /**
-    * Display connect dialog, if dismissed earlier.
-    * @param None.
-    * @return None.
-    */     
-    void ShowConnectDialogAgainL();
-    
-    /**
-    * Called to process the response of user action on specified Device dialog
-    * @param aData, User response to the device dialog note           
-    * @return None.
-    */     
-    void DevDialogResponseL(CHbSymbianVariantMap& aData);
-    
-protected:
-
-    /**
-     * Calls when a New session is getting created
-     * @param aVersion
-     * @param aMessage
-     * @return CSession2*
-     */
-    CSession2* NewSessionL(const TVersion& aVersion,
-            const RMessage2& aMessage) const;
-
-private:
-    //Periodic timer used while shutting down the server
-    CPeriodic* iServerCloseRequest;
-
-    //DM Server Profile Id
-    TInt iProfileId;
-
-    //Current Dm Session Job Id
-    TInt iJobId;
-    
-    //Server alert type of package zero message
-    TUint iUimode;
-    
-    //Pointer to Device dialog server
-    CHbDeviceDialogSymbian* iDevDialog;
-    
-    //Reference to Indicator framework
-    CHbIndicatorSymbian* iDmIndicator;
-    
-    //Status variable to identify the status of Connecting note
-    TBool iPkgZeroConnectionNoteShown;
-    
-    //User response of device dialog note
-    TInt iResponse;
-
-    //RMessage reference used to notify the caller
-    RMessage2 iMessage;
-    
-    //Status variable to know whether server can be stopped or not
-    TBool iStopServer;
-    
-    // SyncML Session
-    RSyncMLSession iSyncMLSession;
-
-    // Job id after starting DM Job
-    TInt iSyncJobId;
-
-    // DM job
-    RSyncMLDevManJob iSyncJob;    
-    
-    //Status variable to know whether a DM Job is ongoing or not
-    TBool iJobongoing;
-    
-    //Status variable to know currently any device dialog is displayed or not
-    TBool iAnyDialogDisplaying;
-    
-    //Status variable to know whether an Indicator is launched or not
-    TBool iIndicatorLaunched;
-    
-    //Identifies the number of requests pending
-    TInt iSessionCount; 
-    
-    //Identifies whether package zero note is displaying or not
-    TBool iPkgZeroQueryNoteDisplaying;
-    
-	//Response slot to write the result
-    TInt iReplySlot;
-    };
-
-#endif
--- a/devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogsession.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of DM Device Dialogs
-* 	This is part of syncmlfw.
-*/
-
-#ifndef __DMDEVDIALOG_SESSION_H__
-#define __DMDEVDIALOG_SESSION_H__
-
-#include "dmdevicedialogserver.h"
-
-class CDmDeviceDialogSession: public CSession2
-{
-	friend class CDmDeviceDialogServer;
-	public:
-		/**
-		 * Destructor
-		 */
-		virtual ~CDmDeviceDialogSession();
-						
-	private:
-		/**
-		 * Constructor
-		 */ 
-		CDmDeviceDialogSession();
-		
-		/**
-		 * Provides DM Device dialog Server reference
-		 * @param None.
-		 * @return CDmDeviceDialogServer reference
-		 */ 
-		CDmDeviceDialogServer& Server();
-		
-		/**
-		 * Called by the framework to handle the request 	 
-		 * @param aMessage
-		 * @return None
-		 */
-		void ServiceL(const RMessage2& aMessage);
-		
-		/**
-		 * Called from ServiceL to handle the request 
-		 * @param aMessage
-		 * @return None
-		 */
-		void DispatchMessageL(const RMessage2& aMessage);
-		
-		/**
-		 * Called when ServiceL leaves
-		 * @param aMessage
-		 * @param aError
-		 * @return None
-		 */
-		void ServiceError(const RMessage2 &aMessage, TInt aError);
-		
-		/**
-		 * Checks whether the session started client is secured or not	 
-		 * @param aMessage
-		 * @return TBool
-		 */
-		TBool CheckClientSecureId( const RMessage2 &aMessage );		
-		
-	private:			
-		RMessage2 iMessage;		 		
-};
-
-
-#endif
--- a/devicemgmtnotifications/dmdevdialogserver/src/dmdevicedialogserver.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,755 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of DM Device Dialogs
- *
- */
-
-#include <hbtextresolversymbian.h>
-#include <centralrepository.h>
-#include <DevManInternalCRKeys.h>
-#include "dmdevicedialogserver.h"
-#include "dmdevdialogclientserver.h"
-#include "dmdevicedialogsession.h"
-//#include <devicedialogconsts.h>
-// ----------------------------------------------------------------------------------------
-// Server startup code
-// ----------------------------------------------------------------------------------------
-static void RunServerL()
-    {
-    // naming the server thread after the server helps to debug panics
-    User::LeaveIfError(User::RenameThread(KDMDEVDIALOGSERVER));
-
-    // create and install the active scheduler
-    CActiveScheduler* s = new (ELeave) CActiveScheduler;
-    CleanupStack::PushL(s);
-    CActiveScheduler::Install(s);
-
-    // create the server (leave it on the cleanup stack)
-    CDmDeviceDialogServer::NewLC();
-
-    // Initialisation complete, now signal the client
-    RProcess::Rendezvous(KErrNone);
-
-    // Ready to run
-    CActiveScheduler::Start();
-
-    // Cleanup the server and scheduler
-    CleanupStack::PopAndDestroy(2);
-    }
-
-// ----------------------------------------------------------------------------------------
-// static method ShutDownL() called to submit async n/w request
-// ----------------------------------------------------------------------------------------
-static TInt ShutDownL(TAny* aPtr)
-    {
-    CDmDeviceDialogServer* ptr = (CDmDeviceDialogServer*) aPtr;
-    FLOG(_L("static ShutDownL:-Begin"));
-    TRAPD(err, ptr->CloseServer());
-    FLOG(_L("closing the server"));
-    ptr->CancelServerCloseRequest();
-    FLOG(_L("closing the server:-end"));
-    return err;
-    }
-
-// ----------------------------------------------------------------------------------------
-// Server process entry-point
-// ----------------------------------------------------------------------------------------
-TInt E32Main()
-    {
-    __UHEAP_MARK;
-    CTrapCleanup* cleanup = CTrapCleanup::New();
-    TInt r = KErrNoMemory;
-    if (cleanup)
-        {
-        TRAP(r,RunServerL());
-        delete cleanup;
-        }
-    __UHEAP_MARKEND;
-    return r;
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::NewLC
-// ----------------------------------------------------------------------------------------
-CServer2* CDmDeviceDialogServer::NewLC()
-    {
-    CDmDeviceDialogServer* self = new (ELeave) CDmDeviceDialogServer;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::ConstructL
-// ----------------------------------------------------------------------------------------
-void CDmDeviceDialogServer::ConstructL()
-    {
-    FLOG(_L("CDmDeviceDialogServer::ConstructL- begin"));
-    StartL( KDMDEVDIALOGSERVER);    
-    iSyncMLSession.OpenL();
-    FLOG(_L("CDmDeviceDialogServer::ConstructL- end"));
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::CDmDeviceDialogServer() 
-// ----------------------------------------------------------------------------------------
-CDmDeviceDialogServer::CDmDeviceDialogServer() :
-    CServer2(EPriorityStandard, EUnsharableSessions)
-    {
-    iSessionCount = 0;
-    iServerCloseRequest = NULL;
-    iProfileId = EFalse;
-    iJobId = EFalse;
-    iStopServer = EFalse;
-    iResponse = -1;
-    iPkgZeroConnectionNoteShown = EFalse;
-    iDmIndicator = NULL;
-    iDevDialog = NULL;
-    iAnyDialogDisplaying = EFalse;
-    iIndicatorLaunched = EFalse;
-    iPkgZeroQueryNoteDisplaying = EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::CloseServer()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::CloseServer()
-    {
-    iSessionCount = 0;
-    //Kill the server
-    CActiveScheduler::Stop();
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::DataReceived()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::DataReceived(CHbSymbianVariantMap& aData)
-    {
-    FLOG(_L("CDmDeviceDialogServer::DataReceived>>"));
-    TRAP_IGNORE(DevDialogResponseL(aData));
-    FLOG(_L("CDmDeviceDialogServer::DataReceived<<"));
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::DevDialogResponseL()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::DevDialogResponseL(CHbSymbianVariantMap& aData)
-    {
-    FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL>>"));
-    _LIT(KNotifierReturnType, "notifiertype");
-    _LIT(KKeyPress, "keypress");
-    const CHbSymbianVariant* notifiertypevariant = aData.Get(KNotifierReturnType);    
-    TInt *notifiertype = notifiertypevariant->Value<TInt> ();
-    const CHbSymbianVariant* returnkeyvariant = aData.Get(KKeyPress);    
-    TInt *returnvalue = returnkeyvariant->Value<TInt> ();   
-    iResponse = *returnvalue;
-    iDevDialog->Cancel();
-    iAnyDialogDisplaying = EFalse;
-    if (EPkgZeroNote == *notifiertype )//Server alert note
-        {
-        FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL EPkgZeroNote \
-                response from user is %d"),iResponse);
-        if (iResponse == 0)
-            {
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL OK pressed"));
-            CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-            CleanupStack::PushL(varMap);            
-            TInt id = KConnectNotifierId;
-            HBufC* notifierid = HBufC::NewL(10);
-            CleanupStack::PushL(notifierid);            
-            *notifierid = KNotifierType;
-            CHbSymbianVariant* notifieridvar = CHbSymbianVariant::NewL(&id,
-                    CHbSymbianVariant::EInt);            
-            varMap->Add(*notifierid, notifieridvar);
-            TInt err = iDevDialog->Show(KDeviceDialogType, *varMap, this);
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseLconnect note \
-                    launch error is %d"), err);
-            iAnyDialogDisplaying = ETrue;
-            iPkgZeroConnectionNoteShown = ETrue;
-            GetDMJobStatusL();
-            TPckgBuf<TInt> response(KDmDevDialogUid);
-            iMessage.WriteL(iReplySlot,response);
-            iMessage.Complete(KErrNone);
-            iSessionCount--;
-            CleanupStack::PopAndDestroy(2);
-            //GetDMJobStatusL();
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL DM Job \
-                     started"));
-            }
-        else
-            {
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL user pressed \
-                     cancel"));
-            iMessage.Complete(KErrCancel);
-            iSessionCount--;            
-            StopServer();
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL stop \
-                     server called"));
-            }
-        iPkgZeroQueryNoteDisplaying = EFalse;
-        }
-    else if (EInformativeAlertNote == *notifiertype )// Iformative alert
-        {
-        FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL informative alert"));
-        iMessage.Complete(KErrNone);
-        iSessionCount--;
-        if (!iJobongoing)
-            StopServer();
-        else
-            ShowConnectDialogAgainL();
-        }
-    else if (EConfirmationAlertNote == *notifiertype)// conformative alert
-        {
-        FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL conformative alert"));
-        iMessage.Complete(iResponse);
-        iSessionCount--;
-        if (!iJobongoing)
-            StopServer();
-        else
-            ShowConnectDialogAgainL();
-        }
-    else //connecting note
-        {
-        iPkgZeroConnectionNoteShown = EFalse;
-        FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL connecting note"));
-        if (iResponse == KErrCancel)
-            {
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL user cancelled \
-                     connection"));
-            if (iJobongoing)
-                {
-                FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL job stop \
-                         requested"));
-                iSyncJob.StopL();
-                FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL job stop\
-                         done"));
-                }
-            DismissDialog();                               
-            StopServer();
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL connecting note \
-                     stopserver called"));
-            }
-        else // Launch indicator
-            {
-            FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL Launch \
-                    Indicator"));            
-            //Send the text id
-			_LIT(KFileName, "deviceupdates_");
-			_LIT(KPath, "z:/resource/qt/translations/"); 
-			TBool result = HbTextResolverSymbian::Init(KFileName, KPath);
-    		if(result)
-    			{
-    		    if(iDmIndicator == NULL)
-				iDmIndicator = CHbIndicatorSymbian::NewL();
-				_LIT(KIndicatorTest, 
-				    "txt_deviceupdate_dblist_device_updates_val_connect_fota");       
-				// returns the string "Text test"
-				HBufC* text = HbTextResolverSymbian::LoadL(KIndicatorTest);
-    			CleanupStack::PushL(text);
-    			TPtr textptr = text->Des();
-				CHbSymbianVariant* IndicatorText = CHbSymbianVariant::NewL(
-									&textptr, CHbSymbianVariant::EDes);
-				CleanupStack::PushL(IndicatorText);	       
-				FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL Indicator activated")); 
-				iDmIndicator->SetObserver(this);
-				FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL indicator Observer set"));
-				iDmIndicator->Activate(KDMProgressIndicatorType,IndicatorText);
-				
-				iIndicatorLaunched = ETrue;
-				CleanupStack::PopAndDestroy(2);  
-				}
-            }
-        }
-    FLOG(_L("CDmDeviceDialogServer::DevDialogResponseL End"));    
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::DeviceDialogClosed()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::DeviceDialogClosed(TInt /*aError*/)
-    {
-    FLOG(_L("CDmDeviceDialogServer::DeviceDialogClosed "));
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::~CDmDeviceDialogServer() 
-// ----------------------------------------------------------------------------------------
-CDmDeviceDialogServer::~CDmDeviceDialogServer()
-    {
-    FLOG(_L("CDmDeviceDialogServer::~CDmDeviceDialogServer()"));
-    if (iServerCloseRequest)
-        {
-        FLOG(_L("CDmDeviceDialogServer::~CDmDeviceDialogServer() \
-                iServerCloseRequest cancel)"));
-        iServerCloseRequest->Cancel();
-        delete iServerCloseRequest;
-        iServerCloseRequest = NULL;
-        }
-    if (iDevDialog)
-        {
-        FLOG(_L("CDmDeviceDialogServer::~CDmDeviceDialogServer():if loop)"));
-        iDevDialog->Cancel();
-        delete iDevDialog;
-        }
-    if (iDmIndicator)
-        {
-        iDmIndicator->Deactivate(KDMProgressIndicatorType);
-        delete iDmIndicator;
-        }
-    FLOG(_L("CDmDeviceDialogServer::~CDmDeviceDialogServer()job to close"));
-    if(iJobongoing)
-        iSyncJob.Close();
-    iSyncMLSession.Close();
-    FLOG(_L("CDmDeviceDialogServer::~CDmDeviceDialogServer() end"));
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::NewSessionL() 
-// ----------------------------------------------------------------------------------------
-CSession2* CDmDeviceDialogServer::NewSessionL(const TVersion&,
-        const RMessage2&) const
-    {
-    return new (ELeave) CDmDeviceDialogSession();
-    }
-
-// ----------------------------------------------------------------------------
-// CDmDeviceDialogServer::PeriodicServerCloseL() 
-// ----------------------------------------------------------------------------
-void CDmDeviceDialogServer::PeriodicServerCloseL()
-    {
-    if (iServerCloseRequest)
-        {
-        FLOG(_L("CDmDeviceDialogServer::PeriodicServerCloseL() \
-                :-iServerCloseRequest cancel "));
-        iServerCloseRequest->Cancel();
-        delete iServerCloseRequest;
-        iServerCloseRequest = NULL;
-        }
-    iServerCloseRequest = CPeriodic::NewL(EPriorityNormal);    
-    iServerCloseRequest->Start(TTimeIntervalMicroSeconds32(
-            KRequestTriggerWaitTime * 5), TTimeIntervalMicroSeconds32(
-            KRequestTriggerWaitTime * 5), TCallBack(ShutDownL, this));
-    FLOG(_L("CDmDeviceDialogServer::PeriodicServerCloseL():-Request logged)"));
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::LaunchPkgZeroNoteL()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::LaunchPkgZeroNoteL(TInt &aProfileId,
-        TInt &aJobId, const TInt &aReplySlot, TInt &aUimode,
-        const RMessage2& aMessage)
-    {
-    FLOG(_L("CDmDeviceDialogSession::LaunchPkgZeroNoteL \
-             called:"));
-    iProfileId = aProfileId;
-    iReplySlot = aReplySlot;
-    iJobId = aJobId;
-    iUimode = aUimode;
-    iMessage = aMessage;
-    CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-    CleanupStack::PushL(varMap);
-
-    HBufC* notifierid = HBufC::NewL(10);
-    CleanupStack::PushL(notifierid);
-    *notifierid = KNotifierType;
-
-    HBufC* profileid = HBufC::NewL(10);
-    CleanupStack::PushL(profileid);
-    *profileid = KProfileId;
-
-    HBufC* uimode = HBufC::NewL(10);
-    CleanupStack::PushL(uimode);
-    *uimode = KUImode;
-
-    HBufC* serverdisplay = HBufC::NewL(20);
-    CleanupStack::PushL(serverdisplay);
-    *serverdisplay = KServerdisplayname;
-    
-    HBufC* defaultprofile = HBufC::NewL(20);
-    CleanupStack::PushL(defaultprofile);
-    *defaultprofile = KFotaDefaultProfile;
-    
-    HBufC* timeout = HBufC::NewL(20);
-    CleanupStack::PushL(timeout);
-    *timeout = KPkgZeroTimeout;
-    
-    TInt profileId( KErrNotFound );
-    TBool Isdefault = EFalse;
-    CRepository* centrep = NULL;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidNSmlDMSyncApp ) );
-    if (err == KErrNone)
-        {
-        centrep->Get(KNSmlDMDefaultFotaProfileKey, profileId);
-        delete centrep;
-        centrep = NULL;
-        if (aProfileId == profileId)
-            Isdefault = ETrue;
-        }
-    TRAP( err, centrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys) );
-    TInt Timeout(KErrNone);
-    if (err == KErrNone)
-        {
-        centrep->Get(KDevManServerAlertTimeout, Timeout);
-        //Timeout has minutes, convert to milli second
-        Timeout = Timeout * 60 * 1000;
-        delete centrep;
-        centrep = NULL;        
-        }
-    
-    TInt id = KDefaultNotifierId;
-    CHbSymbianVariant* notifieridvar = CHbSymbianVariant::NewL(&id,
-            CHbSymbianVariant::EInt);
-    CleanupStack::PushL(notifieridvar);
-    CHbSymbianVariant* infoprofileid = CHbSymbianVariant::NewL(&iProfileId,
-            CHbSymbianVariant::EInt);
-    CleanupStack::PushL(infoprofileid);
-    CHbSymbianVariant* infouimode = CHbSymbianVariant::NewL(&iUimode,
-            CHbSymbianVariant::EInt);
-    CleanupStack::PushL(infouimode);
-    RSyncMLDevManProfile DmProfile;
-    DmProfile.OpenL( iSyncMLSession, iProfileId, ESmlOpenRead );
-    TBuf<256> servername= DmProfile.DisplayName();                  
-    DmProfile.Close();
-    CHbSymbianVariant* serverdisplayname = CHbSymbianVariant::NewL(
-            &servername, CHbSymbianVariant::EDes);
-    CleanupStack::PushL(serverdisplayname);
-    CHbSymbianVariant* defaultprofilevalue = CHbSymbianVariant::NewL(
-            &Isdefault, CHbSymbianVariant::EBool);
-    CleanupStack::PushL(defaultprofilevalue);
-    
-    CHbSymbianVariant* pkgzerotimeout = CHbSymbianVariant::NewL(
-                &Timeout, CHbSymbianVariant::EInt);
-        CleanupStack::PushL(pkgzerotimeout);
-    
-    varMap->Add(*notifierid, notifieridvar);
-    varMap->Add(*profileid, infoprofileid);
-    varMap->Add(*uimode, infouimode);
-    varMap->Add(*serverdisplay, serverdisplayname);
-    varMap->Add(*defaultprofile, defaultprofilevalue);
-    varMap->Add(*timeout, pkgzerotimeout);
-    CleanupStack::Pop(6);
-    if (iDevDialog == NULL)
-        iDevDialog = CHbDeviceDialogSymbian::NewL();
-    else if (iAnyDialogDisplaying)
-        {
-        iDevDialog->Cancel();
-        iAnyDialogDisplaying = EFalse;
-        }
-    else
-        {
-        }
-    err = 
-        iDevDialog->Show(KDeviceDialogType, *varMap, this);
-    iPkgZeroQueryNoteDisplaying = ETrue;
-    FLOG(_L("CDmDeviceDialogSession::LaunchPkgZeroNoteL \
-         err in devdialog is %d"), err);
-    iAnyDialogDisplaying = ETrue;
-    CleanupStack::PopAndDestroy(7);
-    FLOG(_L("CDmDeviceDialogSession::LaunchPkgZeroNoteL \
-                 end:"));
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::StopServer()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::StopServer()
-    {
-    FLOG(_L("CDmDeviceDialogServer::StopServer Begin"));
-    if(!iStopServer && !iJobongoing)
-        {
-        iPkgZeroConnectionNoteShown = EFalse;
-        iStopServer = ETrue;
-        FLOG(_L("CDmDeviceDialogServer::StopServer Requested to shut down"));
-        TRAP_IGNORE(PeriodicServerCloseL());
-        }
-    FLOG(_L("CDmDeviceDialogServer::StopServer Done"));
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::OnSyncMLSessionEvent()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::OnSyncMLSessionEvent(TEvent aEvent,
-        TInt aIdentifier, TInt aError, TInt /*aAdditionalData*/)
-    {
-    FLOG(_L("[OMADM]\tDmDeviceDialogServer::OnSyncMLSessionEvent(),\
-                     aEvent = %d, aIdentifier = %d, aError = %d"),
-            aEvent, aIdentifier, aError);
-    if (iSyncJobId == aIdentifier && (aEvent == EJobStop || aEvent
-            == EJobStartFailed || aEvent == EJobRejected))
-        {
-        FLOG(_L("[OMADM]\tDmDeviceDialogServer::OnSyncMLSessionEvent(), \
-                        ajob stoping" ));
-        iSyncJob.Close();
-        iJobongoing = false;        
-        //Stop the dialog
-        DismissDialog();
-        StopServer();
-        }
-    FLOG(_L( "[OMADM]\tDmDeviceDialogServer::OnSyncMLSessionEvent()end" ));
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::DismissDialog()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::DismissDialog()
-    {
-    FLOG(_L("CDmDeviceDialogServer::dismissDialog "));
-
-    if (iDevDialog && iPkgZeroConnectionNoteShown && !iIndicatorLaunched)
-        {
-        FLOG(_L("CDmDeviceDialogServer::dismissDialog 3"));
-        iDevDialog->Cancel();
-        iAnyDialogDisplaying = EFalse;
-        iPkgZeroConnectionNoteShown = EFalse;
-        }
-    if (iIndicatorLaunched)
-        {
-        FLOG(
-            _L("CDmDeviceDialogServer::dismissDialog deactivating indicator"));
-        iDmIndicator->Deactivate(KDMProgressIndicatorType);       
-        FLOG(
-           _L("CDmDeviceDialogServer::dismissDialog deactivating indicator done"));
-        iIndicatorLaunched = false;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::GetDMJobStatusL()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::GetDMJobStatusL()
-    {
-    FLOG(_L("CDmDeviceDialogServer::GetDMJobStatusL "));
-    iSyncJob.OpenL(iSyncMLSession, iJobId);
-    FLOG(_L("CDmDeviceDialogServer::GetDMJobStatusL Job started "));
-    iJobongoing = true;
-    iSyncJobId = iSyncJob.Identifier();
-    TInt err = KErrNone;
-    // for MSyncMLEventObserver events
-    TRAP( err, iSyncMLSession.RequestEventL(*this) );
-    FLOG(_L("CDmDeviceDialogServer::GetDMJobStatusL error %d"), err);
-    if (err != KErrNone)
-        {
-        iSyncJob.StopL();
-        iSyncJob.Close();
-        FLOG(_L("CDmDeviceDialogServer::GetDMJobStatusL leaving"));
-        User::Leave(err);
-        }    
-    FLOG(_L("CDmDeviceDialogServer::GetDMJobStatusL end "));
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::IsConenctDialogDisplaying()
-// -----------------------------------------------------------------------------
-TBool CDmDeviceDialogServer::IsConenctDialogDisplaying()
-    {
-    return iPkgZeroConnectionNoteShown;
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::ShowConnectDialogAgainL()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::ShowConnectDialogAgainL()
-    {
-    if (iJobongoing && !iIndicatorLaunched && !iPkgZeroConnectionNoteShown)
-        {
-        FLOG(_L("CDmDeviceDialogServer::ShowConnectDialogAgain 1"));
-        CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-        CleanupStack::PushL(varMap);
-        TInt id = KConnectNotifierId;
-        HBufC* notifierid = HBufC::NewL(10);
-        CleanupStack::PushL(notifierid);
-        FLOG(_L("CDmDeviceDialogServer::ShowConnectDialogAgain 2"));
-        *notifierid = KNotifierType;
-        CHbSymbianVariant* notifieridvar = CHbSymbianVariant::NewL(&id,
-                CHbSymbianVariant::EInt);
-        FLOG(_L("CDmDeviceDialogServer::ShowConnectDialogAgain 3"));
-        varMap->Add(*notifierid, notifieridvar);
-        FLOG(_L("CDmDeviceDialogServer::ShowConnectDialogAgain 4"));
-        if (iDevDialog == NULL)
-            {
-            iDevDialog = CHbDeviceDialogSymbian::NewL();
-            FLOG(_L("CDmDeviceDialogServer::ShowConnectDialogAgain 5"));
-            }
-        else if (iAnyDialogDisplaying)
-            iDevDialog->Cancel();
-        else
-            {
-            }
-        iDevDialog->Show(KDeviceDialogType, *varMap, this);
-        iAnyDialogDisplaying = ETrue;
-        FLOG(_L("CDmDeviceDialogServer::ShowConnectDialogAgain 6"));
-        iPkgZeroConnectionNoteShown = ETrue;
-        CleanupStack::PopAndDestroy(2);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::ShowDisplayalertL()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::ShowDisplayalertL(const TDesC& aAlertText,
-        const RMessage2& aMessage)
-    {
-    FLOG(_L("CDmDeviceDialogServer::ShowDisplayalert "));
-    iMessage = aMessage;
-    CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-    CleanupStack::PushL(varMap);
-    HBufC* keyBuf = HBufC::NewL(25);
-    CleanupStack::PushL(keyBuf);
-    *keyBuf = KNotifierType;
-    HBufC* servalertType = HBufC::NewL(25);
-    CleanupStack::PushL(servalertType);
-    *servalertType = KServerpushalertInfo;
-    TInt id = 0;
-    CHbSymbianVariant* notifierid = CHbSymbianVariant::NewL(&id,
-            CHbSymbianVariant::EInt);
-    varMap->Add(*keyBuf, notifierid);
-    CHbSymbianVariant* serveralertmsg = CHbSymbianVariant::NewL(&aAlertText,
-            CHbSymbianVariant::EDes);
-    varMap->Add(*servalertType, serveralertmsg); // takes ownership
-    FLOG(_L("CDmDeviceDialogServer::ShowDisplayalert before newl"));
-    if (iDevDialog == NULL)
-        iDevDialog = CHbDeviceDialogSymbian::NewL();
-    else if (iAnyDialogDisplaying)
-        {
-        iDevDialog->Cancel();
-        }
-    else
-        {
-        }
-    FLOG(_L("CDmDeviceDialogServer::ShowDisplayalert before show"));
-    iDevDialog->Show(KDeviceDialogType, *varMap, this);
-    iAnyDialogDisplaying = ETrue;
-    CleanupStack::PopAndDestroy(3);
-    }
-
-// -----------------------------------------------------------------------------
-// CDmDeviceDialogServer::ShowConfirmationalertL()
-// -----------------------------------------------------------------------------
-void CDmDeviceDialogServer::ShowConfirmationalertL(const TInt& /*aTimeOut*/,
-        const TDesC& /*aHeader*/, const TDesC& aText, const RMessage2& aMessage)
-    {
-    iMessage = aMessage;
-    CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-    CleanupStack::PushL(varMap);
-    HBufC* keyBuf = HBufC::NewL(25);
-    CleanupStack::PushL(keyBuf);
-    *keyBuf = KNotifierType;
-    HBufC* servalertType = HBufC::NewL(25);
-    CleanupStack::PushL(servalertType);
-    *servalertType = KServerpushalertConfirm;
-    TInt id = 0;
-    CHbSymbianVariant* notifierid = CHbSymbianVariant::NewL(&id,
-            CHbSymbianVariant::EInt);
-    varMap->Add(*keyBuf, notifierid);
-    CHbSymbianVariant* serveralertmsg = CHbSymbianVariant::NewL(&aText,
-            CHbSymbianVariant::EDes);    
-    varMap->Add(*servalertType, serveralertmsg); // takes ownership   
-    if (iDevDialog == NULL)
-        iDevDialog = CHbDeviceDialogSymbian::NewL();
-    else if (iAnyDialogDisplaying)
-        iDevDialog->Cancel();
-    else
-        {
-        }
-    iDevDialog->Show(KDeviceDialogType, *varMap, this);
-    iAnyDialogDisplaying = ETrue;
-    CleanupStack::PopAndDestroy(3);
-    }
-
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::NewAsyncRequest() 
-// ----------------------------------------------------------------------------------------
-void CDmDeviceDialogServer::NewAsyncRequest()
-    {
-    iSessionCount++;
-    }
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::RequestPending() 
-// Any request pending
-// ----------------------------------------------------------------------------------------
-TBool CDmDeviceDialogServer::RequestPending()
-    {
-    if( iSessionCount > 0 )
-        {
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::CancelServerCloseRequest() 
-// Cancels Server shutdown
-// ----------------------------------------------------------------------------------------	
-void CDmDeviceDialogServer::CancelServerCloseRequest()    
-	{
-	FLOG(_L("CDmDeviceDialogServer::CancelServerCloseRequest():-begin)"));
-	if(iServerCloseRequest)
-		{
-		FLOG(_L("CDmDeviceDialogServer::CancelServerCloseRequest():-iServerCloseRequest cancel)"));
-		iServerCloseRequest->Cancel();
-		delete iServerCloseRequest;
-		iServerCloseRequest = NULL;
-		}	
-	FLOG(_L("CDmDeviceDialogServer::CancelServerCloseRequest():-end)"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::IsPkgZeroNoteDisplaying() 
-// ---------------------------------------------------------------------------------------- 
-TBool CDmDeviceDialogServer::IsPkgZeroNoteDisplaying()    
-    {
-    FLOG(_L("CDmDeviceDialogServer::IsPkgZeroNoteDisplaying())"));
-    return iPkgZeroQueryNoteDisplaying;    
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::CancelPendingServerAlert() 
-// ----------------------------------------------------------------------------------------
-void CDmDeviceDialogServer::CancelPendingServerAlert()
-    {
-    FLOG(_L("CDmDeviceDialogServer::CancelPendingServerAlert())"));
-    if(IsPkgZeroNoteDisplaying())
-        {
-        iSessionCount--;
-        iDevDialog->Cancel();
-        iPkgZeroQueryNoteDisplaying = EFalse;
-        iMessage.Complete(KErrCancel);
-        FLOG(_L("CDmDeviceDialogServer::CancelPendingServerAlert() cancelled"));    
-        }
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogServer::IndicatorUserActivated() 
-// ----------------------------------------------------------------------------------------
-void  CDmDeviceDialogServer::IndicatorUserActivated (const TDesC& /*aType*/,
-                        CHbSymbianVariantMap& /*aData*/)
-    {
-    //Deactivate the indicator done by plugin
-    FLOG(_L("CDmDeviceDialogServer::IndicatorUserActivated()"));
-    if (iDmIndicator)
-        {
-        //Indicator deactivated on plugin side
-        FLOG(_L("CDmDeviceDialogServer::IndicatorUserActivated() Indicator \
-                deactivated"));
-        iIndicatorLaunched = EFalse;
-        FLOG(_L("CDmDeviceDialogServer::IndicatorUserActivated() connect \
-                 dialog to be activated"));
-        TRAP_IGNORE(ShowConnectDialogAgainL());
-        FLOG(_L("CDmDeviceDialogServer::IndicatorUserActivated() connect \
-                         dialog activated"));
-        }
-    FLOG(_L("CDmDeviceDialogServer::IndicatorUserActivated() end"));
-    }
-//End of file
--- a/devicemgmtnotifications/dmdevdialogserver/src/dmdevicedialogsession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of DM Device Dialogs
- */
-
-#include "dmdevicedialogsession.h"
-#include "dmdevdialogclientserver.h"
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::CDmDeviceDialogSession
-// ----------------------------------------------------------------------------------------
-CDmDeviceDialogSession::CDmDeviceDialogSession()
-    {    
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::~CDmDeviceDialogSession
-// ----------------------------------------------------------------------------------------
-CDmDeviceDialogSession::~CDmDeviceDialogSession()
-    {
-    FLOG(_L("CDmDeviceDialogSession::~CDmDeviceDialogSession-- begin"));    
-    if ( !Server().RequestPending() )
-        {
-        FLOG(_L("CDmDeviceDialogSession::~CDmDeviceDialogSession Stopserver"));
-        Server().StopServer();
-        }
-    FLOG(_L("CDmDeviceDialogSession::~CDmDeviceDialogSession-- end"));
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::Server
-// ----------------------------------------------------------------------------------------
-CDmDeviceDialogServer& CDmDeviceDialogSession::Server()
-    {
-    return *static_cast<CDmDeviceDialogServer*> (const_cast<CServer2*> (CSession2::Server()));
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::CheckClientSecureIdL
-// ----------------------------------------------------------------------------------------
-TBool CDmDeviceDialogSession::CheckClientSecureId(const RMessage2& aMessage)
-    {
-    TUid fota = TUid::Uid(KFotaServerUid);
-    TUid sosserver = TUid::Uid(KSosServerUid);
-    TUid scomo = TUid::Uid(KScomoServerUid);
-
-    // Fotaserver
-    if (aMessage.SecureId() == fota.iUid)
-        {
-        FLOG(_L("[CDmDeviceDialogSession] CheckClientSecureId client is \
-		fotaserver!"));
-        return ETrue;
-        }
-
-    // Sosserver
-    else if (aMessage.SecureId() == sosserver.iUid)
-        {
-        FLOG(_L("[CDmDeviceDialogSession] CheckClientSecureId client is \
-      sosserver!"));
-        return ETrue;
-        }
-    // Scomoserver
-        else if (aMessage.SecureId() == scomo.iUid)
-            {
-            FLOG(_L("[CDmDeviceDialogSession] CheckClientSecureId client is \
-          SCOMO server!"));
-            return ETrue;
-            }
-    // test app
-    else if (aMessage.SecureId() == 0x102073E4)
-        {
-        FLOG(_L("[CDmDeviceDialogSession] CheckClientSecureId client is \
-        testapp!"));
-        return ETrue;
-        }
-    else
-        {
-        FLOG(_L("[CDmDeviceDialogSession] CheckClientSecureId client 0x%X is\
-                 unknown (msg %d), bailing out"),
-                aMessage.SecureId().iId, aMessage.Function());        
-        }
-    return EFalse;
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::ServiceL
-// ----------------------------------------------------------------------------------------
-void CDmDeviceDialogSession::ServiceL(const RMessage2& aMessage)
-    {
-    RThread clt;
-    aMessage.ClientL(clt);
-    TFullName cltnm = clt.FullName();
-    FLOG(_L( "CDmDeviceDialogSession::ServiceL      %d   serving for %S?" ),
-            aMessage.Function(), &cltnm);
-    if (CheckClientSecureId(aMessage))
-        {
-        FLOG(_L( "CDmDeviceDialogSession::ServiceL access ok"));
-		Server().CancelServerCloseRequest();
-		if(!Server().IsPkgZeroNoteDisplaying() || aMessage.Function() == 
-		        ECancelServerAlert )
-		    {
-            TRAPD(err,DispatchMessageL(aMessage));
-            FLOG(_L( "CDmDeviceDialogSession::ServiceL err is %d"), err);
-            User::LeaveIfError(err);
-		    }
-		else //User not responded to earlier package zero, so no other services 
-		    {
-            FLOG(_L( "CDmDeviceDialogSession::ServiceL server is busy"));
-            aMessage.Complete(KErrServerBusy);
-		    }        
-        }
-    else
-        {
-        FLOG(_L( "CDmDeviceDialogSession::ServiceL access denied"));
-        aMessage.Complete(KErrAccessDenied);
-        }
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::ServiceError
-// ----------------------------------------------------------------------------------------
-void CDmDeviceDialogSession::ServiceError(const RMessage2& aMessage,
-        TInt aError)
-    {
-    CSession2::ServiceError(aMessage, aError);
-    }
-
-// ----------------------------------------------------------------------------------------
-// CDmDeviceDialogSession::DispatchMessageL
-// ----------------------------------------------------------------------------------------
-void CDmDeviceDialogSession::DispatchMessageL(const RMessage2& aMessage)
-    {
-    FLOG(_L("CDmDeviceDialogSession::DispatchMessageL-begin"));
-    iMessage = aMessage;
-    switch (aMessage.Function())
-        {
-        case EServerAlert:
-            {
-            FLOG(_L("CDmDeviceDialogSession::DispatchMessageL \
-                     Server alert case:"));
-            TInt Uimode = aMessage.Int2();
-            if (Uimode == CDmDeviceDialogServer::ESANSilent)
-                aMessage.Complete(KErrNone);
-            else
-                {
-                Server().NewAsyncRequest();
-                TInt ProfileId = aMessage.Int0();
-                TInt JobId = aMessage.Int1();
-                TInt ReplySlot = 3;
-                Server().LaunchPkgZeroNoteL(ProfileId, JobId, ReplySlot, Uimode,
-                        iMessage);
-                }
-            }
-            break;
-        case EPkgConnectNoteIsActive:
-            {
-            FLOG(_L("CDmDeviceDialogSession::DispatchMessageL EPkgZeroOngoing \
-                     case:"));
-            TBool ret = Server().IsConenctDialogDisplaying();
-            TPckgBuf<TInt> callactive(ret);
-            aMessage.WriteL(0, callactive);
-            aMessage.Complete(KErrNone);
-            }
-            break;
-        case EPkgZeroConnectNoteDismiss:
-            {
-            FLOG(_L("CDmDeviceDialogSession::DispatchMessageL \
-                    EPkgZeroConnectNoteDismiss case:"));
-            if (Server().IsConenctDialogDisplaying())
-                Server().DismissDialog();
-            aMessage.Complete(KErrNone);
-            }
-            break;
-        case EPkgZeroConnectNoteShowAgain:
-            {
-            FLOG(_L("CDmDeviceDialogSession::DispatchMessageL \
-                    EPkgZeroConnectNoteShow case:"));
-            if (!Server().IsConenctDialogDisplaying())
-                Server().ShowConnectDialogAgainL();
-            aMessage.Complete(KErrNone);
-            }
-            break;
-        case EShowDisplayAlert:
-            {
-            FLOG(_L("CDmDeviceDialogSession::DispatchMessageL \
-                    EDisplayAlert case:"));	
-            HBufC* alerttext = HBufC::NewLC(aMessage.GetDesLengthL(0));
-            TPtr bufPtr = alerttext->Des();
-            aMessage.ReadL(0, bufPtr, 0);
-            Server().NewAsyncRequest();
-            Server().ShowDisplayalertL(bufPtr, iMessage);
-            CleanupStack::PopAndDestroy();             
-            }
-            break;
-        case EShowConfirmationalert:
-            {          
-            HBufC* alerttext = HBufC::NewLC(aMessage.GetDesLengthL(2));
-            TPtr alerttxtptr = alerttext->Des();
-            aMessage.ReadL(2, alerttxtptr);
-            HBufC* alertheader = HBufC::NewLC(aMessage.GetDesLengthL(1));
-            TPtr alertheaderptr = alertheader->Des();
-            aMessage.ReadL(1, alertheaderptr);
-            Server().NewAsyncRequest();
-            Server().ShowConfirmationalertL(aMessage.Int0(), alertheaderptr,
-                    alerttxtptr, iMessage);
-            CleanupStack::PopAndDestroy(2);
-            }
-            break;
-        case ECancelServerAlert:
-            {          
-            Server().CancelPendingServerAlert();
-            aMessage.Complete(KErrNone);
-            }
-            break;    
-        default:
-            {
-            FLOG(_L("CDmDeviceDialogSession::DispatchMessageL default case: \
-                    and a leave happened"));            
-            User::Leave(KErrArgument);
-            }
-        }
-    FLOG(_L("CDmDeviceDialogSession::DispatchMessageL:end"));
-    }
-//End of file
--- a/devicemgmtnotifications/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Build info file for Device management notification
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT   
-PRJ_EXPORTS
-
-../rom/devicemgmtnotifications.iby			CORE_MW_LAYER_IBY_EXPORT_PATH(devicemgmtnotifications.iby)
-
-PRJ_MMPFILES
-
-#include "../dmdevdialogclient/bld/bld.inf"
-#include "../dmdevdialogserver/bld/bld.inf"
--- a/devicemgmtnotifications/inc/dmdevdialogclientserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of DM Device Dialogs
-* 	This is part of syncmlfw.
-*/
-
-#ifndef __DMDEVDIALOG_CONSTS_H__
-#define __DMDEVDIALOG_CONSTS_H__
-
-#include <e32std.h>
-#include <e32base.h>
-
-// server name
-_LIT(KDMDEVDIALOGSERVER,"dmdevicedialog");
-
-const TInt KDmDevDialogServerVersionMinor = 0;
-const TInt KDmDevDialogServerVersionMajor = 1;
-const TUint KDefaultMessageSlots=4;
-const TUint KDmDevDialogUid = 0x2002FF68;
-
-enum TNotifiertype
-{
-	EServerAlert,
-	EPkgConnectNoteIsActive,
-	EPkgZeroConnectNoteDismiss,
-	EPkgZeroConnectNoteShowAgain,
-	EShowDisplayAlert,
-	EShowConfirmationalert,
-	ECancelServerAlert
-	
-};
-#endif
--- a/devicemgmtnotifications/rom/devicemgmtnotifications.iby	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include <bldvariant.hrh>
-
-#ifndef __DMNOTFIFICATIONS_IBY__
-#define __DMNOTFIFICATIONS_IBY__
-
-#ifdef __SYNCML_DM // nothing should be installed from this .iby file if __SYNCML_DM feature is not selected
-
-
-
-REM DM Device Dialog Client
-file=ABI_DIR\BUILD_DIR\dmdevdialogclient.dll    SHARED_LIB_DIR\dmdevdialogclient.dll
-
-REM DM Device Dialog Server
-file=ABI_DIR\BUILD_DIR\dmdevicedialog.exe    PROGRAMS_DIR\dmdevicedialog.exe
-
-#endif //__SYNCML_DM
-
-#endif //__DMNOTFIFICATIONS_IBY__
--- a/fotaapplication/FotaEngine/BWINS/fotaengineu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
-	?GetUpdatePackageIds@RFotaEngineSession@@QAEHAAVTDes16@@@Z @ 1 NONAME ; int RFotaEngineSession::GetUpdatePackageIds(class TDes16 &)
-	?TryResumeDownload@RFotaEngineSession@@QAEHH@Z @ 2 NONAME ; int RFotaEngineSession::TryResumeDownload(int)
-	?CurrentVersion@RFotaEngineSession@@QAEHAAVTDes16@@@Z @ 3 NONAME ; int RFotaEngineSession::CurrentVersion(class TDes16 &)
-	?Update@RFotaEngineSession@@QAEHHHABVTDesC8@@0@Z @ 4 NONAME ; int RFotaEngineSession::Update(int, int, class TDesC8 const &, class TDesC8 const &)
-	?GetResult@RFotaEngineSession@@QAEHH@Z @ 5 NONAME ; int RFotaEngineSession::GetResult(int)
-	?GetCurrentFirmwareDetailsL@RFotaEngineSession@@QAEXAAVTDes8@@0AAH@Z @ 6 NONAME ; void RFotaEngineSession::GetCurrentFirmwareDetailsL(class TDes8 &, class TDes8 &, int &)
-	?Close@RFotaEngineSession@@QAEXXZ @ 7 NONAME ; void RFotaEngineSession::Close(void)
-	?OpenL@RFotaEngineSession@@QAEXXZ @ 8 NONAME ; void RFotaEngineSession::OpenL(void)
-	?GetState@RFotaEngineSession@@QAE?AW4TState@1@H@Z @ 9 NONAME ; enum RFotaEngineSession::TState RFotaEngineSession::GetState(int)
-	?GenericAlertSentL@RFotaEngineSession@@QAEXH@Z @ 10 NONAME ; void RFotaEngineSession::GenericAlertSentL(int)
-	?ScheduledUpdateL@RFotaEngineSession@@QAEHVTFotaScheduledUpdate@@@Z @ 11 NONAME ; int RFotaEngineSession::ScheduledUpdateL(class TFotaScheduledUpdate)
-	?Version@RFotaEngineSession@@QBE?AVTVersion@@XZ @ 12 NONAME ; class TVersion RFotaEngineSession::Version(void) const
-	?PauseDownload@RFotaEngineSession@@QAEHXZ @ 13 NONAME ; int RFotaEngineSession::PauseDownload(void)
-	?DownloadAndUpdate@RFotaEngineSession@@QAEHHABVTDesC8@@H00H@Z @ 14 NONAME ; int RFotaEngineSession::DownloadAndUpdate(int, class TDesC8 const &, int, class TDesC8 const &, class TDesC8 const &, int)
-	?LastUpdate@RFotaEngineSession@@QAEHAAVTTime@@@Z @ 15 NONAME ; int RFotaEngineSession::LastUpdate(class TTime &)
-	?Download@RFotaEngineSession@@QAEHHABVTDesC8@@H00H@Z @ 16 NONAME ; int RFotaEngineSession::Download(int, class TDesC8 const &, int, class TDesC8 const &, class TDesC8 const &, int)
-	?DeleteUpdatePackage@RFotaEngineSession@@QAEHH@Z @ 17 NONAME ; int RFotaEngineSession::DeleteUpdatePackage(int)
-	??0RFotaEngineSession@@QAE@XZ @ 18 NONAME ; RFotaEngineSession::RFotaEngineSession(void)
-	?UpdatePackageDownloadComplete@RFotaEngineSession@@QAEXH@Z @ 19 NONAME ; void RFotaEngineSession::UpdatePackageDownloadComplete(int)
-	?OpenUpdatePackageStore@RFotaEngineSession@@QAEHHAAPAVRWriteStream@@@Z @ 20 NONAME ; int RFotaEngineSession::OpenUpdatePackageStore(int, class RWriteStream * &)
-	?IsPackageStoreSizeAvailable@RFotaEngineSession@@QAEHH@Z @ 21 NONAME ; int RFotaEngineSession::IsPackageStoreSizeAvailable(int)
-	?GetDownloadUpdatePackageSize@RFotaEngineSession@@QAEHHAAH0@Z @ 22 NONAME ; int RFotaEngineSession::GetDownloadUpdatePackageSize(int, int &, int &)
-
--- a/fotaapplication/FotaEngine/INC/fotaenginedebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   This file defines logging macros 
-*
-*/
-
-
-
-#ifndef FOTADEBUG_H
-#define FOTADEBUG_H
-
-    // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
-    #ifdef _FOTA_DEBUG
-
-        #include <e32std.h>
-        #include <f32file.h>
-        #include <flogger.h>
-        #include <e32svr.h>
-
-        _LIT( KLogFile, "fotaengine.log" );
-        _LIT( KLogDirFullName, "c:\\logs\\" );
-        _LIT( KLogDir, "fota" );
-
-        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
-            {
-            VA_LIST list;
-            VA_START( list, aFmt );
-            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
-            }
-
-
-        #ifdef _FOTA_DEBUG_RDEBUG 
-            #ifndef __GNUC__          
-                #define FLOG            RDebug::Print
-            #else   // __GNUC__       
-                #define FLOG(arg...)    RDebug::Print(arg);
-            #endif // __GNUC__        
-        #else // _FOTA_DEBUG_RDEBUG
-            #ifndef __GNUC__          
-                #define FLOG            FWrite
-            #else   // __GNUC__       
-                #define FLOG(arg...)    FWrite(arg);
-            #endif // __GNUC__        
-        #endif // _FOTA_DEBUG_RDEBUG
-
-    #else   // _FOTA_DEBUG    
-        #ifndef __GNUC__
-            #define FLOG
-        #else
-            #define FLOG(arg...)
-        #endif // __GNUC__
-    #endif // _FOTA_DEBUG
-
-#endif      // FOTADEBUG_H
-            
-// End of File
--- a/fotaapplication/FotaEngine/SRC/fotaengine.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,416 +0,0 @@
-/*
-* 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:   Client for fotaserver
-*
-*/
-
-
-// INCLUDES
-#include <bldvariant.hrh>
-#include <fotaengine.h>
-#include "FotaIPCTypes.h"
-#include "fotaConst.h"
-#include "fotaenginedebug.h"
-#include <apgcli.h>
-
-       
-
-// =================== LOCAL FUNCTIONS ========================================
-
-
-// ---------------------------------------------------------------------------
-// StartServerL()  
-//  Starts Fota Downlaod Interrupt Monitory server
-// ---------------------------------------------------------------------------
-TInt StartServerL()
-    {
-    FLOG(_L("StartServerLt Started"));
-    TInt res = KErrNone;
-    
-    RProcess server;
-    RSemaphore sem;
-    res = sem.CreateGlobal(KFotaServerScem, EOwnerProcess);
-
-    res=server.Create(KFotaServerName,KNullDesC);
-    FLOG(_L("StartServerL-- create server error as %d"),res);
-    if (res!=KErrNone)
-        {       
-        return res;
-        }
-
-    server.Resume();    // logon OK - start the server
-    
-    sem.Wait();
-    sem.Close();
-    server.Close();
-    
-    FLOG(_L("StartServerL-- server.ExitType() returns %d"),res);
-
-    return res;
-    }
-
-/**
- * Connects to the  server using 4 message slots.
- */
-TBool RFotaEngineSession::connectToHbServer()
-{
-    FLOG(_L("RFotaEngineSession::connectToHbServer >>"));
-
-    TInt error = CreateSession(KFotaServerName,TVersion(1,0,0),2);
-
-    if (KErrNone != error) {
-        FLOG(_L("RFotaEngineSession::Error: %d"), error);
-    }
-    FLOG(_L("RFotaEngineSession::connectToHbServer <<"));
-    return (KErrNone == error); 
-}
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::OpenL( )
-// Opens session to fotaserver. 
-// ---------------------------------------------------------------------------
-EXPORT_C void RFotaEngineSession::OpenL( )
-{
-    RProcess pr; TFullName fn = pr.FullName(); 
-
-    TInt res = KErrNone;
-    FLOG(_L("[RFotaEngineSession] OpenL\tcalled by '%S' >>"),&fn );
-    
-    res = connectToHbServer();
-    if(!res)
-        {
-    FLOG(_L("Creation of session failed with error: %d; starting the server now..."), res);
-        res = StartServerL();
-        
-        FLOG(_L("Starting of the server, error = %d"), res);
-        User::LeaveIfError( res );
-
-        res = CreateSession( KFotaServerName,TVersion(1,0,0),2 );
-        FLOG(_L("Creation of session,  error: %d; "), res);
-        User::LeaveIfError (res);
-    
-        }
-    
-    FLOG(_L("[RFotaEngineSession]\tconnected <<") );
-}
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::Close( )
-// Closes session to fotaserver
-// ---------------------------------------------------------------------------
-EXPORT_C void RFotaEngineSession::Close( )
-{
-    RProcess pr; TFullName fn = pr.FullName(); 
-    FLOG(_L("[RFotaEngineSession] RFotaEngineSession::Close() >> called by '%S'"),&fn );
-        
-    // Tell server that generic alert is sent for this pkg, so state is 
-    // cleaned up     
-    FLOG(_L("iGenericAlertSentPkgID = %d"), iGenericAlertSentPkgID);
-    if ( iGenericAlertSentPkgID != -1 )
-        {
-        TInt err = SendReceive( EGenericAlertSentForPackage
-                                    , TIpcArgs(iGenericAlertSentPkgID) );
-        }
-
-    RSessionBase::Close();
-    FLOG(_L("[RFotaEngineSession] RFotaEngineSession::Close() <<") );
-}
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::Download
-// Starts download of upd package.
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::Download(const TInt aPkgId
-    , const TDesC8& aPkgURL, const TSmlProfileId aProfileId
-    , const TDesC8& aPkgName, const TDesC8& aPkgVersion, TBool aSilent)
-{
-    TInt err;
-    TDownloadIPCParams          ipcparam;
-    ipcparam.iPkgId             = aPkgId;
-    ipcparam.iProfileId         = aProfileId;
-    ipcparam.iPkgName.Copy      (aPkgName);
-    ipcparam.iPkgVersion.Copy   (aPkgVersion);
-    TPckg<TDownloadIPCParams>   pkg(ipcparam);
-    err = SendReceive ( EFotaDownload ,  TIpcArgs(&pkg, &aPkgURL, aSilent));
-    return err;
-}
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::DownloadAndUpdate
-// Starts download and update of update pakcage
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::DownloadAndUpdate(const TInt aPkgId
-        ,const TDesC8& aPkgURL, const TSmlProfileId aProfileId
-        ,const TDesC8& aPkgName, const TDesC8& aPkgVersion, TBool aSilent)
-{
-    TInt err;
-    TDownloadIPCParams          ipcparam;
-    ipcparam.iPkgId             = aPkgId;
-    ipcparam.iProfileId         = aProfileId;
-    ipcparam.iPkgName.Copy      (aPkgName);
-    ipcparam.iPkgVersion.Copy   (aPkgVersion);
-    TPckg<TDownloadIPCParams>   pkg(ipcparam);
-    err = SendReceive( EFotaDownloadAndUpdate,  TIpcArgs(&pkg, &aPkgURL, aSilent));
-    return err;
-}
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::Update
-// Starts update of update package
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::Update(const TInt aPkgId
-        ,const TSmlProfileId aProfileId, const TDesC8& aPkgName
-        ,const TDesC8& aPkgVersion)
-{
-    TInt err;
-    TDownloadIPCParams          ipcparam;
-    ipcparam.iPkgId             = aPkgId;
-    ipcparam.iProfileId         = aProfileId;
-    ipcparam.iPkgName.Copy      (aPkgName);
-    ipcparam.iPkgVersion.Copy   (aPkgVersion);
-    TPckg<TDownloadIPCParams>   pkg(ipcparam);
-    err = SendReceive ( EFotaUpdate ,  TIpcArgs(&pkg));
-    return err;
-}
-
-// --------------------------------------------------------------------------
-// RFotaEngineSession::PauseDownload
-// To pause the download
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::PauseDownload ( )
-    {
-    TInt err(KErrNotSupported);
-
-    err = SendReceive( EPauseDownload );
-
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::TryResumeDownload
-// Requests to resume the suspended download of the update package. 
-// Implementation is not ready and will be provided later.
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::TryResumeDownload(TBool aSilent)
-	{
-	FLOG(_L("RFotaEngineSession::TryResumeDownload >>"));
-
-	TInt err = KErrNone;
-	
-	err = SendReceive( EFotaTryResumeDownload, TIpcArgs( aSilent) );
-	
-	FLOG(_L("RFotaEngineSession::TryResumeDownload << err = %d" ),err);
-	return err;
-	}
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::GetState
-// ---------------------------------------------------------------------------
-EXPORT_C RFotaEngineSession::TState RFotaEngineSession::GetState(
-                                                         const TInt aPkgId)
-    {
-    FLOG(_L("RFotaEngineSession::GetState >>"));
-
-    RFotaEngineSession::TState          state;
-    TPckg<RFotaEngineSession::TState>   pkgstate(state);
-    SendReceive ( EGetState , TIpcArgs(aPkgId, &pkgstate));
-    FLOG(_L("RFotaEngineSession::GetState <<"));
-
-    return state;
-    }
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::GetResult    
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::GetResult(const TInt aPkgId)
-    {
-    FLOG(_L("RFotaEngineSession::GetResult"));
-    TInt            result;
-    TPckg<TInt>     pkgresult(result);
-    SendReceive ( EGetResult , TIpcArgs(aPkgId, &pkgresult));
-    return result;
-    }
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::DeleteUpdatePackage
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::DeleteUpdatePackage(const TInt aPkgId)
-{
-    TInt err = SendReceive(EDeletePackage, TIpcArgs(aPkgId) );
-    return err;
-}
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::LastUpdate
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::LastUpdate(TTime& aUpdates)
-    {
-    TInt err;
-    FLOG(_L("RFotaEngineSession::LastUpdate >>"));
-    TBuf<15>                    timestamp;
-    err = SendReceive ( EGetUpdateTimestamp, TIpcArgs(&timestamp) );
-
-    if ( timestamp.Length() > 0 )
-        {
-        TInt year   = timestamp[0];
-        TInt month  = timestamp[1];
-        TInt day    = timestamp[2];
-        TInt hour   = timestamp[3];
-        TInt minute = timestamp[4];
-        aUpdates = TDateTime (year,(TMonth)month,day,hour,minute,0,0 );
-        }
-    else
-        {
-        aUpdates.Set( _L( "19900327:101010.000000" ) ); 
-        err = KErrUnknown;
-        }
-    FLOG(_L("RFotaEngineSession::LastUpdate <<"));
-    return err;
-    }
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::CurrentVersion
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::CurrentVersion(TDes& aSWVersion)
-    {
-    aSWVersion.Copy(_L("1.0"));  
-    return KErrNone;
-    }
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::RFotaEngineSession
-// ---------------------------------------------------------------------------
-EXPORT_C RFotaEngineSession::RFotaEngineSession() : iGenericAlertSentPkgID(-1)
-    {
-    FLOG(_L("RFotaEngineSession::RFotaEngineSession() >>"));
-    FLOG(_L("RFotaEngineSession::RFotaEngineSession() <<"));
-    }
-
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::GetUpdatePackageIds
-// Gets ids of the update packages present in the system.
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::GetUpdatePackageIds(TDes16& aPackageIdList)
-    {
-    TInt err;
-    FLOG(_L("RFotaEngineSession::GetUpdatePackageIds >>"));
-    TBuf<10> b; b.Copy(_L("dkkd"));
-    TPkgIdList                  pkgids;
-    TPckg<TPkgIdList>           pkgids_pkg(pkgids);
-    TIpcArgs                    args ( &pkgids_pkg);
-    err = SendReceive ( EGetUpdatePackageIds, args);
-    aPackageIdList.Copy(pkgids);
-    FLOG(_L("RFotaEngineSession::GetUpdatePackageIds <<"));
-    return err;
-    }
-
-
-EXPORT_C TVersion RFotaEngineSession::Version() const
-    {
-    TVersion version (1,0,0);
-      
-    return version;
-    }
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::GenericAlertSentL
-// marks genereic alert being sent
-// ---------------------------------------------------------------------------
-EXPORT_C void RFotaEngineSession::GenericAlertSentL ( const TInt aPackageID )
-    {
-    FLOG(_L("RFotaEngineSession::GenericAlertSentL, aPackageID = %d >>"),aPackageID);
-    iGenericAlertSentPkgID = aPackageID;
-    FLOG(_L("RFotaEngineSession::GenericAlertSentL, iGenericAlertSentPkgID = %d <<"), iGenericAlertSentPkgID);
-    }
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::ScheduledUpdateL
-// Update fw
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFotaEngineSession::ScheduledUpdateL ( const TFotaScheduledUpdate aSchedule )
-    {
-  	TInt err(KErrNotSupported);
-
-    TPckg<TFotaScheduledUpdate> p(aSchedule);
-    err = SendReceive( EScheduledUpdate, TIpcArgs(&p) );
-
-    return err;
-    }
-
-EXPORT_C void RFotaEngineSession::GetCurrentFirmwareDetailsL(TDes8& aName, TDes8& aVersion, TInt& aSize)
-    {
-    FLOG(_L("RFotaEngineSession::GetCurrentFirmwareDetailsL >>"));
-    
-    TPckg<TInt>     pkgsize(aSize);
-    
-    __ASSERT_ALWAYS(aName.MaxLength() >= KFotaMaxPkgNameLength, User::Leave(KErrArgument) );
-    __ASSERT_ALWAYS(aName.MaxLength() >= KFotaMaxPkgVersionLength, User::Leave(KErrArgument) );
-    
-    TInt err = SendReceive(EGetCurrFwDetails, TIpcArgs(&aName, &aVersion, &pkgsize));
-    
-    FLOG(_L("RFotaEngineSession::GetCurrentFirmwareDetailsL, err = %d <<"), err);
-    User::LeaveIfError(err);
-    }
-
-// ---------------------------------------------------------------------------
-// RFotaEngineSession::ServiceUid
-// Apparc asks which session class to create in server side
-// ---------------------------------------------------------------------------
-TUid RFotaEngineSession::ServiceUid() const
-	{
-    RProcess pr; TFullName fn = pr.FullName(); 
-    FLOG(_L( "RFotaEngineSession::ServiceUid() >> called by: %S" ), &fn );
-    FLOG(_L( "RFotaEngineSession::ServiceUid() << ret: 0x%X" ),
-                                            KFotaServiceUid );
-	return TUid::Uid( KFotaServiceUid );
-	}
-	
-/*
- * The following exported functions are not supported in SF4
- * They would be removed once stakeholder remove dependency with them.
- * Polonium CR: 530
- */ 
-	
-EXPORT_C TBool RFotaEngineSession::IsPackageStoreSizeAvailable(
-        const TInt aSize)
-    {
-    return EFalse;
-    }
-
-EXPORT_C TInt RFotaEngineSession::OpenUpdatePackageStore(const TInt aPkgId,
-        RWriteStream*& aPkgStore)
-    {
-    return KErrNotSupported;
-    }
-
-EXPORT_C TInt RFotaEngineSession::GetDownloadUpdatePackageSize(
-        const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize)
-    {
-    return KErrNotSupported;
-    }
-
-EXPORT_C void RFotaEngineSession::UpdatePackageDownloadComplete(
-        const TInt aPkgId)
-    {
-    
-    }
-
--- a/fotaapplication/FotaEngine/eabi/fotaengineu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-EXPORTS
-	_ZN18RFotaEngineSession10LastUpdateER5TTime @ 1 NONAME
-	_ZN18RFotaEngineSession13PauseDownloadEv @ 2 NONAME
-	_ZN18RFotaEngineSession14CurrentVersionER6TDes16 @ 3 NONAME
-	_ZN18RFotaEngineSession16ScheduledUpdateLE20TFotaScheduledUpdate @ 4 NONAME
-	_ZN18RFotaEngineSession17DownloadAndUpdateEiRK6TDesC8iS2_S2_i @ 5 NONAME
-	_ZN18RFotaEngineSession17GenericAlertSentLEi @ 6 NONAME
-	_ZN18RFotaEngineSession17TryResumeDownloadEi @ 7 NONAME
-	_ZN18RFotaEngineSession19DeleteUpdatePackageEi @ 8 NONAME
-	_ZN18RFotaEngineSession19GetUpdatePackageIdsER6TDes16 @ 9 NONAME
-	_ZN18RFotaEngineSession26GetCurrentFirmwareDetailsLER5TDes8S1_Ri @ 10 NONAME
-	_ZN18RFotaEngineSession5CloseEv @ 11 NONAME
-	_ZN18RFotaEngineSession5OpenLEv @ 12 NONAME
-	_ZN18RFotaEngineSession6UpdateEiiRK6TDesC8S2_ @ 13 NONAME
-	_ZN18RFotaEngineSession8DownloadEiRK6TDesC8iS2_S2_i @ 14 NONAME
-	_ZN18RFotaEngineSession8GetStateEi @ 15 NONAME
-	_ZN18RFotaEngineSession9GetResultEi @ 16 NONAME
-	_ZN18RFotaEngineSessionC1Ev @ 17 NONAME
-	_ZN18RFotaEngineSessionC2Ev @ 18 NONAME
-	_ZNK18RFotaEngineSession7VersionEv @ 19 NONAME
-	_ZN18RFotaEngineSession22OpenUpdatePackageStoreEiRP12RWriteStream @ 20 NONAME
-	_ZN18RFotaEngineSession27IsPackageStoreSizeAvailableEi @ 21 NONAME
-	_ZN18RFotaEngineSession28GetDownloadUpdatePackageSizeEiRiS0_ @ 22 NONAME
-	_ZN18RFotaEngineSession29UpdatePackageDownloadCompleteEi @ 23 NONAME
-
--- a/fotaapplication/FotaEngine/group/fotaengine.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   Project specification file for fotaengine
-*
-*/
-
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-//MACRO  _FOTA_DEBUG 
-//MACRO  _FOTA_DEBUG_RDEBUG
-
-TARGET          fotaengine.dll
-TARGETTYPE      DLL
-UID             0x1000008d 0x102072C5
-
-CAPABILITY CAP_GENERAL_DLL
-VENDORID                VID_DEFAULT
-
-SOURCEPATH      ../SRC
-SOURCE          fotaengine.cpp
-//SOURCE          fotaengstream.cpp
-SOURCEPATH		../../inc
-SOURCE          FotaIPCTypes.cpp
-
-USERINCLUDE    ../INC  ../../inc ../../cenrep
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE		/epoc32/include/uiklaf/private
-
-LIBRARY         avkon.lib
-LIBRARY         euser.lib
-LIBRARY         estor.lib
-LIBRARY         apparc.lib
-LIBRARY         cone.lib
-LIBRARY         bafl.lib
-LIBRARY         apgrfx.lib
-LIBRARY         mtur.lib
-LIBRARY         eikcore.lib
-LIBRARY			efsrv.lib
-LIBRARY			ws32.lib			// wssession
-LIBRARY			centralrepository.lib
-LIBRARY	flogger.lib
-
-SMPSAFE
-
-//End of file
--- a/fotaapplication/FotaScheduleHandler/group/fotaschedulehandler.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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:   Handles scheduled update, starts fotaserver and request upd
-*
-*/
-
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-//MACRO  _FOTA_DEBUG
-//MACRO  _FOTA_DEBUG_RDEBUG
-
-
-TARGET          	fotaschedulehandler.exe
-TARGETTYPE		EXE
-
-EPOCSTACKSIZE 0x5400
-
-UID 0x100039CE 0x101F99FA
-
-// set vendor id (from defaultcaps.hrh)
-VENDORID VID_DEFAULT
-
-// set dll capability (from defaultcaps.hrh)
-CAPABILITY  CAP_APPLICATION
-
-
-SOURCEPATH ../src
-
-SOURCE				fotaschedulehandler.cpp
-
-USERINCLUDE . 
-USERINCLUDE ../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY	euser.lib
-LIBRARY	efsrv.lib
-LIBRARY	estor.lib
-LIBRARY	schsvr.lib
-LIBRARY	fotaengine.lib
-LIBRARY	flogger.lib
-
-SMPSAFE
\ No newline at end of file
--- a/fotaapplication/FotaScheduleHandler/inc/FotaSchedDebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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 file defines logging macros 
-*
-*/
-
-
-
-#ifndef FOTADEBUG_H
-#define FOTADEBUG_H
-
-    #ifdef _FOTA_DEBUG
-
-
-        #include <e32std.h>
-        #include <f32file.h>
-        #include <flogger.h>
-        #include <e32svr.h>
-
-        _LIT( KLogFile, "fotaschedhandler.log" );
-        _LIT( KLogDir, "fota" );
-
-        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
-            {
-            VA_LIST list;
-            VA_START( list, aFmt );
-            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
-            }
-
-
-        #ifdef _FOTA_DEBUG_RDEBUG 
-            #ifndef __GNUC__          
-                #define FLOG            RDebug::Print
-            #else   // __GNUC__       
-                #define FLOG(arg...)    RDebug::Print(arg);
-            #endif // __GNUC__        
-        #else // _FOTA_DEBUG_RDEBUG
-            #ifndef __GNUC__          
-                #define FLOG            FWrite
-            #else   // __GNUC__       
-                #define FLOG(arg...)    FWrite(arg);
-            #endif // __GNUC__        
-        #endif // _FOTA_DEBUG_RDEBUG
-
-    #else   // _FOTA_DEBUG    
-        #ifndef __GNUC__
-            #define FLOG
-        #else
-            #define FLOG(arg...)
-        #endif // __GNUC__
-    #endif // _FOTA_DEBUG
-
-#endif      // FOTADEBUG_H
-            
-// End of File
--- a/fotaapplication/FotaScheduleHandler/src/fotaschedulehandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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:   Handles scheduled update, starts fotaserver and request upd
-*
-*/
-
-
-
-#include <schinfo.h>
-#include <schtask.h>
-#include <s32file.h>
-#include <e32math.h>
-#include <e32cons.h>
-
-#include "FotaSchedDebug.h"
-#include "fotaengine.h"
-#include "../../inc/FotaIPCTypes.h"
-
-// Constants
-
-// -----------------------------------------------------------------------------
-// UpdateFirmwareL
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_D void UpdateFirmwareL(RFile& aTaskFile)
-	{
-    FLOG(_L("fotaschedulehandler UpdateFirmwareL(RFile& aTaskFile)"));
-    TInt err;
-    CFileStore*         store;
-    RStoreReadStream    instream;
-    // Get tasks from scheduler's store
-    store = CDirectFileStore::FromLC(aTaskFile);
-    instream.OpenLC(*store,store->Root());
-    TInt count = instream.ReadInt32L();
-    FLOG(_L("fotaschedulehandler  task count  %d"),count );
-	for (TInt i=0;i<count;i++)
-        {
-		CScheduledTask* task = CScheduledTask::NewLC(instream);
-        HBufC* b = const_cast<HBufC*>(&(task->Data()));
-        TPtr ptr = b->Des();
-        HBufC8* b8 = HBufC8::NewLC( b->Length() );
-        b8->Des().Copy(ptr);
-        TFotaScheduledUpdate fotareminder(-1,-1);
-        TPckg<TFotaScheduledUpdate>   fotareminderpkg(fotareminder);
-        fotareminderpkg.Copy(b8->Des());
-        CleanupStack::PopAndDestroy( b8 );
-        FLOG(_L("fotaschedulehandler packageid:%d  sched:%d"),fotareminder.iPkgId, fotareminder.iScheduleId);
-        RFotaEngineSession fota;
-        fota.OpenL();
-        CleanupClosePushL( fota );
-        err = fota.ScheduledUpdateL (fotareminder);
-        if(err){} // to remove compiler warning
-        FLOG(_L("fotaschedulehandler       2........ err %d"),err);
-        fota.Close();
-        FLOG(_L("fotaschedulehandler       3 "));
-        CleanupStack::PopAndDestroy( &fota); 
-		CleanupStack::PopAndDestroy(task);
-        }
-	CleanupStack::PopAndDestroy( &instream ); 
-	CleanupStack::PopAndDestroy( store ); 
-	}
-
-
-// -----------------------------------------------------------------------------
-// ExecuteL
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_D TInt ExecuteL()
-	{
-	TInt err = KErrNoMemory;
-		
-	RFile file;
-		
-	// Adopt the task file from the Task Scheduler
-	err = file.AdoptFromCreator(TScheduledTaskFile::FsHandleIndex(),
-									TScheduledTaskFile::FileHandleIndex());
-    FLOG(_L("  err  %d"),err );
-	User::LeaveIfError(err);
-	
-	TRAP(err, UpdateFirmwareL(file));
-	
-	file.Close();
-	
-	User::LeaveIfError(err);
-	
-	return err;
-	}
-
-
-// -----------------------------------------------------------------------------
-// Execute
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_D TInt Execute()
-	{
-    FLOG(_L("fotaschedulehandler Execute()"));
-	TInt err = KErrNoMemory;
-	
-	// construct and install active scheduler
-	CActiveScheduler* scheduler = new CActiveScheduler;
-	if (!scheduler)
-		{
-		return err;
-		}
-	CActiveScheduler::Install(scheduler);
-	CTrapCleanup* cleanupStack = CTrapCleanup::New();
-	if (cleanupStack)
-		{
-        TRAP(err, ExecuteL());
-		delete cleanupStack;
-		}
-    delete scheduler;
-	return err;
-	}
-
-
-// -----------------------------------------------------------------------------
-// E32Main
-//
-// -----------------------------------------------------------------------------
-//
-GLDEF_C TInt E32Main()
-	{
-	return Execute();
-	}
-
-
-
--- a/fotaapplication/cenrep/fotadiskstoragePrivateCRKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* 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:   fotadiskstorage's cenrep keys
-*
-*/
-
-
-
-#ifndef FOTADISKSTORAGE_PRIVATE_KEYS_H
-#define FOTADISKSTORAGE_PRIVATE_KEYS_H
-
-// CONSTANTS
-
-// fotadiskstorage key UID
-const TUid KCRUidFotaDiskStorage = { 0x102072C6 };
-
-// How much space should be reserved for firmware update package
-const TUint32 KFotaDiskSpaceReservationKey = 0x00000001;
-
-#endif // FOTADISKSTORAGE_PRIVATE_KEYS_H
-            
-// End of File
--- a/fotaapplication/cenrep/fotaserverPrivateCRKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* 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:   	CR keys for fotaserver
-*
-*/
-
-
-
-#ifndef FOTASERVER_PRIVATE_KEYS_H
-#define FOTASERVER_PRIVATE_KEYS_H
-
-// CONSTANTS
-
-// FS key UID
-const TUid KCRUidFotaServer = { 0x102072C4 };
-
-// Device manager key UID
-const TUid KPSUidNSmlDMSyncApp = {0x101f6de5};
-// Whether update agent should be simulated by FS
-const TUint32 KSimulateUpdateAgent = 0x00000001;
-
-//Flag to enable/disable the  feature ,.."Send Generic alert after device reboots"
-//Allowed values   1  , 0 
-const TUint32 KGenericAlertResendAfterBoot = 0x00000002;
-
-//Flag to configure number of retries for sending GA in failure cases.
-
-const TUint32 KGenericAlertRetries = 0x00000003;
-
-//Determines state of fota update.
-//0 - Default , no action taken. 
-//1 - Firmware update/GA 
-//2. Download Interrupted
-
-const TUint32 KFotaUpdateState   = 0x00000004;
-
-//Determines whether the Fota Monitory Service is enabled or not.
-//0 (default ) - Feature OFF
-//1   - Feature ON
-
-const TUint32  KFotaMonitoryServiceEnabled = 0x00000005;
-
-/*
-* This key is used to determine the maximum number of postpones allowed for a FOTA Update.
-* Default value : 3
-*/
-
-const TUint32 KFOTAMaxPostponeCount = 0x00000006; 
-
-
-/*
-* This key is used to determine the number of postpones done by the user for a particular FOTA Update.
-* Default value : 0
-*/
-
-const TUint32 KFOTAUserPostponeCount = 0x00000007; 
-
-const TUint32 KUpdateRequesterUid = 0x0000008;
-
-const TUint32 KFOTADownloadRestartCount = 0x0000009;
-
-#endif // FOTASERVER_PRIVATE_KEYS_H
-            
-// End of File
Binary file fotaapplication/conf/CI_fotadiskstorage.confml has changed
Binary file fotaapplication/conf/CI_fotaserver.confml has changed
Binary file fotaapplication/conf/fotadiskstorage.confml has changed
Binary file fotaapplication/conf/fotadiskstorage_102072C6.crml has changed
Binary file fotaapplication/conf/fotaserver.confml has changed
Binary file fotaapplication/conf/fotaserver_102072C4.crml has changed
--- a/fotaapplication/fmsclient/bwins/fmsclientu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	?Close@RFMSClient@@QAEXXZ @ 1 NONAME ; void RFMSClient::Close(void)
-	?Cancel@RFMSClient@@QAEXXZ @ 2 NONAME ; void RFMSClient::Cancel(void)
-	?OpenL@RFMSClient@@QAEHXZ @ 3 NONAME ; int RFMSClient::OpenL(void)
-	?IsPhoneCallActive@RFMSClient@@QAEHAAH@Z @ 4 NONAME ; int RFMSClient::IsPhoneCallActive(int &)
-	?NotifyForUpdateL@RFMSClient@@QAEXABW4TFmsIpcCommands@@I@Z @ 5 NONAME ; void RFMSClient::NotifyForUpdateL(enum TFmsIpcCommands const &, unsigned int)
-	?NotifyForResumeL@RFMSClient@@QAEXABW4TFmsIpcCommands@@ABHABW4TDriveNumber@@1@Z @ 6 NONAME ; void RFMSClient::NotifyForResumeL(enum TFmsIpcCommands const &, int const &, enum TDriveNumber const &, int const &)
-
--- a/fotaapplication/fmsclient/eabi/fmsclientu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	_ZN10RFMSClient16NotifyForResumeLERK15TFmsIpcCommandsRKiRK12TDriveNumberS4_ @ 1 NONAME
-	_ZN10RFMSClient16NotifyForUpdateLERK15TFmsIpcCommandsj @ 2 NONAME
-	_ZN10RFMSClient17IsPhoneCallActiveERi @ 3 NONAME
-	_ZN10RFMSClient5CloseEv @ 4 NONAME
-	_ZN10RFMSClient5OpenLEv @ 5 NONAME
-	_ZN10RFMSClient6CancelEv @ 6 NONAME
-
--- a/fotaapplication/fmsclient/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-// BLD.INF
-// Component description file 
-//
-
-PRJ_MMPFILES
-
-FMSClient.mmp
-
--- a/fotaapplication/fmsclient/group/fmsclient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <platform_paths.hrh>
-#include "defaultcaps.hrh"
-
-//MACRO  _FOTA_DEBUG
-//MACRO  _FOTA_DEBUG_RDEBUG
-
-CAPABILITY	CAP_CLIENT_DLL 
-
-TARGET        fmsclient.dll
-TARGETTYPE    dll
-UID 0x1000008D 0x200100C7
-VENDORID 			VID_DEFAULT
-
-SOURCEPATH    ../src
-SOURCE        fmsclient.cpp
-
-USERINCLUDE   ../inc
-USERINCLUDE   ../../inc
-USERINCLUDE   ../../cenrep
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY       euser.lib  
-LIBRARY 	  bafl.lib 
-LIBRARY 	  efsrv.lib 
-LIBRARY		  centralrepository.lib
-LIBRARY       flogger.lib
-
-SMPSAFE
\ No newline at end of file
--- a/fotaapplication/fmsclient/inc/fmsclient.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#ifndef __FMS_CLIENT_H__
-#define __FMS_CLIENT_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <e32cmn.h>
-#include <f32file.h>
-#include "fmsclientserver.h"
-
-
-class RFMSClient : public RSessionBase
-	{
-	public:
-		/**
-		 * Launches FMSServer
-		 * @param None
-		 * @return KErrNone Symbian error code
-		 */
-		IMPORT_C TInt OpenL();
-		
-		/**
-		 * Close server connection
-		 * @param None
-		 * @return None
-		 */
-		IMPORT_C void Close();
-		
-		/**
-		 * Sending the parameters to FMSServer
-		 * FotaServer or test app should use this
-		 * @param aReason
-		 * @param aBearer
-		 * @param aDrive
-		 * @param aSize
-		 * @return None
-		 */
-		IMPORT_C void NotifyForResumeL(const TFmsIpcCommands& aReason, 
-		  const TInt& aBearer, const TDriveNumber& aDrive, const TInt& aSize);						
-		
-		
-		 /**
-		  * phone call active check to FMSServer
-		  * @param aCallActive, on return holds call status
-		  * @return TInt, error code
-		  */
-		 IMPORT_C TInt IsPhoneCallActive(TInt& aCallActive);
-		 
-		 
-		 IMPORT_C void NotifyForUpdateL(const TFmsIpcCommands& aReason, TUint aLevel = 2);
-		 
-	     /**
-	         * Cancels the request on FMSServer
-	         * @param None
-	         * @return None
-	         */
-         IMPORT_C void Cancel();
-		 
-	private:
-		/* 
-		 * FotaStartUp uses this at the time of reboot 
-		 * to trigger FMS server
-		 * @param None
-		 * @return None
-		 */
-		 void SendInterruptParamsL();
-};
-
-#endif
--- a/fotaapplication/fmsclient/inc/fmsclientdebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#ifndef FMS_CLIENT_DEBUG_H_
-#define FMS_CLIENT_DEBUG_H_
-   #ifdef _FOTA_DEBUG
-
-        #include <e32std.h>
-        #include <f32file.h>
-        #include <flogger.h>
-        #include <e32svr.h>
-
-        _LIT( KLogFile, "fmsclient.log" );
-        _LIT( KLogDirFullName, "c:\\logs\\" );
-        _LIT( KLogDir, "fota" );
-
-        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
-            {
-            VA_LIST list;
-            VA_START( list, aFmt );
-            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
-            }
-
-
-        #ifdef _FOTA_DEBUG_RDEBUG 
-            #ifndef __GNUC__          
-                #define FLOG            RDebug::Print
-            #else   // __GNUC__       
-                #define FLOG(arg...)    RDebug::Print(arg);
-            #endif // __GNUC__        
-        #else // _FOTA_DEBUG_RDEBUG
-            #ifndef __GNUC__          
-                #define FLOG            FWrite
-            #else   // __GNUC__       
-                #define FLOG(arg...)    FWrite(arg);
-            #endif // __GNUC__        
-        #endif // _FOTA_DEBUG_RDEBUG
-
-    #else   // _FOTA_DEBUG    
-        #ifndef __GNUC__
-            #define FLOG
-        #else
-            #define FLOG(arg...)
-        #endif // __GNUC__
-    #endif // _FOTA_DEBUG
-
-
-#endif /*FMSCLIENTDEBUG_H_*/
--- a/fotaapplication/fmsclient/src/fmsclient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <f32file.h>
-#include <fotaConst.h>
-#include <fotaengine.h>
-#include "fmsclientserver.h"
-#include "fmsclient.h"
-#include "fmsclientdebug.h"
-
-#include "fotaserverPrivateCRKeys.h"
-#include <centralrepository.h>
-// ---------------------------------------------------------------------------
-// IsSecureClient()  
-// Checks who is trying to launch FMS
-// ---------------------------------------------------------------------------
-TBool IsSecureClient(TBool& aFotaStartUp)
-	{
-	FLOG(_L("IsSecureClient Started"));
-	RThread thread;
-	TUid fotaserver,fotastartup;
-	fotaserver.iUid = KFotaServerUid;
-	fotastartup.iUid = KStarterUid;	
-	if ( thread.SecureId() == fotaserver.iUid ) 
-		{
-		FLOG(_L("fmsclient fotaserver is using the service"));
-		return ETrue;
-		}
-	else if ( thread.SecureId() ==  fotastartup.iUid )
-		{
-		FLOG(_L("fmsclient fotastartupplugin is using the service"));
-		aFotaStartUp = ETrue;
-		return ETrue;    
-		}
-		else if (thread.SecureId() == 0x01D278B9 ) //test app
-		{
-		FLOG(_L("fmsclient test app is using the service"));		
-		return ETrue;
-		}
-	FLOG(_L("fmsclient not launched"));
-	return EFalse;
-	}
-
-// ---------------------------------------------------------------------------
-// StartServerL()  
-//	Starts Fota Downlaod Interrupt Monitory server
-// ---------------------------------------------------------------------------
-TInt StartServerL()
-	{
-	FLOG(_L("StartServerLt Started"));
-	TInt res = KErrNone;
-	RProcess server;
-	res=server.Create(KFMSServerName,KNullDesC);
-	FLOG(_L("StartServerL-- create server error as %d"),res);
-	if (res!=KErrNone)
-		{		
-		return res;
-		}
-	TRequestStatus stat;
-	server.Rendezvous(stat);
-	if (stat!=KRequestPending)
-		server.Kill(0);		// abort startup
-	else
-		server.Resume();	// logon OK - start the server
-	User::WaitForRequest(stat);		// wait for start or death
-	res=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
-	FLOG(_L("StartServerL-- server.ExitType() returns %d"),res);
-	server.Close();
-	return res;
-	}
-
-// ---------------------------------------------------------------------------
-// RFMSClient::OpenL()
-// ---------------------------------------------------------------------------
-EXPORT_C TInt RFMSClient::OpenL()
-	{	
-	FLOG(_L("RFMSClient::OpenL()- Begin"));
-	TInt res = KErrNone;
-	TBool FotaStartUp = EFalse;
-	if( IsSecureClient(FotaStartUp))
-		{
-		FLOG(_L("RFMSClient::OpenL()- Secured client"));
-		res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
-		if ( res != KErrNone )
-			{
-			FLOG(_L("RFMSClient::OpenL()- session not created"));
-			res = StartServerL();
-			User::LeaveIfError( res );
-			res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
-			}
-		User::LeaveIfError( res );
-		FLOG(_L("RFMSClient::OpenL()- session created"));
-		CRepository* centrep2 = NULL;
-    TRAPD( err, centrep2 = CRepository::NewL( KCRUidFotaServer ) )
-    TInt val = KErrNone;
-    if (err==KErrNone ) 
-      {
-      	      centrep2->Get(  KFotaUpdateState, val );
-      	      delete centrep2;
-      }
-            
-            centrep2 = NULL;
-    
-		if( FotaStartUp && val == EFotaDownloadInterrupted )
-			{
-			FLOG(_L("RFMSClient::OpenL()- fotastartup using FMS session"));
-			SendInterruptParamsL();
-			}
-		}
-	else //not a secured client
-		{
-		FLOG(_L("fmsclient not launched--insecured client"));
-		res = KErrNotFound;
-		}
-	FLOG(_L("RFMSClient::OpenL()- End %d"),res);	
-	return res;
-	}
-
-// ---------------------------------------------------------------------------
-// RFMSClient::Close()
-// ---------------------------------------------------------------------------
-EXPORT_C void RFMSClient::Close()
-	{
-    FLOG(_L(" RFMSClient::Close"));
-	RSessionBase::Close();  //basecall
-	}
-	
-// ----------------------------------------------------------------------------
-// RFMSClient::NotifyForResumeL()
-// ----------------------------------------------------------------------------	
-EXPORT_C void RFMSClient::NotifyForResumeL(const TFmsIpcCommands& aReason,
-		const TInt& aBearer, const TDriveNumber& aDrive, const TInt& aSize)
-	{		
-    FLOG(_L(" RFMSClient::NotifyForResumeL--Begin"));
-    TInt Size(aSize),Drive((TInt)aDrive),Bearer(aBearer);
-    TInt err = SendReceive( (TInt)aReason, TIpcArgs(Bearer,Drive,Size));
-    FLOG(_L(" RFMSClient::NotifyForResumeL--End error as %d"),err);
-	}
-
-// ---------------------------------------------------------------------------
-// RFMSClient::SendInterruptParamsL() called only when fotastartup launched
-// ---------------------------------------------------------------------------	
-void RFMSClient::SendInterruptParamsL()
-	{
-	FLOG(_L(" RFMSClient::SendInterruptParamsL--Begin"));
-	TInt err = Send( EFotaStartUpPlugin );
-	FLOG(_L(" RFMSClient::SendInterruptParamsL--End as %d"),err);
-	}
-	
-EXPORT_C void RFMSClient::NotifyForUpdateL(const TFmsIpcCommands& aReason, TUint aLevel)
-    {
-    FLOG(_L(" RFMSClient::NotifyForUpdateL--Begin, level = %d"), aLevel);
-    TInt err = SendReceive( (TInt) aReason, TIpcArgs (aLevel));
-    FLOG(_L(" RFMSClient::NotifyForUpdateL--End as %d"),err);
-    User::LeaveIfError(err);
-    }
-// ---------------------------------------------------------------------------
-// RFMSClient::Cancel() 
-// ---------------------------------------------------------------------------	
-EXPORT_C void RFMSClient::Cancel()
-	{
-	FLOG(_L(" RFMSClient::Cancel--Begin"));
-	TInt err = SendReceive( ECancelOutstandingRequest );
-	FLOG(_L(" RFMSClient::Cancel--End as %d"),err);
-	}
-	
-// ---------------------------------------------------------------------------
-// RFMSClient::ActivePhoneCallSync() 
-// ---------------------------------------------------------------------------  
-EXPORT_C TInt RFMSClient::IsPhoneCallActive(TInt& aCallActive)
-    {
-    FLOG(_L(" RFMSClient::IsPhoneCallActive--Begin"));
-    TPckgBuf<TInt> result(aCallActive);
-    TInt err = SendReceive( EUpdPhoneCallActive,TIpcArgs(&result));    
-    aCallActive=result();
-    FLOG(_L(" RFMSClient::IsPhoneCallActive--End as %d,%d"),err,aCallActive);
-    return err;
-    }
-
-//End of file
--- a/fotaapplication/fmserver/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-// BLD.INF
-// Component description file 
-//
-
-PRJ_MMPFILES
-
-FMSServer.mmp
-
-
--- a/fotaapplication/fmserver/group/fmsserver.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <platform_paths.hrh>
-#include "defaultcaps.hrh"
-
-//MACRO  _FOTA_DEBUG
-//MACRO  _FOTA_DEBUG_RDEBUG
-
-CAPABILITY    CAP_SERVER
-
-TARGET        fmsserver.exe
-TARGETTYPE    exe
-
-UID 0 0x200100C8
-VENDORID 			VID_DEFAULT
-
-SOURCEPATH    ../src
-SOURCE        fmsserver.cpp
-SOURCE		  fmsserversession.cpp
-SOURCE		  fmsinterruptaob.cpp
-
-USERINCLUDE   ../inc
-USERINCLUDE   ../../inc
-USERINCLUDE   ../../cenrep
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY       euser.lib
-LIBRARY       connmon.lib // for connection monitoring
-LIBRARY       sysutil.lib 
-LIBRARY       efsrv.lib 
-LIBRARY       flogger.lib
-LIBRARY       centralrepository.lib 
-LIBRARY       fotaengine.lib 
-LIBRARY       cmmanager.lib 
-LIBRARY       etelmm.lib 
-LIBRARY       etel.lib 
-LIBRARY		  schsvr.lib
-
-SMPSAFE
--- a/fotaapplication/fmserver/inc/fmsdebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#ifndef FMSDEBUG_H_
-#define FMSDEBUG_H_
-	
-
-   #ifdef _FOTA_DEBUG
-
-        #include <e32std.h>
-        #include <f32file.h>
-        #include <flogger.h>
-        #include <e32svr.h>
-
-        _LIT( KLogFile, "fmsserver.log" );
-        _LIT( KLogDirFullName, "c:\\logs\\" );
-        _LIT( KLogDir, "fota" );
-
-        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
-            {
-            VA_LIST list;
-            VA_START( list, aFmt );
-            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
-            }
-
-
-        #ifdef _FOTA_DEBUG_RDEBUG 
-            #ifndef __GNUC__          
-                #define FLOG            RDebug::Print
-            #else   // __GNUC__       
-                #define FLOG(arg...)    RDebug::Print(arg);
-            #endif // __GNUC__        
-        #else // _FOTA_DEBUG_RDEBUG
-            #ifndef __GNUC__          
-                #define FLOG            FWrite
-            #else   // __GNUC__       
-                #define FLOG(arg...)    FWrite(arg);
-            #endif // __GNUC__        
-        #endif // _FOTA_DEBUG_RDEBUG
-
-    #else   // _FOTA_DEBUG    
-        #ifndef __GNUC__
-            #define FLOG
-        #else
-            #define FLOG(arg...)
-        #endif // __GNUC__
-    #endif // _FOTA_DEBUG
-
-
-#endif /*FMSDEBUG_H_*/
--- a/fotaapplication/fmserver/inc/fmsinterruptaob.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,296 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#ifndef __FMS_AOB_H__
-#define __FMS_AOB_H__
-
-#include <e32base.h>
-#include <e32std.h>
-#include <e32property.h>
-#include <rconnmon.h>
-#include <etel.h>
-#include <fotaengine.h>
-#include "fmsserver.h"
-#include "fmsdebug.h"
-
-class CFMSServer;
-
-// CLASS DECLARATION     
-class CFMSInterruptAob : public CActive,private MConnectionMonitorObserver
-	{	
-	friend class CFMSServer;	
-	
-	public:
-	/**
-	 * Default constructor
-	 */
-	CFMSInterruptAob();
-	
-	/**
-	 * second phase constructor
-	 */
-	void ConstructL();
-	
-	/**     
-     * Logs the new request/interrupt to  be monitored  
-     * @param aType, interrupt reason
-     * @return None
-     */
-	void StartL(TFmsIpcCommands aType);
-	
-	/**
-	 * Starts Active object to monitor for the update interrupt in case of USB charger support
-	 * @param aType, Interrupt reason
-	 * @return None
-	 */
-	void StartBatteryMonitoringL(TFmsIpcCommands aType, TUint aLevel);
-
-	/**     
-     * Sets the memory size member variable to be monitored 
-     * for the current interrupt 
-     * @param aSize, Memory space required
-     * @param aDrive, Drive used for download
-     * @return None
-     */
-	void MemoryToMonitorL(TInt aSize, TDriveNumber aDrive);
-	
-	/**     
-     * Sets the network type for the current interrupt 
-     * @param aBearer
-     * @return None
-     */
-	void NetworkTypeL(TInt aBearer);
-	/**     
-     * Launches FOTA install notifier 
-     * @param None
-     * @return None
-     */
-	void LaunchFotaScheduleUpdate();
-	
-	/*
-	 * Destructor
-	 */
-	virtual ~CFMSInterruptAob();
-	
-	/**     
-	 * Starts monitor for active call end 	
-	 * @param aType, Reason to be monitored	 
-	 * @return None
-	 */
-	void StartCallEndMonitoringL(TFmsIpcCommands aType);
-	
-	private:
-	
-	/**
-     * From CActive
-     * Called by Active scheduler when the asynchronous 
-     * request completed     
-     * @param None
-     * @return None
-     */
-	void RunL();
-	
-	/**
-     * From CActive
-     * Called when a pending request has to be cancelled     
-     * @param None
-     * @return None
-     */
-	void DoCancel();
-	
-	 /**
-     * From CActive
-     * Handle a leave occurred in the RunL().
-     * Note: If RunError function pointer is not given in construction,
-     * the leave error is to be propagated back to the active scheduler!
-     *
-     * @since S60 v3.2
-     * @param aError the error code of leave
-     */
-    TInt RunError( TInt aError );
-    
-    /**
-     * Checks the package size is more than warning level of memory
-     * @param aCritical to set EFalse/ETrue
-     * @return TInt
-     */
-	TInt IsPkgSizeMoreThanWL(TBool& aCritical);
-	
-	/**
-	  * Starts network notification registry
-	  * @param None
-	  * @return None
-	  */
-	TBool CheckNetworkL();
-	
-	/**
-	  * Starts network notification registry
-	  * @param None
-	  * @return None
-	  */
-	void LaunchFotaEngineL();		
-	
-	/**
-	  * Starts network notification registry
-	  * @param None
-	  * @return None
-	  */
-	TBool CheckGlobalRFStateL();
-	
-	/**
-	  * Stops the FMS Server
-	  * @param None
-	  * @return None
-	  */
-	void StopServer();
-	
-	/**
-	  * Checks the memory size to be monitored
-	  * after adding the warning level
-	  * @param None
-	  * @return None
-	  */
-	void CheckMemSizeL();
-	
-	public: 
-    
-  	/**
-    * Starts network notification registry
-    * @param None
-    * @return None
-    */
-	void NotifyL() ;
-	
-    /**
-    * Stops network notifications.
-    * @param None
-    * @return None
-    */
-   	void StopNotify() ;
-   	
-   	/**
-     * sets n/w to 3G.
-     * @param None
-     * @return None
-     */
-   	void SetWcdma() ;
-   	
-   	/**
-     * Starts n/w registry check in Hard reeboot case
-     * uses CPeriodic variable to call static method
-     * @param None
-     * @return None
-     */
-   	void StartNetworkRegistryCheckL();
-   	
-   	/**
-     * checks n/w registry in Hard reeboot case
-     * and destroys the CPeriodic if connection is there
-     * and triggers fota engine
-     * @param None
-     * @return None
-     */
-	void NetworkRegistryCheckL();
-	
-	/**
-	 * Launches Fota update note	 
-	 * @param aPkgId, package Id of FOTA Update
-	 * @param aProfilleId, Profile ID of FOTA
-	 * @return None
-	 */
-	void LaunchFotaUpdate();
-	
-	private : 
-	
-	/**
-	 * From MConnectionMonitorObserver
-	 * Method involed by connection monitor with current event. 
-	 * This method handles the events
-	 * @param aConnMonEvent says about the event
-	 * @return None
-	 */
-	void EventL( const CConnMonEventBase& aConnMonEvent ) ;
-	
-	/**
-	 *CheckNetworkstatus and takes action based on that 
-	 * @param none
-	 * @return None
-	 */
-	void CheckNetworkStatusL();
-	/**
-	 * HandleAboveCriticallevel handle memory interrupt when it is above critical level 
-	 * @param                   None
-	 * @return                  None
-	 */
-	void HandleAboveCriticallevelL();
-	
-	/**
-	 * HandleChargingInterruptL  handle charging interrupt when it is above critical level 
-	 * @param                   None
-	 * @return                  None
-	 */
-	
-	void HandleChargingInterruptL();
-	
-	private:	  
-	
-	RConnectionMonitor iConnMon;
-	RFs iFs;
-	RProperty iProperty;
-    TInt iConnStatus;	
-    TInt iSize;
-    TDriveNumber iDrive;
-    TInt iBearer;
-    TBool iWlanAvailable;
-    TBool iGPRSAvail;
-    TFmsIpcCommands iInterruptType;
-    TFmsIpcCommands iUpdInterruptType;
-    CFMSServer* iServer;
-    RFotaEngineSession iFotaEngine;    
-    CPeriodic* iPeriodicNwCheck;
-    TBool iWcdma;
-    
-    /** 
-     * RTelServer object used to keep an asynchronous request
-     * for phone call end monitoring
-     */ 
-    RTelServer iTelServer;
-
-    /** 
-     * RPhone object used to keep an asynchronous request
-     * for phone call end monitoring
-     */
-    RPhone     iPhone;
-    
-    /** 
-     * RLine object used to keep an asynchronous request
-     * for phone call end monitoring
-     */
-    RLine      iLine;
-    
-    /** 
-     * To get hodl of current call status     
-     */
-    RCall::TStatus iCallStatus;
-
-    TInt iChargeToMonitor;
-
-	};
-	
-
-#endif
--- a/fotaapplication/fmserver/inc/fmsserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#ifndef __FMS_SERVER_H__
-#define __FMS_SERVER_H__
-
-#include <e32base.h>
-#include <e32std.h>
-#include <e32property.h>
-#include <flogger.h>
-#include <rconnmon.h>
-#include <f32file.h>
-#include <fotaengine.h>
-#include "fmsclientserver.h"
-#include "fmsinterruptaob.h"
-#include "fmsdebug.h"
-
-_LIT( KFotaInterruptFileName, "fotainterrupt.txt" );
-const TInt64 KThresholdDiskSpace = 305152;
-const TInt64 KDiskSpaceNotCL = 102400;
-const TInt KRequestTriggerWaitTime(1000000);
-
-class CFMSSession;
-class CFMSServer;
-class CFMSInterruptAob;
-
-	
-class CFMSServer: public CServer2
-	{
-	friend class CFMSSession;
-	friend class CFMSInterruptAob;
-	
-	public:
-	
-	/**
-	 * Destructor
-	 */ 
-	virtual ~CFMSServer();
-	
-	/**
-	 * Static method which creates the server instance
-	 * @param None
-	 * @return CServer2*
-	 */ 
-	static CServer2*  NewLC();
-	
-	/**
-	 * Stops the session and closes the server
-	 * @param None
-	 * @return None
-	 */
-	void DropSession();
-	
-	/**
-	 * Starts Active object to monitor for the interrupt
-	 * @param aType, Interrupt reason
-	 * @return None
-	 */
-	void StartMonitoringL(TFmsIpcCommands aType);
-
-	/**
-	 * Starts Active object to monitor for the update interrupt
-	 * @param aType, Interrupt reason
-	 * @param aLevel, Level of the battery charge to monitor
-	 * @return None
-	 */
-	void StartBatteryMonitoringL(TFmsIpcCommands aType, TUint aLevel);
-
-/**
-	 * Starts Active object to monitor for the update interrupt
-	 * @param aType, Interrupt reason
-	 * @return None
-	 */
-	void StartUpdateInterruptMonitoringL(TFmsIpcCommands aType);
-	/**
-	 * Calls Active object's method to set the drive & size 
-	 * for memory interrupt
-	 * @param aSize, Interrupt aDrive
-	 * @return None
-	 */
-	void MemoryToMonitorL(TInt aSize, TDriveNumber aDrive);
-	
-	/**
-	 * Calls Active object's method to set the network bearer
-	 * @param aBearer
-	 * @return None
-	 */
-	void NetworkTypeL(TInt aBearer);
-	
-	/**
-	 * Writes the file with all the interrupt information
-	 * @param aReason ,Interrupt reason
-	 * @param aBearer ,Bearer id
-	 * @param aDrive  ,Drive to Download
-	 * @param aSize   , memory size to monitor
-	 * @param aWcdmaBearer , 3G bearer or not
-	 * @return None
-	 */
-    void WriteToFile(TInt aReason, TInt aBearer, TDriveNumber aDrive, 
-    		TInt aSize, TBool aWcdmaBearer );
-    
-    /**
-	 * Reads the file for the interrupt information
-	 * @param aReason ,Interrupt reason
-	 * @param aBearer ,Bearer id
-	 * @param aDrive  ,Drive to Download
-	 * @param aSize   , memory size to monitor
-	 * @param aWcdmaBearer , 3G bearer or not
-	 * @return TBool, says reading success or not
-	 */
-    TBool ReadFromFile(TInt& aReason, TInt& aBearer, TInt& aDrive, TInt& aSize
-    		 , TInt& aWcdmaBearer );
-    
-    /**
-	 * Checks for any interrupt pending
-	 * @param None
-	 * @return TBool
-	 */
-    TBool RequestPending();
-    
-    /**
-	 * Checks the network as part of other interrupts
-	 * before triggering fota.
-	 * In case of network down, it keeps network interrupt
-	 * @param aBearer ,Bearer id
-	 * @param aDrive  ,Drive to Download
-	 * @param aSize   , memory size to monitor
-	 * @param aWcdmaBearer , 3G bearer or not
-	 * @return None
-	 */
-    void CheckNetworkL(TInt& aBearerId,TInt& aDrive, TInt& aSize,TBool& aWcdma);
-    
-    /**
-	 * Locks the session, so that new session will not be started
-	 * before the previous interrupt monitory completion
-	 * @param None
-	 * @return None
-	 */
-    void LockSession();
-    
-    /**
-	 * Computes the variation configured
-	 * @param None
-	 * @return None
-	 */
-    void FindVariation();
-    
-    /**
-	 * Checks Charger monitoring supported or not
-	 * @param None
-	 * @return TBool, which says Charger monitory support
-	 */
-    TBool ChargerTobeMonitered();
-    
-    /**
-	 * Checks  Network monitoring supported or not
-	 * @param None
-	 * @return TBool, which says  Network monitory support
-	 */
-    TBool NetworkTobeMonitered();
-    
-    /**
-	 * Checks Phone startup monitoring supported or not
-	 * @param None
-	 * @return TBool, which says Phone startup monitory support
-	 */
-    TBool MoniterAfterPhoneRestart();
-    
-    /**
-	 * Checks Memory monitoring supported or not
-	 * @param None
-	 * @return TBool, which says Memory monitory support
-	 */
-    TBool MemoryTobeMonitered();
-    
-    /**
-	 * Checks for WLAN
-	 * @param None
-	 * @return TBool, which says WLAN availability
-	 */
-    TBool CheckWlanL();
-    
-    /**
-	 * Sets the Bool value which decides file deletion
-	 * @param aValue, says whether the file to be deletd or not
-	 * @return None
-	 */
-    void DeleteFile(TBool aValue);
-    
-    /**
-	 * Checks network and trigger fota engine in hard reboot case
-	 * @param None
-	 * @return None
-	 */
-    void TriggerFotaL();
-    
-    /**
-	 * For asynchronous network request to be 
-	 * logged on active object, using CPeriodic
-	 * @param None
-	 * @return None
-	 */
-	void AsyncSessionRequestL();
-		
-	/**
-	 * Destroys the CPeriodic object
-	 * So that not to call the static method again
-	 * @param None
-	 * @return None
-	 */
-	void StopAsyncRequest();
-	
-	/**
-     * Calls Active objects SetWcdma to set the bearer to 3G
-     * @param None
-     * @return None
-     */
-   	void SetWcdma() ;
-   	
-   	/**
-   	 * Checks whether a phone call is active or not
-   	 * @param aStatus, on return contains the call status
-   	 * @return None
-   	 */
-   	void CheckPhoneCallActiveL(TInt& aStatus);
-   	
-   	/**
-   	 * Starts montioring for active phone call end
-   	 * @param aPkgId, package Id of FOTA Update
-   	 * @param aProfileId, Profile ID of FOTA
-   	 * @return phone call active or not at that moment
-   	 */
-   	TBool MonitorPhoneCallEndL();
-   	
-   	/**
-   	 * Logs Asynchronous montioring for active phone call end
-   	 * To avoid performance issues(like thread blocking call)
-   	 * @param None
-   	 * @return None
-   	 */
-   	void LogAsyncCallMonitorL();
-   	
-   	void CreateScheduledReminderL();
-   	
-   	void DeleteScheduledRemindersL();
-   	
-	private:
-	
-	/**
-	 * second phase constructor
-	 */
-	void ConstructL();
-	
-	/**
-	 * Default constructor
-	 */
-	CFMSServer();
-	
-	protected:
-	
-	/**
-	 * Calls when a New session is getting created
-	 * @param aVersion
-	 * @param aMessage
-	 * @return CSession2*
-	 */
-	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage)  const;
-	
-	private:
-	RFs iFs; //for file creation, writing & Deleting
-	RFile iFile;
-	TInt iSessionCount;	
-	CFMSInterruptAob iFMSInterruptAob;
-    TBool iNetworkMon;
-    TBool iChargerMon;
-    TBool iPhoneRestartMon;
-    TBool iMemoryMon;	
-    TBool iDeleteFile;
-    CPeriodic* iLogAsyncRequest;
-	};
-	
-#endif
--- a/fotaapplication/fmserver/inc/fmsserversession.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#ifndef __FMS_SESSION_H__
-#define __FMS_SESSION_H__
-
-#include "fmsserver.h"
-
-class CFMSSession: public CSession2
-{
-	friend class CFMSServer;
-	public:
-		/**
-		 * Destructor
-		 */
-		virtual ~CFMSSession();		
-	
-	private:
-		/**
-		 * Constructor
-		 */ 
-		CFMSSession();
-		
-		/**
-		 * Provides FMS Server reference
-		 * @param None.
-		 * @return CFMSServer reference
-		 */ 
-		CFMSServer& Server();
-		
-		/**
-		 * Called by the framework to handle the request 	 
-		 * @param aMessage
-		 * @return None
-		 */
-		void ServiceL(const RMessage2& aMessage);
-		
-		/**
-		 * Called from ServiceL to handle the request 
-		 * @param aMessage
-		 * @return None
-		 */
-		void DispatchMessageL(const RMessage2& aMessage);
-		
-		
-		/**
-		 * Called when ServiceL leaves
-		 * @param aMessage
-		 * @param aError
-		 * @return None
-		 */
-		void ServiceError(const RMessage2 &aMessage, TInt aError);
-		
-		/**
-		 * Checks whether the session started client is secured or not	 
-		 * @param aMessage
-		 * @return TBool
-		 */
-		TBool CheckClientSecureIdL( const RMessage2 &aMessage );
-		
-		/**
-		 * Finds the bearer id for the corresponding IAP Id		 
-		 * @param aIapId
-		 * @return TUint32, bearer id
-		 */
-		TUint32 FindBearerIdL(TInt aIapId);
-		
-		/**
-		 * Writes Dummy file in case of unsupported monitoring		 
-		 * @param None.
-		 * @return CFMSServer reference
-		 */
-		void WriteDummyFile();
-		
-		/**
-		 * Checks whether the phone is in 2G or 3G mode
-		 * sets the member variable iWcdmaBearer
-		 * @param None.
-		 * @return CFMSServer reference
-		 */
-		void PhoneModeL();
-		
-		/**
-		 * 
-		 * Handles the service based on bearer type
-		 * @param aMessage.
-		 * @return None
-		 */
-			void HandleBasedOnBearertypeL(const RMessage2& aMessage);
-	private:	
-		TBool iStopServer;
-		TBool iWlanbearer;
-		TBool iWcdmaBearer;
-};
-
-
-#endif
--- a/fotaapplication/fmserver/src/fmsinterruptaob.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,996 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <systemwarninglevels.hrh>
-#include <e32property.h>
-#include <startupdomainpskeys.h>
-#include <hwrmpowerstatesdkpskeys.h>
-#include <sysutil.h> 
-#include <fotaengine.h>
-#include "fotaserverPrivateCRKeys.h"
-#include "fmsserver.h"
-#include "fmsinterruptaob.h"
-#include "fmsclientserver.h"
-#include "FotaIPCTypes.h"
-
-#if defined (__WINS__)
-#include <cmpluginlanbasedef.h>
-#endif
-// ----------------------------------------------------------------------------------------
-// static method StaticCheckNwRequestL() called to check n/w availability
-// ----------------------------------------------------------------------------------------
-static TInt StaticCheckNwRequestL(TAny* aPtr)
-	{
-	CFMSInterruptAob* ptr = (CFMSInterruptAob*) aPtr;
-	FLOG(_L("StaticCheckNwRequestL:-Begin"));	
-	TRAPD(err, ptr->NetworkRegistryCheckL() );	
-	FLOG(_L("StaticCheckNwRequestL:-end"));
-	return err;
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSInterruptAob::CFMSInterruptAob()
-// -----------------------------------------------------------------------------
-CFMSInterruptAob::CFMSInterruptAob()
-:CActive(EPriorityStandard)
-	{
-	//CActiveScheduler::Add(this);
-	iConnStatus = KErrNone;
-	iWlanAvailable = EFalse;
-	iGPRSAvail = EFalse;
-	iWcdma = EFalse;
-	iUpdInterruptType = ENoInterrupt;
-	iChargeToMonitor = 0;
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSInterruptAob::ConstructL()
-// -----------------------------------------------------------------------------
-void CFMSInterruptAob::ConstructL()
-	{
-	CActiveScheduler::Add(this);	
-	User::LeaveIfError(iConnMon.ConnectL());
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSInterruptAob::Start()
-// -----------------------------------------------------------------------------
-void CFMSInterruptAob::StartL(TFmsIpcCommands aType)
-	{	
-	FLOG(_L("CFMSInterruptAob::Start- begin"));
-	iInterruptType = aType;
-	if(iInterruptType == EDLUserInterrupt && iServer->ChargerTobeMonitered())
-		{
-		FLOG(_L("CFMSInterruptAob::Start--EUserInterrupt"));
-		if(!IsActive())
-			{
-			//RProperty pw;
-			iProperty.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus);
-			iStatus=KRequestPending;
-			iProperty.Subscribe(iStatus);	
-			SetActive();	
-			}
-		}
-	else if(iInterruptType == EDLNetworkInterrupt && iServer->NetworkTobeMonitered())
-		{	  
-		FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt"));	
-		if(!IsActive())
-			{		  
-			iStatus=KRequestPending;			  
-			TBool phonenotoffline = CheckGlobalRFStateL();
-			if ( ( iBearer == EBearerIdGPRS || iBearer == EBearerIdWCDMA )
-					&& phonenotoffline )
-				{
-				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt iBearer is %d"),iBearer);	
-				NotifyL();
-				return;			  
-				}
-			else if ( iBearer == EBearerIdWLAN )
-				{
-				//feature supported check
-				iWlanAvailable = EFalse;	  
-				iConnMon.GetBoolAttribute( EBearerIdWLAN, 
-						0, 
-						KBearerAvailability, 
-						iWlanAvailable, 
-						iStatus );
-				SetActive();
-				}
-			else
-				{
-				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt--other then GPRS/ WLan bearer "));	  
-				//Stop the server	  
-				//Dont delete the file if interrupt is network + offline( to differentiate from hard reboot
-				iServer->DeleteFile(EFalse);
-				StopServer();
-				}	  
-			}
-		}
-	else if(iInterruptType == EDLMemoryInterrupt && iServer->MemoryTobeMonitered())
-		{
-		FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt on drive %d"),(TInt)iDrive );		  
-		if(!IsActive())
-			{
-			User::LeaveIfError(iFs.Connect());
-			TBool critical = EFalse;
-			TInt err = KErrNone;
-			err=IsPkgSizeMoreThanWL(critical);		  
-			if(critical)
-				{	 
-				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg dont fit on drive %d"),(TInt)iDrive );		  
-				iStatus=KRequestPending;					
-				iFs.NotifyDiskSpace( iSize, iDrive, iStatus ); 
-				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt-setting as active") );		  
-				SetActive();	
-				}
-			else
-				{
-				if(err == KErrNone)
-					{
-					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg fits on drive %d"),(TInt)iDrive );
-					LaunchFotaEngineL();
-					}
-				else
-					{
-					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--System error %d on memory drive %d"), err,(TInt)iDrive );
-					}
-				//Stop the server	 
-				StopServer();	   
-				}
-			}
-		}  
-	else //case where variation fails or by chance if a bad interrupt reason
-		{
-		StopServer();	  
-		}	 
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSInterruptAob::RunL()
-// -----------------------------------------------------------------------------
-void CFMSInterruptAob::RunL()
-	{
-	FLOG(_L("CFMSInterruptAob::RunL()- begin"));
-	TInt value = 0;
-	if( EUpdMonitorPhoneCallEnd == iUpdInterruptType)
-      {
-      FLOG(_L("RunL EPhoneCallActiveAsync--call status %d"),iCallStatus);
-      if(iStatus == KErrNone && RCall::EStatusIdle == iCallStatus )
-          {
-          //call fota scheduler & Stop the server          
-          LaunchFotaUpdate();
-          StopServer();
-          }
-      else //call in progress, subscribe again
-          {
-          FLOG(_L("call in progress, subscribing again"));
-          iLine.NotifyStatusChange(iStatus, iCallStatus);
-          SetActive();
-          }
-      }
-	else if( iUpdInterruptType == EUpdMonitorbattery)
-	  {
-	  	 FLOG(_L("CFMSInterruptAob::RunL()- handling battery monitor"));
-	  	 iProperty.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel);
-		   TInt err=iProperty.Get(KPSUidHWRMPowerState,KHWRMBatteryLevel,value);
-		   if(err != KErrNone)
-		    { 
-		    	FLOG(_L("CFMSInterruptAob::RunL()- error  in getiing the battery level")); 
-		    	StopServer();
-		    }  
-		   if(value >= iChargeToMonitor)
-	    	{ iProperty.Cancel();
-			    iProperty.Close();	
-			  TRAPD(err, LaunchFotaScheduleUpdate());
-			  if(err)
-			  {
-			  	FLOG(_L("CFMSInterruptAob::RunL()- error in launch fota schedule"));
-			  }
-            iUpdInterruptType = ENoInterrupt;
-            StopServer();
-			   
-		    }
-		
-	    	else 
-		   	{			
-		    	FLOG(_L("CFMSInterruptAob::RunL()--status charger not connected"));
-			   if(!IsActive())
-			  	{
-				  iStatus=KRequestPending;	
-				  iProperty.Subscribe(iStatus);
-				  FLOG(_L("CFMSInterruptAob::RunL()--waiting for charger Connectivity"));
-				  SetActive();
-				  }	
-	       }
-	  }     	
-  else if( iInterruptType == EDLUserInterrupt)
-		{
-		TInt value;	
-		//RProperty   pw;
-		iProperty.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus);
-		iProperty.Get(KPSUidHWRMPowerState,KHWRMChargingStatus,value);
-		// charger connected or already charging going on
-		if( value == EChargingStatusCharging /*|| value == EChargingStatusChargingComplete ||
-				value == EChargingStatusAlmostComplete || value == EChargingStatusChargingContinued */)
-			{	
-			 	FLOG(_L("CFMSInterruptAob::RunL()--status charging"));
-			  HandleChargingInterruptL();			
-						
-			}
-		else 
-			{			
-			FLOG(_L("CFMSInterruptAob::RunL()--status charger not connected"));
-			if(!IsActive())
-				{
-				iStatus=KRequestPending;	
-				iProperty.Subscribe(iStatus);
-				FLOG(_L("CFMSInterruptAob::RunL()--waiting for charger Connectivity"));
-				SetActive();
-				}				
-			}
-		}
-	else if( iInterruptType == EDLNetworkInterrupt )
-		{
-		FLOG(_L("CFMSInterruptAob::RunL()--ENetworkInterrupt" ));	
-		/*if( iBearer == EBearerIdGPRS || iBearer == EBearerIdWCDMA )
-			{
-			FLOG(_L("CFMSInterruptAob::RunL()--ENetworkInterrupt:GPRS/WCDMA" ));
-			}*/
-		 if ( iBearer == EBearerIdWLAN )
-			{
-			TBuf<10> num;
-			FLOG(_L("CFMSInterruptAob::RunL()--ENetworkInterrupt due to bearer id WLAN, iStatus %d"),iStatus.Int());	
-			/*if(iWlanAvailable)
-				FLOG(_L("iWlanAvailable :TRUE"));
-			else
-				FLOG(_L("iWlanAvailable :FALSE"));	*/				
-			if( iWlanAvailable && iStatus == KErrNone )
-				{
-				FLOG(_L("CFMSInterruptAob::RunL()--status WLAN networks found"));		
-				LaunchFotaEngineL();
-				StopServer();				
-				}
-			else if( iStatus == KErrNotSupported )//feture not supported
-				{
-				FLOG(_L("CFMSInterruptAob::RunL()--status WLAN feature not supported"));
-				StopServer();				
-				}
-			else 
-				{
-				FLOG(_L("CFMSInterruptAob::RunL()--status WLAN networks not found"));  			  
-				if(!IsActive())
-					{	
-					iWlanAvailable = EFalse;
-					iStatus=KRequestPending;	
-					iConnMon.GetBoolAttribute( EBearerIdWLAN, 
-							0, 
-							KBearerAvailability, 
-							iWlanAvailable, 
-							iStatus );
-					FLOG(_L("CFMSInterruptAob::RunL()--search for wlan availability"));
-					SetActive();
-					}		   
-				}	
-			}
-		}	
-	else if( iInterruptType == EDLMemoryInterrupt )
-		{
-		FLOG(_L("CFMSInterruptAob::RunL()--EMemoryInterrupt,iStatus %d"),iStatus.Int());			
-		if( iStatus == KErrNone  || iStatus == KErrCancel )
-			{
-			TBool critical = EFalse;
-			IsPkgSizeMoreThanWL(critical);
-			//if download size doesn't lead to memory less than critical level
-			if( !critical )	
-				{
-				FLOG(_L("CFMSInterruptAob::RunL()--Ok download not greater than critical level"));
-				//Check network status at this moment
-				
-				HandleAboveCriticallevelL();
-				
-				
-				}
-			else
-				{
-				FLOG(_L("CFMSInterruptAob::RunL()--Ok download greater than critical level"));
-				// space monitor for this		
-				if(!IsActive())
-					{
-					iStatus=KRequestPending;					
-					iFs.NotifyDiskSpace( iSize, iDrive, iStatus ); 
-					SetActive(); 	
-					}			
-				}
-			}			
-		else // for size request more than disk space
-			{
-			FLOG(_L("CFMSInterruptAob::RunL()--bad request size greater than the disk limit"));		
-			StopServer();			
-			}		
-		}
-	else //general
-		{
-		//Already ahandled in session class
-		}
-	FLOG(_L("CFMSInterruptAob::RunL()- End"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::DoCancel() 
-// ----------------------------------------------------------------------------------------
-void CFMSInterruptAob::DoCancel()
-	{
-	FLOG(_L("CFMSInterruptAob::::DoCancel()"));
-	if( iStatus == KRequestPending )
-		{
-		FLOG(_L("CFMSInterruptAob::::DoCancel()--request pending"));
-		TRequestStatus* status = &iStatus;
-		User::RequestComplete( status, KErrCancel );
-		}
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::MemoryToMonitorL() 
-// ----------------------------------------------------------------------------------------
-void CFMSInterruptAob::MemoryToMonitorL(TInt aSize, TDriveNumber aDrive)
-	{
-	FLOG(_L("CFMSInterruptAob::::MemoryToMonitorL()--Begin"));
-	if( aSize < 0 || (aDrive < EDriveA && aDrive > EDriveZ) )
-		{
-		FLOG(_L("CFMSInterruptAob::::MemoryToMonitorL()--Leving with KErrArgumnet"));
-		User::Leave(KErrArgument);
-		}
-	iDrive = aDrive;
-	iSize = aSize;
-	CheckMemSizeL();				
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::NetworkTypeL() 
-// ----------------------------------------------------------------------------------------
-void CFMSInterruptAob::NetworkTypeL(TInt aBearer)
-	{	
-	if( aBearer == EBearerIdGPRS || aBearer == EBearerIdWLAN
-									|| aBearer == EBearerIdWCDMA 
-#if defined (__WINS__)									
-									|| aBearer == EBearerIdLAN)
-#else
-                                                                 )
-#endif
-		{
-		iBearer = aBearer;		
-		}
-	else
-		{
-		FLOG(_L("CFMSInterruptAob::::NetworkTypeL()--leaving with KErrArgument"));
-		User::Leave(KErrArgument);
-		}
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::IsPkgSizeMoreThanWL() 
-// ----------------------------------------------------------------------------------------
-TInt CFMSInterruptAob::IsPkgSizeMoreThanWL(TBool& aCritical)
-	{
-	FLOG(_L("CFMSInterruptAob::::IsPkgSizeMoreThanWL()--Begin"));
-	TInt err = KErrNone;	
-	//Already checked the drive is proper or not
-	//here the check happened for warning level
-	TRAP(err,aCritical = SysUtil::DiskSpaceBelowCriticalLevelL ( &iFs, iSize, iDrive ));
-	FLOG(_L("CFMSInterruptAob::::IsPkgSizeMoreThanWL() end %d"),err);
-	return err;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::CheckNetworkL() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSInterruptAob::CheckNetworkL()
-	{	
-	FLOG(_L("CFMSInterruptAob::CheckNetworkL--begin"));
-	TRequestStatus status=KRequestPending;	
-	iConnStatus = KErrNone; 	  
-	TBool phonenotoffline = CheckGlobalRFStateL();	  
-	if ( phonenotoffline && iBearer == EBearerIdGPRS )
-		{
-		TRequestStatus gsmstatus = KRequestPending;	
-		iConnStatus = KErrNotFound;		
-		FLOG(_L("CFMSInterruptAob::CheckNetworkL--check GSM registry"));	
-		iConnMon.GetIntAttribute( EBearerIdGSM, 0,KNetworkRegistration, iConnStatus, gsmstatus );
-		User::WaitForRequest(gsmstatus);
-		FLOG(_L("iConnStatus is %d gsmstatus is %d"),iConnStatus,gsmstatus.Int());
-		if( iConnStatus == ENetworkRegistrationHomeNetwork || 
-				iConnStatus == ENetworkRegistrationRoaming ) 
-			{
-			FLOG(_L("CFMSInterruptAob::CheckNetworkL--GSM available"));
-			FLOG(_L("CFMSInterruptAob::CheckNetworkL--checking GPRS"));
-			iConnMon.GetBoolAttribute( EBearerIdGPRS, 0,KPacketDataAvailability,
-					iGPRSAvail, status );
-			User::WaitForRequest(status);
-			if( iGPRSAvail && status.Int()==KErrNone )
-				{
-				FLOG(_L("CFMSInterruptAob::CheckNetworkL--GPRS available"));
-				return ETrue;
-				}
-			}
-		}
-	else if ( phonenotoffline && iBearer == EBearerIdWCDMA )
-		{
-		TRequestStatus gsmstatus = KRequestPending;	
-		iConnStatus = KErrNotFound;		
-		FLOG(_L("CFMSInterruptAob::CheckNetworkL--check WCDMA sim registry"));	
-		iConnMon.GetIntAttribute( EBearerIdWCDMA, 0,KNetworkRegistration, iConnStatus, gsmstatus );
-		User::WaitForRequest(gsmstatus);
-		FLOG(_L("iConnStatus is %d WCDMA gsmstatus is %d"),iConnStatus,gsmstatus.Int());
-		if( iConnStatus == ENetworkRegistrationHomeNetwork || 
-				iConnStatus == ENetworkRegistrationRoaming ) 
-			{
-			FLOG(_L("CFMSInterruptAob::CheckNetworkL--WCDMA GSM available"));
-			FLOG(_L("CFMSInterruptAob::CheckNetworkL--checking WCDMA GPRS"));
-			iConnMon.GetBoolAttribute( EBearerIdWCDMA, 0,KPacketDataAvailability,
-					iGPRSAvail, status );
-			User::WaitForRequest(status);
-			if( iGPRSAvail && status.Int()==KErrNone )
-				{
-				FLOG(_L("CFMSInterruptAob::CheckNetworkL--WCDMA GPRS available"));
-				return ETrue;
-				}
-			}
-		}
-	else if ( iBearer == EBearerIdWLAN )
-		{
-		FLOG(_L("CFMSInterruptAob::CheckNetworkL--checking WLAN"));	  
-		iWlanAvailable = EFalse;	  
-		iConnMon.GetBoolAttribute( EBearerIdWLAN, 
-				0, 
-				KBearerAvailability, 
-				iWlanAvailable, 
-				status );	
-		User::WaitForRequest(status);//Synchronous call
-		if( iWlanAvailable && status == KErrNone )
-			{
-			FLOG(_L("CFMSInterruptAob::CheckNetworkL--wlan available"));
-			return ETrue;
-			}
-		}
-	else //phone is offline
-		{
-		FLOG(_L("CFMSInterruptAob::CheckNetworkL--phone is offline or invalid bearer"));
-		}
-	FLOG(_L("CFMSInterruptAob::CheckNetworkL--end"));
-	return EFalse;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::CheckGlobalRFStateL() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSInterruptAob::CheckGlobalRFStateL()
-	{		
-	TInt val = KErrNone;
-	TInt err = KErrNone;
-	TInt status = EFalse;
-	err = RProperty::Get(KPSUidStartup, KPSGlobalSystemState, val);
-	if ( err == KErrNone && val == ESwStateNormalRfOn )
-		{
-		//Phone is not offline. Check for Network Registration status
-		FLOG(_L("Phone is online. Check for Network Registration status"));		
-		status = ETrue;
-		}
-	else
-		{
-		//Phone is offline. No Network activities allowed.
-		FLOG(_L("Phone is offline. No Network activities allowed."));		
-		status = EFalse;
-		}
-	FLOG(_L("CFotaNetworkRegStatus::CheckGlobalRFState, status = %d <<"),status);	
-	return status;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::StopServer() 
-// ----------------------------------------------------------------------------------------
-void CFMSInterruptAob::StopServer()
-	{
-	FLOG(_L("CFMSInterruptAob::StopServer begin"));	
-	iServer->iSessionCount = 0;
-	CActiveScheduler::Stop();//---for stopping the server
-	FLOG(_L("CFMSInterruptAob::StopServer:server stopped"));	
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::LaunchFotaEngineL() 
-// ----------------------------------------------------------------------------------------
-void CFMSInterruptAob::LaunchFotaEngineL()
-	{
-	FLOG(_L("CFMSInterruptAob::LaunchFotaEngineL call to iFotaEngine.OpenL() "));
-	TInt err = KErrNone;
-    iServer->DeleteScheduledRemindersL();
-	TRAP(err,iFotaEngine.OpenL());
-	FLOG(_L("iFotaEngine.OpenL() launched withe error as %d"),err);
-	if(err == KErrNone)
-		{
-        RFotaEngineSession::TState state = iFotaEngine.GetState(-1);
-        if (state == RFotaEngineSession::EDownloadProgressing)
-            {
-            FLOG(_L("Trying resume download..."));
-            err = iFotaEngine.TryResumeDownload();
-            }
-        else if (state == RFotaEngineSession::EStartingUpdate)
-            {
-            FLOG(_L("Trying resume update..."));
-            err = iFotaEngine.Update(-1,(TSmlProfileId)1, _L8(""), _L8(""));
-            }
-            
-        FLOG(_L("Fota engine returned : %d"), err);
-		iFotaEngine.Close();
-		FLOG(_L("CFMSInterruptAob::LaunchFotaEngineL END - fotaengine closed "));
-		}
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::CheckMemSizeL() 
-// ----------------------------------------------------------------------------------------
-void CFMSInterruptAob::CheckMemSizeL(/*TInt& aMemoryNeeded*/)
-	{
-	FLOG(_L("CFMSInterruptAob::CheckMemSizeL-begin"));
-	iSize = iSize + KDRIVECWARNINGTHRESHOLD; //irrespective of Drive
-	FLOG(_L(" neededspace = sizeNeededFromFS + KDRIVECWARNINGTHRESHOLD: %d"), iSize);
-	FLOG(_L("CFMSInterruptAob::CheckMemSizeL-end"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSInterruptAob::~CFMSInterruptAob() 
-// ----------------------------------------------------------------------------------------
-CFMSInterruptAob::~CFMSInterruptAob()
-	{ 
-	FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()"));  	
-	if(iPeriodicNwCheck)
-		{
-		FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()--deleting iPeriodicNwCheck"));
-		delete iPeriodicNwCheck;
-		iPeriodicNwCheck = NULL;
-		}
-	StopNotify();
-	Cancel();
-	iConnMon.Close();
-	if(iProperty.Handle())
-		{    	
-		iProperty.Close();
-		FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()--iProperty closed")); 
-		}
-	
-	if(iInterruptType == EDLMemoryInterrupt)
-		{
-		iFs.NotifyDiskSpaceCancel();
-		}
-	iFs.Close();	
-	if(iLine.SubSessionHandle())
-	    {
-	    iLine.Close();
-	    }
-	if(iPhone.SubSessionHandle())
-	    {
-	    iPhone.Close();
-	    }
-	if(iTelServer.Handle())
-	    {
-	    iTelServer.Close();
-	    }
-	FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()--End"));  
-	}
-
-
-// ---------------------------------------------------------------------------
-// CFMSInterruptAob::RunError
-// ---------------------------------------------------------------------------
-//
-TInt CFMSInterruptAob::RunError( TInt aError )
-	{
-	FLOG( _L("CAOConnectionImpl::RunError: aError: %d"), aError );        
-	return aError;
-	}
-
-
-//
-// -----------------------------------------------------------------------------
-// CFMSInterruptAob::NotifyL()
-// Registers with connection monitor for notification
-// -----------------------------------------------------------------------------
-//
-void CFMSInterruptAob::NotifyL()
-	{
-	FLOG(_L("CFMSInterruptAob::NotifyL Begin  "));
-	iConnMon.NotifyEventL( *this );
-	FLOG(_L("CFMSInterruptAob::NotifyL, after registering  "));
-	// Threholds
-	TInt    err = iConnMon.SetUintAttribute( iBearer, 
-			0, 
-			KBearerAvailabilityThreshold, 
-			1 );    
-	FLOG(_L("CFMSInterruptAob::NotifyL : END "));
-
-	}
-
-
-// -----------------------------------------------------------------------------
-// CFMSInterruptAob::StopNotify()
-// Cancels notification with connection monitor
-// -----------------------------------------------------------------------------
-//
-void CFMSInterruptAob::StopNotify()
-	{
-	FLOG(_L("CFMSInterruptAob::StopNotify Begin  "));
-	iConnMon.CancelNotifications();
-	FLOG(_L("CFMSInterruptAob::StopNotify end "));
-	}	
-
-// -----------------------------------------------------------------------------
-// CNsmlNetworkStatusEngine::EventL()
-// Method involed by connection monitor with current event. 
-// This method handles the events
-// -----------------------------------------------------------------------------
-//
-void CFMSInterruptAob::EventL( const CConnMonEventBase& aConnMonEvent )
-	{
-	FLOG(_L("CFMSInterruptAob::EventL, BEGIN"));
-	FLOG(_L("CFMSInterruptAob::EventL event is ==  %d"), aConnMonEvent.EventType()  );
-	switch ( aConnMonEvent.EventType() )
-	{
-	case EConnMonNetworkStatusChange:
-		{
-		CConnMonBearerAvailabilityChange* eventBearerAvailabilityChange;
-		eventBearerAvailabilityChange = ( CConnMonBearerAvailabilityChange* ) &aConnMonEvent;
-
-		if ( eventBearerAvailabilityChange->ConnectionId() == iBearer )
-			{
-			if ( eventBearerAvailabilityChange->Availability() )
-				{
-				// Available            				
-				if(CheckNetworkL())
-					{
-					FLOG(_L("CFMSInterruptAob::EventL()--status GPRS up"));
-					LaunchFotaEngineL();
-					StopServer();	
-					}
-				else 
-					{
-					FLOG(_L("CFMSInterruptAob::EventL()--status GPRS not up-- but connmon triggererd"));
-					NotifyL();
-					}         				
-				} 
-			else
-				{
-				//check the phone status
-				// Not available            
-				FLOG(_L("CFMSInterruptAob::EventL()--search for GPRS connection not up"));	    			
-				NotifyL();	    	
-				}
-			}
-		break;
-		}
-	case EConnMonPacketDataAvailable:
-		{
-		CConnMonPacketDataAvailable* eventAvailable;
-		eventAvailable = ( CConnMonPacketDataAvailable* ) &aConnMonEvent;
-
-		if ( eventAvailable->ConnectionId() == iBearer )
-			{
-			// Available            				
-			if(CheckNetworkL())
-				{
-				FLOG(_L("CFMSInterruptAob::EventL()--status GPRS up"));
-				LaunchFotaEngineL();
-				StopServer();	
-				}
-			else 
-				{
-				FLOG(_L("CFMSInterruptAob::EventL()--status GPRS not up-- but connmon triggererd"));
-				NotifyL();
-				}         				
-			} 
-		else
-			{
-			//check the phone status
-			// Not available            
-			FLOG(_L("CFMSInterruptAob::EventL()--search for GPRS connection not up"));	    			
-			NotifyL();	    	
-			}
-		break;
-		}
-	default:
-	break;
-	}
-	}
-
-//------------------------------------------------------------
-// CFMSInterruptAob::SetWcdma
-//------------------------------------------------------------
-void CFMSInterruptAob::SetWcdma()
-	{
-	iWcdma = ETrue;
-	}
-
-//------------------------------------------------------------
-// CFMSInterruptAob::CheckNetworkRegistryL
-//------------------------------------------------------------
-void CFMSInterruptAob::StartNetworkRegistryCheckL()
-	{
-	FLOG(_L("CFMSInterruptAob::CheckNetworkRegistryL- begin"));	
-	iPeriodicNwCheck = CPeriodic::NewL (EPriorityNormal) ;
-	FLOG(_L("CFMSInterruptAob::CheckNetworkRegistryL:-iPeriodicNwCheck created)"));
-	iPeriodicNwCheck->Start(
-			TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*20)
-			, TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*25)
-			, TCallBack(StaticCheckNwRequestL,this) ) ;
-	FLOG(_L("CFMSInterruptAob::CheckNetworkRegistryL- End"));
-	}
-
-//------------------------------------------------------------
-// CFMSInterruptAob::StopNetworkRegistryCheckL
-//------------------------------------------------------------
-void CFMSInterruptAob::NetworkRegistryCheckL()
-	{
-	FLOG(_L("CFMSInterruptAob::StopNetworkRegistryCheckL- begin"));	
-	if(CheckNetworkL())
-		{
-		FLOG(_L("CFMSInterruptAob::StopNetworkRegistryCheckL-n/w found"));
-		if(iPeriodicNwCheck)
-			{
-			delete iPeriodicNwCheck;
-			iPeriodicNwCheck = NULL;
-			FLOG(_L("CFMSInterruptAob::iPeriodicNwCheck-deleted"));
-			}
-		LaunchFotaEngineL();
-		StopServer();
-		}	
-	FLOG(_L("CFMSInterruptAob::StopNetworkRegistryCheckL- End"));
-	}
-
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::StartBatteryMonitoringL
-// Starts the monitoring of Battery
-//----------------------------------------------------------------------------
-void CFMSInterruptAob::StartBatteryMonitoringL(TFmsIpcCommands aType, TUint aLevel)
-	{	
-	FLOG(_L("CFMSInterruptAob::StartBatteryMonitoringL- begin"));
-	
-	__ASSERT_ALWAYS(aLevel > EBatteryLevelLevel0 && aLevel <=EBatteryLevelLevel7, User::Leave(KErrArgument));
-	
-	iUpdInterruptType = aType;
-if(iUpdInterruptType == EUpdMonitorbattery)
-	{
-		FLOG(_L("CFMSInterruptAob::Start- EMonitorbattery"));
-		TInt value =0;
-		iChargeToMonitor = aLevel;
-		iProperty.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel);
-		TInt err=iProperty.Get(KPSUidHWRMPowerState,KHWRMBatteryLevel,value);
-		   if(err != KErrNone)
-		    { 
-		    	FLOG(_L("CFMSInterruptAob::StartBatteryMonitoringL- error  in getiing the battery level")); 
-		    	StopServer();
-		    }  
-		if(value >= iChargeToMonitor)
-		{  
-			  iProperty.Cancel();
-			  iProperty.Close();	
-			TRAPD(err1, LaunchFotaScheduleUpdate());
-			if (err1)
-			{
-				FLOG(_L("CFMSInterruptAob::error in LaunchFotaScheduleUpdateL()"));
-		  }
-		  
-		  StopServer();
-	  }
-	 else
-	 { 	  
-		if(!IsActive())
-			{
-			//RProperty pw;
-			FLOG(_L("CFMSInterruptAob::Start- attaching for battery"));
-			
-			iProperty.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel);
-			iStatus=KRequestPending;
-			iProperty.Subscribe(iStatus);	
-			SetActive();	
-			}
-		}	
-	}
-	FLOG(_L("CFMSInterruptAob::StartBatteryMonitoringL- end"));
-}	 
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::LaunchFotaScheduleUpdate
-// Launches the FOTA schedule dialog
-//----------------------------------------------------------------------------
-
-void CFMSInterruptAob::LaunchFotaScheduleUpdate()
-{
-    TRAP_IGNORE(iServer->DeleteScheduledRemindersL());
-    
-	RFotaEngineSession fotaengine;
-	TRAPD(error,fotaengine.OpenL());
-	if(error == KErrNone)
-	  {
-		  	
-		  	
-	    FLOG(_L("CFMSInterruptAob::LaunchFotaScheduleUpdate()- going for update again"));
-	    TFotaScheduledUpdate           sched(-1,-1);   //trigger the Fota remainder dialog here..
-        TPckg<TFotaScheduledUpdate>    p(sched);
-        TRAPD(err, fotaengine.ScheduledUpdateL(sched));
-        if(err)
-         {
-             	  FLOG( _L( "[LaunchFotaScheduleUpdate()] FirmwareUpdate scheduling failed   " ) );              	
-         }
-        FLOG(_L("CFMSInterruptAob::LaunchFotaScheduleUpdate()- closing fota engine"));
-        iUpdInterruptType = ENoInterrupt;
-        fotaengine.Close();	
-	   }
-	 else
-	  {
-		FLOG(_L("CFMSInterruptAob::LaunchFotaScheduleUpdate()- error in opening the fota engine"));
-		  	
-	  }
-}
-
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::CheckNetworkStatusL
-// Checks the network status
-//----------------------------------------------------------------------------
-void CFMSInterruptAob::CheckNetworkStatusL()
-{
-      if(CheckNetworkL()) 
-					{
-					FLOG(_L("CFMSInterruptAob::RunL()--charging & network found"));				
-					LaunchFotaEngineL();
-					StopServer();
-					}
-				else 
-					{				
-					FLOG(_L("CFMSInterruptAob::RunL()--charging but no network found & started monitoring"));
-					//StartNetWorkMonitoring
-					iServer->WriteToFile(EDLNetworkInterrupt, iBearer, EDriveC, 0, iWcdma);
-					StartL(EDLNetworkInterrupt);	  
-					}
-}		
-
-
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::HandleChargingInterruptL
-// Handle the cherging interrupt
-//----------------------------------------------------------------------------
-void CFMSInterruptAob::HandleChargingInterruptL()
-{
-	    iProperty.Cancel();
-			iProperty.Close();		
-			//check variation
-			if(iServer->NetworkTobeMonitered())
-				{			
-				//Check network status at this moment	
-			  	CheckNetworkStatusL();
-			
-				}
-			else
-				{
-				FLOG(_L("CFMSInterruptAob::RunL()--charging & network found"));				
-				LaunchFotaEngineL();
-				StopServer();				
-				}
-}		
-
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::HandleAboveCriticallevelL
-// Handle the meory above critical level
-//----------------------------------------------------------------------------
-void CFMSInterruptAob::HandleAboveCriticallevelL()
-{
-        if(iServer->NetworkTobeMonitered())
-					{
-					if(CheckNetworkL())
-						{	
-						FLOG(_L("CFMSInterruptAob::RunL()--memory avail & network found"));
-						//Notify fota server
-						LaunchFotaEngineL();
-						StopServer();			   
-						}
-					else
-						{
-						FLOG(_L("CFMSInterruptAob::RunL()--memory avail but no network found"));
-						//StartNetWorkMonitoring
-						iServer->WriteToFile(EDLNetworkInterrupt, iBearer, iDrive, 0, iWcdma);
-						StartL(EDLNetworkInterrupt);
-						}
-					}
-				else
-					{
-					FLOG(_L("CFMSInterruptAob::RunL()--memory avail & no network monitor "));
-					//Notify fota server
-					LaunchFotaEngineL();
-					StopServer();				
-					}
-}										
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::LaunchFotaUpdate
-// Launches the FOTA update dialog
-//----------------------------------------------------------------------------
-
-void CFMSInterruptAob::LaunchFotaUpdate()
-    {
-    RFotaEngineSession fotaengine;
-    TRAPD(error,fotaengine.OpenL());
-    if(error == KErrNone)
-        {
-        FLOG(_L("CFMSInterruptAob::LaunchFotaUpdate()- going for update"));
-        TInt err=fotaengine.Update( -1, -1, KNullDesC8, KNullDesC8 );
-        if(err)
-            {
-            FLOG( _L( "LaunchFotaUpdate() failed   " ) );              	
-            }
-        FLOG(_L("CFMSInterruptAob::LaunchFotaUpdate()- closing fota engine"));
-        iUpdInterruptType = ENoInterrupt;
-        fotaengine.Close();	
-        }
-    else
-        {
-        FLOG(_L("CFMSInterruptAob::LaunchFotaUpdate()- error in opening the fota engine"));
-        }
-    }
-
-
-
-//----------------------------------------------------------------------------
-// CFMSInterruptAob::StartCallEndMonitoringL
-// starts monitoring for call end 
-//----------------------------------------------------------------------------
-void CFMSInterruptAob::StartCallEndMonitoringL(TFmsIpcCommands aType)
-    {    
-    if(!IsActive())
-        {
-        FLOG(_L("Starting Call End Monitoring:Begin"));
-        iUpdInterruptType = aType;        
-        User::LeaveIfError(iTelServer.Connect());
-        _LIT(KTsyName, "phonetsy.tsy");//TSY module names wouldn't change 
-        RTelServer::TPhoneInfo info;
-        RPhone::TLineInfo lineInfo;        
-        User::LeaveIfError(iTelServer.LoadPhoneModule(KTsyName));
-        // Get the details for the first (and only) phone.
-        User::LeaveIfError(iTelServer.GetPhoneInfo(0, info));
-        // Open the phone.
-        User::LeaveIfError(iPhone.Open(iTelServer, info.iName));
-        iPhone.Initialise();
-        TInt numberLines = 0;
-        User::LeaveIfError(iPhone.EnumerateLines(numberLines));
-        TBool foundLine = EFalse;
-        for (TInt a = 0; a < numberLines; a++)
-            {
-            User::LeaveIfError(iPhone.GetLineInfo(a, lineInfo));
-            if (lineInfo.iLineCapsFlags & RLine::KCapsVoice)
-                {
-                foundLine = ETrue;
-                break;
-                }
-            }
-        if (!foundLine)
-            {
-            User::Leave(KErrNotFound);
-            }
-        User::LeaveIfError(iLine.Open(iPhone, lineInfo.iName));
-        iCallStatus = RCall::EStatusIdle;
-        iLine.NotifyStatusChange(iStatus, iCallStatus);
-        SetActive();
-        }
-    FLOG(_L("Starting Call End Monitoring: end"));
-    }
-//End of File
--- a/fotaapplication/fmserver/src/fmsserver.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,839 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <systemwarninglevels.hrh>
-#include <e32property.h>
-#include <bldvariant.hrh>
-#include <startupdomainpskeys.h>
-#include <hwrmpowerstatesdkpskeys.h>
-#include <f32file.h>
-#include <sysutil.h> 
-#include <centralrepository.h>
-#include <ctsydomainpskeys.h>
-#include "fotaserverPrivateCRKeys.h"
-#include "fmsserver.h"
-#include "fmsinterruptaob.h"
-#include "fmsclientserver.h"
-#include "fmsserversession.h"
-#include <schinfo.h>
-#include <csch_cli.h>
-#include "FotaIPCTypes.h"
-// ----------------------------------------------------------------------------------------
-// Server startup code
-// ----------------------------------------------------------------------------------------
-static void RunServerL()
-	{
-	// naming the server thread after the server helps to debug panics
-	User::LeaveIfError(User::RenameThread(KFMSServerName)); 
-
-	// create and install the active scheduler
-	CActiveScheduler* s=new(ELeave) CActiveScheduler;
-	CleanupStack::PushL(s);
-	CActiveScheduler::Install(s);
-
-	// create the server (leave it on the cleanup stack)
-	CFMSServer::NewLC();
-
-	// Initialisation complete, now signal the client
-	RProcess::Rendezvous(KErrNone);
-
-	// Ready to run
-	CActiveScheduler::Start();
-
-	// Cleanup the server and scheduler
-	CleanupStack::PopAndDestroy(2);
-	}
-
-
-// ----------------------------------------------------------------------------------------
-// static method LogNwRequestL() called to submit async n/w request
-// ----------------------------------------------------------------------------------------
-static TInt LogNwRequestL(TAny* aPtr)
-	{
-	CFMSServer* ptr = (CFMSServer*) aPtr;
-	FLOG(_L("static LogNwRequestL:-Begin"));
-	TRAPD(err, ptr->StartMonitoringL(EDLNetworkInterrupt));
-	FLOG(_L("LogNwRequestL started monitoring"));
-	ptr->StopAsyncRequest();
-	FLOG(_L("static LogNwRequestL:-end"));
-	return err;
-	}
-
-
-// ----------------------------------------------------------------------------------------
-// static method LogCallEndMonitorRequestL() called to submit async call end monitor request
-// ----------------------------------------------------------------------------------------
-static TInt LogCallEndMonitorRequestL(TAny* aPtr)
-    {
-    CFMSServer* ptr = (CFMSServer*) aPtr;
-    FLOG(_L("static LogCallEndMonitorRequestL:-Begin"));
-    TRAPD(err, ptr->StartUpdateInterruptMonitoringL(EUpdMonitorPhoneCallEnd));
-    FLOG(_L("LogCallEndMonitorRequestL started monitoring"));
-    ptr->StopAsyncRequest();
-    FLOG(_L("static LogCallEndMonitorRequestL:-end"));
-	return err;
-	}
-
-// ----------------------------------------------------------------------------------------
-// Server process entry-point
-// ----------------------------------------------------------------------------------------
-TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	TInt r=KErrNoMemory;
-	if (cleanup)
-		{
-		TRAP(r,RunServerL());
-		delete cleanup;
-		}
-	__UHEAP_MARKEND;
-	return r;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::NewLC
-// ----------------------------------------------------------------------------------------
-CServer2* CFMSServer::NewLC()
-{
-CFMSServer* self=new(ELeave) CFMSServer;
-CleanupStack::PushL(self);
-self->ConstructL();	
-return self;
-}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::ConstructL
-// ----------------------------------------------------------------------------------------
-void CFMSServer::ConstructL()
-	{
-	FLOG(_L("CFMSServer::ConstructL- begin"));
-	StartL(KFMSServerName);		
-	User::LeaveIfError( iFs.Connect() );
-	TInt err;
-	err = iFs.CreatePrivatePath(EDriveC);
-	if ( err != KErrNone && err != KErrAlreadyExists )
-		{ User::Leave (err); }
-	User::LeaveIfError( iFs.SetSessionToPrivate( EDriveC ) );
-	err = iFile.Create(iFs,KFotaInterruptFileName,EFileWrite);
-	if(err == KErrNone)//means file created now and opened
-		{
-		FLOG(_L("CFMSServer::ConstructL- file closed"));
-		iFile.Close();
-		}
-	else if( err != KErrAlreadyExists )
-		{
-		FLOG(_L("CFMSServer::ConstructL- leaving with err as %d"),err);
-		User::Leave(err);
-		}
-	FindVariation();
-	iFMSInterruptAob.ConstructL();
-	iFMSInterruptAob.iServer = this;  
-	FLOG(_L("CFMSServer::ConstructL- end"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::CFMSServer() 
-// ----------------------------------------------------------------------------------------
-CFMSServer::CFMSServer() :CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/
-	{	
-	iSessionCount = 0;
-	//iNetworkMon = ETrue; //Incase of cenrep key has problem
-	iNetworkMon = EFalse; 
-	iChargerMon = EFalse;
-	iPhoneRestartMon = EFalse;
-	iMemoryMon = EFalse;
-	iDeleteFile = ETrue;
-	iLogAsyncRequest = NULL;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::MemoryToMonitorL() 
-// ----------------------------------------------------------------------------------------
-void CFMSServer::MemoryToMonitorL(TInt aSize, TDriveNumber aDrive)
-	{
-	if( iSessionCount == 0 )// no pending request
-		{
-		iFMSInterruptAob.MemoryToMonitorL(aSize,aDrive);
-		}
-	}
-// ----------------------------------------------------------------------------------------
-// CFMSServer::NetworkTypeL() 
-// ----------------------------------------------------------------------------------------
-void CFMSServer::NetworkTypeL(TInt aBearer)
-	{
-	if( iSessionCount == 0 )// no pending request
-		{
-		iFMSInterruptAob.NetworkTypeL(aBearer);
-		}
-	}
-
-//------------------------------------------------------------
-// Call from session class in fotastartup  case 
-// CFMSServer::CheckNetworkL
-//------------------------------------------------------------
-void CFMSServer::CheckNetworkL(TInt& aBearerId, TInt& aDrive, TInt& aSize,
-		TBool& aWcdma)
-	{
-	if(iNetworkMon)//n/w monitoring supports
-		{
-		FLOG(_L("CFMSServer::CheckNetworkL- n/w monitor supported"));
-		if(iFMSInterruptAob.CheckNetworkL()) //not n/w interrupt + WLAN or GPRS
-			{
-			FLOG(_L("CFMSServer::CheckNetworkL- n/w mon supported & launch fota"));
-			iFMSInterruptAob.LaunchFotaEngineL();		
-			DropSession(); // to close the session & server
-			return;
-			}			
-		else //if network not up, monitor for that
-			{
-			//from session itself we set the bearer type
-			FLOG(_L("CFMSServer::CheckNetworkL- n/w not up beaerer 3G %d"),aWcdma);
-			WriteToFile(EDLNetworkInterrupt,aBearerId,
-					(TDriveNumber)aDrive, aSize, aWcdma );
-			StartMonitoringL(EDLNetworkInterrupt);
-			}
-		}
-	else //user interrupt or general interrupt dont check n/w call fota
-		{
-		FLOG(_L("CFMSServer::CheckNetworkL- n/w monitor not supported & launch fota"));		
-		iFMSInterruptAob.LaunchFotaEngineL();
-		FLOG(_L("CFMSServer::CheckNetworkL- stop server"));		
-		DropSession();
-		}
-	}
-
-//------------------------------------------------------------
-// Call from session class in hard reboot only 
-// CFMSServer::TriggerFotaL
-//------------------------------------------------------------
-void CFMSServer::TriggerFotaL()
-	{
-	FLOG(_L("CFMSServer::TriggerFotaL- begin"));	
-	if(iNetworkMon)//n/w monitoring supports
-		{
-		FLOG(_L("CFMSServer::TriggerFotaL- n/w monitor supported"));
-#if defined (__WINS__)
-		if(ETrue)
-#else
-		if(iFMSInterruptAob.CheckNetworkL())
-#endif
-			{
-			FLOG(_L("CFMSServer::TriggerFotaL- n/w mon supported & launch fota"));
-			iFMSInterruptAob.LaunchFotaEngineL();				
-			}
-		else if(iFMSInterruptAob.CheckGlobalRFStateL())
-			{
-			FLOG(_L("CFMSServer::TriggerFotaL- n/w check started"));
-			iFMSInterruptAob.StartNetworkRegistryCheckL();
-			return; //dont call drop session as it closes server
-			}
-		else
-			{
-			FLOG(_L("CFMSServer::TriggerFotaL- phone is offline"));			
-			}
-		}
-	else //user interrupt or general interrupt dont check n/w call fota
-		{
-		FLOG(_L("CFMSServer::TriggerFotaL- n/w monitor not supported & launch fota"));		
-		iFMSInterruptAob.LaunchFotaEngineL();		
-		FLOG(_L("CFMSServer::TriggerFotaL- stop server"));			
-		}
-	DropSession(); // to close the session & server in any case
-	FLOG(_L("CFMSServer::TriggerFotaL- End"));
-	}
-
-//------------------------------------------------------------
-// Called only in n/w interrupt+ WLAN case from session class
-// CFMSServer::CheckWlanL
-//------------------------------------------------------------
-TBool CFMSServer::CheckWlanL()
-	{
-	return iFMSInterruptAob.CheckNetworkL();
-	}
-
-//------------------------------------------------------------
-// CFMSServer::SetWcdma
-//------------------------------------------------------------
-void CFMSServer::SetWcdma()
-	{
-	iFMSInterruptAob.SetWcdma();
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::LockSession() 
-// ----------------------------------------------------------------------------------------
-void CFMSServer::LockSession()
-	{
-	iSessionCount++;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::WriteToFile() 
-// ----------------------------------------------------------------------------------------
-void CFMSServer::WriteToFile(TInt aReason, TInt aBearer,TDriveNumber aDrive,
-		TInt aSize, TBool aWcdmaBearer )
-	{
-	if(iSessionCount == 0)
-		{
-		FLOG(_L("CFMSServer::WriteToFile- begin"));
-		TInt err=iFile.Open(iFs,KFotaInterruptFileName,EFileWrite);
-		if(err == KErrNone)
-			{
-			FLOG(_L("CFMSServer::WriteToFile--passed"));
-			TBuf8<30> data;//size 30 or 32--as args is 16 bytes
-			TBuf8<30> temp;
-			temp.Num(aReason);
-			data.Append(temp);
-			data.Append(',');
-			temp.Num(aBearer);// or use iFMSinterruptAob's iBearer
-			data.Append(temp);
-			data.Append(',');
-			temp.Num((TInt)aDrive);
-			data.Append(temp);
-			data.Append(',');
-			temp.Num(aSize);  
-			data.Append(temp);
-			data.Append(',');
-			temp.Num(aWcdmaBearer);
-			data.Append(temp);
-			iFile.Write(data);
-			iFile.Close();
-			}
-		else
-			FLOG(_L("CFMSServer::WriteToFile- Failed"));
-		}
-	else
-		FLOG(_L("CFMSServer::WriteToFile- not done as another request is there"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::ReadFromFile() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSServer::ReadFromFile(TInt& aReason, TInt& aBearer, TInt& aDrive, TInt& aSize
-		, TInt& aWcdmaBearer )
-	{
-	TInt err = iFile.Open(iFs,KFotaInterruptFileName,EFileRead);
-	FLOG(_L("CFMSServer::ReadFromFile() error as %d"),err);
-	if(err == KErrNone)
-		{
-		TInt size = KErrNone;
-		err = iFile.Size(size);	
-		if(size == 0) //file empty
-			{
-			FLOG(_L("CFMSServer::ReadFromFile() file size is empty"));
-			iFile.Close();
-			return EFalse;		
-			}
-		TBuf8<30> data;
-		iFile.Read(data);
-		iFile.Close();	
-		TBuf8<30> data1;    
-		if(data.Length()>0)
-			{
-			TInt len =0 ;
-			if((len=data.LocateF(',')) > 0)
-				{
-				TLex8 value( data.Left(len));            
-				value.Val(aReason);
-				FLOG(_L("CFMSServer::ReadFromFile() retrieving reason as %d"),aReason);
-				data1.Insert(0,data.Right(data.Length()-(len+1)));
-				data.Zero();
-				//    len=data1.LocateF(',');
-				if( data1.Length() > 0 && (len=data1.LocateF(',')) > 0)
-					{
-					value=data1.Left(len);            
-					value.Val(aBearer);  
-					FLOG(_L("CFMSServer::ReadFromFile() retrieving aBearer as %d"),aBearer);
-					data.Insert(0,data1.Right(data1.Length()-(len+1)));            
-					data1.Zero();
-					//  len=data.LocateF(','); 
-					if(data.Length() > 0 && (  len=data.LocateF(','))> 0)
-						{
-						value=data.Left(len);            
-						value.Val(aDrive);
-						FLOG(_L("CFMSServer::ReadFromFile() retrieving aDrive as %d"),aDrive);
-						data1.Insert(0,data.Right(data.Length()-(len+1)));
-						data.Zero();
-						if(data1.Length() > 0 && (  len=data1.LocateF(','))> 0 )
-							{
-							value=data1.Left(len);
-							value.Val(aSize);
-							FLOG(_L("CFMSServer::ReadFromFile() retrieving aSize as %d"),aSize);
-							data.Insert(0,data1.Right(data1.Length()-len-1));
-							data1.Zero();
-							if(data.Length() > 0 )
-								{
-								value=data;  
-								value.Val(aWcdmaBearer);
-								FLOG(_L("CFMSServer::ReadFromFile() retrieving aWcdmaBearer as %d"),aWcdmaBearer);
-								}
-							}
-						} 
-					}
-				}    
-			}
-		}
-	else
-		{
-		return EFalse;
-		}
-	return ETrue;
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSServer::DropSession()
-// -----------------------------------------------------------------------------
-
-void CFMSServer::DropSession()
-	{
-	// A session is being destroyed	
-	iSessionCount = 0;	
-	//Kill the server
-	CActiveScheduler::Stop();	
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::FindVariation() 
-// ----------------------------------------------------------------------------------------
-void CFMSServer::FindVariation()
-	{
-	FLOG(_L("CFMSServer::FindVariation()"));
-	CRepository* centrep = NULL;
-	TInt variation = 1;
-	TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-	if ( centrep )
-		{
-		FLOG(_L("CFMSServer::FindVariation()::Inside cenrep if"));
-		TInt err = centrep->Get( KFotaMonitoryServiceEnabled, variation );                 
-		if( err == KErrNone)
-			{ 
-			FLOG(_L("CFMSServer::FindVariation()::cenrep key found with %d"),variation);
-			}
-		delete centrep;
-		}
-	if ( err == KErrNone )
-		{
-		TBuf<10> var; //32-bit has max of 10 chars in Decimal
-		var.Num(variation,EBinary);
-		TInt size = var.Length(), maxlen = 4;
-		if( size < maxlen)
-			{
-			TBuf<4> temp;
-			temp.AppendFill('0',maxlen-size);
-			temp.Append(var);
-			var.Zero();
-			var.Append(temp);
-			}
-		var.AppendFill('0',6);
-		if( var[0] == '1' )//memory
-			{
-			FLOG(_L("CFMSServer::FindVariation():: memory monitor supported"));    		
-			iMemoryMon = ETrue;
-			}
-		if( var[1] == '1' ) //startup
-			{
-			FLOG(_L("CFMSServer::FindVariation()::Phone restart monitor supported"));
-			iPhoneRestartMon = ETrue;
-			}
-		if( var[2] == '1' )//user or charger
-			{			
-			FLOG(_L("CFMSServer::FindVariation()::charger monitor supported"));    		
-			iChargerMon = ETrue;
-			}
-		if( var[3] == '1' )//newtwork
-			{
-			FLOG(_L("CFMSServer::FindVariation()::network monitor supported"));
-			iNetworkMon = ETrue;
-			}    	
-		}	
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::ChargerTobeMonitered() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSServer::ChargerTobeMonitered()
-	{
-	FLOG(_L("CFMSServer::ChargerTobeMonitered()::charger monitor check"));
-	return iChargerMon;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::NetworkTobeMonitered() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSServer::NetworkTobeMonitered()
-	{
-	FLOG(_L("CFMSServer::NetworkTobeMonitered()::network monitor check"));
-	return iNetworkMon;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::MoniterAfterPhoneRestart() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSServer::MoniterAfterPhoneRestart()
-	{
-	FLOG(_L("CFMSServer::MoniterAfterPhoneRestart()::phonerestart monitor check"));
-	return iPhoneRestartMon;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::MemoryTobeMonitered() 
-// ----------------------------------------------------------------------------------------
-TBool CFMSServer::MemoryTobeMonitered()
-	{
-	FLOG(_L("CFMSServer::MemoryTobeMonitered()::memory monitor check"));
-	return iMemoryMon;
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSServer::StartMonitoring()
-// -----------------------------------------------------------------------------
-void CFMSServer::StartMonitoringL(TFmsIpcCommands aType)
-	{
-	// A new session is being created	
-	FLOG(_L("CFMSServer::StartMonitoringL>>"));
-	if( iSessionCount == 0 ) 
-		{
-		++iSessionCount;		
-		iFMSInterruptAob.StartL(aType);
-		}
-		FLOG(_L("CFMSServer::StartMonitoringL<<"));
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSServer::DeleteFile()
-// -----------------------------------------------------------------------------
-void CFMSServer::DeleteFile(TBool aValue)
-	{	
-	iDeleteFile = aValue;
-	}
-// ----------------------------------------------------------------------------------------
-// CFMSServer::~CFMSServer() 
-// ----------------------------------------------------------------------------------------
-CFMSServer::~CFMSServer()
-{
-FLOG(_L("CFMSServer::~CFMSServer())"));
-//iFMSInterruptAob.Cancel();
-if(iDeleteFile)
-	{
-	TInt err = iFs.Delete(KFotaInterruptFileName);
-	FLOG(_L("CFMSServer::~CFMSServer() File Deleted with error as %d"),err);
-	}
-if(iLogAsyncRequest)
-	{
-	FLOG(_L("CFMSServer::~CFMSServer():-iLogAsyncRequest cancel)"));
-	iLogAsyncRequest->Cancel();
-	delete iLogAsyncRequest;
-	iLogAsyncRequest = NULL;
-	}
-iFs.Close();	
-}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::NewSessionL() 
-// ----------------------------------------------------------------------------------------
-CSession2* CFMSServer::NewSessionL(const TVersion&,const RMessage2&) const
-{
-return new (ELeave) CFMSSession();
-}
-
-// ----------------------------------------------------------------------------------------
-// CFMSServer::RequestPending() 
-// Any request pending
-// ----------------------------------------------------------------------------------------
-TBool CFMSServer::RequestPending()
-	{
-	if( iSessionCount > 0 )
-		{
-		return ETrue;
-		}
-	return EFalse;
-	}
-
-// ----------------------------------------------------------------------------
-// CFMSServer::AsyncSessionRequestL() 
-// Asynchronous request logging
-// ----------------------------------------------------------------------------
-void CFMSServer::AsyncSessionRequestL()
-	{
-	if(iLogAsyncRequest)
-		{
-		FLOG(_L("CFMSServer::AsyncSessionRequestL():-iLogAsyncRequest cancel)"));
-		iLogAsyncRequest->Cancel();
-		delete iLogAsyncRequest;
-		iLogAsyncRequest = NULL;
-		}
-	iLogAsyncRequest = CPeriodic::NewL (EPriorityNormal) ;
-	FLOG(_L("CFMSServer::AsyncSessionRequestL():-iLogAsyncRequest created)"));
-	iLogAsyncRequest->Start(
-			TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
-			, TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
-			, TCallBack(LogNwRequestL,this) ) ;
-	FLOG(_L("CFMSServer::AsyncSessionRequestL():-Request logged)"));
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSServer::AsyncSessionRequestL() 
-// Asynchronous request logging
-// -----------------------------------------------------------------------------
-void CFMSServer::StopAsyncRequest()
-	{
-	FLOG(_L("CFMSServer::StopAsyncRequest():-Begin)"));
-	if(iLogAsyncRequest)
-		{
-		FLOG(_L("CFMSServer::StopAsyncRequest():-cancelling the request)"));
-		iLogAsyncRequest->Cancel();
-		delete iLogAsyncRequest;
-		iLogAsyncRequest = NULL;
-		}
-	FLOG(_L("CFMSServer::StopAsyncRequest():-End)"));
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSServer::StartBatteryMonitoringL() 
-// Monitors for the battery
-// -----------------------------------------------------------------------------
-void CFMSServer::StartBatteryMonitoringL(TFmsIpcCommands aType, TUint aLevel)
-	{
-	// A new session is being created	
-	FLOG(_L("CFMSServer::StartMonitoringL, level = %d>>"), aLevel);
-	if( iSessionCount == 0 ) 
-		{
-		++iSessionCount;		
-		iFMSInterruptAob.StartBatteryMonitoringL(aType, aLevel);
-		}
-		FLOG(_L("CFMSServer::StartMonitoringL<<"));
-	}
-// -----------------------------------------------------------------------------
-// CFMSServer::StartUpdateInterruptMonitoringL() 
-// Monitors for the update interrupt type
-// -----------------------------------------------------------------------------
-void CFMSServer::StartUpdateInterruptMonitoringL(TFmsIpcCommands aType)
-	{
-	// A new session is being created	
-	FLOG(_L("CFMSServer::StartUpdateInterruptMonitoringL>>"));
-	if(EUpdMonitorPhoneCallEnd == aType)
-	    {
-	    iFMSInterruptAob.StartCallEndMonitoringL(aType);
-	    }
-	else
-	    {
-	    FLOG(_L("reason unknown"));
-	    }
-		FLOG(_L("CFMSServer::StartUpdateInterruptMonitoringL<<"));
-	}
-
-// -----------------------------------------------------------------------------
-// CFMSServer::CheckPhoneCallActiveL() 
-// checks any phone call is there or not at this moment
-// -----------------------------------------------------------------------------
-void CFMSServer::CheckPhoneCallActiveL(TInt& aStatus)
-    {
-    FLOG(_L("CFMSServer::CheckPhoneCallActiveL>>"));
-    TInt callstatus(KErrNotFound);
-    RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, callstatus);
-    //check ctsydomainpskeys.h for different combinations, below OR condition holds good
-    if(EPSCTsyCallStateUninitialized == callstatus || 
-            EPSCTsyCallStateNone == callstatus ) // call not active
-        {
-        aStatus = EFalse;
-        }
-    else // call active
-        {
-        aStatus = ETrue;
-        }
-    FLOG(_L("CFMSServer::CheckPhoneCallActiveL status is %d<<"),aStatus);
-    }
-
-// -----------------------------------------------------------------------------
-// CFMSServer::MonitorPhoneCallEndL() 
-// Monitors for active phone call end
-// -----------------------------------------------------------------------------
-TBool CFMSServer::MonitorPhoneCallEndL()
-    {
-    TInt CallState = KErrNotFound;
-
-    CheckPhoneCallActiveL(CallState);
-    if(CallState)
-        {
-        //go for call end montioring
-        LogAsyncCallMonitorL();
-        return EFalse;
-        }
-    else //trigger fota to show install query
-        {
-        return ETrue;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CFMSServer::LogAsyncCallMonitorL() 
-// Async request to monitor active phone call end
-// -----------------------------------------------------------------------------
-void CFMSServer::LogAsyncCallMonitorL()
-    {
-    if(iLogAsyncRequest)
-        {
-        FLOG(_L("CFMSServer::LogAsyncCallMonitorL():- cancel)"));
-        iLogAsyncRequest->Cancel();
-        delete iLogAsyncRequest;
-        iLogAsyncRequest = NULL;
-        }
-    iLogAsyncRequest = CPeriodic::NewL (EPriorityNormal) ;
-    FLOG(_L("CFMSServer::LogAsyncCallMonitorL(): created)"));
-    iLogAsyncRequest->Start(
-            TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*1)
-            , TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
-            , TCallBack(LogCallEndMonitorRequestL,this) ) ;
-    FLOG(_L("CFMSServer::LogAsyncCallMonitorL():-Request logged)"));
-    }
-
-
-void CFMSServer::CreateScheduledReminderL()
-    {
-    FLOG(_L("CFMSServer::CreateScheduledReminderL ()"));
-    _LIT(KFotaScheduleExe, "Z:\\sys\\bin\\fotaschedulehandler.exe");
-
-    RScheduler scheduler;
-    TTsTime startTime;
-    TTime time;
-    time.HomeTime();
-    time = time + (TTimeIntervalHours(1));
-    startTime.SetLocalTime(time);
-
-    User::LeaveIfError(scheduler.Connect());
-    CleanupClosePushL(scheduler);
-    //Creating a persistent daily schedule
-    
-    TSchedulerItemRef persistentScheduleItem;
-    CArrayFixFlat<TScheduleEntryInfo2>* entries = new CArrayFixFlat<TScheduleEntryInfo2> (1);
-    CleanupStack::PushL(entries);
-    persistentScheduleItem.iName = TUid::Uid(KFMSServerUid).Name();
-
-    //TScheduleEntryInfo2 scentry1(startTime, EDaily, 1, 1);
-    TScheduleEntryInfo2 scentry1;
-    scentry1.SetStartTime(startTime);
-    scentry1.SetInterval(1);
-    scentry1.SetIntervalType(TIntervalType(EHourly));
-    scentry1.SetValidityPeriod((TTimeIntervalMinutes) 1440); //1440 min = 24 hrs or 1 day
-    
-    entries->AppendL(scentry1);
-
-    scheduler.Register(TFileName( KFotaScheduleExe ), 0 );
-    TInt ret = scheduler.CreatePersistentSchedule(persistentScheduleItem, *entries);
-
-    FLOG(_L("created schedule %d  %d:%d"), persistentScheduleItem.iHandle,
-            time.DateTime().Hour(), time.DateTime().Minute());
-
-    if (ret == KErrNone)
-        {
-        TTaskInfo taskInfo;
-        taskInfo.iName = TUid::Uid(KFMSServerUid).Name();
-        taskInfo.iRepeat = 1; //Repeat once
-        taskInfo.iPriority = 1;
-
-        TFotaScheduledUpdate fotareminder(-1, -1);
-        TPckg<TFotaScheduledUpdate> fotareminderpkg(fotareminder);
-
-        HBufC* data = HBufC::NewLC(fotareminderpkg.Length());
-        data->Des().Copy(fotareminderpkg);
-
-        TInt err = scheduler.ScheduleTask(taskInfo, *data,  persistentScheduleItem.iHandle);
-
-        FLOG(_L("Schedule creation error %d"), err);
-
-        CleanupStack::PopAndDestroy(data);
-        }
-    CleanupStack::PopAndDestroy(entries);
-    CleanupStack::PopAndDestroy(&scheduler); // xx
-    }
-
-
-void CFMSServer::DeleteScheduledRemindersL()
-    {
-    FLOG(_L("CFMSServer::DeleteScheduledRemindersL >>"));
-    
-    TScheduleEntryInfo2                     ret;
-    TInt                                    err;    
-    RScheduler                              sc;
-    TTime                                   t; 
-    TTsTime                                 time;
-    TSchedulerItemRef                       scitem; 
-    CArrayFixFlat<TSchedulerItemRef>*       aSchRefArray = new CArrayFixFlat <TSchedulerItemRef>(5);
-    TScheduleFilter                         aFilter(EAllSchedules);
-    User::LeaveIfError( sc.Connect() ); 
-    CleanupClosePushL( sc );
-    CleanupStack::PushL(aSchRefArray);
-
-    User::LeaveIfError( sc.GetScheduleRefsL( *aSchRefArray,aFilter) );
-    FLOG(_L("Schedule items: "));
-    for ( TInt i=0; i<aSchRefArray->Count(); ++i  )
-    {
-    TSchedulerItemRef it = (*aSchRefArray)[i];
-    if ( it.iName == TUid::Uid(KFMSServerUid).Name()  )
-        {
-        TScheduleState2 sc_state;
-        CArrayFixFlat<TScheduleEntryInfo2>*  sc_entries = new CArrayFixFlat <TScheduleEntryInfo2>(5);
-        CArrayFixFlat<TTaskInfo>*            sc_tasks  = new CArrayFixFlat <TTaskInfo>(5);
-        TTsTime                              sc_duetime;
-        CleanupStack::PushL( sc_entries );
-        CleanupStack::PushL( sc_tasks );
-        FLOG (_L("%d. schedule handle: %d name:'%S'"),i,it.iHandle, &(it.iName) );
-
-        err = sc.GetScheduleL ( it.iHandle , sc_state, *sc_entries,*sc_tasks,sc_duetime ); // xx
-
-        TDateTime  dtm = sc_duetime.GetLocalTime().DateTime();
-        FLOG(_L("   schedule duetime:%d:%d"), dtm.Hour(), dtm.Minute());
-
-        if ( err ) FLOG(_L("     schedule  sc get err %d"),err);
-        else 
-            {
-            for ( TInt k=0; k<sc_entries->Count();++k)
-                {
-                TScheduleEntryInfo2 sc_entry = (*sc_entries)[k];
-                ret = sc_entry;
-                TTime sctime = sc_entry.StartTime().GetLocalTime();
-                FLOG(_L("         schedule entry %d int-type:%d int:%d start: %d:%d"),k,sc_entry.IntervalType(),sc_entry.Interval(),sctime.DateTime().Hour(),sctime.DateTime().Minute());
-                }
-
-            for ( TInt j=0; j<sc_tasks->Count();++j)
-                {
-                TTaskInfo sc_task = (*sc_tasks)[j];
-                FLOG(_L("         schedule task  %d  '%S'"),sc_task.iTaskId,&(sc_task.iName) );
-                if ( sc_task.iName==TUid::Uid(KFMSServerUid).Name() )
-                    {
-                    FLOG(_L("          schedule DeleteTask %d"),sc_task.iTaskId);
-                    User::LeaveIfError( sc.DeleteTask(sc_task.iTaskId) );
-                    }
-                }
-            }
-
-        FLOG(_L("     DeleteSchedule %d"),it.iHandle);
-        err = sc.DeleteSchedule(it.iHandle );
-		FLOG(_L("Delete status of tasks = %d"), err);
-
-        CleanupStack::PopAndDestroy( sc_tasks );
-        CleanupStack::PopAndDestroy( sc_entries );
-        }
-    }
-    CleanupStack::PopAndDestroy( aSchRefArray );
-    CleanupStack::PopAndDestroy(&sc);
-    
-    FLOG(_L("CFMSServer::DeleteScheduledRemindersL <<"));
-    }
-//End of file
--- a/fotaapplication/fmserver/src/fmsserversession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,513 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-#include <f32file.h>
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
-#include <cmpluginwlandef.h>
-#include <cmpluginpacketdatadef.h>
-#include <etel.h> //for telephone mode
-#include <etelmm.h> //for telephone mode
-#include <fotaConst.h> 
-#include "fmsserversession.h"
-#include "fmsclientserver.h"
-
-#if defined (__WINS__)
-#include <cmpluginlanbasedef.h>
-#endif
-// ----------------------------------------------------------------------------------------
-// CFMSSession::CFMSSession
-// ----------------------------------------------------------------------------------------
-CFMSSession::CFMSSession()
-	{	
-	iStopServer  =  EFalse;
-	iWlanbearer  =  EFalse;
-	iWcdmaBearer =  EFalse;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::~CFMSSession
-// ----------------------------------------------------------------------------------------
-CFMSSession::~CFMSSession()
-	{	
-	FLOG(_L("CFMSSession::~CFMSSession-- begin"));
-	if( iStopServer )
-		{
-		FLOG(_L("Stop fmserver CFMSSession::~CFMSSession"));	
-		Server().DropSession();
-		}
-	FLOG(_L("CFMSSession::~CFMSSession-- end"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::Server
-// ----------------------------------------------------------------------------------------
-CFMSServer& CFMSSession::Server()
-	{
-	return *static_cast<CFMSServer*>(const_cast<CServer2*>(CSession2::Server()));
-	}
-
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::CheckClientSecureIdL
-// ----------------------------------------------------------------------------------------
-TBool CFMSSession::CheckClientSecureIdL (
-		const RMessage2& aMessage)
-	{
-	TUid    fota            = TUid::Uid( KFotaServerUid );
-	TUid    starter         = TUid::Uid( KStarterUid );
-
-	// Fotaserver
-	if ( aMessage.SecureId() == fota.iUid ) 
-		{
-		FLOG(_L("[CFMSSession] CheckClientSecureIdL client is \
-		fotaserver!"));
-		return ETrue;
-		}
-
-	// Starter
-	if ( aMessage.SecureId() == starter.iUid )
-		{
-		return ETrue;
-		}
-
-	// test app
-	if ( aMessage.SecureId() == 0x01D278B9 )
-		{
-		return ETrue;
-		}
-
-	FLOG(_L("[CFMSSession] CheckClientSecureIdL client 0x%X is unknown \
-	(msg %d), bailing out"),aMessage.SecureId().iId, aMessage.Function());
-	iStopServer = ETrue;
-	User::Leave( KErrAccessDenied );    
-	return EFalse; // compiler warning otherwise
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::ServiceL
-// ----------------------------------------------------------------------------------------
-void CFMSSession::ServiceL(const RMessage2& aMessage)
-	{	
-	RThread clt; aMessage.ClientL(clt); TFullName cltnm = clt.FullName();
-	FLOG(_L( "CFMSSession::ServiceL      %d   serving for %S?" )
-			,aMessage.Function(), &cltnm );
-	if( CheckClientSecureIdL( aMessage ) )
-		{
-		//already one request pending
-		if( Server().RequestPending() && 
-				aMessage.Function() !=  ECancelOutstandingRequest )
-			{
-			aMessage.Complete(KErrCancel);
-			}
-		else //For no pending request case
-			{
-			TRAPD(err,DispatchMessageL(aMessage));
-			if(err != KErrNone ) 
-				{
-				iStopServer = ETrue;
-				}
-			aMessage.Complete(err);
-			}
-		}
-	else
-		{
-		aMessage.Complete(KErrAccessDenied);
-		}
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::ServiceError
-// ----------------------------------------------------------------------------------------
-void CFMSSession::ServiceError(const RMessage2& aMessage,TInt aError)
-	{		
-	CSession2::ServiceError(aMessage,aError);
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::DispatchMessageL
-// ----------------------------------------------------------------------------------------
-void CFMSSession::DispatchMessageL(const RMessage2& aMessage)
-	{	
-	FLOG(_L("CFMSSession::DispatchMessageL-begin"));
-
-	if( aMessage.Function() != EFotaStartUpPlugin && 
-			aMessage.Function() != ECancelOutstandingRequest && 
-			aMessage.Function() != EUpdMonitorbattery &&
-			aMessage.Function() != EUpdPhoneCallActive &&
-	        aMessage.Function() != EUpdMonitorPhoneCallEnd )
-		{
-		 
-		 HandleBasedOnBearertypeL(aMessage);
-		
-			
-						
-		}
-	switch(aMessage.Function())
-	{
-	case EDLUserInterrupt:
-		{
-		Server().CreateScheduledReminderL();
-		
-		if(Server().ChargerTobeMonitered())
-			{	
-			FLOG(_L("FMSSErver::EUserInterrupt"));			
-			Server().WriteToFile(EDLUserInterrupt,aMessage.Int0(),
-					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);
-			Server().StartMonitoringL(EDLUserInterrupt);
-			}
-		else
-			{
-			WriteDummyFile();
-			iStopServer = ETrue;
-			}
-		}
-		break;
-	case EDLNetworkInterrupt:
-		{
-		if(Server().NetworkTobeMonitered())
-			{
-			FLOG(_L("FMSSErver::ENetworkInterrupt"));						
-			//If wlan = on & network interrupt, then stop the server and dont monitor
-			//mean other wlan n/w's present but this wlan gone off
-			if(iWlanbearer && Server().CheckWlanL())
-				{
-				WriteDummyFile();
-				Server().DeleteFile(EFalse);
-				iStopServer = ETrue;
-				break;
-				}			
-			Server().WriteToFile(EDLNetworkInterrupt,aMessage.Int0(),
-					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);			
-			Server().AsyncSessionRequestL();
-			}
-		else
-			{
-			WriteDummyFile();
-			iStopServer = ETrue;
-			}
-		}
-		break;
-	case EDLMemoryInterrupt:
-		{			
-		if(Server().MemoryTobeMonitered())
-			{
-			FLOG(_L("FMSSErver::EMemoryInterrupt"));				
-			Server().MemoryToMonitorL(aMessage.Int2(),(TDriveNumber)aMessage.Int1()); 		
-			Server().WriteToFile(EDLMemoryInterrupt,aMessage.Int0(),
-					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);
-			Server().StartMonitoringL(EDLMemoryInterrupt);		
-			}
-		else
-			{
-			WriteDummyFile();
-			iStopServer = ETrue;
-			}
-		}
-		break;
-	case EDLGeneralInterrupt:
-		{
-		if(Server().ChargerTobeMonitered())
-			{
-			FLOG(_L("FMSSErver::GeneralInterrupt"));	
-			Server().WriteToFile(EDLUserInterrupt,aMessage.Int0(),
-					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);
-			Server().StartMonitoringL(EDLUserInterrupt);
-			}
-		else
-			{
-			WriteDummyFile();
-			iStopServer = ETrue;
-			}
-		}
-		break;
-	case EFotaStartUpPlugin:
-		{	
-		if(Server().MoniterAfterPhoneRestart())				
-			{
-			FLOG(_L("CFMSSession::EFotaStartUpPlugin"));	
-			TInt intrreason(-1),bearer(-1),size(0);
-			TInt drive(-1), wcdmabearer(-1);
-			//if loop for Hard reboot--no file or size is empty
-#if defined(__WINS__)
-        if(ETrue)
-#else
-			if(Server().ReadFromFile(intrreason,bearer,drive,size,wcdmabearer) == EFalse )
-#endif
-				{
-				FLOG(_L("CFMSSession::EFotaStartUpPlugin no file or size is empty"));
-				if(!Server().RequestPending())
-					{	
-					FLOG(_L("CFMSSession::EFotaStartUpPlugin-no request pending"));						  					  	
-					TRAPD(err,PhoneModeL());
-					if(err); // remove compiler warning
-					FLOG(_L("PhoneModeL() fotastartup returns err as %d"),err);
-					if(iWcdmaBearer)						 
-						Server().NetworkTypeL( (TInt)EBearerIdWCDMA );
-
-					else
-						Server().NetworkTypeL( (TInt)EBearerIdGPRS );	  					  					  
-					Server().LockSession();
-					Server().TriggerFotaL(); //checks n/w & trigger FOTA DL						
-					}
-				break;
-				}												
-			TUint32 BearerId = FindBearerIdL(bearer);
-			FLOG(_L("CFMSSession::EFotaStartUpPlugin wcdma bearer is %d"),wcdmabearer);
-			if( BearerId == KUidWlanBearerType )
-				{
-				FLOG(_L("CFMSSession::EFotaStartUpPlugin-wlan bearer"));	
-				Server().NetworkTypeL(EBearerIdWLAN);
-				if(intrreason == EDLNetworkInterrupt)
-					{
-					//stop the server , but dont delete file to support in second reboot
-					FLOG(_L("wlan bearer & n/w interrupt--stopping the server"));
-					Server().DeleteFile(EFalse);
-					iStopServer = ETrue;
-					break;
-					}
-				}
-			else if( BearerId == KUidPacketDataBearerType )
-				{
-				FLOG(_L("CFMSSession::EFotaStartUpPlugin-bearer is packet data"));	
-				if( wcdmabearer == 1 )
-					{
-					Server().NetworkTypeL(EBearerIdWCDMA);	
-					FLOG(_L("CFMSSession::EFotaStartUpPlugin-packet data and 3G"));
-					}
-				else
-					{
-					Server().NetworkTypeL(EBearerIdGPRS);
-					FLOG(_L("CFMSSession::EFotaStartUpPlugin-packet data and 2G"));
-					}
-				}
-			else
-				{
-				FLOG(_L("CFMSSession::EFotaStartUpPlugin-unknown bearer"));
-				Server().DeleteFile(EFalse);
-				iStopServer = ETrue;
-				break;
-				}
-			//when there is dummy file in the store
-			if( intrreason < EDLUserInterrupt || intrreason > EDLGeneralInterrupt )
-				{
-				FLOG(_L("CFMSSession::EFotaStartUpPlugin-Interrupt unknown"));	
-				Server().DeleteFile(EFalse); //used when variation support & reboot again
-				iStopServer = ETrue;
-				break;
-				}
-			if( intrreason == EDLUserInterrupt || intrreason == EDLGeneralInterrupt )
-				{
-				FLOG(_L("CFMSSession::EFotaStartUpPlugin-Check n/w & trigger fotaengine"));	
-				Server().CheckNetworkL(bearer,drive,size,wcdmabearer);//3 params used in monitoring if no n/w
-				break;
-				} 				
-			//for other interrupts it will monitor
-			Server().StartMonitoringL((TFmsIpcCommands)intrreason);
-			}
-		else
-			{
-			iStopServer = ETrue;
-			}
-		}
-		break;
-	case ECancelOutstandingRequest:
-		{					
-		FLOG(_L("CFMSSession::DispatchMessageL ECancelOutstandingRequest case:"));
-		Server().DeleteScheduledRemindersL();
-		iStopServer = ETrue; 
-		}
-		break;	
-
-	case EUpdMonitorbattery:
-	   {
-	    FLOG(_L("CFMSSession::DispatchMessageL EUpdMonitorbattery case:"));
-	 	Server().StartBatteryMonitoringL(EUpdMonitorbattery, aMessage.Int0());
-	   }
-	 	break;
-	   
-	case EUpdPhoneCallActive:
-	    {
-	    FLOG(_L("CFMSSession::DispatchMessageL EUpdPhoneCallActive case:"));
-	    Server().LockSession();
-	    TInt reason =EFalse;
-	    Server().CheckPhoneCallActiveL(reason);
-	    TPckgBuf<TInt> callactive(reason);
-	    aMessage.WriteL(0,callactive);
-	    Server().iSessionCount = 0;
-	    FLOG(_L("CFMSSession::DispatchMessageL EUpdPhoneCallActive case:%d"),reason);
-	    iStopServer = ETrue;
-	    }
-	    break;
-	    
-	case EUpdMonitorPhoneCallEnd:
-	    {
-	    FLOG(_L("CFMSSession::DispatchMessageL EUpdMonitorPhoneCallEnd case:%d,%d"),aMessage.Int0(),aMessage.Int1());
-	    Server().LockSession();
-	    if(Server().MonitorPhoneCallEndL())
-	        {
-	        iStopServer = ETrue;
-	        Server().iSessionCount = 0;
-	        }
-	    else //let server monitor for active call end
-	        {
-	        iStopServer = EFalse;
-	        }
-	   }
-	 	break;
-	default:
-		{
-		FLOG(_L("CFMSSession::DispatchMessageL default case:and a leave happened"));
-		iStopServer = ETrue;
-		User::Leave(KErrArgument);			
-		}			
-	}
-	FLOG(_L("CFMSSession::DispatchMessageL:end"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::FindBearerId
-// ----------------------------------------------------------------------------------------
-TUint32 CFMSSession::FindBearerIdL(TInt aIapId)
-	{
-	FLOG(_L("CFMSSession::FindBearerId: % d"),aIapId);
-	TUint32 bearer = 0;
-	TInt err( KErrNone );
-	// Query CM Id
-	TInt cmId ( aIapId );			        
-	RCmManagerExt  CmManagerExt;
-	TRAP( err, CmManagerExt.OpenL() );
-	if( err == KErrNone )
-		{
-		RCmConnectionMethodExt cm;
-		TRAP( err, cm = CmManagerExt.ConnectionMethodL( cmId ) );			        	
-		if ( err == KErrNone )
-			{	        
-			CleanupClosePushL( cm );	  
-			bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );	        			        
-			CleanupStack::PopAndDestroy();  // cm	        
-			}	    	        
-		CmManagerExt.Close();
-		}
-	return bearer;
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::WriteDummyFile
-// This method used when the variation wouldn't support and startup called
-// and also differentiates hard reeboot(with empty or no file)
-// ----------------------------------------------------------------------------------------
-void CFMSSession::WriteDummyFile()
-	{
-	FLOG(_L("CFMSSession::WriteDummyFile--begin"));
-	Server().WriteToFile(KErrNotFound,KErrNotFound,
-			(TDriveNumber)KErrNotFound,KErrNotFound,EFalse);
-	Server().DeleteFile(EFalse);
-	FLOG(_L("CFMSSession::WriteDummyFile--End"));
-	}
-
-// ----------------------------------------------------------------------------------------
-// CFMSSession::PhoneMode
-// This method used to know the current phone mode
-// If the phone is in dual mode it will check GPRS bearer only
-// ----------------------------------------------------------------------------------------
-void CFMSSession::PhoneModeL()
-	{
-	FLOG(_L("CFMSSession::PhoneModeL--begin"));	
-	// find out if we are in 2G or in 3G - it is needed for calculating bearer availability
-	__UHEAP_MARK; 
-	RTelServer telServer;
-	User::LeaveIfError( telServer.Connect());
-	FLOG(_L("CFMSSession::PhoneModeL--telServer Connected"));
-	RTelServer::TPhoneInfo teleinfo;
-	User::LeaveIfError( telServer.GetPhoneInfo( 0, teleinfo ) );
-	FLOG(_L("CFMSSession::PhoneModeL--telServer getting tel info"));
-	RMobilePhone phone;
-	User::LeaveIfError( phone.Open( telServer, teleinfo.iName ) );
-	FLOG(_L("CFMSSession::PhoneModeL--RMobilePhone opened"));
-	User::LeaveIfError(phone.Initialise());	
-	FLOG(_L("CFMSSession::PhoneModeL--phone.Initialise() success"));
-	RMobilePhone::TMobilePhoneNetworkMode mode;        	        	
-	TInt err = phone.GetCurrentMode( mode );
-	phone.Close();
-	telServer.Close();
-	__UHEAP_MARKEND;
-
-	if( KErrNone == err )
-		{
-		switch(mode)
-		{
-		case RMobilePhone::ENetworkModeGsm:
-		//case RMobilePhone::ENetworkModeUnknown:  // emulator default
-			{
-			FLOG(_L("CFMSSession::PhoneModeL-begin-GSM Mode"));	                		
-			iWcdmaBearer = EFalse;
-			Server().NetworkTypeL(EBearerIdGPRS);
-			break;		
-			}
-		case RMobilePhone::ENetworkModeWcdma:
-			{                		     		
-			FLOG(_L("CFMSSession::PhoneModeL-begin-3G Mode"));	
-			iWcdmaBearer = ETrue;
-			Server().SetWcdma();
-			Server().NetworkTypeL(EBearerIdWCDMA);
-			break;	
-			}	
-		default:        	
-		FLOG(_L("unknown"));
-		}        				
-		}
-	FLOG(_L("CFMSSession::PhoneModeL--end"));
-	}
-	
-//----------------------------------------------------------------------------------------
-// CFMSSession::HandleBasedOnBearertypeL
-// Handles based on bearer type
-//----------------------------------------------------------------------------------------	
-
-void  CFMSSession::HandleBasedOnBearertypeL(const RMessage2& aMessage)
-{
-    TUint32 bearer = FindBearerIdL(aMessage.Int0());
-		if( bearer == KUidPacketDataBearerType )
-			{
-			FLOG(_L("CFMSSession::DispatchMessageL bearer is packet data"));
-			TRAPD(err,PhoneModeL());
-			if(err); // remove compiler warning
-			FLOG(_L("PhoneModeL() returns err as %d"),err);
-			}
-		else if	(	bearer == KUidWlanBearerType )
-			{
-			FLOG(_L("CFMSSession::DispatchMessageL bearer is WLAN"));
-			iWlanbearer = ETrue;
-			Server().NetworkTypeL(EBearerIdWLAN);
-			}
-#if defined(__WINS__)
-		else if (   bearer == KUidLanBearerType )
-		    {
-            FLOG(_L("CFMSSession::DispatchMessageL bearer is LAN"));
-            Server().NetworkTypeL(EBearerIdLAN);
-		    }
-#endif
-		else	
-			{
-			FLOG(_L("CFMSSession::DispatchMessageL bearer is not known and a leave happened "));
-			iStopServer = ETrue;
-			User::Leave(KErrArgument);
-			}
-}				
-//End of file
--- a/fotaapplication/fotaapplication.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#
-#  Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-#  All rights reserved.
-#  This component and the accompanying materials are made available
-#  under the terms of "Eclipse Public License v1.0"
-#  which accompanies this distribution, and is available
-#  at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#  
-#  Initial Contributors:
-#  Nokia Corporation - initial contribution.
-#  
-#  Contributors: 
-#  
-#  Description: This is the project specification file for the Organizer project.
-#  
-
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS += fotaserver \
-
-# End of file	--Don't remove this.
--- a/fotaapplication/fotacustcmds/bwins/fotacustcmdsu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	?FotaCustCmdAllReasonsNewL@FotaCustCmdsFactory@@SAPAVMSsmCustomCommand@@XZ @ 1 NONAME ; class MSsmCustomCommand * FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL(void)
-	?FotaCustCmdFirmwareUpdateNewL@FotaCustCmdsFactory@@SAPAVMSsmCustomCommand@@XZ @ 2 NONAME ; class MSsmCustomCommand * FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL(void)
-	?FotaCustCmdFirstBootNewL@FotaCustCmdsFactory@@SAPAVMSsmCustomCommand@@XZ @ 3 NONAME ; class MSsmCustomCommand * FotaCustCmdsFactory::FotaCustCmdFirstBootNewL(void)
-
--- a/fotaapplication/fotacustcmds/eabi/fotacustcmdsu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_ZN19FotaCustCmdsFactory25FotaCustCmdAllReasonsNewLEv @ 1 NONAME
-	_ZN19FotaCustCmdsFactory29FotaCustCmdFirmwareUpdateNewLEv @ 2 NONAME
-	_ZN19FotaCustCmdsFactory24FotaCustCmdFirstBootNewLEv @ 3 NONAME
-
--- a/fotaapplication/fotacustcmds/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Build information file for the FotaCustCmds project.
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-fotacustcmds.mmp
--- a/fotaapplication/fotacustcmds/group/fotacustcmds.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Project definition file for the FotaCustCmds project.
-*
-*/
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET          fotacustcmds.dll
-TARGETTYPE      dll
-UID             0x1000008D 0x10205071 
-
-CAPABILITY      CAP_GENERAL_DLL
-VENDORID        VID_DEFAULT
-
-SOURCEPATH      ../src
-SOURCE          fotacustcmdsfactory.cpp
-SOURCE          fotacustcmdallreasons.cpp
-SOURCE          fotacustcmdfirmwareupdate.cpp
-SOURCE          fotacustcmdfirstboot.cpp
-
-USERINCLUDE     ../inc ../../cenrep ../../inc ../../fmsclient/inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY         ecom.lib
-#ifdef __SYNCML_DM_FOTA
-LIBRARY         fotaengine.lib
-LIBRARY		fmsclient.lib
-#endif
-DEBUGLIBRARY    flogger.lib
-LIBRARY         centralrepository.lib
-LIBRARY         schsvr.lib  
-LIBRARY		apgrfx.lib
-LIBRARY		apparc.lib
-
-SMPSAFE
\ No newline at end of file
--- a/fotaapplication/fotacustcmds/inc/fotacustcmdallreasons.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Declaration of CFotaCustCmdAllReasons class.
-*
-*/
-
-#ifndef FOTACUSTCMDALLREASONS_H
-#define FOTACUSTCMDALLREASONS_H
-
-#include <e32base.h>
-#include <ssm/ssmcustomcommand.h>
-
-/**
- *  Each command is implemented in a class derived from MSsmCustomCommand.
- *  It is also possible to implement multiple similar command in the same
- *  class and differentiate between them based on constructor parameters
- *  from the factory method.
- */
-NONSHARABLE_CLASS( CFotaCustCmdAllReasons ) : public CBase, public MSsmCustomCommand
-    {
-
-public:
-
-    /**
-     * Two-phased constructor
-     */
-	static CFotaCustCmdAllReasons* NewL();
-
-    /**
-     * Destructor
-     */
-    virtual ~CFotaCustCmdAllReasons();
-
-private: // From MSsmCustomCommand
-
-    /**
-     * @see MSsmCustomCommand
-     */
-    TInt Initialize( CSsmCustomCommandEnv* aCmdEnv );
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Execute( const TDesC8& aParams, TRequestStatus& aRequest );
-
-    /**
-     * Takes action depending on the fota update state cenrep
-     * @Params None
-     * @return  None
-     *
-     */
-     
-  void ExecuteL( );  
-    
-    /**
-     * @see MSsmCustomCommand
-     */
-	void ExecuteCancel();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Close();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Release();
-	
-    /**
-     * Finds whether fota is schedduled or not 
-     * @Params None
-     * @return 
-     * ETrue if  fota is scheduled else EFalse
-     */
-  TBool FindScheduleL();
-  
-private: // data
-
-    /**
-    * If the command needs command env in Execute function, it should store it
-    * to member variable:
-    *
-    * Custom command environment. Not owned. Set in Initialize.
-    * CSsmCustomCommandEnv* iEnv;
-    */
-	
-	/*
-	* Function description:
-	* This function checks for dmEventNotifier. 
-	* This checks for the specific scenario "when MMC is removed/inserted when phone is 
-	* in switch off mode. Then it starts the DmEventNotifier.
-	*
-	* @params: None
-	* @Return: void
-	*/
-    void checkDMEventNotifierL();
-
-    };
-
-#endif // FOTACUSTCMDALLREASONS_H
--- a/fotaapplication/fotacustcmds/inc/fotacustcmdfirmwareupdate.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Declaration of CFotaCustCmdFirmwareUpdate class.
-*
-*/
-
-#ifndef FOTACUSTCMDFIRMWAREUPDATE_H
-#define FOTACUSTCMDFIRMWAREUPDATE_H
-
-#include <e32base.h>
-#include <ssm/ssmcustomcommand.h>
-
-/**
- *  Each command is implemented in a class derived from MSsmCustomCommand.
- *  It is also possible to implement multiple similar command in the same
- *  class and differentiate between them based on constructor parameters
- *  from the factory method.
- */
-NONSHARABLE_CLASS( CFotaCustCmdFirmwareUpdate ) : public CBase, public MSsmCustomCommand
-    {
-
-public:
-
-    /**
-     * Two-phased constructor
-     */
-	static CFotaCustCmdFirmwareUpdate* NewL();
-
-    /**
-     * Destructor
-     */
-    virtual ~CFotaCustCmdFirmwareUpdate();
-
-private: // From MSsmCustomCommand
-
-    /**
-     * @see MSsmCustomCommand
-     */
-    TInt Initialize( CSsmCustomCommandEnv* aCmdEnv );
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Execute( const TDesC8& aParams, TRequestStatus& aRequest );
-	
-	  /**
-     * invokes fotaengine after fota update
-     * @Params None
-     * @return  None
-     *
-     */
-	void ExecuteL();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void ExecuteCancel();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Close();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Release();
-
-private: // data
-
-    /**
-    * If the command needs command env in Execute function, it should store it
-    * to member variable:
-    *
-    * Custom command environment. Not owned. Set in Initialize.
-    * CSsmCustomCommandEnv* iEnv;
-    */
-
-    };
-
-#endif // FOTACUSTCMDFIRMWAREUPDATE_H
--- a/fotaapplication/fotacustcmds/inc/fotacustcmdfirstboot.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Declaration of CFotaCustCmdFirstBoot class.
-*
-*/
-
-#ifndef FOTACUSTCMDFIRSTBOOT_H
-#define FOTACUSTCMDFIRSTBOOT_H
-
-#include <e32base.h>
-#include <ssm/ssmcustomcommand.h>
-
-/**
- *  Each command is implemented in a class derived from MSsmCustomCommand.
- *  It is also possible to implement multiple similar command in the same
- *  class and differentiate between them based on constructor parameters
- *  from the factory method.
- */
-NONSHARABLE_CLASS( CFotaCustCmdFirstBoot ) : public CBase, public MSsmCustomCommand
-    {
-
-public:
-
-    /**
-     * Two-phased constructor
-     */
-	static CFotaCustCmdFirstBoot* NewL();
-
-    /**
-     * Destructor
-     */
-    virtual ~CFotaCustCmdFirstBoot();
-
-private: // From MSsmCustomCommand
-
-    /**
-     * @see MSsmCustomCommand
-     */
-    TInt Initialize( CSsmCustomCommandEnv* aCmdEnv );
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Execute( const TDesC8& aParams, TRequestStatus& aRequest );
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void ExecuteCancel();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Close();
-
-    /**
-     * @see MSsmCustomCommand
-     */
-	void Release();
-
-private: // data
-
-    /**
-    * If the command needs command env in Execute function, it should store it
-    * to member variable:
-    *
-    * Custom command environment. Not owned. Set in Initialize.
-    * CSsmCustomCommandEnv* iEnv;
-    */
-
-    };
-
-#endif // FOTACUSTCMDFIRSTBOOT_H
--- a/fotaapplication/fotacustcmds/inc/fotacustcmdsfactory.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Declaration of FotaCustCmdsFactory class.
-*
-*/
-
-#ifndef FOTACUSTCMDSFACTORY_H
-#define FOTACUSTCMDSFACTORY_H
-
-#include <e32def.h>
-
-class MSsmCustomCommand;
-
-/**
- *  Creates custom command objects.
- *
- *  Custom commands are loaded by system state manager based on DLL name and
- *  function ordinal.
- *  Each DLL containing custom commands must offer factory methods for each
- *  custom command.
- *  The function ordinals must be exactly the same in emulator and HW builds
- *  or loading the custom command may have unpredictable results.
- *
- *  FotaCustCmdsFactory is a static class containing factory method of one
- *  custom command. It can be easily extended to contain factory methods of
- *  multiple custom commands by adding more member functions.
- *
- *  It is better to implement own factory method for each separate command
- *  than to try to use parameters of Execute function to distinguish between
- *  them.
- *  Note that similar commands can be implemented in the same command class -
- *  just the factory methods need to be different.
- */
-
-class FotaCustCmdsFactory
-    {
-
-public:
-
-    /**
-     * Creates and returns a custom command of type CFotaCustCmdAllReasons.
-     * This method has function ordinal 1 in fotacustcmds.dll.
-     *
-     * @return A custom command object.
-     */
-	IMPORT_C static MSsmCustomCommand* FotaCustCmdAllReasonsNewL();
-
-    /**
-     * Creates and returns a custom command of type CFotaCustCmdFirmwareUpdate.
-     * This method has function ordinal 2 in fotacustcmds.dll.
-     *
-     * @return A custom command object.
-     */
-	IMPORT_C static MSsmCustomCommand* FotaCustCmdFirmwareUpdateNewL();
-
-    /**
-     * Creates and returns a custom command of type CFotaCustCmdFirstBoot.
-     * This method has function ordinal 3 in fotacustcmds.dll.
-     *
-     * @return A custom command object.
-     */
-	IMPORT_C static MSsmCustomCommand* FotaCustCmdFirstBootNewL();
-
-    // To add new custom commands to this DLL, add their factory methods here.
-
-    };
-
-#endif // FOTACUSTCMDSFACTORY
--- a/fotaapplication/fotacustcmds/inc/fotastartupDebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   This file defines logging macros for Fotastartupextension log
-*
-*/
-
-
-
-
-#ifndef FOTASTARTUPDEBUG_H
-#define FOTASTARTUPDEBUG_H
-
-#include <e32debug.h> 
-#include <f32file.h>
-
-//Examples
-//FLOG( _L( "[fotastartupextensionplugin] CFotaStartupExtensionPlugIn::NewL:" ) );
-//FTRACE(RDebug::Print(_L("[fotastartupextensionplugin] fotastartupextensionplugin::NewL: err (%d)"), err));
-#ifdef _DEBUG
-
-const TInt KBTHexDumpWidth=16;
-const TInt KBTLogBufferSize=100;
-const TText KFullStopChar='.';
-
-_LIT(KBTFirstFormatString,"%04x: ");
-_LIT(KBTSecondFormatString,"%02x ");
-_LIT(KBTThirdFormatString,"%c");
-_LIT(KBTThreeSpaces,"   ");
-_LIT(KBTSeparator," ");
-
-inline void HexDump(const TUint8* aPtr, TInt aLen)
-    {
-	if( aPtr != NULL )
-	    {
-    	TBuf<KBTLogBufferSize> line;
-	    TInt i = 0;
-
-    	while (aLen>0)
-    		{
-    		TInt n = (aLen>KBTHexDumpWidth ? KBTHexDumpWidth : aLen);
-    		line.AppendFormat(KBTFirstFormatString,i);
-    		TInt j;
-    		for (j=0; j<n; j++)
-    			line.AppendFormat(KBTSecondFormatString,aPtr[i+j]);
-    		while (j++<KBTHexDumpWidth)
-    			line.Append(KBTThreeSpaces);
-    		line.Append(KBTSeparator);
-    		for (j=0; j<n; j++)
-    			line.AppendFormat(KBTThirdFormatString,(aPtr[i+j]<32 || aPtr[i+j]>126 || aPtr[i+j]==37) ? KFullStopChar : aPtr[i+j]);
-
-    		RDebug::Print(line);
-
-            line.Zero();
-    		aLen-=n;
-    		i+=n;
-    	    }
-        }
-    }
-
-
-// ===========================================================================
-#ifdef __WINS__     // File logging for WINS
-// ===========================================================================
-#include <e32std.h>
-#include <f32file.h>
-#include <flogger.h>
-
-_LIT( KLogFile, "fotacustcmds.log" );
-_LIT( KLogDirFullName, "c:\\logs\\" );
-_LIT( KLogDir, "fota" );
-
-#define FLOG( a )   { FPrint(a); }
-#define FTRACE( a ) { a; }
-
-// Declare the FPrint function
-//
-inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
-    {
-    VA_LIST list;
-    VA_START( list, aFmt );
-    RFileLogger::WriteFormat( KLogDir,
-                              KLogFile,
-                              EFileLoggingModeAppend,
-                              aFmt,
-                              list );
-    }
-
-// ===========================================================================
-#else               // RDebug logging for target HW
-// ===========================================================================
-/*#include <e32svr.h>
-
-#define FLOG( a )   { RDebug::Print( a ); }
-#define FTRACE( a ) { a; }
-
-*/
-
-///////////////////////////////
-#include <e32std.h>
-#include <f32file.h>
-#include <flogger.h>
-
-_LIT( KLogFile, "fotacustcmds.log" );
-_LIT( KLogDirFullName, "c:\\logs\\" );
-_LIT( KLogDir, "fota" );
-
-#define FLOG( a )   { FPrint(a); }
-#define FTRACE( a ) { a; }
-
-// Declare the FPrint function
-//
-inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
-    {
-    VA_LIST list;
-    VA_START( list, aFmt );
-    RFileLogger::WriteFormat( KLogDir,
-                              KLogFile,
-                              EFileLoggingModeAppend,
-                              aFmt,
-                              list );
-    }
-
-////////////////////////////////
-
-
-#endif //__WINS__
-
-// ===========================================================================
-#else // // No loggings --> Reduced binary size
-// ===========================================================================
-#define FLOG( a )
-#define FTRACE( a )
-
-#endif // _DEBUG
-
-/////////  ///////////////////////
-inline void LOGX(TInt aSource)
-	{
-		HBufC *iMyBufNumber = HBufC::NewLC(255);
-   		TPtr bufNumberPtr(iMyBufNumber->Des());
-   		bufNumberPtr.FillZ();
-   		bufNumberPtr.AppendFormat(_L("%d"),aSource);
-    	FLOG(iMyBufNumber->Des());
-    	CleanupStack::PopAndDestroy();
-	}
-/////////  ///////////////////////
-	
-#endif      // FOTASTARTUP_H
-            
-// End of File
--- a/fotaapplication/fotacustcmds/src/fotacustcmdallreasons.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Implementation of CFotaCustCmdAllReasons class.
-*
-*/
-
-#include "fotacustcmdallreasons.h"
-#include "fotastartupDebug.h"
-#ifdef __SYNCML_DM_FOTA
-#include <fotaengine.h>
-#include "fmsclient.h"
-#include "fotaserverPrivateCRKeys.h"
-#include "FotaIPCTypes.h"
-#include "fmsclientserver.h"
-#endif
-#include <schtime.h>      
-#include <csch_cli.h>    
-#include <centralrepository.h>
-// RProperty
-#include <e32base.h>
-#include <e32property.h>
-// Memory status PS key headers
-#include <UikonInternalPSKeys.h>
-// Loading application headers
-#include <apgcli.h>
-#include <apacmdln.h>
-//Middleware includes
-#include <dmeventnotifiercrkeys.h>
-#include <dmeventnotifiercommon.h>
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::NewL
-// ---------------------------------------------------------------------------
-//
-CFotaCustCmdAllReasons* CFotaCustCmdAllReasons::NewL()
-	{
-  FLOG( _L( "[CFotaCustCmdAllReasons::NewL() BEGIN " ) );
-	return new ( ELeave ) CFotaCustCmdAllReasons;
-	}
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::~CFotaCustCmdAllReasons
-// ---------------------------------------------------------------------------
-//
-CFotaCustCmdAllReasons::~CFotaCustCmdAllReasons()
-    {
-      FLOG( _L( "[CFotaCustCmdAllReasons::~CFotaCustCmdAllReasons()  " ) );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::Initialize
-// ---------------------------------------------------------------------------
-//
-TInt CFotaCustCmdAllReasons::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
-    {
-    FLOG( _L( "[CFotaCustCmdAllReasons::~Initialize()  " ) );
-
-    
-    return KErrNone;
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::Execute
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdAllReasons::Execute(
-    const TDesC8& /*aParams*/,
-    TRequestStatus& aRequest )
-    {
-     FLOG( _L( "[CFotaCustCmdAllReasons::~Execute() BEGIN " ) );
-      aRequest = KRequestPending;
- #ifdef __SYNCML_DM_FOTA
-    TRAP_IGNORE(ExecuteL());    
- #endif
-    TRequestStatus* request = &aRequest;
-    User::RequestComplete( request, KErrNone );
- FLOG( _L( "[CFotaCustCmdAllReasons::~Execute() END " ) ); 
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::ExecuteL
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdAllReasons::ExecuteL( )
-    {
-    FLOG( _L( "[CFotaCustCmdAllReasons]::ExecuteL() Boot reason AllReason BEGIN " ) );
-
-    RFotaEngineSession fotaEngine;
-    //CheckCenrep if GA feature in ON then start else nothing.
-    CRepository* centrep(NULL);
-    TInt err = KErrNone;
-    TRAP( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    TInt sendGAAfterrebootfeature = 0;
-    TInt val(EFotaDefault);
-
-    if (err == KErrNone)
-        {
-        err = centrep->Get(KFotaUpdateState, val);
-
-        if (err == KErrNone)
-            {
-            // check if there is GA pending
-
-            FTRACE(RDebug::Print(_L("[CFotaCustCmdAllReasons]  startup reason is %d"), val));
-            switch (val)
-                {
-                case EFotaDownloadInterrupted:
-                    {
-                    FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Start FMS server " ) );
-                    RFMSClient fmsClient;
-                    TRAPD(err, fmsClient.OpenL());
-                    if (err == KErrNone)
-                        {
-                        fmsClient.Close();
-                        FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Closing FMS server  " ) );
-                        }
-                    }
-                    break;
-                case EFotaPendingGenAlert:
-                    {
-                    FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Start fota server " ) );
-                    err = centrep->Get(KGenericAlertResendAfterBoot,
-                            sendGAAfterrebootfeature);
-                    FTRACE(RDebug::Print(_L("[CFotaCustCmdAllReasons] feature sendGenericAlert is %d"), sendGAAfterrebootfeature));
-
-                    if (sendGAAfterrebootfeature == 1)
-                        {
-                        TRAPD(oError,fotaEngine.OpenL());
-                        if (oError == KErrNone)
-                            {
-                            fotaEngine.Close();
-                            FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Closing fota server  " ) );
-                            }
-                        }
-                    }
-                    break;
-                case EFotaUpdateInterrupted:
-                    {
-                    FLOG(_L(" update interrupted >>"));
-                    RFMSClient fmsclient;
-                    TRAPD(err,fmsclient.OpenL());
-                    if (err)
-                        {
-                        FLOG(_L( " opening fms failed " ) );
-
-                        }
-                    else
-                        {
-
-                        FLOG(_L("CFotaUpdate::going into FMS client side MonitorBatteryL() >>"));
-                        TRAPD(err1, fmsclient.NotifyForUpdateL(EUpdMonitorbattery, 3))// equal to EBatteryLevelLevel3
-                        if (err1)
-                            {
-                            FLOG(_L( " MonitorBatteryL failed " ));
-                            }
-                        fmsclient.Close();
-                        FLOG(_L(" update interrupted <<"));
-                        }
-                    }
-                    break;
-                default:
-                    {
-                    FLOG( _L( "[CFotaCustCmdAllReasons] pendingGAToSend is not SET " ) );
-                    }
-                    break;
-                }
-
-            }
-        }
-    delete centrep;
-        { // Write the code for starting the dmEventNotifier
-        TRAPD(err, checkDMEventNotifierL());
-        if (err)
-            {
-            FLOG(_L("start DmEventNotifier.exe successfull"));
-            }
-        else
-            {
-            FLOG(_L("start DmEventNotifier.exe un-successfull"));
-            }
-        }
-    FLOG( _L( "[CFotaCustCmdAllReasons]::ExecuteL() Boot reason AllReason END " ) );
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::ExecuteCancel
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdAllReasons::ExecuteCancel()
-    {
-   
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::Close
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdAllReasons::Close()
-    {
-     FLOG( _L( "[CFotaCustCmdAllReasons]::Close() " ) );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdAllReasons::Release
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdAllReasons::Release()
-    {
-    
-     FLOG( _L( "[CFotaCustCmdAllReasons]::Close() " ) );
-	   delete this;
-    }
-    
-    
-TBool  CFotaCustCmdAllReasons::FindScheduleL()
-{
-	FLOG( _L( "[CFotaCustCmdAllReasons]::FindScheduleL()BEGIN " ) );
-	TScheduleEntryInfo2                     ret;    
-	RScheduler                              sc;
-	TTime                                   t; 
-	TTsTime                                 time;
-	TSchedulerItemRef                       scitem; 
-	CArrayFixFlat<TSchedulerItemRef>*     	aSchRefArray = new CArrayFixFlat <TSchedulerItemRef>(5);
-	TScheduleFilter                      	aFilter(EAllSchedules);
-	User::LeaveIfError( sc.Connect() );                             // xx
-	CleanupClosePushL( sc );
-	CleanupStack::PushL(aSchRefArray);
-
-	User::LeaveIfError( sc.GetScheduleRefsL( *aSchRefArray,aFilter) );  // xx
-	FLOG(_L("Schedule items: "));
-	for ( TInt i=0; i<aSchRefArray->Count(); ++i  )
-		{
-		  TSchedulerItemRef it = (*aSchRefArray)[i];
-		 if ( it.iName == TUid::Uid(KFotaServerUid).Name()  )
-	   {
-	   	  	 
-	   	  	 	CleanupStack::PopAndDestroy(aSchRefArray);  
-                CleanupStack::PopAndDestroy(&sc);
-	   	  	 	return ETrue;
-	  	
-	   }
-     }
-                 CleanupStack::PopAndDestroy(aSchRefArray);
-                 CleanupStack::PopAndDestroy(&sc);
-     FLOG( _L( "[CFotaCustCmdAllReasons]::FindScheduleL()END " ) );            
-                 return EFalse; 
-}
-
-
-void CFotaCustCmdAllReasons::checkDMEventNotifierL()
-{
-    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - started"));
- 
-    const TUid KAppDmEventNotifierUid = TUid::Uid(KAppUidDmEventNotifier); //UID3 from .mmp file
-    CRepository* cenrep (NULL);
-    cenrep = CRepository::NewLC( KAppDmEventNotifierUid );
-    TInt value (KErrNone);
-    TBool tocontinue (EFalse);
-
-    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for cenrep KDmEventNotifierEnabled"));
-    if ( ((cenrep->Get(KDmEventNotifierEnabled,value)) == KErrNone )
-            && (EHandlerRegistered == value || EHandlerNeedRegister == value )) // v alue != EHandlerNotRegistered 
-    {
-//        FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - cenrep KDmEventNotifierEnabled exist, value = (%d) "), value);
-				FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - cenrep KDmEventNotifierEnabled exist"));
-        tocontinue = ETrue;
-    }
-    else
-    {
-        //Log errors
-//        FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for cenrep KDmEventNotifierEnabled does not exist: error: (%d) "), err);
-				FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - cenrep KDmEventNotifierEnabled does not exist or already registered"));
-        //delete cenrep; cenrep = NULL;
-        CleanupStack::PopAndDestroy(); // cenrep
-        return;
-    }
-    
-    TInt pMmcstatus = KErrNotFound;
-    TInt ret = RProperty::Get(KPSUidUikon, KUikMMCInserted, pMmcstatus);
-//    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for present Memory status: ret = (%d) , MMCStatus = (%d) "), ret, pMmcStatus);
-		FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for memory status"));
-    if(!ret)
-    {
-
-        TInt sMMCStatus (KErrNotFound);
-        TInt error = cenrep->Get(KMMCStatus, sMMCStatus);
-				CleanupStack::PopAndDestroy(); // cenrep
-
-        //FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for previous Memory status, before phone off: error = (%d) , sMMCStatus = (%d) "), error, sMMCStatus);
-        if(error)
-        {
-        		FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - Error in memory status get"));
-            //CleanupStack::PopAndDestroy(); // cenrep
-            return;    
-        }
-        if (pMmcstatus == sMMCStatus && tocontinue) // if sMMCStatus is 0 && pMMCStatus is 0. Or sMMCStatus is 1 && pMMCStatus is 1
-        {
-        //start the dm event notifier
-                
-            RApaLsSession apaLsSession;
-            User :: LeaveIfError(apaLsSession.Connect());
-            TApaAppInfo appInfo;
-            FLOG(_L("RApaLsSession connection successful"));
-            FLOG(_L("Running dmeventnotifier.exe"));
-                    
-            _LIT(KExampleTaskHandlerExe, "dmeventnotifier.exe");
-        
-            appInfo.iFullName = KExampleTaskHandlerExe;
-            CApaCommandLine* cmdLine  = CApaCommandLine::NewLC();
-            cmdLine->SetExecutableNameL( appInfo.iFullName );
-            TBuf<KMaxFileName> temp;
-            temp.Copy (appInfo.iFullName);
-            TInt err = apaLsSession.StartApp(*cmdLine);
-            
-            User :: LeaveIfError(err);
-            CleanupStack :: PopAndDestroy(cmdLine);
-            apaLsSession.Close();
-            FLOG(_L("started dmeventnotifier.exe successfully"));
-        }
-    }
-    //CleanupStack::PopAndDestroy(); // cenrep
-    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - ended"));
-}
--- a/fotaapplication/fotacustcmds/src/fotacustcmdfirmwareupdate.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Implementation of CFotaCustCmdFirmwareUpdate class.
-*
-*/
-
-#include "fotacustcmdfirmwareupdate.h"
-#ifdef __SYNCML_DM_FOTA
-#include <fotaengine.h>
-#include "fmsclient.h"
-#include "fotaserverPrivateCRKeys.h"
-#include "FotaIPCTypes.h"
-#include "fmsclientserver.h"
-#endif
-#include "fotastartupDebug.h"
-#include <centralrepository.h>
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::NewL
-// ---------------------------------------------------------------------------
-//
-CFotaCustCmdFirmwareUpdate* CFotaCustCmdFirmwareUpdate::NewL()
-	{
-    FLOG( _L( "CFotaCustCmdFirmwareUpdate::NewL()  " ) );
-	return new ( ELeave ) CFotaCustCmdFirmwareUpdate;
-	}
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::~CFotaCustCmdFirmwareUpdate
-// ---------------------------------------------------------------------------
-//
-CFotaCustCmdFirmwareUpdate::~CFotaCustCmdFirmwareUpdate()
-    {
-     FLOG( _L( "CFotaCustCmdFirmwareUpdate::~CFotaCustCmdFirmwareUpdate()  " ) );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::Initialize
-// ---------------------------------------------------------------------------
-//
-TInt CFotaCustCmdFirmwareUpdate::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
-    {
-    
-     FLOG( _L( "CFotaCustCmdFirmwareUpdate::Initialize()  " ) );
-    
-    return KErrNone;
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::Execute
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirmwareUpdate::Execute(
-    const TDesC8& /*aParams*/,
-    TRequestStatus& aRequest )
-    {
-     aRequest = KRequestPending;
-       FLOG( _L( "CFotaCustCmdFirmwareUpdate::Execute() BEGIN " ) );
-     #ifdef __SYNCML_DM_FOTA
-     TRAP_IGNORE(ExecuteL());
-     #endif
-     TRequestStatus* request = &aRequest;
-     User::RequestComplete( request, KErrNone );
-     FLOG( _L( "CFotaCustCmdFirmwareUpdate::Execute() END " ) );
-     
-
-    }
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::ExecuteL
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirmwareUpdate::ExecuteL( )
-    
-   {
-   	FLOG( _L( "CFotaCustCmdFirmwareUpdate::ExecuteL( ) Boot reason KFirmwareUpdateReason BEGIN " ) );
-
-    CRepository*    centrep( NULL);
-    RFotaEngineSession fotaEngine;
-    TInt err= KErrNone;
-    TRAP( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    TInt sendGAAfterrebootfeature = 0;
-    	if( err == KErrNone && centrep )
-    	{
-    	  err = centrep->Get(  KGenericAlertResendAfterBoot, sendGAAfterrebootfeature );
-    	}
-    	 FTRACE(RDebug::Print(_L("[CFotaCustCmdFirmwareUpdate] feature sendGenericAlert is %d"), sendGAAfterrebootfeature));        
-        if( sendGAAfterrebootfeature != 1 )
-        {
-   	        FLOG( _L( "[CFotaCustCmdFirmwareUpdate] FirmwareUpdateReason: Starting fota server  " ) );
-            TRAPD(oError,fotaEngine.OpenL());
-            if(oError == KErrNone)
-            {
-            fotaEngine.Close();
-            FLOG( _L( "[CFotaCustCmdFirmwareUpdate] FirmwareUpdateReason: Closing fota server  " ) );
-            }
-       
-        }
-        
-        if(centrep)
-        {
-        	delete centrep;
-        }
-    
-  	FLOG( _L( "CFotaCustCmdFirmwareUpdate::ExecuteL( ) Boot reason KFirmwareUpdateReason END " ) );
-
-   }
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::ExecuteCancel
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirmwareUpdate::ExecuteCancel()
-    {
-  
-      FLOG( _L( "CFotaCustCmdFirmwareUpdate::ExecuteCancel() " ) );
-    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::Close
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirmwareUpdate::Close()
-    {
-    
-       FLOG( _L( "CFotaCustCmdFirmwareUpdate::Close() " ) );
-    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirmwareUpdate::Release
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirmwareUpdate::Release()
-    {
-    FLOG( _L( "CFotaCustCmdFirmwareUpdate::Release() " ) );
-
-	delete this;
-    }
--- a/fotaapplication/fotacustcmds/src/fotacustcmdfirstboot.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Implementation of CFotaCustCmdFirstBoot class.
-*
-*/
-
-#include "fotacustcmdfirstboot.h"
-#include "fotastartupDebug.h"
-//#include "trace.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::NewL
-// ---------------------------------------------------------------------------
-//
-CFotaCustCmdFirstBoot* CFotaCustCmdFirstBoot::NewL()
-	{
-   FLOG( _L( "[CFotaCustCmdFirstBoot::NewL()  " ) );
-	return new ( ELeave ) CFotaCustCmdFirstBoot;
-	}
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::~CFotaCustCmdFirstBoot
-// ---------------------------------------------------------------------------
-//
-CFotaCustCmdFirstBoot::~CFotaCustCmdFirstBoot()
-    {
-      FLOG( _L( "[CFotaCustCmdFirstBoot::~CFotaCustCmdFirstBoot()  " ) );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::Initialize
-// ---------------------------------------------------------------------------
-//
-TInt CFotaCustCmdFirstBoot::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
-    {
-  
-  FLOG( _L( "[CFotaCustCmdFirstBoot::Initialize()  " ) );
-
-    return KErrNone;
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::Execute
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirstBoot::Execute(
-    const TDesC8& /*aParams*/,
-    TRequestStatus& aRequest )
-    {
-    	     aRequest = KRequestPending;
-   FLOG( _L( "[CFotaCustCmdFirstBoot::Execute()  " ) );
-    #ifdef __PLUG_AND_PLAY_MOBILE_SERVICES 
-      FLOG( _L( "NOTHING TO DO   " ) );
-    #endif
-      TRequestStatus* request = &aRequest;
-      User::RequestComplete( request, KErrNone );
-
-    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::ExecuteCancel
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirstBoot::ExecuteCancel()
-    {
-      FLOG( _L( "[CFotaCustCmdFirstBoot::ExecuteCancel()  " ) );
-
-    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::Close
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirstBoot::Close()
-    {
-     FLOG( _L( "[CFotaCustCmdFirstBoot::Close()  " ) );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaCustCmdFirstBoot::Release
-// ---------------------------------------------------------------------------
-//
-void CFotaCustCmdFirstBoot::Release()
-    {
-     FLOG( _L( "[CFotaCustCmdFirstBoot::Release()  " ) );
-
-	delete this;
-    }
--- a/fotaapplication/fotacustcmds/src/fotacustcmdsfactory.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* Implementation of FotaCustCmdsFactory class.
-*
-*/
-
-#include "fotacustcmdsfactory.h"
-#include "fotacustcmdallreasons.h"
-#include "fotacustcmdfirmwareupdate.h"
-#include "fotacustcmdfirstboot.h"
-#include "fotastartupDebug.h"
-//#include "trace.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL
-// ---------------------------------------------------------------------------
-//
-EXPORT_C MSsmCustomCommand* FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL()
-    {
-   FLOG( _L( "[FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL() " ) );
-
-    return CFotaCustCmdAllReasons::NewL();
-    }
-
-
-// ---------------------------------------------------------------------------
-// FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL
-// ---------------------------------------------------------------------------
-//
-EXPORT_C MSsmCustomCommand* FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL()
-    {
-    FLOG( _L( "[FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL() " ) );
-    return CFotaCustCmdFirmwareUpdate::NewL();
-    }
-
-
-// ---------------------------------------------------------------------------
-// FotaCustCmdsFactory::FotaCustCmdFirstBootNewL
-// ---------------------------------------------------------------------------
-//
-EXPORT_C MSsmCustomCommand* FotaCustCmdsFactory::FotaCustCmdFirstBootNewL()
-    {
-   
-    FLOG( _L( "[FotaCustCmdsFactory::FotaCustCmdFirstBootNewL() " ) );
-    return CFotaCustCmdFirstBoot::NewL();
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaEngine/BWINS/fotaengineu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,22 @@
+EXPORTS
+	??0RFotaEngineSession@@QAE@XZ @ 1 NONAME ; RFotaEngineSession::RFotaEngineSession(void)
+	?Close@RFotaEngineSession@@QAEXXZ @ 2 NONAME ; void RFotaEngineSession::Close(void)
+	?CurrentVersion@RFotaEngineSession@@QAEHAAVTDes16@@@Z @ 3 NONAME ; int RFotaEngineSession::CurrentVersion(class TDes16 &)
+	?DeleteUpdatePackage@RFotaEngineSession@@QAEHH@Z @ 4 NONAME ; int RFotaEngineSession::DeleteUpdatePackage(int)
+	?Download@RFotaEngineSession@@QAEHHABVTDesC8@@H00@Z @ 5 NONAME ; int RFotaEngineSession::Download(int, class TDesC8 const &, int, class TDesC8 const &, class TDesC8 const &)
+	?DownloadAndUpdate@RFotaEngineSession@@QAEHHABVTDesC8@@H00@Z @ 6 NONAME ; int RFotaEngineSession::DownloadAndUpdate(int, class TDesC8 const &, int, class TDesC8 const &, class TDesC8 const &)
+	?ExtensionInterface@RFotaEngineSession@@EAEXVTUid@@AAPAX@Z @ 7 NONAME ; void RFotaEngineSession::ExtensionInterface(class TUid, void * &)
+	?GenericAlertSentL@RFotaEngineSession@@QAEXH@Z @ 8 NONAME ; void RFotaEngineSession::GenericAlertSentL(int)
+	?GetResult@RFotaEngineSession@@QAEHH@Z @ 9 NONAME ; int RFotaEngineSession::GetResult(int)
+	?GetState@RFotaEngineSession@@QAE?AW4TState@1@H@Z @ 10 NONAME ; enum RFotaEngineSession::TState RFotaEngineSession::GetState(int)
+	?GetUpdatePackageIds@RFotaEngineSession@@QAEHAAVTDes16@@@Z @ 11 NONAME ; int RFotaEngineSession::GetUpdatePackageIds(class TDes16 &)
+	?IsPackageStoreSizeAvailable@RFotaEngineSession@@QAEHH@Z @ 12 NONAME ; int RFotaEngineSession::IsPackageStoreSizeAvailable(int)
+	?LastUpdate@RFotaEngineSession@@QAEHAAVTTime@@@Z @ 13 NONAME ; int RFotaEngineSession::LastUpdate(class TTime &)
+	?OpenL@RFotaEngineSession@@QAEXXZ @ 14 NONAME ; void RFotaEngineSession::OpenL(void)
+	?OpenUpdatePackageStore@RFotaEngineSession@@QAEHHAAPAVRWriteStream@@@Z @ 15 NONAME ; int RFotaEngineSession::OpenUpdatePackageStore(int, class RWriteStream * &)
+	?ScheduledUpdateL@RFotaEngineSession@@QAEHVTFotaScheduledUpdate@@@Z @ 16 NONAME ; int RFotaEngineSession::ScheduledUpdateL(class TFotaScheduledUpdate)
+	?Update@RFotaEngineSession@@QAEHHHABVTDesC8@@0@Z @ 17 NONAME ; int RFotaEngineSession::Update(int, int, class TDesC8 const &, class TDesC8 const &)
+	?UpdatePackageDownloadComplete@RFotaEngineSession@@QAEXH@Z @ 18 NONAME ; void RFotaEngineSession::UpdatePackageDownloadComplete(int)
+	?GetDownloadUpdatePackageSize@RFotaEngineSession@@QAEHHAAH0@Z @ 19 NONAME ; int RFotaEngineSession::GetDownloadUpdatePackageSize(int, int &, int &)
+	?TryResumeDownload@RFotaEngineSession@@QAEHXZ @ 20 NONAME ; int RFotaEngineSession::TryResumeDownload(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaEngine/INC/fotaenginedebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   This file defines logging macros 
+*
+*/
+
+
+
+#ifndef FOTADEBUG_H
+#define FOTADEBUG_H
+
+    // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
+    #ifdef _FOTA_DEBUG
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "fotaengine.log" );
+        _LIT( KLogDirFullName, "c:\\logs\\" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+#endif      // FOTADEBUG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaEngine/SRC/fotaengine.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,559 @@
+/*
+* 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:   Client for fotaserver
+*
+*/
+
+
+
+
+// INCLUDES
+#include <bldvariant.hrh>
+#include "fotaengine.h"
+#include "FotaIPCTypes.h"
+#include "fotaConst.h"
+#include "fotaenginedebug.h"
+#include <apgcli.h>
+#include <AknServerApp.h>
+
+// CONSTANTS
+_LIT(KServerNameFormat, "%08x_%08x_AppServer");        
+
+// =================== LOCAL FUNCTIONS ========================================
+
+// ---------------------------------------------------------------------------
+// IsClientFota()   Checks if client is another fotaserver
+// ---------------------------------------------------------------------------
+TBool IsClientFota()
+    {
+    RThread thread;
+    TUid    fota,dlmgr;
+    fota.iUid           = KFotaServerUid;
+    dlmgr.iUid			= KDLMgrServerUid;
+    if (thread.SecureId() == fota.iUid || thread.SecureId() == dlmgr.iUid )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::StartServerL() 
+// Start application server
+// ---------------------------------------------------------------------------
+//
+void RFotaEngineSession::StartApplicationL( const TUid& aNameUid
+                                            , const TUid& aAppServerUid )
+    {
+    TInt err;
+    FLOG(_L("RFotaEngineSession::StartApplicationL >>"));
+    RApaLsSession apa;
+    err = apa.Connect();
+    User::LeaveIfError(err);
+    CleanupClosePushL(apa);
+
+    // Get application information
+    TApaAppInfo info;
+    err=0;
+    for(TInt i = 20; ((err = apa.GetAppInfo(info, 
+	    aAppServerUid)) == RApaLsSession::EAppListInvalid) && i > 0; i--)
+        {
+        User::After(500000);
+        }
+    User::LeaveIfError(err);
+
+    // Start aplication server
+    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+    cmdLine->SetExecutableNameL(info.iFullName);
+    cmdLine->SetServerRequiredL( aNameUid.iUid );
+    cmdLine->SetCommandL(EApaCommandBackground);
+    TThreadId   srvid;
+    err = apa.StartApp(*cmdLine, srvid);
+    User::LeaveIfError(err);
+
+    // Wait until server is running.
+
+    // Rendezvous() is not reliable for synchronising with the new server
+    // in this case as we may not be able
+    // to open the server thread before it has reached its rendezvous
+    // point, in which case we hang.
+    // So, the standby algorithm is to poll for server existence (yuk)
+	const TInt maxPoll = 100;
+	const TInt waitDelay = 100000;	// 0.1 seconds
+    TFullName serverName;
+    serverName.Format(KServerNameFormat, aNameUid, aAppServerUid);
+	for (TInt ii = 0; ii < maxPoll; ii++)
+		{
+		// look for the server name
+		TFindServer find(serverName);
+		TFullName fullName;
+        err = find.Next(fullName);
+		if ( err == KErrNone)
+			{
+			break;		// found the server, so return
+			}
+		User::After(waitDelay);			// wait before trying again
+		}
+	User::LeaveIfError(err);	// failed to find the server, bomb out
+
+    CleanupStack::PopAndDestroy(2, &apa);	// cmdLine and apa
+    FLOG(_L("RFotaEngineSession::StartApplicationL <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::StartServerL() 
+// Connect to existing server
+// ---------------------------------------------------------------------------
+//
+void RFotaEngineSession::ConnectToServerL( const TUid& aNameUid
+                                            , const TUid& aAppServerUid )
+    {
+    RWsSession  ws;
+    TInt        err;
+
+    FLOG(_L("RFotaEngineSession::ConnectToServerL >>"));
+    if (aAppServerUid == KNullUid)
+        {
+        User::Leave(KErrGeneral);
+        }
+
+	// Connect to server
+    TFullName serverName;
+	serverName.Format(KServerNameFormat, 
+	aNameUid, aAppServerUid);
+    TRAP(err, ConnectExistingByNameL(serverName) );
+    if(err)
+        {
+        TVersion vers(0,0,1);
+        err = CreateSession (serverName, vers);
+        User::LeaveIfError(err);
+        }
+    FLOG(_L("       3"));
+
+    FLOG(_L("RFotaEngineSession::ConnectToServerL <<"));
+    }
+    
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::OpenL( )
+// Opens session to fotaserver. 
+// ---------------------------------------------------------------------------
+EXPORT_C void RFotaEngineSession::OpenL( )
+{
+    RProcess pr; TFullName fn = pr.FullName(); 
+    TInt err(0);
+    TUid diff1 = TUid::Uid(KUikonUidPluginInterfaceNotifiers);
+    FLOG(_L("[RFotaEngineSession] OpenL\tcalled by '%S' >>"),&fn );
+
+    // -------------------------------------------- V
+    err = KErrNotFound;
+    // If client is fotaserver - MUST create new server
+    if( !IsClientFota() ) 
+        {
+        TRAP(err, ConnectToServerL( diff1 , TUid::Uid(KFotaServerUid)) );
+        }
+    else
+        {
+        diff1 = TUid::Uid(KUikonUidPluginInterfaceNotifiers+1);
+        }
+
+    if(err!=KErrNone)
+        {
+        StartApplicationL( diff1 , TUid::Uid(KFotaServerUid));
+        ConnectToServerL( diff1 , TUid::Uid(KFotaServerUid));
+        }
+    FLOG(_L("[RFotaEngineSession]\tconnected <<") );
+}
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::Close( )
+// Closes session to fotaserver
+// ---------------------------------------------------------------------------
+EXPORT_C void RFotaEngineSession::Close( )
+{
+    RProcess pr; TFullName fn = pr.FullName(); 
+    FLOG(_L("[RFotaEngineSession] RFotaEngineSession::Close() >> called by '%S'"),&fn );
+        
+    if ( iStream )
+        {
+        iStream->Close(); // this uses iChunk
+        delete iStream;  iStream=0;
+        }
+    iChunk.Close();
+
+    // Tell server that generic alert is sent for this pkg, so state is 
+    // cleaned up     
+    if ( iGenericAlertSentPkgID != -1 )
+        {
+        TInt err = SendReceive( EGenericAlertSentForPackage
+                                    , TIpcArgs(iGenericAlertSentPkgID) );
+        }
+
+    REikAppServiceBase::Close();
+    FLOG(_L("[RFotaEngineSession] RFotaEngineSession::Close() <<") );
+}
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::Download
+// Starts download of upd package.
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::Download(const TInt aPkgId
+    , const TDesC8& aPkgURL, const TSmlProfileId aProfileId
+    , const TDesC8& aPkgName, const TDesC8& aPkgVersion)
+{
+    TInt err;
+    TDownloadIPCParams          ipcparam;
+    ipcparam.iPkgId             = aPkgId;
+    ipcparam.iProfileId         = aProfileId;
+    ipcparam.iPkgName.Copy      (aPkgName);
+    ipcparam.iPkgVersion.Copy   (aPkgVersion);
+    TPckg<TDownloadIPCParams>   pkg(ipcparam);
+    err = SendReceive ( EFotaDownload ,  TIpcArgs(&pkg, &aPkgURL));
+    return err;
+}
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::DownloadAndUpdate
+// Starts download and update of update pakcage
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::DownloadAndUpdate(const TInt aPkgId
+        ,const TDesC8& aPkgURL, const TSmlProfileId aProfileId
+        ,const TDesC8& aPkgName, const TDesC8& aPkgVersion)
+{
+    TInt err;
+    TDownloadIPCParams          ipcparam;
+    ipcparam.iPkgId             = aPkgId;
+    ipcparam.iProfileId         = aProfileId;
+    ipcparam.iPkgName.Copy      (aPkgName);
+    ipcparam.iPkgVersion.Copy   (aPkgVersion);
+    TPckg<TDownloadIPCParams>   pkg(ipcparam);
+    err = SendReceive( EFotaDownloadAndUpdate,  TIpcArgs(&pkg, &aPkgURL));
+    return err;
+}
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::Update
+// Starts update of update package
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::Update(const TInt aPkgId
+        ,const TSmlProfileId aProfileId, const TDesC8& aPkgName
+        ,const TDesC8& aPkgVersion)
+{
+    TInt err;
+    TDownloadIPCParams          ipcparam;
+    ipcparam.iPkgId             = aPkgId;
+    ipcparam.iProfileId         = aProfileId;
+    ipcparam.iPkgName.Copy      (aPkgName);
+    ipcparam.iPkgVersion.Copy   (aPkgVersion);
+    TPckg<TDownloadIPCParams>   pkg(ipcparam);
+    err = SendReceive ( EFotaUpdate ,  TIpcArgs(&pkg));
+    return err;
+}
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::IsPackageStoreSizeAvailable
+// Checks if there's space enough for update package
+// ---------------------------------------------------------------------------
+EXPORT_C TBool RFotaEngineSession::IsPackageStoreSizeAvailable(
+                                                    const TInt aSize)
+    {
+//    // -------------------------------------------- v 
+//    if( IsClientFota() ) 
+//        {
+//        FLOG(_L("     IsPackageStoreSizeAvailable  NOT CONNECTING"));
+//        return ETrue;
+//        }
+//    // -------------------------------------------- ^ 
+    TInt            err;
+    TBool           available;
+    TPckg<TBool>    pavailable(available);
+    err = SendReceive ( EIsPackageStoreSizeAvailable, TIpcArgs(aSize
+                                                        , &pavailable ) );
+    if ( err ) 
+        {   
+        FLOG(_L("RFotaEngineSession::IsPackageStoreSizeAvailable error %d")
+                    ,err);
+        }
+    return available;
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::OpenUpdatePackageStore
+// OPens update package storage for writing.
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::OpenUpdatePackageStore(const TInt aPkgId
+                                                 ,RWriteStream*& aPkgStore)
+	{
+    FLOG(_L( "RFotaEngineSession::OpenUpdatePackageStore >> pkgid %d " )
+                    ,aPkgId );
+    TInt err;
+    err = iChunk.CreateGlobal( KNullDesC, KFotaChunkMinSize, KFotaChunkMaxSize );
+    if(err) return err;
+    iStream = new RFotaWriteStream();
+    iStream->iFotaEngineSession = this;    
+    TRAP( err, iStream->OpenL(aPkgId) );
+    aPkgStore = iStream;
+    if(err) return err;
+
+    TIpcArgs args;
+    args.Set(0,aPkgId);
+    args.Set(1,iChunk );
+	err = SendReceive( EFotaOpenUpdatePackageStore, args );
+    FLOG(_L( "RFotaEngineSession::OpenUpdatePackageStore << err  %d" ),err );
+    return err;
+    }
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::GetDownloadUpdatePackageSize
+// Gets the downloaded and full size of the update package. 
+// Implementation is not ready and will be provided later.
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::GetDownloadUpdatePackageSize(const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize)
+	{
+	FLOG(_L("RFotaEngineSession::GetDownloadUpdatePackageSize, aPkgId=%d >>"),aPkgId);
+	TInt err (KErrNone);
+    TPckg<TInt> pkg1(aDownloadedSize);
+    TPckg<TInt>	pkg2(aTotalSize);
+	err = SendReceive( EFotaGetDownloadUpdatePackageSize,TIpcArgs(aPkgId,&pkg1, &pkg2)  );
+	FLOG(_L("RFotaEngineSession::GetDownloadUpdatePackageSize << err = %d, aDownloadedSize = %d, aTotalSize = %d" ), err, aDownloadedSize, aTotalSize);
+	return err;
+	}
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::TryResumeDownload
+// Requests to resume the suspended download of the update package. 
+// Implementation is not ready and will be provided later.
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::TryResumeDownload()
+	{
+	FLOG(_L("RFotaEngineSession::TryResumeDownload >>"));
+
+	TInt err = KErrNone;
+	
+	err = SendReceive( EFotaTryResumeDownload );
+	
+	FLOG(_L("RFotaEngineSession::TryResumeDownload << err = %d" ),err);
+	return err;
+	}
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::UpdatePackageDownloadComplete
+// Ends update pkg storing. Closes resources.
+// ---------------------------------------------------------------------------
+EXPORT_C void RFotaEngineSession::UpdatePackageDownloadComplete(
+                                                          const TInt aPkgId)
+    {
+    FLOG(_L("RFotaEngineSession::UpdatePackageDownloadComplete >> id %d")
+                            ,aPkgId);
+    if ( iStream )
+        {
+        iStream->Close();
+        delete iStream;
+        iStream=0;
+        }
+    TInt err = SendReceive(EUpdatePackageDownloadComplete, TIpcArgs(aPkgId) );
+    FLOG(_L("RFotaEngineSession::UpdatePackageDownloadComplete << error %d ")
+                            ,err);
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::GetState
+// ---------------------------------------------------------------------------
+EXPORT_C RFotaEngineSession::TState RFotaEngineSession::GetState(
+                                                         const TInt aPkgId)
+    {
+    FLOG(_L("RFotaEngineSession::GetState"));
+    TInt err(0);
+    RFotaEngineSession::TState          state;
+    TPckg<RFotaEngineSession::TState>   pkgstate(state);
+    err = SendReceive ( EGetState , TIpcArgs(aPkgId, &pkgstate));
+    if ( err ) 
+        {
+        FLOG(_L("RFotaEngineSession::GetState error %d"),err);
+        }
+    return state;
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::GetResult    
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::GetResult(const TInt aPkgId)
+    {
+    FLOG(_L("RFotaEngineSession::GetResult"));
+    TInt            result;
+    TPckg<TInt>     pkgresult(result);
+    SendReceive ( EGetResult , TIpcArgs(aPkgId, &pkgresult));
+    return result;
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::DeleteUpdatePackage
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::DeleteUpdatePackage(const TInt aPkgId)
+{
+    TInt err = SendReceive(EDeletePackage, TIpcArgs(aPkgId) );
+    return err;
+}
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::LastUpdate
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::LastUpdate(TTime& aUpdates)
+    {
+    TInt err;
+    FLOG(_L("RFotaEngineSession::LastUpdate >>"));
+    TBuf<15>                    timestamp;
+    err = SendReceive ( EGetUpdateTimestamp, TIpcArgs(&timestamp) );
+
+    if ( timestamp.Length() > 0 )
+        {
+        TInt year   = timestamp[0];
+        TInt month  = timestamp[1];
+        TInt day    = timestamp[2];
+        TInt hour   = timestamp[3];
+        TInt minute = timestamp[4];
+        aUpdates = TDateTime (year,(TMonth)month,day,hour,minute,0,0 );
+        }
+    else
+        {
+        aUpdates.Set( _L( "19900327:101010.000000" ) ); 
+        err = KErrUnknown;
+        }
+    FLOG(_L("RFotaEngineSession::LastUpdate <<"));
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::CurrentVersion
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::CurrentVersion(TDes& aSWVersion)
+    {
+    aSWVersion.Copy(_L("1.0"));  
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::ExtensionInterface
+// ---------------------------------------------------------------------------
+EXPORT_C void RFotaEngineSession::ExtensionInterface(TUid /*aInterfaceId*/
+                                              ,TAny*& /*aImplementation*/)
+    {
+    RProcess pr; TFullName fn = pr.FullName(); 
+    FLOG(_L("RFotaEngineSession::ExtensionInterface called by %S"), &fn);
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::RFotaEngineSession
+// ---------------------------------------------------------------------------
+EXPORT_C RFotaEngineSession::RFotaEngineSession() : iStream(0)
+                    , iGenericAlertSentPkgID(-1)
+    {
+    FLOG(_L("RFotaEngineSession::RFotaEngineSession() >>"));
+    FLOG(_L("RFotaEngineSession::RFotaEngineSession() <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::GetUpdatePackageIds
+// Gets ids of the update packages present in the system.
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::GetUpdatePackageIds(TDes16& aPackageIdList)
+    {
+    TInt err;
+    FLOG(_L("RFotaEngineSession::GetUpdatePackageIds >>"));
+    TBuf<10> b; b.Copy(_L("dkkd"));
+    TPkgIdList                  pkgids;
+    TPckg<TPkgIdList>           pkgids_pkg(pkgids);
+    TIpcArgs                    args ( &pkgids_pkg);
+    err = SendReceive ( EGetUpdatePackageIds, args);
+    aPackageIdList.Copy(pkgids);
+    FLOG(_L("RFotaEngineSession::GetUpdatePackageIds <<"));
+    return err;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::GenericAlertSentL
+// marks genereic alert being sent
+// ---------------------------------------------------------------------------
+EXPORT_C void RFotaEngineSession::GenericAlertSentL ( const TInt aPackageID )
+    {
+    iGenericAlertSentPkgID = aPackageID;
+    }
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::ScheduledUpdateL
+// Update fw
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFotaEngineSession::ScheduledUpdateL ( const TFotaScheduledUpdate aSchedule )
+    {
+  	TInt err(KErrNotSupported);
+
+    TPckg<TFotaScheduledUpdate> p(aSchedule);
+    err = SendReceive( EScheduledUpdate, TIpcArgs(&p) );
+
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::ServiceUid
+// Apparc asks which session class to create in server side
+// ---------------------------------------------------------------------------
+TUid RFotaEngineSession::ServiceUid() const
+	{
+    RProcess pr; TFullName fn = pr.FullName(); 
+    FLOG(_L( "RFotaEngineSession::ServiceUid() >> called by: %S" ), &fn );
+    FLOG(_L( "RFotaEngineSession::ServiceUid() << ret: 0x%X" ),
+                                            KFotaServiceUid );
+	return TUid::Uid( KFotaServiceUid );
+	}
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::SendChunkL
+// Tells server to read chunk contnets
+// ---------------------------------------------------------------------------
+void RFotaEngineSession::SendChunkL(const TUint8* aP1, const TUint8* aP2)
+    {
+    TInt writecount = aP2-aP1;
+    TInt err = SendReceive(EFotaSendChunk, TIpcArgs(writecount) );
+
+    if ( err )
+        {   
+        FLOG(_L("RFotaEngineSession::SendChunkL error %d"),err);
+        }
+    User::LeaveIfError ( err );
+    }
+
+
+// ---------------------------------------------------------------------------
+// RFotaEngineSession::ReleaseChunkHandle()
+// Releases server's handle to the chuhnk
+// ---------------------------------------------------------------------------
+TInt RFotaEngineSession::ReleaseChunkHandle()
+	{
+	return Send( EFotaReleaseChunkHandle);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaEngine/SRC/fotaengstream.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2005-2006 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:   Stream for storing firmware update package
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <centralrepository.h>
+#include "fotadiskstoragePrivateCRKeys.h"
+#include "fotaengstream.h"
+#include "fotaengine.h"
+#include "fotaenginedebug.h"
+
+// ======================= MEMBER FUNCTIONS ==================================
+
+// ---------------------------------------------------------------------------
+// RFotaWriteStream::RFotaWriteStream()
+// ---------------------------------------------------------------------------
+RFotaWriteStream::RFotaWriteStream() : RWriteStream (), iWriteLimit(0)
+    {
+    iFotaEngineSession  = 0;
+    iBuf.iMyWriteStream = this;
+    }
+
+// ---------------------------------------------------------------------------
+// RFotaWriteStream::OpenL()
+// Opens stream
+// ---------------------------------------------------------------------------
+TInt RFotaWriteStream::OpenL(const TInt /*aPkgId*/)
+    {
+    FLOG(_L( "[RFotaEngineSession] RFotaWriteStream::OpenL() >>" ) );
+
+    // Get write limit 
+    TInt            writelimit( KDefaultWriteLimit );
+    CRepository*    centrep( NULL);
+    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaDiskStorage ) );
+    if(err) FLOG(_L(" writelimit not defined in centrep") );
+    if ( centrep ) 
+        {
+        err = centrep->Get(  KFotaDiskSpaceReservationKey, writelimit );
+        }
+    iWriteLimit = writelimit;
+    delete centrep;
+
+    iBuf.ResetL();
+    Attach ( &iBuf );  // set sink
+
+    FLOG(_L( "[RFotaEngineSession] RFotaWriteStream::OpenL() <<" ) );
+    return 0;
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDP2StreamBuf::Reset()
+// Redefine write area.
+// ---------------------------------------------------------------------------
+void TDP2StreamBuf::ResetL()
+    {
+  	FLOG(_L("TDP2StreamBuf::ResetL() >>" ));
+    // Define write area (chunk)
+    TArea   a (EWrite) ;
+    //TInt    limitedwritearea(-1);
+    TInt    chunksize = iMyWriteStream->iFotaEngineSession->iChunk.Size();
+   // TInt    writelimit = iMyWriteStream->iWriteLimit;
+/*	08-nov-06 flexible mem handling overrides this
+    // If writelimit is being exceeded, raise error
+    if ( iBytesWritten > writelimit ) 
+        {
+        User::Leave ( KErrOverflow );
+        }
+*/        
+/*		08-nov-06 flexible mem handling overrides this
+    // Ensure that we cant go beyond write limit
+    if ( (iSentChunks+1) * chunksize > writelimit )
+        {
+        limitedwritearea = writelimit - iBytesWritten;
+
+        // 0-size writearea would crash writestream base classes
+        if ( limitedwritearea == 0 )
+            {
+            limitedwritearea += 1;
+            }        
+        }
+*/
+
+    // Define write area
+    TUint8* p1 = iMyWriteStream->iFotaEngineSession->iChunk.Base();
+    TUint8* p2;
+    p2 = p1 + chunksize;
+    
+    /* // dead code
+    if ( limitedwritearea == -1 ) 
+        {
+        p2 = p1 + chunksize;
+        }
+    else
+        {
+        p2 = p1 + limitedwritearea;
+        }
+        */
+    SetBuf  (a,p1 , p2 );
+  	FLOG(_L("TDP2StreamBuf::ResetL() <<" ));
+    }
+
+// ---------------------------------------------------------------------------
+// TDP2StreamBuf::DoRelease()
+// Stream is released. This is called when data has been comitted to stream.
+// ---------------------------------------------------------------------------
+void TDP2StreamBuf::DoRelease()
+    {
+    FLOG(_L("TDP2StreamBuf::DoRelease() >>" ));
+    TRAPD(err,  OverflowL() );
+    if ( err ) FLOG(_L(" DoRelease overflow err %d"),err);
+    this->iMyWriteStream->iFotaEngineSession->ReleaseChunkHandle();
+    FLOG(_L("TDP2StreamBuf::DoRelease() <<" ));
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDP2StreamBuf::TDP2StreamBuf()
+// ---------------------------------------------------------------------------
+TDP2StreamBuf::TDP2StreamBuf() : iBytesWritten(0), iSentChunks(0)
+                    ,iMyWriteStream(0)
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDP2StreamBuf::UnderflowL(TInt aMaxLength)
+// ---------------------------------------------------------------------------
+TInt TDP2StreamBuf::UnderflowL(TInt aMaxLength)
+    {
+    FLOG(_L("TDP2StreamBuf::UnderflowL %d"), aMaxLength );
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// TDP2StreamBuf::OverflowL()
+// Send buffer data to server. Reset buffer.
+// ---------------------------------------------------------------------------
+void TDP2StreamBuf::OverflowL()
+    {
+    FLOG(_L("TDP2StreamBuf::OverflowL >>") );
+    // Send pointers to data to server. Then reset.
+    TUint8* p1 = iMyWriteStream->iFotaEngineSession->iChunk.Base();
+    TUint8* p2 = Ptr(EWrite);                           // start point of 
+                                                        // write area
+    FLOG(_L("TDP2StreamBuf::OverflowL ptrs 0x%x  0x%x"),p1,p2 );
+    TPtr8   data(p1, p2-p1, p2-p1 );
+    iBytesWritten += p2-p1;
+    if ( p2-p1 >0 )
+        {
+        iMyWriteStream->iFotaEngineSession->SendChunkL(p1,p2);
+        iSentChunks++;
+        }
+    ResetL();
+    FLOG(_L("TDP2StreamBuf::OverflowL <<") );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaEngine/eabi/fotaengineu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+EXPORTS
+	_ZN18RFotaEngineSession10LastUpdateER5TTime @ 1 NONAME
+	_ZN18RFotaEngineSession14CurrentVersionER6TDes16 @ 2 NONAME
+	_ZN18RFotaEngineSession17DownloadAndUpdateEiRK6TDesC8iS2_S2_ @ 3 NONAME
+	_ZN18RFotaEngineSession18ExtensionInterfaceE4TUidRPv @ 4 NONAME
+	_ZN18RFotaEngineSession19DeleteUpdatePackageEi @ 5 NONAME
+	_ZN18RFotaEngineSession19GetUpdatePackageIdsER6TDes16 @ 6 NONAME
+	_ZN18RFotaEngineSession22OpenUpdatePackageStoreEiRP12RWriteStream @ 7 NONAME
+	_ZN18RFotaEngineSession27IsPackageStoreSizeAvailableEi @ 8 NONAME
+	_ZN18RFotaEngineSession29UpdatePackageDownloadCompleteEi @ 9 NONAME
+	_ZN18RFotaEngineSession5CloseEv @ 10 NONAME
+	_ZN18RFotaEngineSession5OpenLEv @ 11 NONAME
+	_ZN18RFotaEngineSession6UpdateEiiRK6TDesC8S2_ @ 12 NONAME
+	_ZN18RFotaEngineSession8DownloadEiRK6TDesC8iS2_S2_ @ 13 NONAME
+	_ZN18RFotaEngineSession8GetStateEi @ 14 NONAME
+	_ZN18RFotaEngineSession9GetResultEi @ 15 NONAME
+	_ZN18RFotaEngineSessionC1Ev @ 16 NONAME
+	_ZN18RFotaEngineSessionC2Ev @ 17 NONAME
+	_ZTI13TDP2StreamBuf @ 18 NONAME ; #<TI>#
+	_ZTI18RFotaEngineSession @ 19 NONAME ; #<TI>#
+	_ZTV13TDP2StreamBuf @ 20 NONAME ; #<VT>#
+	_ZTV18RFotaEngineSession @ 21 NONAME ; #<VT>#
+	_ZN18RFotaEngineSession17GenericAlertSentLEi @ 22 NONAME
+	_ZN18RFotaEngineSession16ScheduledUpdateLE20TFotaScheduledUpdate @ 23 NONAME
+	_ZN18RFotaEngineSession17TryResumeDownloadEv @ 24 NONAME
+	_ZN18RFotaEngineSession28GetDownloadUpdatePackageSizeEiRiS0_ @ 25 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaEngine/group/fotaengine.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project specification file for fotaengine
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+//MACRO  _FOTA_DEBUG 
+//MACRO  _FOTA_DEBUG_RDEBUG
+
+TARGET          fotaengine.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x102072C5
+
+CAPABILITY CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH      ../SRC
+SOURCE          fotaengine.cpp
+SOURCE          fotaengstream.cpp
+SOURCEPATH		../../inc
+SOURCE          FotaIPCTypes.cpp
+
+USERINCLUDE    ../INC  ../../inc ../../cenrep
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE		/epoc32/include/uiklaf/private
+
+LIBRARY         avkon.lib
+LIBRARY         euser.lib
+LIBRARY         estor.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         bafl.lib
+LIBRARY         apgrfx.lib
+LIBRARY         mtur.lib
+LIBRARY         eikcore.lib
+LIBRARY			efsrv.lib
+LIBRARY			ws32.lib			// wssession
+LIBRARY			centralrepository.lib
+LIBRARY	flogger.lib
+
+SMPSAFE
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/group/RfsFotaPlugin.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project rfsfotaplugin
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// MACRO  _FOTA_DEBUG
+// MACRO  _FOTA_DEBUG_RDEBUG
+
+TARGET					rfsfotaplugin.dll
+TARGETTYPE				PLUGIN
+UID						0x10009D8D 0x10281873
+
+CAPABILITY				CAP_ECOM_PLUGIN
+VENDORID				VID_DEFAULT
+
+SOURCEPATH				../src
+SOURCE					RfsFotaPlugin.cpp
+SOURCE					Proxy.cpp
+
+START RESOURCE			10281873.rss
+TARGET rfsfotaplugin.rsc
+LANGUAGE_IDS
+END
+
+
+
+USERINCLUDE				../inc  ../../inc ../../../inc
+SYSTEMINCLUDE			 /epoc32/include/ecom 
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib       // Base library
+LIBRARY ecom.lib	    // ECom library
+LIBRARY flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* 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 file provides the information required for building RFS AP
+*    	plugin
+*
+*/
+
+
+
+PRJ_PLATFORMS
+
+PRJ_MMPFILES
+
+../group/RfsFotaPlugin.mmp
+
+
+PRJ_EXPORTS
+
+
+PRJ_TESTMMPFILES
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/inc/RfsFotaPlugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2005-2006 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:   Handles restory factory settings
+*
+*/
+
+
+
+
+#ifndef RfsFotaPlugin_H
+#define RfsFotaPlugin_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <fotastorage.h>
+
+#include "rfsPlugin.h"
+
+// CLASS DECLARATION
+
+/**
+ *  Ensures that there is disk space reservation in place after 1st boot
+ *
+ *  @lib    fotaserver.exe
+ *  @since  S60 v3.1
+ */
+class CRfsFotaPlugin: public CRFSPlugin
+    {
+public:
+
+
+    /**
+    * Two-phased constructor.
+     *
+     * @since   S60   v3.1
+     * @param	aInitParams initial parameters
+     * @return  Error code
+     */
+    static CRfsFotaPlugin* NewL(TAny* aInitParams);
+
+    virtual ~CRfsFotaPlugin();
+
+
+    /**
+     * Handle restory factory settings. Run at boot up.
+     *
+     * @since   S60   v3.1
+	 * @param	aType   type of boot
+     * @return  none
+     */
+    void RestoreFactorySettingsL( const TRfsReason aType );
+
+
+    /**
+    * GetScriptL
+    *
+	* @param    aType
+	* @param    aPath
+    * @return   None
+    */
+    void GetScriptL( const TRfsReason aType, TDes& aPath );
+
+    
+    /**
+    * GetScriptL
+    *
+	* @param    aType
+	* @param    aCommand
+    * @return   None
+    */
+    void ExecuteCustomCommandL( const TRfsReason aType, TDesC& aCommand );
+
+
+private:
+
+    CRfsFotaPlugin();
+
+    
+    /**
+    * Constructor
+    *
+	* @param    aInitParams
+    * @return   None
+    */
+	CRfsFotaPlugin(TAny* aInitParams);
+
+    void ConstructL();
+
+
+    
+    /**
+    * Load fota storage plugin
+    *
+	* @param    None
+    * @return   None
+    */
+    void            LoadStoragePluginL ();
+
+    
+    /**
+    * unload fota storage plugin
+    *
+	* @param    None
+    * @return   None
+    */
+    void            UnLoadStoragePluginL ();
+
+private: // data    
+
+
+    /**
+     * Destructor key of fotastorageplugin.
+     */
+    TUid                iStorageDtorKey;
+
+
+    /**
+     * Fotastorage plugin. Used for disk space reservation file handling
+     */
+    CFotaStorage*       iStorage;
+
+    };
+
+
+#endif      // RfsFotaPlugin_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/inc/fotadebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   This file defines logging macros 
+*
+*/
+
+
+
+#ifndef FOTADEBUG_H
+#define FOTADEBUG_H
+
+    // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
+    #ifdef _FOTA_DEBUG
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "rfsfotaplugin.log" );
+        _LIT( KLogDirFullName, "c:\\logs\\" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+#endif      // FOTADEBUG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/src/10281873.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 1028 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+
+#include "registryinfo.rh"
+
+// Declares info for two implementations
+RESOURCE REGISTRY_INFO theInfo
+	{
+	// UID for the DLL
+	dll_uid = 0x10281873;
+	// Declare array of interface info
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+			// UID of interface that is implemented
+			interface_uid = 0x102073BB;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10281874;
+					version_no = 1;
+					display_name = "RFS FOTA Plugin";
+					default_data = "I"; // N = Normal RFS, D = Deep RFS, I = Init RFS (FirstBoot RFS)
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/src/Proxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2005-2006 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 export ECom interface implementations.
+*
+*/
+
+
+
+#include <e32std.h>
+#include <implementationproxy.h>
+#include "RfsFotaPlugin.h"
+
+// Map the interface UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(0x10281874,	CRfsFotaPlugin::NewL)
+    };
+
+// Exported proxy for instantiation method resolution
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaRfsPlugin/src/RfsFotaPlugin.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "RfsFotaPlugin.h"
+#include "fotadebug.h"
+
+_LIT(KScriptPath, "");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CRfsFotaPlugin::CRfsFotaPlugin()
+    {
+    FLOG(_L("CRfsFotaPlugin::CRfsFotaPlugin()"));
+    }
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CRfsFotaPlugin::CRfsFotaPlugin(TAny* /*aInitParams*/)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CRfsFotaPlugin::~CRfsFotaPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::NewL
+// ---------------------------------------------------------------------------
+//
+CRfsFotaPlugin* CRfsFotaPlugin::NewL(TAny* aInitParams)
+    {
+    FLOG(_L("CRfsFotaPlugin::NewL()"));
+    CRfsFotaPlugin* self = new (ELeave) CRfsFotaPlugin(aInitParams);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CRfsFotaPlugin::ConstructL()
+    {
+    FLOG(_L("CRfsFotaPlugin::ConstructL()"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::RestoreFactorySettingsL
+// Handle rfs. Must reserve disk space to keep user from filling it. 
+// ---------------------------------------------------------------------------
+//
+void CRfsFotaPlugin::RestoreFactorySettingsL( const TRfsReason aType )
+    {
+    FLOG(_L("CRfsFotaPlugin::RestoreFactorySettingsL(%d)"), aType);
+
+    if ( aType == ENormalRfs ) 
+        {
+        FLOG(_L(" ERROR - NORMAL RFS (Only FirstBoot RFS is ordered) "));
+        }
+    if ( aType == EDeepRfs   ) 
+        { 
+        FLOG(_L(" ERROR - DEEP   RFS (Only FirstBoot RFS is ordered) "));
+        }
+
+    LoadStoragePluginL ();
+    iStorage->AdjustDummyStorageL () ;
+
+    UnLoadStoragePluginL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::GetScriptL
+// ---------------------------------------------------------------------------
+//
+void CRfsFotaPlugin::GetScriptL( const TRfsReason /*aType*/, TDes& aPath )
+    {
+    FLOG(_L("CRfsFotaPlugin::GetScriptL"));
+    aPath.Copy( KScriptPath);
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::ExecuteCustomCommandL
+// ---------------------------------------------------------------------------
+void CRfsFotaPlugin::ExecuteCustomCommandL( const TRfsReason /*aType*/,
+                                        TDesC& /*aCommand*/ )
+    {
+    FLOG(_L("CRfsFotaPlugin::ExecuteCustomCommandL"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::LoadStoragePluginL 
+// Load update storage plugin via ecom framework.
+// ---------------------------------------------------------------------------
+//
+void CRfsFotaPlugin::LoadStoragePluginL ()
+    {
+    FLOG(_L("CRfsFotaPlugin::LoadStoragePluginL"));
+    if(iStorage)
+        {
+        UnLoadStoragePluginL ();
+        }
+    TUid                if_uid;
+    if_uid.iUid =  (0x10207384);
+    RImplInfoPtrArray   pluginArray;
+    REComSession::ListImplementationsL( if_uid, pluginArray );
+    CleanupClosePushL (pluginArray);
+
+    if( pluginArray.Count() )
+        {
+        for( TInt i = 0; i < pluginArray.Count(); i++ )
+            {
+            CImplementationInformation* info = pluginArray[ i ];
+            TUid id = info->ImplementationUid();
+            delete info;
+            info = NULL;
+            iStorage =(CFotaStorage*) REComSession::CreateImplementationL(
+                                        id , iStorageDtorKey); 
+            }
+        }
+    else
+        {
+        FLOG(_L("  storage plugin not found, ERROR"));
+        User::Leave ( KErrNotFound );
+        }
+    CleanupStack::PopAndDestroy(1); // array 
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRfsFotaPlugin::UnLoadStoragePluginL
+// Unloads storage plugin
+// ---------------------------------------------------------------------------
+//
+void CRfsFotaPlugin::UnLoadStoragePluginL ()
+    {
+    FLOG(_L("CRfsFotaPlugin::UnLoadStoragePluginL"));
+    if(iStorage != NULL) 
+        {
+        delete iStorage;
+        iStorage=0;
+        }
+    REComSession::DestroyedImplementation(iStorageDtorKey); // sets reference count of plugin to 0
+    REComSession::FinalClose();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaScheduleHandler/group/fotaschedulehandler.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005-2006 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:   Handles scheduled update, starts fotaserver and request upd
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+//MACRO  _FOTA_DEBUG
+//MACRO  _FOTA_DEBUG_RDEBUG
+
+
+TARGET          	fotaschedulehandler.exe
+TARGETTYPE		EXE
+
+EPOCSTACKSIZE 0x5400
+
+UID 0x100039CE 0x101F99FA
+
+// set vendor id (from defaultcaps.hrh)
+VENDORID VID_DEFAULT
+
+// set dll capability (from defaultcaps.hrh)
+CAPABILITY  CAP_APPLICATION
+
+
+SOURCEPATH ../src
+
+SOURCE				fotaschedulehandler.cpp
+
+USERINCLUDE . 
+USERINCLUDE ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY	euser.lib
+LIBRARY	efsrv.lib
+LIBRARY	estor.lib
+LIBRARY	schsvr.lib
+LIBRARY	fotaengine.lib
+LIBRARY	flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaScheduleHandler/inc/FotaSchedDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* 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 file defines logging macros 
+*
+*/
+
+
+
+#ifndef FOTADEBUG_H
+#define FOTADEBUG_H
+
+    #ifdef _FOTA_DEBUG
+
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "fotaschedhandler.log" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+#endif      // FOTADEBUG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaScheduleHandler/src/fotaschedulehandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2005-2006 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:   Handles scheduled update, starts fotaserver and request upd
+*
+*/
+
+
+
+#include <schinfo.h>
+#include <schtask.h>
+#include <s32file.h>
+#include <e32math.h>
+#include <e32cons.h>
+
+#include "FotaSchedDebug.h"
+#include "fotaengine.h"
+#include "../../inc/FotaIPCTypes.h"
+
+// Constants
+
+// -----------------------------------------------------------------------------
+// UpdateFirmwareL
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_D void UpdateFirmwareL(RFile& aTaskFile)
+	{
+    FLOG(_L("fotaschedulehandler UpdateFirmwareL(RFile& aTaskFile)"));
+    TInt err;
+    CFileStore*         store;
+    RStoreReadStream    instream;
+    // Get tasks from scheduler's store
+    store = CDirectFileStore::FromLC(aTaskFile);
+    instream.OpenLC(*store,store->Root());
+    TInt count = instream.ReadInt32L();
+    FLOG(_L("fotaschedulehandler  task count  %d"),count );
+	for (TInt i=0;i<count;i++)
+        {
+		CScheduledTask* task = CScheduledTask::NewLC(instream);
+        HBufC* b = const_cast<HBufC*>(&(task->Data()));
+        TPtr ptr = b->Des();
+        HBufC8* b8 = HBufC8::NewLC( b->Length() );
+        b8->Des().Copy(ptr);
+        TFotaScheduledUpdate fotareminder(-1,-1);
+        TPckg<TFotaScheduledUpdate>   fotareminderpkg(fotareminder);
+        fotareminderpkg.Copy(b8->Des());
+        CleanupStack::PopAndDestroy( b8 );
+        FLOG(_L("fotaschedulehandler packageid:%d  sched:%d"),fotareminder.iPkgId, fotareminder.iScheduleId);
+        RFotaEngineSession fota;
+        fota.OpenL();
+        CleanupClosePushL( fota );
+        err = fota.ScheduledUpdateL (fotareminder);
+        if(err){} // to remove compiler warning
+        FLOG(_L("fotaschedulehandler       2........ err %d"),err);
+        fota.Close();
+        FLOG(_L("fotaschedulehandler       3 "));
+        CleanupStack::PopAndDestroy( &fota); 
+		CleanupStack::PopAndDestroy(task);
+        }
+	CleanupStack::PopAndDestroy( &instream ); 
+	CleanupStack::PopAndDestroy( store ); 
+	}
+
+
+// -----------------------------------------------------------------------------
+// ExecuteL
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_D TInt ExecuteL()
+	{
+	TInt err = KErrNoMemory;
+		
+	RFile file;
+		
+	// Adopt the task file from the Task Scheduler
+	err = file.AdoptFromCreator(TScheduledTaskFile::FsHandleIndex(),
+									TScheduledTaskFile::FileHandleIndex());
+    FLOG(_L("  err  %d"),err );
+	User::LeaveIfError(err);
+	
+	TRAP(err, UpdateFirmwareL(file));
+	
+	file.Close();
+	
+	User::LeaveIfError(err);		
+	return err;
+	}
+
+
+// -----------------------------------------------------------------------------
+// Execute
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_D TInt Execute()
+	{
+    FLOG(_L("fotaschedulehandler Execute()"));
+	TInt err = KErrNoMemory;
+	
+	// construct and install active scheduler
+	CActiveScheduler* scheduler = new CActiveScheduler;
+	if (!scheduler)
+		{
+		return err;
+		}
+	CActiveScheduler::Install(scheduler);
+	CTrapCleanup* cleanupStack = CTrapCleanup::New();
+	if (cleanupStack)
+		{
+        TRAP(err, ExecuteL());
+		delete cleanupStack;
+		}
+    delete scheduler;
+	return err;
+	}
+
+
+// -----------------------------------------------------------------------------
+// E32Main
+//
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+	{
+	return Execute();
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/data/fotaserver.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource file
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    FOTS // 4 letter ID
+
+
+//  INCLUDES
+#include <bldvariant.hrh>
+#include <eikon.rh>
+#include <uikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.hrh>
+#include <AvkonIcons.hrh>
+#include <avkon.loc>
+#include <CommonDialogs.rh>
+#include <CommonDialogs.hrh>
+#include <data_caging_paths_strings.hrh>
+#include <fotaserver.loc>
+
+//
+// AIF icons/files
+//
+#include <appinfo.rh>
+
+//  CONSTANTS  
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+RESOURCE TBUF { buf = "fotaserver"; }
+
+
+RESOURCE EIK_APP_INFO
+	{
+	}
+
+//
+// AIF icons/files
+//
+RESOURCE LOCALISABLE_APP_INFO r_fotaserver_localisable_app_info
+    {
+    short_caption = qtn_fota_title;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_fota_title;
+
+    #ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+        icon_file = "Z:\\resource\\apps\\fotaserver_aif.mif";
+    #else
+        number_of_icons = 2;
+        icon_file = "Z:\\resource\\apps\\fotaserver.mbm";
+    #endif  // __SCALABLE_ICONS
+
+        };
+    }
+
+RESOURCE DIALOG r_fotaserver_dl_progress_dialog
+    {
+    flags = EAknProgressNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EAknNoteProgressBar;
+            control = AVKON_NOTE
+                {
+                singular_label= qtn_fota_wait_downloading;
+                layout = EProgressLayout;                            
+                };
+            }
+        };
+    }
+
+RESOURCE DIALOG r_connection_note
+  {
+  flags = EAknProgressNoteFlags;
+  buttons = R_AVKON_SOFTKEYS_CANCEL;
+  items= 
+    {
+    DLG_LINE
+      {
+      type = EAknCtNote;
+      id = EAknNoteProgressBar;
+      control = AVKON_NOTE 
+        {
+        animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+        layout = EProgressLayout;
+        singular_label =  "\n \n";
+        };
+      }
+    };
+  }
+
+
+RESOURCE LISTBOX r_setting_app_listbox
+    {
+    flags = EEikListBoxMultipleSelection;
+    }
+
+RESOURCE AVKON_SETTING_PAGE r_setting_remainder 
+    {
+    label= qtn_fota_reminder_setting;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type =  EAknSetListBox;
+    editor_resource_id= r_setting_app_listbox;
+    }
+
+
+
+////////////////////////////////////////////////////
+//	Strings
+//
+
+STRUCT STRING
+	{
+	LTEXT text;
+	}
+
+RESOURCE TBUF r_apps_fota_updating			{ buf = qtn_fota_wait_installing;}
+RESOURCE TBUF r_apps_fota_restarting		{ buf = qtn_fota_restarting_phone;}
+RESOURCE TBUF r_qtn_dm_title_settings_dialog				{ buf=qtn_apps_dm_title; }
+RESOURCE TBUF r_fota_radio_dialog_1hour_remainder		{ buf=qtn_fota_reminder_1_hour;}
+//RESOURCE TBUF r_fota_radio_dialog_4hours_remainder	{ buf=qtn_fota_reminder_4_hours; }
+RESOURCE TBUF r_fota_radio_dialog_1day_remainder		{ buf=qtn_fota_reminder_1_day; }
+//RESOURCE TBUF r_fota_radio_dialog_3days_remainder		{ buf=qtn_fota_reminder_3_days; }
+RESOURCE TBUF r_fota_radio_dialog_no_remainder			{ buf=qtn_fota_no_reminder;}
+RESOURCE TBUF r_qtn_fota_reminder_1_minute          { buf=qtn_fota_reminder_1_minute; }    
+RESOURCE TBUF r_qtn_fota_reminder_minutes           { buf=qtn_fota_reminder_minutes ; }
+RESOURCE TBUF r_qtn_fota_reminder_hours             { buf=qtn_fota_reminder_hours ; }
+RESOURCE TBUF r_qtn_fota_reminder_days              { buf=qtn_fota_reminder_days ; }
+RESOURCE TBUF r_fotaserver_decryption_progress_dialog { buf=qtn_fota_decrypting_encrypt_process ; }
+RESOURCE TBUF r_fotaserver_encryption_progress_dialog { buf=qtn_fota_encrypting_encrypt_process ; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/data/fotaserver_reg.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+
+#include <appinfo.rh>
+#include <fotaserver.rsg>
+#include "fotaserver_service.rh"
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x102072C4 // Define your application UID here
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file 			= "fotaserver";
+    localisable_resource_file = APP_RESOURCE_DIR "\\fotaserver";
+    localisable_resource_id = R_FOTASERVER_LOCALISABLE_APP_INFO;
+    hidden					= KAppIsHidden;
+	embeddability			= KAppNotEmbeddable;
+    newfile 				= KAppSupportsNewFile;
+	launch					= KAppLaunchInBackground;
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/group/fotaserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project fotaserver
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+//MACRO  _FOTA_DEBUG
+//MACRO  _FOTA_DEBUG_RDEBUG
+
+
+#ifdef __SERIES60_30__
+MACRO  ___USE_SYNCML_NOTIFIER_
+#endif
+
+TARGET          fotaserver.exe
+TARGETTYPE      exe
+
+EPOCSTACKSIZE 0x5400
+UID             0x100039CE  0x102072C4
+CAPABILITY      CAP_SERVER NetworkControl PowerMgmt DiskAdmin
+VENDORID        VID_DEFAULT
+
+START RESOURCE ../data/fotaserver.rss
+HEADER
+	TARGETPATH APP_RESOURCE_DIR
+	LANGUAGE_IDS
+END
+
+START RESOURCE ../data/fotaserver_reg.rss
+DEPENDS fotaserver.rsg
+// Do not change the UID below.
+TARGETPATH /private/10003a3f/apps
+END
+
+
+SOURCEPATH  ../src
+
+SOURCE      FotaSrvApp.cpp 
+SOURCE      FotaSrvUi.cpp
+SOURCE      FotaSrvDocument.cpp
+SOURCE      FotaServer.cpp
+SOURCE		fotadownload.cpp
+SOURCE		fotaupdate.cpp
+SOURCE 		fotaSrvSession.cpp
+SOURCE		FotaDB.cpp
+SOURCE		FotaDLProgressDlg.cpp
+SOURCE		FotaReminderDlg.cpp
+SOURCE		FotaNetworkRegStatus.cpp
+SOURCE		DevEncController.cpp
+SOURCE 		DevEncProgressObserver.cpp
+SOURCE 		DevEncProgressDlg.cpp
+
+SOURCEPATH	../../inc
+SOURCE		  FotaIPCTypes.cpp
+USERINCLUDE    ../inc  ../../inc ../../cenrep ../../../inc ../../fmsclient/inc
+
+//help
+SYSTEMINCLUDE   /epoc32/include/cshelp
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY     aknskins.lib
+LIBRARY     apgrfx.lib
+LIBRARY     apparc.lib
+LIBRARY     avkon.lib
+LIBRARY     bafl.lib
+LIBRARY     cone.lib
+LIBRARY     commdb.lib
+LIBRARY     commonengine.lib
+LIBRARY     edbms.lib
+LIBRARY     efsrv.lib
+LIBRARY     eikctl.lib
+LIBRARY     eikcore.lib
+LIBRARY     eikcoctl.lib 
+LIBRARY     eikdlg.lib
+LIBRARY     estor.lib
+LIBRARY     euser.lib
+LIBRARY     featmgr.lib
+LIBRARY     hlplch.lib      //help
+LIBRARY     ws32.lib
+LIBRARY		downloadmgr.lib
+LIBRARY		commonui.lib 		// dochandler
+LIBRARY		apmime.lib			// TDataType
+LIBRARY		syncmlclientapi.lib	//  RSyncMLSession
+LIBRARY     ecom.lib
+LIBRARY		bitgdi.lib			// fbsbitmapdevice
+LIBRARY		fbscli.lib			// fbsbitmap
+LIBRARY		gdi.lib				// TFontSpec
+library		etelmm.lib
+LIBRARY		etel.lib
+LIBRARY		centralrepository.lib
+LIBRARY		esock.lib
+LIBRARy		schsvr.lib 
+LIBRARY			  sysversioninfo.lib //For reading software version
+LIBRARY     nsmldmtreedbclient.lib
+LIBRARY		akncapserverclient.lib // AknUiServer
+LIBRARY		starterclient.lib
+LIBRARY		connmon.lib
+LIBRARY		featmgr.lib
+LIBRARY		fmsclient.lib	//FMS Client
+LIBRARY     	cmmanager.lib 	//Connection Manager
+LIBRARY		inetprotutil.lib
+
+LIBRARY		aknnotify.lib
+// #ifdef _FOTA_DEBUG
+LIBRARY    flogger.lib
+// #endif
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/DevEncController.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   CDevEncController class declaration
+*
+*/
+
+#ifndef __DEVENCCONTROLLER_H__
+#define __DEVENCCONTROLLER_H__
+
+// INCLUDES
+#include <e32base.h>
+
+#include <DevEncConstants.h>
+#include "DevEncProgressDlg.h"
+#define KDevEncUIUid 0x2000259A
+
+//Forward declaration
+class CFotaServer;
+class CDevEncSessionBase;
+class CDevEncStarterStarter;
+class CDevEncProgressObserver;
+
+class CDevEncController : public CBase
+    {
+    public:
+        static CDevEncController* NewL( CFotaServer* aCallback );
+        static CDevEncController* NewLC( CFotaServer* aCallback );
+        ~CDevEncController();
+
+    public:
+        TBool NeedToDecryptL(const TDriveNumber &aDrive);
+    
+        void DoStartDecryptionL(const TDriveNumber &aDrive);
+        
+        TBool NeedToEncryptL(TDriveNumber &aDrive);
+        
+        void DoStartEncryptionL(const TDriveNumber &aDrive );
+        
+        void ReportDevEncStartCompleteL(TInt aResult);
+        
+        void ReportDevEncOpnCompleteL(TInt aResult);
+        
+        TInt GetDEOperation();
+        
+    private:
+    // Functions
+        CDevEncController(CFotaServer* aCallback);
+
+        void ConstructL();
+        
+        TBool IsDeviceEncryptionSupportedL();
+        
+        void LoadDevEncSessionL();
+        
+        void UnloadDevEncSession();
+        
+        void StartDecryptionL();
+        
+        void StartEncryptionL();
+        
+        TBool CheckBatteryL();
+        
+    // Data
+        CFotaServer* iCallback; // parent
+        
+		RLibrary iLibrary;
+                
+        CDevEncSessionBase*     iEncMemorySession; // Device Encryption engine session
+
+        CDevEncProgressObserver* iDevEncObserver; //Observer for the encryption/decryption operation
+        
+        TDriveNumber iStorageDrive; //Holds the storage drive id
+        
+        TInt iDevEncOperation; //TOperations values
+        
+    };
+
+#endif //__DEVENCCONTROLLER_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/DevEncProgressDlg.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* 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:   header file fot CDevEncProgressDlg class
+*
+*/
+
+
+
+#ifndef __DEVENCPROGRESSDLG_H__
+#define __DEVENCPROGRESSDLG_H__
+
+// INCLUDES
+#include <stringresourcereader.h>
+#include <AknGlobalNote.h>
+
+// Set to progress bar, when download starts
+const TInt  KInitialDEProgressFinalValue( 100 );
+
+// FORWARD DECLARATIONS
+class CAknGlobalProgressDialog;
+// CLASS DECLARATION
+
+
+/**
+ *  Dialog observer interface
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+class MDEProgressDlgObserver
+    {
+public:
+    
+    /**
+    * Called when the dialog is going to be closed.
+    *
+    * @since S60 v3.1
+    * @param aButtonId    Id of the button, which was used to cancel 
+    *                       the dialog.
+    * @return TBool Can dlg be exited
+    */
+    virtual TBool HandleDEProgressDialogExitL( TInt aButtonId ) = 0;    
+    };
+
+
+/**
+ *  Progress dialog for download.
+ *
+ *  @lib    fotaserver.exe
+ *  @since  S60 v3.1
+ */
+NONSHARABLE_CLASS(CDevEncProgressDlg) : public CActive
+    {
+
+public:
+
+    IMPORT_C static CDevEncProgressDlg* NewL(MDEProgressDlgObserver* aObserver, TInt aResource);
+    IMPORT_C static CDevEncProgressDlg* NewLC(MDEProgressDlgObserver* aObserver, TInt aResource);
+
+    virtual ~CDevEncProgressDlg();
+
+
+public: // from base classes
+    
+
+    void ShowProgressDialogL();
+    
+    void UpdateProgressDialogL(TInt aValue, TInt aFinalValue);
+    
+    void ProgressFinished();
+
+private:
+    void ConstructL(TInt aResource);
+    
+    virtual void RunL();
+    
+    virtual void DoCancel();
+    
+    CDevEncProgressDlg(MDEProgressDlgObserver* aObserver);
+
+private: // data
+
+   
+    CAknGlobalProgressDialog* iProgressDialog;
+    
+    HBufC* iStringResource;
+    
+    
+    /**
+     * Progress dialog observer. Not owned.
+     */
+    MDEProgressDlgObserver* iObserver;
+
+    };
+
+#endif // __DEVENCPROGRESSDLG_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/DevEncProgressObserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,100 @@
+/*
+* 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:   GPRS and Wlan status getter for sending Generic Alerts
+*
+*/
+
+
+
+#ifndef __NFEOBSERVER_H__
+#define __NFEOBSERVER_H__
+
+// SYSTEM INCLUDES
+#include <e32base.h>
+#include "DevEncProgressDlg.h"
+
+//Forward declarations
+class CDevEncController;
+class CDevEncSessionBase;
+class CDevEncProgressDlg;
+//Constants used in this class
+
+const TTimeIntervalMicroSeconds32 KNfeTimeInterval = 500000; //0.5 second, duration between each retry.
+const KProgressComplete = 100; //100 percent
+
+/**
+* Actice object class that runs a timer for probing network status (GPRS & WLAN)
+*  @lib    fotaserver
+*  @since  S60 v3.2
+*/
+NONSHARABLE_CLASS (CDevEncProgressObserver) : public MDEProgressDlgObserver
+	{
+	public:
+		//Symbian 2-Phase construction
+		
+		IMPORT_C static CDevEncProgressObserver* NewL(CDevEncController* aObserver, TInt aResource);
+		IMPORT_C static CDevEncProgressObserver* NewLC(CDevEncController* aObserver, TInt aResource);
+
+       /**
+        * Destructor.
+        */      
+		virtual ~CDevEncProgressObserver();
+
+	public: 
+		/**
+	     * Starts monitoring for Network status before sending Generic Alert
+		 *
+     	 * @since   S60   v5.2
+     	 * @param   None
+     	 * @return  None
+     	 */
+
+		void StartMonitoringL(CDevEncSessionBase* aSession);
+		
+    public: // Functions from base classes
+
+        void CheckProgressL();
+        
+		TBool HandleDEProgressDialogExitL(TInt aButtonId);
+		
+	private: //functions
+		
+		//Constructors
+		
+		CDevEncProgressObserver();
+		CDevEncProgressObserver(CDevEncController* aObserver);
+
+		//Symbian 2-Phase construction 
+		void ConstructL(TInt aResource);
+		
+		TInt GetStatusL();
+		
+	
+	private: // data
+	
+		
+		CDevEncController* iObserver;
+		
+        CDevEncProgressDlg* iProgressDlg;
+		
+        CPeriodic* iPeriodicTimer;
+		
+		//Not owned
+		CDevEncSessionBase*     iEncMemorySession;
+	
+	};
+
+#endif // __NFEOBSERVER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaDB.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,282 @@
+/*
+* 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:   Header file for fotadb
+*
+*/
+
+
+
+
+#ifndef __CFOTADB_H___
+#define __CFOTADB_H___
+
+// INCLUDES
+#include <d32dbms.h>
+#include <fotaengine.h>
+#include "FotaIPCTypes.h"
+
+
+// CONSTANTS
+// see fotaipctypes.h for field descriptions
+_LIT(KDatabaseName,"FotaState");
+
+_LIT(KSelectAll,"SELECT * FROM State" );
+_LIT(KSelect_where_packageid,"SELECT * FROM State WHERE PkgID=%d" );
+_LIT(KCreateTable, "CREATE TABLE State ( Id COUNTER, PkgID INTEGER NOT \
+     NULL, Result INTEGER, State INTEGER NOT NULL, ProfileID INTEGER,\
+	     PkgURL LONG VARCHAR, PkgName CHAR(255),Version CHAR(255), SmlTryCount INTEGER, \
+         SessionType INTEGER, IapId INTEGER, PkgSize UNSIGNED INTEGER, UpdateLtr BIT)");
+_LIT(KAlterTable, "ALTER TABLE State ADD (SessionType INTEGER, IapId INTEGER, PkgSize UNSIGNED INTEGER, UpdateLtr BIT)");
+_LIT(KTblState,     "State");
+
+_LIT(KColPkgId,     "PkgID");
+_LIT(KColResult,    "Result");
+_LIT(KColState,     "State");
+_LIT(KColProfileId, "ProfileID");
+_LIT(KColPkgUrl,    "PkgURL");
+_LIT(KColPkgName,   "PkgName");
+_LIT(KColVersion,   "Version");
+_LIT(KColSmlTryCount, "SmlTryCount");
+_LIT(KColSessionType, "SessionType");
+_LIT(KColIapId, "IapId");
+_LIT(KColPkgSize, "PkgSize");
+_LIT(KColUpdateLtr, "UpdateLtr");
+
+// DATATYPES
+enum TFDBFields
+{
+    EFDBResult      = 0x01,
+    EFDBState       = 0x02,
+    EFDBProfileId   = 0x04,
+    EFDBPkgUrl      = 0x08,
+    EFDBPkgName     = 0x10,
+    EFDBVersion     = 0x20,
+    EFDBSmlTryCount = 0x40,
+    EFDBSessionType = 0x80,
+    EFDBIapId 		= 0x100,
+    EFDBPkgSize 	= 0x200,
+    EFDBUpdateLtr 	= 0x400
+};
+//Number of attributes in fotastate table
+const TUint KNoOfDBFields = 13;
+
+// FORWARD DECLARATION
+class CPackageState;
+
+
+/**
+ *  Database class
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+NONSHARABLE_CLASS(CFotaDB): public CBase
+    {
+    friend class CPackageState;
+public:
+	CFotaDB();
+
+	virtual ~CFotaDB();
+
+    static CFotaDB* NewL();
+
+    /**
+     * Create database
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  none
+     */
+    void CreateDatabaseL();
+    
+
+    /**
+     * Open database
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  Error code
+     */
+    void OpenDBL();
+
+    /**
+     * Close database and commit changes
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  none
+     */
+    void CloseAndCommitDB();
+
+
+    /**
+     * Checks if DB is open
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  TBool - is database open
+     */
+    TBool IsOpen();
+    
+
+    /**
+     * Add new package state to database
+     *
+     * @since   S60   v3.1
+     * @param   aState      State
+     * @param   aPkgURL     URL
+     * @return  None
+     */    
+    void AddPackageStateL( const TPackageState& aState
+                                ,const TDesC8& aPkgURL );
+
+
+    /**
+     * Get state from db
+     *
+     * @since   S60   v3.1
+     * @param   aPkgId      Package ID
+     * @return  State object
+     */        
+    TPackageState   GetStateL( const TInt aPkgId );
+
+
+    /** Sets state of package specified by packageid. If state doesnt exist,
+     * it is added to db.
+     * @since   S60   v3.1
+     * @param   aState   source data to be set
+     * @param   aPkgURL  URL
+     * @param   aChangedFields  Changed fields. Tells what columns from aState
+     *                          are to be set.
+     * @return  None
+     */
+    void SetStateL( TPackageState& aState
+                        ,const TDesC8& aPkgURL, TUint aChangedFields );
+
+
+    /**
+     * Deletes state from database 
+     *
+     * @since   S60   v3.1
+     * @param   aPkgId      Package ID
+     * @return  Error code
+     */
+    TInt DeleteStateL( const TInt aPkgId);
+
+
+    /**
+     * Gets all states from database
+     *
+     * @since   S60   v3.1
+     * @param   aStates     On return, all  states
+     * @return  Error code
+     */
+    void GetAllL(RArray<TInt>& aStates);
+
+private:
+
+    void ConstructL();
+
+
+    /**
+     * Converts database row to TPackageState
+     *
+     * @since   S60   v3.1
+     * @param  aPkgUrl  URL
+     * @param  aView    Database view. Must be ready&prepared for data 
+     *                  extraction
+     * @return  State
+     */
+	TPackageState RowToStateL(HBufC8*& aPkgUrl,const RDbView& aView);
+
+
+    /**
+     * Inserts TPackageState to database view
+     *
+     * @since   S60   v3.1
+     * @param  aPkg    Source package
+     * @param  aPkgURL Url
+     * @param  aView   Database view. Must be ready&prepared for data writing
+     * @return  None
+     */
+    void StateToRowL (const TPackageState& aPkg, const TDesC8& aPkgURL
+                    ,RDbView& aView);
+    
+    /**
+     * Adds new attributes to fota table for enabling suspend and resume of download. They include - 
+     * DM session type, IAP used during download, total Package size and Update-after-download information.
+     * 
+     * @since   S60   v3.2
+     * @return  None
+     */
+    void AlterTableIfRequiredL();
+    
+    /**
+     * Sets the retry count from the cenrep
+     *
+     * @since   S60   v5.0
+     * @param   package state
+     * @return  None
+     */
+    
+    void SetRetryCount(TPackageState& aState);
+    
+    /**
+     * Determines the char need for db queries
+     *
+     * @since   S60   v5.0
+     * @param   aChangedFields change fields
+     * @param   aState package states
+     * @param   aPkgURL
+     * @return  None
+     */    
+    TInt DetermineCharNeeded(TInt aChangedFields,TPackageState& aState,const TDesC8& aPkgURL);
+
+private:
+
+    /**
+     * File server session
+     */
+    RFs iFSSession;
+
+    
+    /**
+     * Reference to database
+     */
+    RDbNamedDatabase iStateDB;
+
+
+    /**
+     * Columns
+     */
+    CDbColSet* iColSet;
+
+
+    /**
+     * Table
+     */
+    RDbTable iTable;
+
+    /**
+    * Is the db open?
+    */
+    TBool iIsOpen;
+
+    /**
+     * Is fota table alter done?
+     */
+    TBool iTableAltercheck;
+    };
+
+#endif // FOTADB_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaDLProgressDlg.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* 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:   header file fot CFotaDLProgressDlg class
+*
+*/
+
+
+
+#ifndef CFOTADLPROGRESSDLG_H
+#define CFOTADLPROGRESSDLG_H
+
+// INCLUDES
+#include <AknProgressDialog.h>
+
+// Set to progress bar, when download starts
+const TInt  KInitialProgressFinalValue( 100 );
+
+// Constant to identify the type of progress note displayed at that moment
+enum {
+	EDownloadingNote=0,	//downloading note is shown
+	EConnectingNote		//connecting note is shown
+};
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+
+/**
+ *  Dialog observer interface
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+class MDLProgressDlgObserver
+    {
+public:
+    
+    /**
+    * Called when the dialog is going to be closed.
+    *
+    * @since S60 v3.1
+    * @param aButtonId    Id of the button, which was used to cancel 
+    *                       the dialog.
+    * @return TBool Can dlg be exited
+    */
+    virtual TBool HandleDLProgressDialogExitL( TInt aButtonId ) = 0;    
+    };
+
+
+/**
+ *  Progress dialog for download.
+ *
+ *  @lib    fotaserver.exe
+ *  @since  S60 v3.1
+ */
+NONSHARABLE_CLASS(CFotaDLProgressDlg) : public CAknProgressDialog
+    {
+
+public:
+
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.1
+     * @param aSelfPtr              Pointer to self
+     * @param aVisibilityDelayOff   Visibility in delay
+     * @param aObserver             Observer
+     * @return None
+     */
+    CFotaDLProgressDlg( CEikDialog** aSelfPtr, TBool aVisibilityDelayOff
+                        , MDLProgressDlgObserver* aObserver, TInt aNoteType);
+
+    virtual ~CFotaDLProgressDlg();
+
+    /**
+     * Offers key event for progress dialog.
+     *
+     * @since S60 v3.1
+     * @param aKeyEvent             Key event
+     * @param aType                 Event type
+     * @return None
+     */
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+public: // from base classes
+    
+
+    /**
+     * From CEikDialog, respond to softkey inputs.
+     *
+     * @since S60 v3.1
+     * @para aButtonId, type of pressed Button or Softkey
+     * @return TBool, ETrue if exit the dialog, otherwise EFalse.
+     */
+    TBool OkToExitL( TInt aButtonId );
+
+    /**
+     * Type of note shown or displayed
+     */
+    const TInt iNoteType;
+private: // data
+
+    /**
+     * Progress dialog observer
+     */
+    MDLProgressDlgObserver* iObserver;
+
+    };
+
+#endif //
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaNetworkRegStatus.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,168 @@
+/*
+* 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:   GPRS and Wlan status getter for sending Generic Alerts
+*
+*/
+
+
+
+#ifndef __FOTANETWORKREGSTATUS_H__
+#define __FOTANETWORKREGSTATUS_H__
+
+// SYSTEM INCLUDES
+#include <e32base.h>
+#include <rconnmon.h>
+
+//Forward declarations
+class CFotaServer;
+
+//Constants used in this class
+
+const TTimeIntervalMicroSeconds32 KTimeInterval = 1000000; //1 second, duration between each retry.
+const TInt KRetries = 10; //Maximum number of retries.
+
+/**
+* Actice object class that runs a timer for probing network status (GPRS & WLAN)
+*  @lib    fotaserver
+*  @since  S60 v3.2
+*/
+NONSHARABLE_CLASS (CFotaNetworkRegStatus) : public CActive
+	{
+	public:
+		//Symbian 2-Phase construction
+		
+		static CFotaNetworkRegStatus* NewL(CFotaServer* aObserver);
+		static CFotaNetworkRegStatus* NewLC(CFotaServer* aObserver);
+
+       /**
+        * Destructor.
+        */      
+		virtual ~CFotaNetworkRegStatus();
+
+	public: 
+		/**
+	     * Starts monitoring for Network status before sending Generic Alert
+		 *
+     	 * @since   S60   v3.2
+     	 * @param   None
+     	 * @return  None
+     	 */
+
+		void StartMonitoringL();
+		
+		/** 
+	     * Checks whether the network connection possible with the IAP Id provided
+		 *
+     	 * @since   S60   v3.2
+     	 * @param   None
+     	 * @return  ETrue if yes, EFalse when not possible
+     	 */
+		TBool IsConnectionPossibleL(TInt aIapid);
+		
+    public: // Functions from base classes
+		/**
+        * From CActive,DoCancel.
+        */
+		void DoCancel();
+
+		/**
+        * From CActive,RunL.
+        */
+	    void RunL();
+
+		/**
+        * From CActive,RunError.
+        */
+		TInt RunError(TInt aError);
+		
+	private: //functions
+		
+		//Constructors
+		
+		CFotaNetworkRegStatus();
+		CFotaNetworkRegStatus(CFotaServer* aObserver);
+
+		//Symbian 2-Phase construction 
+		void ConstructL();
+		
+		/**
+	     * Checks GlobalRFs status
+		 *
+     	 * @since   S60   v3.2
+     	 * @param   None
+     	 * @return  ETrue if success, EFalse if failure
+     	 */
+		TBool CheckGlobalRFState();
+
+		/**
+	     * Checks Network status, basically Network Registration
+		 *
+     	 * @since   S60   v3.2
+     	 * @param   None
+     	 * @return  ETrue if success, EFalse if failure
+     	 */
+		TBool CheckNetworkRegStateL();
+		
+		
+		/**
+	     * Checks Wlan status
+		 *
+     	 * @since   S60   v3.2
+     	 * @param   None
+     	 * @return  ETrue if success, EFalse if failure
+     	 */
+		TBool IsWlanSupportedL();
+		
+	    /**
+	     * To find the bearer of the IapId
+	     *
+	     * @since   S60   v3.2
+	     * @param   aIapId
+	     * @return  ETrue/EFalse
+	     */
+	    TUint32 FindBearerL(TInt aIapId);
+
+	
+	private: // data
+	
+	    /**
+	     * timer used for monitoring
+	     */
+		RTimer iTimer;
+		
+	    /**
+	     * S60 monitory class used for monitoring network status
+	     */
+		RConnectionMonitor iMonitor;
+	
+	    /**
+	     * FotaServer
+    	 */
+		CFotaServer* iObserver;
+	
+	    /**
+	     * Number of retries
+    	 */
+		TInt iRetriesLeft;
+	
+		
+	    /**
+    	 * GlobalRFs state
+     	 */
+		TBool iGlobalRFState;
+	};
+
+#endif // __FOTANETWORKREGSTATUS_H__
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaReminderDlg.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* 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:   Header file for CFotaReminderDlg
+*
+*/
+
+
+
+#ifndef CFOTAREMINDERDLG_H
+#define CFOTAREMINDERDLG_H
+
+#include <AknCapServerClient.h>
+#include <aknradiobuttonsettingpage.h>
+
+
+class CFotaReminderDlg: public CAknRadioButtonSettingPage
+	{
+	public: //Constructors & destructors
+	
+	/**
+    * Two-phased constructor.
+    */
+	static CFotaReminderDlg* NewLC(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent);
+	static CFotaReminderDlg* NewL(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent);
+	
+	/**
+    * Destructor
+    */	
+	~CFotaReminderDlg();
+	
+	/**
+    * Two-phased constructor.
+    */
+	virtual	void ConstructL();
+	
+	public:	//other methods
+
+	/**
+    * Used to activate the radiobuttonsettingpage.
+    * @param None
+    * @return None
+    */
+	void ActivateL();
+
+	/**
+    * Process events from softkeys
+    * @param aCommandId is the command id
+    * @return None
+    */
+	virtual void ProcessCommandL( TInt aCommandId );
+	
+	/**
+	* This routine routes the keys to the editor.
+	* @param aKeyEvent is the key event
+	* @param aType is the type of key event
+	* @return indicates whether or not the key event was used by this control. 
+	*/
+	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+	
+	private:
+	
+	/**
+	* Constructor
+	*/
+	CFotaReminderDlg(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent);
+    
+    /**
+    * From CEikDialog: Determines if the dialog can be closed.
+    * @param aButtonId Identifier of the button pressed.
+    * @return whether to close the dialog or not.
+    */
+    TBool OkToExitL( TInt aButtonId );
+
+    /**
+    * Suppress the menu/app key when reminder dialog is displayed
+    * @param ETrue to Suppress, else EFalse
+    * @return None
+    */
+	
+	void SuppressAppKey(TBool aValue);
+
+	private:	//data
+	
+    CAknSetStyleListBox* iList;
+    
+	//UI Server used for suppressing the menu/app key
+	RAknUiServer iAppKeyClient;
+	
+	//Stores the user selected item on the radio button page
+	TInt& iSelectedItem;
+	
+	//Stores the key event generated on radio button page
+	TInt& iEvent;
+	
+	//Holds the state of menu/app key supress
+	TBool iIsAppKeySuppressed;
+	};
+
+#endif //CFOTAREMINDERDLG_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaServer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,875 @@
+/*
+* 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:   Header file for CFotaServer
+*
+*/
+
+
+
+#ifndef __FOTASERVER_H__
+#define __FOTASERVER_H__
+
+// INCLUDES
+#include <AknDoc.h>
+#include <aknapp.h>
+#include <AknServerApp.h>
+#include <coemain.h>
+#include <s32file.h>
+#include <DocumentHandler.h>
+#include <apmstd.h>
+#include <e32property.h>
+#include <SyncMLClient.h>
+#include <SyncMLClientDM.h>
+#include <hwrmpowerstatesdkpskeys.h>
+#include <SyncMLNotifier.h>
+#include <SyncMLNotifierParams.h>
+#include <SyncMLObservers.h>
+#include <fotastorage.h>
+#include <starterclient.h>
+
+#include "fotaserverPrivateCRKeys.h"
+
+#include "FotaIPCTypes.h"
+#include "FotaDB.h"
+#include "fotaConst.h"
+#include "fotadownload.h"
+#include "fotaupdate.h" 
+#include "fmsclient.h"	//The FMS Client header file
+
+
+//Forward declarations
+class CDevEncController;
+
+enum TOmaDmLrgObjDl
+{
+    EOmaDmLrgObjDlFail = 1,
+    EOmaDmLrgObjDlExec
+};
+_LIT (KSWversionFile, "swv.txt");
+/** Timeout to let cfotadownloader callstack to empty*/
+const TInt KDownloadFinalizerWaitTime(1000000);
+
+/** Time interval between syncml session retry attempts*/
+const TInt KSyncmlSessionRetryInterval(60000000);
+
+/** shutdown timer */
+const TTimeIntervalMicroSeconds32 KFotaTimeShutDown(10000000);
+
+/** How many times generic alert sending should be tried in row. */
+const TInt KSyncmlAttemptCount = 3;
+
+/** This P&S Key is used to notify DM UI on any download event. key=0 for idle and key=1 for download */ 
+const TUint32 KFotaDownloadState = 0x00000001;
+
+/** If download is active this P&S key is set to ETrue, otherwise EFalse. 
+ * The key is owned by omadmappui**/
+const TUint32 KFotaDownloadActive = 0x00000008;
+
+/** The P&S key to say DM UI to perform refresh of UI elements */
+const TUint32 KFotaDMRefresh = 0x00000009;
+
+enum {
+	ENo=0,
+	EYes
+};
+
+//Constants used when update happen NSC/DM 
+enum {
+		EFotaUpdateNSC=1,
+		EFotaUpdateNSCBg,
+		EFotaUpdateDM
+};
+
+_LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData );
+_LIT_SECURITY_POLICY_C1( KWritePolicy, ECapabilityWriteDeviceData );
+_LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+
+//Constants for Device Encryption operation
+enum TDEOperations
+    {
+    EIdle = 0,
+    EEncryption,
+    EDecryption,
+    EDecryptionPending
+    };
+// FORWARD CLASS DECLARATION
+
+class CFotaServer;
+class CFotaDownload;
+class CFotaUpdate;
+class CFotaSrvApp;
+class CFotaNetworkRegStatus;
+/**
+* Fota server. Handles client requests. Starts download and/or update.
+ *
+ *  This class is 
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+NONSHARABLE_CLASS( CFotaServer ) : public CAknAppServer, MSyncMLEventObserver
+	{
+    friend class  CFotaSrvSession;
+    friend class  CFotaDownload;
+    friend class  CFotaUpdate;
+
+public:
+
+    /**
+    * C++ default constructor.
+    */
+	CFotaServer();
+    
+    /**
+    * Destructor.
+    */		
+	virtual ~CFotaServer();
+
+public: // New functions
+
+
+    /**
+     * Create database
+     *
+     * @since   S60   v3.1
+     * @param   aLargObj    Is it largeobject download (or dlmgr download)
+     * @param   aPkgId      Packageid of the download
+     * @return  none
+     */
+    void UpdatePackageDownloadCompleteL( TBool aLargObj,const TInt aPkgId);
+ 
+ 
+    /**
+     * Check s/w version with the current version
+     *
+     * @since   S60   v3.2
+     * @param   none
+     * @return  Bool value(matches or not)
+     */
+     TBool CheckSWVersionL();
+     
+    /**
+     * Start download
+     *
+     * @since   S60   v3.1
+     * @param   aParams     Package state params to be save in db
+     * @param   aPkgURL     URL
+     * @return  none
+     */
+    void DownloadL(TDownloadIPCParams aParams,const TDesC8& aPkgURL);
+
+
+    /**
+     * Start download which finishes with update
+     *
+     * @since   S60   v3.1
+     * @param   aParams     Package state params to be save in db
+     * @param   aPkgURL     URL
+     * @return  none
+     */
+    void DownloadAndUpdateL(TDownloadIPCParams aParams
+            ,const TDesC8& aPkgURL);
+
+
+
+    /**
+     * Start update
+     *
+     * @since   S60   v3.1
+     * @param   aParams     Package state params to be save in db
+     * @return  none
+     */    
+    void UpdateL( const TDownloadIPCParams& aParams );
+
+
+
+    /**
+     * Update, triggered by scheduler
+     *
+     * @since   S60   v3.1
+     * @param   aUpdate     Update details
+     * @return  none
+     */ 
+    void ScheduledUpdateL( TFotaScheduledUpdate aUpdate );
+
+    /**
+     * Delete swupd package
+     *
+     * @since   S60   v3.1
+     * @param   aPkgId  Package id
+     * @return  none
+     */    
+    void DeletePackageL ( const TInt aPkgId);
+
+
+
+    /**
+     * Get state of a swupd package
+     *
+     * @since   S60   v3.1
+     * @param   aPkgId  Package id
+     * @return  Package state
+     */       
+    TPackageState GetStateL( const TInt aPkgId);
+
+
+    /**
+     * Open a store to save swupd into
+     *
+     * @since   S60   v3.1
+     * @param   aMessage    containing client side chunk handle  
+     * @return  None
+     */       
+    void OpenUpdatePackageStoreL ( const RMessage2& aMessage );
+
+    /**
+     * Gets the downloaded and complete size of the update package
+     *
+     * @since   S60   v3.2
+     * @param   aPkgId    Package id
+     * @param	aDownloadedSize		size of download package in bytes
+     * @param	aTotalSize	size of the complete package in bytes
+     * @return  None
+     */       
+    void GetDownloadUpdatePackageSizeL (const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize);
+
+    /**
+     * Tries to resume the download.
+     *
+     * @since   S60   v3.2
+     * @param   aQueryUser	Whether to query user for resume?
+     * @return  None
+     */       
+	void TryResumeDownloadL(TBool aQueryUser);
+
+    /**
+     * Invoke Fota Monitory Service when the download gets suspended
+     *
+     * @since   S60   v3.2
+     * @return  None
+     */       
+	void InvokeFmsL();
+	
+    /**
+     * Cancels any outstanding request for resume notification
+     *
+     * @since   S60   v3.2
+     * @return  None
+     */       
+	void CancelFmsL();
+	
+    /**
+     * Sets the phone's startup reason. This is used by Fota Startup Pluggin to any decision.
+     *
+     * @since   S60   v3.2
+     * @param   aReason		Startup reason, either download interrupted
+     * @return  None
+     */       
+	void SetStartupReason(TInt aReason);
+	
+	/**
+	 * Shutdown DM UI application
+	 * @since	S60	 v3.2
+	 * @return 	None
+	 */
+	void ShutApp();
+	
+	/**
+	 * Stops ongoing download, if any.
+	 * @since	S60	 v3.2
+	 * @param	aReason		Reason for stopping the download.
+	 * @return 	None
+	 */
+	void StopDownload(TInt aReason);
+	
+    /**
+     * Read data from chunk
+     *
+     * @since   S60   v3.1
+     * @param   aSize   Size of data
+     * @param   aError error caught while writing data into FS
+     * @return  none
+     */
+    void ReadChunkL ( const TInt aSize ,TInt aError );
+
+
+    /**
+     * Check if swupd package fits into store
+     *
+     * @since   S60   v3.1
+     * @param   aSize   Size of swupd
+     * @return  Does it fit?
+     */
+    TBool IsPackageStoreSizeAvailableL ( const TInt aSize );
+
+
+    /**
+     * Get ids of present swupd packages
+     *
+     * @since   S60   v3.1
+     * @param   aPackageIdList  On return, ids will be here
+     * @return  None
+     */
+    void  GetUpdatePackageIdsL(TDes16& aPackageIdList);
+
+
+    /**
+     * Get time of last update
+     *
+     * @since   S60   v3.1
+     * @param   aTime       On return, time of last update
+     * @return  None
+     */
+    void GetUpdateTimeStampL (TDes16& aTime) ; 
+
+
+    /**
+     * Set download to be finalized. 
+     *
+     * @since   S60   v3.1
+     * @param   aDLState    Final state of the download
+     * @return  None
+     */
+    void  FinalizeDownloadL( const TPackageState& aDLState );
+
+
+    /**
+     * Set update to be finalized. 
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  None
+     */
+    void  FinalizeUpdateL();
+
+    /**
+     * Monitors for the battery in case of USB charger
+     *
+     * @since   S60   v3.2.3
+     * @param   aLevel - level of the battery charge to monitor
+     * @return  None
+     */
+    void MonitorBattery(TInt aLevel);
+
+    /**
+     * Finalize download
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  None
+     */
+    void  DoFinalizeDownloadL();
+
+
+    /**
+     * Finalize Update
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  None
+     */
+    void  DoFinalizeUpdateL();
+
+
+    /**
+     * Read update result file and report result back to DM server
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  None
+     */
+    void  DoExecuteResultFileL();
+    
+    /**
+     * Deletes the update result file
+     *
+     * @since   S60   v3.2
+     * @param   None
+     * @return  None
+     */
+    void  DoDeleteUpdateResultFileL();
+
+    /**
+    * Close syncml session
+    *
+    * @since   S60 v3.1
+    * @param none
+    * @return none
+    */
+    void DoCloseSMLSessionL();
+
+    /**
+     * Shutdown fotaserver, if there's no operations in progress (
+     * download,update)
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  Error
+     */
+    TInt TryToShutDownFotaServer();
+
+
+    /**
+     * Get reference to storageplugin. Load it, if not existing
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  Reference to storage
+     */
+    CFotaStorage*   StoragePluginL();
+
+    
+    /**
+     * Do cleanup for package
+     *
+     * @since   S60   v3.1
+     * @param   aPackageID Packageid
+     * @return  None
+     */
+    void GenericAlertSentL( const TInt aPackageID );
+
+
+    /**
+     * Create DM session to DM server (identified by profileid)
+     *
+     * @since   S60   v3.1
+     * @param   aProfileId  DM profile id
+     * @param   aIapid		IAP id. If not kerrnone, will be used instead
+     *						of profiles' IAP id.
+     * @return  none
+     */
+    void CreateDeviceManagementSessionL( TPackageState& aState );
+    
+    
+    /**
+     * Get profiles' data.
+     *
+     * @since   S60   v3.1
+     * @param   aSyncml     syncml session. must be open.
+     * @param   aProf 	    profile id.
+     * @param   aIapid      iapid 
+     * @param   aSrvAA      server alerted action
+     * @param   aUIJob      is current dm job started from ui
+     * @param	aSanVal		the SAN bit set by server for the DM Session
+     * @return  none
+     */    
+    void GetProfileDataL( RSyncMLSession* aSyncml,const TSmlProfileId aProf
+        , TInt& aIapId, TSmlServerAlertedAction& aSrvAA,TBool& aUIJob, TInt& aSanVal);
+
+	/**
+	 * Gets the EikonEnv object
+	 *
+	 * @since S60	v3.1
+	 * @param None
+	 * @return CEikonEnv
+	 */ 
+	CEikonEnv* GetEikEnv();
+
+
+	/**
+	 * Callback function to notify the network status
+	 *
+	 * @since S60	v3.2
+	 * @param Status of network connection
+	 * @return None
+	 */ 
+	void ReportNetworkStatus(TBool status);
+
+
+
+  /**
+	 * Get the software version of the device
+	 * @since S60	v3.2
+	 * @param s/w version 
+	 * @return error
+	 */
+	TInt GetSoftwareVersion(TDes& aVersion);
+	
+	/**
+	 * Incase of large object download failure
+	 * Updates the fota database state & reason information
+	 * @since S60	v3.2
+	 * @param None
+	 * @return None
+	 */
+	void UpdateDBdataL();
+
+    /**
+     * stores the client id who triggered the update
+     * @since S60   v3.2
+     * @param aClient, client Id
+     * @return None
+     */ 	
+	void SetInstallUpdateClientL(TInt aClient);
+	
+	/**
+	 * returns the client id,who triggered the update
+	 * @since S60   v3.2
+	 * @param None
+	 * @return TInt
+	 */ 
+	TInt GetInstallUpdateClientL();	
+	
+	
+	/**
+	 * Checks for IAP Id exists or not in commsdb
+	 * IAPId used for resuming the paused download
+	 * @since S60   v5.0
+	 * @param IapId
+	 * @return ETrue/EFalse
+	 */
+	TBool CheckIapExistsL(TUint32 aIapId);
+	
+    /**
+     * This method is called to check if dencryption needs to be performed.
+     */
+	TBool NeedToDecryptL(const TInt &aPkgId, TDriveNumber &aDrive);
+	
+    /**
+     * This method is called to start the decryption operation.
+     */
+	void DoStartDecryptionL();
+	
+    /**
+     * This method is called once the decryption operation is complete.
+     */
+    void HandleDecryptionCompleteL(TInt aResult, TInt aValue = 0);
+    
+    /**
+     * This method is called to check if encryption needs to be performed.
+     */
+    TBool NeedToEncryptL(TDriveNumber &aDrive);
+    
+    /**
+     * This method is called to start the encryption operation.
+     */
+    void DoStartEncryptionL();
+	
+    /**
+     * This method is called once the encryption operation is complete.
+     */
+	void HandleEncryptionCompleteL(TInt aResult, TInt aValue = 0);
+	
+    /**
+     * Gets the device encryption operation
+     */
+	TInt GetDEOperation();
+	
+    
+    /**
+     * Is server initialized? Must be public for session to use.
+     */
+    TBool iInitialized;
+
+    /**
+    * Whether Fota server should close or not
+    */
+    TBool iNeedToClose;
+    
+    /**
+     * handles notifier completion
+     */
+    CFotaDownloadNotifHandler*  iNotifHandler;
+
+public: // from  base classes
+
+    /**
+     * Creator
+     * Not own
+     */
+    CFotaSrvApp* iParentApp;
+
+    /**
+    * CreateServiceL. Creates session.
+    * @param    aServiceType
+    * @return   CApaAppServiceBase*
+    */
+    CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const;
+    /**
+    * Handle syncml event
+    * @param    aEvent
+    * @param    aIdentifier
+    * @param    aError
+    * @param    aAdditionalData
+    * @return   none
+    */
+    void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData) ;
+
+    /**
+     * Reference to client side chunk.  Swupd comes this way.
+     */
+    RChunk iChunk;
+
+
+    /**
+     * Used for package state saving.
+     */
+    CFotaDB* iDatabase;
+
+
+    /**
+     * Used for downloading.
+     */
+    CFotaDownload* iDownloader;
+
+
+    /**
+     * Used for starting update of fw.
+     */
+    CFotaUpdate* iUpdater;
+
+
+    /**
+     * Used for deleting download.
+     */
+    CPeriodic* iDownloadFinalizer;
+
+
+    /**
+     * Used for deleting update.
+     */
+    CPeriodic*          iUpdateFinalizer;
+
+
+    /**
+     * Used for reading result file.
+     */
+    CPeriodic*          iTimedExecuteResultFile;
+
+
+    /**
+     * Used for closing syncml session
+     */
+    CPeriodic* iTimedSMLSessionClose;
+
+    /**
+     * ConstructL
+     *
+     * @since   S60   v3.1
+     * @param   aFixedServerName    Name of this app server 
+     * @return  none
+     */    
+    virtual void ConstructL(const TDesC &aFixedServerName);
+
+protected: // from base classes
+
+
+    /**
+     * DoConnect. 
+     *
+     * @since   S60   v3.1
+     * @param   aMessage    IPC message
+     * @return  none
+     */
+    void DoConnect(const RMessage2& aMessage);
+
+
+    /**
+     * When last client disconnects, this is called.
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    void HandleAllClientsClosed();
+
+    
+private: // new functions
+
+
+    /**
+     * Latter part of constructing. It's ensured that parent fotaserver is 
+     * constructed only once, and child fotaserver is not constructed at all.
+     * Client fotaserver has a task of saving swupd as its only task. It should
+     * not update swupd states.
+     *
+     * @since   S60   v3.1
+     * @param   aMessage    Client process details
+     * @return  none
+     */
+    void ClientAwareConstructL( const RMessage2 &aMessage );
+
+
+    /**
+     * Loads storage plugin if not loaded.
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    void            LoadStoragePluginL ();
+
+
+    /**
+     * Unloads storage plugin.
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    void            UnLoadStoragePluginL ();
+
+
+
+/**
+	 * Resets the fota state
+	 * @since S60	v3.2
+	 * @param IPC params
+	 * @return None
+	 */
+	 
+	void ResetFotaStateL(const TDownloadIPCParams& aParams);
+	
+	/**
+	 * Starts network monitoring operaiton for defined interval and retries
+	 *
+	 * @since S60	v3.2
+	 * @param None
+	 * @return None
+	 */ 
+	void StartNetworkMonitorL();
+
+
+private: // Data
+
+
+    /**
+     * The state that iDownloader was in, when it called to be finalized.
+     */
+    TPackageState       iDLFinalizeState;
+
+    /**
+     * The state before sending generic alert.
+     */
+    TPackageState		iStoredState;
+
+
+    /**
+     * Storage class (plugin).
+     */
+    CFotaStorage*       iStorage;
+
+
+    /**
+     * Packageid of the swupd being stored. Used only by child fotaserver.
+     */
+    TInt                iStorageDownloadPackageId;
+
+
+    /**
+     * Destructor key of the storage plugin.
+     */
+    TUid                iStorageDtorKey;
+
+
+    /**
+     * Destructor key of the storage plugin.
+     */
+    RWriteStream*       iStorageStream;
+
+
+    /**
+     * File server session
+     */
+    RFs                 iFs;
+
+
+    /**
+     * Tries to periodically shut down fotaserver
+     */
+    CPeriodic*          iAppShutter;
+
+    /**
+     * Syncmlsession for creating dmsession
+     */
+    RSyncMLSession      iSyncMLSession;
+
+    /**
+     * Class that checks for network availability 
+     * 
+     */
+    CFotaNetworkRegStatus* iMonitor;
+
+    /**
+     * How many times to try dm session
+     */
+    TInt    iSyncMLAttempts;
+
+    /**
+     * sync job id
+     */
+    TSmlJobId iSyncJobId;
+
+    /**
+     * profile
+     */
+    TSmlProfileId iSyncProfile;
+
+    /**
+     * Reference to eikonenv. Used by other classes
+     * 
+     */
+    CEikonEnv*	iEikEnv;
+
+    /**
+     * To tell whether Generic Alert sending is being retried or not. This is checked before shutting down fota server
+     * 
+     */
+    TBool iRetryingGASend;
+
+    /**
+     * To tell whether network is available to send Generic Alert.
+     * 
+     */
+    TBool iNetworkAvailable;
+
+    /**
+     * The Fota Monitory Client object
+     */
+    RFMSClient	iFMSClient;
+    
+    /**
+     * For sending GA, this will set to fotastate's iapid
+     */
+    TInt iIapId;
+    /**
+     * Tells the session mode.
+     */
+    TInt iSessMode;
+    
+    /**
+     * Tells about who started resume.
+     */
+    TInt iUserResume;
+    
+    /**
+     * Tells which client triggered install update.
+     */
+    TInt iInstallupdClient;
+    
+    /**
+     * The pointer to encryption controller
+     */
+    CDevEncController *iDEController;
+    
+    /**
+     * Holds the storage drive of the package.
+     */
+    TDriveNumber iStorageDrive;
+    
+	};
+
+#endif 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaSrvApp.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* 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:   Header file for CFotaSrvApp
+*
+*/
+
+
+
+
+#ifndef __FOTASRVAPP_H_
+#define __FOTASRVAPP_H_
+
+// INCLUDES
+#include <eikapp.h>
+#include <aknapp.h>
+#include "FotaServer.h"
+#include "FotaSrvUI.h"
+#include "fotaConst.h"
+
+// CLASS DECLARATION
+
+/**
+* Fota server application
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+class CFotaSrvApp : public CAknApplication
+    {
+
+public:
+	CFotaServer* Server();
+
+    CFotaSrvApp();
+
+    virtual ~CFotaSrvApp();
+
+    /**
+     * Show or hide UI
+     *
+     * @since   S60   v3.1
+     * @param   aVisible    Tells whether to hide / show the ui
+     * @return  none
+     */
+    void SetUIVisibleL( const TBool aVisible, const TBool aAlsoFSW=EFalse);
+
+private:
+    /**
+    * From CApaApplication, creates FotaSrvDocument document object.
+    * @since   S60   v3.1
+    * @param    None    
+	* @return A pointer to the created document object.
+	*/
+    CApaDocument* CreateDocumentL();
+    
+    /**
+    * From CApaApplication, returns application's UID (KUidFotaServer).
+    * @since   S60   v3.1
+    * @param    None
+	* @return   The value of KUidFotaServer.
+    */
+    TUid AppDllUid() const;
+    
+    /**
+    * From CApaApplication
+    * @since   S60   v3.1
+    * @param   aAppServer returned server
+	* @return  None
+    */
+    void NewAppServerL( CApaAppServer*& aAppServer );
+
+private:
+
+
+    /**
+     * Fota server.
+     * Own. 
+     */
+    CFotaServer*    iFotaServer;
+
+
+    /**
+     * Document
+     * Own. 
+     */
+    CFotaSrvDocument* iDocument;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaSrvDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* 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 file defines logging macros 
+*
+*/
+
+
+
+#ifndef FOTADEBUG_H
+#define FOTADEBUG_H
+
+    // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
+    #ifdef _DEBUG
+    #define _FOTA_DEBUG
+    #endif
+    #ifdef _FOTA_DEBUG
+
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "fotaserver.log" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+#endif      // FOTADEBUG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaSrvDocument.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* 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:   Header file for CFotaSrvDocument
+*
+*/
+
+
+
+
+#ifndef CFOTASRVDOCUMENT_H
+#define CFOTASRVDOCUMENT_H
+
+// INCLUDES
+#include <aknapp.h>
+#include <AknDoc.h>
+#include <eikenv.h>
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CEikEnv;
+class CNSmlDMSyncProfileList;
+
+// CLASS DECLARATION
+
+/**
+ *  CFotaSrvDocument application class.
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+class CFotaSrvDocument : public CAknDocument
+    {
+public: 
+
+    /**
+    * Two-phased constructor.
+    */
+    static CFotaSrvDocument* NewL(CAknApplication& aApp);
+
+    /**
+    * Destructor.
+    */
+    virtual ~CFotaSrvDocument();
+
+public: // New functions
+
+	/**
+	* Getter fo CEikAppUi class
+	* @param    None
+	* @return   Pointer to the CEikAppUi
+	*/
+	CEikAppUi* AppUi() const { return iAppUi; }
+
+private:
+
+
+  	/**
+	* Constructor
+	* @param    aApp Used by akndocument
+	* @return   None
+	*/
+    CFotaSrvDocument( CEikApplication& aApp ): CAknDocument( aApp ) { }
+
+
+    void ConstructL();
+
+
+  	/**
+	* From CEikDocument, create CFotaSrvUi "App UI" object.
+	* @param    None
+	* @return   UI
+	*/
+    CEikAppUi* CreateAppUiL();
+
+    
+private:
+
+    /**
+     * Reference to eikonenv
+     * 
+     */
+	//CEikonEnv*                          iEikEnv;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotaSrvUI.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* 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:   Header file for CFotaSrvUi
+*
+*/
+
+
+
+#ifndef CFOTASRVUI_H
+#define CFOTASRVUI_H
+
+#include <bldvariant.hrh>
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknappui.h>
+#include <eikdialg.h>
+#include <eikmenup.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <aknnavilabel.h>
+#include <akntitle.h>
+#include <AknProgressDialog.h>
+
+#include "FotaSrvDocument.h"
+#include "fotaConst.h"
+
+// FORWARD DECLARATIONS
+
+/**
+ *  Application UI class 
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+class CFotaSrvUi : public CAknAppUi
+    {
+public: // Constructors and destructor
+
+    void ConstructL();
+
+    virtual ~CFotaSrvUi();
+    
+private: // from base classes
+   
+
+	/**
+    * @param aResourceId        
+	* @param aMenuPane
+    * @return none
+    */
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+
+    /**
+    * From CEikAppUi, takes care of command handling.
+    * @param aCommand id of the  command to be handled
+	* @return None 
+    */
+    void HandleCommandL(TInt aCommand);
+
+
+    /**
+    * From CEikAppUi, handles key events.
+    * @param aKeyEvent  Event to handled.
+    * @param aType   Type of the key event. 
+    * @return Reponse code (EKeyWasConsumed, EKeyWasNotConsumed). 
+    */
+    virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent
+                    , TEventCode aType );
+
+    /**
+    * From CAknAppUi, handles file change.
+    * @param aFileName New file to be opened.
+    * @return None
+    */
+	void OpenFileL( const TDesC& aFileName );
+
+
+    /**
+    * From CAknAppUi, Preparing to close server
+    * @param None
+    * @return None
+    */
+   void PrepareToExit();
+
+private: //Data
+	
+	/**
+	 * Should Fota operation close on an system event (ex. MMC card removal)?
+	 */
+	TBool iNeedToClose;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/FotasrvSession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* 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:   Represent client's session at serverside
+*
+*/
+
+
+
+#ifndef CFOTASRVSESSION_H
+#define CFOTASRVSESSION_H
+
+// INCLUDES
+#include <eikdoc.h>
+#include <AknServerApp.h>
+#include <fotaengine.h>
+#include "FotaServer.h"
+
+// CLASS DECLARATION
+/**
+ *  Fotaserver's session class
+ *
+ *  @lib    fotaserver.exe
+ *  @since  S60 v3.1
+ */
+class CFotaSrvSession : public CAknAppServiceBase
+	{
+public:
+
+    enum TClient
+	    {
+        EUnknown = 0,
+        EDMHostServer = 1,
+        EOMADMAppUi = 2,
+        EFotaServer  = 3,
+        EStarter  = 4,
+        EFMSServer = 5,
+        EFotaTestApp = 6,
+	ESoftwareChecker = 7,
+	ESoftwareCheckerBackground = 8
+        };
+
+	CFotaSrvSession( );
+	
+    /**
+	* C++ Destructor
+	*/
+	virtual ~CFotaSrvSession();
+
+    /**
+    * Getter for fotaserver
+    *
+    * @since   S60   v3.1
+    * @param   None
+    * @return  Fotaserver
+    */
+    CFotaServer*    FotaServer() const;
+
+public: // new functions
+
+    /**
+    * Checks client secure id (dmhostserver,fotaserver,fotatester) 
+    *
+    * @since   S60   v3.1
+    * @param   Message containing client details
+    * @return  is it fotaserver
+    */
+    static TClient CheckClientSecureIdL (const RMessage2& aMessage);
+
+protected: // from CSession2
+
+    /**
+    * CreateL
+    *
+    * @since   S60   v3.1
+    * @param   none
+    * @return  None
+    */
+    void CreateL();
+	
+	
+    /**
+    * service client request
+    *
+    * @since   S60   v3.1
+    * @param   aMessage     message containing client request details
+    * @return  None
+    */
+    void ServiceL( const RMessage2& aMessage );
+	
+
+    /**
+    * Handle service error
+    *
+    * @since   S60   v3.1
+	* @param aMessage  Msg that resulted in error
+	* @param aError    Error code
+	* @return None
+	*/
+	void ServiceError( const RMessage2& aMessage, TInt aError );
+
+private:
+     /**
+     * Error caught while writing data into FS
+     */ 
+     TInt iError ;
+
+    /**
+     * document
+     */
+	//CEikDocument*   iDoc;
+	};
+
+
+#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/fotaUpdateAgentComms.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* 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:   Update agent result codes
+*
+*/
+
+
+
+
+#ifndef __COMMUNICATION_BETWEEN_NORMAL_AND_UPDATE_MODE_H__
+#define __COMMUNICATION_BETWEEN_NORMAL_AND_UPDATE_MODE_H__
+
+
+typedef enum
+{
+
+    /*
+        Everything is ok - update package were installed successfully and 
+        newer version of OS is running.
+    */
+	UPD_OK=0,
+    /*
+        Problem: The request sent to update installer were invalid - probable issue in
+        Download agent.
+        
+        Solutions:
+            - Probable: Download agent created an invalid file.
+              Fix download agent.
+            - Inprobable: Corrupted request file, or FAT
+    */
+    UPD_INSTALL_REQUEST_IS_INVALID=1,
+    /*
+        Problem: Update package is absent from specified location.
+
+        Solution: Incorrect user application actions. 
+        Read update application document / manual on how to switch to 
+        update mode.
+    */
+    UPD_UPDATE_PACKAGE_IS_ABSENT=2,
+    /*
+        Problem: Update package is corrupted. (Integrity or authenticity 
+        check failed)
+        Solution: End-user should try to download again update package.
+    */
+	UPD_UPDATE_PACKAGE_IS_CORRUPTED=3,
+    /*
+        Problem: Update package contents is invalid for some reason.
+        This problem normally refers to the fact that update package
+        were created incorrectly.
+    
+        Solution: Contact update package build team in order to find out the 
+        error cause.
+    */
+	UPD_UPDATE_PACKAGE_CONTENTS_IS_INVALID=4,
+    /*
+        Problem: Update package is not compatible with current mobile device.
+        Solution: End-user should try to download again update package.
+    */    
+
+	UPD_UPDATE_PACKAGE_IS_NOT_COMPATIBLE_WITH_CURRENT_MOBILE_DEVICE=5,
+    /*
+        Problem: This error code will be used to indicate fatal error 
+        code after which phone becomes dead.
+    
+        Solution: Phone should be taken to maintenance.
+        This error code cannot be seen by normal mode applications 
+        because OS cannot be started when phone became dead.
+    */
+	UPD_FATAL_ERROR=0xFFFFFFFF
+} InstallationResult;
+
+
+typedef enum
+{
+    UPD_InvalidBlockHeaderIdentifier    =1,
+    UPD_InvalidUpdatePackageVersion     =2,
+    UPD_GenericInvalidFileFormat        =3
+} DetailedInstallationResult;
+
+
+
+#endif //__COMMUNICATION_BETWEEN_NORMAL_AND_UPDATE_MODE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/fotadownload.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,608 @@
+/*
+* 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:   Swupd downloader.
+*
+*/
+
+
+
+#ifndef ___DOWNLOADER_H_
+#define ___DOWNLOADER_H_
+
+#include <downloadmgrclient.h>
+#include <etelpckt.h> //To read GSM Error codes from symbian
+#include <exterror.h> //To read GSM Error codes from symbian
+#include <wlanerrorcodes.h> //To read WLAN Error codes from s60
+#include <AknWaitDialog.h>
+#include "FotaServer.h"
+#include "FotaSrvDebug.h"
+#include "FotaDLProgressDlg.h"
+
+// FORWARD DECLARATIONS
+class CFotaServer;
+class CAknWaitDialog;
+class CFotaDownloadNotifHandler;
+class CFotaNetworkRegStatus; 	//To know the network connectivity status while resuming suspended download
+// CONSTANTS
+ // from coderror.h
+#define KErrCodInvalidDescriptor -1000
+#define KErrCodInsufficientSpace -1001
+#define KErrCodWapConnectionDropped -20041
+
+// If download times out, it must be tried again
+#define KFotaDownloadTimeoutRestartCount 5
+
+// For reading connecting resource from DM UI
+_LIT( KSCPResourceFilename, "\\Resource\\Apps\\NsmlDMSync.rsc" );
+_LIT( KDriveZ,"z:" );
+_LIT( KDDDirPath, "c:\\system\\fota\\" );
+_LIT( KDDFilename, "fotadownload.dd" );
+
+//Constants when SAN Bits are set
+enum {
+		ESanNotSpecified=0,
+		ESanSilent,
+		ESanInformative,
+		ESanInteractive
+};
+
+//Contants when SAN is Off. It refers to Accepted state in DM Profile Settings
+enum {
+	EAcceptedNo=0,
+	EAcceptedYes
+};
+
+// Constants for KSilentOmaDlUIBehavior cenrep key
+ enum {
+ 		EOmacdOffdlprgOff=0, //OMA CD View = Off, Download Progress Bar = Off
+ 		EOmacdOffdlprgOn,    //OMA CD View = Off, Download Progress Bar = On
+ 		EOmacdOndlprgOff,    //OMA CD View = On,  Download Progress Bar = Off
+ 		EOmacdOndlprgOn,     //OMA CD View = On,  Download Progress Bar = On 
+ 		EChooseFromSan		 //Choose behavior from SAN bits set during DM Session
+ };
+/**
+ *  Downloader 
+ *
+ *  Starts download and observes it.
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+NONSHARABLE_CLASS (CFotaDownload ) 
+        : public CActive 
+        , MHttpDownloadMgrObserver
+        , MDLProgressDlgObserver
+    {
+    friend class CFotaDownloadNotifHandler;
+
+
+	enum TFotaDLProgress
+		{
+		EStarted,
+		EDescriptorDownloaded,
+		ESizeChecked
+		};
+		
+			
+public: // new functions
+
+    CFotaDownload ();
+
+    virtual ~CFotaDownload ();
+
+    static CFotaDownload* NewL (CFotaServer* aServer);
+
+public: // Functions from base classes:
+
+
+    /**
+     * Schedule update to be carried out after download
+     *
+     * @since   S60   v3.1
+     * @param   aButtonId Button pressed
+     * @return  None
+     */
+    TBool HandleDLProgressDialogExitL( TInt aButtonId );
+
+protected:  // Functions from base classes:
+    
+    /**
+     * Handle user action
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  None
+     */
+    virtual void RunL();
+
+
+     /**
+     * Handle leaving Runl
+     *
+     * @since   S60   v3.1
+     * @param   aError  error code
+     * @return  Error code
+     */
+    virtual TInt RunError(TInt aError);
+
+
+     /**
+     * Handle cancel of active object
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    void DoCancel();
+
+public:
+
+
+    /**
+     * Handle Download manager event
+     *
+     * @since   S60   v3.1
+     * @param   aDownload       download 
+     * @param   aEvent          event
+     * @return  none
+     */
+    virtual void HandleDMgrEventL( RHttpDownload& aDownload
+                        , THttpDownloadEvent aEvent );
+
+
+    /**
+     * Handle Download manager event
+     *
+     * @since   S60   v3.1
+     * @param   aDownload       download 
+     * @param   aEvent          event
+     * @return  none
+     */
+    void DoHandleDMgrEventL( RHttpDownload* aDownload
+                        ,THttpDownloadEvent aEvent );
+
+
+    /**
+     * Start download of swupd
+     *
+     * @since   S60   v3.1
+     * @param   aParams     download parameters
+     * @param   aPkgURL     Url of swupd
+     * @param   aUpdateAfterDownload     Is update needed
+     * @param   aIapid      Iap
+     * @param   aRestartDownload Is this a retry download (counter)? 
+     *                            If yes, don't show descriptor.
+     * @return  none
+     */
+    void DownloadL(TDownloadIPCParams aParams,const TDesC8& aPkgURL
+        ,TBool aUpdateAfterDownload,const TInt aIapid=KErrNotFound
+        ,const TInt aRestartDownload=0 );
+
+
+    /**
+     * Cancel
+     *
+     * @since   S60   v3.1
+     * @param   aCancelProgressBar  Cancel progress bar also?
+     * @return  none
+     */
+    void CancelDownload( const TBool aCancelProgressBar );
+
+    /**
+     * Tries to resume any suspended fota download by quering the user. When the DM session is
+     * Silent, this method directly starts resuming of download by calling ResumeDownloadL.
+     *
+     * @since   S60   v3.2
+     * @param   aUserInitiated  Is user initiated resume?
+     * @return  none
+     */
+    void TryResumeDownloadL(TBool aUserInitiated);
+    
+    /**
+     * Resumes any suspended fota download. Firstly, it retrieves the RHttpDownload download object from Download Manager
+     * and then performs the following - 
+     * - sets the IAP ID to use
+     * - checks whether the connection is possible with that IAP ID
+     * - sets download ui behavior
+     *
+     * @since   S60   v3.2
+     * @return  none
+     */
+    void ResumeDownloadL();
+    /**
+     * Finds whether the download is resumable or not.
+     *
+     * @since   S60   v3.2
+     * @return  ETrue if download is resumable, else EFalse.
+     */
+    TBool IsDownloadResumable();
+    
+    /**
+     * Finds whether Fota Monitory Service is enabled or not.
+     *
+     * @since   S60   v3.2
+     * @return  ETrue if FMS is enabled, else EFalse.
+     */
+	TBool IsFMSEnabled();
+	
+    /**
+     * Sets the download activity state to the P&S Key used to sync with DM UI.
+     *
+     * @since   S60   v3.2
+     * @param	aValue	ETrue when download is active, else EFalse.
+     * @return  None
+     */
+	void SetDownloadActive(TBool aValue);
+	
+    /**
+     * Returns the download activity state
+     *
+     * @since   S60   v3.2
+     * @return	aValue	ETrue when download is active, else EFalse.
+     */
+
+	TBool IsDownloadActive();
+
+    /**
+     * Starts to suspend the ongoing download
+     *
+     * @since   S60   v3.2
+     * @param	aReason		Reason to suspend the download. Value is one of RFotaEngineSession::TResult.
+     * @param	aSilent		Is suspend operation to be silent?
+     * @return  None
+     */
+	void RunDownloadSuspendL(const TInt aReason, TBool aSilent=EFalse);
+		
+    /**
+     * Starts to cancel the ongoing download
+     *
+     * @since   S60   v3.2
+     * @param	aReason		Reason to cancel the download. Value is one of RFotaEngineSession::TResult.
+     * @param	aSilent		Is cancel operation to be silent?
+     * @return  None
+     */
+	void RunDownloadCancelL(const TInt aReason, TBool aSilent=EFalse);
+	
+    /**
+     * Should update be started after download completes
+     */
+    TBool iUpdateAfterDownload;
+
+    /**
+     * Download is to be restarted. (counter)
+     */
+    TInt iRestartCounter;
+    
+    /**
+     * Download state
+     */
+    TPackageState iDLState;
+
+
+    /**
+    * Download URL 
+    */
+    HBufC8* iUrl;
+
+
+  
+
+private:
+
+
+    /**
+     * Launch notifier. Also used to end download silently.
+     *
+     * @since   S60   v3.1
+     * @param   aNotetype    Notetype
+     * @param   aIntParam    int param
+     * @param   aMemoryneeded How much disk space needed for download
+     * @param   aFinishOnly  finish only, do not launch notifier
+     * @return  none
+     */
+    
+    void LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype
+                            ,const TInt aIntParam
+                            ,const TInt aMemoryNeeded
+                            ,TBool aFinishOnly=EFalse );
+
+    /**
+     * Reads the download variations from the Cenrep keys into instance variables.
+     * They include - Fota Suspend & Resume feature state (on/off) &
+     * Fota Monitory Service feature state (on/off)
+     * 
+     * @since   S60   v3.2
+     * @return  none
+     */
+	void CheckDownloadVariations();
+
+    /**
+     * Retrieves the RHttpDownload object from Download Manager for the suspended download.
+     * Since concurrent downloads are not possible, there will be always zero or one suspended download.
+     * 
+     * @since   S60   v3.2
+     * @return  RHttpDownload object. If NULL, it means that there is no suspended download or the retrieval has fails.
+     */
+	RHttpDownload* RetrieveDownloadL();
+	
+    /**
+     * Sets the IAP Id to use during download. The same API is used for fresh or resuming download.
+     * During resuming of download, the selection of IAP logic varies as below:
+     * 1. If IAP is always ask in DM profile, uses the earlier set during FMS trigger
+	 * 2. If IAP is always ask in DM profile, query user for IAP during user trigger
+	 * 3. If IAP has changed in DM profile after suspend, use the newer one during resume
+     * 
+     * @since   S60   v3.2
+     * @param	aParams		contains the download operation details
+     * @param	aIapid		Out param, the IAP Id is set here.
+     * @return  None
+     */
+	void SetIapToUseL(TPackageState aParams,const TInt aIapid);
+	
+    /**
+     * Sets the Download UI behavior for fresh or resuming download.
+     * 
+     * @since   S60   v3.2
+     * @param	aFreshDL	ETrue if the download is fresh, else EFalse.
+     * @return  None
+     */
+	void SetDownloadUiBehavior(TBool aFreshDL);
+	
+    /**
+     * Creates a fresh download
+     *
+     * @since   S60   v3.1
+     * @param   
+     * @return  none
+     */
+    void CreateDownloadL();
+	  /**
+     * SetDLResultdlErrorId Set the appropriate error codes.
+     *
+     * @since   S60   v5.0
+     * @param   adlErrorId  error id from DlMgr
+     * @param   asysErrorId error id from system
+     * @return  none
+     */   
+    void SetDLResultdlErrorId( THttpDownloadMgrError adlErrorId, TInt32 asysErrorId);
+    
+    /**
+     * ReSetDownloadL Reset the Fota state to Download failed
+     *
+     * @since   S60   v5.0
+     * @param   atoresetdl Bool value if ETrue the set the state to Download Failed
+     * @return  none
+     */   
+    void ReSetDownloadL(TBool atoresetdl);
+    
+    /**
+     * DetermineUISANOFF Determine UI behavior when SAN is OFF
+     *
+     * @since   S60   v5.0
+     * @param   aBehavior behavior depending upon whether SAN is supported or not
+     * @return  none
+     */    
+    void DetermineUISANOFF(TInt aBehavior);
+    
+     /**
+     * DetermineUISANOFF Determine UI behavior when SAN is OFF
+     *
+     * @since   S60   v5.0
+     * @param   aBehavior behavior depending upon whether SAN is supported or not
+     * @return  none
+     */
+    void DetermineUISANON(TInt aBehavior);
+    /**
+     * Reference to fotaserver.
+     * Not own
+     */
+    CFotaServer*            iFotaServer;
+
+    /**
+     * Reference to download mgr.
+     */
+    RHttpDownloadMgr        iDownloadMgr;
+
+    /**
+     * The download object for the current download.
+     */
+    RHttpDownload* iDownload;
+    
+    /**
+     * The downloaded content size in bytes.
+     */
+    TInt	iDownloadedContentSize;
+
+    /**
+     * Download progress dialog.
+     */
+    CFotaDLProgressDlg*     iDLProgressDlg;
+
+    /**
+     * Content size received in previous event
+     */
+    TInt                    iPreviousContentSize;
+
+    /**
+     * handles notifier completion
+     */
+	CFotaDownloadNotifHandler*  iNotifHandler;
+
+    
+    /**
+	* Indicates that this download should be reset. (could be inclded in progress)
+    */
+    TBool iDLNeedsReset;
+    
+    /**
+	* Progress state.
+    */
+    TFotaDLProgress iDLProgress;
+    
+    /**
+     * Showing OMA Content Descriptor
+     */
+    TBool iShowOMACDUI;
+
+    /**
+     * Showing Progress bar
+     */
+    TBool iShowDLPrgUI;
+    
+    /**
+     * Is download resumable?
+     */
+	TBool iDownloadResumable;
+	
+	/**
+	 * Is Fota Monitory service enabled?
+	 */
+	TBool iFMSEnabled;
+	
+	/**
+	 * Is Fota download active?
+	 */
+	TBool iDownloadActive;
+    /**
+     * Iap id to be used in download
+     */
+	TInt	iIapid;
+	
+	/**
+	 * Is download fresh?
+	 */
+	TBool iFreshDL;
+	
+	/**
+	 * Is user initiated resume?
+	 */
+	TBool iUserInitiatedResume;
+	
+	/**
+	 * Is fota operation started by user?
+	 */
+	TBool iIsjobStartedFromUI;
+	
+	/**
+	 * Value of SAN bit set by the remote Server
+	 */
+	TInt iSanValue;
+	
+	/**
+	 * Is suspend/cancel of download operation to be silent?
+	 */
+	TBool 	iSilentOpn;
+	
+	/**
+	 * to check whether downlaod is finalized or not 
+	 */
+	 TBool iDownloadFinalized;
+	 /**
+     * Class that checks for network availability 
+     */
+    CFotaNetworkRegStatus* iMonitor;
+
+    };
+
+
+
+
+
+NONSHARABLE_CLASS ( CFotaDownloadNotifHandler ) 
+        : public CActive 
+    {
+public: // new functions
+    static CFotaDownloadNotifHandler* NewL (CFotaDownload* aDownload);
+    
+    CFotaDownloadNotifHandler();
+    
+    ~CFotaDownloadNotifHandler();
+    /**
+     * Handle user action
+     *
+     * @since   S60   v3.1
+     * @param   None
+     * @return  None
+     */
+    virtual void RunL();
+
+
+     /**
+     * Handle leaving Runl
+     *
+     * @since   S60   v3.1
+     * @param   aError  error code
+     * @return  Error code
+     */
+    virtual TInt RunError(TInt aError);
+
+
+     /**
+     * Handle cancel of active object
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    void DoCancel();
+
+     /**
+     * Shows notifier and/or ends download
+     *
+     * @since   S60   v3.1
+     * @param   aNotetype	type of the note as defined in syncmlnotifier
+     * @param   aIntParam  Generic parameter, defined in syncmlnotifier
+     * @param   aMemoryNeeded	Amount of disk space needed. Only one notifier
+	 *							type consumes this.
+     * @param   aFinishOnly		Do not show notifier, finish download only
+     * @return  none
+     */
+    void LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype
+                            ,const TInt aIntParam
+                            ,const TInt aMemoryNeeded
+                            ,TBool aFinishOnly=EFalse );
+
+     /**
+     * Is any notifier displayed?
+     *
+     * @since   S60   v3.2
+     * @param   none
+     * @return  ETrue if yes, otherwise EFalse
+     */
+    TBool IsOpen();
+private:
+
+	CFotaDownload* iDownload;
+
+    /**
+     * Notifier for showing notes
+     */
+    RNotifier               iNotifier;
+
+    /**
+     * Notifier input parameters
+     */
+    TSyncMLFwUpdNotifParams     iNotifParams;
+
+    /**
+     * Notifier response 
+     */
+    TSyncMLFwUpdNotifRetValPckg  iDummyResponsePckg;
+    
+
+    };
+
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/fotaserverPrivatePSKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* 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:   	PS keys for fotaserver
+*
+*/
+
+
+
+#ifndef FOTASERVER_PRIVATE_PSKEYS_H
+#define FOTASERVER_PRIVATE_PSKEYS_H
+
+// CONSTANTS
+
+// Reading the current or ongoing NSML Job Id from DM UI
+const TUint32 KNsmlCurrentJobId = 0x00000001;
+
+// Reading the Server Alert UI Mode Key
+const TUint32 KNsmlSanUIMode = 0x00000004;
+
+// Reading the OMA DM large object download status
+const TUint32 KFotaLrgObjDl = 0x00000005;
+
+// Reading the Server profile id used for OMA DM large object download
+const TUint32 KFotaLrgObjProfileId = 0x00000006;
+
+//PubSub key used to mark which application is handling the process of download
+//Sets by DM UI, NSC or NSCBackground
+const TUint32 KNSmlCurrentFotaUpdateAppName = 0x0000000A;
+
+//PubSub key used to define should "Install Now?" query be shown or not
+//Sets by DM UI or NSC
+const TUint32 KDevManShowInstallNowQuery = 0x0000000B;
+
+//Reading the DM Job status/error used for OMA DM large object download
+const TUint32  KDmJobCancel = 0x00000012; 
+
+#endif // FOTASERVER_PRIVATE_PSKEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/fotaserver_service.rh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+
+STRUCT FOTASERVICE_STRUCT
+	{
+	LONG type = 0;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/inc/fotaupdate.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,450 @@
+/*
+* 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:   Header for updater active object
+*
+*/
+
+
+
+#ifndef __UPDATER_H___
+#define __UPDATER_H___
+
+// INCLUDES
+#include <etelmm.h>
+#include <mmtsy_names.h> // for etel
+#include <bautils.h>
+#include <schinfo.h>
+
+#include "FotaServer.h"
+#include "fotaUpdateAgentComms.h"
+#include "fotaengine.h"
+
+// CONSTANTS
+_LIT (KUpdateResultFile, "update.resp");
+_LIT (KUpdateRequestFile, "update.req");
+_LIT (KUpdateBitmap ,"installing.bmp");
+_LIT (KRestartingBitmap ,"restarting.bmp");
+_LIT (KUpdateTimeStampFileName, "updatetimestamp");
+_LIT8 (KSwupdPath8, "c:\\private\\102072C4\\");
+_LIT8 (KSwupdFileExt8, ".swupd");
+_LIT(KDefaultSched, "1h:4h:1d:3d");  
+_LIT(Ksep,";");  
+
+// FORWARD  DECLARATIONS
+class CFotaServer;
+class CFotaUpdate;
+
+// CLASS DECLARATION
+
+
+
+/**
+ *  Update related activities
+ *
+ *  @lib    fotaserver
+ *  @since  S60 v3.1
+ */
+NONSHARABLE_CLASS( CFotaUpdate ): public CActive 
+    {
+public:
+
+    static CFotaUpdate* NewL (CFotaServer* aServer);
+
+    virtual ~CFotaUpdate ();
+
+
+    /**
+     * Start update
+     *
+     * @since   S60   v3.1
+     * @param   aParams         details
+     * @return  none
+     */
+    void StartUpdateL( const TDownloadIPCParams &aParams );
+
+
+    /**
+     * Update. boot.
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    void UpdateL();
+
+
+    /**
+     * Check update result written update agent. Is it there?
+     *
+     * @since   S60   v3.1
+     * @param   aRfs
+     * @return  is it there
+     */
+    static TBool CheckUpdateResults( RFs& aRfs );
+
+
+
+    /**
+     * Delete update result file
+     *
+     * @since   S60   v3.1
+     * @param   aRfs
+     * @return  none
+     */
+    static void DeleteUpdateResultFileL( RFs& aRfs );
+
+
+
+    /**
+     * Execute update result file. That is, read result code. Send it to srv.
+     *
+     * @since   S60   v3.1
+     * @param   aRfs
+     * @return  none
+     */
+    void ExecuteUpdateResultFileL( RFs& aRfs );
+    
+    /**
+     * Checks the FOTA Install update note variation     
+     * @since   S60   v3.2
+     * @param   None
+     * @return  TBool, ETrue / EFalse
+     */
+    TBool CheckUpdateVariations();
+
+    /**
+     * HandleUpdateAcceptStartL handle the update process when the user pressed Now
+     *
+     * @since   S60   v5.0
+     * @param   None
+     * @return  None
+     */
+    void HandleUpdateAcceptStartL(TBool aSkipBatteryChk = EFalse);
+    
+    /**
+     * This method handles any update related error.
+     *
+     * @since   S60   v5.2
+     * @param   the error code and value if applicable
+     * @return  None, can leave with system wide error.
+     */
+    void HandleUpdateErrorL(TInt aError, TInt aValue = 0);
+    
+    /**
+     * This method handles any encryption related error.
+     *
+     * @since   S60   v5.2
+     * @param   the error code
+     * @return  None, can leave with system wide error.
+     */
+    void HandleEncryptionErrorL(TInt aError);
+
+
+protected: // from base classes
+
+
+    /**
+     * Hanlde notifier clicking
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */    
+    virtual void RunL();
+
+
+    /**
+     * Cancel outstanding reqeust
+     *
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */    
+    void DoCancel();
+
+
+    /**
+     * Handle leaving runl
+     *
+     * @since   S60   v3.1
+     * @param   aError  error
+     * @return  none
+     */
+    virtual TInt RunError(TInt aError);
+    /**
+     * Enum for Interval type of scheduling
+     *
+     * @since   S60   v3.2
+     */   
+    enum TUpdateIntervalType
+	{
+	/** The interval is based on hours. */
+	EHourly,
+	/** The interval is based on days. */
+	EDaily,
+	/** The interval is based on months. */
+    EMonthly,
+	/** The interval is based on years. */
+	EYearly,
+    /**Show the No reminder             */  
+	ENoReminderOn,
+	/**Show the No reminder             */   
+    ENoReminderOff,
+    /* Added for postpone limit, When All the postpones are used and user presses end key this command is sent */
+    EEndKeyReminder
+	};
+
+private:
+
+    CFotaUpdate ();
+
+    /**
+     * Check if there's enough battery power to update
+     *
+     * @since   S60   v3.1
+     * @param   aUSBCharger
+     * @return  TBool is there enough battery
+     */
+    TBool CheckBatteryL(TBool aUSBCharger);
+        
+    /**
+     * HandleUpdateAcceptLaterL handle the update process when the user pressed Later
+     *
+     * @since   S60   v5.0
+     * @param   None
+     * @return  None
+     */
+    void HandleUpdateAcceptLaterL();
+    
+    /**
+     * HandleErrorBasedonChargingTypeL handle the error based on chrager type 
+     *
+     * @since   S60   v5.0
+     * @param   None
+     * @return  None
+     */
+    void HandleErrorBasedonChargingTypeL();
+    
+    /**
+     * SetUpdateFailedStatesL Set the state to update failed
+     *
+     * @since   S60   v5.0
+     * @param   None
+     * @return  None
+     */
+    void SetUpdateFailedStatesL();
+    
+    /**
+     * GetSchedulesInfoL Get the schedule info of FOTA update
+     *
+     * @since   S60   v5.0
+     * @param   None
+     * @return  None
+     */
+    void GetSchedulesInfoL();
+    
+    /**
+     * DisplayInstallationNoteType determines the proper installation note based on the Cenrep keys.
+     *
+     * @since   S60   v5.0
+     * @param   None
+     * @return  None
+     */
+    void DisplayInstallationNoteTypeL();
+
+
+    /**
+     * Launch notifier for user to interact with
+     *
+     * @since   S60   v3.1
+     * @param   aNotetype
+     * @param   aIntparam
+     * @return  none
+     */
+    void LaunchNotifierL(  const TSyncMLFwUpdNoteTypes aNotetype , const TInt aIntParam,const TInt aEnc=EFalse);
+    
+    
+    /**
+     * Launch the postpone information note, when the postpone limit feature is enabled.
+     *
+     * @since   S60   v5.0
+     * @param   aNotetype
+     * @param   aIntparam
+     * @param   aIntParam1
+     * @param   aIntervalType
+     * @param   aInterval
+     * @return  none
+     */
+    void LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype,const TInt aIntParam,const TInt aIntParam1,TIntervalType aIntervalType,const TInt aInterval);
+
+	/**
+	 * Prepare and display Reminder Dialog using RFotaReminderDlg
+	 * on radio button setting page
+	 * @since 	S60	  v3.1
+	 * @param None
+	 * @return none
+	 */
+	void ShowReminderDialogL();
+	
+	/**
+	 * Create the Schedule 
+	 * @since 	S60	  v3.1
+	 *
+	 * @param package id 
+	 * @param intervaltype
+	 * @param interval
+	 * @return TInt 
+	 */
+    TInt CreateScheduleL ( const TInt aPackageId
+            ,TIntervalType aIntervalType,const TInt aInterval);
+            
+            
+  /**
+	 * Create the new Schedule 
+	 * @since 	S60	  v3.1
+	 *
+	 * @param package id 
+	 * @param aRet
+	 * @param aRadioSelectionIndex
+	 * @return None
+	 */
+
+    void CreateNewScheduleL(TInt aRet, TInt aRadioSelectionIndex);
+    
+  /**
+	 * Fins the schedule or deletes it 
+	 * @since 	S60	  v3.1
+	 *
+	 * @param aDelete if true the delete the schedule 
+	 * @return TScheduleEntryInfo2
+	 */
+    TScheduleEntryInfo2 FindScheduleL ( const TBool aDelete );
+    /**  
+	 * Parse the schedule string from Cenrep
+	 * @since 	S60	  v3.2
+	 * @param None
+	 * @return none
+	 */
+    void ParseScheduleStringL();
+
+public:
+
+
+	/**
+	* Creates the Array of radio buttons and returns to the caller
+	*/
+	CDesCArray* CreateRadionButtonArrayLC(const TScheduleEntryInfo2 aScEntry,TInt& aSelectionIndex);
+
+private:
+
+    /**
+     * State of the update package. For convenience.
+     */
+    TPackageState iUpdateState;
+
+
+    /**
+     * reference to fotaserver.
+     * Not own
+     */
+    CFotaServer*    iFotaServer;
+
+
+    /**
+     * Notifier
+     */
+    RNotifier       iNotifier;
+
+
+   
+   /**
+     * Interval Type  
+     */
+    
+    RArray<TInt>  iIntervalType; 
+    
+    /**
+     * Interval  
+     */
+     RArray<TInt>  iInterval;
+    /**
+     * Notifier params
+     */
+    TSyncMLFwUpdNotifParams     iNotifParams;
+
+
+
+    /**
+     * NOtifier response
+     */    
+    TSyncMLFwUpdNotifRetValPckg  iDummyResponsePckg;
+
+    
+    /**
+     * file server session
+     * not own
+     */
+    RFs*            iFs; 
+    
+    /**
+     * scheduled  times
+     */
+    TBuf<255> iscInfo;
+	
+	/** 
+	* fota update reminder task
+	*/
+	TFotaScheduledUpdate* iScheduledUpdate;
+	/*
+	 * flag to handle showing the reminder dialog twice.
+	 */
+	TBool iHandleUpdateAcceptLater;
+	
+    /*
+     * tells the battery charge to monitor for.
+     */
+	TInt iChargeToMonitor;
+	
+	/*
+	 * to finalize update later
+	 */
+	 
+ 	TBool iFinalizeLater;
+	 
+		/*
+	 * flag to enable the FOTA Update Postpone  limit feature.
+	 */
+	TInt iFOTAUICustomization;
+	
+	/*
+	 * To Store the number of postpones done by the user.
+	 */
+	TInt iFOTAUserPostponeCount;
+	
+	/*
+	 * To Store the maximum number of postpones allowed for the user.
+	 */
+	TInt iFOTAMaxPostponeCount;
+	
+	/*
+	 * To Get the Configuration values related to FOTA
+	 */
+	CRepository* iCentrep;
+	
+    };
+
+
+
+
+#endif // __UPDATER_H___
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/loc/fotaserver.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2002 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:   Localisation file. 
+*
+*/
+
+
+
+
+// l: param specified in Series_60_3_0_QVGA_Portrait_Application_LAF_Document_1.0.pdf
+
+//d:-----------------------------------------------------------
+//d:APPLICATION TITLES
+//d:-----------------------------------------------------------
+
+//d:Title of the application on the title pane
+//l:title_pane_t2/opt9
+//w:
+//r:3.1
+#define qtn_fota_title			"Download"
+
+//d:Updating progress bar
+//l:popup_note_wait_window
+//w:
+//r:3.1
+#define qtn_fota_wait_downloading	 "Downloading"
+
+//d:Updating progress bar
+//l:popup_note_wait_window
+//w:
+//r:3.1
+#define qtn_fota_wait_installing  "Updating..."
+
+//d:restarting note after updating
+//l:popup_note_window
+//w:
+//r:3.1
+#define qtn_fota_restarting_phone  "Restarting phone"
+
+
+//d:radio button item to display 1 hour
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.2
+#define qtn_fota_reminder_1_hour   	"1 hour"
+
+//d:radio button item to display 1 day
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.2
+#define qtn_fota_reminder_1_day  	"1 day"
+
+//d:radio button item to display no remainder
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.2
+#define qtn_fota_no_reminder    	"No reminder"
+
+//d:Title of the radio button setting page on the title pane
+//l:title_pane_t2/opt9
+//w:
+//r:3.2
+#define qtn_apps_dm_title           "Device Manager"
+
+
+//d:Title of the radio button setting page, placed on control itself
+//l:list_setting_pane_t1
+//w:
+//r:3.2
+#define qtn_fota_reminder_setting		"Remind after"
+
+
+//d:radio button item to display 1 minute
+//l:list_set_graphic_pane_t1
+//w:
+//r:5.0
+#define qtn_fota_reminder_1_minute 	"1 minute"
+
+//d:radio button item to display %N minutes
+//l:list_set_graphic_pane_t1
+//w:
+//r:5.0
+#define qtn_fota_reminder_minutes 	"%N minutes"
+
+//d:radio button item to display %N hours
+//l:list_set_graphic_pane_t1
+//w:
+//r:5.0
+#define qtn_fota_reminder_hours 	"%N hours"
+
+//d:radio button item to display %N days
+//l:list_set_graphic_pane_t1
+//w:
+//r:5.0
+#define qtn_fota_reminder_days 	"%N days"
+
+//d:Progress bar shown during decryption operation
+//l:popup_note_wait_window
+//w:
+//r:5.2
+#define qtn_fota_decrypting_encrypt_process "Decrypting"
+
+//d:Progress bar shown during encryption operation
+//l:popup_note_wait_window
+//w:
+//r:5.2
+#define qtn_fota_encrypting_encrypt_process "Encrypting"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/DevEncController.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,529 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   CDevEncController definitions Part of ES System Application
+*
+*/
+
+//System Include
+#include <apgcli.h> // for RApaLsSession
+#include <apacmdln.h> // for CApaCommandLine
+#include <centralrepository.h>
+#include <featmgr.h> // for checking DE feature
+#include <DevEncEngineConstants.h>
+#include <DevEncSessionBase.h> //for device encryption
+#include <DevEncProtectedPSKey.h>  //for device encryption
+#include <fotaserver.rsg>
+
+//User Include
+#include "DevEncController.h"
+#include "FotaServer.h"
+#include "DevEncProgressObserver.h"
+#include "FotaSrvDebug.h"
+
+#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
+
+// ================= MEMBER FUNCTIONS =======================
+//
+// ----------------------------------------------------------
+// CDevEncController::NewL
+// Instancies CDevEncController object
+// ----------------------------------------------------------
+//
+CDevEncController* CDevEncController::NewL(CFotaServer* aCallback )
+    {
+    FLOG(_L("CDevEncController::NewL >>"));
+
+    CDevEncController* self = CDevEncController::NewLC(aCallback);
+    CleanupStack::Pop();
+
+    FLOG(_L("CDevEncController::NewL <<"));
+    return self;
+    }
+
+
+// ----------------------------------------------------------
+// CDevEncController::NewL
+// Instancies CDevEncController object
+// ----------------------------------------------------------
+//
+CDevEncController* CDevEncController::NewLC(CFotaServer* aCallback )
+    {
+    FLOG(_L("CDevEncController::NewLC >>"));
+
+    CDevEncController* self = new ( ELeave ) CDevEncController(aCallback);
+    CleanupStack::PushL ( self );
+    self->ConstructL();
+
+    FLOG(_L("CDevEncController::NewC <<"));
+    return self;
+    }
+
+// ----------------------------------------------------------
+// CDevEncController::ConstructL()
+// Initializes data objects
+// ----------------------------------------------------------
+//
+void CDevEncController::ConstructL()
+    {
+    FLOG(_L("CDevEncController::ConstructL >>"));
+
+    if (IsDeviceEncryptionSupportedL())
+        {
+				LoadDevEncSessionL();
+        }
+    else
+    	{
+				FLOG(_L("Device doesn't support encryption!!"));
+        User::Leave(KErrNotSupported);
+    	}
+        	
+    FLOG(_L("CDevEncController::ConstructL <<"));
+    }
+
+
+TBool CDevEncController::IsDeviceEncryptionSupportedL()
+    {
+    FLOG(_L("CDevEncController::IsDeviceEncryptionSupportedL >>"));
+
+    TBool ret(EFalse);
+
+    FeatureManager::InitializeLibL();
+    ret = FeatureManager::FeatureSupported( KFeatureIdFfDeviceEncryptionFeature);
+    FeatureManager::UnInitializeLib();
+
+    FLOG(_L("CDevEncController::IsDeviceEncryptionSupportedL, ret = %d <<"), ret);
+    return ret;
+    }
+// ----------------------------------------------------------
+// CDevEncController::CDevEncController()
+// Constructor
+// ----------------------------------------------------------
+//
+CDevEncController::CDevEncController(CFotaServer* aCallback): iCallback (aCallback),
+iEncMemorySession(NULL),
+iDevEncObserver (NULL),
+iDevEncOperation(EIdle)
+        {
+
+        }
+
+// ----------------------------------------------------------
+// CDevEncController::CDevEncController()
+// Destructor
+// ----------------------------------------------------------
+//
+CDevEncController::~CDevEncController()
+    {
+    FLOG(_L("CDevEncController::~CDevEncController >>"));
+
+		UnloadDevEncSession();
+
+    if (iDevEncObserver)
+        {
+        delete iDevEncObserver;
+        iDevEncObserver = NULL;
+        }
+
+    FLOG(_L("CDevEncController::~CDevEncController <<"));
+    }
+
+// ----------------------------------------------------------
+// CDevEncController::LoadDevEncSessionL()
+// Loads the devenc library
+// ----------------------------------------------------------
+//
+void CDevEncController::LoadDevEncSessionL()
+    {
+    FLOG(_L("CDevEncController::LoadDevEncSessionL >> "));
+    
+    if (!iEncMemorySession)
+        {
+	      TInt err = iLibrary.Load(KDevEncCommonUtils);	 
+        if (err != KErrNone)
+            {
+            FLOG(_L("Error in finding the library... %d"), err);
+            }
+        else
+        	{
+		       TLibraryFunction entry = iLibrary.Lookup(1);
+         
+	        if (!entry)
+	            {
+	            FLOG(_L("Error in loading the library..."));
+	            User::Leave(KErrBadLibraryEntryPoint);
+	            }
+	        iEncMemorySession = (CDevEncSessionBase*) entry();
+	        FLOG(_L("Library is found and loaded successfully..."));
+	        }
+	      }
+    FLOG(_L("CDevEncController::LoadDevEncSessionL << "));
+    }
+
+// ----------------------------------------------------------
+// CDevEncController::UnloadDevEncSessionL()
+// Unloads the devenc library
+// ----------------------------------------------------------
+//
+void CDevEncController::UnloadDevEncSession()
+    {
+    FLOG(_L("CDevEncController::UnloadDevEncSession >> "));
+    
+    if (iEncMemorySession)
+        {
+        delete iEncMemorySession;
+        iEncMemorySession = NULL;
+        }
+
+		if (iLibrary.Handle())
+      	{
+       	iLibrary.Close();    
+        }
+    FLOG(_L("CDevEncController::UnloadDevEncSession << "));
+    }
+    
+TBool CDevEncController::NeedToDecryptL(const TDriveNumber &aDrive)
+    {
+    FLOG(_L("CDevEncController::NeedToDecryptL, drive = %d >>"), (TInt) aDrive);
+
+    TBool ret (EFalse);
+    TInt err (KErrNone);
+    TInt status (KErrNone);
+
+    TInt deoperation (EOpIdle);  
+
+    RProperty::Get(KDevEncProtectedUid, KDevEncOperationKey, deoperation );
+
+    if (deoperation != EOpIdle)
+        {
+        FLOG(_L("Some disk operation is ongoing. Hence Fota is not possible."));
+        User::Leave(KErrNotReady);
+        }
+
+		iEncMemorySession->SetDrive( aDrive);
+
+    err = iEncMemorySession->Connect();
+    if (err != KErrNone)
+        {
+        FLOG(_L("Error in connecting to devencdisk session = %d"), err);
+        User::Leave(err);
+        }
+
+    err = iEncMemorySession->DiskStatus(status);
+
+    if (!err && (status == EEncrypted || status == EEncrypting))
+        {
+        FLOG(_L("Drive %d is encrypted"), (TInt) aDrive);
+        ret = ETrue;
+        }
+    else
+        {
+        CRepository *centrep = CRepository::NewL( KCRUidFotaServer );
+        err = centrep->Set(  KDriveToEncrypt, KErrNotFound );
+        delete centrep; centrep = NULL;
+        }
+
+#if defined(__WINS__)
+    ret = ETrue;
+#endif
+
+    iEncMemorySession->Close();
+    
+    FLOG(_L("CDevEncController::NeedToDecrypt, ret = %d <<"), ret);
+    return ret;
+    }
+
+void CDevEncController::DoStartDecryptionL(const TDriveNumber &aDrive)
+    {
+    FLOG(_L("CDevEncController::DoStartDecryptionL >>"));
+
+    TInt deoperation (EOpIdle);  
+
+    RProperty::Get(KDevEncProtectedUid, KDevEncOperationKey, deoperation );
+
+    if (deoperation != EOpIdle)
+        {
+        FLOG(_L("Some disk operation is ongoing. Hence Fota is not possible."));
+        User::Leave(KErrNotReady);
+        }
+
+    iDevEncOperation = EDecryption;
+    iStorageDrive = aDrive;
+
+
+    StartDecryptionL();
+
+    FLOG(_L("CDevEncController::DoStartDecryptionL <<"));
+    }
+
+
+void CDevEncController::StartDecryptionL()
+    {
+    FLOG(_L("CDevEncController::StartDecryptionL >>"));
+
+    TInt status (KErrNone);
+
+  	iEncMemorySession->SetDrive ( iStorageDrive );
+			
+    __LEAVE_IF_ERROR(iEncMemorySession->Connect());
+
+    __LEAVE_IF_ERROR(iEncMemorySession->DiskStatus(status));
+
+    FLOG(_L("Status = %d"), status);
+
+    if (status == EEncrypted)
+        {
+        if (CheckBatteryL())
+            {
+            FLOG(_L("Started decryption of drive %d..."), iStorageDrive);
+
+            if (!iDevEncObserver)
+                iDevEncObserver = CDevEncProgressObserver::NewL(this, R_FOTASERVER_DECRYPTION_PROGRESS_DIALOG);
+
+            __LEAVE_IF_ERROR(iEncMemorySession->StartDiskDecrypt());
+
+            FLOG(_L("Monitor for completion of the decryption operation..."));
+
+            iDevEncObserver->StartMonitoringL(iEncMemorySession);
+            }
+        else
+            {
+            FLOG(_L("Battery low for performing decryption!"));
+
+            iDevEncOperation = EIdle;
+            iEncMemorySession->Close();
+
+            iCallback->HandleDecryptionCompleteL(KErrBadPower, EBatteryLevelLevel4);
+            }
+        }
+    else if(status == EDecrypted)
+        {
+        FLOG(_L("Device is already decrypted"));
+
+        iDevEncOperation = EIdle;
+        iEncMemorySession->Close();
+
+        iCallback->HandleDecryptionCompleteL(KErrNone);
+        }
+    else
+        {
+        // status is either unmounted, encrypting, decrypting, wiping or corrupted
+        FLOG(_L("Can't proceed as disk status is %d"), status);
+
+        iDevEncOperation = EIdle;
+        iEncMemorySession->Close();
+
+        iCallback->HandleDecryptionCompleteL(KErrNotReady);
+        }
+
+    FLOG(_L("CDevEncController::StartDecryptionL <<"));
+    }
+
+void CDevEncController::ReportDevEncOpnCompleteL(TInt aResult)
+    {
+    FLOG(_L("CDevEncController::ReportDevEncOpnCompleteL, result = %d >>"), aResult);
+
+    TInt err (KErrNone);
+
+    if (iEncMemorySession)
+        {
+        iEncMemorySession->Close();
+        }
+
+    CRepository *centrep = CRepository::NewL( KCRUidFotaServer );
+
+    if (iDevEncOperation == EDecryption)
+        {
+        err = centrep->Set(  KDriveToEncrypt, iStorageDrive );
+        if (err != KErrNone)
+            {
+            FLOG(_L("Setting drive to encrypt as %d after firmware update, error = %d"), (TInt) iStorageDrive, err);
+            }
+        }
+    else if (iDevEncOperation == EEncryption)
+        {
+        err = centrep->Set(  KDriveToEncrypt, KErrNotFound );
+        if (err != KErrNone)
+            {
+            FLOG(_L("Setting no drive, error = %d"), err);
+            }
+        }
+    delete centrep; centrep = NULL;
+
+    if (iDevEncOperation == EDecryption)
+        {
+        FLOG(_L("Starting update..."));
+        iCallback->HandleDecryptionCompleteL(KErrNone);
+        iDevEncOperation = EIdle;
+        }
+    else if (iDevEncOperation == EEncryption)
+        {
+        FLOG(_L("Encryption ended"));
+        iCallback->HandleEncryptionCompleteL(KErrNone);
+        iDevEncOperation = EIdle;
+        }
+    else
+        {
+        //should not land here!
+        }
+
+    FLOG(_L("CDevEncController::ReportDevEncOpnCompleteL <<"));
+    }
+
+TBool CDevEncController::NeedToEncryptL(TDriveNumber &aDrive)
+    {
+    FLOG(_L("CDevEncController::NeedToEncryptL >> "));
+    TBool ret (EFalse);
+
+    CRepository *centrep = CRepository::NewL( KCRUidFotaServer );
+    TInt drive (KErrNotFound);
+    TInt err = centrep->Get(  KDriveToEncrypt, drive );
+    if (drive != KErrNotFound)
+        {
+        aDrive = (TDriveNumber) drive;
+        ret = ETrue;
+        }
+
+    delete centrep; centrep = NULL;
+
+    FLOG(_L("CDevEncController::NeedToEncryptL, ret = %d, err = %d << "), ret, err);
+    return ret;
+    }
+
+void CDevEncController::DoStartEncryptionL(const TDriveNumber &aDrive)
+    {
+    FLOG(_L("CDevEncController::DoStartEncryptionL, drive = %d >>"), (TInt) aDrive);
+
+    iDevEncOperation = EEncryption;
+    iStorageDrive = aDrive;
+    StartEncryptionL();
+
+    FLOG(_L("CDevEncController::DoStartEncryptionL <<"));
+    }
+
+void CDevEncController::StartEncryptionL()
+    {
+    FLOG(_L("CDevEncController::StartEncryptionL >>"));
+
+    TInt status (KErrNone);
+
+    iEncMemorySession->SetDrive( iStorageDrive );
+
+    __LEAVE_IF_ERROR(iEncMemorySession->Connect());
+
+    __LEAVE_IF_ERROR(iEncMemorySession->DiskStatus(status));
+
+    FLOG(_L("Status = %d"), status);
+
+    if (status == EDecrypted)
+        {
+        FLOG(_L("Started encryption of drive %d..."), iStorageDrive);
+
+        if (CheckBatteryL())
+            {
+            if (!iDevEncObserver)
+                iDevEncObserver = CDevEncProgressObserver::NewL(this, R_FOTASERVER_ENCRYPTION_PROGRESS_DIALOG);
+
+            __LEAVE_IF_ERROR(iEncMemorySession->StartDiskEncrypt());
+
+            FLOG(_L("Monitor for completion of the decryption operation..."));
+
+            iDevEncObserver->StartMonitoringL(iEncMemorySession);
+            }
+        else
+            {
+            FLOG(_L("Battery low for performing encryption!"));
+
+            iDevEncOperation = EIdle;
+            iEncMemorySession->Close();
+
+            iCallback->HandleEncryptionCompleteL(KErrBadPower);
+            }
+        }
+    else if (status == EEncrypted)
+        {
+        FLOG(_L("Memory is already encrypted"));
+
+        iDevEncOperation = EIdle;
+        iEncMemorySession->Close();
+
+        iCallback->HandleEncryptionCompleteL(KErrNone);
+        }
+    else
+        {
+        //status is either encrypting, decrypting, wiping, corrupted
+        FLOG(_L("Can't proceed as disk status is %d"), status);
+
+        iDevEncOperation = EIdle;
+        iEncMemorySession->Close();
+
+        iCallback->HandleEncryptionCompleteL(KErrNotReady);
+        }
+    FLOG(_L("CDevEncController::StartEncryptionL <<"));
+    }
+
+TBool CDevEncController::CheckBatteryL()
+    {
+    FLOG(_L("CDevEncController::CheckBatteryL >>"));
+#ifdef __WINS__
+
+    // In the emulator, the battery level is always 0 and the charger is never
+    // connected, so just return ETrue.
+    return ETrue;
+
+#else // __WINS__
+
+    // Running on target. Check the real battery and charger status
+
+    TInt chargingstatus( EChargingStatusError );
+    TInt batterylevel( 1 );
+    TBool enoughPower( EFalse );
+
+    // Read battery
+    FLOG( _L("CDevEncUiEncryptionOperator::CheckBatteryL" ));
+    RProperty pw;
+    User::LeaveIfError( pw.Attach( KPSUidHWRMPowerState, KHWRMBatteryLevel ) );
+    User::LeaveIfError( pw.Get( batterylevel ) );
+    pw.Close();
+
+    User::LeaveIfError( pw.Attach( KPSUidHWRMPowerState, KHWRMChargingStatus ) );
+    User::LeaveIfError( pw.Get( chargingstatus ));
+    pw.Close();
+
+    // Too low battery, power insufficient
+    if ( batterylevel >= EBatteryLevelLevel4 )
+        {
+        enoughPower = ETrue;
+        }
+    // But charger is connected, power sufficient
+    if ( ( chargingstatus != EChargingStatusError ) &&
+            ( chargingstatus != EChargingStatusNotConnected ) )
+        {
+        enoughPower = ETrue;
+        }
+
+    FLOG( _L("Battery level: %d  (0..7), chargingstatus %d"),
+            batterylevel, chargingstatus );
+    FLOG( _L("CDevEncController::CheckBatteryL, ret=%d <<"), ( enoughPower ? 1 : 0 ) );
+    return enoughPower;
+
+#endif // __WINS__
+    }
+
+TInt CDevEncController::GetDEOperation()
+    {
+    return iDevEncOperation;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/DevEncProgressDlg.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,150 @@
+/*
+* 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:   Progress dlg for download
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "DevEncProgressDlg.h"
+#include <AknGlobalProgressDialog.h>
+#include <StringLoader.h>
+#include <stringresourcereader.h>
+#include <avkon.rsg>
+#include "FotaSrvDebug.h"
+
+// ========================= MEMBER FUNCTIONS ================================
+EXPORT_C CDevEncProgressDlg* CDevEncProgressDlg::NewL(MDEProgressDlgObserver* aObserver, TInt aResource)
+    {
+    FLOG(_L("CDevEncProgressDlg::NewL >>"));
+    
+    CDevEncProgressDlg* self = CDevEncProgressDlg::NewLC(aObserver, aResource);
+    CleanupStack::Pop();
+    
+    FLOG(_L("CDevEncProgressDlg::NewL <<"));
+    return self;
+    }
+
+EXPORT_C CDevEncProgressDlg* CDevEncProgressDlg::NewLC(MDEProgressDlgObserver* aObserver, TInt aResource)
+    {
+    FLOG(_L("CDevEncProgressDlg::NewLC >>"));
+    
+    CDevEncProgressDlg* self = new (ELeave) CDevEncProgressDlg(aObserver);
+    CleanupStack::PushL(self);
+    
+    self->ConstructL(aResource);
+    
+    FLOG(_L("CDevEncProgressDlg::NewL <<"));
+    return self;    
+    }
+
+void CDevEncProgressDlg::ConstructL(TInt aResource)
+    {
+    FLOG(_L("CDevEncProgressDlg::ConstructL >>"));
+    
+    iProgressDialog = CAknGlobalProgressDialog::NewL();
+    iStringResource = StringLoader::LoadL(aResource);
+    
+    FLOG(_L("CDevEncProgressDlg::ConstructL <<"));
+    }
+
+// ---------------------------------------------------------------------------
+// CDevEncProgressDlg::CDevEncProgressDlg
+// ---------------------------------------------------------------------------
+CDevEncProgressDlg::CDevEncProgressDlg(MDEProgressDlgObserver* aObserver) : CActive(EPriorityMore),
+                                                                            iProgressDialog (NULL),
+                                                                            iStringResource (NULL),
+                                                                            iObserver (aObserver)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+CDevEncProgressDlg::~CDevEncProgressDlg()
+    {
+    FLOG(_L("CDevEncProgressDlg::~CDevEncProgressDlg >>"));
+    
+    Cancel();
+    
+    delete iProgressDialog; iProgressDialog = NULL;
+    
+    delete iStringResource; iStringResource = NULL;
+    
+    iObserver = NULL;
+    
+    FLOG(_L("CDevEncProgressDlg::~CDevEncProgressDlg <<"));
+    }
+
+// ---------------------------------------------------------------------------
+// CDevEncProgressDlg::OkToExitL
+// Called by framework when the Softkey is pressed.
+// ---------------------------------------------------------------------------
+//
+void CDevEncProgressDlg::DoCancel()
+    {
+    FLOG(_L("CDevEncProgressDlg::DoCancel >>"));
+    
+    if (iProgressDialog)
+        {
+        iProgressDialog->CancelProgressDialog();
+        }
+    
+    FLOG(_L("CDevEncProgressDlg::DoCancel <<"));
+    }
+
+void CDevEncProgressDlg::RunL()
+    {
+    FLOG(_L("CDevEncProgressDlg::RunL >>"));
+    
+    if (iObserver)
+        {
+        iObserver->HandleDEProgressDialogExitL(iStatus.Int());
+        }
+    FLOG(_L("CDevEncProgressDlg::RunL <<"));
+    }
+
+void CDevEncProgressDlg::ShowProgressDialogL()
+    {
+    FLOG(_L("CDevEncProgressDlg::ShowProgressDialogL >>"));
+    
+    iProgressDialog->ShowProgressDialogL(iStatus,iStringResource->Des(),R_AVKON_SOFTKEYS_EMPTY);
+    FLOG(_L("Step...1"));
+    
+    SetActive();
+    FLOG(_L("Step...2"));
+    FLOG(_L("CDevEncProgressDlg::ShowProgressDialogL <<"));
+    }
+
+
+void CDevEncProgressDlg::UpdateProgressDialogL(TInt aValue, TInt aFinalValue)
+    {
+    FLOG(_L("CDevEncProgressDlg::UpdateProgressDialogL, value = %d >>"), aValue);
+    
+    iProgressDialog->UpdateProgressDialog(aValue, aFinalValue);
+    
+    FLOG(_L("CDevEncProgressDlg::UpdateProgressDialogL <<"));
+    }
+
+void CDevEncProgressDlg::ProgressFinished()
+    {
+    FLOG(_L("CDevEncProgressDlg::ProgressFinished >>"));
+   
+    iProgressDialog->ProcessFinished();
+    
+    FLOG(_L("CDevEncProgressDlg::ProgressFinished <<"));
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/DevEncProgressObserver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,205 @@
+/*
+ * 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 <DevEncSessionBase.h>
+//User Includes
+
+#include "DevEncProgressObserver.h"
+#include "DevEncController.h"
+#include "DevEncProgressDlg.h"
+#include "FotaSrvDebug.h"
+#include <eikprogi.h>
+#include <fotaConst.h>
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::NewL
+// Symbian 2-Phase construction, NewL used for creating object of this class
+// This method can leave
+// -----------------------------------------------------------------------------
+
+CDevEncProgressObserver* CDevEncProgressObserver::NewL(CDevEncController* aObserver, TInt aResource)
+    {
+    CDevEncProgressObserver* self = CDevEncProgressObserver::NewLC(aObserver, aResource);
+    CleanupStack::Pop(self);
+    return self;	
+    }
+
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::NewLC
+// Symbian 2-Phase construction, NewLC used for creating object of this class
+// This method can leave
+// -----------------------------------------------------------------------------
+
+CDevEncProgressObserver* CDevEncProgressObserver::NewLC(CDevEncController* aObserver, TInt aResource)
+    {
+    CDevEncProgressObserver* self = new (ELeave) CDevEncProgressObserver (aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL(aResource);
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::ConstructL
+// Symbian 2-Phase construction, ConstructL used for constructing the members of this class
+// This method can leave
+// -----------------------------------------------------------------------------
+
+void CDevEncProgressObserver::ConstructL(TInt aResource)
+    {
+    FLOG(_L("CDevEncProgressObserver::ConstructL >>"));
+    
+    iProgressDlg = CDevEncProgressDlg::NewL(this, aResource);
+    
+    FLOG(_L("CDevEncProgressObserver::ConstructL <<"));
+    }
+
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::CDevEncProgressObserver
+// C++ Constructor
+// This method shouldn't leave
+// -----------------------------------------------------------------------------
+
+CDevEncProgressObserver::CDevEncProgressObserver(CDevEncController* aObserver) : 
+iObserver(aObserver), iProgressDlg (NULL), iPeriodicTimer(NULL), iEncMemorySession (NULL)
+            {
+
+            }
+
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::~CDevEncProgressObserver
+// C++ Desctructor
+// This method shouldn't leave
+// -----------------------------------------------------------------------------
+
+CDevEncProgressObserver::~CDevEncProgressObserver()
+    {
+    FLOG(_L("CDevEncProgressObserver::~CDevEncProgressObserver >>"));
+
+    iEncMemorySession = NULL;
+
+    if (iPeriodicTimer)
+        {
+        FLOG(_L("1..........."));
+        iPeriodicTimer->Cancel();
+        FLOG(_L("2..........."));
+        delete iPeriodicTimer;
+        iPeriodicTimer = NULL;
+        }
+
+    if (iProgressDlg)
+        {
+        iProgressDlg->ProgressFinished();
+        delete iProgressDlg;
+        iProgressDlg = NULL;
+        }
+
+    FLOG(_L("CDevEncProgressObserver::~CDevEncProgressObserver <<"));
+    }
+
+static TInt StaticTimerExpiry(TAny *aPtr)
+    {
+    FLOG(_L("CDevEncProgressObserver StaticTimerExpiry() >>"));
+
+    CDevEncProgressObserver* obj = (CDevEncProgressObserver*) aPtr;
+    TRAPD( err,  obj->CheckProgressL());
+    FLOG(_L("ERROR =  %d"),err);
+    
+    FLOG(_L("CDevEncProgressObserver StaticTimerExpiry() <<"));
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::StartMonitoringL
+// Monitors for connection status
+// This method don't leave
+// -----------------------------------------------------------------------------
+
+void CDevEncProgressObserver::StartMonitoringL(CDevEncSessionBase* aSession)
+    {
+    FLOG(_L("CDevEncProgressObserver::StartMonitoringL >>"));
+
+    __ASSERT_ALWAYS( aSession, User::Panic(KFotaPanic, KErrArgument) );
+    
+    iEncMemorySession = aSession;
+    iProgressDlg->ShowProgressDialogL();
+
+    iPeriodicTimer = CPeriodic::NewL (EPriorityMore) ;
+    iPeriodicTimer->Start (
+            TTimeIntervalMicroSeconds32(KNfeTimeInterval)
+            ,TTimeIntervalMicroSeconds32(KNfeTimeInterval)
+            ,TCallBack(StaticTimerExpiry,this) );
+
+    FLOG(_L("CDevEncProgressObserver::StartMonitoringL <<"));
+    }
+
+// -----------------------------------------------------------------------------
+// CDevEncProgressObserver::RunL()
+// Called when event accomplished
+// -----------------------------------------------------------------------------
+//
+void CDevEncProgressObserver::CheckProgressL()
+    {
+    FLOG(_L("CDevEncProgressObserver::CheckProgressL >>"));
+
+    TInt progress = GetStatusL();
+    FLOG(_L("NFE Progress = %d"),progress);
+    if (progress != KProgressComplete)
+        {
+        iProgressDlg->UpdateProgressDialogL(progress, 100);
+        FLOG(_L("nfe progress = %d"), progress);
+        }
+    else
+        {
+        FLOG(_L("nfe progress complete"));
+
+        if (iPeriodicTimer && iPeriodicTimer->IsActive())
+            {
+            iPeriodicTimer->Cancel();
+            }
+
+        iProgressDlg->UpdateProgressDialogL(progress, 100);
+        iProgressDlg->ProgressFinished();
+
+        delete iProgressDlg; iProgressDlg = NULL;
+
+        iObserver->ReportDevEncOpnCompleteL(KErrNone);
+        }
+    FLOG(_L("CDevEncProgressObserver::CheckProgressL <<"));
+    }
+
+
+
+
+TInt CDevEncProgressObserver::GetStatusL()
+    {
+    FLOG(_L("CDevEncProgressObserver::GetStatus >>"));
+    TInt ret (0);
+    User::LeaveIfError(iEncMemorySession->Progress(ret));
+
+    FLOG(_L("CDevEncProgressObserver::GetStatus << progress = %d"), ret);
+    return ret;
+    }
+
+TBool CDevEncProgressObserver::HandleDEProgressDialogExitL(TInt aButtonId)
+    {
+    //Do nothing
+    return ETrue;
+    }
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaDB.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,640 @@
+/*
+* 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:   Fota package state preservation 
+*
+*/
+
+
+
+#include "FotaDB.h"
+#include "FotaSrvDebug.h"
+#include <centralrepository.h>
+#include "fotaserverPrivateCRKeys.h"
+
+#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
+
+// ====================== MEMBER FUNCTIONS ===================================
+
+// ---------------------------------------------------------------------------
+// CFotaDB::CFotaDB()
+// ---------------------------------------------------------------------------
+CFotaDB::CFotaDB() : iIsOpen( EFalse )
+	,iTableAltercheck(ETrue)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDB::~CFotaDB()
+// ---------------------------------------------------------------------------
+CFotaDB::~CFotaDB()
+    {
+    //Delete columns set
+    if (iColSet)
+    	{
+    	delete iColSet;
+    	iColSet = NULL;
+    	}
+    //Close table
+   	iTable.Close();
+   	
+   	//Close database
+   	iStateDB.Close();
+   	
+   	//Close file server session
+    if (iFSSession.Handle())
+    	iFSSession.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::NewL()
+// ---------------------------------------------------------------------------
+CFotaDB* CFotaDB::NewL()
+    { 
+    CFotaDB* self=new(ELeave) CFotaDB();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::ConstructL()
+// ---------------------------------------------------------------------------
+void CFotaDB::ConstructL()
+    {
+    TInt err;
+    TBuf<KMaxPath>    tmp;
+    User::LeaveIfError( iFSSession.Connect() );
+    err = iFSSession.CreatePrivatePath( EDriveC );
+    if ( err != KErrNone && err != KErrAlreadyExists ) User::Leave( err );
+    User::LeaveIfError( iFSSession.SetSessionToPrivate( EDriveC ) );
+    User::LeaveIfError( iFSSession.SessionPath (tmp) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::CreateDatabaseL()
+// Creates db in private dir of fotaserver
+// ---------------------------------------------------------------------------
+void CFotaDB::CreateDatabaseL()
+    {
+    FLOG(_L("CFotaDB::CreateDatabaseL()  >>"));
+    TInt        err;
+    User::LeaveIfError( iStateDB.Create( iFSSession ,KDatabaseName ) );
+    User::LeaveIfError(iStateDB.Begin());
+    User::LeaveIfError(iStateDB.Execute(KCreateTable));
+    err = iStateDB.Commit();
+    if(err) 
+        {
+        FLOG(_L("      cdb err %d"),err);
+        iStateDB.Rollback();
+        User::Leave(err);
+        }
+    User::LeaveIfError( iStateDB.Compact() );
+    FLOG(_L("CFotaDB::CreateDatabaseL()  <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::AddPackageStateL
+// Adds state to db
+// ---------------------------------------------------------------------------
+void CFotaDB::AddPackageStateL(const TPackageState& aState
+                                ,const TDesC8& aPkgURL)
+    {
+    FLOG(_L("  CFotaDB::AddPackageStateL   >>"));
+    TInt            err;
+    RDbView         view;
+	CleanupClosePushL( view );
+    TPackageState   pkgstate(aState); 
+    pkgstate.iResult = -1; // result should be -1 if no Execs have been done
+	err = view.Prepare( iStateDB, TDbQuery(KSelectAll), RDbView::EInsertOnly);
+    __LEAVE_IF_ERROR(err);
+    FLOG(_L("  CFotaDB::AddPackageStateL   inserting. pkgid:%d result:%d \
+            state:%d"), pkgstate.iPkgId,pkgstate.iResult,pkgstate.iState);
+	view.InsertL();
+    StateToRowL( pkgstate,aPkgURL,view );
+	view.PutL();
+	CleanupStack::PopAndDestroy(); //view
+    FLOG(_L("  CFotaDB::AddPackageStateL   <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::GetAllL
+// Get all states
+// ---------------------------------------------------------------------------
+void CFotaDB::GetAllL( RArray<TInt>& aStates)
+	{
+	RDbView             view;
+	CleanupClosePushL( view );
+    
+	TInt err = view.Prepare( iStateDB, TDbQuery( KSelectAll ) );
+	__LEAVE_IF_ERROR(err);
+	view.EvaluateAll();
+
+	view.FirstL();
+    FLOG(_L("[fota DB] --- rows --------------------------------------------\
+        ----------------------- v"));		
+	while ( view.AtRow() )
+		{
+        view.GetL();
+        HBufC8*         url;
+        TPackageState   s = RowToStateL(url,view);
+        aStates.Append( s.iPkgId );
+        CleanupStack::PushL ( url );       
+        FLOG(_L("[fotaDB] pkgid: %d profid:%d state:%d  result:%d \
+        url: %d chars sessiontype:%d IapId:%d Pkgsize:%d UpdateLtr:%d"), s.iPkgId, s.iProfileId, s.iState,s.iResult
+        ,url->Des().Length(), s.iSessionType, s.iIapId, s.iPkgSize, s.iUpdateLtr );
+	    CleanupStack::PopAndDestroy(); // url
+		view.NextL();
+		}	
+    FLOG(_L("[fota DB] --- rows --------------------------------------------\
+        ----------------------- ^"));		
+    view.Close();
+	CleanupStack::PopAndDestroy(); //view
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::OpenDBL()
+// Opens database
+// ---------------------------------------------------------------------------
+void CFotaDB::OpenDBL()
+    {
+    FLOG(_L("CFotaDB::OpenDBL()"));
+    if (!iIsOpen)	//Prevents accidental opening of database twice
+    	{
+	    TInt        err;
+	    err     = iStateDB.Open ( iFSSession ,KDatabaseName);
+	    
+	    if ( err == KErrNotFound )
+	        {
+	        CreateDatabaseL();
+	        iTableAltercheck = EFalse; //Table created newly, hence no alteration required.
+	        }
+	    else if ( err != KErrNone )
+	        {
+	        FLOG(_L("[fota DB openDB]\t db open error: %d"), err);
+	        FLOG(_L("deleting fota DB and creating it again..."));
+	        err = iFSSession.Delete(KDatabaseName);
+	        CreateDatabaseL();
+	        User::LeaveIfError(err);
+	        }
+	    User::LeaveIfError( iTable.Open (iStateDB, KTblState) );
+	    iColSet = iTable.ColSetL();
+	    
+	   	//Check & correct if the table has wrong attributes - this is for data compatibility
+	    if (iTableAltercheck)
+	    	AlterTableIfRequiredL();
+	
+	    iIsOpen = ETrue;
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDB::CloseAndCommitDB
+// Closes and commits DB
+// ---------------------------------------------------------------------------
+void CFotaDB::CloseAndCommitDB()
+    {
+    if ( iColSet )
+        {
+        delete iColSet;
+        iColSet = NULL;
+        }
+    iTable.Close();
+    iStateDB.Close();
+    iIsOpen = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDB::IsOpen()
+// Chekcs if db is open
+// ---------------------------------------------------------------------------
+TBool CFotaDB::IsOpen()
+    {
+    return iIsOpen;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::GetStateL
+// Gets pkg state from db
+// ---------------------------------------------------------------------------
+TPackageState CFotaDB::GetStateL(const TInt aPkgId)
+    {   
+	RDbView             view;
+    TPackageState       s;
+	CleanupClosePushL( view ); 
+
+    s.iState = RFotaEngineSession::EIdle; // default state is idle
+
+    HBufC* select  = HBufC::NewLC( KSelect_where_packageid().Length() + 10); 
+    select->Des().Format (KSelect_where_packageid, aPkgId);
+
+    TInt err = view.Prepare( iStateDB, TDbQuery(*select) );
+	__LEAVE_IF_ERROR(err);
+	view.EvaluateAll();
+	view.FirstL();
+
+    while ( view.AtRow() )
+		{
+        view.GetL();
+        HBufC8* url;
+        s = RowToStateL( url,view ); 
+        CleanupStack::PushL( url );     
+        CleanupStack::PopAndDestroy(); // url
+		view.NextL();
+		}	
+	CleanupStack::PopAndDestroy(); //select
+	CleanupStack::PopAndDestroy(); //view
+    return s;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::SetStateL
+// Writes package state to DB. 
+// ---------------------------------------------------------------------------
+void CFotaDB::SetStateL( TPackageState& aState, const TDesC8& aPkgURL
+                        , TUint aChangedFields )
+    {
+    FLOG(_L("  CFotaDB::SetStateL  >>  id %d result %d  state %d sessiontype %d iapid %d pkgsize %d updateltr %d")
+                    ,aState.iPkgId, aState.iResult, aState.iState);
+    __ASSERT_ALWAYS( aChangedFields!=0, User::Panic(KFotaPanic, KErrArgument) );
+
+    TPackageState found = GetStateL( aState.iPkgId );
+    if ( found.iPkgId == KErrNotFound )
+        {
+        AddPackageStateL( aState, aPkgURL);
+        }
+    else
+        {
+        // sml try count must be reset, if state is set
+        if (aChangedFields & EFDBState )
+            {
+            aChangedFields = aChangedFields | EFDBSmlTryCount;
+            SetRetryCount(aState);
+            }
+
+        // Construct a SQL string for update. 
+        // Example: UPDATE State SET Result=40,State=4 WHERE pkgID=5
+        // 
+        TInt        sqlsize = 0;
+        _LIT8( KSqlbegin, "UPDATE State SET " );
+        TBuf<21>    sqlEnd;
+        HBufC8*     sql( NULL );
+        // determine characters needed 
+        sqlsize = DetermineCharNeeded(aChangedFields,aState,aPkgURL);
+        sqlEnd.AppendFormat( _L(" WHERE pkgID=%d"),aState.iPkgId );
+        
+        sql = HBufC8::NewLC( ((TDesC8)KSqlbegin).Length() + sqlsize 
+                                        + sqlEnd.Length() );
+
+        sql->Des().Append ( KSqlbegin );
+
+        if (aChangedFields & EFDBResult )   
+            {
+            // check FUMO compability
+ 			__ASSERT_ALWAYS( aState.iResult>=KErrNotFound 
+ 			&& aState.iResult<=600, User::Panic(KFotaPanic, KErrArgument) );
+            sql->Des().AppendFormat(_L8("Result=%d,"),aState.iResult);
+            }
+        if (aChangedFields & EFDBState )    
+            {
+            // check FUMO compability
+ 			__ASSERT_ALWAYS( aState.iState>=0 && aState.iState<=100
+ 				, User::Panic(KFotaPanic, KErrArgument) );
+            sql->Des().AppendFormat(_L8("State=%d,"),aState.iState);
+            }
+        if (aChangedFields & EFDBProfileId) 
+            {
+            sql->Des().AppendFormat(_L8("profileid=%d,"),aState.iProfileId);
+            }
+        if (aChangedFields & EFDBPkgUrl )   
+            {
+            sql->Des().AppendFormat(_L8("pkgurl='%S',"), &aPkgURL );
+            }
+        if (aChangedFields & EFDBPkgName )  
+            {
+            sql->Des().AppendFormat(_L8("pkgname='%S',") 
+                ,&(aState.iPkgName)) ;
+            }
+        if (aChangedFields & EFDBVersion )  
+            {
+            sql->Des().AppendFormat(_L8("Version='%S',")
+                    ,&(aState.iPkgVersion));
+            }
+        if ( aChangedFields & EFDBSmlTryCount )
+            {
+ 			__ASSERT_ALWAYS( aState.iSmlTryCount>=0
+ 				, User::Panic(KFotaPanic, KErrArgument) );            
+            sql->Des().AppendFormat(_L8("SmlTryCount=%d,")
+                , aState.iSmlTryCount );
+                    
+            }
+        if (aChangedFields & EFDBSessionType )    
+            {
+            sql->Des().AppendFormat(_L8("SessionType=%d,"),aState.iSessionType);
+            }
+        if (aChangedFields & EFDBIapId )    
+            {
+            // validate IAP ID
+ 			__ASSERT_ALWAYS( aState.iIapId>=-1 ,User::Panic(KFotaPanic, KErrArgument) );
+            sql->Des().AppendFormat(_L8("IapId=%d,"),aState.iIapId);
+            }
+        if (aChangedFields & EFDBPkgSize )    
+            {
+            // validate size
+ //			__ASSERT_ALWAYS( aState.iPkgSize>=0 ,User::Panic(KFotaPanic, KErrArgument) ); // to remove compiler warning
+            sql->Des().AppendFormat(_L8("PkgSize=%d,"),aState.iPkgSize);
+            }
+        if (aChangedFields & EFDBUpdateLtr )    
+            {
+            // validate bit
+            sql->Des().AppendFormat(_L8("UpdateLtr=%d,"),aState.iUpdateLtr);
+            }
+        // remove trailing ,
+        if ( aChangedFields )
+            {
+            sql->Des().SetLength ( sql->Des().Length()-1 );
+            }
+        sql->Des().Append ( sqlEnd );
+        HBufC*  sql2 = HBufC::NewLC( sql->Length() ); // to cleanupstack
+        sql2->Des().Copy(sql->Des());
+		FLOG(_L("  sql:%S"),sql2);
+        
+        User::LeaveIfError( iStateDB.Begin() );
+        User::LeaveIfError( iStateDB.Execute(*sql2) );
+        User::LeaveIfError( iStateDB.Commit() );
+        User::LeaveIfError( iStateDB.Compact() );
+
+        CleanupStack::PopAndDestroy( sql2 );  //sql2
+        CleanupStack::PopAndDestroy( sql );  //sql
+        }
+    FLOG(_L("  CFotaDB::SetStateL  <<"));
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDB::DetermineCharNeeded 
+// Returns the char needed fro the query 
+// ---------------------------------------------------------------------------
+
+TInt CFotaDB::DetermineCharNeeded(TInt aChangedFields,TPackageState& aState,const TDesC8& aPkgURL)
+
+{	 
+	
+	      TInt sqlsize=0;
+	      if (aChangedFields & EFDBResult )       sqlsize += 4 + 7 + 4; 
+        if (aChangedFields & EFDBState )        sqlsize += 4 + 5 + 4;
+        if (aChangedFields & EFDBProfileId )    sqlsize += 4 + 9 + 4;
+        if (aChangedFields & EFDBPkgUrl )       sqlsize += aPkgURL.Length() 
+                                                           + 6 + 4;
+        if (aChangedFields & EFDBPkgName )      sqlsize += 
+                                                   aState.iPkgName.Length() 
+                                                   + 7 + 4;
+        if (aChangedFields & EFDBVersion )      sqlsize += 
+                                                   aState.iPkgVersion.Length() 
+                                                   + 7 + 4;
+        if (aChangedFields & EFDBSmlTryCount )  sqlsize += 4 + 11 + 4;
+        
+        if (aChangedFields & EFDBSessionType )    sqlsize += 4 + 11 + 4;
+        if (aChangedFields & EFDBIapId )    sqlsize += 4 + 5 + 4;
+        if (aChangedFields & EFDBPkgSize )    sqlsize += 4 + 7 + 10;
+        if (aChangedFields & EFDBUpdateLtr ) sqlsize += 4 + 11 + 4;
+        
+        return sqlsize;
+	
+}
+
+// ---------------------------------------------------------------------------
+// CFotaDB::SetRetryCount
+// Sets the retry count
+// ---------------------------------------------------------------------------
+void CFotaDB::SetRetryCount(TPackageState& aState)
+{
+   CRepository* centrep( NULL);
+   TInt err = KErrNone;
+   TInt retry = 0;
+  
+   TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+   if ( centrep ) 
+     	   {
+        	err = centrep->Get( KGenericAlertRetries, retry );
+        	delete centrep; centrep = NULL;
+        	}
+        	if(err == KErrNone )
+        	    {
+            	    if(retry < 0 )
+            	    {
+            	    aState.iSmlTryCount = KDefaultSmlTryCount;
+            	    }
+                  	else if( retry == 0 )
+               	    {
+               	     aState.iSmlTryCount = 2 ;
+               	    }
+                	else if (retry > KMaximumSmlTryCount )
+               	    {
+               	     aState.iSmlTryCount = KMaximumSmlTryCount + 1;
+               	    }
+                   	else
+                    {
+                	  aState.iSmlTryCount = retry + 1;
+                    }
+        	    }
+        	 else
+        	    {
+        	    aState.iSmlTryCount = KDefaultSmlTryCount;
+        	    }
+}        	    
+        	    
+
+// ---------------------------------------------------------------------------
+// CFotaDB::DeleteStateL
+// Delete state
+// ---------------------------------------------------------------------------
+TInt CFotaDB::DeleteStateL(const TInt aPkgId)
+    {
+	FLOG(_L("[fota DB Delete]\tdeleting %d"),aPkgId);
+	TInt err( KErrNone );
+
+    if ( iStateDB.InTransaction() )
+    	{
+	    return ( KErrAccessDenied );
+	    }
+
+	_LIT( KSQLDeleteState,"DELETE FROM State WHERE PkgId = %d" );
+
+    HBufC*  del  = HBufC::NewLC( KSQLDeleteState().Length() + 10);
+    del->Des().Format (KSQLDeleteState, aPkgId);
+
+	iStateDB.Begin();
+
+	err = iStateDB.Execute( *del );
+	CleanupStack::PopAndDestroy( del );
+	if ( err < KErrNone )
+		{
+		iStateDB.Rollback();
+		return err;
+		}
+    FLOG(_L("[fota DB Delete]\tdeleted %d"),aPkgId);
+	return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDB::RowToStateL
+// Extracts db row contents to package state object and aPkgUrl
+// Returns url in aPkgURL parameter
+// ---------------------------------------------------------------------------
+TPackageState CFotaDB::RowToStateL(HBufC8*& aPkgUrl,const RDbView& aView)
+    {
+    TPackageState   s;
+    TInt            pkgid   = aView.ColInt( iColSet->ColNo(KColPkgId)  );
+	TInt            state   = aView.ColInt( iColSet->ColNo(KColState)  );
+	TInt            result  = aView.ColInt( iColSet->ColNo(KColResult)  );
+    TSmlProfileId   profileid(aView.ColInt( iColSet->ColNo(KColProfileId)));
+    TPtrC           pkgname = aView.ColDes( iColSet->ColNo(KColPkgName)  );
+    TPtrC           version = aView.ColDes( iColSet->ColNo(KColVersion)  );
+    TInt            smltrycount 
+                        = aView.ColInt( iColSet->ColNo(KColSmlTryCount) );
+    TInt            sessiontype = aView.ColInt( iColSet->ColNo(KColSessionType)  );
+    TInt            iapid = aView.ColInt( iColSet->ColNo(KColIapId)  );
+    TUint           pkgsize = aView.ColUint( iColSet->ColNo(KColPkgSize)  );
+    TBool			updateltr = aView.ColUint8( iColSet->ColNo(KColUpdateLtr));
+    
+    s.iPkgId            = pkgid;
+    s.iPkgName.Copy     (pkgname);
+    s.iPkgVersion.Copy  (version);
+    s.iProfileId        = profileid;
+    s.iResult           = result;
+    s.iState            = RFotaEngineSession::TState (state);
+    s.iSmlTryCount      = smltrycount;
+    s.iSessionType 		= sessiontype;
+    s.iIapId 			= iapid;
+    s.iPkgSize 			= pkgsize;
+    s.iUpdateLtr		= updateltr;
+
+    RDbColReadStream    rstream;
+    TInt                len = aView.ColLength(iColSet->ColNo(KColPkgUrl));
+    rstream.OpenLC(aView,iColSet->ColNo(KColPkgUrl) );
+    HBufC*             pkgurl         = HBufC::NewLC( len );
+    TPtr               ptr            = pkgurl->Des();
+    rstream.ReadL( ptr, len );
+
+    HBufC8*             tmp = HBufC8::NewL( pkgurl->Des().Length() );
+    tmp->Des().Copy ( pkgurl->Des() );
+    aPkgUrl = tmp;
+
+    CleanupStack::PopAndDestroy( pkgurl ); 
+    CleanupStack::PopAndDestroy( &rstream );
+    return s;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::StateToRowL
+// Converts state object to database row (into view object)
+// ---------------------------------------------------------------------------
+void CFotaDB::StateToRowL (const TPackageState& aPkg, const TDesC8& aPkgURL
+                                ,RDbView& aView)
+    {
+    HBufC*  pkgname = HBufC::NewLC(aPkg.iPkgName.Length());
+    HBufC*  version = HBufC::NewLC(aPkg.iPkgVersion.Length());
+
+    pkgname->Des().Copy(aPkg.iPkgName);
+    version->Des().Copy(aPkg.iPkgVersion);
+
+    aView.SetColL( iColSet->ColNo( KColPkgId ),      aPkg.iPkgId);
+	aView.SetColL( iColSet->ColNo( KColResult ),     aPkg.iResult);
+	aView.SetColL( iColSet->ColNo( KColState ),      aPkg.iState);
+	aView.SetColL( iColSet->ColNo( KColProfileId ),  aPkg.iProfileId);
+	aView.SetColL( iColSet->ColNo( KColPkgName ),    *pkgname );
+	aView.SetColL( iColSet->ColNo( KColVersion ),    *version );
+	aView.SetColL( iColSet->ColNo( KColSmlTryCount ), aPkg.iSmlTryCount );
+	aView.SetColL( iColSet->ColNo( KColSessionType ), aPkg.iSessionType );
+	aView.SetColL( iColSet->ColNo( KColIapId ), 	  aPkg.iIapId  );
+	aView.SetColL( iColSet->ColNo( KColPkgSize ), 	  aPkg.iPkgSize );
+	aView.SetColL( iColSet->ColNo( KColUpdateLtr ),	  aPkg.iUpdateLtr );
+
+    RDbColWriteStream wstream;
+    CleanupClosePushL( wstream );
+    wstream.OpenL( aView,iColSet->ColNo(KColPkgUrl) );
+    // Cannot write 8 bit descriptors to databae
+    HBufC* buf = HBufC::NewLC( aPkgURL.Length() );
+    buf->Des().Copy( aPkgURL );
+    wstream.WriteL( buf->Des() );
+
+    FLOG(_L("CFotaDB::StateToRowL  id:%d result:%d state:%d profileid:%d \
+    		name:%d chars version: %d chars url: %d chars sessiontype:%d iapid:%d pkgsize:%d updateltr = %d")
+    		,aPkg.iPkgId, aPkg.iResult, aPkg.iState, aPkg.iProfileId
+    		, pkgname->Des().Length(), version->Des().Length()
+    		, buf->Des().Length(),aPkg.iSessionType,aPkg.iIapId,aPkg.iPkgSize, aPkg.iUpdateLtr);
+
+    CleanupStack::PopAndDestroy( buf );
+    CleanupStack::PopAndDestroy( &wstream );
+    CleanupStack::PopAndDestroy( version );
+    CleanupStack::PopAndDestroy( pkgname );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDB::AlterTableIfRequiredL()
+// Adds the new attributes when fota state table is old.
+// ---------------------------------------------------------------------------
+void CFotaDB::AlterTableIfRequiredL()
+	{
+    FLOG(_L("CFotaDB::AlterTableIfRequired >>"));
+	TInt noofcol = iTable.ColCount();
+	//noofcol = 9 means old database; alteration is needed
+	if (noofcol!=KNoOfDBFields)
+		{
+		FLOG(_L("FotaState table is incompatible; needs alteration!"));
+	    User::LeaveIfError(iStateDB.Begin());
+
+
+	    TInt err (KErrNone);
+	    err = iStateDB.Execute(KAlterTable);
+	    if (!err)
+	    	{
+	    	err = iStateDB.Commit();
+		    if(err) 
+		        {
+		        FLOG(_L(" FotaState table alteration err2 %d, deleting it and recreating it again"),err);
+		    	CloseAndCommitDB();
+		        User::LeaveIfError (iFSSession.Delete(KDatabaseName));
+		        }
+	    	}
+	    else
+	    	{
+	    	FLOG(_L(" FotaState table alteration err1 %d, deleting it and recreating it again"),err);
+	    	CloseAndCommitDB();
+	    	User::LeaveIfError (iFSSession.Delete(KDatabaseName));
+	    	}
+	    if (!err)
+	    	{
+	    	User::LeaveIfError( iStateDB.Compact() );
+	    	CloseAndCommitDB();
+		    FLOG(_L("FotaState table altered successfully, reopening it again."));
+			iTableAltercheck = EFalse;
+	    	}
+	    OpenDBL();
+		}
+	else
+		iTableAltercheck = EFalse;
+
+    FLOG(_L("CFotaDB::AlterTableIfRequired <<"));
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaDLProgressDlg.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* 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:   Progress dlg for download
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "FotaDLProgressDlg.h"
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CFotaDLProgressDlg::CFotaDLProgressDlg
+// ---------------------------------------------------------------------------
+CFotaDLProgressDlg::CFotaDLProgressDlg( CEikDialog** aSelfPtr
+            , TBool aVisibilityDelayOff, MDLProgressDlgObserver* aObserver, TInt aNoteType)
+                : CAknProgressDialog( aSelfPtr, aVisibilityDelayOff )
+                    ,iNoteType(aNoteType)
+                    ,iObserver( aObserver )
+                    
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+CFotaDLProgressDlg::~CFotaDLProgressDlg()
+    {
+    if (iSelfPtr) 
+        {
+        *iSelfPtr = NULL;
+        iSelfPtr = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDLProgressDlg::OkToExitL
+// Called by framework when the Softkey is pressed.
+// ---------------------------------------------------------------------------
+//
+TBool CFotaDLProgressDlg::OkToExitL( TInt aButtonId )
+    {
+    TBool result( ETrue );
+    iObserver->HandleDLProgressDialogExitL( aButtonId );
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDLProgressDlg::OfferKeyEventL
+// ---------------------------------------------------------------------------
+TKeyResponse CFotaDLProgressDlg::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/
+                                                    ,TEventCode /*aType*/)
+    {
+    return EKeyWasNotConsumed;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaNetworkRegStatus.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,391 @@
+/*
+* 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:   GPRS and Wlan status getter for sending Generic Alerts
+*
+*/
+
+
+
+// INCLUDE FILES
+
+//System Includes
+#include <startupdomainpskeys.h>	//GlobalRFsStates
+#include <rconnmon.h>	//RConnectionMonitor
+#include <featmgr.h>	//Feature Manager
+#include <features.hrh>	//Feature Manager
+#include <cmconnectionmethoddef.h>
+#include <cmmanagerext.h>
+#include <cmpluginwlandef.h>
+#include <cmpluginpacketdatadef.h>
+
+//User Includes
+#include "FotaServer.h"
+#include "FotaNetworkRegStatus.h"
+
+
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::NewL
+// Symbian 2-Phase construction, NewL used for creating object of this class
+// This method can leave
+// -----------------------------------------------------------------------------
+
+CFotaNetworkRegStatus* CFotaNetworkRegStatus::NewL(CFotaServer* aObserver)
+	{
+	CFotaNetworkRegStatus* self = CFotaNetworkRegStatus::NewLC(aObserver);
+	CleanupStack::Pop(self);
+	return self;	
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::NewLC
+// Symbian 2-Phase construction, NewLC used for creating object of this class
+// This method can leave
+// -----------------------------------------------------------------------------
+
+CFotaNetworkRegStatus* CFotaNetworkRegStatus::NewLC(CFotaServer* aObserver)
+	{
+	CFotaNetworkRegStatus* self = new (ELeave) CFotaNetworkRegStatus (aObserver);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::ConstructL
+// Symbian 2-Phase construction, ConstructL used for constructing the members of this class
+// This method can leave
+// -----------------------------------------------------------------------------
+
+void CFotaNetworkRegStatus::ConstructL()
+	{
+	iTimer.CreateLocal();
+	iMonitor.ConnectL();
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::CFotaNetworkRegStatus
+// C++ Constructor
+// This method shouldn't leave
+// -----------------------------------------------------------------------------
+
+CFotaNetworkRegStatus::CFotaNetworkRegStatus(CFotaServer* aObserver) : 
+    CActive( CActive::EPriorityStandard ), iObserver(aObserver), iRetriesLeft (KRetries), iGlobalRFState(EFalse)
+    {
+     CActiveScheduler::Add( this ); // Add AO to current active scheduler
+    }
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::~CFotaNetworkRegStatus
+// C++ Desctructor
+// This method shouldn't leave
+// -----------------------------------------------------------------------------
+
+CFotaNetworkRegStatus::~CFotaNetworkRegStatus()
+	{
+	Cancel();
+
+	iTimer.Close();
+	iMonitor.Close();
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::DoCancel()
+// Cancels currently active notifier, if such exists
+// -----------------------------------------------------------------------------
+//
+void CFotaNetworkRegStatus::DoCancel()
+	{
+	FLOG(_L("CFotaNetworkRegStatus::DoCancel >>"));
+	
+	if(IsActive())
+		{
+		iTimer.Cancel();
+//		Cancel();
+		}
+		
+	FLOG(_L("CFotaNetworkRegStatus::DoCancel <<"));
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::StartMonitoringL
+// Monitors for connection status
+// This method don't leave
+// -----------------------------------------------------------------------------
+
+void CFotaNetworkRegStatus::StartMonitoringL()
+    {
+    FLOG(_L("CFotaNetworkRegStatus::StartMonitoringL >>"));
+	
+	//Check offline state
+	FLOG(_L("Check GlobalRF state..."));
+	if (!iGlobalRFState)
+		{
+		iGlobalRFState = CheckGlobalRFState();	
+		}
+	
+	if (iGlobalRFState)
+		{
+		//Check registration state only if iGlobalRFState is true
+		FLOG(_L("Check registration state..."));
+		if (CheckNetworkRegStateL())
+			{
+			//If both are successful report complete
+			FLOG(_L("Network Registration is successful, sending Status as success to FotaServer"));
+			iObserver->ReportNetworkStatus(ETrue);
+			return;
+			}
+		}
+	//If one of them is not successful, start timer and retry KRetries times...
+	
+	if (--iRetriesLeft>=0)
+		{
+		FLOG(_L("Retry count... [%d]"),KRetries-iRetriesLeft);
+		iTimer.After(iStatus,KTimeInterval); 
+		if (!IsActive())
+			SetActive();
+		}
+	else
+		{
+		FLOG(_L("Maximum retries (%d) reached, sending Status as failure to FotaServer"), KRetries);
+		iObserver->ReportNetworkStatus(IsWlanSupportedL());		
+		}
+
+	FLOG(_L("CFotaNetworkRegStatus::StartMonitoringL <<"));
+    }
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::RunL()
+// Called when event accomplished
+// -----------------------------------------------------------------------------
+//
+void CFotaNetworkRegStatus::RunL()
+    {
+    FLOG(_L("CFotaNetworkRegStatus::RunL >>"));
+    
+	if (iStatus==KErrNone)
+		{
+		StartMonitoringL();
+		}
+	else
+		{
+		iObserver->ReportNetworkStatus(EFalse);	
+		}
+
+	FLOG(_L("CFotaNetworkRegStatus::RunL <<"));
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::RunError
+// Called when RunL leaves
+// This method can't leave
+// -----------------------------------------------------------------------------
+
+TInt CFotaNetworkRegStatus::RunError(TInt aError)
+	{
+	FLOG(_L("CFotaNetworkRegStatus::RunL >>"));
+	iObserver->ReportNetworkStatus(EFalse);			
+	FLOG(_L("CFotaNetworkRegStatus::RunL <<"));
+	return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::CheckGlobalRFState
+// Checks for GlobalRFState, set by Starter
+// This method can't leave
+// -----------------------------------------------------------------------------
+
+TBool CFotaNetworkRegStatus::CheckGlobalRFState()
+{
+	FLOG(_L("CFotaNetworkRegStatus::CheckGlobalRFState >>"));
+	
+	RProperty prop;
+	TInt val = KErrNone;
+	TInt err = KErrNone;
+	TInt status = EFalse;
+	
+	err = prop.Get(KPSUidStartup, KPSGlobalSystemState, val);
+	if (err==KErrNone && val==ESwStateNormalRfOn)
+		{
+		//Phone is not offline. Check for Network Registration status
+		FLOG(_L("Phone is online. Check for Network Registration status"));
+		status = ETrue;
+		}
+	else
+		{
+		//Phone is offline. No Network activities allowed.
+		FLOG(_L("Phone is offline. No Network activities allowed."));
+		status = EFalse;
+		}
+	FLOG(_L("CFotaNetworkRegStatus::CheckGlobalRFState, status = %d <<"),status);	
+	return status;
+}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::CheckNetworkRegStatusL
+// Checks for Network registration status
+// This method can leave
+// -----------------------------------------------------------------------------
+
+TBool CFotaNetworkRegStatus::CheckNetworkRegStateL()
+	{
+	FLOG(_L("CFotaNetworkRegStatus::CheckNetworkRegStateL >>"));
+	
+	TBool status = EFalse;
+	
+	TInt registrationStatus (KErrNone);
+	TRequestStatus status1;
+	iMonitor.GetIntAttribute( EBearerIdGSM,  // See bearer ids from TConnMonBearerId
+	                         0, 
+	                         KNetworkRegistration, 
+	                         registrationStatus, 
+	                         status1 );
+	User::WaitForRequest( status1 );
+
+	if ( status1.Int() == KErrNone )
+	    {
+	    switch (registrationStatus)
+	    	{
+	    		case ENetworkRegistrationHomeNetwork:
+	    		case ENetworkRegistrationRoaming:
+						{
+						status = ETrue;
+						break;	
+						}
+				default:
+						{
+	    				/* Includes - 	ENetworkRegistrationNotAvailable:
+	    								ENetworkRegistrationUnknown:
+	    								ENetworkRegistrationNoService:
+	    								ENetworkRegistrationEmergencyOnly:
+	    								ENetworkRegistrationSearching:
+	    								ENetworkRegistrationBusy:
+	    								ENetworkRegistrationDenied:*/
+	    				status = EFalse;
+	    				break;
+	    				}
+	    	}
+	    }
+	    
+	FLOG(_L("CFotaNetworkRegStatus::CheckNetworkRegStateL, status = %d <<"),status);    
+	return status;
+	}
+	
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::IsWlanSupportedL
+// Checks whether Wlan supported on device and active
+// This method can leave
+// -----------------------------------------------------------------------------
+	
+TBool CFotaNetworkRegStatus::IsWlanSupportedL()
+	{
+	FLOG(_L("CFotaNetworkRegStatus::IsWlanSupportedL >>"));
+	
+	TBool status = EFalse;
+	
+	FeatureManager::InitializeLibL();
+	if (FeatureManager::FeatureSupported( KFeatureIdProtocolWlan  )) // check for feature enabled
+		{
+		status = ETrue;
+		}
+	
+	FeatureManager::UnInitializeLib();
+
+#if defined(__WINS__)
+	status = ETrue;
+#endif
+	
+	FLOG(_L("CFotaNetworkRegStatus::IsWlanSupportedL, status = %d <<"),status);
+	return status;
+	}
+
+// -----------------------------------------------------------------------------
+// CFotaNetworkRegStatus::IsConnectionPossibleL
+// Checks whether the network connection is possible in the given IAP Id
+// This method can leave
+// -----------------------------------------------------------------------------
+TBool CFotaNetworkRegStatus::IsConnectionPossibleL(TInt aIapid)
+	{
+	FLOG(_L("CFotaNetworkRegStatus::IsConnectionPossibleL >>"));
+	TBool status (EFalse);
+	
+	TUint32 bearer = FindBearerL(aIapid);
+	if( bearer == KUidPacketDataBearerType )
+	{
+	FLOG(_L("Bearer is Packet data"));
+	if( CheckGlobalRFState() && CheckNetworkRegStateL() )
+		{
+		FLOG(_L("Network is up and connection is possible "));
+		status = ETrue;
+		}
+	else
+		{
+		FLOG(_L("Network is not up and connection is not possible "));
+		status = EFalse;
+		}
+	}
+	else if( bearer == KUidWlanBearerType )//for wlan or other bearers
+		{
+		FLOG(_L("Bearer is wlan and proceeding for download "));
+		//proceed & this else loop to be removed
+		status = ETrue;
+		}
+	else
+		{
+		FLOG(_L("Bearer is not packet data or WLAN"));
+		}
+	
+	FLOG(_L("CFotaNetworkRegStatus::IsConnectionPossibleL, status = %d <<"),status);
+	return status;
+	}
+
+
+// ----------------------------------------------------------------------------------------
+// CFotaDownload::FindBearerId
+// Finds the Bearer Id for a given IAP Id
+// ----------------------------------------------------------------------------------------
+TUint32 CFotaNetworkRegStatus::FindBearerL(TInt aIapId)
+	{
+	FLOG(_L("CFotaNetworkRegStatus::FindBearerL: %d"),aIapId);
+	TUint32 bearer = 0;
+	TInt err( KErrNone );
+	 // Query CM Id
+	TInt cmId ( aIapId );			        
+	RCmManagerExt  CmManagerExt;
+	TRAP( err, CmManagerExt.OpenL() );
+	FLOG(_L("CmManagerExt.OpenL() with error as  %d"),err);	
+    if( err == KErrNone )
+    	{
+    	RCmConnectionMethodExt cm;
+    	TRAP( err, cm = CmManagerExt.ConnectionMethodL( cmId ) );			        	
+    	FLOG(_L("CmManagerExt.ConnectionMethodL with error as  %d"),err);
+	    if ( err == KErrNone )
+	        {	        
+	        CleanupClosePushL( cm );	  
+	        FLOG(_L("cm pushed to cleanupstack "));
+	        bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );	        			        
+	        FLOG(_L("bearer is %d "),bearer);
+		    CleanupStack::PopAndDestroy();  // cm	  
+	        FLOG(_L("cm poped & destroyed from cleanupstack "));
+	        }	  
+	    
+	    CmManagerExt.Close();
+	    FLOG(_L("CmManagerExt closed "));
+    	}
+    FLOG(_L("CFotaNetworkRegStatus::FindBearerL end with bearer: %d"),bearer);				
+    return bearer;
+	}
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaReminderDlg.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,213 @@
+/*
+* 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:   methods for CFotaReminderDlg
+*
+*/
+
+
+
+#include <fotaserver.rsg>
+#include "FotaReminderDlg.h"
+
+#include "FotaDB.h"
+#include "FotaSrvDebug.h"
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::NewLC
+// Two-phase construction
+// ---------------------------------------------------------------------------
+//
+CFotaReminderDlg* CFotaReminderDlg::NewLC(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent)
+	{
+	CFotaReminderDlg* self = new (ELeave) CFotaReminderDlg(aSelectedItem, aItemArray, aEvent);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::NewL
+// Two-phase construction
+// ---------------------------------------------------------------------------
+//
+CFotaReminderDlg* CFotaReminderDlg::NewL(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent)
+	{
+	CFotaReminderDlg* self = CFotaReminderDlg::NewLC(aSelectedItem, aItemArray, aEvent);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::~CFotaReminderDlg
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CFotaReminderDlg::~CFotaReminderDlg()
+	{
+	FLOG(_L("CFotaReminderDlg::~CFotaReminderDlg   >>"));
+	iAppKeyClient.Close();
+	FLOG(_L("CFotaReminderDlg::~CFotaReminderDlg   <<"));
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::CFotaReminderDlg
+// Constructor.
+// ---------------------------------------------------------------------------
+//	
+CFotaReminderDlg::CFotaReminderDlg(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent):
+								CAknRadioButtonSettingPage( R_SETTING_REMAINDER, aSelectedItem, aItemArray ),
+    	                        iSelectedItem(aSelectedItem),
+								iEvent(aEvent),
+								iIsAppKeySuppressed(EFalse)
+	{
+		
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::~CFotaReminderDlg
+// Two-phase construction.
+// ---------------------------------------------------------------------------
+//	
+void CFotaReminderDlg::ConstructL()
+	{
+	FLOG(_L("CFotaReminderDlg::ConstructL   >>"));
+	
+	SuppressAppKey(ETrue);
+
+	CAknRadioButtonSettingPage::ConstructL();
+	iList = ListBoxControl();
+
+	FLOG(_L("CFotaReminderDlg::ConstructL   <<"));    
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::ActivateL
+// Used to activate the radiobuttonsettingpage.
+// ---------------------------------------------------------------------------
+//
+void CFotaReminderDlg::ActivateL()
+	{
+	FLOG(_L("CFotaReminderDlg::ActivateL   >>"));
+
+	//iList->SetCurrentItemIndexAndDraw(0);
+	CAknRadioButtonSettingPage::ActivateL();
+
+	FLOG(_L("CFotaReminderDlg::ActivateL   <<"));
+	}
+	
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::OkToExitL
+// Determines if the dialog can be closed.
+// ---------------------------------------------------------------------------
+//
+TBool CFotaReminderDlg::OkToExitL( TInt aButtonId )
+	{
+   	FLOG(_L("CFotaReminderDlg::OkToExitL   >>"));
+
+    TBool IsAccepted = aButtonId;
+
+    if ( IsAccepted )
+        {
+        iSelectedItem = iList->CurrentItemIndex();
+        }
+
+	SuppressAppKey(EFalse);
+	FLOG(_L("CFotaReminderDlg::OkToExitL   <<"));
+
+    return ETrue;
+    }
+    	
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::ProcessCommandL
+// Process events from softkeys
+// ---------------------------------------------------------------------------
+//
+void CFotaReminderDlg::ProcessCommandL( TInt aCommandId )
+	{
+   	FLOG(_L("CFotaReminderDlg::ProcessCommandL   >>"));
+
+    if ( aCommandId == EAknSoftkeyOk )
+    	{
+    	AttemptExitL(ETrue);
+    	}
+    	
+    if (aCommandId == EAknSoftkeyCancel ||
+         aCommandId == EAknCmdExit)
+        {
+        AttemptExitL( EFalse );
+        }
+
+   	FLOG(_L("CFotaReminderDlg::ProcessCommandL   <<"));
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::OfferKeyEventL
+// This routine routes the keys to the editor.
+// ---------------------------------------------------------------------------
+//	
+TKeyResponse CFotaReminderDlg::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+	FLOG(_L("CFotaReminderDlg::OfferKeyEventL   >>"));
+   
+	/*if (iResumeOnFG && iIsDlgOpen)
+    {
+		TApaTaskList taskList(CEikonEnv::Static()->WsSession());
+		TApaTask task=taskList.FindApp(TUid::Uid(KFotaServerUid));
+		if(task.Exists())
+			task.BringToForeground();
+
+    }
+    
+    iResumeOnFG = EFalse;
+    //Menu key is pressed when reminder dialog is shown
+ 	TBool aStartDmUi (EFalse);   
+    if (aKeyEvent.iCode == EKeyApplication0)
+    {
+    	iResumeOnFG = ETrue;
+		aStartDmUi = ETrue;	
+    }*/
+   
+    iEvent = aType;
+    TKeyResponse aResp (EKeyWasConsumed );
+    aResp = CAknRadioButtonSettingPage::OfferKeyEventL( aKeyEvent, aType );
+    
+    FLOG(_L("CFotaReminderDlg::OfferKeyEventL   <<"));
+    return aResp;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaReminderDlg::SuppressAppKey
+// Used to suppress the menu/app key
+// ---------------------------------------------------------------------------
+//
+void CFotaReminderDlg::SuppressAppKey(TBool aValue)
+	{
+	FLOG(_L("CFotaReminderDlg::SuppressAppKey   >>"));
+
+	if (iIsAppKeySuppressed!=aValue)
+		{	
+		
+		TInt error = iAppKeyClient.ConnectAndSendAppsKeySuppress(aValue);
+		FLOG(_L("Return for suppress (%d)....%d"),aValue,error);
+		iIsAppKeySuppressed = aValue;
+		}
+
+	FLOG(_L("CFotaReminderDlg::SuppressAppKey   <<"));
+	}
+		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaServer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,2592 @@
+/*
+* 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:   Fota server update and download functionality 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <aknenv.h>
+#include <apgtask.h>
+#include <apgwgnam.h>
+#include <schtime.h>
+#include <csch_cli.h>
+#include <e32property.h>
+#include <nsmldmconst.h>
+#include <cmmanager.h>
+#include <cmconnectionmethod.h>
+#include <DevManInternalCRKeys.h>
+#include <nsmlconstants.h>
+#include <centralrepository.h>
+#include <sysversioninfo.h>
+#include "FotaSrvApp.h"
+#include "FotaServer.h"
+#include "FotaSrvDebug.h"
+#include "FotasrvSession.h"
+#include "fotaConst.h"
+#include "nsmldmtreedbclient.h"
+#include "fotaserverPrivatePSKeys.h"
+#include "FotaNetworkRegStatus.h"
+_LIT(KSizePass, "contentsize");
+#include "DevEncController.h"
+#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
+// ============================= LOCAL FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// ToDesC16LC
+// Converts to 16bit desc
+// ---------------------------------------------------------------------------
+HBufC* ToDesC16LC( const TDesC8& a )
+    {
+    HBufC* bf = HBufC::NewLC( a.Length() );
+    bf->Des().Copy(a);
+    return bf;
+    }
+// ---------------------------------------------------------------------------
+// GetPredefinedNodeL
+// function to get preconfigured node for FUMO
+// ---------------------------------------------------------------------------
+void GetPredefinedNodeL(TDes8& aNode)
+	{
+	FLOG(_L("GetPredefinedNodeL() Begin"));
+    CRepository* centrep( NULL);
+	aNode.Zero();
+   	centrep = CRepository::NewLC( TUid::Uid(0x101F9A0A) );
+
+    if ( centrep )
+	    {
+	    FLOG(_L("centralrepository found End"));
+    	TFullName temp;
+		
+    	if (centrep->Get( KDevManFUMOPredefinedNodes, temp )==KErrNone && temp.Length() )
+			{
+			temp.Trim();
+			aNode.Copy(temp);
+			}
+		CleanupStack::PopAndDestroy(centrep);
+	    }
+	FLOG(_L("GetPredefinedNodeL() End"));	    
+	}
+// ---------------------------------------------------------------------------
+// DeleteFUMOTreeL
+// function to get preconfigured node for FUMO
+// ---------------------------------------------------------------------------
+void DeleteFUMOTreeL ()
+    {
+    FLOG(_L("DeleteFUMOTreeL() Begin"));
+    const TUint32 KNSmlFotaAdapterUid = 0x101F9A09;
+    _LIT8( KNSmlFumoPath, "FUMO" );
+    _LIT8( KNSmlFumoSeparator, "/" );
+    const TInt KGranularity = 10;
+    TBuf8<KMaxFullName> temp;
+	GetPredefinedNodeL(temp);
+    RNSmlDMCallbackSession session;
+    User::LeaveIfError(session.Connect());
+    CleanupClosePushL(session);
+    
+    CBufBase *emptyList = CBufFlat::NewL(0);
+    CleanupStack::PushL(emptyList);
+    CArrayFixFlat <TSmlDmMappingInfo>* UriSegList;
+    UriSegList = new (ELeave) CArrayFixFlat <TSmlDmMappingInfo> (KGranularity);
+    
+    CleanupStack::PushL(UriSegList);
+			
+    session.GetUriSegListL(KNSmlFotaAdapterUid,KNSmlFumoPath,*UriSegList);
+    
+    for ( TUint16 i=0;i<UriSegList->Count();i++)
+        {
+        	if (temp.Length() && UriSegList->At(i).iURISeg.Find( temp ) != KErrNotFound)
+            {
+              FLOG(_L("DeleteFUMOTreeL predefined match =%S"), &temp);
+              continue;
+            }
+       
+       	TBuf8<KMaxFullName> tempFumo;
+       	tempFumo.Append(KNSmlFumoPath);
+       	tempFumo.Append(KNSmlFumoSeparator);
+       	tempFumo.Append(UriSegList->At(i).iURISeg);
+       	FLOG(_L("DeleteFUMOTreeL() call update mapping info for node %S"),&tempFumo);
+        session.UpdateMappingInfoL(KNSmlFotaAdapterUid,tempFumo,*emptyList);
+        
+        }
+    // session.UpdateMappingInfoL(KNSmlFotaAdapterUid,KNSmlFumoPath,*emptyList);
+	CleanupStack::PopAndDestroy(UriSegList); 
+    CleanupStack::PopAndDestroy(emptyList); 
+    CleanupStack::PopAndDestroy(&session); //session
+    FLOG(_L("DeleteFUMOTreeL() End"));
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaServer::GetProfileDataL
+// ---------------------------------------------------------------------------
+void CFotaServer::GetProfileDataL( RSyncMLSession* aSyncml
+    ,const TSmlProfileId aProf, TInt& aIapId, TSmlServerAlertedAction& aSrvAA
+    ,TBool& aUIJob, TInt& aSanVal)
+	{
+    FLOG(_L("CFotaServer::GetProfileDataL prof %d"),aProf);
+    __ASSERT_ALWAYS( aSyncml, User::Panic(KFotaPanic, KErrArgument) );
+    __ASSERT_ALWAYS( aSyncml->Handle(), User::Panic(KFotaPanic, KErrBadHandle) );
+    // GET IAP FROM PROFILE ----------------------------------------------
+    TSmlJobId               jobid( KErrNotFound );
+    TInt                    jobidFromUI( KErrNotFound );
+    RSyncMLDevManProfile    smlprof;
+    RArray<TSmlTransportId> connections;
+    TSmlTransportId         transport;
+    RSyncMLConnection       connection;
+                   
+    CleanupClosePushL(smlprof);
+    CleanupClosePushL(connections);
+    CleanupClosePushL(connection);
+    FLOG(_L("[FotaServer]   1"));
+    
+    FLOG(_L("[FotaServer]   1.1 opening syncml \
+                        profileid %d "), aProf);
+    smlprof.OpenL(*aSyncml, aProf, ESmlOpenRead);
+    FLOG(_L("[FotaServer]  1.1"));
+    smlprof.ListConnectionsL(connections);
+    FLOG(_L("[FotaServer]  1.3"));
+    transport = connections[0];
+    connection.OpenL(smlprof,transport);
+    TBuf8<20> iapid2 = connection.GetPropertyL ( KNSmlIAPId );
+    TLex8 iapid3(iapid2);
+    iapid3.Val(aIapId);
+
+    // 1. Profile's "accepted" field.
+    aSrvAA = smlprof.SanUserInteraction ();
+    FLOG(_L("[FotaServer]  1.4 \
+                    SanUserInteraction:%d"),aSrvAA );
+
+    // 2. Has job been started from omadmappui. That is, did user start the job
+    TSmlUsageType dmusagetype(ESmlDevMan);
+    aSyncml->CurrentJobL( jobid,dmusagetype );
+    RProperty::Get( TUid::Uid(KOmaDMAppUid), KNsmlCurrentJobId, jobidFromUI);
+    aUIJob = ( jobidFromUI == jobid && jobid!=KErrNotFound );
+    
+    aSanVal = KErrNotFound; 
+    if ( aUIJob )
+    	{
+    	//First for not server alert or SAN not supported value is -1
+    	RProperty::Get( TUid::Uid(KOmaDMAppUid), KNsmlSanUIMode, aSanVal);
+    	if ( aSanVal != -1 ) //SAN Supported
+    	    {
+   	    	aUIJob = 0;
+    	    }
+    	}
+    FLOG(_L("  jobidFromUI: %d jobid: %d, aUIJob: %d, aSanVal: %d"),jobidFromUI,jobid,aUIJob,aSanVal);
+    CleanupStack::PopAndDestroy (&connection); 
+    CleanupStack::PopAndDestroy (&connections);
+    CleanupStack::PopAndDestroy (&smlprof); 
+	}
+
+// --------------------------------------------------------------------------
+// CreateDeviceManagementSessionL       
+// Creates DM session 
+// --------------------------------------------------------------------------
+void CFotaServer::CreateDeviceManagementSessionL( TPackageState& aState )
+    {
+    FLOG(_L("[cfotasever]   CreateDeviceManagementSessionL dms >> profid %d\
+    %d counts left ,sml handle %d, iNetworkAvailable=%d"), aState.iProfileId, aState.iSmlTryCount 
+    , iSyncMLSession.Handle(),iNetworkAvailable);
+	
+    SetStartupReason(EFotaPendingGenAlert);
+
+	if (!iNetworkAvailable)
+		{
+		iRetryingGASend = ETrue;
+		iStoredState = aState;
+		StartNetworkMonitorL();
+		}
+	else 
+		{
+
+	    TBool dbAlreadyOpen = iDatabase->IsOpen();
+	    TBool triesLeft( EFalse );
+ 		
+ 		iNetworkAvailable = EFalse; // to check network again when GA is sent next time
+ 		
+	    if ( iSyncMLSession.Handle() )
+	        {
+	        User::Leave( KErrAlreadyExists );
+	        }
+
+	    if ( !dbAlreadyOpen ) iDatabase->OpenDBL();
+	    // There is still tries left
+	    if ( aState.iSmlTryCount > 0 )
+	        {
+	        triesLeft = ETrue;
+	        FLOG(_L(" decrementing the retry count"));
+	        aState.iSmlTryCount = aState.iSmlTryCount - 1;
+	        iDatabase->SetStateL( aState, KNullDesC8, EFDBSmlTryCount );
+	        }
+	    // out of tries, set state to idle
+	    else
+	        {
+	        triesLeft = EFalse;
+	        FLOG(_L("   out of tries, resetting pkg state"));
+	        
+	        SetStartupReason(EFotaDefault);
+	        aState.iState = RFotaEngineSession::EIdle;
+	        aState.iResult = KErrNotFound;
+	        iDatabase->SetStateL( aState, KNullDesC8, EFDBState|EFDBResult );
+	        }
+	    if ( !dbAlreadyOpen ) iDatabase->CloseAndCommitDB();
+
+	    if ( triesLeft )
+	        {
+	        TInt iapid;
+	        TSmlServerAlertedAction tmp;
+	        TBool                   tmp2;
+	        TInt					tmp3;
+	        iSyncMLSession.OpenL(); 
+	        GetProfileDataL( &iSyncMLSession,aState.iProfileId,iapid,tmp,tmp2,tmp3);
+	        FLOG(_L("Using IAP: %d to send GA"),iapid);
+	        FLOG(_L("From Db Using IAP: %d to send GA"),aState.iIapId);
+	        RSyncMLDevManJob    dmJob;
+	        
+	        RProperty::Define(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,RProperty::EInt,KAllowAllPolicy,KWritePolicy);
+	        TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);
+			FLOG(_L("CFotaServer::CreateDeviceManagementSessionL KNSmlDMSilentJob set err %d"),r2);
+	        TBuf<10> genalertap,temp;
+	        genalertap.Zero();
+	        temp.Zero();	  
+	        genalertap.Append(KNSmlDMJobIapPrefix);
+	        temp.Num(aState.iIapId);//Decimal Iap
+	        if( temp.Length() <= KNSmlHalfTransportIdLength && 
+	            aState.iIapId > KErrNotFound && CheckIapExistsL(aState.iIapId) )
+	        	{
+	        	genalertap.AppendFill('0',KNSmlHalfTransportIdLength-temp.Length());
+	        	genalertap.Append(temp);
+	        	TLex gavalue(genalertap);
+	        	gavalue.Val(iIapId);
+	        	dmJob.CreateL( iSyncMLSession, aState.iProfileId,iIapId);	
+	        	iSyncMLAttempts = KSyncmlAttemptCount;
+	        	}
+	        else 
+	        	{
+	        	iSyncMLAttempts = 0;
+	        	dmJob.CreateL( iSyncMLSession, aState.iProfileId);
+	        	}
+
+			// If there's no iapid defined, sml will pop up connection dialog.
+			// In that case, only one connection attempt is allowed.
+	        iSyncJobId   = dmJob.Identifier();
+	        iSyncProfile = aState.iProfileId;
+	        dmJob.Close();
+	        iSyncMLSession.RequestEventL( *this ); 
+	        }
+	}
+
+    FLOG(_L("[cfotasever]   CreateDeviceManagementSessionL dms << profid %d")
+                            ,aState.iProfileId);
+    }
+
+
+// ============================= MEMBER FUNCTIONS ============================
+
+// --------------------------------------------------------------------------
+// CFotaServer::CFotaServer()   
+// --------------------------------------------------------------------------
+//
+CFotaServer::CFotaServer() : iInitialized(EFalse), iNeedToClose(0), iParentApp(0)
+, iDatabase(0),iDownloader(0), iUpdater(0)
+ , iDownloadFinalizer(0), iUpdateFinalizer(0), iTimedExecuteResultFile(0)
+ , iTimedSMLSessionClose(0), iStorage(0), iAppShutter(0), iMonitor (NULL), iSyncJobId(-1), iRetryingGASend (EFalse), iNetworkAvailable (EFalse)
+ , iIapId(KErrNotFound),iSessMode(0),iUserResume(KErrNotFound), iInstallupdClient(EFalse), iDEController(NULL)
+	{
+    RProcess pr; TFullName fn = pr.FullName();  TUint prid = pr.Id();
+	FLOG(_L( "CFotaServer::CFotaServer process(id %d)%S. this 0x%x"),prid,&fn
+        ,this);
+
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoExecuteResultFileL
+// Interprets result of update (file update.resp)
+// --------------------------------------------------------------------------
+//
+void CFotaServer::DoExecuteResultFileL()
+    {
+    FLOG(_L("CFotaServer::DoExecuteResultFileL() >>"));
+
+    if ( iTimedExecuteResultFile ) 
+        {
+        iTimedExecuteResultFile->Cancel();
+        delete iTimedExecuteResultFile;
+        iTimedExecuteResultFile = NULL;
+        }
+    iUpdater = CFotaUpdate::NewL(this);
+    iUpdater->ExecuteUpdateResultFileL( iFs );
+    FLOG(_L("CFotaServer::DoExecuteResultFileL() <<"));
+    }
+
+// --------------------------------------------------------------------------
+// StaticDoExecuteResultFile
+// --------------------------------------------------------------------------
+//
+static TInt StaticDoExecuteResultFile(TAny *aPtr)
+    {
+    FLOG(_L("[cfotaserver] StaticDoExecuteResultFile() >>"));
+    __ASSERT_ALWAYS( aPtr, User::Panic(KFotaPanic, KErrBadHandle) );
+    CFotaServer* srv = (CFotaServer*) aPtr;
+    TRAPD( err,  srv->DoExecuteResultFileL() );
+    if(err) 
+        {
+        FLOG(_L("[cfotaserver] StaticDoExecuteResultFile ERROR %d"),err);
+        TRAP_IGNORE(srv->DoDeleteUpdateResultFileL());
+        }
+
+    FLOG(_L("[cfotaserver] StaticDoExecuteResultFile() <<"));
+    return err;
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::CFotaServer()   
+// Constructor. Can't do all constructing since fotaserver might call itself
+// recursively (via downloadmgr). 
+// --------------------------------------------------------------------------
+//
+void CFotaServer::ConstructL(const TDesC &aFixedServerName)
+    {
+    FLOG(_L("CFotaServer::ConstructL() >> name=%S"), &aFixedServerName);
+    TBool   updated (EFalse);
+    TInt    err;
+    CAknAppServer::ConstructL( aFixedServerName );
+
+    User::LeaveIfError( iFs.Connect() );
+    
+    err = iFs.CreatePrivatePath(EDriveC);
+    if ( err != KErrNone && err != KErrAlreadyExists ) { User::Leave (err); }
+    User::LeaveIfError( iFs.SetSessionToPrivate( EDriveC ) );
+
+    if ( !iDatabase )
+        {
+        TRAPD( err,iDatabase = CFotaDB::NewL() );
+        if ( err ) 
+            {
+            FLOG(_L("CFotaServer::  DB creationg error %d"), err);
+            User::Leave( err );
+            }
+        }
+
+    updated = CFotaUpdate::CheckUpdateResults( iFs );
+
+    // Update has happened, and result file is in place
+    if ( updated )
+        {
+        FLOG(_L("scheduling update result file execution"));
+        if ( iTimedExecuteResultFile ) 
+            {
+            iTimedExecuteResultFile->Cancel();
+            delete iTimedExecuteResultFile;
+            iTimedExecuteResultFile = NULL;
+            }
+        iTimedExecuteResultFile = CPeriodic::NewL (EPriorityNormal) ;
+        iTimedExecuteResultFile->Start (
+            TTimeIntervalMicroSeconds32(KDownloadFinalizerWaitTime)
+            , TTimeIntervalMicroSeconds32(KDownloadFinalizerWaitTime)
+            , TCallBack(StaticDoExecuteResultFile,this) ) ;
+        }
+
+	iEikEnv = CEikonEnv::Static();
+    FLOG(_L("CFotaServer::ConstructL() <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::ClientAwareConstructL
+// Does rest of constructing, if not done. If parent of this fotaserver 
+// instance is another fotaserver, skip maintenance operations (since parent 
+// takes care of them). DmHOstserver triggers cleanup for states: 20,70,80
+// ,90,100 , must handle state 60 here
+// --------------------------------------------------------------------------
+void CFotaServer::ClientAwareConstructL( const RMessage2 &aMessage )
+    {
+    FLOG(_L("CFotaServer::ClientAwareConstructL >>"));
+    if ( iInitialized ) return;
+    CFotaSrvSession::TClient client 
+                    = CFotaSrvSession::CheckClientSecureIdL ( aMessage );
+	// temporary fix to keep FS from polluting FSW in case it was opened from omadmappui
+    if ( client == CFotaSrvSession::EOMADMAppUi || client == CFotaSrvSession::EFotaServer ||
+       client == CFotaSrvSession::ESoftwareChecker || client == CFotaSrvSession::ESoftwareCheckerBackground  ) 
+        {
+        //Loading the storage plugin (during DM UI launch) to adjust the reserved memory accordingly.
+        StoragePluginL();
+        iParentApp->SetUIVisibleL ( EFalse, ETrue ); // 
+        }
+
+    // Do constructing if client is other that fotaserver
+    if ( client != CFotaSrvSession::EFotaServer )
+        {
+        RArray<TInt>    states;
+        TPackageState   state;
+        CleanupClosePushL (states);
+        iDatabase->OpenDBL();
+        iDatabase->GetAllL ( states );
+    	TBool value (EFalse);
+    	if (iDownloader)
+    		{
+    		value = iDownloader->IsDownloadActive();
+    		}
+    	else
+    		{
+    		TInt err = RProperty::Get(TUid::Uid(KFotaServerUid), KFotaDownloadActive, value );
+    		FLOG(_L("value of KFotaDownloadActive & err as %d,%d "), (TInt)value,err);
+    		}
+    	FLOG(_L("Download active value is:%d "), (TInt)value);
+        // Loop states. 
+        for(TInt i = 0; i < states.Count(); ++i ) 
+            {
+            TPackageState   tmp;
+            TBool           toIdle(EFalse);
+            tmp = iDatabase->GetStateL(  states[i]  );
+            FLOG(_L("   1 got state id:%d state:%d result:%d"), tmp.iPkgId
+                , tmp.iState, tmp.iResult);
+            
+             if ( tmp.iState == RFotaEngineSession::EStartingUpdate )
+             
+             {
+             	TBool ispkgvalid= ETrue;
+             	TRAPD(err1,ispkgvalid= CheckSWVersionL()   )
+              if (!ispkgvalid && err1 == KErrNone)
+              {
+              StoragePluginL()->DeleteUpdatePackageL (  tmp.iPkgId );	
+             	tmp.iState    = RFotaEngineSession::EUpdateFailed;
+              tmp.iResult   = RFotaEngineSession::EResPackageMismatch;
+              iDatabase->SetStateL( tmp,KNullDesC8, EFDBState | EFDBResult );
+   
+             }	
+             }
+            // Update has been started (60)
+            // If there is no result file, means that update agent failed
+            // to run. Must get back to 50 to allow user to try again. 
+            if ( tmp.iState == RFotaEngineSession::EUpdateProgressing 
+                && iTimedExecuteResultFile==NULL )
+                {
+                FLOG(_L("     State 60 found, UA didnt run! id %d "), tmp.iPkgId);
+                tmp.iState    = RFotaEngineSession::EStartingUpdate;
+                iDatabase->SetStateL( tmp,KNullDesC8, EFDBState);
+                }
+
+            // These states need must trigger generic alert! (70+ )
+            if ( tmp.iState >= RFotaEngineSession::EUpdateFailed  )
+                {
+                if ( iSyncMLSession.Handle() == NULL )
+                    {
+                    iDatabase->CloseAndCommitDB();
+                    CreateDeviceManagementSessionL( tmp );
+                    iDatabase->OpenDBL();
+                    }
+                }
+
+            if (tmp.iState == RFotaEngineSession::EDownloadComplete && tmp.iResult == RFotaEngineSession::EResSuccessful )
+            	{
+                CreateDeviceManagementSessionL( tmp );
+            	}
+
+            if (value != 1) //if download is not active, EStartingDownload should be reset to EDownloadFailed
+            	{
+            	if (tmp.iState == RFotaEngineSession::EStartingDownload ||
+            			tmp.iState == RFotaEngineSession::EDownloadProgressing )
+            		{
+            		FLOG(_L("Resetting state %d to 20..."), tmp.iState);
+            		tmp.iState = RFotaEngineSession::EDownloadFailed;
+                    iDatabase->SetStateL( tmp,KNullDesC8, EFDBState ) ;
+                    iDatabase->CloseAndCommitDB();
+                    iDatabase->OpenDBL();
+            		}
+            	}
+
+            if ( tmp.iState == RFotaEngineSession::EDownloadFailed )
+                {
+                StoragePluginL()->DeleteUpdatePackageL( tmp.iPkgId ); 
+                tmp.iResult   = RFotaEngineSession::EResDLFailDueToNWIssues;
+                iDatabase->SetStateL( tmp,KNullDesC8, EFDBResult ) ;
+                iDatabase->CloseAndCommitDB();
+                CreateDeviceManagementSessionL( tmp );
+                iDatabase->OpenDBL();
+                }
+
+            // Reset package state to idle
+            if ( toIdle )
+                {
+                FLOG(_L("   2 resetting state %d to idle"), tmp.iPkgId);
+                tmp.iState    = RFotaEngineSession::EIdle;
+                iDatabase->SetStateL( tmp,KNullDesC8, EFDBState ) ;
+                DeleteFUMOTreeL();
+                }
+            }
+            iDatabase->CloseAndCommitDB();
+            CleanupStack::PopAndDestroy( &states );
+        }
+    else // client is child fotaserver
+        {
+        }
+    iInitialized = ETrue;
+    FLOG(_L("CFotaServer::ClientAwareConstructL <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaServer::StoragePluginL
+// Getter function for iStorage. If it doesn't exist, load it.
+// ---------------------------------------------------------------------------
+//
+CFotaStorage* CFotaServer::StoragePluginL()
+    {
+    if ( iStorage == NULL )
+        {
+        LoadStoragePluginL();
+        }
+    return iStorage;
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::LoadStoragePluginL 
+// Load update storage plugin via ecom framework.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::LoadStoragePluginL ()
+    {
+    FLOG(_L("CFotaServer::LoadStoragePluginL"));
+    if(iStorage)
+        {
+        UnLoadStoragePluginL ();
+        }
+    TUid                if_uid;
+    if_uid.iUid = ( KStorageIFUid );
+    RImplInfoPtrArray   pluginArray;
+    REComSession::ListImplementationsL( if_uid, pluginArray );
+    CleanupClosePushL( pluginArray );
+
+    if( pluginArray.Count() )
+        {
+        for( TInt i = 0; i < pluginArray.Count(); i++ )
+            {
+            CImplementationInformation* info = pluginArray[ i ];
+            TUid id = info->ImplementationUid();
+            delete info;
+            info = NULL;
+            iStorage =(CFotaStorage*) REComSession::CreateImplementationL( id
+                                        ,iStorageDtorKey); 
+            }
+        }
+    else
+        {
+        FLOG(_L("  storage plugin not found, ERROR"));
+        User::Leave ( KErrNotFound );
+        }
+    CleanupStack::PopAndDestroy( &pluginArray );
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::UnLoadStoragePluginL
+// Unloads storage plugin
+// --------------------------------------------------------------------------
+//
+void CFotaServer::UnLoadStoragePluginL ()
+    {
+    FLOG(_L("CFotaServer::UnLoadStoragePluginL"));
+    if ( iStorage ) 
+        {
+        delete iStorage;
+        iStorage=NULL;
+        }
+    FLOG(_L("    destroying"));
+    REComSession::DestroyedImplementation(iStorageDtorKey); // zeroes referenc
+                                                            // count of plugin
+    FLOG(_L("    finalclosing"));
+    REComSession::FinalClose();
+    }
+
+
+// --------------------------------------------------------------------------
+// StaticDoFinalizeUpdate
+// Intermediate function
+// --------------------------------------------------------------------------
+static TInt StaticDoFinalizeUpdate(TAny *aPtr)
+    {
+    FLOG(_L("[cfotaserver] StaticDoFinalizeUpdate() >>"));
+    CFotaServer* srv = (CFotaServer*) aPtr;
+    TRAPD( err,  srv->DoFinalizeUpdateL() );
+    if(err)
+        {
+        FLOG(_L("[cfotaserver] StaticDoFinalizeUpdate ERROR %d"),err);
+        }
+
+    FLOG(_L("[cfotaserver] StaticDoFinalizeUpdate() <<"));
+    return err;
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::FinalizeUpdate()
+// Initialize finalization of updater
+// --------------------------------------------------------------------------
+//
+void CFotaServer::FinalizeUpdateL()
+    {
+    FLOG(_L("CFotaServer::FinalizeUpdate() >>"));
+    if ( iUpdateFinalizer )
+        {
+        iUpdateFinalizer->Cancel();
+        delete iUpdateFinalizer;
+        iUpdateFinalizer=NULL;
+        }
+    iUpdateFinalizer = CPeriodic::NewL (EPriorityNormal) ;
+    iUpdateFinalizer->Start (
+                TTimeIntervalMicroSeconds32(KDownloadFinalizerWaitTime)
+                ,TTimeIntervalMicroSeconds32(KDownloadFinalizerWaitTime)
+                ,TCallBack(StaticDoFinalizeUpdate,this) ) ;
+    FLOG(_L("CFotaServer::FinalizeUpdate() <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoFinalizeUpdateL
+// Finalize update. Free resources
+// --------------------------------------------------------------------------
+//
+void CFotaServer::DoFinalizeUpdateL()
+    {
+    FLOG(_L("CFotaServer::DoFinalizeUpdateL() >>"));
+
+    // Free resources
+    FLOG(_L("iupdater = %d"), iUpdater);
+    if ( iUpdater ) 
+        {
+        FLOG(_L("Deleting iupdater..."));
+        iUpdater->Cancel();
+        delete iUpdater; 
+        iUpdater=NULL;
+        }
+    
+    if ( iUpdateFinalizer ) 
+        {
+        iUpdateFinalizer->Cancel();
+        }
+    // Hide UI
+    iParentApp->SetUIVisibleL ( EFalse, ETrue );
+    FLOG(_L("CFotaServer::DoFinalizeUpdateL() <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// StaticDoFinalizeDownload
+// Intermediate function
+// --------------------------------------------------------------------------
+static TInt StaticDoFinalizeDownload(TAny *aPtr)
+    {
+    FLOG(_L("[cfotaserver] StaticDoFinalizeDownload() >>"));
+    CFotaServer* srv = (CFotaServer*) aPtr;
+    TRAPD( err,  srv->DoFinalizeDownloadL() );
+    if(err)
+        {
+        FLOG(_L("[cfotaserver] StaticDoFinalizeDownload ERROR %d"),err);
+        }
+
+    FLOG(_L("[cfotaserver] StaticDoFinalizeDownload() <<"));
+    return err;
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::FinalizeDownload
+// Initialize finalization of download
+// --------------------------------------------------------------------------
+//
+void CFotaServer::FinalizeDownloadL( const TPackageState& aDLState )
+    {
+    FLOG(_L("CFotaServer::FinalizeDownload() >> state:%d result:%d")
+                ,aDLState.iState, aDLState.iResult);
+    __ASSERT_ALWAYS( iDownloader, User::Panic(KFotaPanic, KErrBadHandle ));
+    
+    SetStartupReason(EFotaDefault);
+          
+    if ( iDownloadFinalizer )
+        {
+        iDownloadFinalizer->Cancel();
+        delete iDownloadFinalizer;
+        iDownloadFinalizer=NULL;
+        }
+    iDownloadFinalizer = CPeriodic::NewL (EPriorityMuchMore) ;
+    iDLFinalizeState = aDLState;
+    
+    // Not restarting,quick finalize
+    if ( iDownloader->iRestartCounter<=0 )
+        {
+        iDownloadFinalizer->Start(
+                        TTimeIntervalMicroSeconds32(KDownloadFinalizerWaitTime)
+                        ,TTimeIntervalMicroSeconds32(KDownloadFinalizerWaitTime)
+                        ,TCallBack(StaticDoFinalizeDownload,this) ) ;
+        }
+    // Restarting, wait some time
+    else
+        {
+        iDownloadFinalizer->Start(
+                        TTimeIntervalMicroSeconds32(2000000)
+                        ,TTimeIntervalMicroSeconds32(2000000)
+                        ,TCallBack(StaticDoFinalizeDownload,this) ) ;
+        }
+    FLOG(_L("CFotaServer::FinalizeDownload() <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoFinalizeDownloadL
+// Finalize download. Free resources
+// --------------------------------------------------------------------------
+//
+void CFotaServer::DoFinalizeDownloadL()
+    {
+    FLOG(_L("CFotaServer::DoFinalizeDownloadL() >> state:%d result:%d")
+            ,iDLFinalizeState.iState, iDLFinalizeState.iResult );
+    __ASSERT_ALWAYS( iDownloader, User::Panic(KFotaPanic, KErrBadHandle ));
+    
+    if ( iDownloadFinalizer ) 
+        {
+        iDownloadFinalizer->Cancel();
+        }
+
+    if (iDownloader->iDLState.iState == RFotaEngineSession::EDownloadFailed)
+        StoragePluginL()->DeleteUpdatePackageL ( iDownloader->iDLState.iPkgId );
+        
+    // Download not to be restarted, delete
+    if ( iDownloader ) 
+    {
+    	if ( iDownloader->iRestartCounter<=0 )
+        {
+        // Set downloader's ending state to DB
+        iDatabase->OpenDBL();
+        iDatabase->SetStateL(iDLFinalizeState
+                            ,KNullDesC8,EFDBState|EFDBResult);
+        iDatabase->CloseAndCommitDB();
+
+        iDownloader->SetDownloadActive(EFalse);
+        iParentApp->SetUIVisibleL( EFalse,ETrue);
+
+        // Initiate update 
+        if ( iDownloader && iDownloader->iUpdateAfterDownload )
+            {
+            UpdateL( iDownloader->iDLState );  
+            }
+        // Report status to DM server
+        else
+            {
+            if (iDownloader->iDLState.iState == RFotaEngineSession::EDownloadProgressingWithResume )
+            	{
+            	if (iDownloader->IsFMSEnabled())
+                	{
+                	FLOG(_L("Invoking FMS..."));
+                	InvokeFmsL();
+                	SetStartupReason(EFotaDownloadInterrupted);
+                	}
+            	}
+            else
+            	{
+            	CreateDeviceManagementSessionL( iDownloader->iDLState );
+            	}
+            }
+
+        // Free resources
+        if ( iDownloader ) 
+            {
+            iDownloader->Cancel();
+			iDownloader->CancelDownload (ETrue);
+            delete iDownloader; 
+            iDownloader=NULL;
+            }
+        TInt val (EFalse);
+        TInt err = RProperty::Get(TUid::Uid(KOmaDMAppUid), KFotaDMRefresh, val );
+        if (val!=EFalse)
+        	err = RProperty::Set(TUid::Uid(KOmaDMAppUid), KFotaDMRefresh, EFalse );
+        FLOG(_L("RProperty KFotaDMRefresh EFalse, err = %d"), err);
+        }
+      }
+    // Download to be restarted
+    else
+        {
+        __ASSERT_ALWAYS( iDownloader->iUrl
+                ,User::Panic(KFotaPanic, KErrBadHandle ));
+        FLOG(_L(" Restarting download(iRestartCounter %d)"),iDownloader->iRestartCounter);
+
+        // Reuse url and iapid
+        HBufC8* url = iDownloader->iUrl->AllocLC();
+        TInt    iapid = iDownloader->iDLState.iIapId;
+
+        TBool   update= iDownloader->iUpdateAfterDownload;
+        TInt    restart=iDownloader->iRestartCounter;
+        
+        iDownloader->CancelDownload( EFalse ); //Doesn't actually deletes downloads when S&R feature is supported.
+      
+        iDownloader->DownloadL( iDLFinalizeState , *url,update,iapid, restart);
+        CleanupStack::PopAndDestroy( url );
+        }
+
+
+    FLOG(_L("CFotaServer::DoFinalizeDownloadL() <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// StaticDoCloseSMLSession 
+// Intermediate function
+// --------------------------------------------------------------------------
+static TInt StaticDoCloseSMLSession ( TAny *aPtr )
+    {
+    FLOG(_L("[cfotaserver] StaticDoCloseSMLSession() >>"));
+    CFotaServer* srv = (CFotaServer*) aPtr;
+    TRAPD( err,  srv->DoCloseSMLSessionL() );
+    if(err)
+        {
+        FLOG(_L("[cfotaserver] StaticDoCloseSMLSession ERROR %d"),err);
+        }
+
+    FLOG(_L("[cfotaserver] StaticDoCloseSMLSession() <<"));
+    return err;
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoCloseSMLSessionL
+// Close syncml session, or resync
+// --------------------------------------------------------------------------
+//
+void CFotaServer::DoCloseSMLSessionL()
+    {
+    FLOG(_L("CFotaServer::DoCloseSMLSessionL() >>"));
+
+    // Must still try to sync
+    if ( iSyncMLAttempts > 0 )
+        {
+        FLOG(_L("   trycount %d => creating new job"),iSyncMLAttempts);
+	    RSyncMLDevManJob    dmJob;
+    	if(iIapId > KErrNotFound)
+    	    {
+            FLOG(_L("DoCloseSMLSessionL new job uses iap from fotadb %d"),
+                    iIapId);
+   	        RProperty::Define(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,RProperty::EInt,KAllowAllPolicy,KWritePolicy);
+            TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);
+			FLOG(_L("CFotaServer::DoCloseSMLSessionL() KNSmlDMSilentJob set err %d"),r2);
+            dmJob.CreateL( iSyncMLSession, iSyncProfile,iIapId );
+    	    }
+    	else
+    		{
+    		FLOG(_L("DoCloseSMLSessionL new job uses iap from profile"));
+    		dmJob.CreateL( iSyncMLSession, iSyncProfile );
+    		}
+			iSyncMLAttempts--;
+			iSyncJobId = dmJob.Identifier();
+	    dmJob.Close();
+        }
+    else 
+    // We ran out of attempts, close sml
+        {
+        if ( iSyncMLSession.Handle() ) 
+            {
+            FLOG(_L("   Closing syncml session"));
+            iSyncMLSession.CancelEvent();
+            iSyncMLSession.Close();
+            }
+        } 
+
+    if ( iTimedSMLSessionClose ) 
+        {
+        FLOG(_L("   closing smlsession timer"));
+        iTimedSMLSessionClose->Cancel();
+        delete iTimedSMLSessionClose;
+        iTimedSMLSessionClose = NULL;
+        }
+
+    FLOG(_L("CFotaServer::DoCloseSMLSessionL() <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::ReadChunkL
+// Read data from chunk created by client.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::ReadChunkL( const TInt aSize,TInt aError )
+	{
+    __ASSERT_ALWAYS( aSize>=0 , User::Panic(KFotaPanic, KErrArgument) );
+    TUint8* b = iChunk.Base();
+    TPtr8   data(b, aSize, aSize );
+
+    iStorage->iBytesWritten += aSize;
+    FLOG(_L("     CFotaServer::ReadChunkL  >>  reading %d bytes"),aSize);
+    if (iStorageStream && aError !=KErrServerTerminated &&
+    		aError !=KErrDiskFull )
+       {FLOG(_L("     CFotaServer::ReadChunkL  >>  inside if(iStorageStream)"));
+       TRAPD ( err, iStorageStream->WriteL(data) );
+
+       if ( !err ) 
+           {
+           iStorageStream->CommitL();
+           }
+       else
+    	  {
+          FLOG(_L("Error when writing pkg %d"), err);
+          iStorageStream->Close();
+          iStorageStream = NULL;
+          User::Leave ( err );
+          }
+       }  
+    FLOG(_L("     CFotaServer::ReadChunkL  << "));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::OpenUpdatePackageStoreL 
+// Opens package store. Calling chain in case of oma DL:  
+// fotaserver->downloadmgr->codhandler->fotaserver  (subject to change, 
+// depending on downloadmgr&codhandler changes)
+// Fotaadapter calls this function in direct way: fotaadapter->fotaserver
+//
+// --------------------------------------------------------------------------
+//
+void CFotaServer::OpenUpdatePackageStoreL ( const RMessage2& aMessage )
+    {
+    FLOG(_L("CFotaServer::OpenUpdatePackageStoreL  >>"));
+
+    // If chunk is already open, bail out
+    THandleInfo     info;
+    TInt            pkgid;
+    iChunk.HandleInfo(&info);
+    
+     
+    if(info.iNumOpenInProcess>0)
+        {
+        FLOG(_L("CFotaServer::SetChunkHandleL  chunk is open %d times by \
+            current process (%d times in thread)"),info.iNumOpenInProcess
+            ,info.iNumOpenInThread);
+        User::Leave(KErrInUse);
+        }
+
+    // Set package state 
+    pkgid = aMessage.Int0();
+    iStorageDownloadPackageId = pkgid;
+
+    TPackageState   state = GetStateL(pkgid);
+
+    // AS  16.02.05: must be in failed state until complete
+
+    FLOG(_L("CFotaServer::OpenUpdatePackageStoreL  opening update pkg storage\
+                ffor pkgid: %d "),pkgid);
+
+    TInt size2 = state.iPkgSize;
+    // Use storage api to save update pkg 
+    StoragePluginL()->OpenUpdatePackageStoreL(pkgid,size2, iStorageStream);
+
+    User::LeaveIfError( iChunk.Open(aMessage,1,EFalse) );
+	TInt err = RProperty::Define( TUid::Uid(KFotaServerUid),
+					KFotaLrgObjDl,RProperty::EInt,
+					KReadPolicy,  KWritePolicy );
+	TInt    err1 = RProperty::Set( TUid::Uid(KFotaServerUid),
+			KFotaLrgObjDl, KErrNotFound );
+	FLOG(_L("CFotaServer::OpenUpdatePackageStoreL err for KFotaLrgObjDl define is %d err is %d"),
+			err,err1 );  
+	err = RProperty::Define( TUid::Uid(KFotaServerUid),
+				KFotaLrgObjProfileId,RProperty::EInt,
+				KReadPolicy,KWritePolicy );
+	err1 = RProperty::Set( TUid::Uid(KFotaServerUid),
+						KFotaLrgObjProfileId, KErrNotFound );
+	FLOG(_L("CFotaServer::OpenUpdatePackageStoreL err for KFotaLrgObjProfileId define is %d err is %d"),
+			err,err1 );  
+    FLOG(_L("CFotaServer::OpenUpdatePackageStoreL  <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetDownloadUpdatePackageSizeL 
+// Gets the downloaded update package size in bytes
+// --------------------------------------------------------------------------
+//
+void CFotaServer::GetDownloadUpdatePackageSizeL (const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize)
+	{
+	FLOG(_L("CFotaServer::GetDownloadUpdatePackageSize, aPkgId = %d  >>"),aPkgId);
+	TPackageState temp;
+
+	//Getting the total package size from database.
+	iDatabase->OpenDBL();
+	temp = iDatabase->GetStateL(aPkgId);
+	iDatabase->CloseAndCommitDB();
+	
+	FLOG(_L("fota state for given pkg id is = %d"),temp.iState);
+	if (temp.iState == RFotaEngineSession::EDownloadProgressing
+			|| temp.iState == RFotaEngineSession::EDownloadProgressingWithResume
+			|| temp.iState == RFotaEngineSession::EDownloadComplete
+			|| temp.iState == RFotaEngineSession::EStartingUpdate)
+		{
+		aTotalSize = temp.iPkgSize;
+		//Getting the downloaded update package size from storage pluggin.
+		StoragePluginL()->GetDownloadedUpdatePackageSizeL(aPkgId, aDownloadedSize);
+		}
+	else
+		{
+		FLOG(_L("No progressing/suspended/completed download corresponding to the given pkgid (%d)"),aPkgId);
+		User::Leave (KErrNotFound);
+		}
+
+	
+	FLOG(_L("CFotaServer::GetDownloadUpdatePackageSize, aDownloadedSize = %d, aTotalSize = %d  <<"),aDownloadedSize, aTotalSize);
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::TryResumeDownloadL 
+// Tries to resume the download operation
+// --------------------------------------------------------------------------
+//
+void CFotaServer::TryResumeDownloadL(TBool aUserInitiated)
+	{
+	FLOG(_L("CFotaServer::TryResumeDownloadL, aUserInitiated = %d  >>"),aUserInitiated);
+	//Check whether there is a paused resume actually.
+	if(aUserInitiated)
+	    iUserResume = ETrue;
+	else
+	    iUserResume = EFalse;
+	TPackageState temp = GetStateL(-1); //Gets the state of the current/last fota download
+	iSessMode = temp.iSessionType;
+	FLOG(_L("iSessMode = %d ,temp.iSessionType=%d  "),iSessMode,
+	            temp.iSessionType);	
+	if ( temp.iState != RFotaEngineSession::EDownloadProgressingWithResume )
+		{
+		FLOG(_L("There are no paused downloads currently; hence leaving with KErrNotFound..."));
+		User::Leave (KErrNotFound);
+		}
+
+	//Resume download now
+    if(!iDownloader)
+        {
+        FLOG(_L("Creating new idownloader"));
+        iDownloader = CFotaDownload::NewL( this );
+        }
+    if (iDownloader->IsDownloadActive())
+    	{
+    	FLOG(_L("Another download is already active, hence returning..."));
+    	User::Leave (KErrAlreadyExists);
+    	}
+    iDownloader->iDLState = temp;
+	SetStartupReason(EFotaDownloadInterrupted);
+    iDownloader->TryResumeDownloadL(aUserInitiated);
+	
+	FLOG(_L("CFotaServer::TryResumeDownloadL  <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::InvokeFmsL 
+// Starts Fota Monitory Service with relevant parameters for monitoring.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::InvokeFmsL()
+	{
+	FLOG(_L("CFotaServer::InvokeFmsL  >>"));
+	//Collect all information needed to invoke FMS.
+	TPackageState temp = GetStateL(iDownloader->iDLState.iPkgId);
+	FLOG(_L("State as recorded in fota db:"));
+	FLOG(_L("iPkgId = %d"),temp.iPkgId);
+	FLOG(_L("iProfileId = %d"),temp.iProfileId);
+	FLOG(_L("iPkgName = %S"),&temp.iPkgName);
+	FLOG(_L("iPkgVersion = %S"),&temp.iPkgVersion);
+	FLOG(_L("iSendAlert = %d"),temp.iSendAlert);
+	FLOG(_L("iIapId = %d"),temp.iIapId);
+	FLOG(_L("iPkgSize = %d"),temp.iPkgSize);
+	FLOG(_L("iSessionType = %d"),temp.iSessionType);
+	FLOG(_L("iState = %d"),temp.iState);
+	FLOG(_L("iResult = %d"),temp.iResult);
+	
+	
+	//Finding the reason for download interrupt
+	TOmaDLInterruptReason reason (EGeneralInterrupt); // 3
+	
+	switch (iDownloader->iDLState.iResult)
+	{
+	case RFotaEngineSession::EResUserCancelled:
+		{
+		reason = EUserInterrupt; //0
+		break;
+		}
+	case RFotaEngineSession::EResDLFailDueToNWIssues:
+		{
+		reason = ENetworkInterrupt; //1
+		break;
+		}
+	case RFotaEngineSession::EResDLFailDueToDeviceOOM:
+		{
+		reason = EMemoryInterrupt;   //2
+		break;
+		}
+	default:
+		{
+		//reason is already EGeneralInterrupt
+		break;
+		}
+	}
+	//FotaState has the last successfully worked IAP. Hence use this for FMS monitoring.
+//	TInt apid = iDownloader->iDLState.iIapId;
+	TInt apid = temp.iIapId;
+	
+	//Finding the drive number
+	TBuf8<KMaxPath> path8;
+	path8.Zero();
+	StoragePluginL()->GetUpdatePackageLocationL(iDownloader->iDLState.iPkgId, path8);
+	TPath path16;
+	path16.Copy(path8);
+
+
+    TInt drive (EDriveC ); //Default drive is Phone Memory
+	TParse p;
+    if (!p.Set(path16,NULL,NULL))
+    	{
+    	TDriveName drivename(p.Drive());
+    	TDriveUnit driveunit(drivename);
+    	if (iFs.IsValidDrive((TInt) driveunit))
+    		drive = driveunit;
+    	}
+    else
+    	{
+    	FLOG(_L("Error while parsing for drive number! defaulting to Phone Memory (C)"));
+    	}
+
+    TInt dlsize, tsize;
+    GetDownloadUpdatePackageSizeL(iDownloader->iDLState.iPkgId, dlsize, tsize);
+	TInt neededsize = tsize - dlsize;
+	FLOG(_L("Launching FMS with params... reason = %d, iapid = %d, drive = %d, neededsize = %d"),reason, apid, drive, neededsize);
+	iFMSClient.OpenL();
+	iFMSClient.NotifyForResumeL( reason, apid, (TDriveNumber)drive, neededsize );
+	iFMSClient.Close();
+	
+	FLOG(_L("CFotaServer::InvokeFmsL  <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::CancelFmsL 
+// Cancels any outstanding monitoring requests in Fota Monitory Service
+// --------------------------------------------------------------------------
+//
+void CFotaServer::CancelFmsL()
+	{
+	FLOG(_L("CFotaServer::CancelFmsL  >>"));
+	
+	iFMSClient.OpenL();
+	iFMSClient.CancelNotifyForResume();
+	iFMSClient.Close();
+	
+	FLOG(_L("CFotaServer::CancelFmsL  <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::SetStartupReason 
+// Sets the startup reason for Fota. This is used in Fota Startup pluggin.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::SetStartupReason(TInt aReason)
+	{
+	FLOG(_L("CFotaServer::SetStartupReason, aReason = %d  >>"), aReason);
+	
+	CRepository* centrep = NULL;
+    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) )
+    if (err==KErrNone ) 
+    	{
+         centrep->Set(  KFotaUpdateState, aReason );
+        }
+    delete centrep;
+    centrep = NULL;
+
+	FLOG(_L("CFotaServer::SetStartupReason  <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::~CFotaServer()
+// Frees database, download, chunk, filewriter, etc resources
+// --------------------------------------------------------------------------
+//
+CFotaServer::~CFotaServer()
+	{
+    FLOG(_L("CFotaServer::~CFotaServer  >>"));
+
+    if(iDatabase)
+        {
+        iDatabase->CloseAndCommitDB();
+        delete iDatabase;
+        iDatabase = NULL;
+        }
+
+    if(iDownloader)
+        {
+        iDownloader->Cancel();
+        delete iDownloader;
+        iDownloader = NULL;
+        }
+
+    if(iUpdater)
+        {
+        iUpdater->Cancel();
+        delete iUpdater;
+        iUpdater = NULL;
+        }
+
+    if(iDownloadFinalizer) 
+        {
+        iDownloadFinalizer->Cancel();
+        delete iDownloadFinalizer;
+        iDownloadFinalizer = NULL;
+        }
+
+    if(iUpdateFinalizer)
+        {
+        iUpdateFinalizer->Cancel();
+        delete iUpdateFinalizer;
+        iUpdateFinalizer = NULL;
+        }
+
+    if ( iTimedExecuteResultFile ) 
+        {
+        iTimedExecuteResultFile->Cancel();
+        delete iTimedExecuteResultFile;
+        iTimedExecuteResultFile = NULL;
+        }
+
+    if ( iAppShutter )
+        {
+        iAppShutter->Cancel();
+        delete iAppShutter;
+        iAppShutter=NULL;
+        }
+        
+    if ( iMonitor )    
+    	{
+    	delete iMonitor;
+    	iMonitor = NULL;
+    	}
+    //don't delete iEikEnv, fw will take care.
+    if (iChunk.Handle())
+    	iChunk.Close();
+    
+    if (iStorageStream) {
+    	TRAP_IGNORE(iStorageStream->CommitL());
+    	iStorageStream->Close();
+    	iStorageStream = NULL;
+    }
+    iSyncMLSession.Close();
+    TRAP_IGNORE( UnLoadStoragePluginL () );
+    iFs.Close();
+    
+    
+    if (iFMSClient.Handle())
+    	iFMSClient.Close();
+
+	if ( iNotifHandler ) 
+		{
+		iNotifHandler->Cancel();
+		delete iNotifHandler;        
+		}
+	TInt err = RProperty::Delete(TUid::Uid(KFotaServerUid),
+    		KFotaLrgObjDl);
+    FLOG( _L( "CFotaServer::~CFotaServer err for KFotaLrgObjDl is %d " ),err );  
+    err = RProperty::Delete(TUid::Uid(KFotaServerUid),
+    		KFotaLrgObjDl);
+    FLOG( _L( "CFotaServer::~CFotaServer err for KFotaLrgObjProfileId is %d " ),err );  
+    err = RProperty::Delete(TUid::Uid(KFotaServerUid),
+    		KFotaLrgObjProfileId);    
+    
+    if (iDEController)
+        {
+        delete iDEController;
+        iDEController = NULL;
+        }
+ 
+	FLOG(_L("CFotaServer::~CFotaServer  <<"));  
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaServer::UpdatePackageDownloadCompleteL
+// Sets state and package streaming related objects. If this is child
+// fotaserver (not largeobject), don't set state since parent fotaserver does
+// it.
+// ---------------------------------------------------------------------------
+void CFotaServer::UpdatePackageDownloadCompleteL(TBool aLargObj
+                                                        , const TInt aPkgId)
+    {
+    FLOG(_L("CFotaServer::UpdatePackageDownloadCompleteL %d >>"),aPkgId);
+    TInt        pkgid(aPkgId);
+
+    // Set state in case of lrg obj download 
+    // If not lrg ob download, calling app sets state
+    if (aLargObj)
+        {
+        TPackageState s;
+        s.iPkgId = aPkgId;
+        s.iState = RFotaEngineSession::EStartingUpdate;
+        iDatabase->OpenDBL();
+        iDatabase->SetStateL( s,KNullDesC8,EFDBState );
+        iDatabase->CloseAndCommitDB();
+        //To refresh in DM UI for OMA DM large object
+        TInt err = RProperty::Define( TUid::Uid(KOmaDMAppUid),
+				KFotaDMRefresh,
+				RProperty::EInt,KReadPolicy,KWritePolicy);
+		FLOG(_L("CFotaServer::UpdatePackageDownloadCompleteL KFotaDMRefresh Define, err = %d")
+														, err);        
+		if (err != KErrAlreadyExists && err != KErrNone)
+			{
+			User::LeaveIfError(err);
+			}
+		//notify DM UI, EFalse indicates no Download going on 
+		err = RProperty::Set( TUid::Uid(KOmaDMAppUid),
+				KFotaDMRefresh,
+				EFalse );
+		FLOG(_L("RProperty KFotaDMRefresh Set ETrue, err = %d"), err);           
+        }
+    // Free resources
+    iChunk.Close();
+    iStorage->UpdatePackageDownloadCompleteL(pkgid);
+    FLOG(_L("CFotaServer::UpdatePackageDownloadCompleteL %d <<"),aPkgId);
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaServer::DeletePackageL 
+// Deletes update package from db
+// ---------------------------------------------------------------------------
+void CFotaServer::DeletePackageL ( const TInt aPkgId)
+    {
+    FLOG(_L("CFotaServer::DeletePackageL  >> id %d"),aPkgId );
+   // TInt err;
+
+    StoragePluginL()->DeleteUpdatePackageL ( aPkgId );
+//    User::LeaveIfError( err );
+    FLOG(_L("CFotaServer::DeletePackageL  <<") );
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CFotaServer::DownloadL
+//  Create package downloader and download update package.
+// ---------------------------------------------------------------------------
+void CFotaServer::DownloadL(TDownloadIPCParams aParams, const TDesC8& aPkgURL)
+    {
+    FLOG(_L("[FotaServer]  Download >>"));
+
+    // If download already in progress, delete it
+    if ( iDownloader )
+        {
+        FLOG(_L("CFotaServer::DownloadL already downloading!"));
+        User::Leave (KErrAlreadyExists);
+        }
+    
+    if(!iDownloader)
+        {
+        iDownloader = CFotaDownload::NewL( this );
+        }
+        
+        TBuf<KSysVersionInfoTextLength> temp;
+    if (GetSoftwareVersion(temp) == KErrNone)
+        {
+        
+          RFileWriteStream    wstr;
+        	CleanupClosePushL ( wstr );
+        	TInt err1=wstr.Replace( iFs,KSWversionFile, EFileWrite  );
+        	if(err1==KErrNone)
+        	{
+           HBufC16*             swv;
+           swv = HBufC16::NewLC ( temp.Length() );
+           swv->Des().Copy( temp );
+           wstr.WriteInt16L( swv->Des().Length()); // length  
+           wstr.WriteL( swv->Des() );
+           wstr.WriteInt16L( 0 );
+           CleanupStack::PopAndDestroy( swv );
+               
+          }                           
+                                        
+        	CleanupStack::PopAndDestroy( &wstr ); // wstr      
+        }
+    
+    iDownloader->DownloadL(aParams,aPkgURL,EFalse);
+    FLOG(_L("[FotaServer]  Download <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::DownloadAndUpdateL
+// Downloads update package and updates fw
+// --------------------------------------------------------------------------
+//
+void CFotaServer::DownloadAndUpdateL(TDownloadIPCParams aParams 
+                                            ,const TDesC8& aPkgURL)
+    {
+    FLOG(_L("CFotaServer::DownloadAndUpdateL >>"));
+
+    // If download already in progress, delete it
+    if ( iDownloader )
+        {
+        FLOG(_L("CFotaServer::DownloadAndUpdateL already downloading!"));
+        User::Leave (KErrAlreadyExists);
+        }
+    if (!iDownloader)
+        {
+        iDownloader = CFotaDownload::NewL(this);
+        }
+        TBuf<KSysVersionInfoTextLength> temp;
+    if (GetSoftwareVersion(temp) == KErrNone)
+        {
+        	RFileWriteStream    wstr;
+        	CleanupClosePushL ( wstr );
+          TInt err = wstr.Replace( iFs ,KSWversionFile, EFileWrite );
+         if(err ==KErrNone) 
+          {
+          HBufC16*             swv;
+          swv = HBufC16::NewLC ( temp.Length( ) );
+          swv->Des().Copy( temp );
+          wstr.WriteInt16L( swv->Des().Length()); // length  
+          wstr.WriteL( swv->Des() );
+          wstr.WriteInt16L( 0 );
+          CleanupStack::PopAndDestroy( swv );
+                
+          }       
+                                 
+         CleanupStack::PopAndDestroy( &wstr ); // wstr                                   
+        	
+        }
+    iDownloader->DownloadL( aParams,aPkgURL,ETrue );
+    FLOG(_L("CFotaServer::DownloadAndUpdateL <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::UpdateL
+// Start update 
+// --------------------------------------------------------------------------
+//
+void CFotaServer::UpdateL( const TDownloadIPCParams &aParams )
+    {
+    FLOG(_L("CFotaServer::UpdateL  >>"));
+    
+     TBool isPkgvalid(ETrue);
+     isPkgvalid = CheckSWVersionL();
+      
+    if (isPkgvalid)
+        {
+        	
+        FLOG(_L("CFotaServer::UpdateL  package is valid >>"));	
+        if(!iUpdater)
+            {
+            iUpdater = CFotaUpdate::NewL(this);
+            }
+        iUpdater->StartUpdateL( aParams );
+        }
+    else
+        {
+        FLOG(_L("IMPORTANT:: Firmware version mismatch! Resetting fota state"));
+        ResetFotaStateL(aParams);
+        }
+       
+        FLOG(_L("CFotaServer::UpdateL  <<"));  
+    }
+
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::CheckSWVersionL
+// Check the s/w version
+// --------------------------------------------------------------------------
+//
+
+TBool CFotaServer::CheckSWVersionL()
+
+{
+	
+	
+	  FLOG(_L("CFotaServer::CheckSWVersionL  >>"));  
+	 TBuf<KSysVersionInfoTextLength> temp;
+    HBufC16*            message16=NULL;
+    TBool isPkgvalid(ETrue);
+    if (GetSoftwareVersion(temp) == KErrNone)
+        {
+          
+         //TBuf<KSysVersionInfoTextLength>swvfromfile;
+        //Fetch the software version ...
+        RFileReadStream     rstr;
+        TInt err1=rstr.Open(iFs,KSWversionFile ,EFileRead);
+        if(err1== KErrNone)
+        {
+         CleanupClosePushL( rstr );
+         TInt msglen = rstr.ReadInt16L(); 
+         if(msglen > 0)
+         { 
+          	message16         = HBufC16::NewLC(msglen + 1);
+        	 TPtr16 tempswv = message16->Des();
+        	 TRAPD(err, rstr.ReadL(tempswv,msglen ));
+        	        
+           if ( err != KErrNone && err != KErrEof)
+            {
+             FLOG(_L("  file read err %d"),err); //User::Leave( err ); 
+              msglen =0;
+            }
+           else
+           { 
+            FLOG(_L("  msglen  %d"),msglen); 
+            TPtr swvfromfile = message16->Des();
+                     
+            FLOG(_L("  swvfromfile=%S"),message16); 
+            
+             //Compare the software versions to decide whether the download is still valid or not.
+              if (msglen != temp.Length() || temp.Compare(tempswv)!=KErrNone)
+              {
+        	     isPkgvalid = EFalse;
+        	      FLOG(_L("CFotaServer::software not matching  >>"));
+        	
+              }
+            } 
+          
+             CleanupStack::PopAndDestroy( message16 );
+         }    
+            CleanupStack::PopAndDestroy( &rstr ); 
+            
+            
+        }
+        
+       } 
+       
+        FLOG(_L("CFotaServer::CheckSWVersionL  <<"));  
+       return isPkgvalid;
+	
+	
+}	
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::ScheduledUpdateL
+// Update, triggered by scheduler
+// --------------------------------------------------------------------------
+void CFotaServer::ScheduledUpdateL( TFotaScheduledUpdate aUpdate )
+    {
+    FLOG(_L("CFotaServer::ScheduledUpdateL"));
+    TPackageState s = GetStateL( aUpdate.iPkgId );
+
+    // If update is in progress, do not start new one (multiple popups)
+    if ( iUpdater )
+    	{
+    	FLOG(_L("\t\tupdate in progress"));
+		return;
+    	}
+	else
+		{
+		
+		//Check to find whether the user has already installed the package before the
+		//reminder could expire
+		
+		RFs aRfs;
+		RDir aDir;
+		TEntryArray anArray;
+		User::LeaveIfError(aRfs.Connect());
+		
+		
+		TBuf16<KMaxFileName> temp;
+		temp.Zero();
+		temp.Copy(KSwupdPath8);
+		
+		if(aDir.Open(aRfs,temp,KEntryAttNormal)==KErrNone)
+		{
+			TInt error = aDir.Read(anArray);	
+		}
+		aDir.Close();
+		aRfs.Close();
+	
+		temp.Zero();
+		temp.Copy(KSwupdFileExt8);
+		
+		TBool aStartUpdate(EFalse);
+		
+		for (TInt i=0; i<anArray.Count();i++)
+			{
+			if (anArray[i].iName.Find(temp)!=KErrNotFound)
+				{
+				aStartUpdate = ETrue;
+				break;
+				}
+			}
+		
+		if (aStartUpdate)
+			{
+			FLOG(_L("\t\tReminder expired and update packages found on dir"));
+			iUpdater = CFotaUpdate::NewL(this);
+	    	iUpdater->StartUpdateL( s );
+			}
+		else
+			{
+			FLOG(_L("\t\tReminder expired, but no update package is found on dir; skipping"));
+			}
+		}
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoConnect
+// From CServer2. Initializes class members. 
+// --------------------------------------------------------------------------
+void CFotaServer::DoConnect(const RMessage2 &aMessage)
+    {
+    FLOG(_L("CFotaServer::DoConnect(const RMessage2 &aMessage) >>") );
+
+    // In case shutdown is in progress, cancel it.
+    if ( iAppShutter )
+        {
+        iAppShutter->Cancel();
+        delete iAppShutter;
+        iAppShutter=NULL;
+        }
+
+    if ( iInitialized == EFalse )
+        {
+        TRAPD( err, ClientAwareConstructL( aMessage ) );
+        if ( err ) FLOG(_L("   ClientAwareConstructL err %d"),err);
+        }
+
+    CAknAppServer::DoConnect( aMessage );
+    FLOG(_L("CFotaServer::DoConnect(const RMessage2 &aMessage) <<"));
+    }   
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetStateL
+// Get state of a download package
+// --------------------------------------------------------------------------
+TPackageState CFotaServer::GetStateL( const TInt aPkgId)
+    {
+    TPackageState s=RFotaEngineSession::EIdle;
+
+    if (aPkgId >= 0) // Used by all clients
+    	{
+    	iDatabase->OpenDBL();
+    	s = iDatabase->GetStateL( aPkgId );
+   	    iDatabase->CloseAndCommitDB();
+    	}
+    else if (aPkgId == -2) //Used by DM UI to check if fota ui has to be in foreground
+    	{
+    	TBool value (EFalse);
+    	/** This P&S Key is used to notify DM UI on any download event. key=0 for idle and key=1 for download */     	
+    	TInt err = RProperty::Get(TUid::Uid(KOmaDMAppUid),
+                           KFotaDMRefresh,
+                           value);
+        FLOG(_L("RProperty KFotaDMRefresh Get, err = %d, val = %d"), err,value);
+		if (err==KErrNone && value)
+			{
+			FLOG(_L("Ongoing download operation detected!"));
+			s=RFotaEngineSession::EDownloadProgressing;
+			}
+    	}
+    else if ( aPkgId == -1) //Used by DM UI to get the state of last fota operation
+    	{
+		//Read status from fotastate last entry
+
+    	iDatabase->OpenDBL();
+
+		RArray<TInt>    states;
+        CleanupClosePushL (states);
+        iDatabase->GetAllL ( states );
+        // Loop states. 
+        for(TInt i = 0; i < states.Count(); ++i ) 
+            {
+            TPackageState   tmp;
+            tmp = iDatabase->GetStateL(  states[i]  );
+            FLOG(_L("***Package: %d, State = %d"),states[i],(TInt) tmp.iState);
+            if (tmp.iState!=RFotaEngineSession::EIdle)
+	            {
+            	s=tmp;
+    	        }
+            }
+			FLOG(_L("Status of current operation is %d"),(TInt)s.iState);
+		
+		CleanupStack::PopAndDestroy( &states );
+   	    iDatabase->CloseAndCommitDB();
+    	}
+    return s;
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::IsPackageStoreSizeAvailable 
+// Checks if update package fits into storage
+// --------------------------------------------------------------------------
+//
+TBool CFotaServer::IsPackageStoreSizeAvailableL ( const TInt aSize)
+    {
+    FLOG(_L("CFotaServer::IsPackageStoreSizeAvailableL >>"));
+    TInt size=aSize;
+
+		// Write content size for later use (flexible memory usage)
+		RFileWriteStream str;	
+		TUint32 				size2 = aSize;
+		User::LeaveIfError(str.Replace(iFs, KSizePass, EFileWrite)); 
+		CleanupClosePushL(str);
+		str.WriteUint32L(size2);
+		CleanupStack::PopAndDestroy(1);
+
+    
+    CFotaStorage::TFreeSpace avail = StoragePluginL()->IsPackageStoreSizeAvailableL(size);
+    FLOG(_L("CFotaServer::IsPackageStoreSizeAvailableL <<"));
+    return avail==CFotaStorage::EDoesntFitToFileSystem ? EFalse : ETrue;
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::OnSyncMLSessionEvent
+// --------------------------------------------------------------------------
+//
+void CFotaServer::OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier
+                                       , TInt aError, TInt /*aAdditionalData*/)
+    {
+    if ( iSyncJobId != aIdentifier ) return;
+    FLOG(_L("CFotaServer::OnSyncMLSessionEvent %d err:%d (id %d==%d?)")
+            , aEvent,aError,aIdentifier,iSyncJobId);
+
+    if ( iSyncJobId == aIdentifier )
+	    {
+        TTimeIntervalMicroSeconds32 close(0);
+        TBool end ( EFalse );
+	    switch( aEvent )
+		    {
+            //EJobStart = 0
+            case EJobStartFailed: // 1 E
+                {
+                end = ETrue;
+                }
+			    break;
+            case EJobStop: // 2 E
+                {
+                end = ETrue;
+                // Sync ok => do not try anymore
+                if ( aError == KErrNone ) 
+                    {
+                    iSyncMLAttempts=0;
+                    }
+                }
+			    break;
+            case EJobRejected: // 3 E
+                {
+                end = ETrue;
+                }
+			    break;
+            // ETransportTimeout , // 7
+    	    default:
+                {
+                }
+			    break;
+            }
+
+
+        // sml session OK,close it 
+        if ( end && iSyncMLAttempts == 0 ) 
+            {
+            FLOG(_L("   Sml OK, scheduling close"));
+        	if( aError == KErrNone ) //always ask session successful
+    		  {
+    		  TInt val = KErrNotFound;
+    		  TInt    err1 = RProperty::Get( TUid::Uid(KFotaServerUid),
+    				  KFotaLrgObjDl, val );
+    		  FLOG( _L( "CFotaSrvDocument::OnSyncMLSessionEvent KFotaLrgObjDl val & err is %d, %d" )
+    		  														,val,err1 );  
+    				  if( val == EOmaDmLrgObjDlFail ) //if large object
+    					{
+    					err1 = RProperty::Set( TUid::Uid(KFotaServerUid),
+    							KFotaLrgObjDl, KErrNotFound );
+    					FLOG( _L( "CFotaSrvDocument::OnSyncMLSessionEvent err for KFotaLrgObjDl is %d" )
+    							,err1 );  
+    					err1 = RProperty::Set( TUid::Uid(KFotaServerUid),
+    							KFotaLrgObjProfileId, KErrNotFound );
+    					FLOG( _L( "CFotaSrvDocument::OnSyncMLSessionEvent err for KFotaLrgObjProfileId is %d")
+    																							 ,err1 );  
+    							FLOG( _L( "[FotaServer] CFotaSrvDocument::OnSyncMLSessionEvent pkgid is %d" )
+    									,iStorageDownloadPackageId );  
+    							TRAP_IGNORE(GenericAlertSentL( iStorageDownloadPackageId ));
+    					}
+    		  }
+            close = TTimeIntervalMicroSeconds32( 100000 );
+            }
+        // sml session NOK, retry
+        if ( end && iSyncMLAttempts>0)
+            {
+            FLOG(_L("   Sml OK, scheduling retry"));
+            close = TTimeIntervalMicroSeconds32( KSyncmlSessionRetryInterval);
+            }
+
+        if ( close > TTimeIntervalMicroSeconds32(0) )
+            {
+            if ( iTimedSMLSessionClose ) 
+                {
+                FLOG(_L("   closing smlsession timer"));
+                iTimedSMLSessionClose->Cancel();
+                delete iTimedSMLSessionClose;
+                iTimedSMLSessionClose = NULL;
+                }
+            FLOG(_L("   starting smlsession timer"));
+            TRAPD( err2, iTimedSMLSessionClose = CPeriodic::NewL (EPriorityNormal) );
+            if ( !err2 )
+            	{
+							iTimedSMLSessionClose->Start (
+                close
+                , TTimeIntervalMicroSeconds32( KSyncmlSessionRetryInterval )
+                , TCallBack( StaticDoCloseSMLSession,this ) ) ;
+							}
+							else FLOG(_L(" iTimedSMLSessionClose err %d"),err2);
+            }
+        }
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::TryToShutDownFotaServer()
+// Try to shut down. After last client left, this is tried periodically.
+// --------------------------------------------------------------------------
+//
+TInt CFotaServer::TryToShutDownFotaServer()
+    {
+    RProcess pr; TFullName fn = pr.FullName();  TUint prid = pr.Id();
+	FLOG(_L( "CFotaServer::TryToShutDownFotaServer process(id %d)%S. this 0x%x")
+	                ,prid,&fn,this);
+    FLOG(_L("CFotaServer::TryToShutDownFotaServer()"));
+    FLOG(_L("iSessMode:%d,iUserResume:%d,iNeedToClose:%d"),iSessMode,
+                        iUserResume,iNeedToClose);
+    TBool val (EFalse);
+    if (iNotifHandler)
+    	val = iNotifHandler->IsOpen();
+    if( !iDownloader  && !iUpdater && !iTimedExecuteResultFile 
+        && !iSyncMLSession.Handle() && !iRetryingGASend  && !val
+        && !( iDownloader 
+             && iDownloader->IsDownloadActive() && iUserResume == EFalse /*FMS*/ 
+             && !iNeedToClose ))
+        {
+        
+        FLOG(_L("   shutting down fotaserver"));
+        if (iDownloader && iDownloader->IsDownloadActive() )
+            {
+            FLOG(_L("Shutting down active in TryToShutDownFotaServer..."));
+            StopDownload(RFotaEngineSession::EResUndefinedError);
+            }      
+       	CAknAppServer::HandleAllClientsClosed();
+       	return 1;
+        }
+    else
+        {
+        FLOG(_L("   shutdownwait:%d.%d.%d.%d.%d"), iDownloader,iUpdater
+            , iTimedExecuteResultFile,iSyncMLSession.Handle(),val);
+        }
+    return 0;
+    }
+
+
+// ---------------------------------------------------------------------------
+// StaticApplicationShutter
+// Intermediate function
+// ---------------------------------------------------------------------------
+static TInt StaticApplicationShutter(TAny *aPtr)
+    {
+    __ASSERT_ALWAYS( aPtr, User::Panic(KFotaPanic, KErrArgument) );
+    CFotaServer* srv = (CFotaServer*) aPtr;
+    srv->TryToShutDownFotaServer();
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaServer::HandleAllClientsClosed()
+// Tries to shut down fotaserver. If unsuccesfull, periodically try it again
+// and again and again ...
+// ---------------------------------------------------------------------------
+void CFotaServer::HandleAllClientsClosed()
+    {   
+    FLOG(_L("CFotaServer::HandleAllClientsClosed() >>"));
+
+    if ( TryToShutDownFotaServer() == 0) 
+        {
+        FLOG(_L("   starting application shutdown" ));
+        if ( iAppShutter )
+            {
+            iAppShutter->Cancel();
+            delete iAppShutter;
+            iAppShutter=NULL;
+            }
+        TRAPD ( err , iAppShutter = CPeriodic::NewL (EPriorityNormal) );
+        __ASSERT_ALWAYS( err == KErrNone , User::Panic(KFotaPanic, err) );
+        FLOG(_L("iSessMode = %d iUserResume:%d,iNeedToClose:%d"),
+                iSessMode,iUserResume,iNeedToClose);
+        if (iDownloader && iDownloader->IsDownloadActive() &&
+                !(iUserResume == EFalse /*FMS*/ 
+                  && !iNeedToClose ) )
+        	{
+            FLOG(_L("Shutting down active..."));
+        	StopDownload(RFotaEngineSession::EResUndefinedError);
+        	}
+
+        iAppShutter->Start( KFotaTimeShutDown , KFotaTimeShutDown
+                , TCallBack(StaticApplicationShutter,this) ) ;
+        }
+
+    FLOG(_L("CFotaServer::HandleAllClientsClosed() <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetUpdateTimeStampL 
+// Gets time of last update. It is stored in a file.
+// --------------------------------------------------------------------------
+void CFotaServer::GetUpdateTimeStampL (TDes16& aTime)
+    {
+    FLOG(_L("CFotaServer::GetUpdateTimeStampL  >>"));
+    TInt                err;
+
+    RFileReadStream     rstr;
+    err = rstr.Open( iFs, _L("updatetimestamp"), EFileRead );
+
+    if ( err == KErrNone) 
+        {
+        FLOG(_L(" update time stamp file found,reading"));
+        CleanupClosePushL (rstr);
+        TInt year   =  rstr.ReadInt32L();
+        TInt month  =  rstr.ReadInt32L();    
+        TInt day    =  rstr.ReadInt32L();
+        TInt hour   =  rstr.ReadInt32L();  
+        TInt minute =  rstr.ReadInt32L();
+        TInt year16   = year;
+        TInt month16  = month; 
+        TInt day16    = day;   
+        TInt hour16   = hour;  
+        TInt minute16 = minute;
+        CleanupStack::PopAndDestroy( &rstr );
+        aTime.Append (year16);
+        aTime.Append (month16);
+        aTime.Append (day16);
+        aTime.Append (hour16);
+        aTime.Append (minute16);
+        }
+    else if ( err != KErrNotFound )
+        {
+        User::Leave ( err );
+        }
+
+    if ( err == KErrNotFound ) 
+        {
+        FLOG(_L(" update time stamp not found "));
+        }
+
+    FLOG(_L("CFotaServer::GetUpdateTimeStampL  <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetUpdatePackageIdsL
+// --------------------------------------------------------------------------
+//
+void CFotaServer::GetUpdatePackageIdsL(TDes16& aPackageIdList)
+    {
+    FLOG(_L("CFotaServer::GetUpdatePackageIdsL()"));
+    StoragePluginL()->GetUpdatePackageIdsL( aPackageIdList );
+    }
+
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::GenericAlertSentL
+// Generic alert sent, do cleanup. FUMO spec specifies cleanup need to have 
+// for states 20,70,80,90,100. Called by syncml framework when it has sent
+// generic alert
+// --------------------------------------------------------------------------
+//
+void CFotaServer::GenericAlertSentL( const TInt aPackageID )
+    {
+    FLOG(_L("CFotaServer::GenericAlertSentL %d"), aPackageID);
+    TPackageState   state;
+    TBool           toidle(EFalse);
+    TBool           deletepkg(EFalse);
+
+    iDatabase->OpenDBL();
+    state = iDatabase->GetStateL( aPackageID );
+
+	switch( state.iState  )
+		{
+        case RFotaEngineSession::EDownloadFailed:
+            {
+            toidle = ETrue;
+            deletepkg = ETrue;
+            }
+			break;
+        case RFotaEngineSession::EUpdateFailed:
+            {
+            toidle = ETrue;
+            deletepkg = ETrue;
+            }
+			break;
+        case RFotaEngineSession::EUpdateFailedNoData:
+            {
+            toidle = ETrue;
+            }
+			break;
+        case RFotaEngineSession::EUpdateSuccessful:
+            {
+            toidle = ETrue;
+            deletepkg = ETrue;
+            }
+			break;
+        case RFotaEngineSession::EUpdateSuccessfulNoData:
+            {
+            toidle = ETrue;
+            }
+			break;
+        case RFotaEngineSession::EDownloadComplete:
+        	{
+        	state.iState = RFotaEngineSession::EStartingUpdate;
+        	state.iResult = KErrNotFound;
+            iDatabase->SetStateL( state,KNullDesC8, EFDBState );
+        	toidle = EFalse;
+        	}
+        	break;
+    	default:
+            {
+            FLOG(_L(" pkg %d (state:%d) doesnt need cleanup"), aPackageID
+                        ,state.iState );
+            }
+			break;
+        }
+    
+    if ( toidle )
+        {
+        state.iState = RFotaEngineSession::EIdle;
+        state.iResult = KErrNotFound;
+        iDatabase->SetStateL( state,KNullDesC8, EFDBState|EFDBResult );
+        DeleteFUMOTreeL();
+        }
+
+
+   	SetStartupReason(EFotaDefault);
+
+    iDatabase->CloseAndCommitDB();
+
+    if ( deletepkg )
+        {
+        StoragePluginL()->DeleteUpdatePackageL( aPackageID );
+        }
+
+    // this should already be done when user was notified 
+    // about update result
+    DoDeleteUpdateResultFileL();
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoDeleteUpdateResultFileL
+// Deletes the update resule file
+// --------------------------------------------------------------------------
+void CFotaServer::DoDeleteUpdateResultFileL()
+	{
+    CFotaUpdate::DeleteUpdateResultFileL( iFs );
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::CreateServiceL
+// Creates session object
+// --------------------------------------------------------------------------
+CApaAppServiceBase* CFotaServer::CreateServiceL( TUid aServiceType ) const
+	{
+    FLOG(_L( "CFotaServer::CreateServiceL 0x%x " ), aServiceType.iUid );
+    if ( aServiceType.iUid == KFotaServiceUid )
+        {
+	    return ((CApaAppServiceBase*) (new (ELeave) CFotaSrvSession));
+        }
+    else
+        {
+        return CAknAppServer::CreateServiceL ( aServiceType );
+        }
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetEikEnv
+// Gets the EikonEnv object
+// --------------------------------------------------------------------------
+CEikonEnv* CFotaServer::GetEikEnv()
+	{
+	return iEikEnv;
+	}
+	
+// --------------------------------------------------------------------------
+// CFotaServer::StartNetworkMonitorL       
+// Starts Network Monitoring operation for defined interval and retries (FotaNetworkRegMonitor.h)
+// --------------------------------------------------------------------------
+void CFotaServer::StartNetworkMonitorL()
+	{
+	FLOG(_L("CFotaServer::StartNetworkMonitorL >>"));
+	if (!iMonitor)
+		iMonitor = CFotaNetworkRegStatus::NewL (this);
+	iMonitor->StartMonitoringL();
+	
+	FLOG(_L("CFotaServer::StartNetworkMonitorL <<"));
+	}
+	
+// --------------------------------------------------------------------------
+// CFotaServer::ReportNetworkStatus       
+// called by CFotaNetworkRegStatus for reporting status
+// --------------------------------------------------------------------------
+void CFotaServer::ReportNetworkStatus(TBool status)
+	{
+	FLOG(_L("CFotaServer::ReportNetworkStatus, status = %d >>"),status);
+	iRetryingGASend = EFalse;
+	iNetworkAvailable = status;
+	
+	if (iNetworkAvailable)
+		{
+		TRAPD (err, CreateDeviceManagementSessionL (iStoredState));
+		if (err!=KErrNone)
+			{
+			FLOG(_L("Error %d occured while sending GA after retries"),err);
+			}
+		}
+	//No need of iMonitor anymore	
+    if ( iMonitor )    
+    	{
+    	delete iMonitor;
+    	iMonitor = NULL;
+    	}
+
+	FLOG(_L("CFotaServer::ReportNetworkStatus >>"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::ShutApp 
+// Shuts the DM App ui. This is used when End key is pressed during fota operation.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::ShutApp()
+	{
+	FLOG(_L("CFotaServer::ShutApp >>"));
+	FLOG(_L("Ending DM UI...."));
+	TApaTaskList taskList(GetEikEnv()->WsSession());
+	TApaTask task=taskList.FindApp(TUid::Uid(KOmaDMAppUid));
+	if(task.Exists())
+		{
+		task.EndTask();
+		}
+	FLOG(_L("CFotaServer::ShutApp <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::StopDownload 
+// Stops any ongoing download operation. Depending on the property of download, the later is either paused
+// or cancelled.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::StopDownload(TInt aReason)
+	{
+	FLOG(_L("CFotaServer::StopDownload, aReason = %d >>"), aReason);
+	iUserResume = KErrNotFound;
+	iSessMode = KErrNotFound;
+    if (iDownloader)
+    	{
+        FLOG(_L("stopping fota download"));
+        iNeedToClose  = EFalse;
+        if (iDownloader->IsDownloadResumable())
+    		{
+    		TRAP_IGNORE(iDownloader->RunDownloadSuspendL(aReason));
+    		}
+   		else
+   			{
+   			TRAP_IGNORE(iDownloader->RunDownloadCancelL(aReason));
+   			}
+    	}	
+	FLOG(_L("CFotaServer::StopDownload <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaServer::UpdateDBdataL 
+// For OMA DM large object download failure, this method updates the database
+// and sends the generic alert.
+// --------------------------------------------------------------------------
+//
+void CFotaServer::UpdateDBdataL()
+	{	
+	TInt val(KErrNotFound),UserCancel(KErrNotFound);
+	TInt err = RProperty::Get( TUid::Uid(KFotaServerUid),
+			KFotaLrgObjDl, val);
+	FLOG(_L("CFotaServer::UpdateDBdata KFotaLrgObjDl value & err is %d, %d "),val,err);	
+	//val = 1 means LrgObj Download & its failed , -1 means not lrg object download / stream commited
+	if( val == EOmaDmLrgObjDlFail ) 
+		{
+		err = RProperty::Get( TUid::Uid(KOmaDMAppUid),
+				KDmJobCancel, UserCancel);
+		FLOG(_L("CFotaServer::UpdateDBdataL KDmJobCancel value & err is %d, %d "),UserCancel,err);
+		if( UserCancel == KErrCancel )
+			{			
+			TInt ProfId(KErrNotFound);
+			err = RProperty::Get( TUid::Uid(KFotaServerUid),
+					KFotaLrgObjProfileId, ProfId);
+			FLOG(_L("CFotaServer::UpdateDBdataL KFotaLrgObjProfileId value & err is %d, %d,pkgid is %d "),
+					ProfId,err,iStorageDownloadPackageId);
+			if(iStorageDownloadPackageId > KErrNotFound && ProfId > KErrNotFound )
+				{
+				iDatabase->OpenDBL();
+				FLOG(_L("CFotaServer::UpdateDBdataL after iDatabase->OpenDBL() "));
+				TPackageState state;
+				state.iPkgId = iStorageDownloadPackageId;
+				state.iProfileId  = ProfId;
+				state.iState = RFotaEngineSession::EDownloadFailed;
+				state.iResult = RFotaEngineSession::EResUserCancelled;				
+				iDatabase->SetStateL( state,KNullDesC8, EFDBState | EFDBResult ) ;
+				FLOG(_L("CFotaServer::UpdateDBdataL after iDatabase->SetStateL"));
+				iDatabase->CloseAndCommitDB();		
+				FLOG(_L("CFotaServer::UpdateDBdataL after iDatabase->CloseAndCommitDB "));			    
+				// Free resources
+				iChunk.Close();
+				FLOG(_L("CFotaServer::UpdateDBdataL ,chunk released "));
+				iStorage->UpdatePackageDownloadCompleteL(iStorageDownloadPackageId);		    				
+				CreateDeviceManagementSessionL(state);
+				}
+
+			}
+		}	
+	}
+// --------------------------------------------------------------------------
+// CFotaServer::MonitorBatteryL()
+// Monitors for the battery 
+// 
+// --------------------------------------------------------------------------
+//
+void CFotaServer::MonitorBattery(TInt aLevel)
+{   FLOG(_L("CFotaServer::MonitorBatteryL(), level = %d >>"), aLevel);
+    SetStartupReason(EFotaUpdateInterrupted);
+	RFMSClient fmsclient;
+	TRAPD(err,fmsclient.OpenL());
+	if(err == KErrNone)
+	{ FLOG(_L("CFotaServer::going into FMS client side MonitorBatteryL() >>"));
+		//fmsclient.Cancel();
+	  TRAPD(err1,fmsclient.MonitorForBatteryL(aLevel));
+	   if(err1)
+	   {
+	   	FLOG(_L("CFotaServer:: MonitorBatteryL() left with error %d  >>"), err1);
+	   }
+	  fmsclient.Close();
+	
+	}
+	
+	FLOG(_L("CFotaServer::MonitorBatteryL() <<"));
+  	
+	
+}
+
+// --------------------------------------------------------------------------
+// CFotaServer::CheckIapExistsL 
+// Checks for IAP Id exists or not in commsdb
+// IAP Id used for resuming the download or for sending Generic alert
+// --------------------------------------------------------------------------
+//
+TBool CFotaServer::CheckIapExistsL(TUint32 aIapId)
+    {
+    FLOG(_L("CFotaServer::CheckIapExistsL >>"));
+    TBool exists = EFalse;  
+    RCmManager cmManager;    
+    cmManager.OpenLC();
+    RCmConnectionMethod conn;
+    TRAPD(err, conn = cmManager.ConnectionMethodL( aIapId ));
+    if(err == KErrNone)//connection method exists
+       exists = ETrue;
+    conn.Close();
+    CleanupStack::PopAndDestroy();//cmManager                    
+    FLOG(_L("CFotaServer::CheckIapExistsL <<"));
+    return exists;
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetSoftwareVersion
+// Gets the software version
+// 
+// --------------------------------------------------------------------------
+//
+TInt CFotaServer::GetSoftwareVersion(TDes& aVersion)
+    {
+    FLOG(_L("CFotaServer::GetSoftwareVersion >>"));
+    aVersion.Zero();
+    
+    SysVersionInfo::TVersionInfoType what = SysVersionInfo::EFWVersion;
+    TInt error (KErrNone);
+    error = SysVersionInfo::GetVersionInfo(what,aVersion);
+    FLOG(_L("CFotaServer::GetSoftwareVersion,SwV=%S <<"),&aVersion);
+    return error;
+    }
+    
+// --------------------------------------------------------------------------
+// CFotaServer::ResetFotaStateL
+// Resets the Fotastate
+// 
+// --------------------------------------------------------------------------
+//    
+void CFotaServer::ResetFotaStateL(const TDownloadIPCParams& aParams)
+    {
+    FLOG(_L("CFotaServer::ResetFotaStateL >>"));
+
+    TPackageState state;
+    if (!iDatabase->IsOpen()) iDatabase->OpenDBL();
+    //Fetch the software version that was before download from db.
+    state = iDatabase->GetStateL(aParams.iPkgId);
+    state.iState = RFotaEngineSession::EUpdateFailed;
+    state.iResult = RFotaEngineSession::EResPackageMismatch;
+    iDatabase->SetStateL( state,KNullDesC8, EFDBState | EFDBResult );
+    iDatabase->CloseAndCommitDB();
+    
+    StoragePluginL()->DeleteUpdatePackageL ( aParams.iPkgId );
+    
+    CreateDeviceManagementSessionL(state);
+    
+    FLOG(_L("CFotaServer::ResetFotaStateL <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::SetInstallUpdateClientL 
+// Set's who is the client triggering the update
+// --------------------------------------------------------------------------
+//
+void CFotaServer::SetInstallUpdateClientL(TInt aClient)
+    {    
+    iInstallupdClient = aClient;
+    FLOG(_L("CFotaServer::SetInstallUpdateClientL() client:%d<<"),iInstallupdClient);
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetInstallUpdateClientL 
+// returns the client who triggered the update
+// --------------------------------------------------------------------------
+//
+TInt CFotaServer::GetInstallUpdateClientL()
+    {
+    FLOG(_L("CFotaServer::GetInstallUpdateClientL() client:%d<<"),iInstallupdClient);
+    return iInstallupdClient ;
+    }
+
+// CFotaServer::NeedToDecryptL
+// This method is called to check if decryption is needed.
+// 
+// --------------------------------------------------------------------------
+// 
+TBool CFotaServer::NeedToDecryptL(const TInt &aPkgId, TDriveNumber &aDrive)
+    {
+    FLOG(_L("CFotaServer::NeedToDecryptL >>"));
+    
+    TBool ret (EFalse);
+
+    //Finding the drive number
+    TBuf8<KMaxPath> path8;
+    path8.Zero();
+    StoragePluginL()->GetUpdatePackageLocationL(aPkgId, path8);
+    TPath path16;
+    path16.Copy(path8);
+
+
+    TDriveNumber drive (EDriveC ); //Default drive is Phone Memory
+    TParse p;
+    if (!p.Set(path16,NULL,NULL))
+        {
+        TDriveName drivename(p.Drive());
+        TDriveUnit driveunit(drivename);
+        if (iFs.IsValidDrive((TInt) driveunit))
+            {
+            drive =  (TDriveNumber) driveunit.operator TInt();
+            iStorageDrive = drive;
+            }
+        }
+    else
+        {
+        FLOG(_L("Error while parsing for drive number! defaulting to Phone Memory (C)"));
+        }
+    FLOG(_L("Package storage drive is %d"), (TInt) drive);
+
+    if (!iDEController)
+        {
+        TRAPD(err, iDEController = CDevEncController::NewL(this));
+        if (err == KErrNotSupported)
+            {
+            //Encryption feature is not on.
+            return EFalse;
+            }
+        else
+            {
+            __LEAVE_IF_ERROR(err);
+            }
+        }
+    TRAPD(err, ret = iDEController->NeedToDecryptL(drive));
+    
+    delete iDEController; iDEController = NULL;
+    
+    if (err == KErrNotSupported)
+        {
+        //Encryption feature is ON, but the encryption adaptation is note present.
+        ret = EFalse;
+        }
+    else
+        {
+        __LEAVE_IF_ERROR(err);
+        }
+   
+    //Set the appropriate drive when ret is true
+    if (ret)
+        {
+        aDrive = drive;
+        }
+    
+    FLOG(_L("CFotaServer::NeedToDecryptL ret = %d, drive = %d <<"), ret, drive);
+    return ret;
+
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoStartDecryptionL
+// This method is called to start the decryption operation.
+// 
+// --------------------------------------------------------------------------
+// 
+void CFotaServer::DoStartDecryptionL()
+    {
+    FLOG(_L("CFotaServer::DoStartDecryptionL >>"));
+    
+    if (!iDEController)
+        iDEController = CDevEncController::NewL(this);
+    
+    iDEController->DoStartDecryptionL(iStorageDrive);
+    
+    FLOG(_L("CFotaServer::DoStartDecryptionL <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::HandleDecryptionCompleteL
+// This method is called to when decryption operation is complete.
+// 
+// --------------------------------------------------------------------------
+// 
+void CFotaServer::HandleDecryptionCompleteL(TInt aResult, TInt aValue)
+    {
+    FLOG(_L("CFotaServer::HandleDecryptionCompleteL, result = %d, value = %d >>"), aResult, aValue);
+    
+    if (aResult == KErrNone)
+        {
+        //Skip battery test as it is already performed before decryption
+        iUpdater->HandleUpdateAcceptStartL(ETrue);
+        }
+    else
+        {
+        FLOG(_L("Can't start update because of error %d"), aResult);
+        iUpdater->HandleUpdateErrorL(aResult, aValue);
+        }
+    
+    if (iDEController)
+        {
+        delete iDEController; iDEController = NULL;
+        }
+    
+    FLOG(_L("CFotaServer::HandleDecryptionCompleteL <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::NeedToEncryptL
+// This method is called to check if encryption is needed.
+// 
+// --------------------------------------------------------------------------
+// 
+TBool CFotaServer::NeedToEncryptL(TDriveNumber &aDrive)
+    {
+    FLOG(_L("CFotaServer::NeedToEncryptL >>"));
+    
+    TDriveNumber drive;
+    if (!iDEController)
+        {
+        TRAPD(err, iDEController = CDevEncController::NewL(this));
+        if (err == KErrNotSupported)
+            {
+            return EFalse;
+            }
+        else
+            {
+            __LEAVE_IF_ERROR(err);
+            }
+        }
+    
+    TBool ret = iDEController->NeedToEncryptL(drive);
+    delete iDEController; iDEController = NULL;
+    
+    if (ret)
+        {
+        aDrive = drive;
+        iStorageDrive = drive;
+        }
+    
+    FLOG(_L("CFotaServer::NeedToEncryptL, ret = %d drive = %d << "), ret, aDrive);
+    return ret;
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::DoStartEncryptionL
+// This method is called to start the encryption operation.
+// 
+// --------------------------------------------------------------------------
+// 
+void CFotaServer::DoStartEncryptionL()
+    {
+    FLOG(_L("CFotaServer::DoStartEncryptionL >>"));
+    
+    if (!iDEController)
+        iDEController = CDevEncController::NewL(this);
+    
+    iDEController->DoStartEncryptionL(iStorageDrive);
+    
+    FLOG(_L("CFotaServer::DoStartEncryptionL <<"));
+    }
+
+// --------------------------------------------------------------------------
+// CFotaServer::HandleEncryptionCompleteL
+// This method is called when the encryption operation is complete.
+// 
+// --------------------------------------------------------------------------
+// 
+void CFotaServer::HandleEncryptionCompleteL(TInt aResult, TInt aValue)
+    {
+    FLOG(_L("CFotaServer::HandleEncryptionCompleteL, result = %d, value = %d >>"), aResult, aValue);
+    
+    if (aResult == KErrNone)
+        {
+        //Do nothing
+        }
+    else
+        {
+        FLOG(_L("Can't start update because of error %d"), aResult);
+        iUpdater->HandleEncryptionErrorL(aResult);
+        }
+    
+    if (iDEController)
+        {
+        delete iDEController; iDEController = NULL;
+        }
+    
+    FLOG(_L("CFotaServer::HandleEncryptionCompleteL <<"));
+    }
+
+
+// --------------------------------------------------------------------------
+// CFotaServer::GetDEOperation
+// This method returns the device encryption operation.
+// 
+// --------------------------------------------------------------------------
+// 
+TInt CFotaServer::GetDEOperation()
+    {
+    FLOG(_L("CFotaServer::GetDEOperation >>"));
+    TInt ret (EIdle);
+
+    if (iDEController)
+        ret = iDEController->GetDEOperation();
+    
+    FLOG(_L("CFotaServer::GetDEOperation, ret = %d <<"), ret);
+    return ret;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaSrvApp.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,196 @@
+/*
+* 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:   Methods for CFotaSrvApp
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <apgwgnam.h>
+#include <apgcli.h>
+#include "FotaSrvApp.h"
+#include "FotaSrvDocument.h"
+#include "FotaSrvDebug.h"
+#include "FotaServer.h"
+#include "fotaserverPrivatePSKeys.h"
+#include <apgtask.h>
+
+// ---------------------------------------------------------------------------
+// CFotaSrvApp::CFotaSrvApp
+// ---------------------------------------------------------------------------
+CFotaSrvApp::CFotaSrvApp() : iFotaServer(0), iDocument(0)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaSrvApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------------------------
+//
+TUid CFotaSrvApp::AppDllUid() const
+    {
+    TUid fotauid;
+    fotauid.iUid =  KFotaServerUid;
+    return fotauid;
+    }
+
+// --------------------------------------------------------------------------
+// CFotaSrvApp::SetUIVisibleL
+// Turns UI visible or hidden
+// --------------------------------------------------------------------------
+//
+void CFotaSrvApp::SetUIVisibleL( const TBool aVisible, const TBool aAlsoFSW )
+    {
+    CFotaSrvUi*  ui = (CFotaSrvUi*)iDocument->AppUi(); //CFotaSrvUi
+
+    FLOG(_L("[CFotaSrvApp]  CFotaSrvApp::SetUIVisibleL %d alsoFSW:%d")
+    	,aVisible?1:0,aAlsoFSW?1:0);
+    CCoeEnv*    coe = CCoeEnv::Static();
+
+    TApaTask                task = TApaTask(coe->WsSession());
+
+    task.SetWgId(coe->RootWin().Identifier());
+    
+    if ( aVisible )
+        {
+        //Launch DM UI Application
+        TApaTaskList taskList(coe->WsSession());
+        TApaTask task1(taskList.FindApp( TUid::Uid(KOmaDMAppUid)));
+        FLOG(_L("Checking whether DM UI is running..."));
+        TInt value (EFotaUpdateDM);
+        if (task1.Exists())
+	        {
+   		    FLOG(_L("Bring DM UI into FG")); 
+	        task1.BringToForeground(); //DM UI
+	        }
+        else
+        	{
+TInt err = RProperty::Get( KPSUidNSmlDMSyncApp, KNSmlCurrentFotaUpdateAppName, value );
+
+    			if (value != EFotaUpdateNSC && value != EFotaUpdateNSCBg )
+					{
+						FLOG(_L("Launching DM UI into FG"));
+        		RApaLsSession apaLsSession;
+      			User::LeaveIfError(apaLsSession.Connect());
+      			TThreadId thread;
+           	User::LeaveIfError( apaLsSession.StartDocument(KNullDesC, TUid::Uid( KOmaDMAppUid), thread) );
+           	apaLsSession.Close();
+					}				     
+        	}
+        if(value == EFotaUpdateDM)
+        {
+        	if ( aAlsoFSW ) ui->HideApplicationFromFSW( EFalse );
+				}
+        else if (value == EFotaUpdateNSC || value == EFotaUpdateNSCBg )
+        {
+        	if ( aAlsoFSW ) ui->HideApplicationFromFSW( ETrue );
+        }
+				FLOG(_L("Bring FOTA into FG")); 
+      	task.BringToForeground();
+      }  
+    else
+        {
+        if ( aAlsoFSW ) ui->HideApplicationFromFSW( ETrue );
+
+        task.SendToBackground();      // the task whose wingroup is at next 
+                                      // ordinal position is brought to 
+                                      // foreground
+
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaSrvApp::~CFotaSrvApp()
+// ---------------------------------------------------------------------------
+//
+CFotaSrvApp::~CFotaSrvApp()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaSrvApp::CreateDocumentL()
+// Creates FotaSrvDocument object
+// ---------------------------------------------------------------------------
+//
+CApaDocument* CFotaSrvApp::CreateDocumentL()
+    {
+    #ifdef _FOTA_DEBUG
+    RDebug::Print( _L( "[FotaServer] CFotaSrvApp::CreateDocumentL:" ) );
+    #endif 
+    iDocument = CFotaSrvDocument::NewL( *this );
+    return iDocument;
+    }
+
+#include <eikstart.h>
+
+// ---------------------------------------------------------------------------
+// NewApplication() 
+// Constructs CFotaSrvApp
+// Returns: CApaDocument*: created application object
+// ---------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+    {
+    #ifdef _FOTA_DEBUG
+    RDebug::Print( _L( "[FotaServer] CApaApplication* NewApplication:" ) );
+    #endif 
+    return new CFotaSrvApp;
+    }
+
+// ---------------------------------------------------------------------------
+// ServerL() 
+// Getter for server
+// ---------------------------------------------------------------------------
+//
+CFotaServer* CFotaSrvApp::Server()
+    {
+    return iFotaServer;
+    }
+
+// ---------------------------------------------------------------------------
+// NewAppServerL() 
+// Called by framwork
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvApp::NewAppServerL( CApaAppServer*& aAppServer )
+	{
+    #ifdef _FOTA_DEBUG
+	RDebug::Print( _L( "[FotaServer] CFotaSrvApp::NewAppServerL:" ) );
+    #endif 
+    iFotaServer =  new (ELeave) CFotaServer();
+    iFotaServer->iParentApp = this;
+    aAppServer  = iFotaServer;
+	}
+
+
+// ---------------------------------------------------------------------------
+// E32Main
+// ---------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    TInt err;
+    RProcess pr; TFullName fn = pr.FullName(); 
+    #ifdef _FOTA_DEBUG
+    RDebug::Print(_L("[FotaServer] E32Main:    >> called by %S"), &fn);
+    #endif
+    err = EikStart::RunApplication( NewApplication );
+    #ifdef _FOTA_DEBUG
+    RDebug::Print(_L("[FotaServer] E32Main:    <<"));
+    #endif
+    return err;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaSrvDocument.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* 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:   Fotaserver document class
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <StringLoader.h>
+#include <collate.h>
+#include <featmgr.h>
+#include <fotaserver.rsg>
+#include "FotaSrvDocument.h"
+#include "FotaSrvUI.h"
+#include "FotaSrvDebug.h"
+#include <e32property.h>
+#include "FotaServer.h"
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// Desctructor
+// ---------------------------------------------------------------------------
+//
+CFotaSrvDocument::~CFotaSrvDocument()
+    {
+    TInt err = RProperty::Delete(TUid::Uid(KFotaServerUid), KFotaDownloadActive);
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaSrvDocument::ConstructL
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvDocument::ConstructL()
+    {
+    TInt err1(KErrNone);
+    _LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData );
+    _LIT_SECURITY_POLICY_C1( KWritePolicy, ECapabilityDiskAdmin );
+    TInt err  = RProperty::Define( TUid::Uid(KFotaServerUid),
+                KFotaDownloadActive,
+                RProperty::EInt,KReadPolicy,KWritePolicy); 
+    if(err==0)
+        {
+        err1 =  RProperty::Set( TUid::Uid(KFotaServerUid),KFotaDownloadActive,KErrNotFound ); 
+        }
+        FLOG(_L(" [FotaServer] CFotaSrvDocument::ConstructL  : error in setting rproperty: %d %d"), err,err1);
+	//iEikEnv = CEikonEnv::Static();	
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaSrvDocument::NewL
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CFotaSrvDocument* CFotaSrvDocument::NewL( CAknApplication& aApp )
+    {
+    FLOG( _L( "[FotaServer] CFotaSrvDocument::NewL:" ) );
+
+	CFotaSrvDocument* self = new (ELeave) CFotaSrvDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();  //self
+    return self;
+	}
+
+ 
+// ---------------------------------------------------------------------------
+// CFotaSrvDocument::CreateAppUiL
+// ---------------------------------------------------------------------------
+//
+CEikAppUi* CFotaSrvDocument::CreateAppUiL()
+    {
+    FLOG( _L( "[FotaServer] CFotaSrvDocument::CreateAppUiL:" ) );
+    return new (ELeave) CFotaSrvUi;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaSrvUi.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* 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:   Methods for CFotaSrvUi
+*
+*/
+
+
+
+// INCLUDES 
+
+#include <apgwgnam.h>
+#include <aknnotewrappers.h>
+#include <StringLoader.h>
+#include <textresolver.h>
+#include "FotaSrvUI.h"
+#include "FotaSrvApp.h"
+#include "FotaSrvDebug.h"
+
+// ============================ MEMBER FUNCTIONS =============================
+//
+
+// ---------------------------------------------------------------------------
+// CFotaSrvUi::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvUi::ConstructL()
+    {
+    FLOG( _L( "[FotaServer] CFotaSrvUi::ConstructL:" ) );
+    TInt        flags = EStandardApp|EAknEnableSkin|EAknEnableMSK;
+    CAknAppUi::BaseConstructL( flags );
+    CFotaSrvApp* app = (CFotaSrvApp*) Application();
+    app->SetUIVisibleL(EFalse);
+    iNeedToClose = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+CFotaSrvUi::~CFotaSrvUi()
+    {
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvUi::DynInitMenuPaneL
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvUi::DynInitMenuPaneL( TInt /*aResourceId*/,
+                                         CEikMenuPane* /*aMenuPane*/ )
+    {
+    FLOG( _L( "[FotaServer] CFotaSrvUi::DynInitMenuPaneL:" ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaSrvUi::HandleKeyEventL
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CFotaSrvUi::HandleKeyEventL( const TKeyEvent& aKeyEvent,
+                                            	TEventCode aType )
+    {
+    FLOG(_L( "[FotaServer] CFotaSrvUi::HandleKeyEventL: %d  %d" ), aType
+            , aKeyEvent.iCode ); 
+    if (aType == EEventKey && aKeyEvent.iCode == EKeyEscape )
+    	{
+    	FLOG(_L("Application requested to shutdown..."));
+        CFotaSrvApp* app = (CFotaSrvApp*) Application();
+        CFotaServer* server = app->Server();
+
+    	server->iNeedToClose = ETrue;
+    	}
+    return EKeyWasNotConsumed;
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvUi::HandleCommandL
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvUi::HandleCommandL( TInt aCommand )
+    {
+    FLOG(_L( "[FotaServer] CFotaSrvUi::HandleCommandL >> %d" ),aCommand  );
+    switch ( aCommand )
+        {
+	    case EAknCmdExit:
+        case EEikCmdExit:		// quit application
+		    {
+            
+	        CFotaSrvApp* app = (CFotaSrvApp*) Application();
+	        CFotaServer* server = app->Server();
+	        if (!server->GetDEOperation())
+	            {
+	            FLOG(_L("Exitting FotaServer!!"));
+	            server->iNeedToClose = ETrue;
+	            Exit();
+	            }
+	        else
+	            {
+	            FLOG(_L("Defering exit!"));
+	            }
+		    }
+		    break;
+
+        default:
+            break;      
+        }
+    FLOG(_L( "[FotaServer] CFotaSrvUi::HandleCommandL << %d" ),aCommand  );
+    }
+
+// ---------------------------------------------------------------------------
+// CIVAppUi::OpenFileL
+// This is called by framework when application is already open in background
+// and user open other file in eg. FileBrowse.
+// New file to been shown is passed via aFileName.
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvUi::OpenFileL(const TDesC& aFileName)
+    {
+    FLOG(_L("CFotaSrvUi::OpenFileL(%S)"),&aFileName);
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaAppUi::PrepareToExit
+// This is called by framework when application is about to exit
+// and server can prepare to stop any active downloads
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvUi::PrepareToExit()
+    {
+    FLOG(_L("CFotaSrvUi::PrepareToExit >>"));
+	
+    CFotaSrvApp* app = (CFotaSrvApp*) Application();
+    CFotaServer* server = app->Server();
+    server->iNeedToClose = ETrue;
+
+    FLOG(_L("CFotaSrvUi::PrepareToExit <<"));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/fotaSrvSession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,458 @@
+/*
+* 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:   fotaengines server side session
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "FotasrvSession.h"
+#include "FotaSrvDebug.h"
+#include <eikenv.h>
+#include <eikappui.h>
+#include <s32mem.h>
+#include <e32base.h>
+#include <centralrepository.h>
+#include "FotaServer.h"
+#include "FotaSrvApp.h"
+// ============================= MEMBER FUNCTIONS ============================
+
+class CFotaServer;
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::CheckClientSecureIdL 
+// Returns True if caller is syncml framework. False for fotasrv.
+// Leaves if client is unknown
+// ---------------------------------------------------------------------------
+//
+CFotaSrvSession::TClient CFotaSrvSession::CheckClientSecureIdL (
+                                                  const RMessage2& aMessage)
+    {
+    //TClient     client(EUnknown);
+    TUid    dmhostserver1   = TUid::Uid( KDMHostServer1Uid );
+    TUid    fota            = TUid::Uid( KFotaServerUid );
+    TUid    omadmappui      = TUid::Uid( KOmaDMAppUid );
+    TUid    starter         = TUid::Uid( KStarterUid );
+	TUid	fscheduler		= TUid::Uid( KFotaScheduler );
+	TUid	fms				= TUid::Uid( KFMSServerUid );
+	TUid    softwarechecker = TUid::Uid( 0x2000BB96 );    
+	TUid    softwarecheckerbackground = TUid::Uid( 0x2000BB97 );    
+   TUid    testapp =        TUid::Uid(  0x102073E4); 
+
+  TUid    iadclient = TUid::Uid( 0x2000F85A ); 
+
+	// Syncml
+	if ( aMessage.SecureId() == dmhostserver1.iUid )
+		{
+		FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client is \
+		DmHostserver!"));
+		return EDMHostServer;
+		}
+
+	// OmaDMAPpui
+	if ( aMessage.SecureId() == omadmappui.iUid )
+		{
+		FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client is \
+		omadmappui!"));
+		return EOMADMAppUi;
+		}
+
+	// Fotaserver
+	if ( aMessage.SecureId() == fota.iUid ) 
+		{
+		FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client is \
+		fotaserver!"));
+		return EFotaServer;
+		}
+
+	// Starter
+	if ( aMessage.SecureId() == starter.iUid )
+		{
+		return EStarter;
+		}
+
+
+
+	// Software Checker app
+	if ( aMessage.SecureId() == softwarechecker.iUid || aMessage.SecureId() == iadclient.iUid)
+        {
+        return ESoftwareChecker;
+        }
+
+	// Software Checker Background app
+	if ( aMessage.SecureId() == softwarecheckerbackground.iUid )
+        {
+        return ESoftwareCheckerBackground;
+        }
+
+
+// *3* <-        
+
+
+	// Tester app for testing purp. 
+	if ( aMessage.SecureId() == 0x0323231 || aMessage.SecureId() == testapp.iUid)
+		{
+		return EFotaTestApp;
+		}
+	if ( aMessage.SecureId() == fms.iUid )
+		{
+		return EFMSServer;
+		}
+	// schedulehandler
+	if ( aMessage.SecureId() == fscheduler.iUid)
+		{
+		return EFotaTestApp;
+		}
+
+	FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client 0x%X is unknown \
+	(msg %d), bailing out"),aMessage.SecureId().iId, aMessage.Function());
+	User::Leave( KErrAccessDenied );    
+	return EFotaTestApp; // compiler warning otherwise
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::CFotaSrvSession
+// ---------------------------------------------------------------------------
+//
+CFotaSrvSession::CFotaSrvSession( )
+	{
+	FLOG( _L( "CFotaSrvSession::CFotaSrvSession( )" ) );
+	iError =  KErrNone;
+	//iDoc = CEikonEnv::Static()->EikAppUi()->Document();
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::~CFotaSrvSession
+// ---------------------------------------------------------------------------
+//
+CFotaSrvSession::~CFotaSrvSession()
+{
+}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::CreateL
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvSession::CreateL()
+	{
+	FLOG( _L( "CFotaSrvSession::CreateL() >>" ) );
+	CAknAppServiceBase::CreateL();		
+	FLOG( _L( "CFotaSrvSession::CreateL() <<" ) );
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::ServiceL
+// Handle client request
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvSession::ServiceL(const RMessage2& aMessage)
+	{
+	TInt        err(KErrNone);
+	TInt        pkgid = 0;
+	TPackageState       state;
+	RThread clt; aMessage.ClientL(clt); 
+	TFullName cltnm = clt.FullName();
+	FLOG(_L( "CFotaSrvSession::ServiceL      %d   serving for %S?" )
+			,aMessage.Function(), &cltnm );
+
+	TInt cmd = aMessage.Function();
+	if(( cmd!= EGetState ) && (cmd!= EGetResult ))
+	{
+		TInt fotaValue(1);    
+  	CRepository* centrep( NULL);
+  	TUid uidValue = {0x101F9A08}; // KCRFotaAdapterEnabled
+  	centrep = CRepository::NewL( uidValue); 
+  	if(centrep )
+  	{     
+  		FLOG(_L("centralrepository found "));
+    	centrep->Get( 1 , fotaValue ); // KCRFotaAdapterEnabled     
+    	delete centrep;
+  	}
+  	if ( ! fotaValue )
+  	{
+  		User::Leave( KErrNotSupported );   
+  	}
+  }
+  
+	TClient client = CheckClientSecureIdL ( aMessage );
+
+	switch( aMessage.Function() )
+	{
+	case EFotaFirstCommand:
+		{
+		}
+		aMessage.Complete(KErrNone);
+		break;
+	case EFotaDownload:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL DOWNLOAD") );
+		TDownloadIPCParams          ipc;
+		TPckg<TDownloadIPCParams>   pkg(ipc);
+		aMessage.Read (0, pkg);
+		TInt        deslen  = aMessage.GetDesLengthL (1);
+		HBufC8*     urlbuf  = HBufC8::NewLC(deslen);
+		TPtr8       urlptr  = urlbuf->Des();
+		aMessage.Read (1,urlptr);
+		FotaServer()->DownloadL(ipc,urlptr);
+		CleanupStack::PopAndDestroy(); // urlbuf
+		aMessage.Complete( KErrNone );
+		break;
+		}
+	case EFotaUpdate:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL UPDATE" ));
+		TDownloadIPCParams          ipc;
+		TPckg<TDownloadIPCParams>   pkg(ipc);
+		aMessage.Read( 0 ,pkg );
+		FotaServer()->SetInstallUpdateClientL(client);
+		// If update started from omadmappui, no alert should be sent if 
+		// update is cancelled
+		if ( client == EOMADMAppUi )
+			{
+			ipc.iSendAlert = EFalse;
+			}
+		FotaServer()->UpdateL(ipc);
+		aMessage.Complete( KErrNone );	
+		break;
+		}
+	case EFotaDownloadAndUpdate:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL DOWNLOADANDUPDATE" ));
+		TDownloadIPCParams          ipc;
+		TPckg<TDownloadIPCParams>   pkg(ipc);
+		aMessage.Read (0, pkg);
+		TInt        deslen  = aMessage.GetDesLengthL (1);
+		HBufC8*     urlbuf  = HBufC8::NewLC(deslen);
+		TPtr8       urlptr  = urlbuf->Des();
+		aMessage.Read (1,urlptr);
+		FotaServer()->DownloadAndUpdateL(ipc,urlptr);
+		CleanupStack::PopAndDestroy( urlbuf );
+		aMessage.Complete( KErrNone );	
+		}
+		break;
+	case EFotaOpenUpdatePackageStore:
+		{
+		FLOG(_L("CFotaSrvSession::ServiceL OPENUPDATEPACKAGESTORE"));
+		FotaServer()->OpenUpdatePackageStoreL( aMessage );
+		aMessage.Complete( KErrNone );
+		}
+		break;
+
+	case EFotaGetDownloadUpdatePackageSize:
+		{
+		TInt dlsize = 0;
+		TInt totalsize = 0;
+		pkgid = aMessage.Int0();
+		//err is already KErrNone.
+		FotaServer()->GetDownloadUpdatePackageSizeL( pkgid, dlsize, totalsize );
+		TPckg<TInt> pkg2(dlsize);
+		TPckg<TInt> pkg3 (totalsize);
+		aMessage.Write (1,pkg2);
+		aMessage.Write (2,pkg3);
+		aMessage.Complete( KErrNone );
+		}
+		break;
+
+	case EFotaSendChunk:
+		{
+		FotaServer()->ReadChunkL( aMessage.Int0(),iError );
+		iError =  KErrNone;
+		aMessage.Complete( KErrNone );
+		}
+		break;
+	case EFotaReleaseChunkHandle:
+		{
+		FLOG(_L("CFotaSrvSession::ServiceL  EFotaReleaseChunkHandle"));
+		FotaServer()->UpdateDBdataL();
+		aMessage.Complete( KErrNone );
+		}
+		break;
+
+	case EFotaTryResumeDownload:
+		{
+		if ( (client == EOMADMAppUi) || (client == ESoftwareChecker) )
+			{
+			FotaServer()->TryResumeDownloadL(ETrue); // user initiated
+			aMessage.Complete( KErrNone );				
+			}
+		else if (client == EFMSServer)
+			{
+			FotaServer()->TryResumeDownloadL(EFalse); // fms initiated
+			aMessage.Complete( KErrNone );
+			}
+		else if(client == 	EFotaTestApp)
+		{
+			FotaServer()->TryResumeDownloadL(EFalse); // fms initiated
+			aMessage.Complete( KErrNone );
+		}
+		else
+			{
+			aMessage.Complete ( KErrAccessDenied );
+			}
+		}
+		break;	
+
+	case EUpdatePackageDownloadComplete:
+		{
+		FLOG(_L("CFotaSrvSession::ServiceL \
+		UPDATEPACKAGEDOWNLOADCOMPLETE"));
+		// If caller is syncmlDM framework, download is largeobject 
+		// download. If caller is other, download is Oma DL/http
+   
+		TBool largeobj = (client == EDMHostServer)? ETrue : EFalse;
+		pkgid = aMessage.Int0();
+		FotaServer()->UpdatePackageDownloadCompleteL(largeobj
+				, pkgid);
+		aMessage.Complete( KErrNone );
+		}
+		break;
+	case EDeletePackage:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL DELETEPACKAGE") );
+		pkgid = aMessage.Int0();
+		FotaServer()->DeletePackageL(pkgid);
+		aMessage.Complete( KErrNone );
+		}
+		break;
+	case EGetState:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL GETSTATE >>" ));
+		pkgid = aMessage.Int0();
+		
+		// NSC_DM: commented out 2 strings below, otherwise it crashes from NSC with Kern-Exec 44 -> 
+		if (client != EOMADMAppUi && client != ESoftwareChecker && client != ESoftwareCheckerBackground && client != EFotaTestApp && pkgid < 0)
+			aMessage.Complete (KErrArgument);
+		//	<-		
+		state = FotaServer()->GetStateL(pkgid);
+		//Protecting state 25. If any client other than DM UI queries for state, 25 should not be sent and 
+		//20 will be sent instead.
+		if ( (client != EOMADMAppUi && client != ESoftwareChecker) && state.iState == RFotaEngineSession::EDownloadProgressingWithResume)
+			state.iState = RFotaEngineSession::EDownloadProgressing;
+		FLOG(_L( "CFotaSrvSession::ServiceL GETSTATE << %d" )
+				,state.iState);
+		TPckg<RFotaEngineSession::TState>   pkg2(state.iState);
+		aMessage.Write (1, pkg2);
+		aMessage.Complete (KErrNone);
+		}
+		break;
+	case EGetResult:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL GETRESULT >>" ));
+		pkgid = aMessage.Int0();
+		state = FotaServer()->GetStateL(pkgid);
+		TPckg<TInt>     pkg2(state.iResult);
+		FLOG(_L( "CFotaSrvSession::ServiceL GETRESULT << %d" )
+				,state.iResult);
+		aMessage.Write (1, pkg2);
+		aMessage.Complete (err);
+		break;
+		}
+	case EIsPackageStoreSizeAvailable:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL \
+		ISPACKAGESTORESIZEAVAILABLE" ));
+
+		TInt size   = aMessage.Int0();
+		TBool avail;
+		// In UI evolution, size of file will be checked by fotaserver itself. Keep following
+		// until codhandler skips size check itself 
+		//#ifdef RD_OMADMAPPUI_UI_EVOLUTION
+		if ( client == EFotaServer )	avail = ETrue;
+		else	avail = FotaServer()->IsPackageStoreSizeAvailableL( size );
+		/*#else
+						avail = FotaServer()->IsPackageStoreSizeAvailableL( size );
+			#endif*/
+		TPckg<TBool>     pavail(avail);
+		aMessage.Write (1, pavail);
+		aMessage.Complete (KErrNone);
+		break;
+		}
+
+	case EGetUpdatePackageIds:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL EGETUPDATEPACKAGEIDS" ));
+		TPkgIdList                      pkgids;
+		FotaServer()->GetUpdatePackageIdsL(pkgids);
+		TPckg<TPkgIdList>               pkgids_pkg(pkgids);
+		aMessage.Write(0, pkgids_pkg);
+		aMessage.Complete(KErrNone);
+		}
+		break;
+
+	case EGetUpdateTimestamp:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL EGETUPDATETIMESTAMP" ));
+		TBuf16<15>        timestamp;
+		FotaServer()->GetUpdateTimeStampL(timestamp);
+		aMessage.Write(0, timestamp );
+		aMessage.Complete(KErrNone);
+		}
+		break;
+
+	case EGenericAlertSentForPackage:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL EGENERICALERTSENT FOR PKGID" ));
+		TInt pkgid = aMessage.Int0();
+		FotaServer()->GenericAlertSentL( pkgid );
+		aMessage.Complete( err );
+		}
+		break;
+
+	case EScheduledUpdate:
+		{
+		FLOG(_L( "CFotaSrvSession::ServiceL ESCHEDULEDUPDATE" ));
+		TFotaScheduledUpdate           sched(-1,-1);
+		TPckg<TFotaScheduledUpdate>    p(sched);
+		aMessage.Read (0, p);
+		FotaServer()->SetInstallUpdateClientL(client);
+		FLOG(_L(" pkgid: %d   scheduleid:%d"), sched.iPkgId,sched.iScheduleId);
+		FotaServer()->ScheduledUpdateL( sched );
+		aMessage.Complete( KErrNone );
+		}
+		break;
+
+	default:
+		{
+		CAknAppServiceBase::ServiceL( aMessage );
+		}
+		break;
+	}		
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::ServiceError
+// ---------------------------------------------------------------------------
+//
+void CFotaSrvSession::ServiceError( const RMessage2& aMessage,TInt aError )
+	{
+	FLOG(_L( "CFotaSrvSession::ServiceError %d" ),aError );
+	iError = aError;
+	CFotaServer* f = FotaServer();
+	TRAPD(err2, f->iParentApp->SetUIVisibleL ( EFalse,ETrue ) );
+	if(err2); // remove compiler warning
+	CAknAppServiceBase::ServiceError( aMessage, aError );
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaSrvSession::FotaServer
+// Helper function
+// ---------------------------------------------------------------------------
+//
+
+CFotaServer*  CFotaSrvSession::FotaServer() const
+{
+return (CFotaServer* ) Server();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/fotadownload.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1979 @@
+/*
+* 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:   downloads upd pkg
+*
+*/
+
+
+
+// INCLUDES
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <es_enum_internal.h>
+#endif
+#include <centralrepository.h>
+#include <f32file.h>
+#include <AknWaitDialog.h>
+#include <fotaserver.rsg>
+#include <eikprogi.h>
+#include <eikenv.h>
+#include <apgtask.h>
+#include <apgwgnam.h>
+#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <es_sock.h>
+#else
+#include <es_sock.h>
+#include <es_sock_partner.h>
+#endif
+#include <es_enum.h>
+#include <NSmlDMSync.rsg>	//OMA DM UI for reading resource
+#include <bautils.h>
+#include <StringLoader.h>
+#include <DevManInternalCRKeys.h> //for reading san feature
+#include <e32property.h>
+#include "fotastorage.h"
+#include "FotaSrvApp.h"
+#include "fotadownload.h"
+#include "fotaserverPrivatePSKeys.h"
+#include "FotaNetworkRegStatus.h"
+#include <startupdomainpskeys.h>	//globalrfsstates
+#include <uri8.h>
+#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
+#define __LEAVE(x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::NewL 
+// --------------------------------------------------------------------------
+CFotaDownload* CFotaDownload::NewL (CFotaServer* aServer)
+	{
+	__ASSERT_ALWAYS( aServer, User::Panic(KFotaPanic, KErrArgument) );
+	CFotaDownload* ao = new (ELeave) CFotaDownload();
+	ao->iFotaServer = aServer;
+	return ao;
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::RunL
+// Do operations started in HandleDmgrEvent
+// --------------------------------------------------------------------------
+void CFotaDownload::RunL()
+	{
+	FLOG(_L( "[FotaServer] CFotaDownload::RunL() >>"));
+	CancelDownload( ETrue );
+	CreateDownloadL();
+	FLOG(_L( "[FotaServer] CFotaDownload::RunL() <<" ) );
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::DoCancel()
+// Cancel notifier request
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::DoCancel()
+	{
+	FLOG(_L("CFotaDownload::DoCancel() >>"));
+	FLOG(_L("CFotaDownload::DoCancel() <<"));
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::RunError(TInt aError)
+// Handle active object run error.
+// --------------------------------------------------------------------------
+//
+TInt CFotaDownload::RunError(TInt aError)
+	{
+	if(aError)
+		{
+		FLOG(_L(" CFotaDownload::RunError err %d"), aError );
+		}
+	return KErrNone;
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::CFotaDownload()
+// --------------------------------------------------------------------------
+//
+CFotaDownload::CFotaDownload() : CActive(EPriorityNormal)
+		, iUpdateAfterDownload (EFalse), iUrl( NULL ),
+		iDownload (NULL),
+		iDownloadedContentSize(0),
+		iPreviousContentSize ( 0 ), iShowOMACDUI(EFalse), iShowDLPrgUI(EFalse),
+		iDownloadResumable (EFalse),				
+		iFMSEnabled (EFalse),
+		iDownloadActive (EFalse),
+		iFreshDL(ETrue),
+		iUserInitiatedResume(EFalse),		
+		iSanValue(KErrNotFound),
+		iDownloadFinalized(EFalse)		
+	{
+	CActiveScheduler::Add( this ); 
+	FLOG(_L("CFotaDownload::CFotaDownload()"));
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::~CFotaDownload()
+// --------------------------------------------------------------------------
+//
+CFotaDownload::~CFotaDownload()
+	{
+	FLOG(_L("CFotaDownload::~CFotaDownload() >>"));
+	Cancel();
+	
+	//Sets download state inactive if accidently closed. This is anyhow taken care in FinalizeDownload in Server.
+	SetDownloadActive(EFalse);
+	CancelDownload( ETrue );
+	if ( iUrl )
+		{
+		delete iUrl; iUrl=NULL;
+		}
+/*	if ( iNotifHandler ) Deleted at server
+		{
+		iNotifHandler->Cancel();
+		delete iNotifHandler;        
+		}*/
+	if ( iDLProgressDlg )
+		{
+		delete iDLProgressDlg; iDLProgressDlg=NULL;
+		}
+
+	if (iDownloadMgr.Handle())
+		iDownloadMgr.Close();
+	//don't delete iFotaServer as it doesn't belong here.
+	
+	FLOG(_L("CFotaDownload::~CFotaDownload() <<"));
+}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::CancelDownload
+// Cancel download
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::CancelDownload( const TBool aCancelProgressBar )
+	{
+	FLOG(_L("CFotaDownload::CancelDownload() >>"));
+	
+	if( iDownloadMgr.Handle() )
+		{
+		iDownloadMgr.Close();
+		}
+
+	if ( aCancelProgressBar  && iDLProgressDlg )
+		{
+		TRAPD(err, iDLProgressDlg->ProcessFinishedL() ) ;// deletes
+		if(err); // remove compiler warning
+		delete iDLProgressDlg;
+		iDLProgressDlg = NULL;
+		}
+	FLOG(_L("CFotaDownload::CancelDownload() <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::CreateDownloadL
+// Create  download
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::CreateDownloadL()
+	{
+	FLOG(_L("CFotaDownload::CreateDownloadL() >>") );
+	__ASSERT_ALWAYS( iDownloadMgr.Handle()==0, User::Leave(KErrAlreadyExists) );
+	RHttpDownload*  d(NULL);
+	iDLNeedsReset = EFalse;
+	TBool       created;
+	iDownloadMgr.ConnectL( TUid::Uid(KFotaServerUid) , *this, EFalse); 
+	FLOG(_L("CFotaDownload::CreateDownloadL, Stage 1") );
+	iDownloadMgr.DeleteAll();
+
+	TRAPD(err, d = &iDownloadMgr.CreateDownloadL( *iUrl, created ) );
+	RFs fs;	
+	if(fs.Connect() == KErrNone)
+	    {
+	    RFile file;    
+	    CleanupClosePushL( fs );
+	    CleanupClosePushL( file );
+	    err=fs.MkDir(KDDDirPath);
+	    FLOG(_L("creating directory err as %d"),err);
+	    err=fs.SetSessionPath(KDDDirPath);
+	    FLOG(_L("setting session path err as %d"),err);
+	    err=fs.ShareProtected();
+	    FLOG(_L("ShareProtected err as %d"),err);
+	    err = file.Replace(fs,KDDFilename, EFileWrite|EFileShareAny);	
+	    FLOG(_L("creating rfile err as %d"),err);	
+	    err = d->SetFileHandleAttribute(file);
+	    FLOG(_L("setting dlmgr destfile attrib err as %d"),err);
+	    CleanupStack::PopAndDestroy( &file );
+	    CleanupStack::PopAndDestroy( &fs );
+	    }	
+	FLOG(_L("CFotaDownload::CreateDownloadL, Stage 2. err %d"),err);
+	if ( err  == KErrArgument ) User::Leave( KErrNotFound );
+	else if( err !=KErrNone)    User::Leave( err );
+
+	if ( iDLState.iIapId > KErrNotFound )
+		{
+		FLOG(_L("   Using internet access point iapid: %d"), iDLState.iIapId);
+		err = iDownloadMgr.SetIntAttribute( EDlMgrIap, iDLState.iIapId); // IAP id
+		User::LeaveIfError( err );        
+		//At this point the iIapId used in the SyncML Session is presumed working. Hence
+		//the same is stored in database for use during download.
+		FLOG(_L("Setting IAPID=%d is FotaState"),iDLState.iIapId);
+		iFotaServer->iDatabase->OpenDBL();
+		iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBIapId );
+		iFotaServer->iDatabase->CloseAndCommitDB();
+		}
+	FLOG(_L("CFotaDownload::CreateDownloadL, Stage 3") );
+	User::LeaveIfError( d->SetIntAttribute(EDlAttrFotaPckgId ,iDLState.iPkgId) );
+	FLOG(_L("CFotaDownload::CreateDownloadL, Stage 4") );
+	User::LeaveIfError( d->SetBoolAttribute(EDlAttrNoContentTypeCheck,ETrue) );
+
+	// If ui hidden or download restarting, do not show descriptor
+	if ( !iShowOMACDUI || iRestartCounter > 0 )
+		{
+		FLOG(_L("setting DD to hidden"));
+		User::LeaveIfError(iDownloadMgr.SetBoolAttribute( EDlMgrSilentMode,ETrue )) ;
+		}
+	//It's a fresh download
+	iFreshDL = ETrue;
+
+	// Start download 
+	User::LeaveIfError(iDownloadMgr.StartAll()); 
+	FLOG(_L("CFotaDownload::CreateDownloadL, Stage 5") );
+	iDLProgress = EStarted;
+
+	//This P&S Key is used to notify DM UI on any download event. key=0 for idle and key=1 for download
+	err = RProperty::Set( TUid::Uid(KOmaDMAppUid),
+			KFotaDMRefresh,
+			ETrue );
+	FLOG(_L("RProperty KFotaDMRefresh Set Etrue, err = %d"), err);
+
+	SetDownloadActive(ETrue);
+
+	User::LeaveIfError(err);
+	FLOG(_L("[FotaServer]  CFotaDownload::CreateDownloadL <<"));
+}
+
+	// --------------------------------------------------------------------------
+	// CFotaDownload::DownloadL
+	// Start download of swupd package.
+	// --------------------------------------------------------------------------
+	//
+void CFotaDownload::DownloadL(TDownloadIPCParams aParams,const TDesC8& aPkgURL
+		,TBool aUpdateAfterDownload,const TInt aIapid,const TInt aRestartDownload)
+	{
+	FLOG(_L("[FotaServer]  CFotaDownload::DownloadL >> restart %d"),aRestartDownload);
+
+	TInt err = RProperty::Define( TUid::Uid(KOmaDMAppUid),
+			KFotaDMRefresh,
+			RProperty::EInt,KReadPolicy,KWritePolicy);
+	FLOG(_L("RProperty KFotaDMRefresh Define, err = %d"), err);        
+	if (err != KErrAlreadyExists )
+		{
+		User::LeaveIfError(err);
+
+		err = RProperty::Set( TUid::Uid(KOmaDMAppUid),
+				KFotaDMRefresh,
+				KErrNotFound );
+
+		FLOG(_L("RProperty KFotaDMRefresh Set KErrNotFound, err = %d"), err);
+		User::LeaveIfError(err);
+		}
+
+	if ( iUrl ) {delete iUrl; iUrl=NULL;}
+	iUrl = aPkgURL.Alloc();
+	
+	iRestartCounter = aRestartDownload;
+
+	iDLState        = aParams;
+	FLOG(_L("CFotaDownload::DownloadL, Stage 1") );
+
+	// Set state -------------------------------------------------------------
+	iDLState.iState = RFotaEngineSession::EStartingDownload;
+
+	iDLState.iResult = KErrNotFound;
+	iDLState.iUpdateLtr = aUpdateAfterDownload;
+	iFotaServer->iDatabase->OpenDBL();
+	iFotaServer->iDatabase->SetStateL( iDLState, *iUrl,EFDBState|EFDBResult
+			| EFDBProfileId|EFDBPkgUrl|EFDBPkgName|EFDBVersion|EFDBUpdateLtr);
+	iFotaServer->iDatabase->CloseAndCommitDB();
+	FLOG(_L("CFotaDownload::DownloadL, Stage 2, pkgid:%d"),iDLState.iPkgId);
+
+	// 2. Get Iap Id to use for download. This would be set in iDLState.iIapId.
+	SetIapToUseL(aParams, aIapid);
+
+
+	if ( iDLState.iIapId > KErrNotFound )
+		{
+		iFotaServer->iDatabase->OpenDBL();
+		iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBIapId );
+		iFotaServer->iDatabase->CloseAndCommitDB();
+		}
+		
+	/*
+	TBuf8<100> test;
+	//_LIT8( KNSmlDMFotaNode,"http://2IND02230.noe.nokia.com8080/myspace/ddv1.dd" );
+	_LIT8( KNSmlDMFotaNode,"http://fdsqa.nokia.com/fdp/interface?fid=A0A19HMCUHWRU" );
+	test.Copy(KNSmlDMFotaNode);
+	
+	
+    TUriParser8 parser;
+
+    if (!parser.Parse(test) && !parser.IsSchemeValid()) */ 
+		
+	TUriParser8 parser;
+	
+	
+
+    if((parser.Parse(aPkgURL) == KErrNone) && !parser.IsSchemeValid() )
+	
+	{
+        FLOG(_L("URL is malformed.. finalizing download"));
+        iDLState.iResult = RFotaEngineSession::EResMalformedOrBadURL;
+        iDLState.iState  = RFotaEngineSession::EDownloadFailed;
+        iFotaServer->iDatabase->OpenDBL();
+        iFotaServer->iDatabase->SetStateL(iDLState, KNullDesC8, EFDBState | EFDBResult);
+        iFotaServer->iDatabase->CloseAndCommitDB();
+        iFotaServer->FinalizeDownloadL(iDLState);
+        LaunchNotifierL(ESyncMLFwUpdErrorNote, KErrGeneralNoResume, EFalse );
+        return;
+	}
+	iUpdateAfterDownload = aUpdateAfterDownload;
+
+	// 3. Determine whether download should be visible or not
+	// Autoaccepted profile?
+
+	SetDownloadUiBehavior(ETrue);
+
+	CancelDownload( ETrue );
+
+	FLOG(_L("Setting SessionType=%d in FotaState"),iDLState.iSessionType);
+	iFotaServer->iDatabase->OpenDBL();
+	iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBSessionType );
+	iFotaServer->iDatabase->CloseAndCommitDB();
+	FLOG(_L("CFotaDownload::DownloadL, Stage 3") );
+	//Called to read the download variations in Fota (resume support & FMS)
+	CheckDownloadVariations();
+
+	//Create the download
+	CreateDownloadL( );
+	FLOG(_L("[FotaServer]  CFotaDownload::DownloadL <<"));
+	}
+
+// ---------------------------------------------------------------------------
+// CFotaDownload::HandleDLProgressDialogExitL
+// Handle canceling of download
+// ---------------------------------------------------------------------------
+TBool CFotaDownload::HandleDLProgressDialogExitL( TInt aButtonId ) 
+	{
+	FLOG(_L("CFotaDownload::HandleDLProgressDialogExitL %d, note = %d >>"),aButtonId, iDLProgressDlg->iNoteType);
+	// Cancel clicked during download
+	if ( aButtonId == KErrNotFound )
+		{
+		iRestartCounter = -1;
+		FLOG(_L("[FotaServer]  CFotaDownload::HandleDLProgressDialogExitL Hiding UI"));
+		iFotaServer->iParentApp->SetUIVisibleL ( EFalse, ETrue );
+		iUpdateAfterDownload = EFalse;
+
+		iDLState.iResult = RFotaEngineSession::EResUserCancelled;
+
+		if (iDLProgressDlg->iNoteType == EConnectingNote)
+			{
+			iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+
+			TInt active (KErrNotFound);
+			RProperty::Get( TUid::Uid(KFotaServerUid), KFotaDownloadActive, active );
+			FLOG(_L("active = %d"),active);
+			
+			if (active) //Resume operation has just begun and download request is submitted to dlmgr. Hence need to suspend.
+				{
+				RunDownloadSuspendL(RFotaEngineSession::EResUserCancelled, ETrue);
+				}
+			else //Resume operation has just begun, but download request is not submitted to dlmgr
+				{
+				LaunchNotifierL( ESyncMLFwUpdOmaDLPostponed, EFalse, EFalse );
+				iFotaServer->FinalizeDownloadL( iDLState );
+				}
+			}
+		else if (iDLProgressDlg->iNoteType == EDownloadingNote)
+			{
+			if (iDownloadResumable)
+				{
+				//Resume is supported. Query user whether to postpone or cancel download.
+				FLOG(_L("User pressed cancel. Resume is supported; hence pause download and query user if download has to be postponed or cancelled permanently."));
+				RunDownloadSuspendL(RFotaEngineSession::EResUserCancelled);
+				}
+			else
+				{
+				//Resume is not supported. Download is cancelled
+				FLOG(_L("User pressed cancel. Resume is not supported & hence download has to be cancelled"));
+				RunDownloadCancelL(RFotaEngineSession::EResUserCancelled);
+				}
+			}
+		}
+	FLOG(_L("CFotaDownload::HandleDLProgressDialogExitL <<"));
+	return ETrue;
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::DoHandleDMgrEventL
+// Handles download events. Updates package state accordingly
+// --------------------------------------------------------------------------
+void CFotaDownload::DoHandleDMgrEventL( RHttpDownload* aDownload
+		, THttpDownloadEvent aEvent )
+	{
+	__ASSERT_ALWAYS( aDownload, User::Panic(KFotaPanic, KErrArgument) );
+	TInt32                      sysErrorId( KErrNone );
+	TInt32                      contentsize;
+	TInt32                      downloadedsize;
+
+	TInt32                      tmp;
+	THttpDownloadMgrError       dlErrorId;
+	iDownload = aDownload;
+	// If DL is in final state (complete/fail), there's an error id available.
+	User::LeaveIfError( aDownload->GetIntAttribute( EDlAttrGlobalErrorId
+			,sysErrorId ) );
+	User::LeaveIfError( aDownload->GetIntAttribute( EDlAttrDownloadedSize
+			,downloadedsize ) );
+	User::LeaveIfError( aDownload->GetIntAttribute( EDlAttrLength
+			,contentsize ) );
+	User::LeaveIfError( aDownload->GetIntAttribute( EDlAttrErrorId
+			,tmp ) );
+	dlErrorId = (THttpDownloadMgrError)tmp;
+
+
+	// Update progress dlg progress
+	if ( !iDLProgressDlg && iRestartCounter>0)
+		{
+		FLOG(_L("reshowing progress..."));
+		iDLProgressDlg = new(ELeave) CFotaDLProgressDlg((CEikDialog** ) &iDLProgressDlg , EFalse, this, EDownloadingNote );
+		iDLProgressDlg->PrepareLC( R_FOTASERVER_DL_PROGRESS_DIALOG );
+		iDLProgressDlg->RunLD();
+		}
+	if (iDLProgressDlg)
+		{
+		CEikProgressInfo* progressInfo = iDLProgressDlg->GetProgressInfoL();
+		__ASSERT_ALWAYS( progressInfo, User::Panic(KFotaPanic, KErrBadHandle) );
+		if ( iPreviousContentSize!=contentsize )
+			{
+			iPreviousContentSize = contentsize;
+			if ( contentsize > 0 )
+				{
+				progressInfo->SetFinalValue( contentsize );
+				}
+			}
+		TInt incr = downloadedsize - iDownloadedContentSize;
+		if (incr<=0) incr=0; //Protection
+		progressInfo->IncrementAndDraw(incr);
+		iDownloadedContentSize = downloadedsize;
+		}
+	FLOG(_L("CFotaDownload::HandleDMgrEventL() >>   DLstate:%d  ProgressSt:%d\
+	globErr: %d DLError: %d (%d/%d)"),aEvent.iDownloadState
+	,aEvent.iProgressState,sysErrorId,dlErrorId,downloadedsize,contentsize );
+
+	if ( sysErrorId <= -25000)  { FLOG(_L("  error %d interpreted as http \
+	error %d") , sysErrorId, sysErrorId + 25000 ); }
+
+	switch ( aEvent.iDownloadState )
+	{
+	case EHttpDlCreated:		// 1
+		{
+		FLOG(_L("Download State: EHttpDlCreated"));
+		}
+		break;
+	case EHttpDlInprogress:     // 2
+		{
+		FLOG(_L("Download State: EHttpDlProgress"));
+
+
+		if (aEvent.iProgressState == EHttpProgCodDescriptorDownloaded)
+			{
+			if (iShowOMACDUI || iShowDLPrgUI)
+				{
+				iFotaServer->iParentApp->SetUIVisibleL ( ETrue, EFalse);
+				}
+			}
+
+		// Is ECodLoadEnd optimized out?
+		if ( aEvent.iProgressState == EHttpProgCodLoadEnd ) // 2503
+			{
+			TInt    err;
+			err = aDownload->Start();  // PPAR-6FRHFY fixed
+			if(err)
+				{
+				FLOG(_L(" ERROR when restarting DL %d"),err);
+				User::Leave(err);
+				}
+			FLOG( _L("          DL restarted") );
+			}
+
+		// Should tell user to free disk space. But how do we know that disk space is about be exceeded?
+
+		if ( iDLNeedsReset )
+			{
+			FLOG(_L("aDownload->Reset();"));
+			iDLNeedsReset = EFalse;
+			iStatus = KRequestPending;
+			SetActive();
+			TRequestStatus* status = &iStatus;
+			User::RequestComplete( status, KErrNone );
+			User::LeaveIfError( aDownload->Reset() );
+			}
+
+		// Body data of descriptor or payload pkg
+		if ( aEvent.iProgressState == EHttpProgResponseBodyReceived && iDLProgress==EDescriptorDownloaded/*2500*/)
+			{
+			// Now pkg size can be retrieved. must check size.
+			iDLState.iPkgSize = contentsize;
+			FLOG(_L("Setting PkgSize=%d in FotaState"),contentsize);
+			iFotaServer->iDatabase->OpenDBL();
+			iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBPkgSize );
+			iFotaServer->iDatabase->CloseAndCommitDB();
+			
+
+			TInt contentsize2 = contentsize;
+			
+			TInt dlsize (KErrNone);
+			TInt tlsize (KErrNone);
+
+			TRAPD(err, iFotaServer->GetDownloadUpdatePackageSizeL(iDLState.iPkgId, dlsize,tlsize));
+			if(err); // remove compiler warning
+			contentsize2 -= dlsize;
+			FLOG(_L("check pkg size = %d"),contentsize2 );
+
+			CFotaStorage::TFreeSpace avail = iFotaServer->StoragePluginL()->IsPackageStoreSizeAvailableL(contentsize2);
+
+			iDLProgress = ESizeChecked;
+
+			if ( avail==CFotaStorage::EDoesntFitToFileSystem )
+				{
+				FLOG(_L("CFotaStorage::EDoesntFitToFileSystem"));
+				if (iFreshDL)
+					{
+					if ( iShowDLPrgUI )
+						{
+						FLOG(_L("iDLNeedsReset = ETrue;"));
+						iDLNeedsReset = ETrue;
+						LaunchNotifierL( ESyncMLFwUpdOmaDLNotEnoughMemory, KErrDiskFull,contentsize2 );
+						}
+					else
+						{
+						iDLState.iResult = RFotaEngineSession::EResDLFailDueToDeviceOOM;
+						iDLState.iState  = RFotaEngineSession::EDownloadFailed;
+						iUpdateAfterDownload = EFalse;
+						LaunchNotifierL( ESyncMLFwUpdErrorNote, KErrGeneral, contentsize2,ETrue );
+						}
+					}
+				else //resuming download
+					{
+					FLOG(_L("Memory need in order to resume. Notify user..."));
+					LaunchNotifierL( ESyncMLFwUpdOmaDLNotEnoughMemory, KErrDiskFull,contentsize2 );
+					RunDownloadSuspendL(RFotaEngineSession::EResDLFailDueToDeviceOOM);
+					}
+					
+				}
+			}
+
+		// OMA DD download completed , must hide progress
+		if ( aEvent.iProgressState == EHttpProgContentTypeChanged ) // 2055
+			{
+			if ( iDLProgressDlg )
+				{
+				iDLProgressDlg->ProcessFinishedL(); // deletes itself
+				delete iDLProgressDlg;
+				iDLProgressDlg = NULL;
+				}
+			}
+		// OMA DD accepted,show progress
+		if ( aEvent.iProgressState == EHttpProgCodDescriptorAccepted ) // 2502
+
+			{
+			iDLProgress = EDescriptorDownloaded;
+			if ( iShowDLPrgUI )
+				{
+				FLOG(_L("SHOW PROGRESS"));
+				if ( iDLProgressDlg )
+					{
+					FLOG(_L("Removing Connecting progress note..."));
+					iDLProgressDlg->ProcessFinishedL();
+					delete iDLProgressDlg;
+					iDLProgressDlg = NULL;
+					}
+				if (!iDLProgressDlg)
+					{
+					
+					FLOG(_L("Creating iDLProgressDlg"));
+					iDLProgressDlg = new(ELeave) CFotaDLProgressDlg((CEikDialog** ) &iDLProgressDlg , EFalse, this, EDownloadingNote );
+					iDLProgressDlg->PrepareLC( R_FOTASERVER_DL_PROGRESS_DIALOG );
+					iDLProgressDlg->RunLD();
+					}
+				CEikProgressInfo* progressInfo = iDLProgressDlg->GetProgressInfoL();
+				progressInfo->SetFinalValue( 500 );
+				iPreviousContentSize = -1;
+				iDownloadedContentSize = 0;
+				iFotaServer->iParentApp->SetUIVisibleL ( ETrue , EFalse );
+				}
+			if (iDownloadResumable)
+				{
+				FLOG(_L("Setting download as resumable"));
+				iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+		    	iFotaServer->SetStartupReason(EFotaDownloadInterrupted);
+				}
+			else
+				{
+				FLOG(_L("Setting download as non resumable"));
+				iDLState.iState = RFotaEngineSession::EDownloadProgressing;
+				iFotaServer->SetStartupReason(EFotaPendingGenAlert);
+				}
+			iFotaServer->iDatabase->OpenDBL();
+			iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBState );
+			iFotaServer->iDatabase->CloseAndCommitDB();
+
+
+			if (iDLState.iIapId <= 0) //Read the IAP ID when not known, and set it into db.
+				{
+				TInt32 usedapid (KErrNotFound);
+				TInt er = iDownloadMgr.GetIntAttribute( EDlMgrIap, usedapid);
+				iDLState.iIapId = usedapid;
+				FLOG(_L("Setting IAPID=%d is FotaState"),iDLState.iIapId);
+				iFotaServer->iDatabase->OpenDBL();
+				iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBIapId );
+				iFotaServer->iDatabase->CloseAndCommitDB();
+				}
+			}
+		}
+		break;
+	case EHttpDlCompleted:      // 4
+		{
+		FLOG(_L("Download State: EHttpDlCompleted"));
+
+		iRestartCounter = -1;
+		if ( iDLProgressDlg )
+			{
+			iDLProgressDlg->ProcessFinishedL(); // deletes itself
+			delete iDLProgressDlg;
+			iDLProgressDlg = NULL;
+			}
+		iDLState.iState     = RFotaEngineSession::EDownloadComplete;
+
+		if (iUpdateAfterDownload)
+			iDLState.iResult = KErrNotFound;
+		else
+			iDLState.iResult    = RFotaEngineSession::EResSuccessful;
+		iFotaServer->FinalizeDownloadL( iDLState );
+		}
+		break;
+	case EHttpDlPaused: //Event thrown for any resumable download
+	case EHttpDlFailed: //Event thrown for any non-resumable download or critical error on resumable download
+		{
+		
+		if (aEvent.iProgressState != EHttpProgNone) //Accepting only events from COD
+			return;
+
+		if (aEvent.iDownloadState == EHttpDlPaused)
+			{
+			FLOG(_L("Download State: EHttpDlPaused"));
+			if (iDownloadResumable)
+				{
+				iDLState.iState     = RFotaEngineSession::EDownloadProgressingWithResume;
+				}
+			else 
+				{
+				// iDownloadResumable remains 0 even for resumable download.
+				iDLState.iState     = RFotaEngineSession::EDownloadFailed;
+				}
+			}
+		else //aEvent.iDownloadState = EHttpDlFailed
+			{
+			FLOG(_L("Download State: EHttpDlFailed"));
+			iDLState.iState     = RFotaEngineSession::EDownloadFailed;
+			iDownloadResumable = EFalse;
+			}
+		//Remove the download progress bar
+		if ( iDLProgressDlg && (iDLState.iResult != RFotaEngineSession::EResUserCancelled ))
+			{
+			FLOG(_L("Shd not come in EResUserCancelled"));
+			iDLProgressDlg->ProcessFinishedL(); // deletes itself
+			delete iDLProgressDlg;
+			iDLProgressDlg = NULL;
+			}
+		// This is restarted download => decrement counter
+		if ( iRestartCounter > 0 )
+			{
+			--iRestartCounter;
+			if ( iRestartCounter <=0 ) iRestartCounter = -1;
+			FLOG(_L("   iRestartCounter to %d"),iRestartCounter );
+			}
+		/*****************************/
+		//Handling all errors now...//
+		/****************************/
+		TInt notifType (KErrNotFound);
+		TInt notifParam (KErrNotFound);
+		//Handling User Cancel of Download Descriptor
+		if ( dlErrorId == EGeneral && (sysErrorId == KErrAbort || sysErrorId == KErrCancel ))
+			{
+			FLOG(_L("Reason: User cancelled download descriptor"));
+			//LaunchNotifierL(ESyncMLFwUpdOmaDLCancelled, EFalse, EFalse);
+			iRestartCounter = -1;
+			iDLState.iResult = RFotaEngineSession::EResUserCancelled;
+			notifType = ESyncMLFwUpdOmaDLCancelled;
+			notifParam = KErrNone;
+			}
+		//Handling User Cancel
+		else if ( iDLState.iResult == RFotaEngineSession::EResUserCancelled ) //This variable is set in RunDownloadCancelL or RunDownloadSuspendL
+			{
+			iRestartCounter = -1;
+			//If initial pause is successful, query user if he wants to postpone or cancel permanently.
+			iFotaServer->iDatabase->OpenDBL();
+			iFotaServer->iDatabase->SetStateL(iDLState,KNullDesC8, EFDBState);
+			iFotaServer->iDatabase->CloseAndCommitDB();
+
+			if (iDownloadResumable)
+				{
+				if (!iSilentOpn)
+					{
+					FLOG(_L("Download has been paused successful. Query user if he wants to postpone or cancel permanently"));
+					LaunchNotifierL(ESyncMLFwUpdOmaDLUserCancel, KErrNone, KErrNone);
+					break;
+					}
+				else
+					{
+					notifType = ESyncMLFwUpdOmaDLPostponed;
+					notifParam = KErrNone;
+					}
+				}
+			else 
+				{
+				FLOG(_L("Error while initial pausing...%d Hence download has to be cancelled permanently!"));
+				RunDownloadCancelL(RFotaEngineSession::EResUserCancelled);
+        notifType = ESyncMLFwUpdOmaDLCancelled;
+        notifParam = KErrNone;
+				}
+			}
+		else if ( iDLState.iResult == RFotaEngineSession::EResDLFailDueToDeviceOOM )
+			{
+			FLOG(_L("Reason: Not enough memory to perform resume"));
+			iRestartCounter = -1;
+
+			if (iDownloadResumable)
+				iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+			else
+				iDLState.iState = RFotaEngineSession::EDownloadFailed;
+			}
+		//Handling user cancel IAP selection popup
+		else if ( dlErrorId == EConnectionFailed && sysErrorId == KErrCancel)
+			{
+			FLOG(_L("Reason: User canceled IAP selection popup"));
+			iDLState.iResult = RFotaEngineSession::EResUserCancelled;
+			iRestartCounter = -1;
+
+			notifType = ESyncMLFwUpdOmaDLPostponed;
+			notifParam = KErrNone;
+			}
+		//Handling temproary network timeout. This may either try resume or restart based on download.
+/*		else if ( dlErrorId == EGeneral && sysErrorId == KErrTimedOut )
+			{
+			FLOG(_L("Reason: Network timeout"));
+			// No restart issued yet, this is 1st download attempt
+			if ( iRestartCounter == 0 )
+				{
+				iRestartCounter = KFotaDownloadTimeoutRestartCount;
+				iDLState.iState     = RFotaEngineSession::EIdle;
+				FLOG(_L("Trying to restart download (iRestartCounter=%d)"),iRestartCounter );
+				}
+			
+			}*/
+		//Handling all Network interrupts
+		else if ( (dlErrorId == EConnectionFailed && sysErrorId == KErrCommsLineFail)|| 
+				  dlErrorId == ETransactionFailed || 
+				  (dlErrorId == KErrCodWapConnectionDropped && sysErrorId == KErrGeneral) ||
+				  (dlErrorId == EGeneral && sysErrorId == KErrTimedOut) ||
+				  (dlErrorId == EConnectionFailed && sysErrorId == KErrGprsServicesNotAllowed ) ||
+				  (dlErrorId == EConnectionFailed && sysErrorId == KErrGsmMMNetworkFailure ) ||
+				  (dlErrorId == EConnectionFailed && sysErrorId == KErrWlanNetworkNotFound )
+				  )
+			{
+			FLOG(_L("Reason: Network breakage"));
+			iRestartCounter = -1;
+			notifType = ESyncMLFwUpdErrorNote;
+			if (iDownloadResumable)
+				{
+				notifParam = KErrCommsLineFail2;
+				iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+				iDLState.iResult = RFotaEngineSession::EResDLFailDueToNWIssues;
+				}
+			else
+				{
+				notifParam = KErrCommsLineFail;
+				iDLState.iState = RFotaEngineSession::EDownloadFailed;
+				iDLState.iResult = RFotaEngineSession::EResDLFailDueToNWIssues;
+				}
+			}
+		//Handling Out Of Memory interrupt
+		else if ((dlErrorId == EGeneral && sysErrorId == KErrDiskFull ) || sysErrorId == KErrCodInsufficientSpace)
+			{
+			FLOG(_L("Reason: Disk full"));
+			iRestartCounter = -1;
+			notifType = KErrNotFound;
+			notifParam = KErrNotFound; // don't show anything
+			iDLState.iResult = RFotaEngineSession::EResDLFailDueToDeviceOOM;
+			}
+		//Handle unclassified (general) interrupts
+		else
+			{
+			iRestartCounter = -1;
+
+			
+			RProperty prop;
+			TInt val = KErrNone;
+		
+			TInt err = prop.Get(KPSUidStartup, KPSGlobalSystemState, val);
+			if (err==KErrNone && val!=ESwStateShuttingDown)
+				{
+				notifType = ESyncMLFwUpdErrorNote;				
+				}
+			else
+				{
+				FLOG(_L("Phone is powering down..."));
+				}
+
+			if (iDownloadResumable)
+				{
+				notifParam = KErrGeneralResume;
+				iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+				}
+			else
+				{
+				notifParam = KErrGeneralNoResume;
+				iDLState.iState = RFotaEngineSession::EDownloadFailed;
+				}
+
+
+        SetDLResultdlErrorId(dlErrorId ,sysErrorId  );
+			
+
+			}
+		if ( iRestartCounter <= 0)
+			{
+			iUpdateAfterDownload = EFalse;
+			SetDownloadActive(EFalse);
+			if ( iDLState.iSessionType!= ESanSilent && notifType!=KErrNotFound )
+				{
+				if ( iShowDLPrgUI )
+					LaunchNotifierL( (TSyncMLFwUpdNoteTypes)notifType, notifParam,0 );
+				else
+					LaunchNotifierL( (TSyncMLFwUpdNoteTypes)notifType, notifParam,0, ETrue);
+				}
+			FLOG(_L("Should  come here for nonpausable "));	
+			iDownloadFinalized = ETrue;
+			iFotaServer->FinalizeDownloadL( iDLState );
+			}
+		else
+			{
+			if (iDownloadResumable)
+				{
+				FLOG(_L("Resuming download..."));
+				iDownload->Start();
+				}
+			else
+				{
+				FLOG(_L("Restarting download..."));
+				iFotaServer->FinalizeDownloadL( iDLState );
+				}
+			}
+		}
+		break;
+
+	case EHttpDlPausable:
+		{
+		FLOG(_L("Download State: EHttpDlPausable"));
+		if (iDownloadResumable) //This is initially set by IsDownloadSuspendResumeSupported()
+			{
+			FLOG(_L("Download Suspend/Resume is supported!"));       				
+			}
+		else
+			{
+			FLOG(_L("Download Server support Suspend/Resume, but Fota doesn't!"));
+			//retain the state iDownloadResumable = EOmaDLResumeNotSupported;
+			}
+		}
+		break;
+
+	case EHttpDlNonPausable:
+		{
+		FLOG(_L("Download State: EHttpDlNonPausable"));
+		if (iDownloadResumable) //This is initially set by CheckDownloadVariations()
+			{
+			FLOG(_L("Download Server doesn't support Suspend/Resume, but Fota does!"));
+			//Reset the state to not supported.
+			iDownloadResumable = EFalse;
+			}
+		else
+			{
+			FLOG(_L("Download Server doesn't support Suspend/Resume, neither does Fota!"));
+			}
+		}
+		break;
+	case EHttpDlDeleting:	//13
+		{
+		FLOG(_L("Download State: EHttpDlDeleting"));
+		}
+		break;
+	case EHttpDlDeleted:	//11
+		{
+		FLOG(_L("Download State: EHttpDlDeleted"));
+		}
+		break;
+	default:
+		{
+		FLOG(_L("Default. No action performed for this Download State"));
+		}
+		break;
+	}
+	FLOG(_L("CFotaDownload::HandleDMgrEventL()  <<"));
+	}
+
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::SetDLResultdlErrorId
+// Sets the appropriate error
+// --------------------------------------------------------------------------
+//
+
+void CFotaDownload::SetDLResultdlErrorId( THttpDownloadMgrError adlErrorId, TInt32 asysErrorId)
+{
+      if ( adlErrorId == EInternal)
+				{
+				FLOG(_L("Reason:   error EInternal"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EContentFileIntegrity)
+				{
+				FLOG(_L("Reason:   error EContentFileIntegrity"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EMMCRemoved)
+				{
+				FLOG(_L("Reason:   error EMMCRemoved,"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EBadUrl) 
+				{
+				FLOG(_L("Reason:   error EBadUrl"));
+				iDLState.iResult = RFotaEngineSession::EResMalformedOrBadURL;
+				}
+			else if ( adlErrorId == EHttpUnhandled)
+				{
+				FLOG(_L("Reason:   error EHttpUnhandled, check global error id!"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EHttpAuthenticationFailed)
+				{
+				FLOG(_L("Reason:   error EHttpAuthenticationFailed"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EObjectNotFound)
+				{
+				FLOG(_L("Reason:   error EObjectNotFound"));
+				iDLState.iResult = RFotaEngineSession::EResAlternateDLServerUnavailable;
+				}
+			else if ( adlErrorId == EPartialContentModified)
+				{
+				FLOG(_L("Reason:   error EPartialContentModified"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EContentExpired)
+				{
+				FLOG(_L("Reason:   error EContentExpired"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( adlErrorId == EHttpRestartFailed)
+				{
+				FLOG(_L("Reason:   error EHttpRestartFailed"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+			else if ( asysErrorId == KErrCodInvalidDescriptor )
+				{
+				FLOG(_L("Reason:   error KErrCodInvalidDescriptor"));
+				iDLState.iResult  = RFotaEngineSession::EResMalformedOrBadURL;
+				}
+			else
+				{
+				FLOG(_L("Reason: unknown, check dlError!"));
+				iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+				}
+
+}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::HandleDMgrEventL
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::HandleDMgrEventL( RHttpDownload& aDownload
+		, THttpDownloadEvent aEvent )
+	{   
+	DoHandleDMgrEventL(&aDownload,aEvent);
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::LaunchNotifierL
+// Launches notifier. This method is also used to finalize erronous DL
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype
+		,const TInt aIntParam
+		,const TInt aMemoryNeeded
+		,TBool aFinishOnly )
+	{
+	if ( iNotifHandler ) iNotifHandler->Cancel();
+	else				 iNotifHandler = CFotaDownloadNotifHandler::NewL(this);
+	iNotifHandler->LaunchNotifierL( aNotetype,aIntParam,aMemoryNeeded
+			,aFinishOnly );
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::CheckDownloadVariations
+// Reads download variations - fota suspend & resume bahavior & FMS from cenrep keys
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::CheckDownloadVariations()
+	{
+	FLOG(_L("CFotaDownload::CheckDownloadVariations >>"));
+
+	CRepository* centrep( NULL);
+	TRAPD(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+	if (err) FLOG(_L("Error reading FotaServer cenrep... %d"),err);
+	TInt supported(KErrNone);
+	if (centrep ) 
+		{
+		err = centrep->Get( KSuspendResumeFeatureSupported, supported );
+		if (err) FLOG(_L("Error reading cenrep key... %d"),err);
+		iDownloadResumable = (supported==1)? ETrue:EFalse;
+
+		supported = KErrNone;
+		centrep->Get( KFotaMonitoryServiceEnabled, supported );
+		if (err) FLOG(_L("Error reading cenrep key... %d"),err);
+		iFMSEnabled = (supported > 0)? ETrue:EFalse;
+
+		delete centrep;
+		centrep = NULL;
+		}
+
+	FLOG(_L("Susp&Resume feature supported = %d, FMS feature supported = %d"),iDownloadResumable,iFMSEnabled);
+	FLOG(_L("CFotaDownload::CheckDownloadVariations <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::RunDownloadCancelL
+// Starts to cancel the download operation
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::RunDownloadCancelL(const TInt aReason, TBool aSilent)
+	{
+	FLOG(_L("CFotaDownload::RunDownloadCancelL, reason = %d, silent = %d >>"), aReason, aSilent);
+
+	iDLState.iState     = RFotaEngineSession::EDownloadFailed;
+	iDLState.iResult    = aReason;
+	iSilentOpn = aSilent;
+	
+	iRestartCounter = -1;
+	iUpdateAfterDownload = EFalse;
+	
+	if (!iDownload)
+		{
+		//iDownload is null when user cancels the download permanently when prompted to resume.
+		//hence retrieve the download object first 
+		iDownload = RetrieveDownloadL();
+		}
+	TInt err = iDownload->Delete(); //or Cancel or Reset?
+	FLOG(_L("Error = %d"),err);
+	
+	if(iDownloadFinalized == EFalse)
+	{
+	iFotaServer->FinalizeDownloadL( iDLState );
+	FLOG(_L("Should not come here fro nopausable "));
+	if (aReason == RFotaEngineSession::EResUserCancelled)
+		LaunchNotifierL(ESyncMLFwUpdOmaDLCancelled, EFalse, EFalse);
+	else if (aReason == RFotaEngineSession::EResUndefinedError)
+		LaunchNotifierL(ESyncMLFwUpdErrorNote, KErrGeneralNoResume, EFalse );
+  }
+	FLOG(_L("CFotaDownload::RunDownloadCancelL <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::RunDownloadSuspendL
+// Starts to suspend the download operation
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::RunDownloadSuspendL(const TInt aReason, TBool aSilent)
+	{
+	FLOG(_L("CFotaDownload::RunDownloadSuspendL, reason = %d, silent = %d >>"), aReason, aSilent);
+
+	iDLState.iState     = RFotaEngineSession::EDownloadProgressingWithResume;
+	iDLState.iResult    = aReason;
+	iSilentOpn = aSilent;
+	//First pause download, and later ask for user action.
+	TInt err = iDownload->Pause();
+
+	if (err)
+	{
+	//initial pausing becomes a problem.
+	FLOG(_L("Error while initial pausing...%d Hence download has to be cancelled permanently!"),err);
+	RunDownloadCancelL(aReason);
+	}
+
+	FLOG(_L("CFotaDownload::RunDownloadSuspendL <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::TryResumeDownloadL
+// Tries to resume the download operation
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::TryResumeDownloadL(TBool aUserInitiated)
+	{
+	FLOG(_L("CFotaDownload::TryResumeDownloadL >>"));
+
+	iUserInitiatedResume = aUserInitiated;
+	TInt err = RProperty::Define( TUid::Uid(KOmaDMAppUid),
+			KFotaDMRefresh,
+			RProperty::EInt,KReadPolicy,KWritePolicy);
+	FLOG(_L("RProperty KFotaDMRefresh Define, err = %d"), err);        
+	if (err != KErrAlreadyExists )
+		{
+		User::LeaveIfError(err);
+		}
+	//This P&S Key is used to notify DM UI on any download event. key=0 for idle and key=1 for download
+	err = RProperty::Set( TUid::Uid(KOmaDMAppUid),
+			KFotaDMRefresh,
+			ETrue );
+	FLOG(_L("RProperty KFotaDMRefresh Set ETrue, err = %d"), err);    
+
+	//Called to read the download variations in Fota (resume support & FMS)
+	CheckDownloadVariations();	
+	if (IsFMSEnabled() && iUserInitiatedResume)
+		iFotaServer->CancelFmsL();
+
+	//Query based on the type of DM session used earlier.
+	if (iUserInitiatedResume || iDLState.iSessionType != ESanSilent)
+		{
+		//Query user for resume
+		FLOG(_L("Quering user for resume..."));
+		if (iFotaServer->iNotifHandler)
+			{
+			iFotaServer->iNotifHandler->Cancel();
+			delete iFotaServer->iNotifHandler;
+			iFotaServer->iNotifHandler = NULL;
+			}
+		iNotifHandler = CFotaDownloadNotifHandler::NewL(this);
+
+		iNotifHandler->LaunchNotifierL(ESyncMLFwUpdOmaDLResume, EFalse, EFalse);
+		}
+	else //Only FMS initiated Silent Session download
+		{
+		//Resume directly
+		FLOG(_L("Resuming automatically..."));
+		ResumeDownloadL();
+		}
+	FLOG(_L("CFotaDownload::TryResumeDownloadL <<"));
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::ResumeDownloadL
+// Resume the download operation
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::ResumeDownloadL()
+	{
+	FLOG(_L("CFotaDownload::ResumeDownloadL >>"));
+	TBool toresetdl (EFalse);
+	TBool downloadiapvalid (ETrue);
+	//Find the download ui behavior from fota cenrep
+	TInt behavior(KErrNotFound);
+	CRepository* centrep = NULL;
+	TRAPD(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+	if (( centrep ) && ( err == KErrNone))
+	    {
+	    centrep->Get( KSilentOmaDlUIBehavior, behavior );
+	    delete centrep;
+	    }
+	centrep = NULL;
+
+	if (iUserInitiatedResume || 
+	        (behavior == EOmacdOffdlprgOn || behavior == EOmacdOndlprgOn))
+		{
+		FLOG(_L("Showing Connecting progress note..."));
+		iFotaServer->iParentApp->SetUIVisibleL ( ETrue , EFalse );
+		
+		if ( !iDLProgressDlg )
+			{
+			iDLProgressDlg = new(ELeave) CFotaDLProgressDlg((CEikDialog** ) &iDLProgressDlg , EFalse, this, EConnectingNote );
+			iDLProgressDlg->PrepareLC( R_CONNECTION_NOTE );
+			}
+		// Load the resource files
+	    TInt err = KErrNone;
+	       
+	    // Localize the file name, and load the SCP resources
+	    TFileName resFile;
+	    resFile.Copy( KDriveZ );
+	    resFile.Append( KSCPResourceFilename );
+    	    
+	    BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile );    
+
+	    TInt Res1(KErrNone);
+	    TRAP( err, Res1 =CCoeEnv::Static()->AddResourceFileL( resFile ) );        
+
+	    HBufC* buf = StringLoader::LoadLC(R_SYNCSTATUS_SYNC_CONN);
+	
+	    if( Res1 )
+	    	{
+	        iFotaServer->GetEikEnv()->DeleteResourceFile( Res1 );
+	    	}
+	    FLOG(_L("Reading txt as: %S"), &buf->Des());
+		iDLProgressDlg->SetTextL(buf->Des());
+		CleanupStack::PopAndDestroy(buf);
+	
+		iDLProgressDlg->RunLD();
+		}
+	FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 1"));
+	
+	iDownload = RetrieveDownloadL();
+	if (iDownload)
+		{
+		FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 2: Successfully retrieved download object >>"));
+
+		SetIapToUseL(iDLState, iDLState.iIapId);
+
+		FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 3: Using iapid %d for resume..."), iDLState.iIapId);
+		downloadiapvalid = iFotaServer->CheckIapExistsL(iDLState.iIapId);
+		if (iDLState.iIapId > 0 && downloadiapvalid)
+			{
+			if (!iMonitor)
+				{
+				iMonitor = CFotaNetworkRegStatus::NewL (iFotaServer);
+				}
+			TBool val = iMonitor->IsConnectionPossibleL(iDLState.iIapId);
+			FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 4"));
+			delete iMonitor; iMonitor = NULL;
+			
+#if defined(__WINS__)
+			val =ETrue;
+#endif
+			if (!val)
+				{
+				FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 5.1: Disallowing resume operation as connection not possible"));
+				
+				if ( !iShowDLPrgUI && iDLProgressDlg )
+					{
+					FLOG(_L("Removing Connecting progress note..."));
+
+					iDLProgressDlg->ProcessFinishedL();
+					delete iDLProgressDlg;
+					iDLProgressDlg = NULL;
+					}
+				if (iUserInitiatedResume || iDLState.iSessionType!=ESanSilent)
+					LaunchNotifierL(ESyncMLFwUpdErrorNote, KErrCommsLineFail2,0);
+				iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+				iDLState.iResult = RFotaEngineSession::EResDLFailDueToNWIssues;
+				iUpdateAfterDownload = EFalse;
+				iFotaServer->FinalizeDownloadL(iDLState);
+				return;
+				}
+			}
+
+		if (iDLState.iIapId == KErrNotFound || !downloadiapvalid )
+		    {
+		    iDLState.iIapId = KErrNotFound;
+			User::LeaveIfError( iDownloadMgr.SetIntAttribute( EDlMgrIap, 0)); // Download mgr interprets 0 for Always Ask
+		    }
+		else
+			User::LeaveIfError( iDownloadMgr.SetIntAttribute( EDlMgrIap, iDLState.iIapId)); // IAP id
+
+		FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 5.2"));
+		SetDownloadUiBehavior(EFalse);		
+
+		if ( !iShowDLPrgUI && iDLProgressDlg )
+			{
+			FLOG(_L("Removing Connecting progress note..."));
+
+			iDLProgressDlg->ProcessFinishedL();
+			delete iDLProgressDlg;
+			iDLProgressDlg = NULL;
+			}
+		TInt dlsize, tlsize;
+		FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 6"));
+		iFotaServer->GetDownloadUpdatePackageSizeL(iDLState.iPkgId, dlsize,tlsize);
+		iDownloadedContentSize = dlsize; //for progress bar update only
+		iUpdateAfterDownload = iDLState.iUpdateLtr; //should update after reboot?
+		iRestartCounter = 0;
+		
+		//Set right states in fota db
+		iDLState.iState = RFotaEngineSession::EDownloadProgressingWithResume;
+		iDLState.iResult = KErrNotFound;
+		
+		iFotaServer->iDatabase->OpenDBL();
+		iFotaServer->iDatabase->SetStateL( iDLState, KNullDesC8, EFDBState|EFDBResult);
+		iFotaServer->iDatabase->CloseAndCommitDB();
+		iFreshDL = EFalse;
+		FLOG(_L("CFotaDownload::ResumeDownloadL, Stage 6: Starting to resume download now..."));
+		TInt err = iDownload->Start();
+		if (err == KErrNone)
+			{
+			//Set the P&S Key to active...
+			FLOG(_L("Resume operation is success!"));
+			SetDownloadActive(ETrue);
+			}
+		else
+			{
+			FLOG(_L("An error occured during resume, err = %d"),err);
+			toresetdl = ETrue;
+			}
+		}
+	else
+		{
+		FLOG(_L("Failed to get the paused download object"));
+		if ( iDLProgressDlg )
+			{
+			FLOG(_L("Removing Connecting progress note..."));
+			iDLProgressDlg->ProcessFinishedL(); // deletes itself
+			delete iDLProgressDlg;
+			iDLProgressDlg = NULL;
+			}
+		toresetdl = ETrue;
+		}
+      ReSetDownloadL(	toresetdl);
+	
+	FLOG(_L("CFotaDownload::ResumeDownloadL <<"));
+	}
+// --------------------------------------------------------------------------
+// CFotaDownload::ReSetDownloadL
+// Sets the download state to failed
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::ReSetDownloadL(TBool atoresetdl)
+{
+if (atoresetdl)
+		{
+		FLOG(_L("Resetting fota download !!!"));
+		if (iUserInitiatedResume || iDLState.iSessionType!=ESanSilent)
+			LaunchNotifierL(ESyncMLFwUpdErrorNote, KErrGeneralNoResume,0);
+		iDLState.iState = RFotaEngineSession::EDownloadFailed;
+		iDLState.iResult = RFotaEngineSession::EResUndefinedError;
+		iUpdateAfterDownload = EFalse;
+		iFotaServer->FinalizeDownloadL(iDLState);
+		}
+}
+
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::IsFMSEnabled
+// Returns FMS enabled state
+// --------------------------------------------------------------------------
+//
+TBool CFotaDownload::IsFMSEnabled()
+	{
+	FLOG(_L("CFotaDownload::IsFMSEnabled, iFMSEnabled = %d <<"), iFMSEnabled);
+	return iFMSEnabled;
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::IsDownloadResumable
+// Returns whether the download is resumable or not.
+// --------------------------------------------------------------------------
+//
+TBool CFotaDownload::IsDownloadResumable()
+	{
+	FLOG(_L("CFotaDownload::IsDownloadResumable, iDownloadResumable = %d <<"), iDownloadResumable);
+	return iDownloadResumable;
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::SetIapToUseL
+// Sets the IAP ID to use. This menthod is used in fresh and resume download.
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::SetIapToUseL(TPackageState aParams, const TInt aIapid)
+	{
+	FLOG(_L("CFotaDownload::SetIapToUseL >>"));
+
+	RSyncMLSession sml;
+	TInt profIapid( KErrNotFound );
+	TInt sockIapid( KErrNotFound );
+	TSmlServerAlertedAction saa(ESmlConfirmSync);
+
+	CleanupClosePushL( sml );
+	sml.OpenL();
+	iFotaServer->GetProfileDataL(&sml,aParams.iProfileId, profIapid, saa
+			,iIsjobStartedFromUI, iSanValue );
+	CleanupStack::PopAndDestroy( &sml );
+
+	// 2/3 GET IAP FROM ESOCK ----------------------------------------------
+	// resolve which accespoint is used for current DM session
+	if ( (profIapid == KErrNotFound || profIapid == KErrGeneral)  
+			&& aIapid==KErrNotFound)
+		{
+		RSocketServ serv;
+		CleanupClosePushL( serv );
+		User::LeaveIfError( serv.Connect() );
+
+		RConnection conn;
+		CleanupClosePushL( conn );
+		User::LeaveIfError( conn.Open( serv ) );
+
+		TUint count( 0 );
+		User::LeaveIfError( conn.EnumerateConnections ( count ) );
+		// enumerate connections
+		for( TUint idx=1; idx<=count; ++idx )
+			{
+			TConnectionInfo connectionInfo;
+			TConnectionInfoBuf connInfo( connectionInfo );
+
+			TInt err = conn.GetConnectionInfo( idx, connInfo ); // iapid
+			if( err != KErrNone )
+				{
+				CleanupStack::PopAndDestroy( 2 ); // conn, serv
+				User::Leave( err );
+				}
+			// enumerate connectionclients
+			TConnectionEnumArg	conArg;
+			conArg.iIndex = idx;
+			TConnEnumArgBuf conArgBuf(conArg);
+			err=conn.Control(KCOLConnection,KCoEnumerateConnectionClients
+					,conArgBuf);
+			if( err != KErrNone )
+				{
+				CleanupStack::PopAndDestroy( 2 ); // conn, serv
+				User::Leave( err );
+				}
+			TInt cliCount = conArgBuf().iCount;
+			for ( TUint j=1; j<=cliCount ;++j )
+				{
+				TConnectionGetClientInfoArg conCliInfo;
+				conCliInfo.iIndex = j;
+				TConnGetClientInfoArgBuf conCliInfoBuf(conCliInfo);
+				err=conn.Control(KCOLConnection, KCoGetConnectionClientInfo
+						, conCliInfoBuf);
+
+				if( err != KErrNone )
+					{
+					CleanupStack::PopAndDestroy( 2 ); // conn, serv
+					User::Leave( err );
+					}				
+				TConnectionClientInfo conCliInf = conCliInfoBuf().iClientInfo;
+				TUid uid = conCliInf.iUid;
+				if ( uid == TUid::Uid(KSosServerUid) )
+					{
+					sockIapid = connInfo().iIapId;
+					FLOG(_L("[FotaServer]  IAP found %x"),sockIapid);
+					}
+
+				FLOG(_L("[FotaServer]  CFotaDownload::DownloadL uid %x")
+						,uid.iUid);
+				}
+			}
+		CleanupStack::PopAndDestroy( 2 ); // conn, serv		
+		}
+	TInt newIapid( KErrNotFound );
+	if ( sockIapid!=KErrNotFound  ) newIapid = sockIapid;
+	if ( profIapid!=KErrNotFound && profIapid != KErrGeneral ) newIapid = profIapid;
+	if ( aIapid   !=KErrNotFound ) newIapid = aIapid;
+
+	//Do some intelligent work during resume
+	/* Some rules..
+	 * 1. If IAP is always ask in DM profile, use the earlier set during FMS trigger
+	 * 2. If IAP is always ask in DM profile, query user for IAP during user trigger
+	 * 3. If IAP has changed in DM profile after suspend, use the newer one during resume
+	 * 4. 
+	 */
+	TInt active (KErrNotFound);
+	RProperty::Get(TUid::Uid(KFotaServerUid), KFotaDownloadActive, active );
+	FLOG(_L("active = %d"),active);
+	if (active==EFalse && iDLState.iState == RFotaEngineSession::EDownloadProgressingWithResume)
+		{
+		//Actual resume only
+		if (!iUserInitiatedResume && (profIapid == KErrNotFound || profIapid == KErrGeneral  ) )
+			{
+			//FMS triggered resume, apply Rule 1
+			newIapid = iDLState.iIapId;
+			}
+		else if (profIapid == KErrNotFound || profIapid == KErrGeneral )
+			{
+			//User triggered resume, apply Rule 2
+			newIapid = KErrNotFound;
+			}
+		else if (profIapid != iDLState.iIapId && profIapid > KErrNone)
+			{
+			//IAP has changed in DM profile, apply Rule 3
+			newIapid = profIapid;
+			}
+		}
+	iDLState.iIapId = newIapid;
+
+
+	FLOG(_L("CFotaDownload::SetIapToUseL, iap = %d <<"), iDLState.iIapId);
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::SetDownloadUiBehavior
+// Sets Download UI behavior. ex: DD display and Progress note
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::SetDownloadUiBehavior(TBool aFreshDL)
+	{
+	FLOG(_L("CFotaDownload::SetDownloadUiBehavior, aFreshDL = %d >>"),aFreshDL);
+
+	if (aFreshDL) //Fresh download
+		{
+		iDLState.iSessionType = iSanValue;
+		}
+	else //resuming download
+		{
+		iSanValue = iDLState.iSessionType;
+		}
+
+	if ( !iIsjobStartedFromUI &&  iRestartCounter==0 ) //iRestartCounter to ensure that the UI behavior is read only once.
+		{
+		TInt behavior(KErrNotFound);
+		TInt sansupported(KErrNone);
+
+		//Find whether SAN is supported or not
+	    CRepository* centrep = NULL;
+
+	    TRAPD( err, centrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys) );    
+	    if( centrep ) centrep->Get( KDevManSANUIBitVariation, sansupported );
+	    delete centrep; centrep = NULL;
+	    FLOG(_L("...1..."));
+	    if (sansupported != 1) sansupported = 0;
+	    
+		//Find the download ui behavior from fota cenrep
+		TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+		if ( centrep ) 	centrep->Get( KSilentOmaDlUIBehavior, behavior );
+		delete centrep; centrep = NULL;
+
+		FLOG(_L("Values are... SAN enabled: %d, session type: %d, downloadbehavior: %d"),sansupported, iDLState.iSessionType,behavior);
+
+		if (sansupported) //SAN is supported
+			{
+				
+			DetermineUISANON(behavior)	;
+			
+			}
+		else //SAN not supported
+			{
+				DetermineUISANOFF(behavior);
+		
+			}
+		}
+	else// if (iRestartCounter==0) //Started from DM UI, but not retry
+		{
+		iShowOMACDUI = ETrue;
+		iShowDLPrgUI = ETrue;
+		if (aFreshDL)
+			iDLState.iSessionType = KErrNotFound;
+		}
+
+TInt value (EFotaUpdateDM);
+TInt err = RProperty::Get( KPSUidNSmlDMSyncApp, KNSmlCurrentFotaUpdateAppName, value );
+if (!err && ((value == EFotaUpdateNSC) || (value == EFotaUpdateNSCBg)))
+{
+			iShowOMACDUI = EFalse;		
+			iShowDLPrgUI = ETrue;
+			FLOG(_L("CFotaDownload::DownloadL UI will not be shown!"));
+}
+	FLOG(_L("UI Behavior: OMA DD Display = %d, Download Progress = %d"),iShowOMACDUI,iShowDLPrgUI);
+
+	FLOG(_L("CFotaDownload::SetDownloadUiBehavior <<"));
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::DetermineUISANON
+// Determine UI when SAN is ON
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::DetermineUISANON(TInt aBehavior)
+{
+				switch (aBehavior)
+					{
+					case EOmacdOffdlprgOff: //0
+						{
+						iShowOMACDUI = EFalse;
+						iShowDLPrgUI = EFalse;
+						}
+						break;
+					case EOmacdOffdlprgOn: //1
+						{
+						iShowOMACDUI = EFalse;
+						iShowDLPrgUI = ETrue;
+						}
+						break;
+					case EOmacdOndlprgOff: //2
+						{
+						iShowOMACDUI = ETrue;
+						iShowDLPrgUI = EFalse;
+						}
+						break;
+					case EOmacdOndlprgOn: //3
+						{
+						iShowOMACDUI = ETrue;
+						iShowDLPrgUI = ETrue;
+						}
+						break;
+					default: //includes EChooseFromSan
+						{
+						if(iSanValue == ESanSilent)
+							{
+							iShowOMACDUI = EFalse;
+							iShowDLPrgUI = EFalse;
+							}
+						else if (iSanValue == ESanInformative)
+							{
+							iShowOMACDUI = EFalse;
+							iShowDLPrgUI = ETrue;
+							}
+						else //includes ESanInteractive, ESanNotSpecified
+							{
+							iShowOMACDUI = ETrue;
+							iShowDLPrgUI = ETrue;
+							}
+						}
+						break;
+					}
+	
+	
+}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::DetermineUISANOFF
+// Determine UI when SAN is OFF
+// --------------------------------------------------------------------------
+//
+
+void CFotaDownload::DetermineUISANOFF(TInt aBehavior)
+{
+			if (iSanValue==EAcceptedYes) //Accepted is Yes in Profile
+				{
+				switch (aBehavior)
+					{
+					case EOmacdOffdlprgOff: //0
+						{
+						iShowOMACDUI = EFalse;
+						iShowDLPrgUI = EFalse;
+						}
+						break;
+					case EOmacdOffdlprgOn: //1
+						{
+						iShowOMACDUI = EFalse;
+						iShowDLPrgUI = ETrue;
+						}
+						break;
+					case EOmacdOndlprgOff: //2
+						{
+						iShowOMACDUI = ETrue;
+						iShowDLPrgUI = EFalse;
+						}
+						break;
+					default: //includes EOmacdOndlprgOn
+						{
+						iShowOMACDUI = ETrue;
+						iShowDLPrgUI = ETrue;
+						}
+						break;
+					}
+				}
+			else // includes iSanValue = EAcceptedNo (Accepted is No in profile)
+				{
+				iShowOMACDUI = ETrue;
+				iShowDLPrgUI = ETrue;
+				}
+}
+
+
+
+
+
+
+
+// --------------------------------------------------------------------------
+// CFotaDownload::RetrieveDownloadL
+// Retrieves the RHttpDownload object from download manager during resume
+// --------------------------------------------------------------------------
+//
+RHttpDownload* CFotaDownload::RetrieveDownloadL()
+	{
+	FLOG(_L("CFotaDownload::RetrieveDownloadL >>"));
+	//Retrieve RHttpDownload object for the suspended download from Download Mgr.
+	if (!iDownloadMgr.Handle())
+		iDownloadMgr.ConnectL( TUid::Uid(KFotaServerUid) , *this, EFalse);
+	const CDownloadArray& downloads = iDownloadMgr.CurrentDownloads();
+	
+	TBuf8<KMaxPath> url8;
+	TInt32 val (KErrNone);
+	
+	RHttpDownload* aDownload (NULL);
+	for (TInt i = 0; i < downloads.Count(); i++ )
+		{
+		User::LeaveIfError( downloads[i]->GetStringAttribute( EDlAttrCurrentUrl, url8 ));
+		User::LeaveIfError( downloads[i]->GetIntAttribute( EDlAttrFotaPckgId, val));
+	
+		FLOG(_L("Current download(s) as per download mgr: %d, url = %S, pkgid = %d"), i+1, &url8, val);
+	
+		if (iDLState.iPkgId ==  val)
+			{
+			FLOG(_L("Successfully found the paused download object"));
+			aDownload = downloads[i];
+			if ( iUrl ) {delete iUrl; iUrl=NULL;}
+			iUrl = url8.Alloc();
+	
+			}
+		}
+	FLOG(_L("CFotaDownload::RetrieveDownloadL <<"));
+	return aDownload;
+	}
+
+// --------------------------------------------------------------------------
+// CFotaDownload::SetDownloadActive
+// Sets the download activity state P&S key
+// --------------------------------------------------------------------------
+//
+void CFotaDownload::SetDownloadActive(TBool aValue)
+	{
+	FLOG(_L("CFotaDownload::SetDownloadActive, aValue = %d"),aValue);
+	iDownloadActive = aValue;
+	TBool val (EFalse);
+	TInt err = RProperty::Get(TUid::Uid(KFotaServerUid), KFotaDownloadActive, val );
+
+	if (err == KErrNone && val != aValue)
+		{
+		err = RProperty::Set(TUid::Uid(KFotaServerUid), KFotaDownloadActive, aValue );
+		FLOG(_L("RProperty KFotaDownloadActive Set %d, err = %d"), aValue, err);
+		}
+	
+	FLOG(_L("CFotaDownload::SetDownloadActive <<"));
+	}
+
+// --------------------------------------------------------------------------
+// IsDownloadActive
+// Returns the activeness of the download
+// --------------------------------------------------------------------------
+//
+
+TBool CFotaDownload::IsDownloadActive()
+	{
+	FLOG(_L("CFotaDownload::IsDownloadActive, value = %d"),iDownloadActive);
+	return iDownloadActive;
+	}
+
+
+// --------------------------------------------------------------------------
+// CFotaDownloadNotifHandler::NewL 
+// --------------------------------------------------------------------------
+//
+CFotaDownloadNotifHandler* CFotaDownloadNotifHandler::NewL (CFotaDownload* aDownload)
+	{
+	FLOG(_L("CFotaDownloadNotifHandler::NewL"));
+	__ASSERT_ALWAYS( aDownload, User::Panic(KFotaPanic, KErrArgument) );	
+	CFotaDownloadNotifHandler* h=new (ELeave)CFotaDownloadNotifHandler;
+	h->iDownload = aDownload;
+	h->iDownload->iFotaServer->iNotifHandler = h;
+	return h;
+	}
+
+// --------------------------------------------------------------------------
+CFotaDownloadNotifHandler::CFotaDownloadNotifHandler() : CActive(EPriorityNormal)
+	{
+	FLOG(_L("CFotaDownloadNotifHandler::CFotaDownloadNotifHandler()"));
+	CActiveScheduler::Add( this ); 
+	}
+
+// --------------------------------------------------------------------------
+CFotaDownloadNotifHandler::~CFotaDownloadNotifHandler()
+	{
+	FLOG(_L("CFotaDownloadNotifHandler::~CFotaDownloadNotifHandler >>"));
+	iNotifier.Close();
+	Cancel();
+	FLOG(_L("CFotaDownloadNotifHandler::~CFotaDownloadNotifHandler <<"));
+	}
+
+// --------------------------------------------------------------------------
+void CFotaDownloadNotifHandler::RunL()
+	{
+	FLOG(_L("CFotaDownloadNotifHandler::RunL() note:%d, param:%d" ),iNotifParams.iNoteType, iNotifParams.iIntParam);
+
+	TBool reset (ETrue);
+
+	iNotifier.Close();
+
+	iDownload->SetDownloadActive(EFalse);
+	if ( iNotifParams.iNoteType == ESyncMLFwUpdErrorNote  ) // 1 
+		{
+		//do nothing here
+		}
+	if ( iNotifParams.iNoteType == ESyncMLFwUpdOmaDLNotEnoughMemory ) // 7
+		{
+		//To be active as Flexible mem is in action.
+		if (iDownload->iFreshDL)
+			iDownload->SetDownloadActive(ETrue);
+		}
+	if ( iNotifParams.iNoteType == ESyncMLFwUpdOmaDLUserCancel )
+		{
+		//At this point Download Mgr has already paused the download successfully.
+		if (iStatus.Int() == KErrCancel) //RSK Press
+			{
+			//User wants to cancel download permanently.
+			FLOG(_L("User choose to cancel download permanently!"));
+			iDownload->RunDownloadCancelL(RFotaEngineSession::EResUserCancelled);
+			}
+		else
+			{
+			//Other keys pressed, like LSK or Call termination key
+			FLOG(_L("User choose to resume download later, key press = %d"),iStatus.Int());
+			iDownload->iFotaServer->FinalizeDownloadL( iDownload->iDLState );
+			if (iStatus.Int() == KErrNone) //RSK is pressed
+				{
+				LaunchNotifierL(ESyncMLFwUpdOmaDLPostponed, EFalse, EFalse);
+				reset = EFalse;
+				}
+			else
+				iDownload->iFotaServer->ShutApp();
+			}
+		}
+
+	if ( iNotifParams.iNoteType == ESyncMLFwUpdOmaDLPostponed )
+		{
+		//Nothing to do
+		}
+
+	if ( iNotifParams.iNoteType == ESyncMLFwUpdOmaDLCancelled )
+		{
+		//Nothing to do
+		}
+
+	if ( iNotifParams.iNoteType == ESyncMLFwUpdOmaDLResume )
+		{
+		if (iStatus.Int() == KErrNone) // LSK Press
+			{
+			FLOG(_L("User choose to continue download now."));
+			iNotifParams.iNoteType = ESyncMLFwUpdUnknown;
+			iNotifParams.iIntParam = 0;
+			iDownload->ResumeDownloadL();
+			reset = EFalse;
+			}
+		else	//RSK or any other key
+			{
+			FLOG(_L("User cancelled to continue download now, key press = %d."),iStatus.Int());
+			if (iStatus.Int() == KErrCancel) //RSK is pressed
+				{
+				iDownload->iDLState.iResult = RFotaEngineSession::EResUserCancelled;
+				LaunchNotifierL(ESyncMLFwUpdOmaDLUserCancel, EFalse, EFalse);
+				reset = EFalse;
+				}
+			else
+				iDownload->iFotaServer->ShutApp();
+			}
+		}
+
+	if (reset)
+		{
+		iNotifParams.iNoteType = ESyncMLFwUpdUnknown;
+		iNotifParams.iIntParam = 0;
+		}
+	}
+
+// --------------------------------------------------------------------------
+TInt CFotaDownloadNotifHandler::RunError(TInt aError)
+	{	
+	FLOG(_L("CFotaDownloadNotifHandler::RunError %d"),aError);
+	return aError;
+	}
+
+// --------------------------------------------------------------------------
+void CFotaDownloadNotifHandler::DoCancel()
+	{
+	FLOG(_L("CFotaDownloadNotifHandler::DoCancel >>"));
+	if (iNotifier.Handle())
+		{
+		iNotifier.CancelNotifier( KSyncMLFwUpdNotifierUid );
+		iNotifier.Close();
+		}
+		FLOG(_L("CFotaDownloadNotifHandler::DoCancel <<"));
+	}
+
+// --------------------------------------------------------------------------
+void CFotaDownloadNotifHandler::LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype
+		,const TInt aIntParam
+		, const TInt aMemoryNeeded
+		,TBool aFinishOnly)
+	{
+	FLOG(_L("CFotaDownloadNotifHandler::LaunchNotifierL, aNoteType=%d, aParam=%d, aMemoryNeeded=%d aFinishOnly=%d >>  "), aNotetype, aIntParam, aMemoryNeeded, aFinishOnly?1:0);
+	
+	__ASSERT_ALWAYS( iNotifier.Handle()==0, User::Leave(KErrAlreadyExists) );
+	__ASSERT_ALWAYS( aMemoryNeeded>=0, User::Leave(KErrArgument) );
+
+
+	// Launch notifier
+	TSyncMLFwUpdNotifParams         params;
+	FLOG(_L("           1"));
+	params.iNoteType        = aNotetype;
+	params.iIntParam        = aIntParam;
+
+	TInt rem = 0;
+	rem = aMemoryNeeded % 1024 ;
+	if (rem)
+		{
+		params.iMemoryNeeded = (aMemoryNeeded /1024) + 1;   	
+		}
+	else
+		{  
+		params.iMemoryNeeded = (aMemoryNeeded /1024) ;
+		}
+
+	//    #endif    
+	TSyncMLFwUpdNotifParamsPckg     pckg(params);
+	iNotifParams.iNoteType  = params.iNoteType;
+	iNotifParams.iIntParam  = params.iIntParam;
+
+	iNotifParams.iMemoryNeeded = params.iMemoryNeeded;
+
+	iDummyResponsePckg = TSyncMLFwUpdNotifRetValPckg();
+	FLOG(_L("           2"));
+	if ( !aFinishOnly )
+		{
+		User::LeaveIfError( iNotifier.Connect() );
+		iNotifier.StartNotifierAndGetResponse( iStatus, KSyncMLFwUpdNotifierUid
+				, pckg, iDummyResponsePckg );
+		SetActive();
+		}
+	else
+		{
+		iStatus = KRequestPending;
+		SetActive();
+		TRequestStatus* status = &iStatus;
+		User::RequestComplete( status, KErrNone );
+		}
+	FLOG(_L("           3  %d"),iStatus.Int());
+	FLOG(_L("CFotaDownloadNotifHandler::LaunchNotifierL() <<"));	
+	}
+
+TBool CFotaDownloadNotifHandler::IsOpen()
+	{
+	FLOG(_L("Handle = %d"), iNotifier.Handle());
+	return (iNotifier.Handle())? ETrue:EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaServer/src/fotaupdate.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1993 @@
+/*
+ * Copyright (c) 2005-2006 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:   starts update sequence
+ *
+ */
+
+
+
+// INCLUDE FILES
+#include <StringLoader.h>
+#include <fotaserver.rsg>
+#include <centralrepository.h>
+#include <AknUtils.h>
+#include <AknBidiTextUtils.h> 
+#include <biditext.h>
+#include <gdi.h>
+#include <fotaengine.h>
+#include <apgtask.h>
+#include <SyncMLNotifierParams.h>
+#include <aknradiobuttonsettingpage.h> 
+#include <akntitle.h>
+#include <schtime.h>
+#include <csch_cli.h>
+
+#include "fotaupdate.h"
+#include "fmsclient.h"
+#include "FotaReminderDlg.h"
+#include "FotasrvSession.h"
+#include "fotaserverPrivateCRKeys.h"
+#include "fotaserverPrivatePSKeys.h"
+
+
+
+
+
+// ============== LOCAL FUNCTIONS ============================================
+
+
+
+TInt WriteUpdateBitmapL( const TDesC& aText, const TDesC& aFile)
+    {
+    FLOG(_L("WriteUpdateBitmapL writing %S to %S w/ txtdir"),&aText,&aFile);
+
+    TSize   screensize = CCoeEnv::Static()->ScreenDevice()->SizeInPixels();
+    TInt                width  = screensize.iWidth - KBmpMargin*2;
+    TInt                height =  screensize.iHeight;
+
+    CArrayFixSeg<TPtrC>*   lines = new CArrayFixSeg<TPtrC>(5);
+    CleanupStack::PushL(lines);
+    CFbsBitmap*         bitmap = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( bitmap );
+    bitmap->Create(  TSize(width,height), EColor64K );
+    CFbsBitmapDevice*   device = CFbsBitmapDevice::NewL( bitmap );
+    CleanupStack::PushL( device );
+    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);
+    CFbsBitGc*          context;
+    User::LeaveIfError( device->CreateContext( context ) );
+    CleanupStack::PushL( context );
+    TInt                ascent = font->AscentInPixels();
+    TInt                descent = font->DescentInPixels();
+    context->UseFont ( font );
+    context->Clear(); // bg color
+
+    // Visually ordered text
+    HBufC* wrappedstring = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
+            aText, width,*font, *lines);
+    CleanupStack::PushL ( wrappedstring );
+    TBool dirfound (ETrue);
+    // direction of text, affects alignemnt
+    TBidiText::TDirectionality direction = TBidiText::TextDirectionality(
+            *wrappedstring, &dirfound );
+
+    // Print visual text to bitmap
+    for ( TInt i=0; i<lines->Count(); ++i ) 
+        {
+        TPtrC l = (*lines)[i];
+        TInt top = (ascent+descent)*(i);
+        TInt bot = (ascent+descent)*(i+1);
+        TRect rect (0, top ,width, bot );
+        CGraphicsContext::TTextAlign alignment = 
+        direction==TBidiText::ELeftToRight ? CGraphicsContext::ELeft 
+            : CGraphicsContext::ERight;
+        context->DrawText(l, rect, ascent, alignment);
+        }
+    height = (ascent+descent)*lines->Count() + descent;
+    bitmap->Resize( TSize(width,height));
+    bitmap->Save( aFile );
+    context->DiscardFont();
+    CleanupStack::PopAndDestroy( wrappedstring );
+    CleanupStack::PopAndDestroy( context );
+    CleanupStack::PopAndDestroy( device );
+    CleanupStack::PopAndDestroy( bitmap );
+    CleanupStack::PopAndDestroy( lines );
+    return 1;
+    }
+
+
+// ---------------------------------------------------------------------------
+// PackageFileName  Creates pgk filename ,like 5.swupd
+// ---------------------------------------------------------------------------
+void PackageFileName( TInt aPkgid, TDes8& aFileName )
+    {
+    aFileName.AppendNum(aPkgid);
+    aFileName.Append( KSwupdFileExt8 );
+    }
+
+
+// ---------------------------------------------------------------------------
+// PackageFilePath  Creates pk file path, like c:\\private\\102072C4\\5.swupd
+// ---------------------------------------------------------------------------
+void PackageFilePath( TInt aPkgid, TDes8& aPath )
+    {
+    TBuf8<20> fn;
+    PackageFileName ( aPkgid,fn);
+    aPath.Append(KSwupdPath8);
+    aPath.Append(fn);
+    }
+
+// ============================= MEMBER FUNCTIONS ============================
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::CFotaUpdate()
+// ---------------------------------------------------------------------------
+//
+CFotaUpdate::CFotaUpdate() : CActive(EPriorityNormal) 
+,iScheduledUpdate(NULL),iHandleUpdateAcceptLater(EFalse),iCentrep(NULL)
+                {
+                CActiveScheduler::Add( this ); 
+                iNotifParams.iNoteType  = ESyncMLFwUpdUnknown;  
+                iNotifParams.iIntParam  = 0;
+                iChargeToMonitor = 0;
+                iFinalizeLater = EFalse;
+                }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::~CFotaUpdate()
+// ---------------------------------------------------------------------------
+//
+CFotaUpdate::~CFotaUpdate()
+    {
+    if(iScheduledUpdate)
+        {
+        delete iScheduledUpdate;
+        iScheduledUpdate = NULL;	
+        }
+    iIntervalType.Close();  
+    iInterval.Close();  
+   if(iCentrep)
+       {
+       delete iCentrep;
+       iCentrep = NULL;
+       }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::NewL 
+// ---------------------------------------------------------------------------
+//
+CFotaUpdate* CFotaUpdate::NewL (CFotaServer* aServer)
+    {
+    CFotaUpdate* ao = new (ELeave) CFotaUpdate();
+    ao->iFotaServer = aServer;
+    return ao;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::CheckUpdateResults
+// Checks if there is update result file available (meaning that update just
+// took place)
+// ---------------------------------------------------------------------------
+//
+TBool CFotaUpdate::CheckUpdateResults( RFs& aRfs )
+    {
+    RFile   f;
+    TInt    err;
+    err = f.Open ( aRfs, KUpdateResultFile, EFileShareAny );
+    f.Close();
+    if ( err!=KErrNone )
+        {
+        return EFalse;
+        }
+    FLOG(_L(" CFotaUpdate::CheckUpdateResults  update result file Found! "));
+    return ETrue;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::ExecuteUpdateResultFileL
+// Read result code from update result file and update state accordingly. 
+// Show notifier "Update succesful". Do some cleanup.
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::ExecuteUpdateResultFileL( RFs& aRfs )
+    {
+    FLOG(_L("CFotaUpdate::ExecuteUpdateResultFileL >>"));
+    iFs = &aRfs;
+    TInt                err;
+    RFileReadStream     rstr;
+    TInt                result;
+    TInt                msglen;
+    HBufC8*             message=NULL;
+    HBufC16*            message16=NULL;
+    TBool               deleteData ( EFalse );
+
+    // Open update result file
+    FLOG(_L("opening rstr 1/2  "));
+    err = rstr.Open(*iFs,KUpdateResultFile ,EFileRead|EFileStream);
+    FLOG(_L("opened  rstr 2/2  "));
+    if(err) FLOG(_L("   update result file open err %d"), err);
+    User::LeaveIfError (err );
+    FLOG(_L("       0.1"));
+    CleanupClosePushL( rstr );
+    FLOG(_L("       0.2"));
+
+    // Read resultcode 
+    result = rstr.ReadUint32L();        FLOG(_L("       0.3"));
+    msglen = rstr.ReadUint32L();        FLOG(_L("       0.4  result: %d  \
+    msglen:%d "),  result, msglen);
+    if(msglen != 0)
+        {
+        FLOG(_L("       0.5  reading msg"));
+        message         = HBufC8::NewLC(msglen+1);
+        TPtr8  ptrdesc  = message->Des();
+        TRAPD ( err2, rstr.ReadL(ptrdesc) );
+        if ( err2 != KErrNone && err2 != KErrEof)
+            {
+            FLOG(_L("  file read err %d"),err2); User::Leave( err2 ); 
+            }
+
+        message16 = HBufC16::NewLC (message->Des().Length());
+        message16->Des().Copy( *message );
+        FLOG(_L("   1 update result: %d"),  result) ;
+        FLOG(_L("   2 dbg msg: %S"),message16);
+        CleanupStack::PopAndDestroy( message16 );
+        CleanupStack::PopAndDestroy( message );
+        }
+
+    FLOG(_L("       0.6 "));
+    CleanupStack::PopAndDestroy( &rstr ); 
+
+    // Map resultcode to FUMO result code
+    RFotaEngineSession::TState  fstate  
+    = RFotaEngineSession::EUpdateFailed;
+    RFotaEngineSession::TResult fresult 
+    = RFotaEngineSession::EResUpdateFailed;
+
+    TDriveNumber drive;
+    TBool toencrypt =   iFotaServer->NeedToEncryptL(drive);
+
+    FLOG(_L("   3"));
+    switch ( result )
+        {
+        case UPD_OK:
+            {
+            fstate = RFotaEngineSession::EUpdateSuccessfulNoData;
+            fresult = RFotaEngineSession::EResSuccessful;
+            deleteData = ETrue;
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNone, toencrypt );
+            }
+            break;
+        case UPD_INSTALL_REQUEST_IS_INVALID:
+            {
+            fstate = RFotaEngineSession::EUpdateFailedNoData;
+            fresult = RFotaEngineSession::EResUpdateFailed;
+            deleteData = ETrue;
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNotFound, toencrypt );
+            }
+            break;
+        case UPD_UPDATE_PACKAGE_IS_ABSENT:
+            {
+            fstate = RFotaEngineSession::EUpdateFailedNoData;
+            fresult = RFotaEngineSession::EResUpdateFailed;
+            }
+            break;
+        case UPD_UPDATE_PACKAGE_IS_CORRUPTED:
+            {
+            fstate = RFotaEngineSession::EUpdateFailedNoData;
+            fresult = RFotaEngineSession::EResCorruptedFWUPD;
+            deleteData = ETrue;
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNotSupported, toencrypt );
+            }
+            break;
+        case UPD_UPDATE_PACKAGE_CONTENTS_IS_INVALID:
+            {
+            fstate = RFotaEngineSession::EUpdateFailedNoData;
+            fresult = RFotaEngineSession::EResCorruptedFWUPD;
+            deleteData = ETrue;
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNotSupported, toencrypt );
+            }
+            break;
+        case UPD_UPDATE_PACKAGE_IS_NOT_COMPATIBLE_WITH_CURRENT_MOBILE_DEVICE:
+            {
+            fstate = RFotaEngineSession::EUpdateFailedNoData;
+            fresult = RFotaEngineSession::EResPackageMismatch;
+            deleteData = ETrue;
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNotSupported, toencrypt );
+            }
+            break;
+        case UPD_FATAL_ERROR:
+            {
+            fstate = RFotaEngineSession::EUpdateFailedNoData;
+            fresult = RFotaEngineSession::EResUpdateFailed;
+            deleteData = ETrue;
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNotFound, toencrypt );
+            }
+            break;
+
+        default:
+            {
+            FLOG(_L("   3.1 invalid result: %d"), result);
+            LaunchNotifierL ( ESyncMLFwUpdResultNote, KErrNotFound, toencrypt );
+            }
+            break;      
+        }
+
+    // Find the state 60 (update  progressing) -> 100 (etc)
+    RArray<TInt>    states;
+    TPackageState   state;
+    CleanupClosePushL (states);
+    iFotaServer->iDatabase->OpenDBL();
+    iFotaServer->iDatabase->GetAllL(states);
+
+    FLOG(_L("   4.1 found %d states "),states.Count() );
+    for(TInt i=0;i<states.Count(); ++i ) 
+        {
+        TPackageState   tmp;
+        tmp = iFotaServer->iDatabase->GetStateL(  states[i]  );
+        FLOG(_L("   5 got state "));
+        if ( tmp.iState == RFotaEngineSession::EUpdateProgressing )
+            {
+            state = tmp;
+            state.iState    = fstate;
+            state.iResult   = fresult;
+            FLOG(_L("   6 Updating state id %d  to %d ,result %d  ")
+                    ,state.iPkgId, state.iState,state.iResult );
+            iFotaServer->iDatabase->SetStateL(state,KNullDesC8
+                    ,EFDBState|EFDBResult ) ;
+            }
+        }
+    iFotaServer->iDatabase->CloseAndCommitDB();
+    CleanupStack::PopAndDestroy(&states);
+
+
+    // Delete request file
+    err = BaflUtils::DeleteFile ( *iFs, KUpdateRequestFile );
+    if ( err != KErrNone && err != KErrNotFound ) 
+        {
+        FLOG(_L("   6.1  req file deleted, err %d"), err);
+        User::Leave(err); 
+        } 
+
+    // Write timestamp (shown to user in device management ui)
+    if( fresult == RFotaEngineSession::EResSuccessful )
+        {
+        RFileWriteStream    wstr;
+        TTime               time;
+        User::LeaveIfError( wstr.Replace( *iFs, KUpdateTimeStampFileName
+                ,EFileWrite ) );
+        CleanupClosePushL ( wstr );
+        time.HomeTime();
+        TInt                year   = time.DateTime().Year();
+        TInt                month  = time.DateTime().Month();    
+        TInt                day    = time.DateTime().Day();    
+        TInt                hour   = time.DateTime().Hour();    
+        TInt                minute = time.DateTime().Minute();    
+        wstr.WriteInt32L(year) ;
+        wstr.WriteInt32L(month) ;
+        wstr.WriteInt32L(day) ;
+        wstr.WriteInt32L(hour) ;
+        wstr.WriteInt32L(minute) ;   
+        CleanupStack::PopAndDestroy (1); // wstr
+        }
+    // Delete package content
+    if ( deleteData  && state.iPkgId > KErrNotFound )
+        {
+        iFotaServer->StoragePluginL()->DeleteUpdatePackageL( state.iPkgId ) ;
+        }
+
+
+    // Report state back to syncml server
+    if ( state.iPkgId >= 0 )
+        {
+        FLOG(_L("   6.1 creating device mgmt session for profile %d")
+                ,state.iProfileId);
+        iFotaServer->CreateDeviceManagementSessionL( state );
+        }
+    else 
+        {
+        FLOG(_L(" No state found in 'update progress' mode! cannot report\
+        status to DM server "));
+        }
+
+    FLOG(_L("CFotaUpdate::ExecuteUpdateResultFileL <<"));
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::DeleteUpdateResultsL
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::DeleteUpdateResultFileL( RFs& aRfs )
+    {
+    FLOG(_L("CFotaUpdate::DeleteUpdateResultsL "));
+    // Delete result file
+    BaflUtils::DeleteFile( aRfs, KUpdateResultFile );
+    BaflUtils::DeleteFile( aRfs, KUpdateRequestFile );
+    BaflUtils::DeleteFile( aRfs, KUpdateBitmap );
+    BaflUtils::DeleteFile( aRfs, KRestartingBitmap );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::RunL
+//  Handles user selection (button press: accept/ cancel update)
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::RunL()
+    {
+    FLOG(_L( "[FotaServer] CFotaUpdate::RunL() >> %d"  ),iStatus.Int() );
+    TBool       handled( EFalse );
+    User::LeaveIfError(iNotifier.CancelNotifier(KSyncMLFwUpdNotifierUid));
+    iNotifier.Close();
+
+    if (iStatus.Int() == KErrNotFound )
+        {
+        FLOG(_L("Exiting...."));
+        TApaTaskList taskList(iFotaServer->GetEikEnv()->WsSession());
+        TApaTask task=taskList.FindApp(TUid::Uid(KOmaDMAppUid));
+        if(task.Exists())
+            {
+            task.EndTask();
+            }
+        return;
+
+        }
+    // Handle update start query
+    if ( iNotifParams.iNoteType == ESyncMLFwUpdStartQuery || iNotifParams.iNoteType == ESyncMLFwUpdForceQuery || iNotifParams.iNoteType == ESyncMLFwUpdPostponeLimitQuery)
+        {
+        FLOG(_L("   update start query"));
+        // User pressed accept
+        if ( iStatus.Int() == KErrNone )
+            {
+            handled = ETrue;
+            HandleUpdateAcceptStartL();
+            }
+        // User pressed later
+        else if ( iStatus.Int() == KErrCancel )
+            {
+
+            FLOG(_L("USER PRESSED LATER"));
+            handled = ETrue;
+            HandleUpdateAcceptLaterL();
+            }
+        }
+    if ( iNotifParams.iNoteType == ESyncMLFwUpdStartQueryEnc )
+        {
+        FLOG(_L("   update start query"));
+
+        if ( iStatus.Int() == KErrNone )
+            {
+            FLOG(_L(" user accepted query to decrypt memory"));
+            handled = ETrue;
+            TRAPD(err, iFotaServer->DoStartDecryptionL());
+            
+            if (err == KErrNotReady)
+                {
+                HandleUpdateErrorL(err);
+                }
+            }
+        else if (iStatus.Int() == KErrCancel )
+            {
+            FLOG(_L("User pressed cancel. Don't decrypt. Stop."));
+            handled = ETrue;
+            LaunchNotifierL( ESyncMLFwUpdNoReminder , KErrNone );
+            }
+
+        }
+    // Handle battery error
+    if ( iNotifParams.iNoteType == ESyncMLFwUpdErrorNote )
+        {
+
+        if (iNotifParams.iIntParam == KErrBadPower || iNotifParams.iIntParam == KErrBadUsbPower)
+            {
+            FLOG(_L("       battery note"));
+            if ( iStatus.Int() == KErrNone )
+                {
+                handled = ETrue;
+
+                // Still check batt. (user might have connected charger)
+
+                HandleErrorBasedonChargingTypeL();
+
+                }
+            else if (iNotifParams.iIntParam == KErrDeviceMemoryBusy)
+                {
+                FLOG(_L("Do nothing. Stop the update."));
+                iFotaServer->FinalizeUpdateL();
+                }
+            else if (iNotifParams.iIntParam == KErrBadPowerForEnc)
+                {
+                if (iFinalizeLater)
+                    {
+                    FLOG(_L("Finalizing update now..."));
+                    iFinalizeLater = EFalse;
+                    iFotaServer->FinalizeUpdateL();
+                    }
+                }
+            }
+        }
+
+    //  Handle update complete notification
+    if ( iNotifParams.iNoteType == ESyncMLFwUpdResultNote )
+        {
+        handled = ETrue;
+        DeleteUpdateResultFileL( iFotaServer->iFs );
+        if (!iNotifParams.iEncryptReq)
+            {
+            FLOG(_L("Going to finalize update..."));
+            iFotaServer->FinalizeUpdateL();
+            }
+
+        }
+    if ( iNotifParams.iNoteType == ESyncMLFwUpdNoReminder )
+        {
+        FLOG(_L(" No Reminder selected"));
+        if ( iStatus.Int() == KErrNone )
+            {
+            handled = ETrue;
+
+            FindScheduleL( ETrue );
+            iUpdateState.iState = RFotaEngineSession::EStartingUpdate;
+            iFotaServer->iDatabase->OpenDBL();
+            iFotaServer->iDatabase->SetStateL(iUpdateState ,KNullDesC8,EFDBState);
+            iFotaServer->iDatabase->CloseAndCommitDB();
+
+            // Report state back to syncml server
+            if ( iUpdateState.iPkgId >= 0 && iUpdateState.iSendAlert )
+                {
+                FLOG(_L("   creating device mgmt session for profile %d")
+                        ,iUpdateState.iProfileId);
+                iFotaServer->CreateDeviceManagementSessionL( iUpdateState );
+                }
+            iFotaServer->FinalizeUpdateL();
+            }
+        }
+    if ( iNotifParams.iNoteType == ESyncMLFwUpdResultNote && iNotifParams.iEncryptReq)
+        {
+        if (iStatus.Int() == KErrNone)
+            {
+            FLOG(_L("User wanted to start encryption..."));
+            iFotaServer->DoStartEncryptionL();
+            }
+        else 
+            {
+            FLOG(_L("User do not want to start encryption."));
+            }
+        if (!iFinalizeLater)
+            iFotaServer->FinalizeUpdateL();
+        }
+    if ( !handled ) 
+        {
+        FLOG(_L("CANNOT INTERPRET NOTIFIER RESULT CODE: %d"), iStatus.Int() );
+        }
+
+    FLOG(_L( "[FotaServer] CFotaUpdate::RunL() <<" ) );
+    }
+
+
+
+
+
+// ---------------------------------------------------------------------------
+//  CFotaUpdate::HandleUpdateAcceptStartL()
+//  Handles user selection of NOW
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::HandleUpdateAcceptStartL(TBool aSkipBatteryChk)
+    {
+    FLOG(_L("USER PRESSED ACCEPT"));
+
+    TBool	enoughPower (EFalse);
+    TInt usbchargingsupport =0;
+    if (aSkipBatteryChk)
+        {
+        enoughPower = ETrue;
+        }
+    else
+        {
+        CRepository* centrep = NULL;
+        //centrep = CRepository::NewLC( TUid::Uid(KFotaServerUid));
+        TRAPD(err, centrep = CRepository::NewL( TUid::Uid(KFotaServerUid)));
+        if(err)
+            {
+            FLOG(_L("reading from cenrep failed"));
+            }
+
+        if(centrep)
+            {centrep->Get( KFotaUSBChargerEnabled , usbchargingsupport );
+            if(usbchargingsupport != 0 && usbchargingsupport != 1)
+                usbchargingsupport =0;
+            delete centrep;
+            } 
+        centrep = NULL;
+        enoughPower = CheckBatteryL(usbchargingsupport);
+#if defined(__WINS__)
+        enoughPower = ETrue;
+#endif
+        }
+    // Failure due to low battery
+    if ( !enoughPower )
+        {
+        FLOG(_L("Launching low battery notifier"));
+        if(!usbchargingsupport)
+            LaunchNotifierL( ESyncMLFwUpdErrorNote, KErrBadPower );
+        else
+            LaunchNotifierL( ESyncMLFwUpdErrorNote , KErrBadUsbPower );
+        }            
+    else
+        {
+        UpdateL();
+        }   
+    }
+
+
+void CFotaUpdate::HandleUpdateErrorL(TInt aError, TInt aValue)
+    {
+    FLOG(_L("CFotaUpdate::HandleUpdateErrorL, error = %d, value = %d >>"), aError, aValue);
+
+    switch (aError)
+        {
+        case KErrNotReady: //Called from within StartUpdate
+            {
+            LaunchNotifierL(ESyncMLFwUpdErrorNote,KErrDeviceMemoryBusy);
+            }
+            break;
+        case KErrBadPower: //Called from fotaserver when battery power is not enough
+            {
+            iChargeToMonitor = aValue;
+            CRepository* centrep = NULL;
+            TRAPD(err, centrep = CRepository::NewL( TUid::Uid(KFotaServerUid)));
+            if(err)
+                {
+                FLOG(_L("reading from cenrep failed"));
+                }
+            TInt usbchargingsupport =0;
+            if(centrep)
+                {centrep->Get( KFotaUSBChargerEnabled , usbchargingsupport );
+                if(usbchargingsupport != 0 && usbchargingsupport != 1)
+                    usbchargingsupport =0;
+                delete centrep;
+                } 
+            centrep = NULL;
+            FLOG(_L("Launching low battery notifier, usbsupport = %d, state = %d"), usbchargingsupport, iUpdateState.iState);
+            if(!usbchargingsupport )
+                {
+                FLOG(_L("Here 1"));
+                if (iUpdateState.iState == RFotaEngineSession::EStartingUpdate)
+                    {
+                    FLOG(_L("Here 2"));
+                    LaunchNotifierL( ESyncMLFwUpdErrorNote, KErrBadPower );
+                    }
+                }
+            else
+                {
+                LaunchNotifierL( ESyncMLFwUpdErrorNote , KErrBadUsbPower );
+                }
+
+            }
+            break;
+        default:
+            {
+            //Do nothing
+            }
+        }
+
+
+    FLOG(_L("CFotaUpdate::HandleUpdateErrorL <<"));
+    }
+
+void CFotaUpdate::HandleEncryptionErrorL(TInt aError)
+    {
+    FLOG(_L("CFotaUpdate::HandleEncryptionErrorL, error = %d >>"), aError);
+
+    if (aError == KErrBadPower)
+        {
+        iFinalizeLater = ETrue;
+        LaunchNotifierL(ESyncMLFwUpdErrorNote, KErrBadPowerForEnc);
+        }
+    else 
+        {
+        FLOG(_L("Unknown error. Ignored"));
+        }
+
+    FLOG(_L("CFotaUpdate::HandleEncryptionErrorL <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CFotaUpdate::HandleUpdateAcceptLaterL
+//  Handles user selection of Later
+// ---------------------------------------------------------------------------
+void CFotaUpdate::HandleUpdateAcceptLaterL()
+    {
+    TInt fotaUpdateAppName (EFotaUpdateDM);
+    TInt err = RProperty::Get( KPSUidNSmlDMSyncApp, KNSmlCurrentFotaUpdateAppName, fotaUpdateAppName );
+    FLOG(_L("Setting iHandleUpdateAcceptLater to True"));
+
+    if (!err && ((fotaUpdateAppName == EFotaUpdateNSC) || (fotaUpdateAppName == EFotaUpdateNSCBg )))
+        {
+        iFotaServer->FinalizeUpdateL();		//make sure it is not called 2 times				
+        }
+    else
+        {
+        iHandleUpdateAcceptLater = ETrue;
+        ShowReminderDialogL();				
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+//  CFotaUpdate::HandleErrorBasedonChargingTypeL
+//  Handles the error based on charger type supported by the device
+// ---------------------------------------------------------------------------
+
+void CFotaUpdate::HandleErrorBasedonChargingTypeL()
+    {
+    FLOG(_L("CFotaUpdate::HandleErrorBasedonChargingTypeL >>"));
+
+    if (iUpdateState.iState == RFotaEngineSession::EStartingUpdate)
+        {
+        if (iNotifParams.iIntParam == KErrBadUsbPower)
+            {  
+            FLOG(_L("handling usb charger error "));
+            SetUpdateFailedStatesL();
+            FLOG(_L("calling for monitoring  the battery"));
+            iFotaServer->MonitorBattery(iChargeToMonitor);
+            iFotaServer->FinalizeUpdateL();
+            }
+        else
+            {
+            TInt usbcharger = KErrNone; 
+            TBool enoughPower = CheckBatteryL(usbcharger);
+
+#if defined(__WINS__)
+            //It will not come here, just used for testing.
+            enoughPower = ETrue;
+#endif
+
+            if (enoughPower)
+                {
+                //User has connected the charger
+                FLOG(_L("User has connected the charger"));
+                UpdateL();
+                }
+            else
+                {
+                FLOG(_L("User hasn't connected the charger"));
+                //User hasn't connected the charger, hence notify user to update later.
+                SetUpdateFailedStatesL();
+                //Call reminder here
+                if(!iHandleUpdateAcceptLater)
+                    {
+                    FLOG(_L("calling HandleUpdateAcceptLaterL"));
+                    HandleUpdateAcceptLaterL();
+                    }
+                iHandleUpdateAcceptLater = EFalse;
+                }
+            }
+        }
+    else //must be during encryption after update
+        {
+        if (iNotifParams.iIntParam == KErrBadUsbPower)
+            {
+            iFotaServer->MonitorBattery(iChargeToMonitor);
+            }
+        else
+            {
+            //nothing to do for dynamo charging
+            }
+        iFotaServer->FinalizeUpdateL();
+        }
+    FLOG(_L("CFotaUpdate::HandleErrorBasedonChargingTypeL <<"));
+    }
+
+// ---------------------------------------------------------------------------
+//  CFotaUpdate::SetUpdateFailedStatesL
+//  Set the state to update failed
+// ---------------------------------------------------------------------------
+
+void CFotaUpdate::SetUpdateFailedStatesL()
+    {
+    FLOG(_L("CFotaUpdate::SetUpdateFailedStatesL >>"));
+
+    iUpdateState.iState = RFotaEngineSession::EStartingUpdate;
+    iUpdateState.iResult= RFotaEngineSession::EResUpdateFailed;
+    iFotaServer->iDatabase->OpenDBL();
+    iFotaServer->iDatabase->SetStateL( iUpdateState ,KNullDesC8
+            ,EFDBState|EFDBResult );
+    iFotaServer->iDatabase->CloseAndCommitDB();
+
+    FLOG(_L("CFotaUpdate::SetUpdateFailedStatesL <<"));
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::DoCancel()
+    {
+    FLOG(_L("CFotaUpdate::DoCancel() >>"));
+    iNotifier.CancelNotifier(KSyncMLFwUpdNotifierUid);
+    iNotifier.Close();
+    FLOG(_L("CFotaUpdate::DoCancel() <<"));
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::RunError(TInt aError)
+// ---------------------------------------------------------------------------
+//
+TInt CFotaUpdate::RunError(TInt aError)
+    {
+    FLOG(_L("CFotaUpdate::RunError >> err %d"),aError);
+    FLOG(_L("CFotaUpdate::RunError << err %d"),aError);
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSyncMLNTestAppAO::LaunchNotifierL
+// Shows one of the following queries: "update now?", "update success",
+//  "update fail", "too low battery"
+// ---------------------------------------------------------------------------
+void CFotaUpdate::LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype
+        ,const TInt aIntParam, const TBool aEnc )
+    {
+    FLOG(_L("CFotaUpdate::LaunchNotifierL() >>  prof.Id: %d")
+            ,iUpdateState.iProfileId);
+    if (!IsActive())
+        {
+        TSyncMLFwUpdNotifParams         params;
+        params.iNoteType        = aNotetype;
+        params.iIntParam        = aIntParam;
+        params.iEncryptReq = aEnc;
+        TSyncMLFwUpdNotifParamsPckg     pckg(params);
+        iNotifParams.iNoteType  = params.iNoteType;
+        iNotifParams.iIntParam  = params.iIntParam;
+        iNotifParams.iEncryptReq = params.iEncryptReq;
+        iDummyResponsePckg = TSyncMLFwUpdNotifRetValPckg();
+        User::LeaveIfError( iNotifier.Connect() );
+        iNotifier.StartNotifierAndGetResponse( iStatus,KSyncMLFwUpdNotifierUid
+                , pckg, iDummyResponsePckg );
+        SetActive();
+        }
+    FLOG(_L("CFotaUpdate::LaunchNotifierL() <<"));
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::LaunchNotifierL
+// Shows the postpone information note when postpone limit feature is enabled.
+// ---------------------------------------------------------------------------
+void CFotaUpdate::LaunchNotifierL( const TSyncMLFwUpdNoteTypes aNotetype
+                                            ,const TInt aIntUserPostpone,const TInt aIntMaxPostpone,TIntervalType aIntervalType,const TInt aInterval)
+    {
+    FLOG(_L("CFotaUpdate::LaunchNotifierL() >>  prof.Id: %d aIntUserPostpone: %d aIntMaxPostpone %d")
+                                            ,iUpdateState.iProfileId,aIntUserPostpone,aIntMaxPostpone);
+    if (!IsActive())
+        {
+        TSyncMLFwUpdNotifParams         params;
+        
+        // Parameters to display the information note is displayed
+    params.iNoteType        = aNotetype;
+    params.iFotaUserPostponeCount = aIntUserPostpone;
+    params.iFotaMaxPostponeCount = aIntMaxPostpone;
+    params.iIntervalType = aIntervalType;
+    params.iInterval = aInterval;
+    
+    /*
+    if(iReminderString.Length() > 0)
+        params.iSelectedReminder.Copy(iReminderString);
+    
+    TBuf<5> aTime;
+    aTime.Zero();
+    
+    for(TInt i = 0; i<iReminderString.Length();i++)
+        {
+        TChar ch = iReminderString[i];
+        if ( ch.IsDigit())            //separates digits from the string
+            {  
+            aTime.Append(ch); 
+            }
+        else
+            {
+            break;
+            }
+        }
+    
+    TInt val =1 ; 
+    TLex  lex(aTime);
+    TInt err = lex.Val(val); */
+
+    TSyncMLFwUpdNotifParamsPckg     pckg(params);
+    iNotifParams.iNoteType  = params.iNoteType;
+    iNotifParams.iIntParam  = params.iIntParam;
+    iDummyResponsePckg = TSyncMLFwUpdNotifRetValPckg();
+    User::LeaveIfError( iNotifier.Connect() );
+    iNotifier.StartNotifierAndGetResponse( iStatus,KSyncMLFwUpdNotifierUid
+                                            , pckg, iDummyResponsePckg );
+    SetActive();
+        }
+    FLOG(_L("CFotaUpdate::LaunchNotifierL() <<"));
+    }
+
+
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::UpdateL
+// Updates the fw: Creates input files for update agent and boots device to 
+// update mode.
+// ---------------------------------------------------------------------------
+void CFotaUpdate::UpdateL()
+    {
+    FLOG(_L("CFotaUpdate::UpdateL() >>"));
+    // Set state ........................................
+    iUpdateState.iState  = RFotaEngineSession::EUpdateProgressing;
+    iFotaServer->iDatabase->OpenDBL();
+    iFotaServer->iDatabase->SetStateL( iUpdateState ,KNullDesC8, EFDBState );
+    iFotaServer->iDatabase->CloseAndCommitDB();
+
+    // Write update request for update agent..............
+    FLOG(_L("CFotaUpdate::UpdateL  1 writing update.req "));
+    TBuf8<150>           dp2filepath;
+    HBufC16*             dp2;
+    RFileWriteStream    wstr;
+    CleanupClosePushL ( wstr );
+    FLOG(_L("CFotaUpdate::UpdateL  2 getting pkg location"));
+    iFotaServer->StoragePluginL()->GetUpdatePackageLocationL( 
+            iUpdateState.iPkgId,  dp2filepath  );
+    FLOG(_L("CFotaUpdate::UpdateL  3 craeting update.req") );
+    User::LeaveIfError( wstr.Replace( iFotaServer->iFs
+            ,KUpdateRequestFile, EFileWrite ) );
+    wstr.WriteInt16L( 1 ); // version number is  1
+    wstr.WriteInt32L( 1 ); // count   of cmds is 1
+    wstr.WriteInt16L( 0 ); // requestid is 0
+
+    dp2 = HBufC16::NewLC ( dp2filepath.Length( ) );
+    dp2->Des().Copy( dp2filepath );
+    wstr.WriteInt32L( dp2->Des().Length() + 1 ); // length of filename + null
+    wstr.WriteL( dp2->Des() );
+    wstr.WriteInt16L( 0 ); // null character
+    CleanupStack::PopAndDestroy( dp2 );
+    CleanupStack::PopAndDestroy( &wstr ); // wstr
+
+    FLOG(_L("CFotaUpdate::UpdateL  4 craeting update.bmp") );
+
+    // Write update graphic for update agent ...............
+    HBufC*              updatetxt;
+    HBufC*              restarttxt;
+    updatetxt  = StringLoader::LoadLC( R_APPS_FOTA_UPDATING );
+    restarttxt = StringLoader::LoadLC( R_APPS_FOTA_RESTARTING );
+    WriteUpdateBitmapL( updatetxt->Des(), KUpdateBitmap );
+    WriteUpdateBitmapL( restarttxt->Des(), KRestartingBitmap ); 
+    CleanupStack::PopAndDestroy( restarttxt );
+    CleanupStack::PopAndDestroy( updatetxt );
+    TRAPD(error,FindScheduleL( ETrue)); //deleting the schedule (fix for failed update) 
+    if(error)
+        {
+        FLOG(_L("CFotaUpdate::UpdateL  error in deleting previous schedule") );	
+
+        }  
+    // Simulate update agent by writing result file.
+    CRepository* centrep( NULL);
+    TInt err = KErrNone;
+    TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+    TInt simulate(KErrNotFound);
+    if ( centrep ) 
+        {
+        err = centrep->Get( KSimulateUpdateAgent, simulate );
+        }
+    delete centrep;
+    if ( simulate>0 )
+        {   
+        FLOG(_L("CFotaUpdate::UpdateL  5  - writing update.resp"));
+        RFileWriteStream    respstr;
+        CleanupClosePushL ( respstr );
+        User::LeaveIfError( respstr.Replace( iFotaServer->iFs, KUpdateResultFile
+                , EFileWrite ) );
+
+        respstr.WriteUint32L(UPD_OK);
+        respstr.WriteUint32L(15);
+        respstr.WriteL(_L("UPDATE DONE!"));
+        CleanupStack::PopAndDestroy( &respstr );
+        }
+
+    CRepository* centrep2 = NULL;
+    TRAP( err, centrep2 = CRepository::NewL( KCRUidFotaServer ) )
+    if (err==KErrNone ) 
+        {
+        centrep2->Set(  KFotaUpdateState, EFotaPendingGenAlert );
+        if(iFOTAUICustomization)
+            centrep2->Set(  KFOTAUserPostponeCount, 0 );
+       }
+     delete centrep2;
+     
+    // Boot to update mode 
+    LaunchNotifierL( ESyncMLFwUpdRebootNote, KErrNone);
+
+    FLOG(_L("   waiting 2 sec to keep 'restarting' visible"));
+    User::After(TTimeIntervalMicroSeconds32(2000000));
+
+    RStarterSession     starter;
+    FLOG(_L("           starter->Connect"));
+    User::LeaveIfError(starter.Connect());
+    starter.Reset(RStarterSession::EFirmwareUpdate);
+    starter.Close();
+    FLOG(_L("CFotaUpdate::UpdateL() <<"));
+    }   
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::CheckBatteryL()
+// Cheks if there's enough battery power to update
+// ---------------------------------------------------------------------------
+//
+TBool CFotaUpdate::CheckBatteryL(TBool aUSBChargingsupported)
+    {
+    TInt        chargingstatus( EChargingStatusError );
+    TInt        batterylevel( 1 );
+    TBool       enoughPower( EFalse );
+    // Read battery
+    FLOG(_L("   0.9 checking batt level"));
+    RProperty   pw;
+    User::LeaveIfError(pw.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel));
+    User::LeaveIfError(pw.Get( batterylevel ));
+    pw.Close();
+    if(aUSBChargingsupported)
+        {
+        if ( batterylevel >= EBatteryLevelLevel2 ) 
+            enoughPower = ETrue;
+
+        //return enoughPower; 
+        }
+    else
+        {
+        User::LeaveIfError(pw.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus));
+        User::LeaveIfError(pw.Get( chargingstatus ));
+        pw.Close();
+
+        // Too low battery, power insufficient
+        if ( batterylevel >= EBatteryLevelLevel2 ) 
+            {
+            enoughPower = ETrue;
+            }
+        // But charger is connected, power sufficient
+        if ( chargingstatus != EChargingStatusError
+                && chargingstatus != EChargingStatusNotConnected )
+            {
+            enoughPower = ETrue;
+            }
+        }
+
+    if (!enoughPower)
+        iChargeToMonitor = EBatteryLevelLevel2;
+    FLOG(_L("   1.0 batt level: %d  (0..7), chargingstatus %d")
+            ,batterylevel,chargingstatus);
+    FLOG(_L("CFotaUpdate::checkBattery %d"), enoughPower?1:0 );
+    return enoughPower;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::StartUpdateL
+// Starts fw updating (shows a notifier to user). 
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::StartUpdateL( const TDownloadIPCParams &aParams )
+    {
+    FLOG(_L("CFotaUpdate::StartUpdateL(TDownloadIPCParams aParams) >> \
+    pkig:%d"), aParams.iPkgId );
+    TSmlProfileId profile(KErrNotFound);
+
+    // Get update state from db
+    iFotaServer->iDatabase->OpenDBL( );
+    iUpdateState = iFotaServer->iDatabase->GetStateL( aParams.iPkgId );
+    iFotaServer->iDatabase->CloseAndCommitDB( );
+
+    FLOG(_L("   0 "));
+    if ( iUpdateState.iPkgId == KErrNotFound )
+        {
+        FLOG(_L("  STATE NOT FOUND pkgid %d"), aParams.iPkgId);
+        User::Leave(KErrNotFound);
+        }
+
+    // Resolve profile id
+    RSyncMLSession sml;
+    TInt                    tmp1;
+    TSmlServerAlertedAction tmp2;
+    TBool	                tmp3;
+    TInt					tmp4;
+    CleanupClosePushL( sml );
+    sml.OpenL();
+    // Use stored profile
+    if ( aParams.iProfileId == KErrNotFound )
+        {
+        iFotaServer->GetProfileDataL( &sml,iUpdateState.iProfileId
+                ,tmp1,tmp2,tmp3,tmp4);
+        profile = iUpdateState.iProfileId;
+        }
+    // Use passed profile. If error, then try to use stored profile
+    else
+        {
+        TRAPD(err, iFotaServer->GetProfileDataL( &sml,aParams.iProfileId
+                ,tmp1,tmp2, tmp3, tmp4 ) );
+        if ( err != KErrNone )
+            {
+            iFotaServer->GetProfileDataL( &sml,iUpdateState.iProfileId
+                    ,tmp1,tmp2,tmp3,tmp4);
+            profile = iUpdateState.iProfileId;
+            }
+        else
+            {
+            profile = aParams.iProfileId;
+            }
+        }
+    CleanupStack::PopAndDestroy( &sml );
+
+    // Must update package state with fresh params (it could be empty)
+    TUint fields = EFDBState | EFDBPkgName|EFDBVersion;
+    if ( profile != iUpdateState.iProfileId )
+        {  
+        fields |= EFDBProfileId;
+        }
+
+    iUpdateState.iProfileId     = profile;
+    iUpdateState.iPkgName       = aParams.iPkgName;
+    iUpdateState.iPkgVersion    = aParams.iPkgVersion;
+    iUpdateState.iState         = RFotaEngineSession::EStartingUpdate;
+    iUpdateState.iResult		= KErrNotFound;
+    iUpdateState.iSendAlert     = EFalse; // HJHA-6MJCFE . This operation will
+    // not reach any final state.
+    iFotaServer->iDatabase->OpenDBL( );
+    iFotaServer->iDatabase->SetStateL( iUpdateState, KNullDesC8, fields );
+    iFotaServer->iDatabase->CloseAndCommitDB( );
+
+    CRepository* centrep2 = NULL;
+    TRAPD( err, centrep2 = CRepository::NewL( KCRUidFotaServer ) )
+    if (err==KErrNone ) 
+        {  TInt val;
+        //
+        centrep2->Get(  KFotaUpdateState, val );
+
+        if(val == EFotaUpdateInterrupted)
+            centrep2->Set(  KFotaUpdateState, EFotaDefault );
+        }
+    delete centrep2;
+
+    FLOG(_L("CFotaUpdate::StartUpdateL  2"));
+    //new code
+    	 TInt client = iFotaServer->GetInstallUpdateClientL();
+       if( CheckUpdateVariations() && 
+   			client!= CFotaSrvSession::EOMADMAppUi &&  
+         client != CFotaSrvSession::EFMSServer ) 
+       {
+       TInt callactive(EFalse);
+       RFMSClient fmsclient;    
+       TRAPD(err,fmsclient.OpenL());
+       if(err == KErrNone)
+           {
+           CleanupClosePushL(fmsclient);
+           FLOG(_L("CFotaUpdate::startupdate FMS for active call >>"));                
+           TInt err1 = fmsclient.IsPhoneCallActive(callactive);
+           FLOG(_L("IsPhoneCallActive returns %d  >>"),err1);       
+           }
+       if(callactive)
+           {
+           FLOG(_L(" active phone call found"));           
+           
+           FLOG(_L("putting call end Ao start pkgid=%d, profileid=%d"),iUpdateState.iPkgId,iUpdateState.iProfileId);
+           TInt err1 = fmsclient.MonitorActivePhoneCallEnd(iUpdateState.iPkgId,iUpdateState.iProfileId);
+           FLOG(_L("MonitorActivePhoneCallEnd returns %d  >>"),err1);    
+           }
+       else
+           {
+           FLOG(_L("CFotaUpdate::StartUpdateL  2"));
+           
+           TDriveNumber drive;
+
+    TBool ret (EFalse);
+    TRAPD(err2, ret = iFotaServer->NeedToDecryptL(iUpdateState.iPkgId, drive));
+    if ( err2 == KErrNone )
+        {
+        if (!ret)
+            {
+            //Drive is not encrypted
+			DisplayInstallationNoteTypeL();
+            //LaunchNotifierL( ESyncMLFwUpdStartQuery, iUpdateState.iProfileId );
+            }
+        else
+            {
+            //Drive is encrypted.
+            LaunchNotifierL( ESyncMLFwUpdStartQueryEnc, iUpdateState.iProfileId );
+            }
+        }
+    else
+        {
+        HandleUpdateErrorL(err2);
+        }
+       
+           }
+       if(err == KErrNone) //fms opening error
+           {
+           CleanupStack::PopAndDestroy(&fmsclient);
+           }
+       }
+   else
+       {
+       FLOG(_L("CFotaUpdate::StartUpdateL  2 DM UI Install update"));
+       //LaunchNotifierL( ESyncMLFwUpdStartQuery, iUpdateState.iProfileId );
+       
+           TDriveNumber drive;
+
+    TBool ret (EFalse);
+    TRAP(err, ret = iFotaServer->NeedToDecryptL(iUpdateState.iPkgId, drive));
+    if ( err == KErrNone )
+        {
+        if (!ret)
+            {
+            //Drive is not encrypted
+			DisplayInstallationNoteTypeL();
+            //LaunchNotifierL( ESyncMLFwUpdStartQuery, iUpdateState.iProfileId );
+            }
+        else
+            {
+            //Drive is encrypted.
+            LaunchNotifierL( ESyncMLFwUpdStartQueryEnc, iUpdateState.iProfileId );
+            }
+        }
+    else
+        {
+        HandleUpdateErrorL(err);
+        }
+       
+       }                   
+
+    //new code
+    
+
+    FLOG(_L("CFotaUpdate::StartUpdateL(TDownloadIPCParams aParams) << \
+    pkig:%d"),aParams.iPkgId);
+    }
+	
+	
+void CFotaUpdate::DisplayInstallationNoteTypeL()
+    {
+    FLOG(_L("CFotaUpdate::DisplayInstallationNoteTypeL: >>"));
+    
+    //CRepository* centrep = NULL;
+    TInt err = KErrNone;
+    TInt CustomNotes = 0;
+	if(iCentrep == NULL)
+	{
+    TRAP(err, iCentrep = CRepository::NewL(TUid::Uid(KFotaServerUid)));
+    if(err)
+        {
+        FLOG(_L("DisplayInstallationNoteTypeL: reading from cenrep failed, returning ENormal"));
+        LaunchNotifierL( ESyncMLFwUpdStartQuery, iUpdateState.iProfileId );
+        return;
+        }
+	}
+    
+    err= iCentrep->Get( KFOTAUINotesCustomization, CustomNotes);    
+    if (err)
+        CustomNotes = 0;
+    iFOTAUICustomization = CustomNotes;
+    
+    if(iFOTAUICustomization)
+        {
+        //TRAP(err, centrep = CRepository::NewL( TUid::Uid(KFotaServerUid)));
+        //if(err)
+        //    {
+        //    FLOG(_L("DetermineNoteType: reading from cenrep failed, returning ETrue"));
+        //    return ETrue;
+        //    }
+        
+        TInt fotaUserPostpone = 0,fotaMaxPostpone = 3;
+        if(iCentrep)
+            {
+            iCentrep->Get( KFOTAUserPostponeCount , fotaUserPostpone );
+            iCentrep->Get( KFOTAMaxPostponeCount , fotaMaxPostpone );
+            }
+        iFOTAUserPostponeCount = fotaUserPostpone;
+        iFOTAMaxPostponeCount = fotaMaxPostpone;
+
+        if(iFOTAUserPostponeCount < iFOTAMaxPostponeCount)
+            {
+            FLOG(_L("DisplayInstallationNoteTypeL: returning EPostponeLimit"));
+            LaunchNotifierL( ESyncMLFwUpdPostponeLimitQuery, iUpdateState.iProfileId );
+            //return EPostponeLimit;
+            }
+        else
+            {
+            FLOG(_L("DisplayInstallationNoteTypeL: returning EForceStart"));
+            LaunchNotifierL( ESyncMLFwUpdForceQuery, iUpdateState.iProfileId );
+            //return EForceStart;
+            }
+        }
+    else
+        {
+        FLOG(_L("DisplayInstallationNoteTypeL: returning ENormal"));
+        LaunchNotifierL( ESyncMLFwUpdStartQuery, iUpdateState.iProfileId );
+        //return ENormal;
+        }
+    
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::CreateRadionButtonArrayLC
+// Creates the array of radio buttons to display 
+// on radio button setting page
+// ---------------------------------------------------------------------------
+//
+
+CDesCArray* CFotaUpdate::CreateRadionButtonArrayLC( const TScheduleEntryInfo2 aScEntry,
+        TInt& aSelectionIndex)
+    {
+    // selection defaults to 0
+    FLOG(_L("CFotaUpdate::CreateRadionButtonArrayLC >>"));  
+    aSelectionIndex = 0;
+    CDesCArray* array = new (ELeave) CDesC16ArrayFlat(4);
+    CleanupStack::PushL(array);
+    for (TInt i=0;i<iInterval.Count();i++)   
+
+        {    
+        switch (iIntervalType[i])
+            {
+            case EHourly :
+                {
+
+                HBufC* string1 ;
+                if(iInterval[i] == 1)
+                    string1 = StringLoader::LoadLC(R_FOTA_RADIO_DIALOG_1HOUR_REMAINDER);
+                else
+                    string1 = StringLoader::LoadLC(R_QTN_FOTA_REMINDER_HOURS , iInterval[i] );
+
+                array->AppendL( string1->Des() );
+                CleanupStack::PopAndDestroy( string1 );
+                if(aScEntry.Interval() == iInterval[i] && aScEntry.IntervalType()== EHourly ) 
+                    aSelectionIndex = i; 
+                }
+                break; 
+
+            case EDaily:
+                {
+
+                HBufC* string1; //= StringLoader::LoadLC(R_QTN_FOTA_REMINDER_DAYS , iInterval[i] );
+                if(iInterval[i] == 1)
+                    string1 = StringLoader::LoadLC(R_FOTA_RADIO_DIALOG_1DAY_REMAINDER);
+                else
+                    string1 = StringLoader::LoadLC(R_QTN_FOTA_REMINDER_DAYS , iInterval[i] );
+
+                array->AppendL( string1->Des() );
+                CleanupStack::PopAndDestroy( string1 );
+                if(aScEntry.Interval() == iInterval[i] && aScEntry.IntervalType()== EDaily ) 
+                    aSelectionIndex = i;
+                }
+                break;
+            case EMonthly:
+                {
+
+                HBufC* string1 ;//== StringLoader::LoadLC(R_QTN_FOTA_REMINDER_MINUTES , iInterval[i] );
+                if(iInterval[i] == 1)
+                    string1 = StringLoader::LoadLC(R_QTN_FOTA_REMINDER_1_MINUTE);
+                else
+                    string1 = StringLoader::LoadLC(R_QTN_FOTA_REMINDER_MINUTES , iInterval[i] );
+
+                array->AppendL( string1->Des() );
+                CleanupStack::PopAndDestroy( string1 );
+                if(aScEntry.Interval() == iInterval[i] && aScEntry.IntervalType()== EMonthly) 
+                    aSelectionIndex = i;
+                }
+                break; 
+
+                /*case EYearly:
+    		     {
+    		     tempChar.Num(iInterval[i]);
+    		     HBufC* string1 = StringLoader::LoadLC(R_FOTA_RADIO_DIALOG_YEAR_REMAINDER , iInterval[i] );
+               	 array->AppendL( string1->Des() );
+               	 CleanupStack::PopAndDestroy( string1 );
+               	 if(aScEntry.Interval() == iInterval[i] ) 
+               	          aSelectionIndex = i;
+    		     }
+    		     break;*/
+            }
+        }
+
+    if(iIntervalType[iIntervalType.Count()-1] == ENoReminderOn )
+        {
+        HBufC* string1 = StringLoader::LoadLC( R_FOTA_RADIO_DIALOG_NO_REMAINDER);
+        array->AppendL( string1->Des() );
+        CleanupStack::PopAndDestroy( string1 );
+        }
+    FLOG(_L("CFotaUpdate::CreateRadionButtonArrayLC <<"));  
+    return array;
+    }
+// ---------------------------------------------------------------------------
+// CFotaUpdate::ParseScheduleString()
+// Parse the schedule string from cenrep
+// ---------------------------------------------------------------------------
+//
+//
+void CFotaUpdate::ParseScheduleStringL()
+    {    
+    FLOG(_L("CFotaUpdate::ParseScheduleString() >>")); 
+
+    GetSchedulesInfoL();
+
+
+
+    iInterval.Reset();
+    iIntervalType.Reset();
+    TBuf<5> aTime;
+    TBuf<9> aSched,tempChar;
+    aTime.Zero();
+    aSched.Zero();
+
+
+    //TText*sep =   (TText *)ksep.Ptr();
+    TBufC<1>ksep(Ksep);
+    TText *t = (TText *)ksep.Ptr();      //just for Initialization
+    for(TInt i = 0; i<iscInfo.Length();i++)
+        {
+
+        TChar ch = iscInfo[i];
+        if ( ch.IsDigit())            //separates digits from the string
+            {  aTime.Append(ch); 
+
+            }
+        else
+            {  
+            aSched.Append(ch);             
+            *t = ch;
+            if (*t ==     'h' || *t =='H')      //hour
+                { iIntervalType.Append(EHourly) ;
+                TInt val =1 ; 
+                TLex  lex(aTime);
+                TInt err = lex.Val(val);
+                if (err)
+                    {
+                    iInterval.Append(1);
+                    }
+                else
+                    {
+                    iInterval.Append(val); 	
+                    }
+
+                }
+            else if (*t ==     'd'|| *t =='D')      //daily
+                {iIntervalType.Append(EDaily);
+                TInt val =1 ; 
+                TLex  lex(aTime);
+                TInt err = lex.Val(val);
+                if (err)
+                    {
+                    iInterval.Append(1);
+                    }
+                else
+                    {
+                    iInterval.Append(val);  	
+                    }
+
+                }
+            else if (*t ==     'm'||  *t =='M')   //minute
+                {iIntervalType.Append( EMonthly);
+                TInt val =1 ; 
+                TLex  lex(aTime);
+                TInt err = lex.Val(val);
+                if (err)
+                    {
+
+                    iInterval.Append(1);
+                    }
+                else
+                    {
+                    iInterval.Append(val);  	
+                    }
+
+                }
+            /* else if (*t ==     'y')   //year
+                  {iIntervalType.Append( EYearly);
+                    TInt val =1 ; 
+               	    TLex  lex(aTime);
+               	    TInt err = lex.Val(val);
+               	    if (err)
+               	    {
+
+                        iInterval.Append(1);    
+               	    }
+               	    else
+               	    {
+               	     iInterval.Append(val); 	
+               	    }
+
+                  }*/
+            else if (*t == ':')   //colon
+                {
+                aTime.Zero();
+                aSched.Zero();
+                }
+            }
+        }
+    TBool  checkSchInfo =EFalse;
+
+    if(iInterval.Count() == iIntervalType.Count() )
+        {  
+        for (TInt j =0 ;j< iInterval.Count();j++ )
+            {                                                 //setting to default 1h:4h:1d:3d
+            if(iInterval[j] < 0 || iIntervalType[j] > 3 ) 
+                {   
+                iInterval.Reset();    iIntervalType.Reset();
+                iInterval.Append(1);  iIntervalType.Append(EHourly); 
+                iInterval.Append(4);  iIntervalType.Append(EHourly); 
+                iInterval.Append(1);  iIntervalType.Append(EDaily); 
+                iInterval.Append(3);  iIntervalType.Append(EDaily);     
+                checkSchInfo =ETrue;
+                break;
+                }
+            }
+        }
+    else
+        {        
+        iInterval.Reset();    iIntervalType.Reset();
+        iInterval.Append(1);  iIntervalType.Append(EHourly); 
+        iInterval.Append(4);  iIntervalType.Append(EHourly);  //setting to default 1h:4h:1d:3d
+        iInterval.Append(1);  iIntervalType.Append(EDaily); 
+        iInterval.Append(3);  iIntervalType.Append(EDaily);     
+        checkSchInfo =ETrue;
+        }
+
+    TPtrC16 lastFive =  iscInfo.Right(5);
+    _LIT( KNoRem , "NROFF");
+    TPtrC noRem( KNoRem );   //check for No Remainder
+    if (lastFive != noRem || checkSchInfo)
+        {
+        iIntervalType.Append(ENoReminderOn);
+        }
+    else
+        { 
+        iIntervalType.Append(ENoReminderOff);
+
+        }
+    FLOG(_L("CFotaUpdate::ParseScheduleString() <<"));
+
+    } 
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::GetSchedulesInfoL
+// Get the schedule info from the cenrep
+// ---------------------------------------------------------------------------
+//
+//
+void CFotaUpdate::GetSchedulesInfoL()
+    {
+
+    CRepository* centrep = NULL;
+    //TBuf<255> scInfo; 
+    centrep = CRepository::NewLC( TUid::Uid(KFotaServerUid));
+    if ( centrep )
+        {TBuf<255> temp;
+        if (centrep->Get( KFotaOptionsForReminderDuration , temp )==KErrNone && temp.Length() )
+            {   FLOG(_L("CFotaUpdate::ParseScheduleString taking from cenrep <<"));
+            temp.Trim();    //read from cenrep
+            iscInfo.Copy(temp);
+            }
+        else
+            {                               //else set to default
+            iscInfo.Copy(KDefaultSched);  
+
+            }
+        CleanupStack::PopAndDestroy(centrep);
+        }
+    else
+        {
+        iscInfo.Copy(KDefaultSched);    //else set to default
+        }	
+
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::ShowReminderDialogL
+// Prepare and display Reminder Dialog using RFotaReminderDlg
+// on radio button setting page
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::ShowReminderDialogL()
+    {
+    // Push default content to navigation pane and change title
+	if(iFOTAUICustomization)
+	    {
+	    //if(iFOTAUICustomization)
+	    //    {
+	        if(iCentrep)
+	            {
+	            // When User has pressed Later, Postpone limit has to be Incremented
+	            iFOTAUserPostponeCount = iFOTAUserPostponeCount + 1;
+	            iCentrep->Set( KFOTAUserPostponeCount , iFOTAUserPostponeCount );
+	            }
+	    //    }
+	    
+	    
+	    if(iFOTAUserPostponeCount > iFOTAMaxPostponeCount)
+	        {
+	        // When User presses the end key during a Force Update Query or a Update Warning note, Force Update Query should be shown again.
+	        TIntervalType   tIntervalType;    
+	        TInt tInterval;
+	        tIntervalType = (TIntervalType)EEndKeyReminder;
+	        tInterval = 1;
+	        CreateScheduleL ( iUpdateState.iPkgId, tIntervalType ,tInterval );
+	        iFotaServer->FinalizeUpdateL();
+	        return;
+	        }
+	    }
+    CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
+    CAknNavigationControlContainer* naviPane = NULL;
+    HBufC* originalTitle;
+    CAknTitlePane* titlePane = NULL;
+    originalTitle = HBufC::NewLC( 50 ); //KNsmlMaxTitleSize
+
+    if ( statusPane && statusPane->PaneCapabilities( 
+            TUid::Uid(EEikStatusPaneUidTitle) ).IsPresent() )
+        {
+        naviPane = ( CAknNavigationControlContainer* )
+        statusPane->ControlL( TUid::Uid(EEikStatusPaneUidNavi) );
+        naviPane->PushDefaultL();
+        titlePane = static_cast<CAknTitlePane*>
+        ( statusPane->ControlL( TUid::Uid(
+                EEikStatusPaneUidTitle) ) );
+        if ( titlePane->Text() ) 
+            {
+            originalTitle->Des().Copy( *titlePane->Text() );
+            HBufC* titleText = StringLoader::LoadLC(
+                    R_QTN_DM_TITLE_SETTINGS_DIALOG );
+            titlePane->SetTextL( *titleText );
+            CleanupStack::PopAndDestroy( titleText );
+            titleText = NULL;
+            }
+        }
+
+    TApaTaskList taskList(iFotaServer->GetEikEnv()->WsSession());
+    TApaTask task=taskList.FindApp(TUid::Uid(KFotaServerUid));
+
+    if(task.Exists())
+        task.BringToForeground();
+
+    // Construct radio btn list and launch radio button dlg
+    TScheduleEntryInfo2 en=FindScheduleL( EFalse );
+    TInt radioSelectionIndex( KErrNotFound );
+    TRAPD(error,ParseScheduleStringL());  
+    if (error)
+        {
+        iInterval.Reset();    iIntervalType.Reset();
+        iInterval.Append(1);  iIntervalType.Append(EHourly); 
+        iInterval.Append(4);  iIntervalType.Append(EHourly); 
+        iInterval.Append(1);  iIntervalType.Append(EDaily); 
+        iInterval.Append(3);  iIntervalType.Append(EDaily); 
+        iIntervalType.Append(ENoReminderOn);
+        }
+    if(iInterval.Count() > 4)
+        {
+        for(TInt i= 4;i <iInterval.Count();i++)
+            iInterval.Remove(i);
+        }  
+    CDesCArray* itemArray = CreateRadionButtonArrayLC( en,radioSelectionIndex );
+
+    TInt aEvent(KErrNone);
+    CFotaReminderDlg* aFotaReminderDlg = CFotaReminderDlg::NewL(radioSelectionIndex,itemArray,aEvent );
+    FLOG(_L("after creating fota reminder dialog"));   
+    CleanupStack::PushL(aFotaReminderDlg);
+    TInt presentPriotiry = CEikonEnv::Static()->RootWin().OrdinalPriority();
+    TInt presentPosition = CEikonEnv::Static()->RootWin().OrdinalPosition();
+    CEikonEnv::Static()->RootWin().SetOrdinalPosition(presentPosition, ECoeWinPriorityMedium);  //setting the priority to medium for activation on top of global notes
+
+    TInt ret = aFotaReminderDlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+    CleanupStack::Pop(aFotaReminderDlg);	     							
+    CleanupStack::PopAndDestroy( itemArray );
+
+    CEikonEnv::Static()->RootWin().SetOrdinalPosition(presentPosition, presentPriotiry); //resetting to previous priority
+    FLOG(_L("****Event key = %d"),aEvent);
+
+    if (aEvent == EEventKey)
+        {
+        FLOG(_L("Exiting...."));
+        TApaTaskList taskList(iFotaServer->GetEikEnv()->WsSession());
+        TApaTask task=taskList.FindApp(TUid::Uid(KOmaDMAppUid));
+        if(task.Exists())
+            {
+            task.EndTask();
+            task.KillTask();
+            }
+
+        return;
+        }
+		if(naviPane)
+    	naviPane->Pop();
+    if(	titlePane )
+    {	
+    	if ( titlePane->Text() && originalTitle ) 
+        {
+        TRAP_IGNORE( titlePane->SetTextL( *originalTitle ) );
+        }
+    }
+    CleanupStack::PopAndDestroy( originalTitle );
+    task.SendToBackground();	
+
+    CreateNewScheduleL(ret,radioSelectionIndex);	
+
+
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::CreateNewScheduleL
+// Creates the new schedule
+// ---------------------------------------------------------------------------
+//
+void CFotaUpdate::CreateNewScheduleL(TInt aRet, TInt aRadioSelectionIndex)
+    {
+
+    TScheduleEntryInfo2 en=FindScheduleL( EFalse );
+    TIntervalType   tIntervalType;    
+    TInt tInterval; 
+    if ( aRet && aRadioSelectionIndex== 0 ) 
+        {
+        FLOG(_L("Creating reminder: for 1st option"));
+        tIntervalType = (TIntervalType)iIntervalType[aRadioSelectionIndex];				
+        tInterval     = iInterval[aRadioSelectionIndex];
+        if(iFOTAUICustomization)
+                    LaunchNotifierL( ESyncMLFwUpdPostponeNote , iFOTAUserPostponeCount, iFOTAMaxPostponeCount, tIntervalType,tInterval);
+        en=FindScheduleL( ETrue );
+        CreateScheduleL ( iUpdateState.iPkgId, tIntervalType ,tInterval );
+        iFotaServer->FinalizeUpdateL();
+        }
+    else if(aRet && aRadioSelectionIndex == 1 )
+        {
+        FLOG(_L("Creating reminder: 4 hours"));
+        tIntervalType = (TIntervalType)iIntervalType[aRadioSelectionIndex];				
+        tInterval     = iInterval[aRadioSelectionIndex];
+        if(iFOTAUICustomization)
+                    LaunchNotifierL( ESyncMLFwUpdPostponeNote , iFOTAUserPostponeCount, iFOTAMaxPostponeCount, tIntervalType,tInterval);
+        en=FindScheduleL( ETrue );
+        CreateScheduleL ( iUpdateState.iPkgId, tIntervalType ,tInterval );
+        iFotaServer->FinalizeUpdateL();
+        }
+    else if(aRet && aRadioSelectionIndex == 2 )
+        {
+        FLOG(_L("Creating reminder: for 2nd option"));
+        tIntervalType = (TIntervalType)iIntervalType[aRadioSelectionIndex];				
+        tInterval     = iInterval[aRadioSelectionIndex];
+        if(iFOTAUICustomization)
+                    LaunchNotifierL( ESyncMLFwUpdPostponeNote , iFOTAUserPostponeCount, iFOTAMaxPostponeCount, tIntervalType,tInterval);
+        en=FindScheduleL( ETrue );
+        CreateScheduleL ( iUpdateState.iPkgId, tIntervalType ,tInterval );
+        iFotaServer->FinalizeUpdateL();
+        }
+    else if(aRet && aRadioSelectionIndex == 3 )
+        {
+        FLOG(_L("Creating reminder: for 3rd option"));
+        tIntervalType = (TIntervalType)iIntervalType[aRadioSelectionIndex];				
+        tInterval     = iInterval[aRadioSelectionIndex];
+        if(iFOTAUICustomization)
+                    LaunchNotifierL( ESyncMLFwUpdPostponeNote , iFOTAUserPostponeCount, iFOTAMaxPostponeCount, tIntervalType,tInterval);
+        en=FindScheduleL( ETrue );
+        CreateScheduleL ( iUpdateState.iPkgId, tIntervalType ,tInterval );  
+        iFotaServer->FinalizeUpdateL();
+        }
+    else if (!aRet || aRadioSelectionIndex == 4)
+        {
+        FLOG(_L("Deleting reminder, btn press %d"),aRet);
+        TScheduleEntryInfo2 en=FindScheduleL( ETrue );
+
+        if ( !aRet ) // cancel pressed
+            {
+			if(iFOTAUICustomization)
+			    {
+			    if(iCentrep)
+			        {
+			        	// When User has pressed Later and then does a cancel for the warning query, Postpone limit has to be decremented
+			        iFOTAUserPostponeCount = iFOTAUserPostponeCount - 1;
+			        iCentrep->Set( KFOTAUserPostponeCount , iFOTAUserPostponeCount );
+			        }
+			    }
+			DisplayInstallationNoteTypeL();			
+			}
+        else			  // ok pressed
+            {
+            LaunchNotifierL( ESyncMLFwUpdNoReminder , KErrNone );
+            //iFotaServer->FinalizeUpdateL();
+            }
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::FindScheduleL
+// Finds fotaupdate schedule (named [102072c4])
+// ---------------------------------------------------------------------------
+//
+TScheduleEntryInfo2 CFotaUpdate::FindScheduleL( const TBool aDelete )
+    {
+    TScheduleEntryInfo2                     ret;
+    TInt                                    err;    
+    RScheduler                              sc;
+    TTime                                   t; 
+    TTsTime                                 time;
+    TSchedulerItemRef                       scitem; 
+    CArrayFixFlat<TSchedulerItemRef>*     	aSchRefArray = new CArrayFixFlat <TSchedulerItemRef>(5);
+    TScheduleFilter                      	aFilter(EAllSchedules);
+    User::LeaveIfError( sc.Connect() );                             // xx
+    CleanupClosePushL( sc );
+    CleanupStack::PushL(aSchRefArray);
+
+    User::LeaveIfError( sc.GetScheduleRefsL( *aSchRefArray,aFilter) );  // xx
+    FLOG(_L("Schedule items: "));
+    for ( TInt i=0; i<aSchRefArray->Count(); ++i  )
+        {
+        TSchedulerItemRef it = (*aSchRefArray)[i];
+        if ( it.iName == TUid::Uid(KFotaServerUid).Name()  )
+            {
+            TScheduleState2 sc_state;
+            CArrayFixFlat<TScheduleEntryInfo2>*  sc_entries = new CArrayFixFlat <TScheduleEntryInfo2>(5);
+            CArrayFixFlat<TTaskInfo>*            sc_tasks  = new CArrayFixFlat <TTaskInfo>(5);
+            TTsTime                              sc_duetime;
+            CleanupStack::PushL( sc_entries );
+            CleanupStack::PushL( sc_tasks );
+            FLOG (_L("%d. schedule handle: %d name:'%S'"),i,it.iHandle, &(it.iName) );
+
+            err = sc.GetScheduleL ( it.iHandle , sc_state, *sc_entries,*sc_tasks,sc_duetime ); // xx
+
+            TDateTime  dtm = sc_duetime.GetLocalTime().DateTime();
+            FLOG(_L("   schedule duetime:%d:%d"), dtm.Hour(), dtm.Minute());
+
+            if ( err ) FLOG(_L("     schedule  sc get err %d"),err);
+            else 
+                {
+                for ( TInt k=0; k<sc_entries->Count();++k)
+                    {
+                    TScheduleEntryInfo2 sc_entry = (*sc_entries)[k];
+                    ret = sc_entry;
+                    TTime sctime = sc_entry.StartTime().GetLocalTime();
+                    FLOG(_L("         schedule entry %d int-type:%d int:%d start: %d:%d"),k,sc_entry.IntervalType(),sc_entry.Interval(),sctime.DateTime().Hour(),sctime.DateTime().Minute());
+                    }
+
+                for ( TInt j=0; j<sc_tasks->Count();++j)
+                    {
+                    TTaskInfo sc_task = (*sc_tasks)[j];
+                    FLOG(_L("         schedule task  %d  '%S'"),sc_task.iTaskId,&(sc_task.iName) );
+                    if ( aDelete && sc_task.iName==TUid::Uid(KFotaServerUid).Name() )
+                        {
+                        FLOG(_L("          schedule DeleteTask %d"),sc_task.iTaskId);
+                        User::LeaveIfError( sc.DeleteTask(sc_task.iTaskId) );       // xx
+                        }
+                    }
+                }
+            if ( aDelete )
+                {
+                FLOG(_L("     DeleteSchedule %d"),it.iHandle);
+                User::LeaveIfError(sc.DeleteSchedule(it.iHandle ));                 // xx
+                }
+            CleanupStack::PopAndDestroy( sc_tasks );
+            CleanupStack::PopAndDestroy( sc_entries );
+            }
+        }
+    CleanupStack::PopAndDestroy( aSchRefArray );
+    CleanupStack::PopAndDestroy(&sc);
+    return ret;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CFotaUpdate::CreateScheduleL
+// Creates fotaupdate schedule (named [102072c4])
+// ---------------------------------------------------------------------------
+//
+TInt CFotaUpdate::CreateScheduleL ( const TInt aPackageId 
+                                   ,TIntervalType  aIntervalType
+                                   ,const TInt aInterval)
+    {
+    FLOG(_L("CFotaUpdate::CreateScheduleL ()") );
+    const TInt KRepeatForever = 0;
+    const TInt KTaskPriority = 1;
+    _LIT(KFotaScheduleExe, "Z:\\sys\\bin\\fotaschedulehandler.exe");
+    RScheduler                              sc;
+    TTime                                   t; 
+    TTsTime                                 time;
+    TSchedulerItemRef                       scitem; 
+    CArrayFixFlat<TScheduleEntryInfo2>*     scentries = new CArrayFixFlat <TScheduleEntryInfo2>(5);
+    User::LeaveIfError( sc.Connect() );                                       // xx
+    CleanupClosePushL( sc );
+    CleanupStack::PushL(scentries );
+    t.HomeTime(); 
+    switch (aIntervalType)  //create schedule based on the interval type 
+        {
+        case EHourly :
+            t = t + ((TTimeIntervalHours)aInterval);
+            break;
+        case EDaily  :
+            t = t + ((TTimeIntervalDays) aInterval);
+            break;
+        case EMonthly :
+            t = t + ((TTimeIntervalMinutes ) aInterval);
+            break; 
+        case EYearly  :
+            t = t + ((TTimeIntervalYears ) aInterval);
+            break;
+		case EEndKeyReminder:
+                        aIntervalType = (TIntervalType)EHourly;  
+                        t = t + ((TTimeIntervalMinutes)aInterval);
+                        break;
+        default :
+            User::Panic(KFotaPanic, KErrArgument);
+
+        }  
+
+    time.SetLocalTime( t );
+    TScheduleEntryInfo2 scentry1(time, aIntervalType, aInterval, (TTimeIntervalMinutes)1440 ) ; // xx
+    scentries->AppendL( scentry1 );
+
+    scitem.iName = TUid::Uid(KFotaServerUid).Name();
+    User::LeaveIfError( sc.Register(TFileName( KFotaScheduleExe ), 0 ) );    // xxx
+    User::LeaveIfError( sc.CreatePersistentSchedule(scitem, *scentries) );   // xxx
+    FLOG(_L("created schedule %d  %d:%d"),scitem.iHandle, t.DateTime().Hour(),t.DateTime().Minute() );
+    TTaskInfo taskInfo;
+    taskInfo.iName      = TUid::Uid(KFotaServerUid).Name();
+    taskInfo.iRepeat    = KRepeatForever;
+    taskInfo.iPriority  = KTaskPriority;
+
+    TFotaScheduledUpdate fotareminder( aPackageId, scitem.iHandle );
+    TPckg<TFotaScheduledUpdate>   fotareminderpkg(fotareminder);
+
+    HBufC* data = HBufC::NewLC(fotareminderpkg.Length());
+    data->Des().Copy(fotareminderpkg);
+
+    User::LeaveIfError( sc.ScheduleTask(taskInfo, *data, scitem.iHandle) );  // xxx
+
+    CleanupStack::PopAndDestroy( data );
+    CleanupStack::PopAndDestroy( scentries );
+    CleanupStack::PopAndDestroy(&sc);                                         // xx
+    return scitem.iHandle;
+	}
+// --------------------------------------------------------------------------
+// CFotaUpdate::CheckUpdateVariations
+// Checks the Install update note display,when a phone call is active
+// --------------------------------------------------------------------------
+//
+TBool CFotaUpdate::CheckUpdateVariations()
+    {
+    FLOG(_L("CFotaUpdate::CheckUpdateVariations >>"));
+    CRepository* centrep( NULL);
+    TRAPD(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+    if (err) FLOG(_L("Error reading FotaServer cenrep... %d"),err);
+    TInt supported(KErrNone);
+    if (centrep ) 
+        {
+        err = centrep->Get( KFotaUpdateNoteDisplayAlways, supported );
+        if (err) FLOG(_L("Error reading cenrep key... %d"),err);                
+        delete centrep;
+        centrep = NULL;
+        }
+    if(supported) //means note to be displayed when a call is active
+        {
+        return EFalse;
+        }
+    FLOG(_L("CFotaUpdate::CheckUpdateVariations <<"));
+    return ETrue; //means note should not be displayed when a call is there
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/BWINS/fotadiskstorageu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/data/102072C6.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+
+//  INCLUDES
+#include "registryinfo.rh"
+
+//  CONSTANTS  
+
+//  MACROS  
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ICL codec registeration file for codec selection using ECom and ICL resolver.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x102072C6;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x10207384;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10207385;
+                    version_no = 1;
+                    display_name = "Fota storage";
+                    default_data = "";
+                    opaque_data =  "";
+                    }  
+                };
+            }
+        };
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/group/fotadiskstorage.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project fotadiskstorage
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+//MACRO  _FOTA_DEBUG
+//MACRO  _FOTA_DEBUG_RDEBUG
+
+
+TARGET      fotadiskstorage.dll
+
+TARGETTYPE PLUGIN
+
+// MAGIC Dll recognition UID to support ECom.
+UID 0x10009D8D 0x102072C6
+
+CAPABILITY CAP_ECOM_PLUGIN
+
+VENDORID VID_DEFAULT
+
+SOURCEPATH  ../src
+SOURCE      fotaDiskStorage.cpp
+
+SOURCEPATH  ../data
+START RESOURCE 102072C6.rss
+TARGET fotadiskstorage.rsc
+LANGUAGE_IDS
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+USERINCLUDE     ../../cenrep
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/icl
+SYSTEMINCLUDE   /epoc32/include/libc
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY			euser.lib
+LIBRARY			fbscli.lib
+LIBRARY			bafl.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+LIBRARY			centralrepository.lib
+LIBRARY			flogger.lib
+LIBRARY			sysutil.lib
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/group/fotastorage.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005-2006 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:   xxxxxx
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET      fotastorage.dll
+
+TARGETTYPE PLUGIN
+
+// MAGIC Dll recognition UID to support ECom.
+UID 0x10009D8D 0x102072C6
+
+CAPABILITY CAP_ECOM_PLUGIN
+
+VENDORID VID_DEFAULT
+
+SOURCEPATH  ../src
+// SOURCE      fotastorage.cpp
+//SOURCE      fotadiskstorage.cpp
+
+SOURCEPATH  ../data
+START RESOURCE 102072C6.rss
+TARGET fotastorage.rsc
+LANGUAGE_IDS
+END
+
+USERINCLUDE     ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/icl
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY			euser.lib
+LIBRARY			fbscli.lib
+LIBRARY			bafl.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/inc/fotaDiskStorage.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+#ifndef __FOTADISKSTORAGE_H_
+#define __FOTADISKSTORAGE_H_
+
+#include <s32file.h>
+
+
+#include "fotastorage.h"
+
+
+// CONSTANTTS
+// const TInt KDummyFileSize(2000000);   // total of 2MB should be reserved for fota pkgs
+
+#ifndef _FOTA_UNIT_TESTER
+_LIT( KDummyFilePath, "c:\\private\\102072C4\\" );
+#else
+_LIT( KDummyFilePath, "c:\\private\\10009cf4\\" );
+#endif 
+_LIT( KDummyFileName, "reserved");  // dummy file name 
+
+
+const TInt KFileReservationDefaultSize ( 5000000);
+const TInt KFileChunkDefaultSize ( 120000 );
+
+/*
+* Implementation of fotastorage. This implementation
+* directly stores the update package to user disk. 
+* Private directory of the calling process will be used
+* for storage.
+*/
+
+class CFotaDiskStorage : public CFotaStorage
+{
+    public:
+
+    /**
+     * NewL
+     * @since   S60   v3.1
+     * @param   none
+     * @return  New instance
+     */
+      static CFotaDiskStorage* NewL();
+
+
+    /**
+     * Two phase Constructor
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+		void ConstructL();
+     
+    // From base classes
+
+    /**
+     * Two phase Constructor
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+		TInt AdjustDummyStorageL();
+
+    /**
+     * Opens stream to package file
+     * @since   S60   v3.1
+     * @param   pkgid	Package id
+     * @param   aPkgStore	Stream to the file
+     * @return  err
+     */
+    TInt OpenUpdatePackageStoreL(const TInt aPkgId,TInt aNewDummySize
+                                  , RWriteStream*& aPkgStore);
+
+    /**
+     * Gets the update package size
+     * @since   S60   v3.2
+     * @param   aPkgid	Package id
+     * @param   aSize	Size in bytes
+     * @return  None
+     */
+
+     void GetDownloadedUpdatePackageSizeL(const TInt aPkgid, TInt& aSize);
+
+
+    /**
+     * Closes stream to package file
+     * @since   S60   v3.1
+     * @param   pkgid	Package id
+     * @return  none
+     */
+		void UpdatePackageDownloadCompleteL(const TInt aPkgId);
+
+    /**
+     * Gets path to package
+     * @since   S60   v3.1
+     * @param   pkgid	Package id
+     * @param   aPath	path to file
+     * @return  none
+     */
+		void GetUpdatePackageLocationL(const TInt aPkgId, TDes8& aPath );
+
+
+    /**
+     * Gets present packages
+     * @since   S60   v3.1
+     * @param   aPackageIdList	List of package ids
+     * @return  none
+     */
+		void GetUpdatePackageIdsL(TDes16& aPackageIdList);
+
+
+    /**
+     * Checks if there is space for pkg. If not (doesnt fit to filesystem)
+     * returns needed space in aSize.
+     * @since   S60   v3.1
+     * @param   aSize		Space of pkg. On return, needed space.
+     * @return  Whether there's free space
+     */
+		TFreeSpace IsPackageStoreSizeAvailableL(TInt& aSize);
+
+
+    /**
+     * Deletes update package
+     * returns needed space in aSize.
+     * @since   S60   v3.1
+     * @param   apPkgid Package id
+     * @return  none
+     */
+		void  DeleteUpdatePackageL (const TInt aPkgId);
+
+
+
+    /**
+     * Destructor
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+		virtual ~CFotaDiskStorage ();
+		
+public:
+
+
+    /**
+     * Stream to pkg file
+     */
+		RFileWriteStream    iFileWriteStream;
+
+
+    /**
+     * File server session
+     */
+		RFs                 iFs;
+
+    /**
+     * Size of reservation file. Configured via cenrep.
+     */
+		TInt                iDummySize;
+
+
+
+    /**
+     * Size of chunk used to separate update package file content from
+     * reservation file.
+     */
+		TInt                iChunkSize;
+
+private: // new functions
+
+
+    /**
+     * Constructor
+     * @since   S60   v3.1
+     * @param   none
+     * @return  none
+     */
+    CFotaDiskStorage ();
+
+
+    /**
+     * Deletes the update package so that total space reservation file
+     * stays the same (ie 5MB). 
+     * @since   S60   v3.1
+     * @param 	dummy Handle to reservation file
+     * @param   aPkgId package file to be deleted
+     * @param   aAlreadyAllocated Already allocated bytes by other pkg files
+     * @return  none
+     */
+    void DoDeleteUpdatePackageL ( RFile& dummy, TInt aPkgId
+                                      , TInt aAlreadyAllocated=0);
+
+
+    /**
+     * Checks how much space is allocated by package files
+     * @since   S60   v3.1
+     * @param 	aSwupdSize Size allocated by package files
+     * @param   aDummySize Size allocated by reservation file
+     * @return  none
+     */
+     void SpaceAllocatedBySWUPDFilesL( TInt& aSwupdSize, TInt& aDummySize);
+
+};
+
+
+#endif //__FOTADISKSTORAGE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/inc/fotadebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   This file defines logging macros 
+*
+*/
+
+
+
+#ifndef FOTADEBUG_H
+#define FOTADEBUG_H
+
+    // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
+    #ifdef _FOTA_DEBUG
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "fotadiskstorage.log" );
+        _LIT( KLogDirFullName, "c:\\logs\\" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+#endif      // FOTADEBUG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/src/fotaDiskStorage.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,545 @@
+/*
+* Copyright (c) 2005-2006 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:   stores update package to filesystem
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <ecom.h>
+#include <implementationproxy.h>
+#include <centralrepository.h>
+#include <sysutil.h> 
+#include "fotadiskstoragePrivateCRKeys.h"
+#include "fotaDiskStorage.h"
+#include "fotadebug.h"
+
+// CONSTANTS
+// System Critical Level (128KB) plus 5KB for fota operations.
+const TInt KSystemCriticalWorkingspace = 136192;
+
+// MACROS
+#ifdef __EABI__
+#ifndef IMPLEMENTATION_PROXY_ENTRY
+typedef TAny*   TProxyNewLPtr;
+#define IMPLEMENTATION_PROXY_ENTRY(aUid, aFuncPtr) {{aUid},(TProxyNewLPtr)(aFuncPtr)}
+#endif
+#endif
+
+// ============================ MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::CFotaDiskStorage()
+// ---------------------------------------------------------------------------
+//
+CFotaDiskStorage::CFotaDiskStorage ()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::NewL()
+// ---------------------------------------------------------------------------
+//
+CFotaDiskStorage* CFotaDiskStorage::NewL()
+    {
+    FLOG(_L("CFotaDiskStorage::NewL()"));
+    CFotaDiskStorage* self = new ( ELeave ) CFotaDiskStorage;
+    FLOG(_L("  CFotaDiskStorage created at %X "), self);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::ConstructL() 
+// ---------------------------------------------------------------------------
+//
+void CFotaDiskStorage::ConstructL() 
+    {
+    FLOG(_L("CFotaDiskStorage::ConstructL() >>"));
+    TInt err;
+    User::LeaveIfError ( iFs.Connect() );
+
+    // Ensures that fotaserver private dir exists
+    err = iFs.MkDirAll(KDummyFilePath);
+    if ( err!=KErrAlreadyExists && err != KErrNone )
+        {
+        FLOG(_L(" created priv dir err %d"),err);
+        User::Leave ( err ) ;
+        }
+    FLOG(_L("CFotaDiskStorage::ConstructL()  sessionpath to %S")
+                        , &KDummyFilePath,err);
+    User::LeaveIfError ( iFs.SetSessionPath ( KDummyFilePath ) );
+
+    // newdummy remains should not exist now. safety.
+    err = iFs.Delete ( _L("newdummy") ) ;
+    if ( err!=KErrNone && err!= KErrNotFound ) User::Leave (err);
+
+    // Get write limit 
+    TInt writelimit( KFileReservationDefaultSize );
+    TInt chunksize ( iChunkSize );
+    CRepository* centrep( NULL);
+    TRAP(err, centrep = CRepository::NewL( KCRUidFotaDiskStorage ) );
+    if ( centrep ) 
+        {
+        err = centrep->Get( KFotaDiskSpaceReservationKey, writelimit );
+        err = centrep->Get( KFotaDiskSpaceReservationChunkKey, chunksize );
+        }
+    iDummySize = writelimit;
+    iChunkSize = chunksize;
+    delete centrep;
+
+    AdjustDummyStorageL();
+    FLOG(_L("CFotaDiskStorage::ConstructL() <<"));
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::~CFotaDiskStorage ()
+// ---------------------------------------------------------------------------
+//
+CFotaDiskStorage::~CFotaDiskStorage ()
+    {
+    FLOG(_L("CFotaDiskStorage::~CFotaDiskStorage ()"));
+    iFileWriteStream.Close();
+    iFs.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::IsPackageStoreSizeAvailableL
+// does the pkg fit to reservation or filesystem
+// ---------------------------------------------------------------------------
+//
+CFotaStorage::TFreeSpace CFotaDiskStorage::IsPackageStoreSizeAvailableL(TInt& aSize)
+    {
+    CFotaStorage::TFreeSpace isavailable;
+    TInt            swupdSize(0);
+    TInt            dummySize(0);
+    SpaceAllocatedBySWUPDFilesL( swupdSize, dummySize);
+
+    if ( aSize <= dummySize ) 
+        {        
+        // fits to reservation
+        isavailable = CFotaStorage::EFitsToReservation;
+        }
+    else
+        {
+        // doesnt fit to reservation, does it fit to filesystem?
+        TInt sizeNeededFromFS = aSize - dummySize ;
+        if ( sizeNeededFromFS < 0 ) sizeNeededFromFS = 0;
+        TBool critical = SysUtil::FFSSpaceBelowCriticalLevelL( &iFs, sizeNeededFromFS );
+        if ( critical )
+        	{
+					// how much space would be needed
+					TVolumeInfo vi;
+        	iFs.Volume(vi,EDriveC);
+        	
+					TInt neededspace = sizeNeededFromFS - vi.iFree + KSystemCriticalWorkingspace;
+					FLOG(_L("neededspace = %d vi.iFree = %d "), neededspace , vi.iFree);		
+					FLOG(_L(" neededspace = sizeNeededFromFS - vi.iFree + KSystemCriticalWorkingspace;") );
+        	//= aSize - vi.iFree;
+        	aSize = neededspace;
+        	isavailable = CFotaStorage::EDoesntFitToFileSystem;
+        	}
+        else
+        	{
+					isavailable = CFotaStorage::EFitsToFileSystem;
+        	}
+        }
+        TInt fitstodummy = isavailable==CFotaStorage::EFitsToReservation?1:0 ;
+        TInt fitstoFS = isavailable==CFotaStorage::EFitsToFileSystem?1:0 ;
+        TInt DoesntFitToFS = 	isavailable==CFotaStorage::EDoesntFitToFileSystem?1:0 ; 
+        	
+    FLOG(_L("CFotaDiskStorage::IsPackageStoreSizeAvailableL %d<%d (sz vs dummy) => fitstodummy:%d fitstoFS:%d DoesntFitToFS:%d")
+        ,aSize,dummySize,fitstodummy,fitstoFS,DoesntFitToFS );
+
+    return isavailable;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::AdjustDummyStorageL()
+// Ensure that total of iDummySize bytes are reserved by .swupd files and 
+// dummy file.
+// ---------------------------------------------------------------------------
+//
+TInt CFotaDiskStorage::AdjustDummyStorageL  ( )
+    {
+    FLOG(_L("CFotaDiskStorage::AdjustDummyStorageL >>"));
+    // Count size reserved by .swupd files
+    // CDir*       list;
+    TInt        err;
+    TInt        swupdSize(0);
+    TInt        dummySize(0);
+    RFile       dummy;
+
+    TRAP(err,SpaceAllocatedBySWUPDFilesL( swupdSize, dummySize));
+
+    // Calculate space for dummy file
+    TInt targetsize = iDummySize - swupdSize;
+    if ( targetsize<0 ) 
+        {
+        targetsize=0;
+        }
+
+    // Reduce dummy file size 
+    if ( dummySize != targetsize || dummySize ==0 ) 
+        {
+        FLOG(_L("   dummy new size %d (old %d)"), targetsize,dummySize);
+
+        err = dummy.Open(iFs, KDummyFileName, EFileWrite|EFileShareExclusive);
+
+        if (err == KErrNotFound ) 
+            {
+            User::LeaveIfError(dummy.Replace(iFs, KDummyFileName
+                                , EFileWrite|EFileShareExclusive)); 
+            }
+        else
+            if ( err!=KErrNone) User::LeaveIfError (err);
+
+        CleanupClosePushL(dummy);
+        TInt err= dummy.SetSize (targetsize);
+        if (err!=KErrNone)
+        	{
+        	FLOG(_L("Error while creating reserved space:  %d "),err );
+        	}
+        CleanupStack::PopAndDestroy(1); // dummy
+        }
+    FLOG(_L("CFotaDiskStorage::AdjustDummyStorageL, reserved file size = %d <<"),targetsize);
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::OpenUpdatePackageStore
+// Open upd pkg store for writing (writes to dummy file).
+// ---------------------------------------------------------------------------
+TInt CFotaDiskStorage::OpenUpdatePackageStoreL(const TInt aPkgId,TInt aNewDummySize
+                                                , RWriteStream*& aPkgStore)
+	{
+    FLOG(_L("CFotaDiskStorage::OpenUpdatePackageStore"));
+    TInt        err (KErrNone);
+
+    // Remove reserved memory
+    RFile tmp;
+    err = tmp.Open(iFs, KDummyFileName, EFileWrite|EFileShareExclusive);
+    CleanupClosePushL(tmp);
+    if ( !err )
+    	{
+        FLOG(_L("Removing the reserved memory as download has started"), iDummySize);
+        tmp.SetSize( KErrNone );
+        }
+    CleanupStack::PopAndDestroy( &tmp ); 
+	// flexible mem handling: increase dummy size to receive over sized package
+    if (iDummySize < aNewDummySize)
+    	iDummySize = aNewDummySize;
+    FLOG(_L("Newer dummy size = %d"),iDummySize);
+
+    TBuf<KMaxFileName>    swupd;
+
+    swupd.AppendNum(aPkgId);
+    swupd.Append(_L(".swupd"));
+    err = iFileWriteStream.Open(iFs, swupd, EFileWrite) ;
+    if (err == KErrNotFound ) 
+        {
+        User::LeaveIfError(iFileWriteStream.Replace(iFs, swupd
+                                                            , EFileWrite));
+        }
+    else
+        if ( err!=KErrNone) User::LeaveIfError (err);
+
+    //Positioning the seek if the file is already present (in case of resume)
+	TEntry entry;
+	TInt size (KErrNone);
+	err = iFs.Entry(swupd,entry);
+	if (!err)
+		size = entry.iSize; 
+	if (size)
+		{
+	    MStreamBuf* x = iFileWriteStream.Sink();
+	    TStreamPos pos(0);
+	    TRAPD(err2, pos = x->TellL(MStreamBuf::EWrite));
+	    
+	    pos+=size;
+	    TRAP(err2, x->SeekL(MStreamBuf::EWrite,pos ));
+		}
+    aPkgStore = &iFileWriteStream;
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::GetDownloadedUpdatePackageSizeL
+// Gets the downloaded update package size in bytes
+// ---------------------------------------------------------------------------
+
+void CFotaDiskStorage::GetDownloadedUpdatePackageSizeL(const TInt aPkgId, TInt& aSize)
+	{
+	FLOG(_L("CFotaDiskStorage::GetDownloadedUpdatePackageSizeL >>"));
+	aSize = 0;
+
+    TBuf<KMaxFileName>    swupd;
+
+    swupd.AppendNum(aPkgId);
+    swupd.Append(_L(".swupd"));
+
+	TInt err(KErrNone);
+	TEntry entry;
+	err = iFs.Entry(swupd,entry);
+	if (!err)
+	aSize = entry.iSize; 
+	FLOG(_L("CFotaDiskStorage::GetDownloadedUpdatePackageSizeL,err = %d, aSize = %d <<"),err, aSize);
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::UpdatePackageDownloadComplete
+// closes the stream and frees resources
+// ---------------------------------------------------------------------------
+void CFotaDiskStorage::UpdatePackageDownloadCompleteL(const TInt aPkgId)
+    {
+    FLOG(_L("CFotaDiskStorage::UpdatePackageDownloadComplete(const TInt aPkgId)"));
+    RFile       fswupd;
+    TBuf<KMaxFileName>    fn;
+    TInt        err;
+    iFileWriteStream.Close();
+    if(iBytesWritten<1) 
+        {
+        FLOG(_L("  no bytes received!"));
+//        User::Leave(KErrNotFound);
+        return;
+        }
+    TBuf<KMaxFileName>    swupd;
+
+    swupd.AppendNum(aPkgId);
+    swupd.Append(_L(".swupd"));
+
+    // open swupd file for reading
+    err = fswupd.Open(iFs, swupd, EFileWrite|EFileShareExclusive);
+    FLOG(_L("  open err %d"),err);
+    if (err == KErrNotFound ) 
+        {
+        FLOG(_L("swupd not found, creaeting"));
+        User::LeaveIfError(fswupd.Replace(iFs, swupd
+                                        ,EFileWrite|EFileShareExclusive)); 
+        }
+    else
+        if ( err!=KErrNone) User::LeaveIfError (err);
+    CleanupClosePushL(fswupd);
+
+    RFile       ND;
+    User::LeaveIfError ( ND.Replace ( iFs, KDummyFileName, EFileWrite ) );
+    CleanupClosePushL  ( ND);
+    CleanupStack::PopAndDestroy(2); // dummies
+    AdjustDummyStorageL();
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::GetUpdatePackageLocation
+// Gets update package location, that is , path.
+// ---------------------------------------------------------------------------
+void CFotaDiskStorage::GetUpdatePackageLocationL(const TInt aPkgId
+                                                        , TDes8& aPath )
+{
+    TBuf8<20> fn;
+    fn.AppendNum(aPkgId);
+    fn.Append(_L8(".swupd"));
+    TInt pathlength = ((TDesC16)KDummyFilePath).Length();
+    HBufC8* path = HBufC8::NewLC( pathlength );
+    path->Des().Copy( KDummyFilePath );
+
+    aPath.Append( path->Des() );
+    aPath.Append(fn);
+    CleanupStack::PopAndDestroy( path );
+}
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::GetUpdatePackageIds
+// getupdate package ids
+// ---------------------------------------------------------------------------
+void CFotaDiskStorage::GetUpdatePackageIdsL(TDes16& aPackageIdList)
+    {
+    FLOG(_L("CFotaDiskStorage::GetUpdatePackageIds"));
+    // Read all .swupd files and parse pkg ids from filenames
+    TInt err;
+    CDir*   list;
+    err=iFs.GetDir (_L("*.swupd"), KEntryAttNormal ,ESortByName, list  );
+    for(int i=0; i<list->Count() ;++i )
+        {
+        TEntry t = (*list)[i];
+        TParse  p;
+        TInt16  pkgid;
+        p.Set(t.iName,NULL,NULL);
+        TLex    lex(p.Name());
+        err = lex.Val(pkgid);
+        FLOG(_L("   %S"),&t.iName);
+        if(err==KErrNone)
+            {
+            TPtrC  filename(p.Name());
+            FLOG(_L("  pkig found: %d"), pkgid);
+            TDateTime d = t.iModified.DateTime();
+            aPackageIdList.Append (pkgid);   
+            }
+        }
+    delete list;
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::DeleteUpdatePackageL 
+// ---------------------------------------------------------------------------
+void  CFotaDiskStorage::DeleteUpdatePackageL (const TInt aPkgId)
+    {
+    FLOG(_L("CFotaDiskStorage::DeleteUpdatePackageL %d >>"),aPkgId);
+    RFile       dummy;
+    TInt err=    dummy.Open(iFs, KDummyFileName , EFileWrite|EFileShareExclusive);
+    FLOG(_L("Error opening the reserved file...%d"),err);
+    CleanupClosePushL ( dummy );
+    TRAP(err, DoDeleteUpdatePackageL ( dummy, aPkgId, 0 ));
+    CleanupStack::PopAndDestroy(1);
+    AdjustDummyStorageL();
+
+    FLOG(_L("CFotaDiskStorage::DeleteUpdatePackageL %d, err = %d <<"),aPkgId, err);
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::DoDeleteUpdatePackageL 
+// Delete swupd by chunking data to dummy (param) file. Will grow dummy 
+// independently, but takes already allocated bytes into account.
+// ---------------------------------------------------------------------------
+void  CFotaDiskStorage::DoDeleteUpdatePackageL ( RFile& dummy, TInt aPkgId
+                                                    , TInt aAlreadyAllocated)
+    {
+    // Open swupd file 
+    TInt      err;
+    TBuf8<KMaxFileName> swupdpath;
+    TBuf<KMaxFileName>  swupdpath16;
+    GetUpdatePackageLocationL ( aPkgId, swupdpath) ;
+    swupdpath16.Copy ( swupdpath );
+    RFile       swupd;
+    err = swupd.Open( iFs, swupdpath16, EFileWrite );
+    if ( err == KErrNotFound )      return; // no need to delete
+    if ( err != KErrNone )          User::Leave ( err );
+    CleanupClosePushL ( swupd );
+
+    // Reduce dummy size
+    TInt dummytargetsize = iDummySize - aAlreadyAllocated;
+    for ( TInt p=0; p<10000 ; ++p )
+        {
+        TInt        dsize;
+        TInt        swupdsize(0);
+        User::LeaveIfError( dummy.Size( dsize ) );
+        User::LeaveIfError( swupd.Size( swupdsize) );
+        TInt        chunk =  swupdsize > iChunkSize ? iChunkSize : swupdsize;
+
+        // Ensure that dummy dosnt get oversized
+        if ( dsize <= dummytargetsize  && dsize + chunk >= dummytargetsize ) 
+                    chunk = dummytargetsize - dsize;
+
+        // Safety
+        if ( dsize >= dummytargetsize ) break;
+
+        FLOG(_L("  deleting swupd:  dummy %d\t  swupd %d\t chunk%d"),dsize
+                                                ,swupdsize,chunk);
+        if (chunk>0)
+            {
+            User::LeaveIfError( dummy.SetSize( dsize + chunk ) );
+            User::LeaveIfError( swupd.SetSize( swupdsize - chunk ) );
+            }
+        else 
+            break;
+        }
+    CleanupStack::PopAndDestroy(1); // swupd 
+
+    // Delete swupd  (dummy file is big enough now)
+    err = iFs.Delete ( swupdpath16 ) ;
+    FLOG(_L("CFotaDiskStorage::DoDeleteUpdatePackageL deleted ,err %d"),err);
+    if ( err != KErrNone && err != KErrNotFound ) 
+        {
+        User::Leave ( err );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaDiskStorage::SpaceAllocatedBySWUPDFilesL
+// Counts space allocated by swupd files
+// ---------------------------------------------------------------------------
+void CFotaDiskStorage::SpaceAllocatedBySWUPDFilesL( TInt& aSwupdSize, TInt& aDummySize )
+    {
+    CDir*       list;
+    TInt        err;
+    // TInt        (0);
+    aSwupdSize = 0;
+    aDummySize = 0;
+    err = iFs.GetDir (_L("*.swupd"), KEntryAttNormal ,ESortByName, list );
+    User::LeaveIfError(err);
+    CleanupStack::PushL ( list );
+    
+    // get sizes of swupd files
+    for(int i=0; i<list->Count() ;++i )
+        {
+        TEntry t = (*list)[i];
+        TParse  p;
+        TInt16  pkgid;
+        
+        p.Set(t.iName,NULL,NULL);
+        TLex    lex(p.Name());
+        err = lex.Val(pkgid);
+        if(err==KErrNone)
+            {
+            TPtrC  filename(p.Name());
+            aSwupdSize += t.iSize;
+            }
+        }
+    CleanupStack::PopAndDestroy( list );
+
+    // get size of dummyfile
+    err = iFs.GetDir (KDummyFileName, KEntryAttNormal ,ESortByName, list );
+    User::LeaveIfError(err);
+    CleanupStack::PushL ( list );
+    if ( list->Count() >0 )
+        {
+        TEntry t = (*list)[0];
+        aDummySize = t.iSize;
+        }
+    CleanupStack::PopAndDestroy( list );
+    FLOG(_L("CFotaDiskStorage::SpaceAllocatedBySWUPDFilesL dummy:%d swupd:%d")
+                        ,aDummySize,aSwupdSize);
+    }        
+
+// ---------------------------------------------------------------------------
+// Global implementation uid array
+// Define the Implementation UIDs for JP2K decoder.
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+{
+    // implementation_uid
+    IMPLEMENTATION_PROXY_ENTRY( 0x10207385 , CFotaDiskStorage::NewL )
+};
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy Implements proxy interface for ECom
+// Exported proxy for instantiation method resolution.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(  //lint !e714 Used by ECom
+    TInt& aTableCount ) // Number of tables 
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( 
+                                                        TImplementationProxy );
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/FotaStorage/src/fotastorage.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2006 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:   stores update package to filesystem
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <ECom.h>
+#include <ImplementationProxy.h>
+
+#include "fotastorage.hrh"
+#include "fotastorage.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CFotaStorage::CFotaStorage() 
+// -----------------------------------------------------------------------------
+//
+
+EXPORT_C CFotaStorage::CFotaStorage() : iBytesWritten(0)
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CFotaStorage::~CFotaStorage ()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFotaStorage::~CFotaStorage ()
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/cenrep/fotadiskstoragePrivateCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* 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:   fotadiskstorage's cenrep keys
+*
+*/
+
+
+
+#ifndef FOTADISKSTORAGE_PRIVATE_KEYS_H
+#define FOTADISKSTORAGE_PRIVATE_KEYS_H
+
+// CONSTANTS
+
+// fotadiskstorage key UID
+const TUid KCRUidFotaDiskStorage = { 0x102072C6 };
+
+// How much space should be reserved for firmware update package
+const TUint32 KFotaDiskSpaceReservationKey = 0x00000001;
+
+// In how large blocks fw update pkg should be moved
+const TUint32 KFotaDiskSpaceReservationChunkKey = 0x00000002;
+
+
+#endif // FOTADISKSTORAGE_PRIVATE_KEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/cenrep/fotaserverPrivateCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* 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:   	CR keys for fotaserver
+*
+*/
+
+
+
+#ifndef FOTASERVER_PRIVATE_KEYS_H
+#define FOTASERVER_PRIVATE_KEYS_H
+
+// CONSTANTS
+
+// FS key UID
+const TUid KCRUidFotaServer = { 0x102072C4 };
+
+// Device manager key UID
+const TUid KPSUidNSmlDMSyncApp = {0x101f6de5};
+// Whether update agent should be simulated by FS
+const TUint32 KSimulateUpdateAgent = 0x00000001;
+
+// DM UI Silent feature variation
+const TUint32 KSilentOmaDlUIBehavior = 0x00000002;
+
+//Flag to enable/disable the  feature ,.."Send Generic alert after device reboots"
+//Allowed values   1  , 0 
+const TUint32 KGenericAlertResendAfterBoot = 0x00000003;
+
+//Flag to configure number of retries for sending GA in failure cases.
+
+const TUint32 KGenericAlertRetries = 0x00000004;
+
+//Determines state of fota update.
+//0 - Default , no action taken. 
+//1 - Firmware update/GA 
+//2. Download Interrupted
+
+const TUint32 KFotaUpdateState   = 0x00000005;
+
+//Determines whether the Fota Suspend and Resume Feature is supported or not.
+//0 (default) - Feature OFF 
+//1   - Feature ON
+
+const TUint32 KSuspendResumeFeatureSupported = 0x00000006;
+
+//Determines whether the Fota Monitory Service is enabled or not.
+//0 (default ) - Feature OFF
+//1   - Feature ON
+
+const TUint32  KFotaMonitoryServiceEnabled = 0x00000007;
+
+//This key is to configure  the reminder options .
+//Format :
+//1h:4h:1d:3m:NROFF
+//h - hour/s. 
+//d- day/s
+//m - minute/s
+//":" Is the separator.
+//Currently only first 4 options are read to show reminder duration.
+//5th option can have value NROFF which means that "No reminder" option  will not be shown.
+//if 5th option has any other value other than NROFF , "No reminder" option will be shown
+//Default value : NULL.  Which means current options  1h:4h:1d:3d are taken 
+//into consideration along with No Reminder option.
+
+const TUint32 KFotaOptionsForReminderDuration = 0x00000008;
+
+//This key is to enable feature to reset the timer after device reboot  .
+//If value is 0 : Feature is OFF. - Default value
+//If value is 1  : Feature is ON.
+//Any other value its feature OFF
+//If feature is ON then if there was a reminder  set once 
+//device reboots timer should be reset and note to install Firmware update is shown .
+
+const TUint32 KFotaReminderTimerReset = 0x00000009;
+//This key is to enable feature to reset the timer after device reboot  .
+//If value is 0 :  Dynamo charger
+//If value is 1  : USB charger
+//Any other value its feature OFF
+
+const TUint32 KFotaUSBChargerEnabled  = 0x0000000A; 
+
+//This key stores the drive id to encrypt after update.
+const TUint32 KDriveToEncrypt  = 0x0000000B;
+
+//Determines whether FOTA Install Update note to be displayed or not,
+//when a phone call is active
+//0 (default) - Install update note not displayed when a call is active 
+//1   - Install update note will be displayed when a call is active
+const TUint32 KFotaUpdateNoteDisplayAlways= 0x0000000C;
+
+/*
+* This key is used to determine the maximum number of postpones allowed for a FOTA Update.
+* Default value : 3
+*/
+
+const TUint32 KFOTAMaxPostponeCount = 0x0000000D; 
+
+
+/*
+* This key is used to determine the number of postpones done by the user for a particular FOTA Update.
+* Default value : 0
+*/
+
+const TUint32 KFOTAUserPostponeCount = 0x0000000E; 
+
+
+/*
+* This flag defines if the feature to enable  the customized UI notes for interacttrive and note between firware install and update.
+* Default value : 0
+*/
+
+const TUint32 KFOTAUINotesCustomization = 0x0000000F; 
+
+#endif // FOTASERVER_PRIVATE_KEYS_H
+            
+// End of File
Binary file fotaapplication/fotaserver/cenrep/keys_fotadiskstorage.xls has changed
Binary file fotaapplication/fotaserver/cenrep/keys_fotaserver.xls has changed
Binary file fotaapplication/fotaserver/conf/fotadiskstorage.confml has changed
Binary file fotaapplication/fotaserver/conf/fotadiskstorage_102072C6.crml has changed
Binary file fotaapplication/fotaserver/conf/fotaserver.confml has changed
Binary file fotaapplication/fotaserver/conf/fotaserver_102072C4.crml has changed
--- a/fotaapplication/fotaserver/data/fullscreendialog.docml	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.1">
-    <widget name="dialog" type="HbDialog">
-        <size height="expr(var(hb-param-screen-height)-(var(hb-param-margin-gene-screen)*2  )  )" name="size" width="expr(var(hb-param-screen-width)-(var(hb-param-margin-gene-screen)*2   ) )"/>
-        <rect height="var(hb-param-screen-height)" name="geometry" width="var(hb-param-screen-width)" x="2un" y="2un"/>
-        <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-        <sizehint height="expr(var(hb-param-screen-height) -2*var(hb-param-margin-gene-screen) )" type="PREFERRED" width="expr(var(hb-param-screen-width) - 2*var(hb-param-margin-gene-screen) )"/>
-        <sizehint height="expr(var(hb-param-screen-height) - 2*var(hb-param-margin-gene-screen))" type="MINIMUM" width="expr(var(hb-param-screen-width) -2*var(hb-param-margin-gene-screen) )"/>
-        <sizehint height="expr(var(hb-param-screen-height) - 2*var(hb-param-margin-gene-screen) )" type="MAXIMUM" width="expr(var(hb-param-screen-width) - 2*var(hb-param-margin-gene-screen) )"/>
-        <enums name="dismissPolicy" value="NoDismiss"/>
-        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
-            <widget name="container_4" type="HbWidget">
-                <widget name="lblTitle" type="HbLabel">
-                    <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-                    <string name="plainText" value="Updating phone"/>
-                </widget>
-                <widget name="lblSwVersion" type="HbLabel">
-                    <enums name="textWrapping" value="TextWordWrap"/>
-                    <string name="plainText" value="New device software version available [ size and version ]"/>
-                </widget>
-                <widget name="horizontalProgressBar" type="HbProgressBar">
-                    <integer name="progressValue" value="30"/>
-                    <bool name="minMaxTextVisible" value="FALSE"/>
-                    <string name="minText"/>
-                    <integer name="minimum" value="0"/>
-                    <enums name="orientation" value="Horizontal"/>
-                    <bool name="invertedAppearance" value="FALSE"/>
-                    <integer name="maximum" value="100"/>
-                    <string name="text"/>
-                </widget>
-                <widget name="lblDownloadState" type="HbLabel">
-                    <string name="plainText" value="Downloading..."/>
-                </widget>
-                <widget name="scrollArea" type="HbScrollArea">
-                    <widget name="container_6" role="HbScrollArea:contents" type="HbWidget">
-                        <widget name="container_5" type="HbWidget">
-                            <widget name="icnCharger" type="HbLabel">
-                                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-                                <icon iconName="qtg_small_smiley_very_cool" name="icon"/>
-                            </widget>
-                            <widget name="lblcharger" type="HbLabel">
-                                <enums name="textWrapping" value="TextWrapAnywhere"/>
-                                <real name="z" value="2"/>
-                                <string name="plainText" value="It is recommmended to connect the charger."/>
-                            </widget>
-                            <real name="z" value="6"/>
-                            <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
-                            <layout orientation="Horizontal" type="linear">
-                                <linearitem itemname="icnCharger"/>
-                                <linearitem itemname="lblcharger"/>
-                            </layout>
-                        </widget>
-                        <widget name="container_3" type="HbWidget">
-                            <widget name="lblRestartNote" type="HbLabel">
-                                <enums name="textWrapping" value="TextWrapAnywhere"/>
-                                <real name="z" value="1"/>
-                                <string name="plainText" value="After the installation the phone will restart."/>
-                            </widget>
-                            <widget name="icnInstall" type="HbLabel">
-                                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-                                <icon iconName="qtg_small_smiley_very_cool" name="icon"/>
-                            </widget>
-                            <real name="z" value="8"/>
-                            <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
-                            <layout orientation="Horizontal" type="linear">
-                                <linearitem itemname="icnInstall"/>
-                                <linearitem itemname="lblRestartNote"/>
-                            </layout>
-                        </widget>
-                        <widget name="container_1" type="HbWidget">
-                            <widget name="icnEmergency" type="HbLabel">
-                                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-                                <icon iconName="qtg_small_smiley_very_cool" name="icon"/>
-                            </widget>
-                            <widget name="lblEmergency" type="HbLabel">
-                                <enums name="textWrapping" value="TextWrapAnywhere"/>
-                                <real name="z" value="1"/>
-                                <string name="plainText" value="During installation phone cannot be used even for emergency."/>
-                            </widget>
-                            <real name="z" value="10"/>
-                            <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
-                            <layout orientation="Horizontal" type="linear">
-                                <linearitem itemname="icnEmergency"/>
-                                <linearitem itemname="lblEmergency"/>
-                            </layout>
-                        </widget>
-                        <widget name="lblinstallnote" type="HbLabel">
-                            <enums name="textWrapping" value="TextWrapAnywhere"/>
-                            <real name="z" value="9"/>
-                            <string name="plainText" value="Installation will proceed now"/>
-                        </widget>
-                        <real name="z" value="1"/>
-                        <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-                        <sizehint height="62.53732un" type="PREFERRED" width="expr(var(hb-param-screen-width) )"/>
-                        <layout orientation="Vertical" type="linear">
-                            <linearitem itemname="lblinstallnote"/>
-                            <linearitem itemname="container_5"/>
-                            <linearitem itemname="container_3"/>
-                            <linearitem itemname="container_1"/>
-                        </layout>
-                    </widget>
-                    <enums name="scrollDirections" value="Vertical"/>
-                    <real name="z" value="4"/>
-                    <sizehint height="14.92537un" type="PREFERRED" width="14.92537un"/>
-                </widget>
-                <widget name="container_2" type="HbWidget">
-                    <widget name="btnHide" type="HbPushButton">
-                        <string name="text" value="Hide"/>
-                        <sizehint type="PREFERRED" width="10un"/>
-                    </widget>
-                    <widget name="btnResumeLater" type="HbPushButton">
-                        <string name="text" value="Resume Later"/>
-                        <sizehint type="PREFERRED" width="10un"/>
-                    </widget>
-                    <real name="z" value="5"/>
-                    <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-                    <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
-                    <layout orientation="Horizontal" type="linear">
-                        <linearitem itemname="btnHide"/>
-                        <linearitem itemname="btnResumeLater"/>
-                    </layout>
-                </widget>
-                <real name="z" value="3"/>
-                <bool name="visible" value="TRUE"/>
-                <layout orientation="Vertical" type="linear">
-                    <linearitem itemname="lblTitle"/>
-                    <linearitem itemname="lblSwVersion"/>
-                    <linearitem itemname="lblDownloadState"/>
-                    <linearitem itemname="horizontalProgressBar"/>
-                    <linearitem itemname="scrollArea"/>
-                    <linearitem itemname="container_2"/>
-                </layout>
-            </widget>
-            <layout type="grid">
-                <griditem column="0" itemname="container_4" row="0"/>
-            </layout>
-        </widget>
-    </widget>
-    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
-        <uistate name="Common ui state" sections="#common"/>
-        <uistate name="portrait" sections="#common"/>
-        <uistate name="landscape" sections="#common"/>
-    </metadata>
-</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/bwins/fmsclientu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+	?MonitorForBatteryL@RFMSClient@@QAEXI@Z @ 1 NONAME ; void RFMSClient::MonitorForBatteryL(unsigned int)
+	?NotifyForResumeL@RFMSClient@@QAEXABW4TOmaDLInterruptReason@@ABHABW4TDriveNumber@@1@Z @ 2 NONAME ; void RFMSClient::NotifyForResumeL(enum TOmaDLInterruptReason const &, int const &, enum TDriveNumber const &, int const &)
+	?Close@RFMSClient@@QAEXXZ @ 3 NONAME ; void RFMSClient::Close(void)
+	?Cancel@RFMSClient@@QAEXXZ @ 4 NONAME ; void RFMSClient::Cancel(void)
+	?OpenL@RFMSClient@@QAEHXZ @ 5 NONAME ; int RFMSClient::OpenL(void)
+	?CancelNotifyForResume@RFMSClient@@QAEXXZ @ 6 NONAME ; void RFMSClient::CancelNotifyForResume(void)
+	?IsPhoneCallActive@RFMSClient@@QAEHAAH@Z @ 7 NONAME ; int RFMSClient::IsPhoneCallActive(int &)
+	?MonitorActivePhoneCallEnd@RFMSClient@@QAEHHH@Z @ 8 NONAME ; int RFMSClient::MonitorActivePhoneCallEnd(int, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/eabi/fmsclientu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+	_ZN10RFMSClient16NotifyForResumeLERK21TOmaDLInterruptReasonRKiRK12TDriveNumberS4_ @ 1 NONAME
+	_ZN10RFMSClient18MonitorForBatteryLEj @ 2 NONAME
+	_ZN10RFMSClient21CancelNotifyForResumeEv @ 3 NONAME
+	_ZN10RFMSClient5CloseEv @ 4 NONAME
+	_ZN10RFMSClient5OpenLEv @ 5 NONAME
+	_ZN10RFMSClient6CancelEv @ 6 NONAME
+	_ZN10RFMSClient17IsPhoneCallActiveERi @ 7 NONAME
+	_ZN10RFMSClient25MonitorActivePhoneCallEndEii @ 8 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+// BLD.INF
+// Component description file 
+//
+
+PRJ_MMPFILES
+
+FMSClient.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/group/fmsclient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#include <platform_paths.hrh>
+#include "defaultcaps.hrh"
+
+//MACRO  _FOTA_DEBUG
+//MACRO  _FOTA_DEBUG_RDEBUG
+
+CAPABILITY	CAP_CLIENT_DLL 
+
+TARGET        fmsclient.dll
+TARGETTYPE    dll
+UID 0x1000008D 0x200100C7
+VENDORID 			VID_DEFAULT
+
+SOURCEPATH    ../src
+SOURCE        fmsclient.cpp
+
+USERINCLUDE   ../inc
+USERINCLUDE   ../../inc
+USERINCLUDE   ../../cenrep
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       euser.lib  
+LIBRARY 	  bafl.lib 
+LIBRARY 	  efsrv.lib 
+LIBRARY		  centralrepository.lib
+LIBRARY       flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/inc/fmsclient.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#ifndef __FMS_CLIENT_H__
+#define __FMS_CLIENT_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32cmn.h>
+#include <f32file.h>
+#include "fmsclientserver.h"
+
+
+class RFMSClient : public RSessionBase
+	{
+	public:
+		/**
+		 * Launches FMSServer
+		 * @param None
+		 * @return KErrNone Symbian error code
+		 */
+		IMPORT_C TInt OpenL();
+		
+		/**
+		 * Close server connection
+		 * @param None
+		 * @return None
+		 */
+		IMPORT_C void Close();
+		
+		/**
+		 * Sending the parameters to FMSServer
+		 * FotaServer or test app should use this
+		 * @param aReason
+		 * @param aBearer
+		 * @param aDrive
+		 * @param aSize
+		 * @return None
+		 */
+		IMPORT_C void NotifyForResumeL(const TOmaDLInterruptReason& aReason, 
+		  const TInt& aBearer, const TDriveNumber& aDrive, const TInt& aSize);						
+		
+		/*
+		 * Cancels the request on FMSServer
+		 * @param None
+		 * @return None
+		 */
+		void CancelNotifyForResume();
+		
+		/**
+		 * Sending the parameters to FMSServer
+		 * to monitor for battery level during USB charging
+		 * @param aLevel - level of the battery charge to monitor
+		 * @return None
+		 */
+		IMPORT_C void MonitorForBatteryL(TUint aLevel);
+		
+		/**
+		 * Cancels the request on FMSServer
+		 * @param None
+		 * @return None
+		 */
+		 IMPORT_C void Cancel();
+		 
+		 /**
+		  * phone call active check to FMSServer
+		  * @param aCallActive, on return holds call status
+		  * @return TInt, error code
+		  */
+		 IMPORT_C TInt IsPhoneCallActive(TInt& aCallActive);
+		 
+		 /**
+		  * Monitor for active phone call end
+		  * @param aPkgId, Package id of interrupted update 
+		  * & Profile Id, Server profile Id
+		  * @return TInt, error code
+		  */
+		 IMPORT_C TInt MonitorActivePhoneCallEnd(TInt aPkgId,TInt aProfileId);
+		 
+	private:
+		/* 
+		 * FotaStartUp uses this at the time of reboot 
+		 * to trigger FMS server
+		 * @param None
+		 * @return None
+		 */
+		 void SendInterruptParamsL();
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/inc/fmsclientdebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#ifndef FMS_CLIENT_DEBUG_H_
+#define FMS_CLIENT_DEBUG_H_
+   #ifdef _FOTA_DEBUG
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "fmsclient.log" );
+        _LIT( KLogDirFullName, "c:\\logs\\" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+
+#endif /*FMSCLIENTDEBUG_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmsclient/src/fmsclient.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,218 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#include <f32file.h>
+#include <fotaConst.h>
+#include <fotaengine.h>
+#include "fmsclientserver.h"
+#include "fmsclient.h"
+#include "fmsclientdebug.h"
+
+#include "fotaserverPrivateCRKeys.h"
+#include <centralrepository.h>
+// ---------------------------------------------------------------------------
+// IsSecureClient()  
+// Checks who is trying to launch FMS
+// ---------------------------------------------------------------------------
+TBool IsSecureClient(TBool& aFotaStartUp)
+	{
+	FLOG(_L("IsSecureClient Started"));
+	RThread thread;
+	TUid fotaserver,fotastartup;
+	fotaserver.iUid = KFotaServerUid;
+	fotastartup.iUid = KStarterUid;	
+	if ( thread.SecureId() == fotaserver.iUid ) 
+		{
+		FLOG(_L("fmsclient fotaserver is using the service"));
+		return ETrue;
+		}
+	else if ( thread.SecureId() ==  fotastartup.iUid )
+		{
+		FLOG(_L("fmsclient fotastartupplugin is using the service"));
+		aFotaStartUp = ETrue;
+		return ETrue;    
+		}
+		else if (thread.SecureId() == 0x01D278B9 ) //test app
+		{
+		FLOG(_L("fmsclient test app is using the service"));		
+		return ETrue;
+		}
+	FLOG(_L("fmsclient not launched"));
+	return EFalse;
+	}
+
+// ---------------------------------------------------------------------------
+// StartServerL()  
+//	Starts Fota Downlaod Interrupt Monitory server
+// ---------------------------------------------------------------------------
+TInt StartServerL()
+	{
+	FLOG(_L("StartServerLt Started"));
+	TInt res = KErrNone;
+	RProcess server;
+	res=server.Create(KFMSServerName,KNullDesC);
+	FLOG(_L("StartServerL-- create server error as %d"),res);
+	if (res!=KErrNone)
+		{		
+		return res;
+		}
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat!=KRequestPending)
+		server.Kill(0);		// abort startup
+	else
+		server.Resume();	// logon OK - start the server
+	User::WaitForRequest(stat);		// wait for start or death
+	res=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+	FLOG(_L("StartServerL-- server.ExitType() returns %d"),res);
+	server.Close();
+	return res;
+	}
+
+// ---------------------------------------------------------------------------
+// RFMSClient::OpenL()
+// ---------------------------------------------------------------------------
+EXPORT_C TInt RFMSClient::OpenL()
+	{	
+	FLOG(_L("RFMSClient::OpenL()- Begin"));
+	TInt res = KErrNone;
+	TBool FotaStartUp = EFalse;
+	if( IsSecureClient(FotaStartUp))
+		{
+		FLOG(_L("RFMSClient::OpenL()- Secured client"));
+		res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
+		if ( res != KErrNone )
+			{
+			FLOG(_L("RFMSClient::OpenL()- session not created"));
+			res = StartServerL();
+			User::LeaveIfError( res );
+			res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
+			}
+		User::LeaveIfError( res );
+		FLOG(_L("RFMSClient::OpenL()- session created"));
+		CRepository* centrep2 = NULL;
+    TRAPD( err, centrep2 = CRepository::NewL( KCRUidFotaServer ) )
+    TInt val = KErrNone;
+    if (err==KErrNone ) 
+      {
+      	      centrep2->Get(  KFotaUpdateState, val );
+      	      delete centrep2;
+      }
+            
+            centrep2 = NULL;
+    
+		if( FotaStartUp && val == EFotaDownloadInterrupted )
+			{
+			FLOG(_L("RFMSClient::OpenL()- fotastartup using FMS session"));
+			SendInterruptParamsL();
+			}
+		}
+	else //not a secured client
+		{
+		FLOG(_L("fmsclient not launched--insecured client"));
+		res = KErrNotFound;
+		}
+	FLOG(_L("RFMSClient::OpenL()- End %d"),res);	
+	return res;
+	}
+
+// ---------------------------------------------------------------------------
+// RFMSClient::Close()
+// ---------------------------------------------------------------------------
+EXPORT_C void RFMSClient::Close()
+	{
+    FLOG(_L(" RFMSClient::Close"));
+	RSessionBase::Close();  //basecall
+	}
+	
+// ----------------------------------------------------------------------------
+// RFMSClient::NotifyForResumeL()
+// ----------------------------------------------------------------------------	
+EXPORT_C void RFMSClient::NotifyForResumeL(const TOmaDLInterruptReason& aReason,
+		const TInt& aBearer, const TDriveNumber& aDrive, const TInt& aSize)
+	{		
+    FLOG(_L(" RFMSClient::NotifyForResumeL--Begin"));
+    TInt Size(aSize),Drive((TInt)aDrive),Bearer(aBearer);
+    TInt err = SendReceive( (TInt)aReason, TIpcArgs(Bearer,Drive,Size));
+    FLOG(_L(" RFMSClient::NotifyForResumeL--End error as %d"),err);
+	}
+
+// ---------------------------------------------------------------------------
+// RFMSClient::SendInterruptParamsL() called only when fotastartup launched
+// ---------------------------------------------------------------------------	
+void RFMSClient::SendInterruptParamsL()
+	{
+	FLOG(_L(" RFMSClient::SendInterruptParamsL--Begin"));
+	TInt err = Send( EFotaStartUpPlugin );
+	FLOG(_L(" RFMSClient::SendInterruptParamsL--End as %d"),err);
+	}
+// ---------------------------------------------------------------------------
+// RFMSClient::CancelNotifyForResume() 
+// ---------------------------------------------------------------------------	
+EXPORT_C void RFMSClient::CancelNotifyForResume()
+	{
+	FLOG(_L(" RFMSClient::CancelNotifyForResume--Begin"));
+	TInt err = Send( ECancelOutstandingRequest );
+	FLOG(_L(" RFMSClient::CancelNotifyForResume--End as %d"),err);
+	}
+
+// ---------------------------------------------------------------------------
+// RFMSClient::MonitorForBatteryL() 
+// ---------------------------------------------------------------------------	
+EXPORT_C void RFMSClient::MonitorForBatteryL(TUint aLevel)
+    {
+    FLOG(_L(" RFMSClient::MonitorForBatteryL--Begin, level = %d"), aLevel);
+	TInt err = SendReceive( EMonitorbattery, TIpcArgs (aLevel));
+	FLOG(_L(" RFMSClient::MonitorForBatterL--End as %d"),err);
+	User::LeaveIfError(err);
+	}
+// ---------------------------------------------------------------------------
+// RFMSClient::Cancel() 
+// ---------------------------------------------------------------------------	
+EXPORT_C void RFMSClient::Cancel()
+	{
+	FLOG(_L(" RFMSClient::Cancel--Begin"));
+	TInt err = SendReceive( ECancelOutstandingRequest );
+	FLOG(_L(" RFMSClient::Cancel--End as %d"),err);
+	}
+	
+// ---------------------------------------------------------------------------
+// RFMSClient::ActivePhoneCallSync() 
+// ---------------------------------------------------------------------------  
+EXPORT_C TInt RFMSClient::IsPhoneCallActive(TInt& aCallActive)
+    {
+    FLOG(_L(" RFMSClient::IsPhoneCallActive--Begin"));
+    TPckgBuf<TInt> result(aCallActive);
+    TInt err = SendReceive( EPhoneCallActive,TIpcArgs(&result));    
+    aCallActive=result();
+    FLOG(_L(" RFMSClient::IsPhoneCallActive--End as %d,%d"),err,aCallActive);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// RFMSClient::MonitorActivePhoneCallEnd() 
+// ---------------------------------------------------------------------------  
+EXPORT_C TInt RFMSClient::MonitorActivePhoneCallEnd(TInt aPkgId,TInt aProfileId)
+    {
+    FLOG(_L(" RFMSClient::MonitorActivePhoneCallEnd--Begin, pkgid:%d, \
+            / profileid:%d"),aPkgId,aProfileId);
+    TInt err = SendReceive( EMonitorPhoneCallEnd, TIpcArgs(aPkgId,aProfileId));
+    FLOG(_L(" RFMSClient::MonitorActivePhoneCallEnd--End as %d"),err);
+    return err;
+    }
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+// BLD.INF
+// Component description file 
+//
+
+PRJ_MMPFILES
+
+FMSServer.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/group/fmsserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#include <platform_paths.hrh>
+#include "defaultcaps.hrh"
+
+//MACRO  _FOTA_DEBUG
+//MACRO  _FOTA_DEBUG_RDEBUG
+
+CAPABILITY    CAP_SERVER
+
+TARGET        fmsserver.exe
+TARGETTYPE    exe
+
+UID 0 0x200100C8
+VENDORID 			VID_DEFAULT
+
+SOURCEPATH    ../src
+SOURCE        fmsserver.cpp
+SOURCE		  fmsserversession.cpp
+SOURCE		  fmsinterruptaob.cpp
+
+USERINCLUDE   ../inc
+USERINCLUDE   ../../inc
+USERINCLUDE   ../../cenrep
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY       euser.lib
+LIBRARY       connmon.lib // for connection monitoring
+LIBRARY       sysutil.lib 
+LIBRARY       efsrv.lib 
+LIBRARY       flogger.lib
+LIBRARY       centralrepository.lib 
+LIBRARY       fotaengine.lib 
+LIBRARY       cmmanager.lib 
+LIBRARY       etelmm.lib 
+LIBRARY       etel.lib 
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/inc/fmsdebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#ifndef FMSDEBUG_H_
+#define FMSDEBUG_H_
+
+	#ifdef _DEBUG
+	#define _FOTA_DEBUG
+	#endif
+
+   #ifdef _FOTA_DEBUG
+
+        #include <e32std.h>
+        #include <f32file.h>
+        #include <flogger.h>
+        #include <e32svr.h>
+
+        _LIT( KLogFile, "fmsserver.log" );
+        _LIT( KLogDirFullName, "c:\\logs\\" );
+        _LIT( KLogDir, "fota" );
+
+        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+            {
+            VA_LIST list;
+            VA_START( list, aFmt );
+            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+            }
+
+
+        #ifdef _FOTA_DEBUG_RDEBUG 
+            #ifndef __GNUC__          
+                #define FLOG            RDebug::Print
+            #else   // __GNUC__       
+                #define FLOG(arg...)    RDebug::Print(arg);
+            #endif // __GNUC__        
+        #else // _FOTA_DEBUG_RDEBUG
+            #ifndef __GNUC__          
+                #define FLOG            FWrite
+            #else   // __GNUC__       
+                #define FLOG(arg...)    FWrite(arg);
+            #endif // __GNUC__        
+        #endif // _FOTA_DEBUG_RDEBUG
+
+    #else   // _FOTA_DEBUG    
+        #ifndef __GNUC__
+            #define FLOG
+        #else
+            #define FLOG(arg...)
+        #endif // __GNUC__
+    #endif // _FOTA_DEBUG
+
+
+#endif /*FMSDEBUG_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/inc/fmsinterruptaob.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#ifndef __FMS_AOB_H__
+#define __FMS_AOB_H__
+
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+#include <rconnmon.h>
+#include <etel.h>
+#include <fotaengine.h>
+#include "fmsserver.h"
+#include "fmsdebug.h"
+
+class CFMSServer;
+
+// CLASS DECLARATION     
+class CFMSInterruptAob : public CActive,private MConnectionMonitorObserver
+	{	
+	friend class CFMSServer;	
+	
+	public:
+	/**
+	 * Default constructor
+	 */
+	CFMSInterruptAob();
+	
+	/**
+	 * second phase constructor
+	 */
+	void ConstructL();
+	
+	/**     
+     * Logs the new request/interrupt to  be monitored  
+     * @param aType, interrupt reason
+     * @return None
+     */
+	void StartL(TOmaDLInterruptReason aType);
+	
+	/**
+	 * Starts Active object to monitor for the update interrupt in case of USB charger support
+	 * @param aType, Interrupt reason
+	 * @return None
+	 */
+	void StartBatteryMonitoringL(TOmaUpdInterruptReason aType, TUint aLevel);
+
+	/**     
+     * Sets the memory size member variable to be monitored 
+     * for the current interrupt 
+     * @param aSize, Memory space required
+     * @param aDrive, Drive used for download
+     * @return None
+     */
+	void MemoryToMonitorL(TInt aSize, TDriveNumber aDrive);
+	
+	/**     
+     * Sets the network type for the current interrupt 
+     * @param aBearer
+     * @return None
+     */
+	void NetworkTypeL(TInt aBearer);
+	/**     
+     * Launches FOTA install notifier 
+     * @param None
+     * @return None
+     */
+	void LaunchFotaScheduleUpdate();
+	
+	/*
+	 * Destructor
+	 */
+	virtual ~CFMSInterruptAob();
+	
+	/**     
+	 * Starts monitor for active call end 	
+	 * @param aType, Reason to be monitored	 
+	 * @return None
+	 */
+	void StartCallEndMonitoringL(TOmaUpdInterruptReason aType);
+	
+	private:
+	
+	/**
+     * From CActive
+     * Called by Active scheduler when the asynchronous 
+     * request completed     
+     * @param None
+     * @return None
+     */
+	void RunL();
+	
+	/**
+     * From CActive
+     * Called when a pending request has to be cancelled     
+     * @param None
+     * @return None
+     */
+	void DoCancel();
+	
+	 /**
+     * From CActive
+     * Handle a leave occurred in the RunL().
+     * Note: If RunError function pointer is not given in construction,
+     * the leave error is to be propagated back to the active scheduler!
+     *
+     * @since S60 v3.2
+     * @param aError the error code of leave
+     */
+    TInt RunError( TInt aError );
+    
+    /**
+     * Checks the package size is more than warning level of memory
+     * @param aCritical to set EFalse/ETrue
+     * @return TInt
+     */
+	TInt IsPkgSizeMoreThanWL(TBool& aCritical);
+	
+	/**
+	  * Starts network notification registry
+	  * @param None
+	  * @return None
+	  */
+	TBool CheckNetworkL();
+	
+	/**
+	  * Starts network notification registry
+	  * @param None
+	  * @return None
+	  */
+	void LaunchFotaEngineL();		
+	
+	/**
+	  * Starts network notification registry
+	  * @param None
+	  * @return None
+	  */
+	TBool CheckGlobalRFStateL();
+	
+	/**
+	  * Stops the FMS Server
+	  * @param None
+	  * @return None
+	  */
+	void StopServer();
+	
+	/**
+	  * Checks the memory size to be monitored
+	  * after adding the warning level
+	  * @param None
+	  * @return None
+	  */
+	void CheckMemSizeL();
+	
+	public: 
+    
+  	/**
+    * Starts network notification registry
+    * @param None
+    * @return None
+    */
+	void NotifyL() ;
+	
+    /**
+    * Stops network notifications.
+    * @param None
+    * @return None
+    */
+   	void StopNotify() ;
+   	
+   	/**
+     * sets n/w to 3G.
+     * @param None
+     * @return None
+     */
+   	void SetWcdma() ;
+   	
+   	/**
+     * Starts n/w registry check in Hard reeboot case
+     * uses CPeriodic variable to call static method
+     * @param None
+     * @return None
+     */
+   	void StartNetworkRegistryCheckL();
+   	
+   	/**
+     * checks n/w registry in Hard reeboot case
+     * and destroys the CPeriodic if connection is there
+     * and triggers fota engine
+     * @param None
+     * @return None
+     */
+	void NetworkRegistryCheckL();
+	
+	/**
+	 * Launches Fota update note	 
+	 * @param aPkgId, package Id of FOTA Update
+	 * @param aProfilleId, Profile ID of FOTA
+	 * @return None
+	 */
+	void LaunchFotaUpdate(TInt& aPkgId, TInt& aProfilleId);
+	
+	private : 
+	
+	/**
+	 * From MConnectionMonitorObserver
+	 * Method involed by connection monitor with current event. 
+	 * This method handles the events
+	 * @param aConnMonEvent says about the event
+	 * @return None
+	 */
+	void EventL( const CConnMonEventBase& aConnMonEvent ) ;
+	
+	/**
+	 *CheckNetworkstatus and takes action based on that 
+	 * @param none
+	 * @return None
+	 */
+	void CheckNetworkStatusL();
+	/**
+	 * HandleAboveCriticallevel handle memory interrupt when it is above critical level 
+	 * @param                   None
+	 * @return                  None
+	 */
+	void HandleAboveCriticallevelL();
+	
+	/**
+	 * HandleChargingInterruptL  handle charging interrupt when it is above critical level 
+	 * @param                   None
+	 * @return                  None
+	 */
+	
+	void HandleChargingInterruptL();
+	
+	private:	  
+	
+	RConnectionMonitor iConnMon;
+	RFs iFs;
+	RProperty iProperty;
+    TInt iConnStatus;	
+    TInt iSize;
+    TDriveNumber iDrive;
+    TInt iBearer;
+    TBool iWlanAvailable;
+    TBool iGPRSAvail;
+    TOmaDLInterruptReason iInterruptType;
+    TOmaUpdInterruptReason iUpdInterruptType;
+    CFMSServer* iServer;
+    RFotaEngineSession iFotaEngine;    
+    CPeriodic* iPeriodicNwCheck;
+    TBool iWcdma;
+    
+    /** 
+     * RTelServer object used to keep an asynchronous request
+     * for phone call end monitoring
+     */ 
+    RTelServer iTelServer;
+
+    /** 
+     * RPhone object used to keep an asynchronous request
+     * for phone call end monitoring
+     */
+    RPhone     iPhone;
+    
+    /** 
+     * RLine object used to keep an asynchronous request
+     * for phone call end monitoring
+     */
+    RLine      iLine;
+    
+    /** 
+     * To get hodl of current call status     
+     */
+    RCall::TStatus iCallStatus;
+
+    TInt iChargeToMonitor;
+
+	};
+	
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/inc/fmsserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#ifndef __FMS_SERVER_H__
+#define __FMS_SERVER_H__
+
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+#include <flogger.h>
+#include <rconnmon.h>
+#include <f32file.h>
+#include <fotaengine.h>
+#include "fmsclientserver.h"
+#include "fmsinterruptaob.h"
+#include "fmsdebug.h"
+
+_LIT( KFotaInterruptFileName, "fotainterrupt.txt" );
+const TInt64 KThresholdDiskSpace = 305152;
+const TInt64 KDiskSpaceNotCL = 102400;
+const TInt KRequestTriggerWaitTime(1000000);
+
+class CFMSSession;
+class CFMSServer;
+class CFMSInterruptAob;
+
+	
+class CFMSServer: public CServer2
+	{
+	friend class CFMSSession;
+	friend class CFMSInterruptAob;
+	
+	public:
+	
+	/**
+	 * Destructor
+	 */ 
+	virtual ~CFMSServer();
+	
+	/**
+	 * Static method which creates the server instance
+	 * @param None
+	 * @return CServer2*
+	 */ 
+	static CServer2*  NewLC();
+	
+	/**
+	 * Stops the session and closes the server
+	 * @param None
+	 * @return None
+	 */
+	void DropSession();
+	
+	/**
+	 * Starts Active object to monitor for the interrupt
+	 * @param aType, Interrupt reason
+	 * @return None
+	 */
+	void StartMonitoringL(TOmaDLInterruptReason aType);
+
+	/**
+	 * Starts Active object to monitor for the update interrupt
+	 * @param aType, Interrupt reason
+	 * @param aLevel, Level of the battery charge to monitor
+	 * @return None
+	 */
+	void StartBatteryMonitoringL(TOmaUpdInterruptReason aType, TUint aLevel);
+
+/**
+	 * Starts Active object to monitor for the update interrupt
+	 * @param aType, Interrupt reason
+	 * @return None
+	 */
+	void StartUpdateInterruptMonitoringL(TOmaUpdInterruptReason aType);
+	/**
+	 * Calls Active object's method to set the drive & size 
+	 * for memory interrupt
+	 * @param aSize, Interrupt aDrive
+	 * @return None
+	 */
+	void MemoryToMonitorL(TInt aSize, TDriveNumber aDrive);
+	
+	/**
+	 * Calls Active object's method to set the network bearer
+	 * @param aBearer
+	 * @return None
+	 */
+	void NetworkTypeL(TInt aBearer);
+	
+	/**
+	 * Writes the file with all the interrupt information
+	 * @param aReason ,Interrupt reason
+	 * @param aBearer ,Bearer id
+	 * @param aDrive  ,Drive to Download
+	 * @param aSize   , memory size to monitor
+	 * @param aWcdmaBearer , 3G bearer or not
+	 * @return None
+	 */
+    void WriteToFile(TInt aReason, TInt aBearer, TDriveNumber aDrive, 
+    		TInt aSize, TBool aWcdmaBearer );
+    
+    /**
+	 * Reads the file for the interrupt information
+	 * @param aReason ,Interrupt reason
+	 * @param aBearer ,Bearer id
+	 * @param aDrive  ,Drive to Download
+	 * @param aSize   , memory size to monitor
+	 * @param aWcdmaBearer , 3G bearer or not
+	 * @return TBool, says reading success or not
+	 */
+    TBool ReadFromFile(TInt& aReason, TInt& aBearer, TInt& aDrive, TInt& aSize
+    		 , TInt& aWcdmaBearer );
+    
+    /**
+	 * Checks for any interrupt pending
+	 * @param None
+	 * @return TBool
+	 */
+    TBool RequestPending();
+    
+    /**
+	 * Checks the network as part of other interrupts
+	 * before triggering fota.
+	 * In case of network down, it keeps network interrupt
+	 * @param aBearer ,Bearer id
+	 * @param aDrive  ,Drive to Download
+	 * @param aSize   , memory size to monitor
+	 * @param aWcdmaBearer , 3G bearer or not
+	 * @return None
+	 */
+    void CheckNetworkL(TInt& aBearerId,TInt& aDrive, TInt& aSize,TBool& aWcdma);
+    
+    /**
+	 * Locks the session, so that new session will not be started
+	 * before the previous interrupt monitory completion
+	 * @param None
+	 * @return None
+	 */
+    void LockSession();
+    
+    /**
+	 * Computes the variation configured
+	 * @param None
+	 * @return None
+	 */
+    void FindVariation();
+    
+    /**
+	 * Checks Charger monitoring supported or not
+	 * @param None
+	 * @return TBool, which says Charger monitory support
+	 */
+    TBool ChargerTobeMonitered();
+    
+    /**
+	 * Checks  Network monitoring supported or not
+	 * @param None
+	 * @return TBool, which says  Network monitory support
+	 */
+    TBool NetworkTobeMonitered();
+    
+    /**
+	 * Checks Phone startup monitoring supported or not
+	 * @param None
+	 * @return TBool, which says Phone startup monitory support
+	 */
+    TBool MoniterAfterPhoneRestart();
+    
+    /**
+	 * Checks Memory monitoring supported or not
+	 * @param None
+	 * @return TBool, which says Memory monitory support
+	 */
+    TBool MemoryTobeMonitered();
+    
+    /**
+	 * Checks for WLAN
+	 * @param None
+	 * @return TBool, which says WLAN availability
+	 */
+    TBool CheckWlanL();
+    
+    /**
+	 * Sets the Bool value which decides file deletion
+	 * @param aValue, says whether the file to be deletd or not
+	 * @return None
+	 */
+    void DeleteFile(TBool aValue);
+    
+    /**
+	 * Checks network and trigger fota engine in hard reboot case
+	 * @param None
+	 * @return None
+	 */
+    void TriggerFotaL();
+    
+    /**
+	 * For asynchronous network request to be 
+	 * logged on active object, using CPeriodic
+	 * @param None
+	 * @return None
+	 */
+	void AsyncSessionRequestL();
+		
+	/**
+	 * Destroys the CPeriodic object
+	 * So that not to call the static method again
+	 * @param None
+	 * @return None
+	 */
+	void StopAsyncRequest();
+	
+	/**
+     * Calls Active objects SetWcdma to set the bearer to 3G
+     * @param None
+     * @return None
+     */
+   	void SetWcdma() ;
+   	
+   	/**
+   	 * Checks whether a phone call is active or not
+   	 * @param aStatus, on return contains the call status
+   	 * @return None
+   	 */
+   	void CheckPhoneCallActiveL(TInt& aStatus);
+   	
+   	/**
+   	 * Starts montioring for active phone call end
+   	 * @param aPkgId, package Id of FOTA Update
+   	 * @param aProfileId, Profile ID of FOTA
+   	 * @return phone call active or not at that moment
+   	 */
+   	TBool MonitorPhoneCallEndL(TInt aPkgId, TInt aProfileId);
+   	
+   	/**
+   	 * Logs Asynchronous montioring for active phone call end
+   	 * To avoid performance issues(like thread blocking call)
+   	 * @param None
+   	 * @return None
+   	 */
+   	void LogAsyncCallMonitorL();
+   	
+   	/**
+   	 * Returns the FOTA Update packaged Id
+   	 */ 
+   	TInt& PkgId();
+
+   	/**
+   	 * Returns the FOTA server profile Id
+   	 */
+   	TInt& ProfileId();
+   	
+	private:
+	
+	/**
+	 * second phase constructor
+	 */
+	void ConstructL();
+	
+	/**
+	 * Default constructor
+	 */
+	CFMSServer();
+	
+	protected:
+	
+	/**
+	 * Calls when a New session is getting created
+	 * @param aVersion
+	 * @param aMessage
+	 * @return CSession2*
+	 */
+	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage)  const;
+	
+	private:
+	RFs iFs; //for file creation, writing & Deleting
+	RFile iFile;
+	TInt iSessionCount;	
+	CFMSInterruptAob iFMSInterruptAob;
+    TBool iNetworkMon;
+    TBool iChargerMon;
+    TBool iPhoneRestartMon;
+    TBool iMemoryMon;	
+    TBool iDeleteFile;
+    CPeriodic* iLogAsyncRequest;
+    
+    //FOTA Server Profile Id
+    TInt iProfileId;
+    
+    //FOTA Update package Id
+    TInt iPkgId;
+	};
+	
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/inc/fmsserversession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#ifndef __FMS_SESSION_H__
+#define __FMS_SESSION_H__
+
+#include "fmsserver.h"
+
+class CFMSSession: public CSession2
+{
+	friend class CFMSServer;
+	public:
+		/**
+		 * Destructor
+		 */
+		virtual ~CFMSSession();		
+	
+	private:
+		/**
+		 * Constructor
+		 */ 
+		CFMSSession();
+		
+		/**
+		 * Provides FMS Server reference
+		 * @param None.
+		 * @return CFMSServer reference
+		 */ 
+		CFMSServer& Server();
+		
+		/**
+		 * Called by the framework to handle the request 	 
+		 * @param aMessage
+		 * @return None
+		 */
+		void ServiceL(const RMessage2& aMessage);
+		
+		/**
+		 * Called from ServiceL to handle the request 
+		 * @param aMessage
+		 * @return None
+		 */
+		void DispatchMessageL(const RMessage2& aMessage);
+		
+		/**
+		 * Called when ServiceL leaves
+		 * @param aMessage
+		 * @param aError
+		 * @return None
+		 */
+		void ServiceError(const RMessage2 &aMessage, TInt aError);
+		
+		/**
+		 * Checks whether the session started client is secured or not	 
+		 * @param aMessage
+		 * @return TBool
+		 */
+		TBool CheckClientSecureIdL( const RMessage2 &aMessage );
+		
+		/**
+		 * Finds the bearer id for the corresponding IAP Id		 
+		 * @param aIapId
+		 * @return TUint32, bearer id
+		 */
+		TUint32 FindBearerIdL(TInt aIapId);
+		
+		/**
+		 * Writes Dummy file in case of unsupported monitoring		 
+		 * @param None.
+		 * @return CFMSServer reference
+		 */
+		void WriteDummyFile();
+		
+		/**
+		 * Checks whether the phone is in 2G or 3G mode
+		 * sets the member variable iWcdmaBearer
+		 * @param None.
+		 * @return CFMSServer reference
+		 */
+		void PhoneModeL();
+		
+		/**
+		 * 
+		 * Handles the service based on bearer type
+		 * @param aMessage.
+		 * @return None
+		 */
+			void HandleBasedOnBearertypeL(const RMessage2& aMessage);
+	private:	
+		TBool iStopServer;
+		TBool iWlanbearer;
+		TBool iWcdmaBearer;
+};
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/src/fmsinterruptaob.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,975 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#include <systemwarninglevels.hrh>
+#include <e32property.h>
+#include <startupdomainpskeys.h>
+#include <hwrmpowerstatesdkpskeys.h>
+#include <sysutil.h> 
+#include <fotaengine.h>
+#include "fotaserverPrivateCRKeys.h"
+#include "fmsserver.h"
+#include "fmsinterruptaob.h"
+#include "fmsclientserver.h"
+#include "FotaIPCTypes.h"
+
+
+// ----------------------------------------------------------------------------------------
+// static method StaticCheckNwRequestL() called to check n/w availability
+// ----------------------------------------------------------------------------------------
+static TInt StaticCheckNwRequestL(TAny* aPtr)
+	{
+	CFMSInterruptAob* ptr = (CFMSInterruptAob*) aPtr;
+	FLOG(_L("StaticCheckNwRequestL:-Begin"));	
+	TRAPD(err, ptr->NetworkRegistryCheckL() );	
+	FLOG(_L("StaticCheckNwRequestL:-end"));
+	return err;
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSInterruptAob::CFMSInterruptAob()
+// -----------------------------------------------------------------------------
+CFMSInterruptAob::CFMSInterruptAob()
+:CActive(EPriorityStandard)
+	{
+	//CActiveScheduler::Add(this);
+	iConnStatus = KErrNone;
+	iWlanAvailable = EFalse;
+	iGPRSAvail = EFalse;
+	iWcdma = EFalse;
+	iUpdInterruptType = ENoUpdInterrupt;
+	iChargeToMonitor = 0;
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSInterruptAob::ConstructL()
+// -----------------------------------------------------------------------------
+void CFMSInterruptAob::ConstructL()
+	{
+	CActiveScheduler::Add(this);	
+	User::LeaveIfError(iConnMon.ConnectL());
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSInterruptAob::Start()
+// -----------------------------------------------------------------------------
+void CFMSInterruptAob::StartL(TOmaDLInterruptReason aType)
+	{	
+	FLOG(_L("CFMSInterruptAob::Start- begin"));
+	iInterruptType = aType;
+	if(iInterruptType == EUserInterrupt && iServer->ChargerTobeMonitered())
+		{
+		FLOG(_L("CFMSInterruptAob::Start--EUserInterrupt"));
+		if(!IsActive())
+			{
+			//RProperty pw;
+			iProperty.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus);
+			iStatus=KRequestPending;
+			iProperty.Subscribe(iStatus);	
+			SetActive();	
+			}
+		}
+	else if(iInterruptType == ENetworkInterrupt && iServer->NetworkTobeMonitered())
+		{	  
+		FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt"));	
+		if(!IsActive())
+			{		  
+			iStatus=KRequestPending;			  
+			TBool phonenotoffline = CheckGlobalRFStateL();
+			if ( ( iBearer == EBearerIdGPRS || iBearer == EBearerIdWCDMA )
+					&& phonenotoffline )
+				{
+				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt iBearer is %d"),iBearer);	
+				NotifyL();
+				return;			  
+				}
+			else if ( iBearer == EBearerIdWLAN )
+				{
+				//feature supported check
+				iWlanAvailable = EFalse;	  
+				iConnMon.GetBoolAttribute( EBearerIdWLAN, 
+						0, 
+						KBearerAvailability, 
+						iWlanAvailable, 
+						iStatus );
+				SetActive();
+				}
+			else
+				{
+				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt--other then GPRS/ WLan bearer "));	  
+				//Stop the server	  
+				//Dont delete the file if interrupt is network + offline( to differentiate from hard reboot
+				iServer->DeleteFile(EFalse);
+				StopServer();
+				}	  
+			}
+		}
+	else if(iInterruptType == EMemoryInterrupt && iServer->MemoryTobeMonitered())
+		{
+		FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt on drive %d"),(TInt)iDrive );		  
+		if(!IsActive())
+			{
+			User::LeaveIfError(iFs.Connect());
+			TBool critical = EFalse;
+			TInt err = KErrNone;
+			err=IsPkgSizeMoreThanWL(critical);		  
+			if(critical)
+				{	 
+				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg dont fit on drive %d"),(TInt)iDrive );		  
+				iStatus=KRequestPending;					
+				iFs.NotifyDiskSpace( iSize, iDrive, iStatus ); 
+				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt-setting as active") );		  
+				SetActive();	
+				}
+			else
+				{
+				if(err == KErrNone)
+					{
+					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg fits on drive %d"),(TInt)iDrive );
+					LaunchFotaEngineL();
+					}
+				else
+					{
+					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--System error %d on memory drive %d"), err,(TInt)iDrive );
+					}
+				//Stop the server	 
+				StopServer();	   
+				}
+			}
+		}  
+	else //case where variation fails or by chance if a bad interrupt reason
+		{
+		StopServer();	  
+		}	 
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSInterruptAob::RunL()
+// -----------------------------------------------------------------------------
+void CFMSInterruptAob::RunL()
+	{
+	FLOG(_L("CFMSInterruptAob::RunL()- begin"));
+	TInt value = 0;
+	if( EMonitorPhoneCallEnd == iUpdInterruptType)
+      {
+      FLOG(_L("RunL EPhoneCallActiveAsync--call status %d"),iCallStatus);
+      if(iStatus == KErrNone && RCall::EStatusIdle == iCallStatus )
+          {
+          //call fota scheduler & Stop the server          
+          LaunchFotaUpdate(iServer->PkgId(),iServer->ProfileId());
+          StopServer();
+          }
+      else //call in progress, subscribe again
+          {
+          FLOG(_L("call in progress, subscribing again"));
+          iLine.NotifyStatusChange(iStatus, iCallStatus);
+          SetActive();
+          }
+      }
+	else if( iUpdInterruptType == EMonitorbattery)
+	  {
+	  	 FLOG(_L("CFMSInterruptAob::RunL()- handling battery monitor"));
+	  	 iProperty.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel);
+		   TInt err=iProperty.Get(KPSUidHWRMPowerState,KHWRMBatteryLevel,value);
+		   if(err != KErrNone)
+		    { 
+		    	FLOG(_L("CFMSInterruptAob::RunL()- error  in getiing the battery level")); 
+		    	StopServer();
+		    }  
+		   if(value >= iChargeToMonitor)
+	    	{ iProperty.Cancel();
+			    iProperty.Close();	
+			  TRAPD(err, LaunchFotaScheduleUpdate());
+			  if(err)
+			  {
+			  	FLOG(_L("CFMSInterruptAob::RunL()- error in launch fota schedule"));
+			  }
+            iUpdInterruptType = ENoUpdInterrupt;
+            StopServer();
+			   
+		    }
+		
+	    	else 
+		   	{			
+		    	FLOG(_L("CFMSInterruptAob::RunL()--status charger not connected"));
+			   if(!IsActive())
+			  	{
+				  iStatus=KRequestPending;	
+				  iProperty.Subscribe(iStatus);
+				  FLOG(_L("CFMSInterruptAob::RunL()--waiting for charger Connectivity"));
+				  SetActive();
+				  }	
+	       }
+	  }     	
+  else if( iInterruptType == EUserInterrupt)
+		{
+		TInt value;	
+		//RProperty   pw;
+		iProperty.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus);
+		iProperty.Get(KPSUidHWRMPowerState,KHWRMChargingStatus,value);
+		// charger connected or already charging going on
+		if( value == EChargingStatusCharging /*|| value == EChargingStatusChargingComplete ||
+				value == EChargingStatusAlmostComplete || value == EChargingStatusChargingContinued */)
+			{	
+			 	FLOG(_L("CFMSInterruptAob::RunL()--status charging"));
+			  HandleChargingInterruptL();			
+						
+			}
+		else 
+			{			
+			FLOG(_L("CFMSInterruptAob::RunL()--status charger not connected"));
+			if(!IsActive())
+				{
+				iStatus=KRequestPending;	
+				iProperty.Subscribe(iStatus);
+				FLOG(_L("CFMSInterruptAob::RunL()--waiting for charger Connectivity"));
+				SetActive();
+				}				
+			}
+		}
+	else if( iInterruptType == ENetworkInterrupt )
+		{
+		FLOG(_L("CFMSInterruptAob::RunL()--ENetworkInterrupt" ));	
+		/*if( iBearer == EBearerIdGPRS || iBearer == EBearerIdWCDMA )
+			{
+			FLOG(_L("CFMSInterruptAob::RunL()--ENetworkInterrupt:GPRS/WCDMA" ));
+			}*/
+		 if ( iBearer == EBearerIdWLAN )
+			{
+			TBuf<10> num;
+			FLOG(_L("CFMSInterruptAob::RunL()--ENetworkInterrupt due to bearer id WLAN, iStatus %d"),iStatus.Int());	
+			/*if(iWlanAvailable)
+				FLOG(_L("iWlanAvailable :TRUE"));
+			else
+				FLOG(_L("iWlanAvailable :FALSE"));	*/				
+			if( iWlanAvailable && iStatus == KErrNone )
+				{
+				FLOG(_L("CFMSInterruptAob::RunL()--status WLAN networks found"));		
+				LaunchFotaEngineL();
+				StopServer();				
+				}
+			else if( iStatus == KErrNotSupported )//feture not supported
+				{
+				FLOG(_L("CFMSInterruptAob::RunL()--status WLAN feature not supported"));
+				StopServer();				
+				}
+			else 
+				{
+				FLOG(_L("CFMSInterruptAob::RunL()--status WLAN networks not found"));  			  
+				if(!IsActive())
+					{	
+					iWlanAvailable = EFalse;
+					iStatus=KRequestPending;	
+					iConnMon.GetBoolAttribute( EBearerIdWLAN, 
+							0, 
+							KBearerAvailability, 
+							iWlanAvailable, 
+							iStatus );
+					FLOG(_L("CFMSInterruptAob::RunL()--search for wlan availability"));
+					SetActive();
+					}		   
+				}	
+			}
+		}	
+	else if( iInterruptType == EMemoryInterrupt )
+		{
+		FLOG(_L("CFMSInterruptAob::RunL()--EMemoryInterrupt,iStatus %d"),iStatus.Int());			
+		if( iStatus == KErrNone  || iStatus == KErrCancel )
+			{
+			TBool critical = EFalse;
+			IsPkgSizeMoreThanWL(critical);
+			//if download size doesn't lead to memory less than critical level
+			if( !critical )	
+				{
+				FLOG(_L("CFMSInterruptAob::RunL()--Ok download not greater than critical level"));
+				//Check network status at this moment
+				
+				HandleAboveCriticallevelL();
+				
+				
+				}
+			else
+				{
+				FLOG(_L("CFMSInterruptAob::RunL()--Ok download greater than critical level"));
+				// space monitor for this		
+				if(!IsActive())
+					{
+					iStatus=KRequestPending;					
+					iFs.NotifyDiskSpace( iSize, iDrive, iStatus ); 
+					SetActive(); 	
+					}			
+				}
+			}			
+		else // for size request more than disk space
+			{
+			FLOG(_L("CFMSInterruptAob::RunL()--bad request size greater than the disk limit"));		
+			StopServer();			
+			}		
+		}
+	else //general
+		{
+		//Already ahandled in session class
+		}
+	FLOG(_L("CFMSInterruptAob::RunL()- End"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::DoCancel() 
+// ----------------------------------------------------------------------------------------
+void CFMSInterruptAob::DoCancel()
+	{
+	FLOG(_L("CFMSInterruptAob::::DoCancel()"));
+	if( iStatus == KRequestPending )
+		{
+		FLOG(_L("CFMSInterruptAob::::DoCancel()--request pending"));
+		TRequestStatus* status = &iStatus;
+		User::RequestComplete( status, KErrCancel );
+		}
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::MemoryToMonitorL() 
+// ----------------------------------------------------------------------------------------
+void CFMSInterruptAob::MemoryToMonitorL(TInt aSize, TDriveNumber aDrive)
+	{
+	FLOG(_L("CFMSInterruptAob::::MemoryToMonitorL()--Begin"));
+	if( aSize < 0 || (aDrive < EDriveA && aDrive > EDriveZ) )
+		{
+		FLOG(_L("CFMSInterruptAob::::MemoryToMonitorL()--Leving with KErrArgumnet"));
+		User::Leave(KErrArgument);
+		}
+	iDrive = aDrive;
+	iSize = aSize;
+	CheckMemSizeL();				
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::NetworkTypeL() 
+// ----------------------------------------------------------------------------------------
+void CFMSInterruptAob::NetworkTypeL(TInt aBearer)
+	{	
+	if( aBearer == EBearerIdGPRS || aBearer == EBearerIdWLAN
+									|| aBearer == EBearerIdWCDMA )
+		{
+		iBearer = aBearer;		
+		}
+	else
+		{
+		FLOG(_L("CFMSInterruptAob::::NetworkTypeL()--leaving with KErrArgument"));
+		User::Leave(KErrArgument);
+		}
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::IsPkgSizeMoreThanWL() 
+// ----------------------------------------------------------------------------------------
+TInt CFMSInterruptAob::IsPkgSizeMoreThanWL(TBool& aCritical)
+	{
+	FLOG(_L("CFMSInterruptAob::::IsPkgSizeMoreThanWL()--Begin"));
+	TInt err = KErrNone;	
+	//Already checked the drive is proper or not
+	//here the check happened for warning level
+	TRAP(err,aCritical = SysUtil::DiskSpaceBelowCriticalLevelL ( &iFs, iSize, iDrive ));
+	FLOG(_L("CFMSInterruptAob::::IsPkgSizeMoreThanWL() end %d"),err);
+	return err;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::CheckNetworkL() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSInterruptAob::CheckNetworkL()
+	{	
+	FLOG(_L("CFMSInterruptAob::CheckNetworkL--begin"));
+	TRequestStatus status=KRequestPending;	
+	iConnStatus = KErrNone; 	  
+	TBool phonenotoffline = CheckGlobalRFStateL();	  
+	if ( phonenotoffline && iBearer == EBearerIdGPRS )
+		{
+		TRequestStatus gsmstatus = KRequestPending;	
+		iConnStatus = KErrNotFound;		
+		FLOG(_L("CFMSInterruptAob::CheckNetworkL--check GSM registry"));	
+		iConnMon.GetIntAttribute( EBearerIdGSM, 0,KNetworkRegistration, iConnStatus, gsmstatus );
+		User::WaitForRequest(gsmstatus);
+		FLOG(_L("iConnStatus is %d gsmstatus is %d"),iConnStatus,gsmstatus.Int());
+		if( iConnStatus == ENetworkRegistrationHomeNetwork || 
+				iConnStatus == ENetworkRegistrationRoaming ) 
+			{
+			FLOG(_L("CFMSInterruptAob::CheckNetworkL--GSM available"));
+			FLOG(_L("CFMSInterruptAob::CheckNetworkL--checking GPRS"));
+			iConnMon.GetBoolAttribute( EBearerIdGPRS, 0,KPacketDataAvailability,
+					iGPRSAvail, status );
+			User::WaitForRequest(status);
+			if( iGPRSAvail && status.Int()==KErrNone )
+				{
+				FLOG(_L("CFMSInterruptAob::CheckNetworkL--GPRS available"));
+				return ETrue;
+				}
+			}
+		}
+	else if ( phonenotoffline && iBearer == EBearerIdWCDMA )
+		{
+		TRequestStatus gsmstatus = KRequestPending;	
+		iConnStatus = KErrNotFound;		
+		FLOG(_L("CFMSInterruptAob::CheckNetworkL--check WCDMA sim registry"));	
+		iConnMon.GetIntAttribute( EBearerIdWCDMA, 0,KNetworkRegistration, iConnStatus, gsmstatus );
+		User::WaitForRequest(gsmstatus);
+		FLOG(_L("iConnStatus is %d WCDMA gsmstatus is %d"),iConnStatus,gsmstatus.Int());
+		if( iConnStatus == ENetworkRegistrationHomeNetwork || 
+				iConnStatus == ENetworkRegistrationRoaming ) 
+			{
+			FLOG(_L("CFMSInterruptAob::CheckNetworkL--WCDMA GSM available"));
+			FLOG(_L("CFMSInterruptAob::CheckNetworkL--checking WCDMA GPRS"));
+			iConnMon.GetBoolAttribute( EBearerIdWCDMA, 0,KPacketDataAvailability,
+					iGPRSAvail, status );
+			User::WaitForRequest(status);
+			if( iGPRSAvail && status.Int()==KErrNone )
+				{
+				FLOG(_L("CFMSInterruptAob::CheckNetworkL--WCDMA GPRS available"));
+				return ETrue;
+				}
+			}
+		}
+	else if ( iBearer == EBearerIdWLAN )
+		{
+		FLOG(_L("CFMSInterruptAob::CheckNetworkL--checking WLAN"));	  
+		iWlanAvailable = EFalse;	  
+		iConnMon.GetBoolAttribute( EBearerIdWLAN, 
+				0, 
+				KBearerAvailability, 
+				iWlanAvailable, 
+				status );	
+		User::WaitForRequest(status);//Synchronous call
+		if( iWlanAvailable && status == KErrNone )
+			{
+			FLOG(_L("CFMSInterruptAob::CheckNetworkL--wlan available"));
+			return ETrue;
+			}
+		}
+	else //phone is offline
+		{
+		FLOG(_L("CFMSInterruptAob::CheckNetworkL--phone is offline or invalid bearer"));
+		}
+	FLOG(_L("CFMSInterruptAob::CheckNetworkL--end"));
+	return EFalse;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::CheckGlobalRFStateL() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSInterruptAob::CheckGlobalRFStateL()
+	{		
+	TInt val = KErrNone;
+	TInt err = KErrNone;
+	TInt status = EFalse;
+	err = RProperty::Get(KPSUidStartup, KPSGlobalSystemState, val);
+	if ( err == KErrNone && val == ESwStateNormalRfOn )
+		{
+		//Phone is not offline. Check for Network Registration status
+		FLOG(_L("Phone is online. Check for Network Registration status"));		
+		status = ETrue;
+		}
+	else
+		{
+		//Phone is offline. No Network activities allowed.
+		FLOG(_L("Phone is offline. No Network activities allowed."));		
+		status = EFalse;
+		}
+	FLOG(_L("CFotaNetworkRegStatus::CheckGlobalRFState, status = %d <<"),status);	
+	return status;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::StopServer() 
+// ----------------------------------------------------------------------------------------
+void CFMSInterruptAob::StopServer()
+	{
+	FLOG(_L("CFMSInterruptAob::StopServer begin"));	
+	iServer->iSessionCount = 0;
+	CActiveScheduler::Stop();//---for stopping the server
+	FLOG(_L("CFMSInterruptAob::StopServer:server stopped"));	
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::LaunchFotaEngineL() 
+// ----------------------------------------------------------------------------------------
+void CFMSInterruptAob::LaunchFotaEngineL()
+	{
+	FLOG(_L("CFMSInterruptAob::LaunchFotaEngineL call to iFotaEngine.OpenL() "));
+	TInt err = KErrNone;
+	TRAP(err,iFotaEngine.OpenL());
+	FLOG(_L("iFotaEngine.OpenL() launched withe error as %d"),err);
+	if(err == KErrNone)
+		{
+		err = iFotaEngine.TryResumeDownload();
+		FLOG(_L("iFotaEngine.TryResumeDownload() returns %d"),err);
+		iFotaEngine.Close();
+		FLOG(_L("CFMSInterruptAob::LaunchFotaEngineL END - fotaengine closed "));
+		}
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::CheckMemSizeL() 
+// ----------------------------------------------------------------------------------------
+void CFMSInterruptAob::CheckMemSizeL(/*TInt& aMemoryNeeded*/)
+	{
+	FLOG(_L("CFMSInterruptAob::CheckMemSizeL-begin"));
+	iSize = iSize + KDRIVECWARNINGTHRESHOLD; //irrespective of Drive
+	FLOG(_L(" neededspace = sizeNeededFromFS + KDRIVECWARNINGTHRESHOLD: %d"), iSize);
+	FLOG(_L("CFMSInterruptAob::CheckMemSizeL-end"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSInterruptAob::~CFMSInterruptAob() 
+// ----------------------------------------------------------------------------------------
+CFMSInterruptAob::~CFMSInterruptAob()
+	{ 
+	FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()"));  	
+	if(iPeriodicNwCheck)
+		{
+		FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()--deleting iPeriodicNwCheck"));
+		delete iPeriodicNwCheck;
+		iPeriodicNwCheck = NULL;
+		}
+	StopNotify();
+	Cancel();
+	iConnMon.Close();
+	if(iProperty.Handle())
+		{    	
+		iProperty.Close();
+		FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()--iProperty closed")); 
+		}
+	
+	if(iInterruptType == EMemoryInterrupt)
+		{
+		iFs.NotifyDiskSpaceCancel();
+		}
+	iFs.Close();	
+	if(iLine.SubSessionHandle())
+	    {
+	    iLine.Close();
+	    }
+	if(iPhone.SubSessionHandle())
+	    {
+	    iPhone.Close();
+	    }
+	if(iTelServer.Handle())
+	    {
+	    iTelServer.Close();
+	    }
+	FLOG(_L("CFMSInterruptAob::~CFMSInterruptAob()--End"));  
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFMSInterruptAob::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CFMSInterruptAob::RunError( TInt aError )
+	{
+	FLOG( _L("CAOConnectionImpl::RunError: aError: %d"), aError );        
+	return KErrNone;
+	}
+
+
+//
+// -----------------------------------------------------------------------------
+// CFMSInterruptAob::NotifyL()
+// Registers with connection monitor for notification
+// -----------------------------------------------------------------------------
+//
+void CFMSInterruptAob::NotifyL()
+	{
+	FLOG(_L("CFMSInterruptAob::NotifyL Begin  "));
+	iConnMon.NotifyEventL( *this );
+	FLOG(_L("CFMSInterruptAob::NotifyL, after registering  "));
+	// Threholds
+	TInt    err = iConnMon.SetUintAttribute( iBearer, 
+			0, 
+			KBearerAvailabilityThreshold, 
+			1 );    
+	FLOG(_L("CFMSInterruptAob::NotifyL : END "));
+
+	}
+
+
+// -----------------------------------------------------------------------------
+// CFMSInterruptAob::StopNotify()
+// Cancels notification with connection monitor
+// -----------------------------------------------------------------------------
+//
+void CFMSInterruptAob::StopNotify()
+	{
+	FLOG(_L("CFMSInterruptAob::StopNotify Begin  "));
+	iConnMon.CancelNotifications();
+	FLOG(_L("CFMSInterruptAob::StopNotify end "));
+	}	
+
+// -----------------------------------------------------------------------------
+// CNsmlNetworkStatusEngine::EventL()
+// Method involed by connection monitor with current event. 
+// This method handles the events
+// -----------------------------------------------------------------------------
+//
+void CFMSInterruptAob::EventL( const CConnMonEventBase& aConnMonEvent )
+	{
+	FLOG(_L("CFMSInterruptAob::EventL, BEGIN"));
+	FLOG(_L("CFMSInterruptAob::EventL event is ==  %d"), aConnMonEvent.EventType()  );
+	switch ( aConnMonEvent.EventType() )
+	{
+	case EConnMonNetworkStatusChange:
+		{
+		CConnMonBearerAvailabilityChange* eventBearerAvailabilityChange;
+		eventBearerAvailabilityChange = ( CConnMonBearerAvailabilityChange* ) &aConnMonEvent;
+
+		if ( eventBearerAvailabilityChange->ConnectionId() == iBearer )
+			{
+			if ( eventBearerAvailabilityChange->Availability() )
+				{
+				// Available            				
+				if(CheckNetworkL())
+					{
+					FLOG(_L("CFMSInterruptAob::EventL()--status GPRS up"));
+					LaunchFotaEngineL();
+					StopServer();	
+					}
+				else 
+					{
+					FLOG(_L("CFMSInterruptAob::EventL()--status GPRS not up-- but connmon triggererd"));
+					NotifyL();
+					}         				
+				} 
+			else
+				{
+				//check the phone status
+				// Not available            
+				FLOG(_L("CFMSInterruptAob::EventL()--search for GPRS connection not up"));	    			
+				NotifyL();	    	
+				}
+			}
+		break;
+		}
+	case EConnMonPacketDataAvailable:
+		{
+		CConnMonPacketDataAvailable* eventAvailable;
+		eventAvailable = ( CConnMonPacketDataAvailable* ) &aConnMonEvent;
+
+		if ( eventAvailable->ConnectionId() == iBearer )
+			{
+			// Available            				
+			if(CheckNetworkL())
+				{
+				FLOG(_L("CFMSInterruptAob::EventL()--status GPRS up"));
+				LaunchFotaEngineL();
+				StopServer();	
+				}
+			else 
+				{
+				FLOG(_L("CFMSInterruptAob::EventL()--status GPRS not up-- but connmon triggererd"));
+				NotifyL();
+				}         				
+			} 
+		else
+			{
+			//check the phone status
+			// Not available            
+			FLOG(_L("CFMSInterruptAob::EventL()--search for GPRS connection not up"));	    			
+			NotifyL();	    	
+			}
+		break;
+		}
+	default:
+	break;
+	}
+	}
+
+//------------------------------------------------------------
+// CFMSInterruptAob::SetWcdma
+//------------------------------------------------------------
+void CFMSInterruptAob::SetWcdma()
+	{
+	iWcdma = ETrue;
+	}
+
+//------------------------------------------------------------
+// CFMSInterruptAob::CheckNetworkRegistryL
+//------------------------------------------------------------
+void CFMSInterruptAob::StartNetworkRegistryCheckL()
+	{
+	FLOG(_L("CFMSInterruptAob::CheckNetworkRegistryL- begin"));	
+	iPeriodicNwCheck = CPeriodic::NewL (EPriorityNormal) ;
+	FLOG(_L("CFMSInterruptAob::CheckNetworkRegistryL:-iPeriodicNwCheck created)"));
+	iPeriodicNwCheck->Start(
+			TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*20)
+			, TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*25)
+			, TCallBack(StaticCheckNwRequestL,this) ) ;
+	FLOG(_L("CFMSInterruptAob::CheckNetworkRegistryL- End"));
+	}
+
+//------------------------------------------------------------
+// CFMSInterruptAob::StopNetworkRegistryCheckL
+//------------------------------------------------------------
+void CFMSInterruptAob::NetworkRegistryCheckL()
+	{
+	FLOG(_L("CFMSInterruptAob::StopNetworkRegistryCheckL- begin"));	
+	if(CheckNetworkL())
+		{
+		FLOG(_L("CFMSInterruptAob::StopNetworkRegistryCheckL-n/w found"));
+		if(iPeriodicNwCheck)
+			{
+			delete iPeriodicNwCheck;
+			iPeriodicNwCheck = NULL;
+			FLOG(_L("CFMSInterruptAob::iPeriodicNwCheck-deleted"));
+			}
+		LaunchFotaEngineL();
+		StopServer();
+		}	
+	FLOG(_L("CFMSInterruptAob::StopNetworkRegistryCheckL- End"));
+	}
+
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::StartBatteryMonitoringL
+// Starts the monitoring of Battery
+//----------------------------------------------------------------------------
+void CFMSInterruptAob::StartBatteryMonitoringL(TOmaUpdInterruptReason aType, TUint aLevel)
+	{	
+	FLOG(_L("CFMSInterruptAob::StartBatteryMonitoringL- begin"));
+	
+	__ASSERT_ALWAYS(aLevel > EBatteryLevelLevel0 && aLevel <=EBatteryLevelLevel7, User::Leave(KErrArgument));
+	
+	iUpdInterruptType = aType;
+if(iUpdInterruptType == EMonitorbattery)
+	{
+		FLOG(_L("CFMSInterruptAob::Start- EMonitorbattery"));
+		TInt value =0;
+		iChargeToMonitor = aLevel;
+		iProperty.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel);
+		TInt err=iProperty.Get(KPSUidHWRMPowerState,KHWRMBatteryLevel,value);
+		   if(err != KErrNone)
+		    { 
+		    	FLOG(_L("CFMSInterruptAob::StartBatteryMonitoringL- error  in getiing the battery level")); 
+		    	StopServer();
+		    }  
+		if(value >= iChargeToMonitor)
+		{  
+			  iProperty.Cancel();
+			  iProperty.Close();	
+			TRAPD(err1, LaunchFotaScheduleUpdate());
+			if (err1)
+			{
+				FLOG(_L("CFMSInterruptAob::error in LaunchFotaScheduleUpdateL()"));
+		  }
+		  
+		  StopServer();
+	  }
+	 else
+	 { 	  
+		if(!IsActive())
+			{
+			//RProperty pw;
+			FLOG(_L("CFMSInterruptAob::Start- attaching for battery"));
+			
+			iProperty.Attach(KPSUidHWRMPowerState,KHWRMBatteryLevel);
+			iStatus=KRequestPending;
+			iProperty.Subscribe(iStatus);	
+			SetActive();	
+			}
+		}	
+	}
+	FLOG(_L("CFMSInterruptAob::StartBatteryMonitoringL- end"));
+}	 
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::LaunchFotaScheduleUpdate
+// Launches the FOTA schedule dialog
+//----------------------------------------------------------------------------
+
+void CFMSInterruptAob::LaunchFotaScheduleUpdate()
+{
+	RFotaEngineSession fotaengine;
+	TRAPD(error,fotaengine.OpenL());
+	if(error == KErrNone)
+	  {
+		  	
+		  	
+	    FLOG(_L("CFMSInterruptAob::LaunchFotaScheduleUpdate()- going for update again"));
+	    TFotaScheduledUpdate           sched(-1,-1);   //trigger the Fota remainder dialog here..
+        TPckg<TFotaScheduledUpdate>    p(sched);
+        TRAPD(err, fotaengine.ScheduledUpdateL(sched));
+        if(err)
+         {
+             	  FLOG( _L( "[LaunchFotaScheduleUpdate()] FirmwareUpdate scheduling failed   " ) );              	
+         }
+        FLOG(_L("CFMSInterruptAob::LaunchFotaScheduleUpdate()- closing fota engine"));
+        iUpdInterruptType = ENoUpdInterrupt;
+        fotaengine.Close();	
+	   }
+	 else
+	  {
+		FLOG(_L("CFMSInterruptAob::LaunchFotaScheduleUpdate()- error in opening the fota engine"));
+		  	
+	  }
+}
+
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::CheckNetworkStatusL
+// Checks the network status
+//----------------------------------------------------------------------------
+void CFMSInterruptAob::CheckNetworkStatusL()
+{
+      if(CheckNetworkL()) 
+					{
+					FLOG(_L("CFMSInterruptAob::RunL()--charging & network found"));				
+					LaunchFotaEngineL();
+					StopServer();
+					}
+				else 
+					{				
+					FLOG(_L("CFMSInterruptAob::RunL()--charging but no network found & started monitoring"));
+					//StartNetWorkMonitoring
+					iServer->WriteToFile(ENetworkInterrupt, iBearer, EDriveC, 0, iWcdma);
+					StartL(ENetworkInterrupt);	  
+					}
+}		
+
+
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::HandleChargingInterruptL
+// Handle the cherging interrupt
+//----------------------------------------------------------------------------
+void CFMSInterruptAob::HandleChargingInterruptL()
+{
+	    iProperty.Cancel();
+			iProperty.Close();		
+			//check variation
+			if(iServer->NetworkTobeMonitered())
+				{			
+				//Check network status at this moment	
+			  	CheckNetworkStatusL();
+			
+				}
+			else
+				{
+				FLOG(_L("CFMSInterruptAob::RunL()--charging & network found"));				
+				LaunchFotaEngineL();
+				StopServer();				
+				}
+}		
+
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::HandleAboveCriticallevelL
+// Handle the meory above critical level
+//----------------------------------------------------------------------------
+void CFMSInterruptAob::HandleAboveCriticallevelL()
+{
+        if(iServer->NetworkTobeMonitered())
+					{
+					if(CheckNetworkL())
+						{	
+						FLOG(_L("CFMSInterruptAob::RunL()--memory avail & network found"));
+						//Notify fota server
+						LaunchFotaEngineL();
+						StopServer();			   
+						}
+					else
+						{
+						FLOG(_L("CFMSInterruptAob::RunL()--memory avail but no network found"));
+						//StartNetWorkMonitoring
+						iServer->WriteToFile(ENetworkInterrupt, iBearer, iDrive, 0, iWcdma);
+						StartL(ENetworkInterrupt);
+						}
+					}
+				else
+					{
+					FLOG(_L("CFMSInterruptAob::RunL()--memory avail & no network monitor "));
+					//Notify fota server
+					LaunchFotaEngineL();
+					StopServer();				
+					}
+}										
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::LaunchFotaUpdate
+// Launches the FOTA update dialog
+//----------------------------------------------------------------------------
+
+void CFMSInterruptAob::LaunchFotaUpdate(TInt& aPkgId, TInt& aProfileId)
+    {
+    RFotaEngineSession fotaengine;
+    TRAPD(error,fotaengine.OpenL());
+    if(error == KErrNone)
+        {
+        FLOG(_L("CFMSInterruptAob::LaunchFotaUpdate()- going for update pkgid:%d,profile:%d "),aPkgId,aProfileId);
+        TInt err=fotaengine.Update( aPkgId, aProfileId, KNullDesC8, KNullDesC8 );
+        if(err)
+            {
+            FLOG( _L( "LaunchFotaUpdate() failed   " ) );              	
+            }
+        FLOG(_L("CFMSInterruptAob::LaunchFotaUpdate()- closing fota engine"));
+        iUpdInterruptType = ENoUpdInterrupt;
+        fotaengine.Close();	
+        }
+    else
+        {
+        FLOG(_L("CFMSInterruptAob::LaunchFotaUpdate()- error in opening the fota engine"));
+        }
+    }
+
+
+
+//----------------------------------------------------------------------------
+// CFMSInterruptAob::StartCallEndMonitoringL
+// starts monitoring for call end 
+//----------------------------------------------------------------------------
+void CFMSInterruptAob::StartCallEndMonitoringL(TOmaUpdInterruptReason aType)
+    {    
+    if(!IsActive())
+        {
+        FLOG(_L("Starting Call End Monitoring:Begin"));
+        iUpdInterruptType = aType;        
+        User::LeaveIfError(iTelServer.Connect());
+        _LIT(KTsyName, "phonetsy.tsy");//TSY module names wouldn't change 
+        RTelServer::TPhoneInfo info;
+        RPhone::TLineInfo lineInfo;        
+        User::LeaveIfError(iTelServer.LoadPhoneModule(KTsyName));
+        // Get the details for the first (and only) phone.
+        User::LeaveIfError(iTelServer.GetPhoneInfo(0, info));
+        // Open the phone.
+        User::LeaveIfError(iPhone.Open(iTelServer, info.iName));
+        iPhone.Initialise();
+        TInt numberLines = 0;
+        User::LeaveIfError(iPhone.EnumerateLines(numberLines));
+        TBool foundLine = EFalse;
+        for (TInt a = 0; a < numberLines; a++)
+            {
+            User::LeaveIfError(iPhone.GetLineInfo(a, lineInfo));
+            if (lineInfo.iLineCapsFlags & RLine::KCapsVoice)
+                {
+                foundLine = ETrue;
+                break;
+                }
+            }
+        if (!foundLine)
+            {
+            User::Leave(KErrNotFound);
+            }
+        User::LeaveIfError(iLine.Open(iPhone, lineInfo.iName));
+        iCallStatus = RCall::EStatusIdle;
+        iLine.NotifyStatusChange(iStatus, iCallStatus);
+        SetActive();
+        }
+    FLOG(_L("Starting Call End Monitoring: end"));
+    }
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/src/fmsserver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,723 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#include <systemwarninglevels.hrh>
+#include <e32property.h>
+#include <bldvariant.hrh>
+#include <startupdomainpskeys.h>
+#include <hwrmpowerstatesdkpskeys.h>
+#include <f32file.h>
+#include <sysutil.h> 
+#include <centralrepository.h>
+#include <ctsydomainpskeys.h>
+#include "fotaserverPrivateCRKeys.h"
+#include "fmsserver.h"
+#include "fmsinterruptaob.h"
+#include "fmsclientserver.h"
+#include "fmsserversession.h"
+
+
+// ----------------------------------------------------------------------------------------
+// Server startup code
+// ----------------------------------------------------------------------------------------
+static void RunServerL()
+	{
+	// naming the server thread after the server helps to debug panics
+	User::LeaveIfError(User::RenameThread(KFMSServerName)); 
+
+	// create and install the active scheduler
+	CActiveScheduler* s=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(s);
+	CActiveScheduler::Install(s);
+
+	// create the server (leave it on the cleanup stack)
+	CFMSServer::NewLC();
+
+	// Initialisation complete, now signal the client
+	RProcess::Rendezvous(KErrNone);
+
+	// Ready to run
+	CActiveScheduler::Start();
+
+	// Cleanup the server and scheduler
+	CleanupStack::PopAndDestroy(2);
+	}
+
+
+// ----------------------------------------------------------------------------------------
+// static method LogNwRequestL() called to submit async n/w request
+// ----------------------------------------------------------------------------------------
+static TInt LogNwRequestL(TAny* aPtr)
+	{
+	CFMSServer* ptr = (CFMSServer*) aPtr;
+	FLOG(_L("static LogNwRequestL:-Begin"));
+	TRAPD(err, ptr->StartMonitoringL(ENetworkInterrupt));
+	FLOG(_L("LogNwRequestL started monitoring"));
+	ptr->StopAsyncRequest();
+	FLOG(_L("static LogNwRequestL:-end"));
+	return err;
+	}
+
+
+// ----------------------------------------------------------------------------------------
+// static method LogCallEndMonitorRequestL() called to submit async call end monitor request
+// ----------------------------------------------------------------------------------------
+static TInt LogCallEndMonitorRequestL(TAny* aPtr)
+    {
+    CFMSServer* ptr = (CFMSServer*) aPtr;
+    FLOG(_L("static LogCallEndMonitorRequestL:-Begin"));
+    TRAPD(err, ptr->StartUpdateInterruptMonitoringL(EMonitorPhoneCallEnd));
+    FLOG(_L("LogCallEndMonitorRequestL started monitoring"));
+    ptr->StopAsyncRequest();
+    FLOG(_L("static LogCallEndMonitorRequestL:-end"));
+	return err;
+	}
+
+// ----------------------------------------------------------------------------------------
+// Server process entry-point
+// ----------------------------------------------------------------------------------------
+TInt E32Main()
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	TInt r=KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(r,RunServerL());
+		delete cleanup;
+		}
+	__UHEAP_MARKEND;
+	return r;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::NewLC
+// ----------------------------------------------------------------------------------------
+CServer2* CFMSServer::NewLC()
+{
+CFMSServer* self=new(ELeave) CFMSServer;
+CleanupStack::PushL(self);
+self->ConstructL();	
+return self;
+}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::ConstructL
+// ----------------------------------------------------------------------------------------
+void CFMSServer::ConstructL()
+	{
+	FLOG(_L("CFMSServer::ConstructL- begin"));
+	StartL(KFMSServerName);		
+	User::LeaveIfError( iFs.Connect() );
+	TInt err;
+	err = iFs.CreatePrivatePath(EDriveC);
+	if ( err != KErrNone && err != KErrAlreadyExists )
+		{ User::Leave (err); }
+	User::LeaveIfError( iFs.SetSessionToPrivate( EDriveC ) );
+	err = iFile.Create(iFs,KFotaInterruptFileName,EFileWrite);
+	if(err == KErrNone)//means file created now and opened
+		{
+		FLOG(_L("CFMSServer::ConstructL- file closed"));
+		iFile.Close();
+		}
+	else if( err != KErrAlreadyExists )
+		{
+		FLOG(_L("CFMSServer::ConstructL- leaving with err as %d"),err);
+		User::Leave(err);
+		}
+	FindVariation();
+	iFMSInterruptAob.ConstructL();
+	iFMSInterruptAob.iServer = this;  
+	FLOG(_L("CFMSServer::ConstructL- end"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::CFMSServer() 
+// ----------------------------------------------------------------------------------------
+CFMSServer::CFMSServer() :CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/
+	{	
+	iSessionCount = 0;
+	//iNetworkMon = ETrue; //Incase of cenrep key has problem
+	iNetworkMon = EFalse; 
+	iChargerMon = EFalse;
+	iPhoneRestartMon = EFalse;
+	iMemoryMon = EFalse;
+	iDeleteFile = ETrue;
+	iLogAsyncRequest = NULL;
+	iProfileId = EFalse;
+	iPkgId = EFalse;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::MemoryToMonitorL() 
+// ----------------------------------------------------------------------------------------
+void CFMSServer::MemoryToMonitorL(TInt aSize, TDriveNumber aDrive)
+	{
+	if( iSessionCount == 0 )// no pending request
+		{
+		iFMSInterruptAob.MemoryToMonitorL(aSize,aDrive);
+		}
+	}
+// ----------------------------------------------------------------------------------------
+// CFMSServer::NetworkTypeL() 
+// ----------------------------------------------------------------------------------------
+void CFMSServer::NetworkTypeL(TInt aBearer)
+	{
+	if( iSessionCount == 0 )// no pending request
+		{
+		iFMSInterruptAob.NetworkTypeL(aBearer);
+		}
+	}
+
+//------------------------------------------------------------
+// Call from session class in fotastartup  case 
+// CFMSServer::CheckNetworkL
+//------------------------------------------------------------
+void CFMSServer::CheckNetworkL(TInt& aBearerId, TInt& aDrive, TInt& aSize,
+		TBool& aWcdma)
+	{
+	if(iNetworkMon)//n/w monitoring supports
+		{
+		FLOG(_L("CFMSServer::CheckNetworkL- n/w monitor supported"));
+		if(iFMSInterruptAob.CheckNetworkL()) //not n/w interrupt + WLAN or GPRS
+			{
+			FLOG(_L("CFMSServer::CheckNetworkL- n/w mon supported & launch fota"));
+			iFMSInterruptAob.LaunchFotaEngineL();		
+			DropSession(); // to close the session & server
+			return;
+			}			
+		else //if network not up, monitor for that
+			{
+			//from session itself we set the bearer type
+			FLOG(_L("CFMSServer::CheckNetworkL- n/w not up beaerer 3G %d"),aWcdma);
+			WriteToFile(ENetworkInterrupt,aBearerId,
+					(TDriveNumber)aDrive, aSize, aWcdma );
+			StartMonitoringL(ENetworkInterrupt);
+			}
+		}
+	else //user interrupt or general interrupt dont check n/w call fota
+		{
+		FLOG(_L("CFMSServer::CheckNetworkL- n/w monitor not supported & launch fota"));		
+		iFMSInterruptAob.LaunchFotaEngineL();
+		FLOG(_L("CFMSServer::CheckNetworkL- stop server"));		
+		DropSession();
+		}
+	}
+
+//------------------------------------------------------------
+// Call from session class in hard reboot only 
+// CFMSServer::TriggerFotaL
+//------------------------------------------------------------
+void CFMSServer::TriggerFotaL()
+	{
+	FLOG(_L("CFMSServer::TriggerFotaL- begin"));	
+	if(iNetworkMon)//n/w monitoring supports
+		{
+		FLOG(_L("CFMSServer::TriggerFotaL- n/w monitor supported"));
+		if(iFMSInterruptAob.CheckNetworkL()) 
+			{
+			FLOG(_L("CFMSServer::TriggerFotaL- n/w mon supported & launch fota"));
+			iFMSInterruptAob.LaunchFotaEngineL();				
+			}
+		else if(iFMSInterruptAob.CheckGlobalRFStateL())
+			{
+			FLOG(_L("CFMSServer::TriggerFotaL- n/w check started"));
+			iFMSInterruptAob.StartNetworkRegistryCheckL();
+			return; //dont call drop session as it closes server
+			}
+		else
+			{
+			FLOG(_L("CFMSServer::TriggerFotaL- phone is offline"));			
+			}
+		}
+	else //user interrupt or general interrupt dont check n/w call fota
+		{
+		FLOG(_L("CFMSServer::TriggerFotaL- n/w monitor not supported & launch fota"));		
+		iFMSInterruptAob.LaunchFotaEngineL();		
+		FLOG(_L("CFMSServer::TriggerFotaL- stop server"));			
+		}
+	DropSession(); // to close the session & server in any case
+	FLOG(_L("CFMSServer::TriggerFotaL- End"));
+	}
+
+//------------------------------------------------------------
+// Called only in n/w interrupt+ WLAN case from session class
+// CFMSServer::CheckWlanL
+//------------------------------------------------------------
+TBool CFMSServer::CheckWlanL()
+	{
+	return iFMSInterruptAob.CheckNetworkL();
+	}
+
+//------------------------------------------------------------
+// CFMSServer::SetWcdma
+//------------------------------------------------------------
+void CFMSServer::SetWcdma()
+	{
+	iFMSInterruptAob.SetWcdma();
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::LockSession() 
+// ----------------------------------------------------------------------------------------
+void CFMSServer::LockSession()
+	{
+	iSessionCount++;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::WriteToFile() 
+// ----------------------------------------------------------------------------------------
+void CFMSServer::WriteToFile(TInt aReason, TInt aBearer,TDriveNumber aDrive,
+		TInt aSize, TBool aWcdmaBearer )
+	{
+	if(iSessionCount == 0)
+		{
+		FLOG(_L("CFMSServer::WriteToFile- begin"));
+		TInt err=iFile.Open(iFs,KFotaInterruptFileName,EFileWrite);
+		if(err == KErrNone)
+			{
+			FLOG(_L("CFMSServer::WriteToFile--passed"));
+			TBuf8<30> data;//size 30 or 32--as args is 16 bytes
+			TBuf8<30> temp;
+			temp.Num(aReason);
+			data.Append(temp);
+			data.Append(',');
+			temp.Num(aBearer);// or use iFMSinterruptAob's iBearer
+			data.Append(temp);
+			data.Append(',');
+			temp.Num((TInt)aDrive);
+			data.Append(temp);
+			data.Append(',');
+			temp.Num(aSize);  
+			data.Append(temp);
+			data.Append(',');
+			temp.Num(aWcdmaBearer);
+			data.Append(temp);
+			iFile.Write(data);
+			iFile.Close();
+			}
+		else
+			FLOG(_L("CFMSServer::WriteToFile- Failed"));
+		}
+	else
+		FLOG(_L("CFMSServer::WriteToFile- not done as another request is there"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::ReadFromFile() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSServer::ReadFromFile(TInt& aReason, TInt& aBearer, TInt& aDrive, TInt& aSize
+		, TInt& aWcdmaBearer )
+	{
+	TInt err = iFile.Open(iFs,KFotaInterruptFileName,EFileRead);
+	FLOG(_L("CFMSServer::ReadFromFile() error as %d"),err);
+	if(err == KErrNone)
+		{
+		TInt size = KErrNone;
+		err = iFile.Size(size);	
+		if(size == 0) //file empty
+			{
+			FLOG(_L("CFMSServer::ReadFromFile() file size is empty"));
+			iFile.Close();
+			return EFalse;		
+			}
+		TBuf8<30> data;
+		iFile.Read(data);
+		iFile.Close();	
+		TBuf8<30> data1;    
+		if(data.Length()>0)
+			{
+			TInt len =0 ;
+			if((len=data.LocateF(',')) > 0)
+				{
+				TLex8 value( data.Left(len));            
+				value.Val(aReason);
+				FLOG(_L("CFMSServer::ReadFromFile() retrieving reason as %d"),aReason);
+				data1.Insert(0,data.Right(data.Length()-(len+1)));
+				data.Zero();
+				//    len=data1.LocateF(',');
+				if( data1.Length() > 0 && (len=data1.LocateF(',')) > 0)
+					{
+					value=data1.Left(len);            
+					value.Val(aBearer);  
+					FLOG(_L("CFMSServer::ReadFromFile() retrieving aBearer as %d"),aBearer);
+					data.Insert(0,data1.Right(data1.Length()-(len+1)));            
+					data1.Zero();
+					//  len=data.LocateF(','); 
+					if(data.Length() > 0 && (  len=data.LocateF(','))> 0)
+						{
+						value=data.Left(len);            
+						value.Val(aDrive);
+						FLOG(_L("CFMSServer::ReadFromFile() retrieving aDrive as %d"),aDrive);
+						data1.Insert(0,data.Right(data.Length()-(len+1)));
+						data.Zero();
+						if(data1.Length() > 0 && (  len=data1.LocateF(','))> 0 )
+							{
+							value=data1.Left(len);
+							value.Val(aSize);
+							FLOG(_L("CFMSServer::ReadFromFile() retrieving aSize as %d"),aSize);
+							data.Insert(0,data1.Right(data1.Length()-len-1));
+							data1.Zero();
+							if(data.Length() > 0 )
+								{
+								value=data;  
+								value.Val(aWcdmaBearer);
+								FLOG(_L("CFMSServer::ReadFromFile() retrieving aWcdmaBearer as %d"),aWcdmaBearer);
+								}
+							}
+						} 
+					}
+				}    
+			}
+		}
+	else
+		{
+		return EFalse;
+		}
+	return ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSServer::DropSession()
+// -----------------------------------------------------------------------------
+
+void CFMSServer::DropSession()
+	{
+	// A session is being destroyed	
+	iSessionCount = 0;	
+	//Kill the server
+	CActiveScheduler::Stop();	
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::FindVariation() 
+// ----------------------------------------------------------------------------------------
+void CFMSServer::FindVariation()
+	{
+	FLOG(_L("CFMSServer::FindVariation()"));
+	CRepository* centrep = NULL;
+	TInt variation = 1;
+	TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+	if ( centrep )
+		{
+		FLOG(_L("CFMSServer::FindVariation()::Inside cenrep if"));
+		TInt err = centrep->Get( KFotaMonitoryServiceEnabled, variation );                 
+		if( err == KErrNone)
+			{ 
+			FLOG(_L("CFMSServer::FindVariation()::cenrep key found with %d"),variation);
+			}
+		delete centrep;
+		}
+	if ( err == KErrNone )
+		{
+		TBuf<10> var; //32-bit has max of 10 chars in Decimal
+		var.Num(variation,EBinary);
+		TInt size = var.Length(), maxlen = 4;
+		if( size < maxlen)
+			{
+			TBuf<4> temp;
+			temp.AppendFill('0',maxlen-size);
+			temp.Append(var);
+			var.Zero();
+			var.Append(temp);
+			}
+		var.AppendFill('0',6);
+		if( var[0] == '1' )//memory
+			{
+			FLOG(_L("CFMSServer::FindVariation():: memory monitor supported"));    		
+			iMemoryMon = ETrue;
+			}
+		if( var[1] == '1' ) //startup
+			{
+			FLOG(_L("CFMSServer::FindVariation()::Phone restart monitor supported"));
+			iPhoneRestartMon = ETrue;
+			}
+		if( var[2] == '1' )//user or charger
+			{			
+			FLOG(_L("CFMSServer::FindVariation()::charger monitor supported"));    		
+			iChargerMon = ETrue;
+			}
+		if( var[3] == '1' )//newtwork
+			{
+			FLOG(_L("CFMSServer::FindVariation()::network monitor supported"));
+			iNetworkMon = ETrue;
+			}    	
+		}	
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::ChargerTobeMonitered() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSServer::ChargerTobeMonitered()
+	{
+	FLOG(_L("CFMSServer::ChargerTobeMonitered()::charger monitor check"));
+	return iChargerMon;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::NetworkTobeMonitered() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSServer::NetworkTobeMonitered()
+	{
+	FLOG(_L("CFMSServer::NetworkTobeMonitered()::network monitor check"));
+	return iNetworkMon;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::MoniterAfterPhoneRestart() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSServer::MoniterAfterPhoneRestart()
+	{
+	FLOG(_L("CFMSServer::MoniterAfterPhoneRestart()::phonerestart monitor check"));
+	return iPhoneRestartMon;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::MemoryTobeMonitered() 
+// ----------------------------------------------------------------------------------------
+TBool CFMSServer::MemoryTobeMonitered()
+	{
+	FLOG(_L("CFMSServer::MemoryTobeMonitered()::memory monitor check"));
+	return iMemoryMon;
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSServer::StartMonitoring()
+// -----------------------------------------------------------------------------
+void CFMSServer::StartMonitoringL(TOmaDLInterruptReason aType)
+	{
+	// A new session is being created	
+	FLOG(_L("CFMSServer::StartMonitoringL>>"));
+	if( iSessionCount == 0 ) 
+		{
+		++iSessionCount;		
+		iFMSInterruptAob.StartL(aType);
+		}
+		FLOG(_L("CFMSServer::StartMonitoringL<<"));
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSServer::DeleteFile()
+// -----------------------------------------------------------------------------
+void CFMSServer::DeleteFile(TBool aValue)
+	{	
+	iDeleteFile = aValue;
+	}
+// ----------------------------------------------------------------------------------------
+// CFMSServer::~CFMSServer() 
+// ----------------------------------------------------------------------------------------
+CFMSServer::~CFMSServer()
+{
+FLOG(_L("CFMSServer::~CFMSServer())"));
+//iFMSInterruptAob.Cancel();
+if(iDeleteFile)
+	{
+	TInt err = iFs.Delete(KFotaInterruptFileName);
+	FLOG(_L("CFMSServer::~CFMSServer() File Deleted with error as %d"),err);
+	}
+if(iLogAsyncRequest)
+	{
+	FLOG(_L("CFMSServer::~CFMSServer():-iLogAsyncRequest cancel)"));
+	iLogAsyncRequest->Cancel();
+	delete iLogAsyncRequest;
+	iLogAsyncRequest = NULL;
+	}
+iFs.Close();	
+}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::NewSessionL() 
+// ----------------------------------------------------------------------------------------
+CSession2* CFMSServer::NewSessionL(const TVersion&,const RMessage2&) const
+{
+return new (ELeave) CFMSSession();
+}
+
+// ----------------------------------------------------------------------------------------
+// CFMSServer::RequestPending() 
+// Any request pending
+// ----------------------------------------------------------------------------------------
+TBool CFMSServer::RequestPending()
+	{
+	if( iSessionCount > 0 )
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+// ----------------------------------------------------------------------------
+// CFMSServer::AsyncSessionRequestL() 
+// Asynchronous request logging
+// ----------------------------------------------------------------------------
+void CFMSServer::AsyncSessionRequestL()
+	{
+	if(iLogAsyncRequest)
+		{
+		FLOG(_L("CFMSServer::AsyncSessionRequestL():-iLogAsyncRequest cancel)"));
+		iLogAsyncRequest->Cancel();
+		delete iLogAsyncRequest;
+		iLogAsyncRequest = NULL;
+		}
+	iLogAsyncRequest = CPeriodic::NewL (EPriorityNormal) ;
+	FLOG(_L("CFMSServer::AsyncSessionRequestL():-iLogAsyncRequest created)"));
+	iLogAsyncRequest->Start(
+			TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
+			, TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
+			, TCallBack(LogNwRequestL,this) ) ;
+	FLOG(_L("CFMSServer::AsyncSessionRequestL():-Request logged)"));
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSServer::AsyncSessionRequestL() 
+// Asynchronous request logging
+// -----------------------------------------------------------------------------
+void CFMSServer::StopAsyncRequest()
+	{
+	FLOG(_L("CFMSServer::StopAsyncRequest():-Begin)"));
+	if(iLogAsyncRequest)
+		{
+		FLOG(_L("CFMSServer::StopAsyncRequest():-cancelling the request)"));
+		iLogAsyncRequest->Cancel();
+		delete iLogAsyncRequest;
+		iLogAsyncRequest = NULL;
+		}
+	FLOG(_L("CFMSServer::StopAsyncRequest():-End)"));
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSServer::StartBatteryMonitoringL() 
+// Monitors for the battery
+// -----------------------------------------------------------------------------
+void CFMSServer::StartBatteryMonitoringL(TOmaUpdInterruptReason aType, TUint aLevel)
+	{
+	// A new session is being created	
+	FLOG(_L("CFMSServer::StartMonitoringL, level = %d>>"), aLevel);
+	if( iSessionCount == 0 ) 
+		{
+		++iSessionCount;		
+		iFMSInterruptAob.StartBatteryMonitoringL(aType, aLevel);
+		}
+		FLOG(_L("CFMSServer::StartMonitoringL<<"));
+	}
+// -----------------------------------------------------------------------------
+// CFMSServer::StartUpdateInterruptMonitoringL() 
+// Monitors for the update interrupt type
+// -----------------------------------------------------------------------------
+void CFMSServer::StartUpdateInterruptMonitoringL(TOmaUpdInterruptReason aType)
+	{
+	// A new session is being created	
+	FLOG(_L("CFMSServer::StartUpdateInterruptMonitoringL>>"));
+	if(EMonitorPhoneCallEnd == aType)
+	    {
+	    iFMSInterruptAob.StartCallEndMonitoringL(aType);
+	    }
+	else
+	    {
+	    FLOG(_L("reason unknown"));
+	    }
+		FLOG(_L("CFMSServer::StartUpdateInterruptMonitoringL<<"));
+	}
+
+// -----------------------------------------------------------------------------
+// CFMSServer::CheckPhoneCallActiveL() 
+// checks any phone call is there or not at this moment
+// -----------------------------------------------------------------------------
+void CFMSServer::CheckPhoneCallActiveL(TInt& aStatus)
+    {
+    FLOG(_L("CFMSServer::CheckPhoneCallActiveL>>"));
+    TInt callstatus(KErrNotFound);
+    RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, callstatus);
+    //check ctsydomainpskeys.h for different combinations, below OR condition holds good
+    if(EPSCTsyCallStateUninitialized == callstatus || 
+            EPSCTsyCallStateNone == callstatus ) // call not active
+        {
+        aStatus = EFalse;
+        }
+    else // call active
+        {
+        aStatus = ETrue;
+        }
+    FLOG(_L("CFMSServer::CheckPhoneCallActiveL status is %d<<"),aStatus);
+    }
+
+// -----------------------------------------------------------------------------
+// CFMSServer::MonitorPhoneCallEndL() 
+// Monitors for active phone call end
+// -----------------------------------------------------------------------------
+TBool CFMSServer::MonitorPhoneCallEndL(TInt aPkgId, TInt aProfileId)
+    {
+    TInt CallState = KErrNotFound;
+    iPkgId=aPkgId;
+    iProfileId = aProfileId;
+    FLOG(_L(" iPkgId:%d,iProfileId:%d<<"),iPkgId,iProfileId);
+    CheckPhoneCallActiveL(CallState);
+    if(CallState)
+        {
+        //go for call end montioring
+        LogAsyncCallMonitorL();
+        return EFalse;
+        }
+    else //trigger fota to show install query
+        {
+        iFMSInterruptAob.LaunchFotaUpdate(iPkgId,iProfileId);
+        return ETrue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFMSServer::LogAsyncCallMonitorL() 
+// Async request to monitor active phone call end
+// -----------------------------------------------------------------------------
+void CFMSServer::LogAsyncCallMonitorL()
+    {
+    if(iLogAsyncRequest)
+        {
+        FLOG(_L("CFMSServer::LogAsyncCallMonitorL():- cancel)"));
+        iLogAsyncRequest->Cancel();
+        delete iLogAsyncRequest;
+        iLogAsyncRequest = NULL;
+        }
+    iLogAsyncRequest = CPeriodic::NewL (EPriorityNormal) ;
+    FLOG(_L("CFMSServer::LogAsyncCallMonitorL(): created)"));
+    iLogAsyncRequest->Start(
+            TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*1)
+            , TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
+            , TCallBack(LogCallEndMonitorRequestL,this) ) ;
+    FLOG(_L("CFMSServer::LogAsyncCallMonitorL():-Request logged)"));
+    }
+
+// -----------------------------------------------------------------------------
+// CFMSServer::PkgId()) 
+// returns the PkgId of the FOTA update
+// -----------------------------------------------------------------------------
+TInt& CFMSServer::PkgId()
+    {
+    return iPkgId;
+    }
+
+// -----------------------------------------------------------------------------
+// CFMSServer::ProfileId() 
+// returns the ProfileId of the FOTA
+// -----------------------------------------------------------------------------
+TInt& CFMSServer::ProfileId()
+    {
+    return iProfileId;
+    }
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fmserver/src/fmsserversession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,496 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+#include <f32file.h>
+#include <cmconnectionmethoddef.h>
+#include <cmmanagerext.h>
+#include <cmpluginwlandef.h>
+#include <cmpluginpacketdatadef.h>
+#include <etel.h> //for telephone mode
+#include <etelmm.h> //for telephone mode
+#include <fotaConst.h> 
+#include "fmsserversession.h"
+#include "fmsclientserver.h"
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::CFMSSession
+// ----------------------------------------------------------------------------------------
+CFMSSession::CFMSSession()
+	{	
+	iStopServer  =  EFalse;
+	iWlanbearer  =  EFalse;
+	iWcdmaBearer =  EFalse;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::~CFMSSession
+// ----------------------------------------------------------------------------------------
+CFMSSession::~CFMSSession()
+	{	
+	FLOG(_L("CFMSSession::~CFMSSession-- begin"));
+	if( iStopServer )
+		{
+		FLOG(_L("Stop fmserver CFMSSession::~CFMSSession"));	
+		Server().DropSession();
+		}
+	FLOG(_L("CFMSSession::~CFMSSession-- end"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::Server
+// ----------------------------------------------------------------------------------------
+CFMSServer& CFMSSession::Server()
+	{
+	return *static_cast<CFMSServer*>(const_cast<CServer2*>(CSession2::Server()));
+	}
+
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::CheckClientSecureIdL
+// ----------------------------------------------------------------------------------------
+TBool CFMSSession::CheckClientSecureIdL (
+		const RMessage2& aMessage)
+	{
+	TUid    fota            = TUid::Uid( KFotaServerUid );
+	TUid    starter         = TUid::Uid( KStarterUid );
+
+	// Fotaserver
+	if ( aMessage.SecureId() == fota.iUid ) 
+		{
+		FLOG(_L("[CFMSSession] CheckClientSecureIdL client is \
+		fotaserver!"));
+		return ETrue;
+		}
+
+	// Starter
+	if ( aMessage.SecureId() == starter.iUid )
+		{
+		return ETrue;
+		}
+
+	// test app
+	if ( aMessage.SecureId() == 0x01D278B9 )
+		{
+		return ETrue;
+		}
+
+	FLOG(_L("[CFMSSession] CheckClientSecureIdL client 0x%X is unknown \
+	(msg %d), bailing out"),aMessage.SecureId().iId, aMessage.Function());
+	iStopServer = ETrue;
+	User::Leave( KErrAccessDenied );    
+	return EFalse; // compiler warning otherwise
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::ServiceL
+// ----------------------------------------------------------------------------------------
+void CFMSSession::ServiceL(const RMessage2& aMessage)
+	{	
+	RThread clt; aMessage.ClientL(clt); TFullName cltnm = clt.FullName();
+	FLOG(_L( "CFMSSession::ServiceL      %d   serving for %S?" )
+			,aMessage.Function(), &cltnm );
+	if( CheckClientSecureIdL( aMessage ) )
+		{
+		//already one request pending
+		if( Server().RequestPending() && 
+				aMessage.Function() !=  ECancelOutstandingRequest )
+			{
+			aMessage.Complete(KErrCancel);
+			}
+		else //For no pending request case
+			{
+			TRAPD(err,DispatchMessageL(aMessage));
+			if(err != KErrNone ) 
+				{
+				iStopServer = ETrue;
+				}
+			aMessage.Complete(err);
+			}
+		}
+	else
+		{
+		aMessage.Complete(KErrAccessDenied);
+		}
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::ServiceError
+// ----------------------------------------------------------------------------------------
+void CFMSSession::ServiceError(const RMessage2& aMessage,TInt aError)
+	{		
+	CSession2::ServiceError(aMessage,aError);
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::DispatchMessageL
+// ----------------------------------------------------------------------------------------
+void CFMSSession::DispatchMessageL(const RMessage2& aMessage)
+	{	
+	FLOG(_L("CFMSSession::DispatchMessageL-begin"));
+
+	if( aMessage.Function() != EFotaStartUpPlugin && 
+			aMessage.Function() != ECancelOutstandingRequest && 
+			aMessage.Function() != EMonitorbattery &&
+			aMessage.Function() != EPhoneCallActive &&
+	        aMessage.Function() != EMonitorPhoneCallEnd )
+		{
+		 
+		 HandleBasedOnBearertypeL(aMessage);
+		
+			
+						
+		}
+	switch(aMessage.Function())
+	{
+	case EUserInterrupt:
+		{
+		if(Server().ChargerTobeMonitered())
+			{	
+			FLOG(_L("FMSSErver::EUserInterrupt"));			
+			Server().WriteToFile(EUserInterrupt,aMessage.Int0(),
+					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);
+			Server().StartMonitoringL(EUserInterrupt);					    
+			}
+		else
+			{
+			WriteDummyFile();
+			iStopServer = ETrue;
+			}
+		}
+		break;
+	case ENetworkInterrupt:
+		{
+		if(Server().NetworkTobeMonitered())
+			{
+			FLOG(_L("FMSSErver::ENetworkInterrupt"));						
+			//If wlan = on & network interrupt, then stop the server and dont monitor
+			//mean other wlan n/w's present but this wlan gone off
+			if(iWlanbearer && Server().CheckWlanL())
+				{
+				WriteDummyFile();
+				Server().DeleteFile(EFalse);
+				iStopServer = ETrue;
+				break;
+				}			
+			Server().WriteToFile(ENetworkInterrupt,aMessage.Int0(),
+					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);			
+			Server().AsyncSessionRequestL();
+			}
+		else
+			{
+			WriteDummyFile();
+			iStopServer = ETrue;
+			}
+		}
+		break;
+	case EMemoryInterrupt:
+		{			
+		if(Server().MemoryTobeMonitered())
+			{
+			FLOG(_L("FMSSErver::EMemoryInterrupt"));				
+			Server().MemoryToMonitorL(aMessage.Int2(),(TDriveNumber)aMessage.Int1()); 		
+			Server().WriteToFile(EMemoryInterrupt,aMessage.Int0(),
+					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);
+			Server().StartMonitoringL(EMemoryInterrupt);		
+			}
+		else
+			{
+			WriteDummyFile();
+			iStopServer = ETrue;
+			}
+		}
+		break;
+	case EGeneralInterrupt:
+		{
+		if(Server().ChargerTobeMonitered())
+			{
+			FLOG(_L("FMSSErver::GeneralInterrupt"));	
+			Server().WriteToFile(EUserInterrupt,aMessage.Int0(),
+					(TDriveNumber)aMessage.Int1(),aMessage.Int2(),iWcdmaBearer);
+			Server().StartMonitoringL(EUserInterrupt);
+			}
+		else
+			{
+			WriteDummyFile();
+			iStopServer = ETrue;
+			}
+		}
+		break;
+	case EFotaStartUpPlugin:
+		{	
+		if(Server().MoniterAfterPhoneRestart())				
+			{
+			FLOG(_L("CFMSSession::EFotaStartUpPlugin"));	
+			TInt intrreason(-1),bearer(-1),size(0);
+			TInt drive(-1), wcdmabearer(-1);
+			//if loop for Hard reboot--no file or size is empty
+			if(Server().ReadFromFile(intrreason,bearer,drive,size,wcdmabearer) == EFalse )
+				{
+				FLOG(_L("CFMSSession::EFotaStartUpPlugin no file or size is empty"));
+				if(!Server().RequestPending())
+					{	
+					FLOG(_L("CFMSSession::EFotaStartUpPlugin-no request pending"));						  					  	
+					TRAPD(err,PhoneModeL());
+					if(err); // remove compiler warning
+					FLOG(_L("PhoneModeL() fotastartup returns err as %d"),err);
+					if(iWcdmaBearer)						 
+						Server().NetworkTypeL( (TInt)EBearerIdWCDMA );
+
+					else
+						Server().NetworkTypeL( (TInt)EBearerIdGPRS );	  					  					  
+					Server().LockSession();
+					Server().TriggerFotaL(); //checks n/w & trigger FOTA DL						
+					}
+				break;
+				}												
+			TUint32 BearerId = FindBearerIdL(bearer);
+			FLOG(_L("CFMSSession::EFotaStartUpPlugin wcdma bearer is %d"),wcdmabearer);
+			if( BearerId == KUidWlanBearerType )
+				{
+				FLOG(_L("CFMSSession::EFotaStartUpPlugin-wlan bearer"));	
+				Server().NetworkTypeL(EBearerIdWLAN);
+				if(intrreason == ENetworkInterrupt)
+					{
+					//stop the server , but dont delete file to support in second reboot
+					FLOG(_L("wlan bearer & n/w interrupt--stopping the server"));
+					Server().DeleteFile(EFalse);
+					iStopServer = ETrue;
+					break;
+					}
+				}
+			else if( BearerId == KUidPacketDataBearerType )
+				{
+				FLOG(_L("CFMSSession::EFotaStartUpPlugin-bearer is packet data"));	
+				if( wcdmabearer == 1 )
+					{
+					Server().NetworkTypeL(EBearerIdWCDMA);	
+					FLOG(_L("CFMSSession::EFotaStartUpPlugin-packet data and 3G"));
+					}
+				else
+					{
+					Server().NetworkTypeL(EBearerIdGPRS);
+					FLOG(_L("CFMSSession::EFotaStartUpPlugin-packet data and 2G"));
+					}
+				}
+			else
+				{
+				FLOG(_L("CFMSSession::EFotaStartUpPlugin-unknown bearer"));
+				Server().DeleteFile(EFalse);
+				iStopServer = ETrue;
+				break;
+				}
+			//when there is dummy file in the store
+			if( intrreason < EUserInterrupt || intrreason > EGeneralInterrupt )
+				{
+				FLOG(_L("CFMSSession::EFotaStartUpPlugin-Interrupt unknown"));	
+				Server().DeleteFile(EFalse); //used when variation support & reboot again
+				iStopServer = ETrue;
+				break;
+				}
+			if( intrreason == EUserInterrupt || intrreason == EGeneralInterrupt )
+				{
+				FLOG(_L("CFMSSession::EFotaStartUpPlugin-Check n/w & trigger fotaengine"));	
+				Server().CheckNetworkL(bearer,drive,size,wcdmabearer);//3 params used in monitoring if no n/w
+				break;
+				} 				
+			//for other interrupts it will monitor
+			Server().StartMonitoringL((TOmaDLInterruptReason)intrreason);
+			}
+		else
+			{
+			iStopServer = ETrue;
+			}
+		}
+		break;
+	case ECancelOutstandingRequest:
+		{					
+		FLOG(_L("CFMSSession::DispatchMessageL ECancelOutstandingRequest case:"));
+		iStopServer = ETrue; 
+		}
+		break;	
+
+	case EMonitorbattery:
+	   {
+	    FLOG(_L("CFMSSession::DispatchMessageL EMonitorbattery case:"));
+	 	Server().StartBatteryMonitoringL(EMonitorbattery, aMessage.Int0());
+	   }
+	 	break;
+	   
+	case EPhoneCallActive:
+	    {
+	    FLOG(_L("CFMSSession::DispatchMessageL EPhoneCallActiveSync case:"));
+	    Server().LockSession();
+	    TInt reason =EFalse;
+	    Server().CheckPhoneCallActiveL(reason);
+	    TPckgBuf<TInt> callactive(reason);
+	    aMessage.WriteL(0,callactive);
+	    Server().iSessionCount = 0;
+	    FLOG(_L("CFMSSession::DispatchMessageL EPhoneCallActiveSync case:%d"),reason);
+	    iStopServer = ETrue;
+	    }
+	    break;
+	    
+	case EMonitorPhoneCallEnd:
+	    {
+	    FLOG(_L("CFMSSession::DispatchMessageL EPhoneCallActiveAsync case:%d,%d"),aMessage.Int0(),aMessage.Int1());
+	    Server().LockSession();
+	    if(Server().MonitorPhoneCallEndL(aMessage.Int0(),aMessage.Int1()))
+	        {
+	        iStopServer = ETrue;
+	        Server().iSessionCount = 0;
+	        }
+	    else //let server monitor for active call end
+	        {
+	        iStopServer = EFalse;
+	        }
+	   }
+	 	break;
+	default:
+		{
+		FLOG(_L("CFMSSession::DispatchMessageL default case:and a leave happened"));
+		iStopServer = ETrue;
+		User::Leave(KErrArgument);			
+		}			
+	}
+	FLOG(_L("CFMSSession::DispatchMessageL:end"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::FindBearerId
+// ----------------------------------------------------------------------------------------
+TUint32 CFMSSession::FindBearerIdL(TInt aIapId)
+	{
+	FLOG(_L("CFMSSession::FindBearerId: % d"),aIapId);
+	TUint32 bearer = 0;
+	TInt err( KErrNone );
+	// Query CM Id
+	TInt cmId ( aIapId );			        
+	RCmManagerExt  CmManagerExt;
+	TRAP( err, CmManagerExt.OpenL() );
+	if( err == KErrNone )
+		{
+		RCmConnectionMethodExt cm;
+		TRAP( err, cm = CmManagerExt.ConnectionMethodL( cmId ) );			        	
+		if ( err == KErrNone )
+			{	        
+			CleanupClosePushL( cm );	  
+			bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );	        			        
+			CleanupStack::PopAndDestroy();  // cm	        
+			}	    	        
+		CmManagerExt.Close();
+		}
+	return bearer;
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::WriteDummyFile
+// This method used when the variation wouldn't support and startup called
+// and also differentiates hard reeboot(with empty or no file)
+// ----------------------------------------------------------------------------------------
+void CFMSSession::WriteDummyFile()
+	{
+	FLOG(_L("CFMSSession::WriteDummyFile--begin"));
+	Server().WriteToFile(KErrNotFound,KErrNotFound,
+			(TDriveNumber)KErrNotFound,KErrNotFound,EFalse);
+	Server().DeleteFile(EFalse);
+	FLOG(_L("CFMSSession::WriteDummyFile--End"));
+	}
+
+// ----------------------------------------------------------------------------------------
+// CFMSSession::PhoneMode
+// This method used to know the current phone mode
+// If the phone is in dual mode it will check GPRS bearer only
+// ----------------------------------------------------------------------------------------
+void CFMSSession::PhoneModeL()
+	{
+	FLOG(_L("CFMSSession::PhoneModeL--begin"));	
+	// find out if we are in 2G or in 3G - it is needed for calculating bearer availability
+	__UHEAP_MARK; 
+	RTelServer telServer;
+	User::LeaveIfError( telServer.Connect());
+	FLOG(_L("CFMSSession::PhoneModeL--telServer Connected"));
+	RTelServer::TPhoneInfo teleinfo;
+	User::LeaveIfError( telServer.GetPhoneInfo( 0, teleinfo ) );
+	FLOG(_L("CFMSSession::PhoneModeL--telServer getting tel info"));
+	RMobilePhone phone;
+	User::LeaveIfError( phone.Open( telServer, teleinfo.iName ) );
+	FLOG(_L("CFMSSession::PhoneModeL--RMobilePhone opened"));
+	User::LeaveIfError(phone.Initialise());	
+	FLOG(_L("CFMSSession::PhoneModeL--phone.Initialise() success"));
+	RMobilePhone::TMobilePhoneNetworkMode mode;        	        	
+	TInt err = phone.GetCurrentMode( mode );
+	phone.Close();
+	telServer.Close();
+	__UHEAP_MARKEND;
+
+	if( KErrNone == err )
+		{
+		switch(mode)
+		{
+		case RMobilePhone::ENetworkModeGsm:
+		//case RMobilePhone::ENetworkModeUnknown:  // emulator default
+			{
+			FLOG(_L("CFMSSession::PhoneModeL-begin-GSM Mode"));	                		
+			iWcdmaBearer = EFalse;
+			Server().NetworkTypeL(EBearerIdGPRS);
+			break;		
+			}
+		case RMobilePhone::ENetworkModeWcdma:
+			{                		     		
+			FLOG(_L("CFMSSession::PhoneModeL-begin-3G Mode"));	
+			iWcdmaBearer = ETrue;
+			Server().SetWcdma();
+			Server().NetworkTypeL(EBearerIdWCDMA);
+			break;	
+			}	
+		default:        	
+		FLOG(_L("unknown"));
+		}        				
+		}
+	FLOG(_L("CFMSSession::PhoneModeL--end"));
+	}
+	
+//----------------------------------------------------------------------------------------
+// CFMSSession::HandleBasedOnBearertypeL
+// Handles based on bearer type
+//----------------------------------------------------------------------------------------	
+
+void  CFMSSession::HandleBasedOnBearertypeL(const RMessage2& aMessage)
+{
+    TUint32 bearer = FindBearerIdL(aMessage.Int0());
+		if( bearer == KUidPacketDataBearerType )
+			{
+			FLOG(_L("CFMSSession::DispatchMessageL bearer is packet data"));
+			TRAPD(err,PhoneModeL());
+			if(err); // remove compiler warning
+			FLOG(_L("PhoneModeL() returns err as %d"),err);
+			}
+		else if	(	bearer == KUidWlanBearerType )
+			{
+			FLOG(_L("CFMSSession::DispatchMessageL bearer is WLAN"));
+			iWlanbearer = ETrue;
+			Server().NetworkTypeL(EBearerIdWLAN);
+			}
+		else	
+			{
+			FLOG(_L("CFMSSession::DispatchMessageL bearer is not known and a leave happened "));
+			iStopServer = ETrue;
+			User::Leave(KErrArgument);
+			}
+}				
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/bwins/fotacustcmdsu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,5 @@
+EXPORTS
+	?FotaCustCmdAllReasonsNewL@FotaCustCmdsFactory@@SAPAVMSsmCustomCommand@@XZ @ 1 NONAME ; class MSsmCustomCommand * FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL(void)
+	?FotaCustCmdFirmwareUpdateNewL@FotaCustCmdsFactory@@SAPAVMSsmCustomCommand@@XZ @ 2 NONAME ; class MSsmCustomCommand * FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL(void)
+	?FotaCustCmdFirstBootNewL@FotaCustCmdsFactory@@SAPAVMSsmCustomCommand@@XZ @ 3 NONAME ; class MSsmCustomCommand * FotaCustCmdsFactory::FotaCustCmdFirstBootNewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/eabi/fotacustcmdsu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,5 @@
+EXPORTS
+	_ZN19FotaCustCmdsFactory25FotaCustCmdAllReasonsNewLEv @ 1 NONAME
+	_ZN19FotaCustCmdsFactory29FotaCustCmdFirmwareUpdateNewLEv @ 2 NONAME
+	_ZN19FotaCustCmdsFactory24FotaCustCmdFirstBootNewLEv @ 3 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Build information file for the FotaCustCmds project.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+fotacustcmds.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/group/fotacustcmds.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Project definition file for the FotaCustCmds project.
+*
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          fotacustcmds.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x10205071 
+
+CAPABILITY      CAP_GENERAL_DLL
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          fotacustcmdsfactory.cpp
+SOURCE          fotacustcmdallreasons.cpp
+SOURCE          fotacustcmdfirmwareupdate.cpp
+SOURCE          fotacustcmdfirstboot.cpp
+
+USERINCLUDE     ../inc ../../cenrep ../../inc ../../fmsclient/inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+#ifdef __SYNCML_DM_FOTA
+LIBRARY         fotaengine.lib
+LIBRARY		fmsclient.lib
+#endif
+DEBUGLIBRARY    flogger.lib
+LIBRARY         centralrepository.lib
+LIBRARY         schsvr.lib  
+LIBRARY		apgrfx.lib
+LIBRARY		apparc.lib
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdallreasons.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Declaration of CFotaCustCmdAllReasons class.
+*
+*/
+
+#ifndef FOTACUSTCMDALLREASONS_H
+#define FOTACUSTCMDALLREASONS_H
+
+#include <e32base.h>
+#include <ssm/ssmcustomcommand.h>
+
+/**
+ *  Each command is implemented in a class derived from MSsmCustomCommand.
+ *  It is also possible to implement multiple similar command in the same
+ *  class and differentiate between them based on constructor parameters
+ *  from the factory method.
+ */
+NONSHARABLE_CLASS( CFotaCustCmdAllReasons ) : public CBase, public MSsmCustomCommand
+    {
+
+public:
+
+    /**
+     * Two-phased constructor
+     */
+	static CFotaCustCmdAllReasons* NewL();
+
+    /**
+     * Destructor
+     */
+    virtual ~CFotaCustCmdAllReasons();
+
+private: // From MSsmCustomCommand
+
+    /**
+     * @see MSsmCustomCommand
+     */
+    TInt Initialize( CSsmCustomCommandEnv* aCmdEnv );
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Execute( const TDesC8& aParams, TRequestStatus& aRequest );
+
+    /**
+     * Takes action depending on the fota update state cenrep
+     * @Params None
+     * @return  None
+     *
+     */
+     
+  void ExecuteL( );  
+    
+    /**
+     * @see MSsmCustomCommand
+     */
+	void ExecuteCancel();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Close();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Release();
+	
+    /**
+     * Finds whether fota is schedduled or not 
+     * @Params None
+     * @return 
+     * ETrue if  fota is scheduled else EFalse
+     */
+  TBool FindScheduleL();
+  
+private: // data
+
+    /**
+    * If the command needs command env in Execute function, it should store it
+    * to member variable:
+    *
+    * Custom command environment. Not owned. Set in Initialize.
+    * CSsmCustomCommandEnv* iEnv;
+    */
+	
+	/*
+	* Function description:
+	* This function checks for dmEventNotifier. 
+	* This checks for the specific scenario "when MMC is removed/inserted when phone is 
+	* in switch off mode. Then it starts the DmEventNotifier.
+	*
+	* @params: None
+	* @Return: void
+	*/
+    void checkDMEventNotifierL();
+
+    };
+
+#endif // FOTACUSTCMDALLREASONS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdfirmwareupdate.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Declaration of CFotaCustCmdFirmwareUpdate class.
+*
+*/
+
+#ifndef FOTACUSTCMDFIRMWAREUPDATE_H
+#define FOTACUSTCMDFIRMWAREUPDATE_H
+
+#include <e32base.h>
+#include <ssm/ssmcustomcommand.h>
+
+/**
+ *  Each command is implemented in a class derived from MSsmCustomCommand.
+ *  It is also possible to implement multiple similar command in the same
+ *  class and differentiate between them based on constructor parameters
+ *  from the factory method.
+ */
+NONSHARABLE_CLASS( CFotaCustCmdFirmwareUpdate ) : public CBase, public MSsmCustomCommand
+    {
+
+public:
+
+    /**
+     * Two-phased constructor
+     */
+	static CFotaCustCmdFirmwareUpdate* NewL();
+
+    /**
+     * Destructor
+     */
+    virtual ~CFotaCustCmdFirmwareUpdate();
+
+private: // From MSsmCustomCommand
+
+    /**
+     * @see MSsmCustomCommand
+     */
+    TInt Initialize( CSsmCustomCommandEnv* aCmdEnv );
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Execute( const TDesC8& aParams, TRequestStatus& aRequest );
+	
+	  /**
+     * invokes fotaengine after fota update
+     * @Params None
+     * @return  None
+     *
+     */
+	void ExecuteL();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void ExecuteCancel();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Close();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Release();
+
+private: // data
+
+    /**
+    * If the command needs command env in Execute function, it should store it
+    * to member variable:
+    *
+    * Custom command environment. Not owned. Set in Initialize.
+    * CSsmCustomCommandEnv* iEnv;
+    */
+
+    };
+
+#endif // FOTACUSTCMDFIRMWAREUPDATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdfirstboot.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Declaration of CFotaCustCmdFirstBoot class.
+*
+*/
+
+#ifndef FOTACUSTCMDFIRSTBOOT_H
+#define FOTACUSTCMDFIRSTBOOT_H
+
+#include <e32base.h>
+#include <ssm/ssmcustomcommand.h>
+
+/**
+ *  Each command is implemented in a class derived from MSsmCustomCommand.
+ *  It is also possible to implement multiple similar command in the same
+ *  class and differentiate between them based on constructor parameters
+ *  from the factory method.
+ */
+NONSHARABLE_CLASS( CFotaCustCmdFirstBoot ) : public CBase, public MSsmCustomCommand
+    {
+
+public:
+
+    /**
+     * Two-phased constructor
+     */
+	static CFotaCustCmdFirstBoot* NewL();
+
+    /**
+     * Destructor
+     */
+    virtual ~CFotaCustCmdFirstBoot();
+
+private: // From MSsmCustomCommand
+
+    /**
+     * @see MSsmCustomCommand
+     */
+    TInt Initialize( CSsmCustomCommandEnv* aCmdEnv );
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Execute( const TDesC8& aParams, TRequestStatus& aRequest );
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void ExecuteCancel();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Close();
+
+    /**
+     * @see MSsmCustomCommand
+     */
+	void Release();
+
+private: // data
+
+    /**
+    * If the command needs command env in Execute function, it should store it
+    * to member variable:
+    *
+    * Custom command environment. Not owned. Set in Initialize.
+    * CSsmCustomCommandEnv* iEnv;
+    */
+
+    };
+
+#endif // FOTACUSTCMDFIRSTBOOT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdsfactory.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Declaration of FotaCustCmdsFactory class.
+*
+*/
+
+#ifndef FOTACUSTCMDSFACTORY_H
+#define FOTACUSTCMDSFACTORY_H
+
+#include <e32def.h>
+
+class MSsmCustomCommand;
+
+/**
+ *  Creates custom command objects.
+ *
+ *  Custom commands are loaded by system state manager based on DLL name and
+ *  function ordinal.
+ *  Each DLL containing custom commands must offer factory methods for each
+ *  custom command.
+ *  The function ordinals must be exactly the same in emulator and HW builds
+ *  or loading the custom command may have unpredictable results.
+ *
+ *  FotaCustCmdsFactory is a static class containing factory method of one
+ *  custom command. It can be easily extended to contain factory methods of
+ *  multiple custom commands by adding more member functions.
+ *
+ *  It is better to implement own factory method for each separate command
+ *  than to try to use parameters of Execute function to distinguish between
+ *  them.
+ *  Note that similar commands can be implemented in the same command class -
+ *  just the factory methods need to be different.
+ */
+
+class FotaCustCmdsFactory
+    {
+
+public:
+
+    /**
+     * Creates and returns a custom command of type CFotaCustCmdAllReasons.
+     * This method has function ordinal 1 in fotacustcmds.dll.
+     *
+     * @return A custom command object.
+     */
+	IMPORT_C static MSsmCustomCommand* FotaCustCmdAllReasonsNewL();
+
+    /**
+     * Creates and returns a custom command of type CFotaCustCmdFirmwareUpdate.
+     * This method has function ordinal 2 in fotacustcmds.dll.
+     *
+     * @return A custom command object.
+     */
+	IMPORT_C static MSsmCustomCommand* FotaCustCmdFirmwareUpdateNewL();
+
+    /**
+     * Creates and returns a custom command of type CFotaCustCmdFirstBoot.
+     * This method has function ordinal 3 in fotacustcmds.dll.
+     *
+     * @return A custom command object.
+     */
+	IMPORT_C static MSsmCustomCommand* FotaCustCmdFirstBootNewL();
+
+    // To add new custom commands to this DLL, add their factory methods here.
+
+    };
+
+#endif // FOTACUSTCMDSFACTORY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/inc/fotastartupDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   This file defines logging macros for Fotastartupextension log
+*
+*/
+
+
+
+
+#ifndef FOTASTARTUPDEBUG_H
+#define FOTASTARTUPDEBUG_H
+
+#include <e32debug.h> 
+#include <f32file.h>
+
+//Examples
+//FLOG( _L( "[fotastartupextensionplugin] CFotaStartupExtensionPlugIn::NewL:" ) );
+//FTRACE(RDebug::Print(_L("[fotastartupextensionplugin] fotastartupextensionplugin::NewL: err (%d)"), err));
+#ifdef _DEBUG
+
+const TInt KBTHexDumpWidth=16;
+const TInt KBTLogBufferSize=100;
+const TText KFullStopChar='.';
+
+_LIT(KBTFirstFormatString,"%04x: ");
+_LIT(KBTSecondFormatString,"%02x ");
+_LIT(KBTThirdFormatString,"%c");
+_LIT(KBTThreeSpaces,"   ");
+_LIT(KBTSeparator," ");
+
+inline void HexDump(const TUint8* aPtr, TInt aLen)
+    {
+	if( aPtr != NULL )
+	    {
+    	TBuf<KBTLogBufferSize> line;
+	    TInt i = 0;
+
+    	while (aLen>0)
+    		{
+    		TInt n = (aLen>KBTHexDumpWidth ? KBTHexDumpWidth : aLen);
+    		line.AppendFormat(KBTFirstFormatString,i);
+    		TInt j;
+    		for (j=0; j<n; j++)
+    			line.AppendFormat(KBTSecondFormatString,aPtr[i+j]);
+    		while (j++<KBTHexDumpWidth)
+    			line.Append(KBTThreeSpaces);
+    		line.Append(KBTSeparator);
+    		for (j=0; j<n; j++)
+    			line.AppendFormat(KBTThirdFormatString,(aPtr[i+j]<32 || aPtr[i+j]>126 || aPtr[i+j]==37) ? KFullStopChar : aPtr[i+j]);
+
+    		RDebug::Print(line);
+
+            line.Zero();
+    		aLen-=n;
+    		i+=n;
+    	    }
+        }
+    }
+
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT( KLogFile, "fotacustcmds.log" );
+_LIT( KLogDirFullName, "c:\\logs\\" );
+_LIT( KLogDir, "fota" );
+
+#define FLOG( a )   { FPrint(a); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,
+                              KLogFile,
+                              EFileLoggingModeAppend,
+                              aFmt,
+                              list );
+    }
+
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+/*#include <e32svr.h>
+
+#define FLOG( a )   { RDebug::Print( a ); }
+#define FTRACE( a ) { a; }
+
+*/
+
+///////////////////////////////
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT( KLogFile, "fotacustcmds.log" );
+_LIT( KLogDirFullName, "c:\\logs\\" );
+_LIT( KLogDir, "fota" );
+
+#define FLOG( a )   { FPrint(a); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,
+                              KLogFile,
+                              EFileLoggingModeAppend,
+                              aFmt,
+                              list );
+    }
+
+////////////////////////////////
+
+
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG( a )
+#define FTRACE( a )
+
+#endif // _DEBUG
+
+/////////  ///////////////////////
+inline void LOGX(TInt aSource)
+	{
+		HBufC *iMyBufNumber = HBufC::NewLC(255);
+   		TPtr bufNumberPtr(iMyBufNumber->Des());
+   		bufNumberPtr.FillZ();
+   		bufNumberPtr.AppendFormat(_L("%d"),aSource);
+    	FLOG(iMyBufNumber->Des());
+    	CleanupStack::PopAndDestroy();
+	}
+/////////  ///////////////////////
+	
+#endif      // FOTASTARTUP_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdallreasons.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,381 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Implementation of CFotaCustCmdAllReasons class.
+*
+*/
+
+#include "fotacustcmdallreasons.h"
+#include "fotastartupDebug.h"
+#ifdef __SYNCML_DM_FOTA
+#include <fotaengine.h>
+#include "fmsclient.h"
+#include "fotaserverPrivateCRKeys.h"
+#include "FotaIPCTypes.h"
+#include "fmsclientserver.h"
+#endif
+#include <schtime.h>      
+#include <csch_cli.h>    
+#include <centralrepository.h>
+// RProperty
+#include <e32base.h>
+#include <e32property.h>
+// Memory status PS key headers
+#include <UikonInternalPSKeys.h>
+// Loading application headers
+#include <apgcli.h>
+#include <apacmdln.h>
+//Middleware includes
+#include <dmeventnotifiercrkeys.h>
+#include <dmeventnotifiercommon.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::NewL
+// ---------------------------------------------------------------------------
+//
+CFotaCustCmdAllReasons* CFotaCustCmdAllReasons::NewL()
+	{
+  FLOG( _L( "[CFotaCustCmdAllReasons::NewL() BEGIN " ) );
+	return new ( ELeave ) CFotaCustCmdAllReasons;
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::~CFotaCustCmdAllReasons
+// ---------------------------------------------------------------------------
+//
+CFotaCustCmdAllReasons::~CFotaCustCmdAllReasons()
+    {
+      FLOG( _L( "[CFotaCustCmdAllReasons::~CFotaCustCmdAllReasons()  " ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::Initialize
+// ---------------------------------------------------------------------------
+//
+TInt CFotaCustCmdAllReasons::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
+    {
+    FLOG( _L( "[CFotaCustCmdAllReasons::~Initialize()  " ) );
+
+    
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::Execute
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdAllReasons::Execute(
+    const TDesC8& /*aParams*/,
+    TRequestStatus& aRequest )
+    {
+     FLOG( _L( "[CFotaCustCmdAllReasons::~Execute() BEGIN " ) );
+      aRequest = KRequestPending;
+ #ifdef __SYNCML_DM_FOTA
+    TRAP_IGNORE(ExecuteL());    
+ #endif
+    TRequestStatus* request = &aRequest;
+    User::RequestComplete( request, KErrNone );
+ FLOG( _L( "[CFotaCustCmdAllReasons::~Execute() END " ) ); 
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::ExecuteL
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdAllReasons::ExecuteL( )
+    {
+      FLOG( _L( "[CFotaCustCmdAllReasons]::ExecuteL() Boot reason AllReason BEGIN " ) );
+      
+        RFotaEngineSession fotaEngine;          
+       //CheckCenrep if GA feature in ON then start else nothing.
+       CRepository*    centrep( NULL);
+       TInt err= KErrNone;
+       TRAP( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+       TInt sendGAAfterrebootfeature = 0;
+       TInt val (EFotaDefault);
+       
+       if ( err==KErrNone ) 
+           {
+           err = centrep->Get(  KFotaUpdateState, val );
+           
+           if(err == KErrNone)
+               {
+               // check if there is GA pending
+
+               FTRACE(RDebug::Print(_L("[CFotaCustCmdAllReasons]  startup reason is %d"), val));        
+               switch(val)
+                   {
+                   case EFotaDownloadInterrupted :
+                       {
+                       FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Start FMS server " ) ); 
+                       RFMSClient fmsClient;
+                       TRAPD(err, fmsClient.OpenL());
+                       if (err == KErrNone)
+                           {
+                           fmsClient.Close();
+                           FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Closing FMS server  " ) );
+                           }
+                       }
+                       break;
+                   case EFotaPendingGenAlert : 
+                       {
+                       FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Start fota server " ) );
+                       err = centrep->Get(  KGenericAlertResendAfterBoot, sendGAAfterrebootfeature );
+                       FTRACE(RDebug::Print(_L("[CFotaCustCmdAllReasons] feature sendGenericAlert is %d"), sendGAAfterrebootfeature));        
+
+                       if (sendGAAfterrebootfeature==1)
+                           {
+                           TRAPD(oError,fotaEngine.OpenL());
+                           if(oError == KErrNone)
+                               {
+                               fotaEngine.Close();
+                               FLOG( _L( "[CFotaCustCmdAllReasons] AllReason: Closing fota server  " ) );
+                               }
+                           }
+                       }
+                       break;
+                   case EFotaUpdateInterrupted :    
+                       {
+                           FLOG(_L(" update interrupted >>"));
+                           RFMSClient fmsclient;
+                           TRAPD(err,fmsclient.OpenL());
+                           if(err)
+                           {  FLOG(_L( " opening fms failed " ) ); 
+                                   
+                           }
+                           else
+                           {
+                           
+                           FLOG(_L("CFotaUpdate::going into FMS client side MonitorBatteryL() >>"));
+                           TRAPD(err1, fmsclient.MonitorForBatteryL(4)); // equal to EBatteryLevelLevel4
+                           if(err1)
+                           {
+                               FLOG(_L( " MonitorBatteryL failed "  ));
+                           }
+                            fmsclient.Close();
+                            FLOG(_L(" update interrupted <<"));
+                           }
+                       }
+                       break;
+                   default:
+                       {
+                       FLOG( _L( "[CFotaCustCmdAllReasons] pendingGAToSend is not SET " ) ); 
+                       }
+                       break;
+                   }
+               
+               }
+            //Changes for resetting of timer.....   
+            TInt timerResetfeature(KErrNone); 
+            
+            err = centrep->Get(  KFotaReminderTimerReset, timerResetfeature );
+             if((err == KErrNone) && (timerResetfeature==1)) //if reset timer feature on. 
+             {    
+                   
+                   TBool isFotaScheduled =EFalse;
+                   TRAPD(error , isFotaScheduled = FindScheduleL());           //check whether FOTA scheduled 
+                   if(error)
+                   {
+                       isFotaScheduled = EFalse;
+                    
+                   }
+                   if(isFotaScheduled)
+                   {   
+                     FLOG( _L( "[CFotaCustCmdAllReasons] fota operation is scheduled  " ) );   
+                     TRAPD(oError,fotaEngine.OpenL());
+                     if(oError)
+                      {
+                       FLOG( _L( "[CFotaCustCmdAllReasons] error in opening : so Closing fota server  " ) );
+
+                      }
+                     else
+                     {   
+                      
+                       TFotaScheduledUpdate           sched(-1,-1);   //trigger the Fota remainder dialog here..
+                       TPckg<TFotaScheduledUpdate>    p(sched);
+                       TRAPD(err, fotaEngine.ScheduledUpdateL(sched));
+                       if(err)
+                       {
+                         FLOG( _L( "[CFotaCustCmdAllReasons] FirmwareUpdate scheduling failed   " ) );                
+                       }
+                       fotaEngine.Close();
+                      }
+                       
+                    }
+                  
+                  
+               }     
+            
+           }
+       delete centrep;
+       {   // Write the code for starting the dmEventNotifier
+      	   TRAPD(err, checkDMEventNotifierL());
+        	 if(err)
+         	 {
+           		FLOG(_L("start DmEventNotifier.exe successfull"));
+         	 }
+         	 else
+           {
+           		FLOG(_L("start DmEventNotifier.exe un-successfull"));         
+         	 }
+     	 }
+       FLOG( _L( "[CFotaCustCmdAllReasons]::ExecuteL() Boot reason AllReason END " ) );      
+    }
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::ExecuteCancel
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdAllReasons::ExecuteCancel()
+    {
+   
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::Close
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdAllReasons::Close()
+    {
+     FLOG( _L( "[CFotaCustCmdAllReasons]::Close() " ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdAllReasons::Release
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdAllReasons::Release()
+    {
+    
+     FLOG( _L( "[CFotaCustCmdAllReasons]::Close() " ) );
+	   delete this;
+    }
+    
+    
+TBool  CFotaCustCmdAllReasons::FindScheduleL()
+{
+	FLOG( _L( "[CFotaCustCmdAllReasons]::FindScheduleL()BEGIN " ) );
+	TScheduleEntryInfo2                     ret;    
+	RScheduler                              sc;
+	TTime                                   t; 
+	TTsTime                                 time;
+	TSchedulerItemRef                       scitem; 
+	CArrayFixFlat<TSchedulerItemRef>*     	aSchRefArray = new CArrayFixFlat <TSchedulerItemRef>(5);
+	TScheduleFilter                      	aFilter(EAllSchedules);
+	User::LeaveIfError( sc.Connect() );                             // xx
+	CleanupClosePushL( sc );
+	CleanupStack::PushL(aSchRefArray);
+
+	User::LeaveIfError( sc.GetScheduleRefsL( *aSchRefArray,aFilter) );  // xx
+	FLOG(_L("Schedule items: "));
+	for ( TInt i=0; i<aSchRefArray->Count(); ++i  )
+		{
+		  TSchedulerItemRef it = (*aSchRefArray)[i];
+		 if ( it.iName == TUid::Uid(KFotaServerUid).Name()  )
+	   {
+	   	  	 
+	   	  	 	CleanupStack::PopAndDestroy(aSchRefArray);  
+                CleanupStack::PopAndDestroy(&sc);
+	   	  	 	return ETrue;
+	  	
+	   }
+     }
+                 CleanupStack::PopAndDestroy(aSchRefArray);
+                 CleanupStack::PopAndDestroy(&sc);
+     FLOG( _L( "[CFotaCustCmdAllReasons]::FindScheduleL()END " ) );            
+                 return EFalse; 
+}
+
+
+void CFotaCustCmdAllReasons::checkDMEventNotifierL()
+{
+    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - started"));
+ 
+    const TUid KAppDmEventNotifierUid = TUid::Uid(KAppUidDmEventNotifier); //UID3 from .mmp file
+    CRepository* cenrep (NULL);
+    cenrep = CRepository::NewLC( KAppDmEventNotifierUid );
+    TInt value (KErrNone);
+    TBool tocontinue (EFalse);
+
+    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for cenrep KDmEventNotifierEnabled"));
+    if ( ((cenrep->Get(KDmEventNotifierEnabled,value)) == KErrNone )
+            && (EHandlerRegistered == value || EHandlerNeedRegister == value )) // v alue != EHandlerNotRegistered 
+    {
+//        FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - cenrep KDmEventNotifierEnabled exist, value = (%d) "), value);
+				FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - cenrep KDmEventNotifierEnabled exist"));
+        tocontinue = ETrue;
+    }
+    else
+    {
+        //Log errors
+//        FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for cenrep KDmEventNotifierEnabled does not exist: error: (%d) "), err);
+				FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - cenrep KDmEventNotifierEnabled does not exist or already registered"));
+        //delete cenrep; cenrep = NULL;
+        CleanupStack::PopAndDestroy(); // cenrep
+        return;
+    }
+    
+    TInt pMmcstatus = KErrNotFound;
+    TInt ret = RProperty::Get(KPSUidUikon, KUikMMCInserted, pMmcstatus);
+//    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for present Memory status: ret = (%d) , MMCStatus = (%d) "), ret, pMmcStatus);
+		FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for memory status"));
+    if(!ret)
+    {
+
+        TInt sMMCStatus (KErrNotFound);
+        TInt error = cenrep->Get(KMMCStatus, sMMCStatus);
+				CleanupStack::PopAndDestroy(); // cenrep
+
+        //FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - checking for previous Memory status, before phone off: error = (%d) , sMMCStatus = (%d) "), error, sMMCStatus);
+        if(error)
+        {
+        		FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - Error in memory status get"));
+            //CleanupStack::PopAndDestroy(); // cenrep
+            return;    
+        }
+        if (pMmcstatus == sMMCStatus && tocontinue) // if sMMCStatus is 0 && pMMCStatus is 0. Or sMMCStatus is 1 && pMMCStatus is 1
+        {
+        //start the dm event notifier
+                
+            RApaLsSession apaLsSession;
+            User :: LeaveIfError(apaLsSession.Connect());
+            TApaAppInfo appInfo;
+            FLOG(_L("RApaLsSession connection successful"));
+            FLOG(_L("Running dmeventnotifier.exe"));
+                    
+            _LIT(KExampleTaskHandlerExe, "dmeventnotifier.exe");
+        
+            appInfo.iFullName = KExampleTaskHandlerExe;
+            CApaCommandLine* cmdLine  = CApaCommandLine::NewLC();
+            cmdLine->SetExecutableNameL( appInfo.iFullName );
+            TBuf<KMaxFileName> temp;
+            temp.Copy (appInfo.iFullName);
+            TInt err = apaLsSession.StartApp(*cmdLine);
+            
+            User :: LeaveIfError(err);
+            CleanupStack :: PopAndDestroy(cmdLine);
+            apaLsSession.Close();
+            FLOG(_L("started dmeventnotifier.exe successfully"));
+        }
+    }
+    //CleanupStack::PopAndDestroy(); // cenrep
+    FLOG(_L("CFotaCustCmdAllReasons::checkDMEventNotifier() - ended"));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdfirmwareupdate.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Implementation of CFotaCustCmdFirmwareUpdate class.
+*
+*/
+
+#include "fotacustcmdfirmwareupdate.h"
+#ifdef __SYNCML_DM_FOTA
+#include <fotaengine.h>
+#include "fmsclient.h"
+#include "fotaserverPrivateCRKeys.h"
+#include "FotaIPCTypes.h"
+#include "fmsclientserver.h"
+#endif
+#include "fotastartupDebug.h"
+#include <centralrepository.h>
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::NewL
+// ---------------------------------------------------------------------------
+//
+CFotaCustCmdFirmwareUpdate* CFotaCustCmdFirmwareUpdate::NewL()
+	{
+    FLOG( _L( "CFotaCustCmdFirmwareUpdate::NewL()  " ) );
+	return new ( ELeave ) CFotaCustCmdFirmwareUpdate;
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::~CFotaCustCmdFirmwareUpdate
+// ---------------------------------------------------------------------------
+//
+CFotaCustCmdFirmwareUpdate::~CFotaCustCmdFirmwareUpdate()
+    {
+     FLOG( _L( "CFotaCustCmdFirmwareUpdate::~CFotaCustCmdFirmwareUpdate()  " ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::Initialize
+// ---------------------------------------------------------------------------
+//
+TInt CFotaCustCmdFirmwareUpdate::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
+    {
+    
+     FLOG( _L( "CFotaCustCmdFirmwareUpdate::Initialize()  " ) );
+    
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::Execute
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirmwareUpdate::Execute(
+    const TDesC8& /*aParams*/,
+    TRequestStatus& aRequest )
+    {
+     aRequest = KRequestPending;
+       FLOG( _L( "CFotaCustCmdFirmwareUpdate::Execute() BEGIN " ) );
+     #ifdef __SYNCML_DM_FOTA
+     TRAP_IGNORE(ExecuteL());
+     #endif
+     TRequestStatus* request = &aRequest;
+     User::RequestComplete( request, KErrNone );
+     FLOG( _L( "CFotaCustCmdFirmwareUpdate::Execute() END " ) );
+     
+
+    }
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::ExecuteL
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirmwareUpdate::ExecuteL( )
+    
+   {
+   	FLOG( _L( "CFotaCustCmdFirmwareUpdate::ExecuteL( ) Boot reason KFirmwareUpdateReason BEGIN " ) );
+
+    CRepository*    centrep( NULL);
+    RFotaEngineSession fotaEngine;
+    TInt err= KErrNone;
+    TRAP( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+    TInt sendGAAfterrebootfeature = 0;
+    	if( err == KErrNone && centrep )
+    	{
+    	  err = centrep->Get(  KGenericAlertResendAfterBoot, sendGAAfterrebootfeature );
+    	}
+    	 FTRACE(RDebug::Print(_L("[CFotaCustCmdFirmwareUpdate] feature sendGenericAlert is %d"), sendGAAfterrebootfeature));        
+        if( sendGAAfterrebootfeature != 1 )
+        {
+   	        FLOG( _L( "[CFotaCustCmdFirmwareUpdate] FirmwareUpdateReason: Starting fota server  " ) );
+            TRAPD(oError,fotaEngine.OpenL());
+            if(oError == KErrNone)
+            {
+            fotaEngine.Close();
+            FLOG( _L( "[CFotaCustCmdFirmwareUpdate] FirmwareUpdateReason: Closing fota server  " ) );
+            }
+       
+        }
+        
+        if(centrep)
+        {
+        	delete centrep;
+        }
+    
+  	FLOG( _L( "CFotaCustCmdFirmwareUpdate::ExecuteL( ) Boot reason KFirmwareUpdateReason END " ) );
+
+   }
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::ExecuteCancel
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirmwareUpdate::ExecuteCancel()
+    {
+  
+      FLOG( _L( "CFotaCustCmdFirmwareUpdate::ExecuteCancel() " ) );
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::Close
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirmwareUpdate::Close()
+    {
+    
+       FLOG( _L( "CFotaCustCmdFirmwareUpdate::Close() " ) );
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirmwareUpdate::Release
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirmwareUpdate::Release()
+    {
+    FLOG( _L( "CFotaCustCmdFirmwareUpdate::Release() " ) );
+
+	delete this;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdfirstboot.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Implementation of CFotaCustCmdFirstBoot class.
+*
+*/
+
+#include "fotacustcmdfirstboot.h"
+#include "fotastartupDebug.h"
+//#include "trace.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::NewL
+// ---------------------------------------------------------------------------
+//
+CFotaCustCmdFirstBoot* CFotaCustCmdFirstBoot::NewL()
+	{
+   FLOG( _L( "[CFotaCustCmdFirstBoot::NewL()  " ) );
+	return new ( ELeave ) CFotaCustCmdFirstBoot;
+	}
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::~CFotaCustCmdFirstBoot
+// ---------------------------------------------------------------------------
+//
+CFotaCustCmdFirstBoot::~CFotaCustCmdFirstBoot()
+    {
+      FLOG( _L( "[CFotaCustCmdFirstBoot::~CFotaCustCmdFirstBoot()  " ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::Initialize
+// ---------------------------------------------------------------------------
+//
+TInt CFotaCustCmdFirstBoot::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
+    {
+  
+  FLOG( _L( "[CFotaCustCmdFirstBoot::Initialize()  " ) );
+
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::Execute
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirstBoot::Execute(
+    const TDesC8& /*aParams*/,
+    TRequestStatus& aRequest )
+    {
+    	     aRequest = KRequestPending;
+   FLOG( _L( "[CFotaCustCmdFirstBoot::Execute()  " ) );
+    #ifdef __PLUG_AND_PLAY_MOBILE_SERVICES 
+      FLOG( _L( "NOTHING TO DO   " ) );
+    #endif
+      TRequestStatus* request = &aRequest;
+      User::RequestComplete( request, KErrNone );
+
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::ExecuteCancel
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirstBoot::ExecuteCancel()
+    {
+      FLOG( _L( "[CFotaCustCmdFirstBoot::ExecuteCancel()  " ) );
+
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::Close
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirstBoot::Close()
+    {
+     FLOG( _L( "[CFotaCustCmdFirstBoot::Close()  " ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CFotaCustCmdFirstBoot::Release
+// ---------------------------------------------------------------------------
+//
+void CFotaCustCmdFirstBoot::Release()
+    {
+     FLOG( _L( "[CFotaCustCmdFirstBoot::Release()  " ) );
+
+	delete this;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotacustcmds/src/fotacustcmdsfactory.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Implementation of FotaCustCmdsFactory class.
+*
+*/
+
+#include "fotacustcmdsfactory.h"
+#include "fotacustcmdallreasons.h"
+#include "fotacustcmdfirmwareupdate.h"
+#include "fotacustcmdfirstboot.h"
+#include "fotastartupDebug.h"
+//#include "trace.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MSsmCustomCommand* FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL()
+    {
+   FLOG( _L( "[FotaCustCmdsFactory::FotaCustCmdAllReasonsNewL() " ) );
+
+    return CFotaCustCmdAllReasons::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MSsmCustomCommand* FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL()
+    {
+    FLOG( _L( "[FotaCustCmdsFactory::FotaCustCmdFirmwareUpdateNewL() " ) );
+    return CFotaCustCmdFirmwareUpdate::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// FotaCustCmdsFactory::FotaCustCmdFirstBootNewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MSsmCustomCommand* FotaCustCmdsFactory::FotaCustCmdFirstBootNewL()
+    {
+   
+    FLOG( _L( "[FotaCustCmdsFactory::FotaCustCmdFirstBootNewL() " ) );
+    return CFotaCustCmdFirstBoot::NewL();
+    }
--- a/fotaapplication/fotaserver/fotaserver.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-# 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 is the project file defnition for fotaserver.
-
-TEMPLATE = app
-TARGET = fotaserver
-
-DEPENDPATH += . \
-    ./inc \
-    ./src \
-    ../inc \
-
-INCLUDEPATH += . \
-    ./inc \
-    ../inc \
-    ../cenrep \
-    ../fmsclient/inc \
-
-HEADERS +=     FotaServer.h \ 
-    FotaDlMgrClient.h \
-    FotaDlClient.h \
-    FotaDB.h \
-    FotaNetworkRegStatus.h \
-    fotaserverPrivatePSKeys.h \
-    FotaSrvDebug.h \
-    FotasrvSession.h \
-    fotaupdate.h \
-    fotaUpdateAgentComms.h	\
-    fotanotifiers.h	\
-    fotafullscreendialog.h	\
-    fsview.h
-    
-    
-RESOURCES = fotaservernotifier.qrc
-
-TRANSLATIONS += deviceupdates.ts
-
-SOURCES += FotaDlMgrClient.cpp \
-    FotaDlClient.cpp \
-    FotaServer.cpp \
-    fotaupdate.cpp \
-    fotaSrvSession.cpp \
-    FotaDB.cpp \
-    FotaNetworkRegStatus.cpp \
-    FotaIPCTypes.cpp	\
-    fotanotifiers.cpp	\
-    fotafullscreendialog.cpp \
-    main.cpp	\
-    fsview.cpp
-    
-CONFIG(release, debug|release):LIBS += -L. \
-    -L./../../../../WrtBuild/Release/bin \
-    -lWrtDownloadMgr \
-    -lwrtserviceipcclient
-CONFIG(debug, debug|release):LIBS += -L. \
-    -L./../../../../WrtBuild/Debug/bin \
-    -lWrtDownloadMgr \
-    -lwrtserviceipcclient
-symbian { 
-    SYMBIAN_PLATFORMS = WINSCW
-    SYMBIAN_PLATFORMS += ARMV5
-    TARGET.VID = VID_DEFAULT
-    TARGET.UID3 = 0x102072C4
-    TARGET.EPOCALLOWDLLDATA = 1
-    TARGET.CAPABILITY = CAP_SERVER \
-        NetworkControl \
-        PowerMgmt \
-        DiskAdmin \
-        All \
-        -Tcb
-    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
-        /epoc32/include/platform/mw/cwrt \
-        /epoc32/include/cshelp \
-        /epoc32/include/ecom \
-        /epoc32/include/libc \
-        /epoc32/include/mw/Qt \
-        /epoc32/include/mw/QtCore \
-        /epoc32/include/mw/QtGui \
-        /epoc32/include/mw \
-        ../../sf/mw/qt/mkspecs/common/symbian \
-        ../../sf/mw/qt/mkspecs/common/symbian/tmp \
-        /epoc32/include \
-        /epoc32/include/stdapis \
-        /epoc32/include/stdapis/sys \
-        /epoc32/include/platform/mw \
-        /epoc32/include/platform \
-        /epoc32/include/platform/loc \
-        /epoc32/include/platform/mw/loc \
-        /epoc32/include/platform/loc/sc \
-        /epoc32/include/platform/mw/loc/sc \
-        /epoc32/include/mw/cwrt \
-        /epoc32/include/app \
-        /epoc32/include/platform/app \
-        /epoc32/include/platform/app/loc \
-        /epoc32/include/platform/app/loc/sc \
-    	/epoc32/include/stdapis/stlportv5	\
-		/epoc32/include/mw/hb/hbcore	\
-		/epoc32/include/mw/hb/hbwidgets	\
-		/epoc32/include/mw/hb/hbutils \
-		tmp
-	
-    LIBS += -laknskins \
-        -lapgrfx \
-        -lapparc \
-        -lapsettingshandlerui \
-        -lavkon \
-        -lbafl \
-        -lcone \
-        -lcommdb \
-        -lcommonengine \
-        -ledbms \
-        -lefsrv \
-        -leikctl \
-        -leikcore \
-        -leikcoctl \
-        -leikdlg \
-        -lestor \
-        -leuser \
-        -lfeatmgr \
-        -lhlplch \
-        -lws32 \
-        -lcommonui \
-        -lapmime \
-        -lsyncmlclientapi \
-        -lecom \
-        -lbitgdi \
-        -lfbscli \
-        -lgdi \
-        -letelmm \
-        -letel \
-        -lcentralrepository \
-        -lesock \
-        -lschsvr \
-        -lsysversioninfo \
-        -lnsmldmtreedbclient \
-        -lakncapserverclient \
-        -lstarterclient \
-        -lconnmon \
-        -lfeatmgr \
-        -lfmsclient \
-        -lcmmanager \
-        -lsysutil \
-        -lQtGui \
-        -lQtCore \
-        -lapgrfx \
-        -lgdi \
-        -leiksrv \
-        -lhal \
-        -llibc \
-        -llibm \
-        -llibdl \
-        -lmediaclientaudio \
-        -lcharconv \
-        -lws32 \
-        -laknnotify \
-		-lHbCore	\
-		-lHbWidgets	\
-		-lHbUtils	\
-		-lQtSvg		\
-		-lQtNetwork \
-		-lxqutils \
-		-linetprotutil \
-		-lusbman \
-		-lxqserviceutil \
-		-lflogger
-	
-CONFIG += hb
-MOC_DIR = moc
-}
--- a/fotaapplication/fotaserver/fotaservernotifier.qrc	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/xml">
-        <file>data/fullscreendialog.docml</file>
-    </qresource>
-</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   This file provides the information required for building fotaserver
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+../rom/fotaserver.iby																							CORE_MW_LAYER_IBY_EXPORT_PATH(fotaserver.iby)
+../rom/fotaserverresources.iby																		LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(fotaserverresources.iby)
+
+../FotaServer/loc/fotaserver.loc																	MW_LAYER_LOC_EXPORT_PATH(fotaserver.loc)
+
+// Generic configuration interface for component cenrep settings  
+../conf/fotadiskstorage.confml                    MW_LAYER_CONFML(fotadiskstorage.confml)
+../conf/fotadiskstorage_102072C6.crml 	        MW_LAYER_CRML(fotadiskstorage_102072C6.crml)
+../conf/fotaserver.confml                    MW_LAYER_CONFML(fotaserver.confml)
+../conf/fotaserver_102072C4.crml 	        MW_LAYER_CRML(fotaserver_102072C4.crml)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE fotaserver.mif
+  OPTION HEADERFILE fotaserver.mbg
+  OPTION SOURCES \
+	  -c8,8 qgn_prop_sml_http -c8,8 qgn_prop_sml_http_off -c8,8 qgn_prop_sml_bt \
+	  -c8,8 qgn_prop_sml_bt_off -c8,8 qgn_prop_sml_usb -c8,8 qgn_prop_sml_usb_off \
+	  -c8,8 qgn_menu_dm_cxt -c8,8 qgn_menu_dm_disabled_cxt -c8,8 qgn_note_sml \
+	  -c8,8 qgn_note_sml_server	  
+END
+
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE fotaserver_aif.mif
+  OPTION SOURCES -c8,8 qgn_menu_dm
+END
+
+
+PRJ_MMPFILES
+/*
+gnumakefile fota_icons_dc.mk
+
+#ifdef __SCALABLE_ICONS
+gnumakefile fota_icons_aif_scalable_dc.mk
+#else
+gnumakefile fota_icons_aif_bitmaps_dc.mk
+#endif
+*/
+
+#ifdef __SYNCML_DM_FOTA
+../FotaEngine/group/fotaengine.mmp
+../fmsclient/group/fmsclient.mmp
+../FotaServer/group/fotaserver.mmp
+../FotaStorage/group/fotadiskstorage.mmp
+../FotaRfsPlugin/group/RfsFotaPlugin.mmp
+../fmserver/group/fmsserver.mmp
+
+../FotaScheduleHandler/group/fotaschedulehandler.mmp
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/group/fota_icons_aif_scalable_dc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Implementation of fotaserver component
+# 	This is part of fotaapplication.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\RESOURCE\APPS
+ICONTARGETFILENAME=$(TARGETDIR)\fotaserver_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_dm.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/group/fota_icons_dc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Implementation of fotaserver component
+# 	This is part of fotaapplication.
+#
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\fotaserver.mif
+HEADERFILENAME=$(HEADERDIR)\fotaserver.mbg
+
+
+do_nothing : 
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_prop_sml_http.bmp \
+	/c8,8 qgn_prop_sml_http_off.bmp \
+	/c8,8 qgn_prop_sml_bt.bmp \
+	/c8,8 qgn_prop_sml_bt_off.bmp \
+	/c8,8 qgn_prop_sml_usb.bmp \
+	/c8,8 qgn_prop_sml_usb_off.bmp \
+	/c8,8 qgn_menu_dm_cxt.bmp \
+	/c8,8 qgn_menu_dm_disabled_cxt.bmp \
+	/c8,8 qgn_note_sml.bmp \
+	/c8,8 qgn_note_sml_server.bmp	
+	
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- a/fotaapplication/fotaserver/inc/FotaDB.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
-* 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:   Header file for fotadb
-*
-*/
-
-
-
-
-#ifndef __CFOTADB_H___
-#define __CFOTADB_H___
-
-// INCLUDES
-#include <d32dbms.h>
-#include <fotaengine.h>
-#include "FotaIPCTypes.h"
-
-
-// CONSTANTS
-// see fotaipctypes.h for field descriptions
-_LIT(KDatabaseName,"FotaState");
-
-_LIT(KSelectAll,"SELECT * FROM State" );
-_LIT(KSelect_where_packageid,"SELECT * FROM State WHERE PkgID=%d" );
-_LIT(KCreateTable, "CREATE TABLE State ( Id COUNTER, PkgID INTEGER NOT \
-     NULL, Result INTEGER, State INTEGER NOT NULL, ProfileID INTEGER,\
-	     PkgURL LONG VARCHAR, PkgName CHAR(255),Version CHAR(255), SmlTryCount INTEGER, \
-         SessionType INTEGER, IapId INTEGER, PkgSize UNSIGNED INTEGER, UpdateLtr BIT)");
-_LIT(KAlterTable, "ALTER TABLE State ADD (SessionType INTEGER, IapId INTEGER, PkgSize UNSIGNED INTEGER, UpdateLtr BIT)");
-_LIT(KTblState,     "State");
-
-_LIT(KColPkgId,     "PkgID");
-_LIT(KColResult,    "Result");
-_LIT(KColState,     "State");
-_LIT(KColProfileId, "ProfileID");
-_LIT(KColPkgUrl,    "PkgURL");
-_LIT(KColPkgName,   "PkgName");
-_LIT(KColVersion,   "Version");
-_LIT(KColSmlTryCount, "SmlTryCount");
-_LIT(KColSessionType, "SessionType");
-_LIT(KColIapId, "IapId");
-_LIT(KColPkgSize, "PkgSize");
-_LIT(KColUpdateLtr, "UpdateLtr");
-
-// DATATYPES
-enum TFDBFields
-{
-    EFDBResult      = 0x01,
-    EFDBState       = 0x02,
-    EFDBProfileId   = 0x04,
-    EFDBPkgUrl      = 0x08,
-    EFDBPkgName     = 0x10,
-    EFDBVersion     = 0x20,
-    EFDBSmlTryCount = 0x40,
-    EFDBSessionType = 0x80,
-    EFDBIapId 		= 0x100,
-    EFDBPkgSize 	= 0x200,
-    EFDBUpdateLtr 	= 0x400
-};
-//Number of attributes in fotastate table
-const TUint KNoOfDBFields = 13;
-
-// FORWARD DECLARATION
-class CPackageState;
-
-
-/**
- *  Database class
- *
- *  @lib    fotaserver
- *  @since  S60 v3.1
- */
-NONSHARABLE_CLASS(CFotaDB): public CBase
-    {
-    friend class CPackageState;
-public:
-	CFotaDB();
-
-	virtual ~CFotaDB();
-
-    static CFotaDB* NewL();
-
-    /**
-     * Create database
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  none
-     */
-    void CreateDatabaseL();
-    
-
-    /**
-     * Open database
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  Error code
-     */
-    void OpenDBL();
-
-    /**
-     * Close database and commit changes
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  none
-     */
-    void CloseAndCommitDB();
-
-
-    /**
-     * Checks if DB is open
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  TBool - is database open
-     */
-    TBool IsOpen();
-    
-
-    /**
-     * Add new package state to database
-     *
-     * @since   S60   v3.1
-     * @param   aState      State
-     * @param   aPkgURL     URL
-     * @return  None
-     */    
-    void AddPackageStateL( const TPackageState& aState
-                                ,const TDesC8& aPkgURL );
-
-
-    /**
-     * Get state from db
-     *
-     * @since   S60   v3.1
-     * @param   aPkgId      Package ID
-     * @return  State object
-     */        
-    TPackageState   GetStateL( const TInt aPkgId, TDes8& aPkgURL );
-
-
-    /** Sets state of package specified by packageid. If state doesnt exist,
-     * it is added to db.
-     * @since   S60   v3.1
-     * @param   aState   source data to be set
-     * @param   aPkgURL  URL
-     * @param   aChangedFields  Changed fields. Tells what columns from aState
-     *                          are to be set.
-     * @return  None
-     */
-    void SetStateL( TPackageState& aState
-                        ,const TDesC8& aPkgURL, TUint aChangedFields );
-
-    /**
-     * Gets all states from database
-     *
-     * @since   S60   v3.1
-     * @param   aStates     On return, all  states
-     * @return  Error code
-     */
-    void GetAllL(RArray<TInt>& aStates);
-
-private:
-
-    void ConstructL();
-
-
-    /**
-     * Converts database row to TPackageState
-     *
-     * @since   S60   v3.1
-     * @param  aPkgUrl  URL
-     * @param  aView    Database view. Must be ready&prepared for data 
-     *                  extraction
-     * @return  State
-     */
-	TPackageState RowToStateL(HBufC8*& aPkgUrl,const RDbView& aView);
-
-
-    /**
-     * Inserts TPackageState to database view
-     *
-     * @since   S60   v3.1
-     * @param  aPkg    Source package
-     * @param  aPkgURL Url
-     * @param  aView   Database view. Must be ready&prepared for data writing
-     * @return  None
-     */
-    void StateToRowL (const TPackageState& aPkg, const TDesC8& aPkgURL
-                    ,RDbView& aView);
-    
-    /**
-     * Sets the retry count from the cenrep
-     *
-     * @since   S60   v5.0
-     * @param   package state
-     * @return  None
-     */
-    
-    void SetRetryCount(TPackageState& aState);
-    
-    /**
-     * Determines the char need for db queries
-     *
-     * @since   S60   v5.0
-     * @param   aChangedFields change fields
-     * @param   aState package states
-     * @param   aPkgURL
-     * @return  None
-     */    
-    TInt DetermineCharNeeded(TInt aChangedFields,TPackageState& aState,const TDesC8& aPkgURL);
-
-private:
-
-    /**
-     * File server session
-     */
-    RFs iFSSession;
-
-    
-    /**
-     * Reference to database
-     */
-    RDbNamedDatabase iStateDB;
-
-
-    /**
-     * Columns
-     */
-    CDbColSet* iColSet;
-
-
-    /**
-     * Table
-     */
-    RDbTable iTable;
-
-    /**
-    * Is the db open?
-    */
-    TBool iIsOpen;
-
-    };
-
-#endif // FOTADB_H
--- a/fotaapplication/fotaserver/inc/FotaDlClient.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +0,0 @@
-/*
- * 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:   Fota download client
- *
- */
-#ifndef FOTADLCLIENT_H
-#define FOTADLCLIENT_H
-
-//All UI related headers
-#include <QWidget>
-#include <QtGui/QWidget>
-#include <QtGui>
-
-//All download manager related headers
-#include <dmcommon.h>
-#include <downloadmanager.h>
-#include <download.h>
-
-//All user includes
-#include "FotaSrvDebug.h"
-
-using namespace WRT;
-
-//Forward declarations
-class DownloadManagerClient;
-
-//Enums for mapping download manager operation status
-enum DLReturns
-    {
-    EOk = 0, ENotOk
-    };
-
-//Enums for type of download mechanism
-enum TDownloadType
-    {
-    THttpDownload = 0, //HTTP download mechanism
-    TOmaDL10Download, //OMA DL1.0 download mechanism
-    TUnknownType
-    //Unknown download mechanism
-    };
-
-//Enums for client (fota) side errors. This is used to know why client decided to pause/cancel the download.
-enum TClientErrorType
-    {
-    ErrorNone = 0, //No error
-
-    //Device side errors
-    UserCancelled = 100,//User cancelled download    
-    NeedMoreMemory, //Memory insufficient to start download
-
-    //Server side errors        
-    InvalidContentType = 200
-    //Content type invalid. ie. either HTTP nor OMA DL1.0
-    };
-
-/**
- *  This is the download client class. 
- *
- *  @lib    fotaserver
- *  @since  SF^4
- */
-class DownloadClient : public QObject
-    {
-Q_OBJECT
-
-public:
-    /**
-     * Constructor.
-     */
-    DownloadClient(DownloadManagerClient* aObserver);
-
-    /**
-     * Destructor.
-     */
-    ~DownloadClient();
-
-    /**
-     * Creates a single download with the download manager
-     *
-     * @since   SF^4
-     * @param   url - the source which is to be downloaded
-     * @param   type - determines the type of download. Either parallel or sequential.
-     * @return  One of DLReturns
-     */
-    TInt CreateDownload(const QString& url, DownloadType type);
-
-    /**
-     * Sets the required attributes for the single download.
-     *
-     * @since   SF^4
-     * @return  One of DLReturns
-     */
-    TInt SetDownloadAttributes();
-
-    /**
-     * Gets the attribute of the single download
-     *
-     * @since   SF^4
-     * @param   attr - the attribute of the download for which value is needed.
-     * @return  The value of the attribute. Caller should read the value in right format.
-     */
-    QVariant GetDownloadAttribute(DownloadAttribute attr);
-
-    /**
-     * Starts the single download. Download should be created and attributes set before this.
-     *
-     * @since   SF^4
-     * @param   None
-     * @return  One of DLReturns
-     */
-    TInt Start();
-
-    /**
-     * Pauses the single download.
-     *
-     * @since   SF^4
-     * @param   Client reason for pausing the download.
-     * @return  One of DLReturns
-     */
-    TInt Pause(TClientErrorType aReason);
-
-    /**
-     * Resumes the single download.
-     *
-     * @since   SF^4
-     * @param   None
-     * @return  One of DLReturns
-     */
-    TInt Resume();
-
-    /**
-     * Cancels the single download.
-     *
-     * @since   SF^4
-     * @param   Client reason for cancelling the download.
-     * @return  One of DLReturns
-     */
-    TInt Cancel(TClientErrorType aReason);
-
-    /**
-     * Restarts the single download. This is equivalent to cancel and start on Download.
-     *
-     * @since   SF^4
-     * @param   None
-     * @return  None
-     */
-    TInt Restart();
-
-private slots:
-
-    /**
-     * The slot which receives all the single download events.
-     *
-     * @since   SF^4
-     * @param   event - the download event
-     * @return  true, if handled here. Otherwise false.
-     */
-    bool DownloadEventRecieved(DownloadEvent *event);
-
-private:
-    /**
-     * Called to update the progress of download to fota server. This fetches the percentage
-     * of download from download manager.
-     *  
-     * @since   SF^4
-     * @param   None
-     * @return  None
-     */
-    void UpdateDownloadProgress();
-
-    /**
-     * Called when download is complete, either successfully or unsuccessfully.
-     * The arguments to this function is read to know the actual status.
-     *
-     * @since   SF^4
-     * @param   dlevent - the event of the single download
-     * @param   err0 - the last error occured
-     * @return  None
-     */
-    void HandleDownloadComplete(Download::State dlstate, int err0 = 0);
-
-    /**
-     * Called to handle the post download interrupt operation when client cancels/pauses download.
-     * 
-     * @since   SF^4
-     * @param   dlstate - the state of the single download
-     * @param   err0 - the last error occured
-     * @return  None
-     */
-    void HandleClientInterrupt(Download::State dlstate, int err0);
-
-    /**
-     * Called to read the OMA DL1.0 download descriptor. This will update the fota server with size and version.
-     *
-     * @since   SF^4
-     * @param   None
-     * @return  None
-     */
-    void ReadDescriptorData();
-
-    /**
-     * Called to validate the content type of the download as received in header.
-     *
-     * @since   SF^4
-     * @param   aContent - the content type as received in the header
-     * @return  One of TDownloadType
-     */
-    TDownloadType CheckContentType(const QString aContent);
-
-    void SetSubDownloadAttributes();
-
-private:
-
-    /**
-     * The Fota download manger client. This is not owned
-     */
-    DownloadManagerClient* iFotaDlMgrClient;
-
-    /**
-     * The Download object of the single download
-     */
-    Download *iDownload;
-
-    /**
-     * Progress of the download. true when download progressing, otherwise false.
-     */
-    TBool iProgress;
-
-    /**
-     * The total size of the download (ie. update package).
-     */
-    int iTotalSize;
-
-    /**
-     * To tell if space check has happened or not, before the start of the download.
-     */
-    bool iSpaceChecked;
-
-    /**
-     * To tell if client has interrupted download or not. The reason will be in iClientError.
-     */
-    bool iClientinterrupted;
-
-    /**
-     * Holds the client error that caused the download to cancel or pause.
-     */
-    TClientErrorType iClientError;
-
-    /**
-     * The state of the single download. This corresponds to the state received in the download event slot.
-     */
-    Download::State iDlState;
-
-    TDownloadType iContentType;
-
-    };
-
-#endif // FOTADLCLIENT_H
--- a/fotaapplication/fotaserver/inc/FotaDlMgrClient.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-/*
- * 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:   Fota download manager client 
- *
- */
-#ifndef FOTADLMGRCLIENT_H
-#define FOTADLMGRCLIENT_H
-
-#include <QtGui/QWidget>
-#include <QtGui>
-#include <QString>
-#include <QWidget>
-//All download manager related headers
-#include <dmcommon.h>
-#include <downloadmanager.h>
-#include <downloadevent.h>
-#include <download.h>
-#include <devicedialogconsts.h>
-#include <e32property.h>
-#include <e32def.h>
-
-//All orbit related headers
-#include <hbdialog.h>
-#include <hbdevicedialog.h>
-#include <hbdevicedialogsymbian.h>
-#include <hbsymbianvariant.h>
-
-//All user includes
-#include "FotaDlMgrClient.h"
-#include "FotaSrvDebug.h"
-#include <fotaengine.h>
-#include "FotaIPCTypes.h"
-#include "fotadiskstoragePrivateCRKeys.h"
-#include "fotafullscreendialog.h"
-#include "fotadevicedialogobserver.h"
-
-//Forward declarations
-class DownloadClient;
-class CFotaServer;
-class CFotaDownloadNotifHandler;
-
-using namespace WRT;
-
-enum TFreeSpace
-    {
-    EFitsToReservation, // fits to space reservation
-    EFitsToFileSystem, // doesn't fit to reservation,fits to FS
-    EDoesntFitToFileSystem
-    // doesn't fit to fs
-    };
-
-// System Critical Level (128KB) plus 5KB for fota operations.
-const TInt KSystemCriticalWorkingspace = 136192;
-_LIT( KReservedFileName, "reserved");
-_LIT( KDefaultPath, "C:\\private\\102072C4\\");
-_LIT( KPackageExtension, ".swupd");
-_LIT( KPackageExtensionAll, "*.swupd");
-_LIT( KDownloadTempDir, "FotaServer\\downloads\\");
-
-const QString DefaultPath = "C:\\private\\102072C4\\";
-const QString PackageName = "fwupdate.swupd";
-
-//Supported content types for firmware download
-const QString ContentTypeHttp = "application/vnd.nokia.swupd.dp2";
-const QString ContentTypeOmaDl = "application/vnd.oma.dd+xml";
-
-/**
- *  This is the download manager client class. 
- *
- *  @lib    fotaserver
- *  @since  SF^4
- */
-class DownloadManagerClient : public QObject, MfotadevicedialogObserver
-    {
-Q_OBJECT
-
-public:
-    /**
-     * Two phase construction.
-     */
-    static DownloadManagerClient* NewL(CFotaServer* aServer);
-
-    /**
-     * The destructor
-     */
-    ~DownloadManagerClient();
-
-    /**
-     * This method returns the created DownloadManager pointer 
-     * 
-     * @since   SF^4
-     * @param   
-     * @return  the download manager pointer
-     */
-    DownloadManager* Manager();
-
-    /**
-     * Creates a single download from the given url.
-     * 
-     * @since   SF^4
-     * @param   the source url of the download
-     * @return  None. Can leave with system wide errors
-     */
-    void DownloadL(const TDesC8& url);
-
-    /**
-     * This method is called by the download client when the download begins.
-     * @since   SF^4
-     * @param   size - the size of the actual download
-     * @param   version - the version as specified in the OMA DL1.0 descriptor
-     * @return  None
-     */
-    void StartDownloadProgress(QString name, QString version, int size);
-
-    /**
-     * This method is called by the download client when the download is in progress.
-     * @since   SF^4
-     * @param   progress - progress of the download in percentage.
-     * @return  None
-     */
-    void UpdateDownloadProgress(int progress);
-
-    /**
-     * This method is called by the download client when the download is complete, either 
-     * successfully or unsuccessfully.
-     * 
-     * @since   SF^4
-     * @param   dlstate - the state of the single download
-     * @param   err0 - the last download error
-     * @return  None
-     */
-    void HandleDownloadEvent(Download::State dlstate, int err0);
-
-    /**
-     * This method is called by the download client when the download is interrupted due to client specific reasons.
-     * @since   SF^4
-     * @param   dlstate - the state of the single download
-     * @param   err0 - the last download error
-     * @return  None
-     */
-    void HandleClientInterrupt(Download::State dlstate, int err0);
-
-    /**
-     * This method tells if the download is active or not.
-     * @since   SF^4
-     * @param   None
-     * @return true, if active, otherwise false.
-     */
-    TBool IsDownloadActive();
-
-    /**
-     * The method finds the suitable path for a given download. It checks the availability of memory using the size provided.
-     * @since   SF^4
-     * @param   aSize - the size of the download
-     * @param   aPath - the suitable path for the download to happen
-     * @return  one of TFreeSpace - space available, space fits to reservation, space unavailable
-     */
-    TFreeSpace GetSuitablePath(TInt aSize, QString& aPath);
-
-    /**
-     * This method creates the required space reservation on the disk.
-     * @since   SF^4
-     * @param   None
-     * @return None
-     */
-    void CreateDiskReservation();
-
-    /**
-     * This method deletes the reservation on the path provided.
-     * @since   SF^4
-     * @param   path - the path where reservation to be deleted.
-     * @return None
-     */
-    void DeleteDiskReservation(QString& path);
-
-    /**
-     * This method deletes the update package on the disk.
-     * @since   SF^4
-     * @param   None
-     * @return None, can leave with system wide errors.
-     */
-    void DeleteUpdatePackageL();
-
-    /**
-     * This method will try to resume any suspended single download
-     * @since   SF^4
-     * @param   None
-     * @return  None, can leave with system wide errors.
-     */
-    void TryResumeDownloadL();
-
-    /**
-     * This method will try to pause any ongoing download
-     * @since   SF^4
-     * @param   None
-     * @return 
-     */
-    void PauseDownloadL();
-
-    /**
-     * This method will get the location of the update package
-     * @since   SF^4
-     * @param   aPathj - location of the update package
-     * @return None, can leave with system wide errors.
-     */
-    void GetUpdatePackageLocation(TDes& aPath);
-
-    /**
-     * This method will get size of the downloaded content
-     * @since   SF^4
-     * @param   None
-     * @return size of the package in bytes
-     */
-    TInt GetDownloadPackageSize();
-
-    /**
-     * This function shows the device dialog which is requested
-     * @since   SF^4
-     * @param   dialogid - the dialog id to be shown
-     * @param   aValue - the value to be passed, if any.
-     * @return 
-     */
-    void ShowDialogL(TFwUpdNoteTypes dialogid, TInt aValue = 0);
-
-public:
-    // from MfotadevicedialogObserver
-
-    void HandleDialogResponse(int response, TInt aDialogid);
-
-public slots:
-
-    /**
-     * This is the slot which receives the download manager events.
-     * @since   SF^4
-     * @param   event - the download manager event
-     * @return true if handled, otherwise false.
-     */
-    bool DownloadMgrEventRecieved(DownloadManagerEvent *event);
-
-private:
-
-    /**
-     * Constructor.
-     */
-
-    DownloadManagerClient(CFotaServer *aServer);
-
-    /**
-     * Two phase construction
-     */
-    void ConstructL();
-
-    /**
-     * This functions initializes the download manager
-     * @since   SF^4
-     * @param   None
-     * @return one of DLReturns
-     */
-    int InitDownloadMgr();
-
-    /**
-     * This function uninitializes the download manager.
-     * @since   SF^4
-     * @param   None
-     * @return None
-     */
-    void UninitDownloadMgr();
-
-    /**
-     * This function returns the access point name for a given access point id.
-     * @since   SF^4
-     * @param   aIapId - access point id
-     * @return access point name, can leave with system wide errors.
-     */
-    QString GetIapNameWithIdL(TInt aIapId);
-
-    /**
-     * This function calculates the disk space allocated for firmware update and reserved file.
-     * @since   SF^4
-     * @param   aSwupdSize, the size of the swupd files in bytes
-     * @param   aReservedSize, the size of the reserved file in bytes.
-     * @return None
-     */
-    void SpaceAllocatedBySWUPDFiles(TInt& aSwupdSize, TInt& aReservedSize);
-
-    /**
-     * This function maps the download errors to fota failure reasons
-     * @since   SF^4
-     * @param   err0 - the error in the single download
-     * @return None
-     */
-    void MapDownloadErrors(int err0);
-
-private:
-    /**
-     * The download manager instance
-     */
-    DownloadManager* iDownloadManager;
-
-    /**
-     * The fota download client instance
-     */
-    DownloadClient* iDownloadClient;
-
-    /**
-     * The fota server instance
-     */
-    CFotaServer* iFotaServer; // not owned
-
-    /**
-     * Is download manager initialized?
-     */
-    TBool iInitialized;
-
-    /**
-     * Is download submitted to download manager?
-     */
-    TBool iDownloadSubmitted;
-
-    /**
-     * Is download in progress?
-     */
-    TBool iProgress;
-
-    /**
-     * The file server instance
-     */
-    RFs iFs;
-
-    /**
-     * the reserved memory size in bytes
-     */
-    TInt iReservedSize;
-
-    /**
-     * The dialog variant maps which is exchanged with device dialog server
-     */
-
-    CHbSymbianVariantMap * iNotifParams;
-    CFotaDownloadNotifHandler* iNotifier;
-    };
-
-#endif // FOTADLMGRCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaIPCTypes.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2005-2006 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:   interprocess messages
+*
+*/
+
+
+
+// INCLUDES
+#include "FotaIPCTypes.h"
+#include <centralrepository.h>
+#include "fotaserverPrivateCRKeys.h"
+
+// ======================= MEMBER FUNCTIONS ==================================
+
+// ---------------------------------------------------------------------------
+// TDownloadIPCParams::TDownloadIPCParams 
+// ---------------------------------------------------------------------------
+TDownloadIPCParams::TDownloadIPCParams () : iPkgId(-1),iProfileId(0)
+        , iSendAlert(ETrue)
+        , iIapId(-1), iPkgSize(0), iSessionType(0), iUpdateLtr (0)
+{
+    iPkgName        = KNullDesC8;
+    iPkgVersion     = KNullDesC8;
+}
+
+// ---------------------------------------------------------------------------
+// TDownloadIPCParams::TDownloadIPCParams 
+// ---------------------------------------------------------------------------
+TDownloadIPCParams::TDownloadIPCParams (const TDownloadIPCParams& p )
+                           : iPkgId ( p.iPkgId ), iProfileId (p.iProfileId )
+                           , iSendAlert( p.iSendAlert )
+                           , iIapId(p.iIapId), iPkgSize(p.iPkgSize), iSessionType(p.iSessionType), iUpdateLtr (p.iUpdateLtr)
+    {
+    iPkgName        = p.iPkgName;
+    iPkgVersion     = p.iPkgVersion;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::TPackageState
+// ---------------------------------------------------------------------------
+TPackageState::TPackageState( RFotaEngineSession::TState aState, TInt aResult)
+    : TDownloadIPCParams (),  iState(aState), iResult(aResult)
+    						,iSmlTryCount( KDefaultSmlTryCount )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::TPackageState
+// ---------------------------------------------------------------------------
+TPackageState::TPackageState( RFotaEngineSession::TState aState) 
+    : TDownloadIPCParams (), iState(aState), iResult(-1) 
+    						,iSmlTryCount( KDefaultSmlTryCount )
+    {
+	SetSmlTryCount();
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::TPackageState
+// ---------------------------------------------------------------------------
+TPackageState::TPackageState( TDownloadIPCParams p) : 
+    TDownloadIPCParams(p),iState(RFotaEngineSession::EIdle), iResult(-1)
+    					 ,iSmlTryCount( KDefaultSmlTryCount )
+    {  
+    SetSmlTryCount();
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::TPackageState
+// ---------------------------------------------------------------------------
+TPackageState::TPackageState() : TDownloadIPCParams () 
+            ,iState(RFotaEngineSession::EIdle), iResult(-1)
+            ,iSmlTryCount( KDefaultSmlTryCount )
+    {
+    SetSmlTryCount();
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::SetSmlTryCount()
+// ---------------------------------------------------------------------------
+void TPackageState::SetSmlTryCount()
+{
+	 TInt err = KErrNone;
+	 TInt retry = 0;
+	 CRepository *centrep = NULL;
+      TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
+    	    if ( centrep ) 
+        	{
+        	err = centrep->Get( KGenericAlertRetries, retry );
+        	delete centrep; centrep = NULL;
+        	}
+        	if(err == KErrNone)
+        	{
+        		
+            	    if(retry < 0 )
+            	    {
+            	    iSmlTryCount = KDefaultSmlTryCount;
+            	    }
+                  	else if( retry == 0 )
+               	    {
+               	     iSmlTryCount = 2 ;
+               	    }
+                	else if (retry > KMaximumSmlTryCount )
+               	    {
+               	     iSmlTryCount = KMaximumSmlTryCount + 1;
+               	    }
+                   	else
+                    {
+                	  iSmlTryCount = retry + 1;
+                    }
+        	    }
+        	 else
+        	    {
+        	    iSmlTryCount = KDefaultSmlTryCount;
+        	    }
+}
+// ---------------------------------------------------------------------------
+// TPackageState::ExternalizeL 
+// ---------------------------------------------------------------------------
+void TPackageState::ExternalizeL ( RWriteStream& aStream )
+    {
+    aStream.WriteInt16L (iState); aStream.WriteInt16L (iResult); 
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::InternalizeL
+// ---------------------------------------------------------------------------
+void TPackageState::InternalizeL(RReadStream& /*aStream*/) 
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::operator=
+// ---------------------------------------------------------------------------
+TPackageState& TPackageState::operator= ( const TDownloadIPCParams& a )
+    {
+    iPkgId      = a.iPkgId;
+    iProfileId  = a.iProfileId;
+    iPkgName    = a.iPkgName;
+    iPkgVersion = a.iPkgVersion;
+    iIapId		= a.iIapId;
+    iPkgSize	= a.iPkgSize;
+    iSessionType= a.iSessionType;
+    iUpdateLtr 	= a.iUpdateLtr;
+
+    return *this;
+    }
+
+
+// ---------------------------------------------------------------------------
+// TPackageState::operator=
+// ---------------------------------------------------------------------------
+TPackageState& TPackageState::operator=(const TPackageState& a)
+    {
+    iPkgId      = a.iPkgId; 
+    iProfileId  = a.iProfileId; 
+    iPkgName    = a.iPkgName; 
+    iPkgVersion = a.iPkgVersion;
+    iIapId		= a.iIapId;
+    iPkgSize	= a.iPkgSize;
+    iSessionType= a.iSessionType;
+    iUpdateLtr	= a.iUpdateLtr;
+    iState      = a.iState;  
+    iResult     = a.iResult;
+    iSmlTryCount= a.iSmlTryCount;
+    return *this;
+    }
+ 
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaIPCTypes.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,243 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+
+
+#ifndef __FOTAIPCTYPES_H_
+#define __FOTAIPCTYPES_H_
+
+// INCLUDES 
+#include <e32std.h>
+#include <SyncMLDef.h>
+#include "fotaengine.h"
+
+// DATA TYPES
+typedef TBuf16<200> TPkgIdList;
+
+/**
+ *  Inter process parameters for fotaserver
+ *
+ *  @lib    fotaengine.lib
+ *  @since  S60 v3.1
+ */
+class TDownloadIPCParams
+    {
+
+public:
+    TDownloadIPCParams (); 
+
+
+    /**
+     * Copy constructor.
+     *
+     * @since   S60 v3.1
+     * @param   p Copy of another ipc
+     * @return  None
+    */
+    TDownloadIPCParams (const TDownloadIPCParams& p ); 
+
+
+    /**
+     * Package id
+     */
+    TInt                            iPkgId;
+    
+    /**
+     * Profile id
+     */
+    TSmlProfileId                   iProfileId;
+
+    
+    /**
+     * Package name
+     */
+    TBuf8<KFotaMaxPkgNameLength>    iPkgName;
+
+    
+    /**
+     * Package version
+     */
+    TBuf8<KFotaMaxPkgVersionLength> iPkgVersion;
+
+
+    /**
+     * Should DM server be notified via generic alert.
+     * This is not saved to database!
+     */
+    TBool iSendAlert;
+
+
+    /**
+     * IAP Id used
+     */
+    TInt iIapId;
+
+    /**
+     * Total size of the package
+     */
+    TUint iPkgSize;
+
+
+    /**
+     * DM Session type
+     */
+    TInt iSessionType;
+
+
+    /**
+     * Should update happen later?
+     */
+    TBool iUpdateLtr;
+    };
+
+
+/**
+ *  Extended inter process parameters for fotaserver
+ *
+ *  @lib    fotaengine.lib
+ *  @since  S60 v3.1
+ */
+class TPackageState : public TDownloadIPCParams
+    {
+
+public:
+
+
+    /**
+     * Constructor
+     *
+     * @since   S60 v3.1
+     * @param   aState  State
+     * @param   aResult Result
+     * @return  None
+    */
+    TPackageState( RFotaEngineSession::TState aState, TInt aResult);
+    
+
+    /**
+     * Constructor
+     *
+     * @since   S60 v3.1
+     * @param   aState  State
+     * @return  None
+    */
+    TPackageState( RFotaEngineSession::TState aState);
+
+
+    /**
+     * Constructor
+     *
+     * @since   S60 v3.1
+     * @param   p  Ipc params
+     * @return  None
+    */
+    TPackageState( TDownloadIPCParams p);
+
+    TPackageState();
+
+    /**
+     * Externalizes class to a stream
+     *
+     * @since   S60 v3.1
+     * @param   aStream Target stream
+     * @return  None
+    */
+    void ExternalizeL (RWriteStream& aStream);
+
+
+    /**
+     * Externalizes class from a stream
+     *
+     * @since   S60 v3.1
+     * @param   aStream Source stream
+     * @return  None
+    */
+    void InternalizeL(RReadStream& /*aStream*/);
+
+
+    /**
+     * Assignment operator
+     *
+     * @since   S60 v3.1
+     * @param   a  Source 
+     * @return  None
+    */
+    TPackageState& operator=(const TDownloadIPCParams& a);
+
+
+    /**
+     * Assignment operator
+     *
+     * @since   S60 v3.1
+     * @param   a  Source 
+     * @return  None
+    */
+    TPackageState& operator=(const TPackageState& a);
+
+
+public:
+
+    /**
+     * State (see FUMO specification)
+     */
+    RFotaEngineSession::TState  iState;
+
+
+    /**
+     * Result code (FUMO)
+     */
+    TInt iResult;
+
+    /**
+     * Counter for generic alert raporting. If raporting fails, try again in
+     * successive boots until counter runs to 0
+     */
+    TInt iSmlTryCount;
+
+private :
+	/*
+	* Method to set the iSmlTryCount depending on Cenrep settings
+	*/
+	void SetSmlTryCount();
+};
+
+
+
+/**
+ *  Update reminder task
+ *
+ *  @lib    fotaengine.lib
+ *  @since  S60 v3.1
+ */
+class TFotaScheduledUpdate
+{
+    public:
+    TFotaScheduledUpdate(const TInt aPkgId, const TInt aScheduleId)
+        {
+        iPkgId      = aPkgId;
+        iScheduleId = aScheduleId;
+        }
+
+    TInt                            iPkgId;
+
+    TInt                            iScheduleId;
+};
+
+#endif      // __FOTAIPCTYPES_H_   
+            
+// End of File
--- a/fotaapplication/fotaserver/inc/FotaNetworkRegStatus.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
- * 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:   GPRS and Wlan status getter for sending Generic Alerts
- *
- */
-
-#ifndef __FOTANETWORKREGSTATUS_H__
-#define __FOTANETWORKREGSTATUS_H__
-
-// SYSTEM INCLUDES
-#include <e32base.h>
-#include <rconnmon.h>
-
-//Forward declarations
-class CFotaServer;
-
-//Constants used in this class
-
-const TTimeIntervalMicroSeconds32 KTimeInterval = 1000000; //1 second, duration between each retry.
-const TInt KRetries = 10; //Maximum number of retries.
-
-/**
- * Actice object class that runs a timer for probing network status (GPRS & WLAN)
- *  @lib    fotaserver
- *  @since  S60 v3.2
- */
-NONSHARABLE_CLASS (CFotaNetworkRegStatus) : public CActive
-    {
-public:
-    //Symbian 2-Phase construction
-
-    static CFotaNetworkRegStatus* NewL(CFotaServer* aObserver);
-    static CFotaNetworkRegStatus* NewLC(CFotaServer* aObserver);
-
-    /**
-     * Destructor.
-     */
-    virtual ~CFotaNetworkRegStatus();
-
-public:
-    /**
-     * Starts monitoring for Network status before sending Generic Alert
-     *
-     * @since   S60   v3.2
-     * @param   None
-     * @return  None
-     */
-
-    void StartMonitoringL();
-
-    /** 
-     * Checks whether the network connection possible with the IAP Id provided
-     *
-     * @since   S60   v3.2
-     * @param   None
-     * @return  ETrue if yes, EFalse when not possible
-     */
-    //TBool IsConnectionPossibleL(TInt aIapid);
-
-public:
-    // Functions from base classes
-    /**
-     * From CActive,DoCancel.
-     */
-    void DoCancel();
-
-    /**
-     * From CActive,RunL.
-     */
-    void RunL();
-
-    /**
-     * From CActive,RunError.
-     */
-    TInt RunError(TInt aError);
-
-private:
-    //functions
-
-    //Constructors
-
-    CFotaNetworkRegStatus();
-    CFotaNetworkRegStatus(CFotaServer* aObserver);
-
-    //Symbian 2-Phase construction 
-    void ConstructL();
-
-    /**
-     * Checks GlobalRFs status
-     *
-     * @since   S60   v3.2
-     * @param   None
-     * @return  ETrue if success, EFalse if failure
-     */
-    TBool CheckGlobalRFState();
-
-    /**
-     * Checks Network status, basically Network Registration
-     *
-     * @since   S60   v3.2
-     * @param   None
-     * @return  ETrue if success, EFalse if failure
-     */
-    TBool CheckNetworkRegStateL();
-
-    /**
-     * Checks Wlan status
-     *
-     * @since   S60   v3.2
-     * @param   None
-     * @return  ETrue if success, EFalse if failure
-     */
-    TBool IsWlanSupportedL();
-
-    /**
-     * To find the bearer of the IapId
-     *
-     * @since   S60   v3.2
-     * @param   aIapId
-     * @return  ETrue/EFalse
-     */
-    //TUint32 FindBearerL(TInt aIapId);
-
-private:
-    // data
-
-    /**
-     * timer used for monitoring
-     */
-    RTimer iTimer;
-
-    /**
-     * S60 monitory class used for monitoring network status
-     */
-    RConnectionMonitor iMonitor;
-
-    /**
-     * FotaServer
-     */
-    CFotaServer* iObserver;
-
-    /**
-     * Number of retries
-     */
-    TInt iRetriesLeft;
-
-    /**
-     * GlobalRFs state
-     */
-    TBool iGlobalRFState;
-    };
-
-#endif // __FOTANETWORKREGSTATUS_H__
-// End of File
--- a/fotaapplication/fotaserver/inc/FotaServer.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,740 +0,0 @@
-/*
- * 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:   Header file for CFotaServer
- *
- */
-
-#ifndef __FOTASERVER_H__
-#define __FOTASERVER_H__
-
-// INCLUDES
-
-#include <coemain.h>
-#include <s32file.h>
-#include <e32property.h>
-#include <SyncMLClient.h>
-#include <SyncMLClientDM.h>
-#include <hwrmpowerstatesdkpskeys.h>
-#include <SyncMLObservers.h>
-#include <devicedialogconsts.h>
-#include <hbsymbianvariant.h>
-#include <hbmainwindow.h>
-#include "fotaserverPrivateCRKeys.h"
-#include "FotaIPCTypes.h"
-#include "FotaDB.h"
-#include "fotaConst.h"
-#include "fotaupdate.h" 
-#include "fmsclient.h"	//The FMS Client header file
-#include "FotaSrvDebug.h"
-#include "fotadevicedialogobserver.h"
-
-/** If download is active this P&S key is set to ETrue, otherwise EFalse. 
- * The key is owned by omadmappui**/
-const TUint32 KFotaServerActive = 0x0000008;
-#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
-
-//Forward declarations
-class FotaFullscreenDialog;
-/** File that stores the firmware version at the start of download. This is in fota's private directory*/
-_LIT (KSWversionFile, "swv.txt");
-
-/** Time and the interval download finalizing retries*/
-const TInt KDownloadFinalizerWaitTime(1000000);
-
-/** Time interval between syncml session retry attempts*/
-const TInt KSyncmlSessionRetryInterval(60000000);
-
-/** Time and the interval between the fota shutdownload retries*/
-const TTimeIntervalMicroSeconds32 KFotaTimeShutDown(10000000);
-
-/** How many times generic alert sending should be tried in row. */
-const TInt KSyncmlAttemptCount = 3;
-
-/** How many times a download can be restarted when a non-resumable interrupt occurs. */
-const TInt KMaxDownloadRestartCount = 3;
-
-_LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData );
-_LIT_SECURITY_POLICY_C1( KWritePolicy, ECapabilityWriteDeviceData );
-_LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-
-// FORWARD CLASS DECLARATION
-
-class CFotaUpdate;
-class CFotaSrvApp;
-class CFotaNetworkRegStatus;
-class DownloadManagerClient;
-class CFotaDownloadNotifHandler;
-/**
- * Fota server. Handles client requests. Starts download and/or update.
- *
- *  This class is 
- *
- *  @lib    fotaserver
- *  @since  S60 v3.1
- */
-NONSHARABLE_CLASS( CFotaServer ) : public CServer2,
-        MSyncMLEventObserver,
-        MfotadevicedialogObserver
-    {
-    friend class CFotaSrvSession;
-    friend class CFotaUpdate;
-
-public:
-
-    // Member functions
-
-    static CFotaServer* NewInstance(HbMainWindow& mainwindow);
-
-    /**
-     * Destructor.
-     */
-    virtual ~CFotaServer();
-
-public:
-
-    // All functions called from the session
-    /**
-     * Start download
-     *
-     * @since   S60   v3.1
-     * @param   aParams     Package state params to be save in db
-     * @param   aPkgURL     URL
-     * @return  none
-     */
-    void DownloadL(TDownloadIPCParams aParams, const TDesC8& aPkgURL,
-            TFotaClient aRequester, TBool aSilent, TBool aUpdateLtr);
-
-    /**
-     * Pauses ongoing download
-     *
-     * @since   S60   v3.1
-     * @param   none
-     * @return  none, can leave with system wide errors
-     */
-    void PauseDownloadL();
-
-    /**
-     * Start update
-     *
-     * @since   S60   v3.1
-     * @param   aClient - the client which invoked the update
-     * @return  none, can leave with system wide errors
-     */
-    void TryUpdateL(TFotaClient aClient);
-
-    /**
-     * Update, triggered by scheduler
-     *
-     * @since   S60   v3.1
-     * @param   aUpdate - Update details
-     * @param   aClient - the client which invoked the update
-     * @return  none, can leave with system wide errors
-     */
-    void ScheduledUpdateL(TFotaScheduledUpdate aUpdate, TFotaClient aClient);
-
-    /**
-     * Delete swupd package
-     *
-     * @since   S60   v3.1
-     * @param   aPkgId - Package id
-     * @return  none, can leave with system wide errors
-     */
-    void DeletePackageL(const TInt aPkgId);
-
-    /**
-     * Get state of a swupd package
-     *
-     * @since   S60   v3.1
-     * @param   aPkgId - Package id
-     * @return  Package state, can leave with system wide errors
-     */
-    TPackageState GetStateL(const TInt aPkgId);
-
-    /**
-     * Tries to resume the download.
-     *
-     * @since   S60   v5.2
-     * @param   aClient the client which triggers resume
-     * @param   aSilentDl	Whether to query user for resume?
-     * @return  None, can leave with system wide errors
-     */
-    void TryResumeDownloadL(TFotaClient aClient, TBool aSilentDl);
-
-    /**
-     * Get ids of present swupd packages
-     *
-     * @since   S60   v3.1
-     * @param   aPackageIdList  On return, ids will be here
-     * @return  None, can leave with system wide errors
-     */
-    void GetUpdatePackageIdsL(TDes16& aPackageIdList);
-
-    /**
-     * Get time of last update
-     *
-     * @since   S60   v3.1
-     * @param   aTime       On return, time of last update
-     * @return  None, can leave with system wide errors
-     */
-    void GetUpdateTimeStampL(TDes16& aTime);
-
-    void GetCurrentFwDetailsL(TDes8& aName, TDes8& aVersion, TInt& aSize);
-
-    /**
-     * Do cleanup for package
-     *
-     * @since   S60   v3.1
-     * @param   aPackageID Packageid
-     * @return  None
-     */
-    void ResetFotaStateL(const TInt aPackageID);
-
-    /**
-     * Set download to be finalized. 
-     *
-     * @since   S60   v3.1
-     * @param   aDLState    Final state of the download
-     * @return  None, can leave with system wide errors
-     */
-    void FinalizeDownloadL();
-
-    /**
-     * Callback function to notify the network status
-     *
-     * @since S60	v3.2
-     * @param Status of network connection
-     * @return None
-     */
-    void ReportNetworkStatus(TBool status);
-
-    //All user interface functions
-
-    /**
-     * Function to start the full screen dialog
-     *
-     * @since SF4
-     * @param aSize - the full size of the download
-     * @param aVersion - the version of the firmware upate
-     * @param aName - the name of the firmware update
-     * @return None
-     */
-    void StartDownloadDialog(const QString &aName, const QString &aVersion,
-            const TInt &Size);
-
-    /**
-     * Function to update the full screen dialog with download progress
-     *
-     * @since SF4
-     * @param aProgress - the download progress in percentage
-     * @return None
-     */
-    void UpdateDownloadDialog(TInt aProgress);
-
-    /**
-     * Function to show any dialog within fota server 
-     *
-     * @since SF4
-     * @param dialogid -the dialog identifier
-     * @return None
-     */
-    void ShowDialogL(TFwUpdNoteTypes aDialogid);
-
-    /**
-     * Function that handles all the user responses on full screen dialog
-     *
-     * @since SF4
-     * @param aResponse - key response
-     * @return None
-     */
-    void HandleFullScreenDialogResponse(TInt aResponse);
-
-    /**
-     * Function called from the fota update when battery condition changes 
-     *
-     * @since SF4
-     * @param aStatus - status of the battery, true if low, false if acceptable
-     * @return None
-     */
-    void UpdateBatteryLowInfo(TBool aStatus);
-
-    /**
-     * Returns the full screen dialog pointer
-     *
-     * @since SF4
-     * @param none
-     * @return pointer to full screen dialog instance
-     */
-    FotaFullscreenDialog* FullScreenDialog();
-
-    /**
-     * Sets the phone's startup reason which will used by Fota Startup Pluggin to any decision.
-     *
-     * @since   S60   v3.2
-     * @param   aReason     Startup reason, either download interrupted
-     * @return  None
-     */
-    void SetStartupReason(TInt aReason);
-
-    void ConstructApplicationUI(TBool aVal);
-    void SetServerActive(TBool aValue);
-    
-    void FinalizeUpdate();
-
-public:
-    // member variables
-
-    /**
-     * The package state of the firmware update
-     */
-
-    TPackageState iPackageState;
-
-    /**
-     * Used for package state saving.
-     */
-    CFotaDB* iDatabase;
-    
-    
-    TBuf8<KMaxFileName> iLastFwUrl;
-
-public:
-    // from  base classes
-
-    /**
-     * Handle syncml event
-     * @param    aEvent
-     * @param    aIdentifier
-     * @param    aError
-     * @param    aAdditionalData
-     * @return   none
-     */
-    void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError,
-            TInt aAdditionalData);
-
-    /**
-     * Function that is called when any user action happens on the dialogs or full screen dialog
-     *
-     * @since SF4
-     * @param response - key press
-     * @return None
-     */
-    void HandleDialogResponse(int response, TInt aDialogid);
-
-    //All finalizing functions
-    /**
-     * Finalize download
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  None, can leave with system wide errors
-     */
-    void DoFinalizeDownloadL();
-
-    /**
-     * Read update result file and report result back to DM server
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  None, can leave with system wide errors
-     */
-    void DoExecuteResultFileL();
-
-    /**
-     * Close syncml session
-     *
-     * @since   S60 v3.1
-     * @param none
-     * @return  None, can leave with system wide errors
-     */
-    void DoCloseSMLSessionL();
-
-    /**
-     * When called, will try to shut the server when possible.
-     * This will use the timer to shut down.
-     *
-     * @since   SF4
-     * @param none
-     * @return  None
-     */
-    void StopServerWhenPossible();
-
-    void ServerCanShut(TBool aParam);
-    
-    TBool DecrementDownloadRestartCount();
-	
-    void SetVisible(TBool aVisible);
-
-protected:
-    // from base classes
-
-    /**
-     * Calls when a New session is getting created
-     * @param aVersion
-     * @param aMessage
-     * @return CSession2*
-     */
-    CSession2* NewSessionL(const TVersion& aVersion,
-            const RMessage2& aMessage) const;
-
-    /**
-     * DoConnect. 
-     *
-     * @since   S60   v3.1
-     * @param   aMessage    IPC message
-     * @return  none
-     */
-    void DoConnect(const RMessage2& aMessage);
-
-    void DropSession();
-
-private:
-
-    /**
-     * C++ default constructor.
-     */
-    CFotaServer(HbMainWindow& mainwindow);
-
-    /**
-     * ConstructL
-     *
-     * @since   S60   v3.1
-     * @param   none
-     * @return  none
-     */
-    virtual void ConstructL();
-
-    /**
-     * Latter part of constructing. It's ensured that parent fotaserver is 
-     * constructed only once, and child fotaserver is not constructed at all.
-     * Client fotaserver has a task of saving swupd as its only task. It should
-     * not update swupd states.
-     *
-     * @since   S60   v3.1
-     * @param   aMessage    Client process details
-     * @return  none
-     */
-    void ClientAwareConstructL(const RMessage2 &aMessage);
-
-    /**
-     * Resets the fota state
-     * @since S60	v3.2
-     * @param IPC params
-     * @return None
-     */
-
-    void ResetFotaStateToFailL();
-
-    /**
-     * Starts network monitoring operaiton for defined interval and retries
-     *
-     * @since S60	v3.2
-     * @param None
-     * @return None
-     */
-    void StartNetworkMonitorL();
-
-    /**
-     * Creates the disk reservation as set in the configuration
-     *
-     * @since SF4
-     * @param 
-     * @return None
-     */
-    void CreateDiskReservation();
-
-    /**
-     * Deletes the disk reservation in the given absolute path
-     *
-     * @since SF4
-     * @param 
-     * @return None
-     */
-    void DeleteDiskReservation(TDesC& path);
-
-    /**
-     * Sets the appropriate access point id for the download
-     *
-     * @since SF4
-     * @param none
-     * @return None, can leave with system wide errors.
-     */
-    void SetIapToUseL();
-
-    /**
-     * Invoke Fota Monitory Service when the download gets suspended
-     *
-     * @since   S60   v3.2
-     * @return  None
-     */
-    void InvokeFmsL();
-
-    /**
-     * Cancels any outstanding request for resume notification
-     *
-     * @since   S60   v3.2
-     * @return  None
-     */
-    void CancelFmsL();
-
-    /**
-     * Check s/w version with the current version
-     *
-     * @since   S60   v3.2
-     * @param   none
-     * @return  Bool value(matches or not)
-     */
-    TBool CheckSWVersionL();
-
-    /**
-     * Create DM session to DM server (identified by profileid)
-     *
-     * @since   S60   v3.1
-     * @param   aProfileId  DM profile id
-     * @param   aIapid      IAP id. If not kerrnone, will be used instead
-     *                      of profiles' IAP id.
-     * @return  none
-     */
-    void CreateDeviceManagementSessionL(TPackageState& aState);
-
-    /**
-     * Get the software version of the device
-     * @since S60   v3.2
-     * @param s/w version 
-     * @return error
-     */
-    TInt GetSoftwareVersion(TDes& aVersion);
-
-    /**
-     * Checks for IAP Id exists or not in commsdb
-     * IAPId used for resuming the paused download
-     * @since S60   v5.0
-     * @param IapId
-     * @return ETrue/EFalse
-     */
-    TBool CheckIapExistsL(TUint32 aIapId);
-
-    /**
-     * Checks if the drive is busy due to encryption
-     *
-     * @since SF4
-     * @param None
-     * @return true, if busy, else false
-     */
-    TBool IsDeviceDriveBusyL();
-
-    /**
-     * The downloader manager object
-     *
-     * @since SF4
-     * @param 
-     * @return None
-     */
-    DownloadManagerClient* DownloaderL();
-
-    /**
-     * Sets the update requester
-     *
-     * @since SF4
-     * @param aRequester - the requester of firmware update
-     * @return None
-     */
-    void SetUpdateRequester(TFotaClient aRequester);
-
-    /**
-     * Gets the update requester
-     *
-     * @since SF4
-     * @param 
-     * @return None
-     */
-    TFotaClient GetUpdateRequester();
-
-    /**
-     * Reports firmware update status to the requester
-     *
-     * @since SF4
-     * @param astate - the package state that has the status
-     * @return None
-     */
-    void ReportFwUpdateStatusL(TPackageState& aState);
-
-    /**
-     * Loops for the battery status whilst full screen dialog is open
-     * 
-     * @since SF4
-     * @param aBatteryLevel - the battery level
-     * @return None
-     */
-    void LoopBatteryCheckL(TBool aBatteryLevel);
-
-    /**
-     * Shows the full screen dialog
-     *
-     * @since SF4
-     * @param aType - type of the dialog
-     * @return None
-     */
-    void ShowFullScreenDialog(TInt aType);
-
-    /**
-     * Swaps the fota process from background to foreground
-     *
-     * @since SF4
-     * @param aState - true will bring to foreground, false to background
-     * @return None
-     */
-    //void swapProcess(TBool aState);
-
-    void ResetCounters();
-
-    TBool IsUserPostponeAllowed();
-
-    void DecrementUserPostponeCount();
-    
-    void WakeupServer();
-
-private:
-    // Data
-
-private:
-    // member variables    
-    /**
-     * Is server initialized?
-     */
-    TBool iInitialized;
-
-    /**
-     * The download manager client
-     */
-    DownloadManagerClient* iDownloader;
-
-    /**
-     * Used for starting update of fw.
-     */
-    CFotaUpdate* iUpdater;
-
-    /**
-     * Used for deleting download.
-     */
-    CPeriodic* iDownloadFinalizer;
-
-    /**
-     * Used for deleting update.
-     */
-    CPeriodic* iUpdateFinalizer;
-
-    /**
-     * Used for reading result file.
-     */
-    CPeriodic* iTimedExecuteResultFile;
-
-    /**
-     * Used for closing syncml session
-     */
-    CPeriodic* iTimedSMLSessionClose;
-
-    /**
-     * File server session
-     */
-    RFs iFs;
-
-    /**
-     * Tries to periodically shut down fotaserver
-     */
-    CPeriodic* iAppShutter;
-
-    /**
-     * Syncmlsession for creating dmsession
-     */
-    RSyncMLSession iSyncMLSession;
-
-    /**
-     * Class that checks for network availability 
-     * 
-     */
-    CFotaNetworkRegStatus* iMonitor;
-
-    /**
-     * How many times to try dm session
-     */
-    TInt iSyncMLAttempts;
-
-    /**
-     * sync job id
-     */
-    TSmlJobId iSyncJobId;
-
-    /**
-     * profile
-     */
-    TSmlProfileId iSyncProfile;
-
-    /**
-     * To tell whether Generic Alert sending is being retried or not. This is checked before shutting down fota server
-     * 
-     */
-    TBool iRetryingGASend;
-
-    /**
-     * To tell whether network is available to send Generic Alert.
-     * 
-     */
-    TBool iNetworkAvailable;
-
-    /**
-     * The Fota Monitory Client object
-     */
-    RFMSClient iFMSClient;
-
-    /**
-     * Holds the storage drive of the package.
-     */
-    TDriveNumber iStorageDrive;
-
-    /**
-     * The session count to fota server.
-     */
-    static TInt iSessionCount;
-
-    /**
-     * The full screen dialog 
-     */
-    FotaFullscreenDialog *iFullScreenDialog;
-
-    /**
-     * The notifier params to the dialogs
-     */
-    CHbSymbianVariantMap * iNotifParams;
-
-    CFotaDownloadNotifHandler * iNotifier;
-    /**
-     * Can the server shut?
-     */
-    TBool iServerCanShut;
-
-    /**
-     * Is async operation requested?
-     */
-    TBool iAsyncOperation;
-
-    TInt iDialogId;
-
-    TBool iConstructed;
-    
-    HbMainWindow& iMainwindow;
-    };
-
-#endif 
-
-// End of File
--- a/fotaapplication/fotaserver/inc/FotaSrvDebug.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * 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 file defines logging macros 
- *
- */
-#ifndef FOTADEBUG_H
-#define FOTADEBUG_H
-// IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
-#if defined (__WINS__)
-#define _FOTA_DEBUG
-#define _FOTA_DEBUG_RDEBUG
-#else
-
-#endif
-//#endif
-#ifdef _FOTA_DEBUG
-#include <e32std.h>
-#include <f32file.h>
-#include <flogger.h>
-#include <e32svr.h>
-_LIT( KLogFile, "fotaserver.log" );
-_LIT( KLogDir, "fota" );
-
-inline void FWrite(TRefByValue<const TDesC> aFmt, ...)
-    {
-    VA_LIST list;
-    VA_START( list, aFmt );
-    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend,
-            TPtrC(aFmt), list);
-    }
-
-#ifdef _FOTA_DEBUG_RDEBUG 
-#ifndef __GNUC__          
-#define FLOG            RDebug::Print
-#else   // __GNUC__       
-#define FLOG(arg...)    RDebug::Print(arg);
-#endif // __GNUC__        
-#else // _FOTA_DEBUG_RDEBUG
-#ifndef __GNUC__          
-#define FLOG            FWrite
-#else   // __GNUC__       
-#define FLOG(arg...)    FWrite(arg);
-#endif // __GNUC__        
-#endif // _FOTA_DEBUG_RDEBUG
-#else   // _FOTA_DEBUG    
-#ifndef __GNUC__
-#define FLOG
-#else
-#define FLOG(arg...)
-#endif // __GNUC__
-#endif // _FOTA_DEBUG
-#endif      // FOTADEBUG_H
-// End of File
--- a/fotaapplication/fotaserver/inc/FotasrvSession.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * 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:   Represent client's session at serverside
- *
- */
-
-#ifndef CFOTASRVSESSION_H
-#define CFOTASRVSESSION_H
-
-// INCLUDES
-
-#include <fotaengine.h>
-#include "FotaServer.h"
-
-// CLASS DECLARATION
-/**
- *  Fotaserver's session class
- *
- *  @lib    fotaserver.exe
- *  @since  S60 v3.1
- */
-class CFotaSrvSession : public CSession2
-    {
-public:
-
-    CFotaSrvSession();
-
-    /**
-     * C++ Destructor
-     */
-    virtual ~CFotaSrvSession();
-
-    /**
-     * Getter for fotaserver
-     *
-     * @since   S60   v3.1
-     * @param   None
-     * @return  Fotaserver
-     */
-    CFotaServer* FotaServer() const;
-
-public:
-    // new functions
-
-    /**
-     * Checks client secure id (dmhostserver,fotaserver,fotatester) 
-     *
-     * @since   S60   v3.1
-     * @param   Message containing client details
-     * @return  is it fotaserver
-     */
-    static TFotaClient CheckClientSecureIdL(const RMessage2& aMessage);
-
-protected:
-
-    /**
-     * service client request
-     *
-     * @since   S60   v3.1
-     * @param   aMessage     message containing client request details
-     * @return  None
-     */
-    void ServiceL(const RMessage2& aMessage);
-
-    /**
-     * Called from ServiceL to handle the request 
-     * @param aMessage
-     * @return None
-     */
-    void DispatchMessageL(const RMessage2& aMessage);
-
-
-    /**
-     * Handle service error
-     *
-     * @since   S60   v3.1
-     * @param aMessage  Msg that resulted in error
-     * @param aError    Error code
-     * @return None
-     */
-    void ServiceError(const RMessage2& aMessage, TInt aError);
-
-private:
-    /**
-     * Error caught while writing data into FS
-     */
-    TInt iError;
-
-    };
-
-#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/fmsclientserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of fotaserver component
+* 	This is part of fotaapplication.
+*
+*/
+
+// FMSClientServer.h
+//
+//
+#ifndef __FMS_CLIENTSERVER_H__
+#define  __FMS_CLIENTSERVER_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+// server name
+
+_LIT(KFMSServerName,"FMSServer");
+
+//const TUid KFMSServerUid={0x200100C8}; //To be moved to fotaconst.h
+
+enum TOmaDLInterruptReason
+{
+	EUserInterrupt,
+	ENetworkInterrupt,
+	EMemoryInterrupt,
+	EGeneralInterrupt	
+#ifdef __WINS__
+	,ELaunchFota = 6
+#endif	
+};
+
+enum TFMSLaunch //Proper name will be provided later
+{
+	EFotaStartUpPlugin = 4, //as continuation to upper enums
+	ECancelOutstandingRequest
+};
+
+enum TOmaUpdInterruptReason
+{
+	ENoUpdInterrupt=7,
+	EMonitorbattery, 
+    EPhoneCallActive,
+	EMonitorPhoneCallEnd
+};
+#endif
\ No newline at end of file
--- a/fotaapplication/fotaserver/inc/fotaUpdateAgentComms.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * 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:   Update agent result codes
- *
- */
-
-#ifndef __COMMUNICATION_BETWEEN_NORMAL_AND_UPDATE_MODE_H__
-#define __COMMUNICATION_BETWEEN_NORMAL_AND_UPDATE_MODE_H__
-
-typedef enum
-    {
-
-    /*
-     Everything is ok - update package were installed successfully and 
-     newer version of OS is running.
-     */
-    UPD_OK = 0,
-    /*
-     Problem: The request sent to update installer were invalid - probable issue in
-     Download agent.
-     
-     Solutions:
-     - Probable: Download agent created an invalid file.
-     Fix download agent.
-     - Inprobable: Corrupted request file, or FAT
-     */
-    UPD_INSTALL_REQUEST_IS_INVALID = 1,
-    /*
-     Problem: Update package is absent from specified location.
-
-     Solution: Incorrect user application actions. 
-     Read update application document / manual on how to switch to 
-     update mode.
-     */
-    UPD_UPDATE_PACKAGE_IS_ABSENT = 2,
-    /*
-     Problem: Update package is corrupted. (Integrity or authenticity 
-     check failed)
-     Solution: End-user should try to download again update package.
-     */
-    UPD_UPDATE_PACKAGE_IS_CORRUPTED = 3,
-    /*
-     Problem: Update package contents is invalid for some reason.
-     This problem normally refers to the fact that update package
-     were created incorrectly.
-     
-     Solution: Contact update package build team in order to find out the 
-     error cause.
-     */
-    UPD_UPDATE_PACKAGE_CONTENTS_IS_INVALID = 4,
-    /*
-     Problem: Update package is not compatible with current mobile device.
-     Solution: End-user should try to download again update package.
-     */
-
-    UPD_UPDATE_PACKAGE_IS_NOT_COMPATIBLE_WITH_CURRENT_MOBILE_DEVICE = 5,
-    /*
-     Problem: This error code will be used to indicate fatal error 
-     code after which phone becomes dead.
-     
-     Solution: Phone should be taken to maintenance.
-     This error code cannot be seen by normal mode applications 
-     because OS cannot be started when phone became dead.
-     */
-    UPD_FATAL_ERROR = 0xFFFFFFFF
-    } InstallationResult;
-
-typedef enum
-    {
-    UPD_InvalidBlockHeaderIdentifier = 1,
-    UPD_InvalidUpdatePackageVersion = 2,
-    UPD_GenericInvalidFileFormat = 3
-    } DetailedInstallationResult;
-
-#endif //__COMMUNICATION_BETWEEN_NORMAL_AND_UPDATE_MODE_H__
--- a/fotaapplication/fotaserver/inc/fotadevicedialogobserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * 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:   Fota server update and download functionality 
- *
- */
-
-#ifndef FOTADEVICEDIALOGOBSERVER_H
-#define FOTADEVICEDIALOGOBSERVER_H
-
-class MfotadevicedialogObserver
-    {
-public:
-    /**
-    * Notify the input of the device dialog to the respective caller.
-    */
-    virtual void HandleDialogResponse( int response, TInt aDialogid ) = 0;
-    };
-
-#endif // FOTADEVICEDIALOGOBSERVER_H
-
-// End of File
-
--- a/fotaapplication/fotaserver/inc/fotafullscreendialog.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * 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: 
- *
- */
-
-#ifndef FOTAFULLSCREENDIALOG_H
-#define FOTAFULLSCREENDIALOG_H
-
-// INCLUDES
-
-#include <QWidget>
-#include <QtGui/QWidget>
-#include <QtGui>
-#include <hbdialog.h>
-#include <hbdocumentloader.h>
-#include <hbprogressbar.h>
-#include <hbdataform.h>
-#include <hbdataformmodel.h>
-#include <hbpushbutton.h>
-#include <hblabel.h>
-
-#include "FotaDlClient.h"
-#include "FotaServer.h"
-
-enum TFotaWarningType
-    {
-    EHbFotaDownload = 1, EHbFotaUpdate, EHbFotaLowBattery
-    };
-
-// CLASS DECLARATION
-
-/**
- *  FotaFullscreenDialog
- * 
- */
-class FotaFullscreenDialog : public QObject
-    {
-Q_OBJECT
-
-public:
-
-    FotaFullscreenDialog(CFotaServer* aObserver);
-
-    ~FotaFullscreenDialog();
-
-    /**
-     * This function updates the details of the update to the fullscreen dialog.
-     * @param   size - The total size of the update package.
-     * @param   version - The version of the soeftware that is being updated.
-     * @param   aName - the package name of the current update.
-     * @return   void
-     */
-    void SetSoftwareDetails(int size, const QString version,
-            const QString aName);
-
-    /**
-     * This function updates the download progress bar to the progress value passed.
-     * @param   aType - the state in which the firmware update is in(downloading or donwload complete)
-     * @return   void
-     */
-    void SetWarningDetails(TFotaWarningType aType);
-
-    /**
-     * This function updates the download progress bar to the progress value passed.
-     * @param   aProgress - the progress value to be update to the progress bar.
-     * @return   void
-     */
-    void UpdateProgressBar(TInt aProgress);
-
-    /**
-     * Used to change the warnings and softkeys required for the update dialog
-     * @param   void
-     * @return   void
-     */
-    void ShowUpdateDialog();
-
-    /**
-     * Used to refresh the dialog when the content of the dialog content changes.
-     * @param   void
-     * @return   void
-     */
-    void Close();
-
-    /**
-     * Used to disable the RSK of the dialog when resume dialogs
-     * @param   aVal - to enable or disable the key
-     * @return   void
-     */
-    void DisableRSK(TBool aVal);
-
-    bool IsLSKEnabled();
-
-    void SetVisible(TBool aVisible);
-
-private:
-
-    /**
-     * Used to refresh the dialog when the content of the dialog changes.
-     * @param   void
-     * @return   void
-     */
-    void RefreshDialog();
-
-public slots:
-
-    /**
-     * Slot to be called when user selects the Left soft key.
-     * @param   void
-     * @return   void
-     */
-    void LSKSelected();
-
-    /**
-     * Slot to be called when user selects the Right soft key.
-     * @param   void
-     * @return   void
-     */
-    void RSKSelected();
-
-    /**
-     * Slot to be called when the dialog is about to get closed.
-     * @param   void
-     * @return   void
-     */
-    void aboutToClose();
-
-private:
-
-    // dialog instance
-    HbDialog * idialog;
-
-    //document loader to load the widgets
-    HbDocumentLoader iloader;
-
-    //progress bar for updating download progress
-    HbProgressBar * iprogressBar;
-
-    // Fota server instance to send the keypress event
-    CFotaServer* iServer;
-
-    // LSK of the dialog
-    HbPushButton * iPrimaryAction;
-
-    // RSK of the dialog
-    HbPushButton * iSecondaryAction;
-
-    // Flag to differentiate from keypress and dialog timeout case.
-    TBool iClicked;
-
-    // Warning note displayed in the full screen dialog 
-    HbLabel *iInstallNote;
-
-    // Warning note displayed in the full screen dialog
-    HbLabel *iRestartNote;
-
-    // Warning note displayed in the full screen dialog
-    HbLabel *iRestartIcon;
-
-    // Warning note displayed in the full screen dialog
-    HbLabel *iEmergencyNote;
-
-    // Warning note displayed in the full screen dialog
-    HbLabel *iEmergencyIcon;
-
-    // Warning note displayed in the full screen dialog
-    HbLabel *iChargerNote;
-
-    HbLabel *iChargerIcon;
-
-    // To display the state of the download above progress bar
-    HbLabel *iDownloadState;
-
-    // Fullscreen dialog title.
-    HbLabel *iTitle;
-    // Firmware details that is to be shwon in full screen dialog.
-    HbLabel *iSwDetails;
-    };
-
-#endif // CLASSNAME_H
--- a/fotaapplication/fotaserver/inc/fotanotifiers.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * 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: 
- *
- */
-#ifndef FOTANOTIFIER_H
-#define FOTANOTIFIER_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <centralrepository.h>
-#include <devicedialogconsts.h>
-#include <e32property.h>
-
-#include "FotaDlMgrClient.h"
-#include "fotaserverPrivateCRKeys.h"
-
-// CLASS DECLARATION
-
-/**
- *  CClassName
- * 
- */
-
-//#include <hb/hbcore/hbsymbiandevicedialog.h>    // MHbDeviceDialogObserver
-
-NONSHARABLE_CLASS ( CFotaDownloadNotifHandler ) : public MHbDeviceDialogObserver
-    {
-public:
-    // new functions
-    /**
-     * Construction and setting of observer happens here
-     *
-     * @since   S60   SF4
-     * @param   aObserver is the parent class which owns the notifier and information is
-     * passed to the parent class from the device dialog.
-     */
-
-    static CFotaDownloadNotifHandler* NewL(
-            MfotadevicedialogObserver* aObserver);
-
-    /**
-     * constructor for CFotaDownloadNotifHandler
-     *
-     * @since   S60   SF4
-     * @param   None
-     */
-
-    CFotaDownloadNotifHandler();
-
-    /**
-     * Destructor for CFotaDownloadNotifHandler
-     *
-     * @since   S60   SF4
-     * @param   None
-     */
-
-    ~CFotaDownloadNotifHandler();
-
-    /**
-     * Shows notifier and/or ends download
-     *
-     * @since   S60   SF4
-     * @param   aNotifParams   Contains necessary information to lauch a notifier
-     */
-
-    void CFotaDownloadNotifHandler::LaunchNotifierL(
-            CHbSymbianVariantMap *aNotifParams, TInt aDialogId);
-
-    void Cancel();
-
-public:
-    // from MHbDeviceDialogObserver
-
-    /**
-     * Slot to be called from the device dialog
-     *
-     * @aData   - It contains the information from the device dialog
-     */
-    void DataReceived(CHbSymbianVariantMap& aData);
-
-    /**
-     * Slot to be called from the device dialog is closed
-     *
-     * @aCompletionCode   - It contains the error code due to which dialog is closed.
-     */
-    void DeviceDialogClosed(TInt aCompletionCode);
-
-private:
-
-    //DownloadClient* iDownload;
-    MfotadevicedialogObserver * iObserver;
-
-    // Device dialog instance
-    CHbDeviceDialogSymbian* iDevDialog;
-
-    TInt iDialogID;
-
-    };
-
-#endif // FOTANOTIFIER_H
--- a/fotaapplication/fotaserver/inc/fotaserverPrivatePSKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * 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:   	PS keys for fotaserver
- *
- */
-
-#ifndef FOTASERVER_PRIVATE_PSKEYS_H
-#define FOTASERVER_PRIVATE_PSKEYS_H
-
-// CONSTANTS
-
-// Reading the current or ongoing NSML Job Id from DM UI
-const TUint32 KNsmlCurrentJobId = 0x00000001;
-
-// Reading the Server Alert UI Mode Key
-const TUint32 KNsmlSanUIMode = 0x00000004;
-
-// Reading the OMA DM large object download status
-const TUint32 KFotaLrgObjDl = 0x00000005;
-
-// Reading the Server profile id used for OMA DM large object download
-const TUint32 KFotaLrgObjProfileId = 0x00000006;
-
-//PubSub key used to mark which application is handling the process of download
-//Sets by DM UI, NSC or NSCBackground
-const TUint32 KNSmlCurrentFotaUpdateAppName = 0x0000000A;
-
-//PubSub key used to define should "Install Now?" query be shown or not
-//Sets by DM UI or NSC
-const TUint32 KDevManShowInstallNowQuery = 0x0000000B;
-
-//Reading the DM Job status/error used for OMA DM large object download
-const TUint32 KDmJobCancel = 0x00000012;
-
-#endif // FOTASERVER_PRIVATE_PSKEYS_H
-// End of File
--- a/fotaapplication/fotaserver/inc/fotaupdate.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * 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:   Header for updater active object
- *
- */
-#ifndef __UPDATER_H___
-#define __UPDATER_H___
-//System includes
-#include <bautils.h>
-#include <schinfo.h>
-#include <starterclient.h>
-#include "FotaServer.h"
-#include "fotaUpdateAgentComms.h"
-#include "fotaengine.h"
-#include <devicedialogconsts.h>
-#include <hbsymbianvariant.h>
-#include "fotadevicedialogobserver.h"
-// CONSTANTS
-_LIT (KUpdateResultFile, "update.resp");
-_LIT (KUpdateRequestFile, "update.req");
-_LIT (KUpdateBitmap ,"installing.bmp");
-_LIT (KRestartingBitmap ,"restarting.bmp");
-_LIT (KUpdateTimeStampFileName, "updatetimestamp");
-_LIT8 (KSwupdPath8, "c:\\private\\102072C4\\");
-_LIT8 (KSwupdFileExt8, ".swupd");
-
-const TInt BatteryLevelAccepted = EBatteryLevelLevel3;
-
-enum MonitorType
-    {
-    None, BatteryLevel, ChargingStatus
-    };
-
-// FORWARD  DECLARATIONS
-class CFotaServer;
-class CFotaUpdate;
-class CFotaDownloadNotifHandler;
-
-// CLASS DECLARATION
-
-/**
- *  Update related activities
- *
- *  @lib    fotaserver
- *  @since  S60 v3.1
- */
-NONSHARABLE_CLASS( CFotaUpdate ) : public CActive, MfotadevicedialogObserver
-    {
-public:
-
-    static CFotaUpdate* NewL(CFotaServer* aServer);
-
-    virtual ~CFotaUpdate();
-
-    /*****Functions called before update*****/
-
-    TBool CheckBatteryL();
-
-    void MonitorBatteryChargeLevel();
-
-    void MonitorBatteryChargingStatus();
-
-    void CancelMonitor();
-
-    /**
-     * Start update
-     *
-     * @since   S60   v3.1
-     * @param   aParams         details
-     * @return  none
-     */
-    void StartUpdateL(const TDownloadIPCParams &aParams);
-
-    /**
-     * Update. boot.
-     *
-     * @since   S60   v3.1
-     * @param   none
-     * @return  none
-     */
-    void UpdateL();
-
-    /*****Functions called after update *****/
-
-    /**
-     * Check update result written update agent. Is it there?
-     *
-     * @since   S60   v3.1
-     * @param   aRfs
-     * @return  is it there
-     */
-    static TBool CheckUpdateResults(RFs& aRfs);
-
-    /**
-     * Delete update result file
-     *
-     * @since   S60   v3.1
-     * @param   none
-     * @return  none
-     */
-    static void DeleteUpdateResultFileL();
-
-    /**
-     * Execute update result file. That is, read result code. Send it to srv.
-     *
-     * @since   S60   v3.1
-     * @param   aRfs
-     * @return  none
-     */
-    void ExecuteUpdateResultFileL();
-
-protected:
-    // from base classes
-
-
-    /**
-     * Hanlde notifier clicking
-     *
-     * @since   S60   v3.1
-     * @param   none
-     * @return  none
-     */
-    virtual void RunL();
-
-    /**
-     * Cancel outstanding reqeust
-     *
-     * @since   S60   v3.1
-     * @param   none
-     * @return  none
-     */
-    void DoCancel();
-
-    /**
-     * Handle leaving runl
-     *
-     * @since   S60   v3.1
-     * @param   aError  error
-     * @return  none
-     */
-    virtual TInt RunError(TInt aError);
-
-private:
-
-    CFotaUpdate();
-
-    void ShowDialogL(TFwUpdNoteTypes dialogid);
-
-    TBool IsUSBConnected();
-    
-    TInt WriteUpdateBitmapL( const TDesC& aText, const TDesC& aFile);
-
-public:
-    // from MfotadevicedialogObserver
-
-    void HandleDialogResponse(int response, TInt aDialogid);
-
-private:
-
-    /**
-     * reference to fotaserver.
-     * Not own
-     */
-    CFotaServer* iFotaServer;
-
-    RProperty iProperty;
-
-    MonitorType iMonitorType;
-
-    CHbSymbianVariantMap * iNotifParams;
-
-    CFotaDownloadNotifHandler * iNotifier;
-    };
-
-#endif // __UPDATER_H___
--- a/fotaapplication/fotaserver/inc/fsview.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of applicationmanagement components
- *
- */
-
-#ifndef FSVIEW_H_
-#define FSVIEW_H_
-
-#include <hbview.h>
-#include <QObject>
-
-class CFotaServer;
-
-class FSView : public HbView
-    {
-    Q_OBJECT
-
-public:
-    FSView();
-    ~FSView();
-
-    void SetServer(CFotaServer * aServer);
-    
-    //Handles the incoming events
-    bool eventFilter(QObject *object, QEvent *event);
-
-private:
-    CFotaServer *iServer;
-    };
-#endif /* FSVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/rom/fotaserver.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005-2006 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:   Image description file for project fotaserver
+*
+*/
+
+
+
+#ifndef ___FOTASERVER_IBY__
+#define ___FOTASERVER_IBY__
+
+
+#ifdef __SYNCML_DM_FOTA
+
+file=ABI_DIR\BUILD_DIR\fotaengine.dll    SHARED_LIB_DIR\fotaengine.dll
+file=ABI_DIR\BUILD_DIR\FMSClient.dll    SHARED_LIB_DIR\FMSClient.dll
+
+S60_APP_EXE(fotaserver)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,fotaserver)
+S60_APP_AIF_ICONS(fotaserver)
+S60_APP_AIF_RSC(fotaserver)
+
+
+file=ABI_DIR\BUILD_DIR\fotaschedulehandler.exe    PROGRAMS_DIR\fotaschedulehandler.exe
+file=ABI_DIR\BUILD_DIR\FMSServer.exe    PROGRAMS_DIR\FMSServer.exe
+
+ECOM_PLUGIN(fotadiskstorage.dll,fotadiskstorage.rsc)
+ECOM_PLUGIN(RfsFotaPlugin.dll,  RfsFotaPlugin.RSC)
+
+#if ( defined (__SYNCML_DM ) || defined (__PLUG_AND_PLAY_MOBILE_SERVICES) )
+
+file=ABI_DIR\BUILD_DIR\fotacustcmds.dll SHARED_LIB_DIR\fotacustcmds.dll
+
+#endif // __SYNCML_DM || __PLUG_AND_PLAY_MOBILE_SERVICES
+
+#endif // __SYNCML_DM_FOTA
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/rom/fotaserverresources.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2005-2006 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:   Image description file for project fotaserver
+*
+*/
+
+
+
+#ifndef ___FOTASERVERRESOURCES_IBY__
+#define ___FOTASERVERRESOURCES_IBY__
+
+#ifdef __SYNCML_DM_FOTA
+S60_APP_RESOURCE(fotaserver)
+#endif // __SYNCML_DM_FOTA
+
+#endif
--- a/fotaapplication/fotaserver/src/FotaDB.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,549 +0,0 @@
-/*
- * 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:   Fota package state preservation 
- *
- */
-
-#include <centralrepository.h>
-#include "FotaDB.h"
-#include "FotaSrvDebug.h"
-#include "fotaserverPrivateCRKeys.h"
-
-#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
-
-// ====================== MEMBER FUNCTIONS ===================================
-
-// ---------------------------------------------------------------------------
-// CFotaDB::CFotaDB()
-// ---------------------------------------------------------------------------
-CFotaDB::CFotaDB() :
-    iIsOpen(EFalse)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::~CFotaDB()
-// ---------------------------------------------------------------------------
-CFotaDB::~CFotaDB()
-    {
-    //Delete columns set
-    if (iColSet)
-        {
-        delete iColSet;
-        iColSet = NULL;
-        }
-    //Close table
-    iTable.Close();
-
-    //Close database
-    iStateDB.Close();
-
-    //Close file server session
-    if (iFSSession.Handle())
-        iFSSession.Close();
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::NewL()
-// ---------------------------------------------------------------------------
-CFotaDB* CFotaDB::NewL()
-    {
-    CFotaDB* self = new (ELeave) CFotaDB();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::ConstructL()
-// ---------------------------------------------------------------------------
-void CFotaDB::ConstructL()
-    {
-    TInt err;
-    TBuf<KMaxPath> tmp;
-    User::LeaveIfError(iFSSession.Connect());
-    err = iFSSession.CreatePrivatePath(EDriveC);
-    if (err != KErrNone && err != KErrAlreadyExists)
-        User::Leave(err);
-    User::LeaveIfError(iFSSession.SetSessionToPrivate(EDriveC));
-    User::LeaveIfError(iFSSession.SessionPath(tmp));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::CreateDatabaseL()
-// Creates db in private dir of fotaserver
-// ---------------------------------------------------------------------------
-void CFotaDB::CreateDatabaseL()
-    {
-    FLOG(_L("CFotaDB::CreateDatabaseL()  >>"));
-    TInt err;
-    User::LeaveIfError(iStateDB.Create(iFSSession, KDatabaseName));
-    User::LeaveIfError(iStateDB.Begin());
-    User::LeaveIfError(iStateDB.Execute(KCreateTable));
-    err = iStateDB.Commit();
-    if (err)
-        {
-        FLOG(_L("      cdb err %d"), err);
-        iStateDB.Rollback();
-        User::Leave(err);
-        }
-    User::LeaveIfError(iStateDB.Compact());
-    FLOG(_L("CFotaDB::CreateDatabaseL()  <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::AddPackageStateL
-// Adds state to db
-// ---------------------------------------------------------------------------
-void CFotaDB::AddPackageStateL(const TPackageState& aState,
-        const TDesC8& aPkgURL)
-    {
-    FLOG(_L("  CFotaDB::AddPackageStateL   >>"));
-    TInt err;
-    RDbView view;
-    CleanupClosePushL(view);
-    TPackageState pkgstate(aState);
-    pkgstate.iResult = -1; // result should be -1 if no Execs have been done
-    err = view.Prepare(iStateDB, TDbQuery(KSelectAll), RDbView::EInsertOnly);
-    __LEAVE_IF_ERROR(err);
-    FLOG(_L("  CFotaDB::AddPackageStateL   inserting. pkgid:%d result:%d  state:%d"),
-            pkgstate.iPkgId, pkgstate.iResult, pkgstate.iState);
-    view.InsertL();
-    StateToRowL(pkgstate, aPkgURL, view);
-    view.PutL();
-    CleanupStack::PopAndDestroy(); //view
-    FLOG(_L("  CFotaDB::AddPackageStateL   <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::GetAllL
-// Get all states
-// ---------------------------------------------------------------------------
-void CFotaDB::GetAllL(RArray<TInt>& aStates)
-    {
-    RDbView view;
-    CleanupClosePushL(view);
-
-    TInt err = view.Prepare(iStateDB, TDbQuery(KSelectAll));
-    __LEAVE_IF_ERROR(err);
-    view.EvaluateAll();
-
-    view.FirstL();
-    FLOG(_L("[fota DB] --- rows ------------------------------------------------------------------- v"));
-    while (view.AtRow())
-        {
-        view.GetL();
-        HBufC8* url;
-        TPackageState s = RowToStateL(url, view);
-        aStates.Append(s.iPkgId);
-        CleanupStack::PushL(url);
-        FLOG(_L("[fotaDB] pkgid: %d profid:%d state:%d  result:%d \
-                url: %d chars sessiontype:%d IapId:%d Pkgsize:%d UpdateLtr:%d"),
-                s.iPkgId, s.iProfileId, s.iState, s.iResult,
-                url->Des().Length(), s.iSessionType, s.iIapId, s.iPkgSize,
-                s.iUpdateLtr);
-        CleanupStack::PopAndDestroy(); // url
-        view.NextL();
-        }
-    FLOG(_L("[fota DB] --- rows ------------------------------------------------------------------- ^"));
-    view.Close();
-    CleanupStack::PopAndDestroy(); //view
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::OpenDBL()
-// Opens database
-// ---------------------------------------------------------------------------
-void CFotaDB::OpenDBL()
-    {
-    FLOG(_L("CFotaDB::OpenDBL()"));
-    if (!iIsOpen) //Prevents accidental opening of database twice
-        {
-        TInt err;
-        err = iStateDB.Open(iFSSession, KDatabaseName);
-
-        if (err == KErrNotFound)
-            {
-            CreateDatabaseL();
-            }
-        else if (err != KErrNone)
-            {
-            FLOG(_L("[fota DB openDB]\t db open error: %d"), err);
-            FLOG(_L("deleting fota DB and creating it again..."));
-            err = iFSSession.Delete(KDatabaseName);
-            CreateDatabaseL();
-            User::LeaveIfError(err);
-            }
-        User::LeaveIfError(iTable.Open(iStateDB, KTblState));
-        iColSet = iTable.ColSetL();
-
-        iIsOpen = ETrue;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::CloseAndCommitDB
-// Closes and commits DB
-// ---------------------------------------------------------------------------
-void CFotaDB::CloseAndCommitDB()
-    {
-    if (iColSet)
-        {
-        delete iColSet;
-        iColSet = NULL;
-        }
-    iTable.Close();
-    iStateDB.Close();
-    iIsOpen = EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::IsOpen()
-// Chekcs if db is open
-// ---------------------------------------------------------------------------
-TBool CFotaDB::IsOpen()
-    {
-    return iIsOpen;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::GetStateL
-// Gets pkg state from db
-// ---------------------------------------------------------------------------
-TPackageState CFotaDB::GetStateL(const TInt aPkgId, TDes8& aPkgURL)
-    {
-    RDbView view;
-    TPackageState s;
-    CleanupClosePushL(view);
-
-    s.iState = RFotaEngineSession::EIdle; // default state is idle
-
-    HBufC* select = HBufC::NewLC(KSelect_where_packageid().Length() + 10);
-    select->Des().Format(KSelect_where_packageid, aPkgId);
-
-    TInt err = view.Prepare(iStateDB, TDbQuery(*select));
-    __LEAVE_IF_ERROR(err);
-    view.EvaluateAll();
-    view.FirstL();
-
-    while (view.AtRow())
-        {
-        view.GetL();
-        HBufC8* url;
-        s = RowToStateL(url, view);
-        CleanupStack::PushL(url);
-        aPkgURL.Copy(url->Des());
-        CleanupStack::PopAndDestroy(); // url
-        view.NextL();
-        }
-    CleanupStack::PopAndDestroy(); //select
-    CleanupStack::PopAndDestroy(); //view
-    return s;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::SetStateL
-// Writes package state to DB. 
-// ---------------------------------------------------------------------------
-void CFotaDB::SetStateL(TPackageState& aState, const TDesC8& aPkgURL,
-        TUint aChangedFields)
-    {
-    FLOG(_L("  CFotaDB::SetStateL  >>  id %d result %d  state %d sessiontype %d iapid %d pkgsize %d updateltr %d"), aState.iPkgId, aState.iResult, aState.iState);
-    __ASSERT_ALWAYS( aChangedFields!=0, User::Leave(KErrArgument) );
-    TBuf8<KMaxFileName> temp;
-    TPackageState found = GetStateL(aState.iPkgId, temp);
-    if (found.iPkgId == KErrNotFound)
-        {
-        AddPackageStateL(aState, aPkgURL);
-        }
-    else
-        {
-        // sml try count must be reset, if state is set
-        if (aChangedFields & EFDBState)
-            {
-            aChangedFields = aChangedFields | EFDBSmlTryCount;
-            SetRetryCount(aState);
-            }
-
-        // Construct a SQL string for update. 
-        // Example: UPDATE State SET Result=40,State=4 WHERE pkgID=5
-        // 
-        TInt sqlsize = 0;
-        _LIT8( KSqlbegin, "UPDATE State SET " );
-        TBuf<21> sqlEnd;
-        HBufC8* sql(NULL);
-        // determine characters needed 
-        sqlsize = DetermineCharNeeded(aChangedFields, aState, aPkgURL);
-        sqlEnd.AppendFormat(_L(" WHERE pkgID=%d"), aState.iPkgId);
-
-        sql = HBufC8::NewLC(((TDesC8) KSqlbegin).Length() + sqlsize
-                + sqlEnd.Length());
-
-        sql->Des().Append(KSqlbegin);
-
-        if (aChangedFields & EFDBResult)
-            {
-            // check FUMO compability
-            __ASSERT_ALWAYS( aState.iResult>=KErrNotFound
-                    && aState.iResult<=602, User::Leave(KErrArgument) );
-            sql->Des().AppendFormat(_L8("Result=%d,"), aState.iResult);
-            }
-        if (aChangedFields & EFDBState)
-            {
-            // check FUMO compability
-            __ASSERT_ALWAYS( aState.iState>=0 && aState.iState<=100
-                    , User::Leave(KErrArgument) );
-            sql->Des().AppendFormat(_L8("State=%d,"), aState.iState);
-            }
-        if (aChangedFields & EFDBProfileId)
-            {
-            sql->Des().AppendFormat(_L8("profileid=%d,"), aState.iProfileId);
-            }
-        if (aChangedFields & EFDBPkgUrl)
-            {
-            sql->Des().AppendFormat(_L8("pkgurl='%S',"), &aPkgURL);
-            }
-        if (aChangedFields & EFDBPkgName)
-            {
-            sql->Des().AppendFormat(_L8("pkgname='%S',"), &(aState.iPkgName));
-            }
-        if (aChangedFields & EFDBVersion)
-            {
-            sql->Des().AppendFormat(_L8("Version='%S',"),
-                    &(aState.iPkgVersion));
-            }
-        if (aChangedFields & EFDBSmlTryCount)
-            {
-            __ASSERT_ALWAYS( aState.iSmlTryCount>=0
-                    , User::Leave(KErrArgument) );
-            sql->Des().AppendFormat(_L8("SmlTryCount=%d,"),
-                    aState.iSmlTryCount);
-
-            }
-        if (aChangedFields & EFDBSessionType)
-            {
-            sql->Des().AppendFormat(_L8("SessionType=%d,"),
-                    aState.iSessionType);
-            }
-        if (aChangedFields & EFDBIapId)
-            {
-            // validate IAP ID
-            __ASSERT_ALWAYS( aState.iIapId>=-1 ,User::Leave(KErrArgument) );
-            sql->Des().AppendFormat(_L8("IapId=%d,"), aState.iIapId);
-            }
-        if (aChangedFields & EFDBPkgSize)
-            {
-            sql->Des().AppendFormat(_L8("PkgSize=%d,"), aState.iPkgSize);
-            }
-        if (aChangedFields & EFDBUpdateLtr)
-            {
-            // validate bit
-            sql->Des().AppendFormat(_L8("UpdateLtr=%d,"), aState.iUpdateLtr);
-            }
-        // remove trailing ,
-        if (aChangedFields)
-            {
-            sql->Des().SetLength(sql->Des().Length() - 1);
-            }
-        sql->Des().Append(sqlEnd);
-        HBufC* sql2 = HBufC::NewLC(sql->Length()); // to cleanupstack
-        sql2->Des().Copy(sql->Des());
-        FLOG(_L("  sql:%S"), sql2);
-
-        User::LeaveIfError(iStateDB.Begin());
-        User::LeaveIfError(iStateDB.Execute(*sql2));
-        User::LeaveIfError(iStateDB.Commit());
-        User::LeaveIfError(iStateDB.Compact());
-
-        CleanupStack::PopAndDestroy(sql2); //sql2
-        CleanupStack::PopAndDestroy(sql); //sql
-        }
-    FLOG(_L("  CFotaDB::SetStateL  <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::DetermineCharNeeded 
-// Returns the char needed fro the query 
-// ---------------------------------------------------------------------------
-
-TInt CFotaDB::DetermineCharNeeded(TInt aChangedFields, TPackageState& aState,
-        const TDesC8& aPkgURL)
-
-    {
-
-    TInt sqlsize = 0;
-    if (aChangedFields & EFDBResult)
-        sqlsize += 4 + 7 + 4;
-    if (aChangedFields & EFDBState)
-        sqlsize += 4 + 5 + 4;
-    if (aChangedFields & EFDBProfileId)
-        sqlsize += 4 + 9 + 4;
-    if (aChangedFields & EFDBPkgUrl)
-        sqlsize += aPkgURL.Length() + 6 + 4;
-    if (aChangedFields & EFDBPkgName)
-        sqlsize += aState.iPkgName.Length() + 7 + 4;
-    if (aChangedFields & EFDBVersion)
-        sqlsize += aState.iPkgVersion.Length() + 7 + 4;
-    if (aChangedFields & EFDBSmlTryCount)
-        sqlsize += 4 + 11 + 4;
-
-    if (aChangedFields & EFDBSessionType)
-        sqlsize += 4 + 11 + 4;
-    if (aChangedFields & EFDBIapId)
-        sqlsize += 4 + 5 + 4;
-    if (aChangedFields & EFDBPkgSize)
-        sqlsize += 4 + 7 + 10;
-    if (aChangedFields & EFDBUpdateLtr)
-        sqlsize += 4 + 11 + 4;
-
-    return sqlsize;
-
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::SetRetryCount
-// Sets the retry count
-// ---------------------------------------------------------------------------
-void CFotaDB::SetRetryCount(TPackageState& aState)
-    {
-    CRepository* centrep(NULL);
-    TInt err = KErrNone;
-    TInt retry = 0;
-
-    TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (centrep)
-        {
-        err = centrep->Get(KGenericAlertRetries, retry);
-        delete centrep;
-        centrep = NULL;
-        }
-    if (err == KErrNone)
-        {
-        if (retry < 0)
-            {
-            aState.iSmlTryCount = KDefaultSmlTryCount;
-            }
-        else if (retry == 0)
-            {
-            aState.iSmlTryCount = 2;
-            }
-        else if (retry > KMaximumSmlTryCount)
-            {
-            aState.iSmlTryCount = KMaximumSmlTryCount + 1;
-            }
-        else
-            {
-            aState.iSmlTryCount = retry + 1;
-            }
-        }
-    else
-        {
-        aState.iSmlTryCount = KDefaultSmlTryCount;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::RowToStateL
-// Extracts db row contents to package state object and aPkgUrl
-// Returns url in aPkgURL parameter
-// ---------------------------------------------------------------------------
-TPackageState CFotaDB::RowToStateL(HBufC8*& aPkgUrl, const RDbView& aView)
-    {
-    TPackageState s;
-    TInt pkgid = aView.ColInt(iColSet->ColNo(KColPkgId));
-    TInt state = aView.ColInt(iColSet->ColNo(KColState));
-    TInt result = aView.ColInt(iColSet->ColNo(KColResult));
-    TSmlProfileId profileid(aView.ColInt(iColSet->ColNo(KColProfileId)));
-    TPtrC pkgname = aView.ColDes(iColSet->ColNo(KColPkgName));
-    TPtrC version = aView.ColDes(iColSet->ColNo(KColVersion));
-    TInt smltrycount = aView.ColInt(iColSet->ColNo(KColSmlTryCount));
-    TInt sessiontype = aView.ColInt(iColSet->ColNo(KColSessionType));
-    TInt iapid = aView.ColInt(iColSet->ColNo(KColIapId));
-    TUint pkgsize = aView.ColUint(iColSet->ColNo(KColPkgSize));
-    TBool updateltr = aView.ColUint8(iColSet->ColNo(KColUpdateLtr));
-
-    s.iPkgId = pkgid;
-    s.iPkgName.Copy(pkgname);
-    s.iPkgVersion.Copy(version);
-    s.iProfileId = profileid;
-    s.iResult = result;
-    s.iState = RFotaEngineSession::TState(state);
-    s.iSmlTryCount = smltrycount;
-    s.iSessionType = sessiontype;
-    s.iIapId = iapid;
-    s.iPkgSize = pkgsize;
-    s.iUpdateLtr = updateltr;
-
-    RDbColReadStream rstream;
-    TInt len = aView.ColLength(iColSet->ColNo(KColPkgUrl));
-    rstream.OpenLC(aView, iColSet->ColNo(KColPkgUrl));
-    HBufC* pkgurl = HBufC::NewLC(len);
-    TPtr ptr = pkgurl->Des();
-    rstream.ReadL(ptr, len);
-
-    HBufC8* tmp = HBufC8::NewL(pkgurl->Des().Length());
-    tmp->Des().Copy(pkgurl->Des());
-    aPkgUrl = tmp;
-
-    CleanupStack::PopAndDestroy(pkgurl);
-    CleanupStack::PopAndDestroy(&rstream);
-    return s;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDB::StateToRowL
-// Converts state object to database row (into view object)
-// ---------------------------------------------------------------------------
-void CFotaDB::StateToRowL(const TPackageState& aPkg, const TDesC8& aPkgURL,
-        RDbView& aView)
-    {
-    HBufC* pkgname = HBufC::NewLC(aPkg.iPkgName.Length());
-    HBufC* version = HBufC::NewLC(aPkg.iPkgVersion.Length());
-
-    pkgname->Des().Copy(aPkg.iPkgName);
-    version->Des().Copy(aPkg.iPkgVersion);
-
-    aView.SetColL(iColSet->ColNo(KColPkgId), aPkg.iPkgId);
-    aView.SetColL(iColSet->ColNo(KColResult), aPkg.iResult);
-    aView.SetColL(iColSet->ColNo(KColState), aPkg.iState);
-    aView.SetColL(iColSet->ColNo(KColProfileId), aPkg.iProfileId);
-    aView.SetColL(iColSet->ColNo(KColPkgName), *pkgname);
-    aView.SetColL(iColSet->ColNo(KColVersion), *version);
-    aView.SetColL(iColSet->ColNo(KColSmlTryCount), aPkg.iSmlTryCount);
-    aView.SetColL(iColSet->ColNo(KColSessionType), aPkg.iSessionType);
-    aView.SetColL(iColSet->ColNo(KColIapId), aPkg.iIapId);
-    aView.SetColL(iColSet->ColNo(KColPkgSize), aPkg.iPkgSize);
-    aView.SetColL(iColSet->ColNo(KColUpdateLtr), aPkg.iUpdateLtr);
-
-    RDbColWriteStream wstream;
-    CleanupClosePushL(wstream);
-    wstream.OpenL(aView, iColSet->ColNo(KColPkgUrl));
-    // Cannot write 8 bit descriptors to databae
-    HBufC* buf = HBufC::NewLC(aPkgURL.Length());
-    buf->Des().Copy(aPkgURL);
-    wstream.WriteL(buf->Des());
-
-    FLOG(_L("CFotaDB::StateToRowL  id:%d result:%d state:%d profileid:%d \
-    		name:%d chars version: %d chars url: %d chars sessiontype:%d iapid:%d pkgsize:%d updateltr = %d"),
-            aPkg.iPkgId, aPkg.iResult, aPkg.iState, aPkg.iProfileId,
-            pkgname->Des().Length(), version->Des().Length(),
-            buf->Des().Length(), aPkg.iSessionType, aPkg.iIapId,
-            aPkg.iPkgSize, aPkg.iUpdateLtr);
-
-    CleanupStack::PopAndDestroy(buf);
-    CleanupStack::PopAndDestroy(&wstream);
-    CleanupStack::PopAndDestroy(version);
-    CleanupStack::PopAndDestroy(pkgname);
-    }
--- a/fotaapplication/fotaserver/src/FotaDlClient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,615 +0,0 @@
-/*
- * 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:   Fota download client 
- *
- */
-#include <XQConversions>
-#include "FotaDlClient.h"
-#include "FotaDlMgrClient.h"
-
-// -----------------------------------------------------------------------------
-// The constructor of this class
-// -----------------------------------------------------------------------------
-DownloadClient::DownloadClient(DownloadManagerClient* Observer)
-    {
-    FLOG(_L("DownloadClient::DownloadClient >>"));
-    
-    iFotaDlMgrClient = Observer;
-    iTotalSize = -1;
-    iSpaceChecked = 0;
-    iDownload = NULL;
-    iClientinterrupted = false;
-    iClientError = ErrorNone;
-    iContentType = TUnknownType;
-    
-    FLOG(_L("DownloadClient::DownloadClient <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// The destructor of this class 
-// -----------------------------------------------------------------------------
-DownloadClient::~DownloadClient()
-    {
-    FLOG(_L("DownloadClient::~DownloadClient >>"));
-
-    if (iDownload)
-        {
-        disconnect(iDownload, SIGNAL(downloadEvent(DownloadEvent *)), this,
-                SLOT(DownloadEventRecieved(DownloadEvent *)));
-
-        //Do not delete iDownload as it is owned by download manager.
-        //delete iDownload;
-        iDownload = NULL;
-        }
-    //Don't delete as it is not owned
-    iFotaDlMgrClient = NULL;
-
-    FLOG(_L("DownloadClient::~DownloadClient <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// Creates a single download with the download manager
-// -----------------------------------------------------------------------------
-TInt DownloadClient::CreateDownload(const QString &url, DownloadType type)
-    {
-    FLOG(_L("DownloadClient::CreateDownload >>"));
-
-    TInt ret = ENotOk;
-
-    iDownload = iFotaDlMgrClient->Manager()->createDownload(url, type); //Step 6
-
-    if (iDownload)
-        {
-        connect(iDownload, SIGNAL(downloadEvent(DownloadEvent *)), this,
-                SLOT(DownloadEventRecieved(DownloadEvent *)));
-        ret = EOk;
-        }
-    else
-        {
-        FLOG(_L("Download creation is unsuccessful!"));
-        }
-
-    FLOG(_L("DownloadClient::CreateDownload, ret = %d <<"), ret);
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// Sets the required attributes for the single download.
-// -----------------------------------------------------------------------------
-TInt DownloadClient::SetDownloadAttributes()
-    {
-    FLOG(_L("DownloadClient::SetDownloadAttributes >>"));
-
-    int ret(EOk);
-
-    iDownload->setAttribute(ProgressInterval, 100); //Step 7
-    iDownload->setAttribute(Priority, High); //Step 8
-
-    //Setting the default path
-    iDownload->setAttribute(DestinationPath, DefaultPath);
-
-    iDownload->setAttribute(FileName, PackageName);
-
-    FLOG(_L("DownloadClient::SetDownloadAttributes, ret = %d <<"), ret);
-
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// Starts the single download. Download should be created and attributes set before this.
-// -----------------------------------------------------------------------------
-TInt DownloadClient::Start()
-    {
-    FLOG(_L("DownloadClient::Start >>"));
-
-    iClientinterrupted = false;
-    iDownload->start(); //Step 9
-
-    FLOG(_L("DownloadClient::Start <<"));
-    return EOk;
-
-    }
-
-// -----------------------------------------------------------------------------
-// Gets the attribute of the single download
-// -----------------------------------------------------------------------------
-inline QVariant DownloadClient::GetDownloadAttribute(DownloadAttribute attr)
-    {
-    FLOG(_L("DownloadClient::GetDownloadAttribute >>"));
-
-    QVariant val;
-
-    val = iDownload->attribute(attr);
-
-    FLOG(_L("DownloadClient::GetDownloadAttribute<<"));
-    return val;
-    }
-
-// -----------------------------------------------------------------------------
-// Pauses the single download.
-// -----------------------------------------------------------------------------
-TInt DownloadClient::Pause(TClientErrorType aReason)
-    {
-    FLOG(_L("DownloadClient::Pause >>"));
-
-    iClientinterrupted = true;
-    iClientError = aReason;
-
-    iDownload->pause();
-
-    FLOG(_L("DownloadClient::Pause <<"));
-    return EOk;
-    }
-
-// -----------------------------------------------------------------------------
-// Resumes the single download.
-// -----------------------------------------------------------------------------
-TInt DownloadClient::Resume()
-    {
-    FLOG(_L("DownloadClient::Resume >>"));
-
-    int ret(ENotOk);
-    iSpaceChecked = true;
-
-    if (!iDownload)
-        {
-        QList<Download*> dls =
-                iFotaDlMgrClient->Manager()->currentDownloads();
-        int count = dls.count();
-        FLOG(_L("Number of current downloads = %d"), count);
-
-        if (count)
-            {
-            iDownload = dls[0];
-            FLOG(_L("Connecting to download event"));
-            connect(iDownload, SIGNAL(downloadEvent(DownloadEvent *)), this,
-                    SLOT(DownloadEventRecieved(DownloadEvent *)));
-            FLOG(_L("Connecting to download events done"));
-            }
-
-        }
-    iClientinterrupted = false;
-    iClientError = ErrorNone;
-
-    if (iDownload)
-        {
-        FLOG(_L("B4 Download Start"));
-        iDownload->start();
-        ret = EOk;
-        FLOG(_L("After Download Start"));
-        }
-
-    FLOG(_L("DownloadClient::Resume, ret = %d <<"), ret);
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// Cancels the single download.
-// -----------------------------------------------------------------------------
-TInt DownloadClient::Cancel(TClientErrorType aReason)
-    {
-    FLOG(_L("DownloadClient::Cancel >>"));
-
-    iClientinterrupted = true;
-    iClientError = aReason;
-
-    iDownload->cancel();
-
-    FLOG(_L("DownloadClient::Cancel <<"));
-    return EOk;
-    }
-
-// -----------------------------------------------------------------------------
-// Restarts the single download. This is equivalent to cancel and start on Download.
-// -----------------------------------------------------------------------------
-TInt DownloadClient::Restart()
-    {
-    FLOG(_L("DownloadClient::Restart >>"));
-
-    QString path(NULL);
-    int size = iTotalSize;
-    TFreeSpace avail = iFotaDlMgrClient->GetSuitablePath(size, path);
-
-    if (avail == EFitsToReservation || avail == EFitsToFileSystem)
-        {
-        //FLOG(_L("Space is available for download at %S"), TPtrC (reinterpret_cast<const TText*> (path.constData()),path.length()));
-        
-        if (iContentType == TOmaDL10Download)
-            {
-            ReadDescriptorData();
-            }
-        Resume();
-        }
-    else
-        {
-        FLOG(_L("Space not available. Download is stopped!"));
-        TRAP_IGNORE(iFotaDlMgrClient->ShowDialogL(EFwDLNeedMoreMemory, size));
-        }
-
-    FLOG(_L("DownloadClient::Restart >>"));
-
-    return EOk;
-    }
-
-// -----------------------------------------------------------------------------
-// The slot which receives all the single download events.
-// -----------------------------------------------------------------------------
-bool DownloadClient::DownloadEventRecieved(DownloadEvent *event)
-    {
-    FLOG(_L("DownloadClient::event >>"));
-
-    DownloadEvent::Event type = (DownloadEvent::Event) event->type();
-    bool eventHandled = false;
-    int err0(NoError);
-
-    FLOG(_L("Download Event Type: %d"), type);
-
-    switch (type)
-        {
-        case DownloadEvent::Started:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::Started"));
-            iProgress = true;
-            iDlState = Download::Created;
-
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::HeadersReceived:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::HeadersReceived"));
-            iProgress = true;
-            iDlState = Download::Created;
-
-            QString contenttype =
-                    GetDownloadAttribute(ContentType).toString();
-            HBufC* s_contenttype = XQConversions::qStringToS60Desc(contenttype);
-            FLOG(_L("Content type received is %S"), s_contenttype);
-            delete s_contenttype;
-
-            iContentType = CheckContentType(contenttype);
-
-            if (iContentType == THttpDownload)
-                {
-                FLOG(_L("Content type: Http; checking the size of download"));
-                if (!iSpaceChecked)
-                    {
-
-                    iTotalSize = GetDownloadAttribute(TotalSize).toInt();
-
-                    FLOG(_L("Size of the firmware update as received is %d"),
-                            iTotalSize);
-
-                    if (iTotalSize > 0)
-                        {
-                        QString path(NULL);
-
-                        TFreeSpace avail = iFotaDlMgrClient->GetSuitablePath(
-                                iTotalSize, path);
-
-                        if (avail == EFitsToReservation || avail
-                                == EFitsToFileSystem)
-                            {
-                            //FLOG(_L("Space is available for download at %S"),TPtrC (reinterpret_cast<const TText*> (path.constData()),path.length()));
-                            iFotaDlMgrClient->DeleteDiskReservation(path);
-                            iDownload->setAttribute(DestinationPath, path);
-                            }
-                        else
-                            {
-                            FLOG(
-                                    _L("Space not available. Download is stopped!"));
-                            Pause(NeedMoreMemory);
-                            TRAP_IGNORE(iFotaDlMgrClient->ShowDialogL(EFwDLNeedMoreMemory));
-                            break;
-                            }
-
-                        iSpaceChecked = true;
-                        iFotaDlMgrClient->StartDownloadProgress(
-                                QString::null, QString::null, iTotalSize);
-                        }
-                    }
-                }
-            else if (iContentType == TUnknownType)
-                {
-                FLOG(_L("Content type unknown; hence cancelling download !"));
-                Cancel(InvalidContentType);
-                }
-
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::InProgress:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::InProgress"));
-
-            iProgress = true;
-            iDlState = Download::InProgress;
-            UpdateDownloadProgress();
-
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::Completed:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::Completed"));
-            iProgress = false;
-            iDlState = Download::Completed;
-            iTotalSize = 0;
-            UpdateDownloadProgress();
-
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::Paused:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::Paused"));
-            iProgress = false;
-            iDlState = Download::Paused;
-
-            eventHandled = true;
-            break;
-            }
-        case DownloadEvent::Failed:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::Failed"));
-            iProgress = false;
-            iDlState = Download::Failed;
-
-            eventHandled = true;
-            break;
-            }
-        case DownloadEvent::Cancelled:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::Cancelled"));
-            iProgress = false;
-            iDlState = Download::Cancelled;
-
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::NetworkLoss:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::NetworkLoss"));
-            iProgress = false;
-            iDlState = Download::Paused;
-
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::Error:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::Error"));
-            iProgress = false;
-           // iDlState = (Download::State) GetDownloadAttribute(State).toInt();
-            iDlState = Download::Failed;
-            eventHandled = true;
-            break;
-            }
-
-        case DownloadEvent::DescriptorReady:
-            {
-            FLOG(_L("DownloadEventRecieved - DownloadEvent::DescriptorReady"));
-            iProgress = true;
-            iDlState = Download::InProgress;
-            iContentType = TOmaDL10Download;
-
-            iTotalSize = GetDownloadAttribute(DescriptorSize).toInt();
-            QString path(NULL);
-            if (iTotalSize > 0)
-                {
-
-                TFreeSpace avail = iFotaDlMgrClient->GetSuitablePath(
-                        iTotalSize, path);
-
-                if (avail == EFitsToReservation || avail == EFitsToFileSystem)
-                    {
-                    //FLOG(_L("Space is available for download at %S"), TPtrC (reinterpret_cast<const TText*> (path.constData()),path.length()));
-                    iFotaDlMgrClient->DeleteDiskReservation(path);
-                    }
-                else
-                    {
-                    FLOG(_L("Space not available. Download is stopped!"));
-                    TRAP_IGNORE(iFotaDlMgrClient->ShowDialogL(EFwDLNeedMoreMemory));
-                    break;
-                    }
-                }
-            ReadDescriptorData();
-            Resume();
-            SetSubDownloadAttributes();
-
-            eventHandled = true;
-            break;
-            }
-        case DownloadEvent::CreatingConnection:
-            {
-            FLOG(
-                    _L("DownloadEventRecieved - DownloadEvent::CreatingConnection"));
-            iProgress = true;
-            iDlState = Download::InProgress;
-
-            eventHandled = true;
-            break;
-            }
-        case DownloadEvent::ConnectionNeeded:
-        case DownloadEvent::ConnectionDisconnected:
-            {
-            FLOG(
-                    _L("DownloadEventRecieved - DownloadEvent::ConnectionNeeded/ConnectionDisconnected"));
-            iProgress = false;
-            iDlState = Download::Paused;
-            err0 = ConnectionFailed;
-            eventHandled = true;
-            break;
-            }
-
-        default:
-            {
-            FLOG(_L("DownloadEventRecieved - Skipped this event: %d"), type);
-            break;
-            }
-        }
-
-    if (iProgress == false)
-        {
-
-        if (iClientinterrupted)
-            {
-            //Client has requested for cancellation. Hence provide the same error code
-            err0 = iClientError;
-            HandleClientInterrupt(iDlState, err0);
-            }
-        else
-            {
-            //Download Manager has cancelled download. Hence provide the last error code.
-            if (err0 == NoError)
-                err0 = GetDownloadAttribute(LastError).toInt();
-
-            HandleDownloadComplete(iDlState, err0);
-            }
-
-        }
-
-    FLOG(_L("DownloadClient::event <<"));
-
-    return eventHandled;
-    }
-
-// -----------------------------------------------------------------------------
-// Called to update the progress of download to fota server. This fetches the percentage
-// of download from download manager.
-// -----------------------------------------------------------------------------
-inline void DownloadClient::UpdateDownloadProgress()
-    {
-    FLOG(_L("DownloadClient::UpdateDownloadProgress >>"));
-
-    // Remaining size calculation
-    int prog = GetDownloadAttribute(Percentage).toInt();
-    iFotaDlMgrClient->UpdateDownloadProgress(prog);
-
-    FLOG(_L("DownloadClient::UpdateDownloadProgress, progress = %d <<"), prog);
-    }
-
-// -----------------------------------------------------------------------------
-// Called to read the OMA DL1.0 download descriptor. This will update the fota server with size and version.
-// -----------------------------------------------------------------------------
-void DownloadClient::ReadDescriptorData()
-    {
-    FLOG(_L("DownloadClient::ReadDescriptorData >>"));
-
-    QString name = GetDownloadAttribute(DescriptorName).toString(); // "name" in OMA dd
-    QString version = GetDownloadAttribute(DescriptorVersion).toString(); // "version" in OMA dd
-    QString type = GetDownloadAttribute(DescriptorType).toString(); // "type" in OMA dd
-    int size = GetDownloadAttribute(DescriptorSize).toInt(); // "size" in OMA dd
-    QString vendor = GetDownloadAttribute(DescriptorVendor).toString(); // "vendor" in OMA dd
-    QString description =
-            GetDownloadAttribute(DescriptorDescription).toString(); // "description" in OMA dd
-    QString nxturl = GetDownloadAttribute(DescriptorNextURL).toString(); // "nextURL" in OMA dd
-
-    TDownloadType gottype = CheckContentType(type);
-
-    if (gottype == THttpDownload)
-        {
-        iFotaDlMgrClient->StartDownloadProgress(name, version, size);
-        }
-    else
-        {
-        FLOG(
-                _L("The content type in descriptor is not appropriate! Hence cancelling download"));
-        Cancel(InvalidContentType);
-        }
-
-    FLOG(_L("DownloadClient::ReadDescriptorData <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// Called when download is complete, either successfully or unsuccessfully.
-// The arguments to this function is read to know the actual status.
-// -----------------------------------------------------------------------------
-void DownloadClient::HandleDownloadComplete(Download::State dlstate, int err0)
-    {
-    FLOG(_L("DownloadClient::HandleDownloadComplete, idlstate = %d, err0 = %d>>"), dlstate, err0);
-
-    iFotaDlMgrClient->HandleDownloadEvent(dlstate, err0);
-
-    FLOG(_L("DownloadClient::HandleDownloadComplete <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// Called to handle the post download interrupt operation when client cancels/pauses download.
-// -----------------------------------------------------------------------------
-void DownloadClient::HandleClientInterrupt(Download::State dlstate, int err0)
-    {
-    FLOG(_L("DownloadClient::HandleClientInterrupt, idlstate = %d, err0 = %d >>"), dlstate, err0);
-
-    iFotaDlMgrClient->HandleClientInterrupt(dlstate, err0);
-
-    FLOG(_L("DownloadClient::HandleClientInterrupt <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// Called to validate the content type of the download as received in header.
-// -----------------------------------------------------------------------------
-TDownloadType DownloadClient::CheckContentType(const QString aContent)
-    {
-    FLOG(_L("DownloadClient::CheckContentType >>"));
-
-    TDownloadType type(TUnknownType);
-
-    QString semicollon(";");
-    QString contenttype = aContent;
-
-    int index = aContent.indexOf(semicollon, 0);
-
-    if (index > 0)
-        {
-        contenttype.chop(aContent.length() - index);
-        }
-
-    if (contenttype.compare(ContentTypeHttp) == 0)
-        type = THttpDownload;
-    else if (contenttype.compare(ContentTypeOmaDl) == 0)
-        type = TOmaDL10Download;
-
-    FLOG(_L("DownloadClient::CheckContentType, type = %d<<"), type);
-
-    return type;
-    }
-
-void DownloadClient::SetSubDownloadAttributes()
-    {
-    FLOG(_L("DownloadClient::SetSubDownloadAttributes >>"));
-
-    QList<Download*> dls = iDownload->subDownloads();
-
-    if (dls.count() > 0)
-        {
-        Download* subdl = dls[0];
-
-        subdl->setAttribute(FileName, PackageName);
-        }
-    else
-        {
-        FLOG(_L("Error: There are no sub downloads!"));
-        }
-
-    FLOG(_L("DownloadClient::SetSubDownloadAttributes <<"));
-    }
-
-//End of file
--- a/fotaapplication/fotaserver/src/FotaDlMgrClient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1128 +0,0 @@
-/*
- * 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:   Fota download manager client
- *
- */
-
-//System includes
-#include <sysutil.h> 
-#include <bautils.h>
-#include <cmmanager.h>
-#include <cmconnectionmethod.h>
-#include <devicedialogconsts.h>
-#include <centralrepository.h>
-#include <XQConversions>
-#include <uri8.h> //For parsing uri
-//User includes
-#include "FotaDlMgrClient.h"
-#include "FotaDlClient.h"
-#include "FotaServer.h"
-#include "fotanotifiers.h"
-
-// --------------------------------------------------------------------------
-//  Two phase construction
-// --------------------------------------------------------------------------
-DownloadManagerClient* DownloadManagerClient::NewL(CFotaServer* aServer)
-    {
-    DownloadManagerClient* self = new (ELeave) DownloadManagerClient(aServer);
-    self->ConstructL();
-    return self;
-    }
-
-// --------------------------------------------------------------------------
-//  The constructor
-// --------------------------------------------------------------------------
-DownloadManagerClient::DownloadManagerClient(CFotaServer* aServer) :
-    iDownloadManager(NULL), iDownloadClient(NULL), iFotaServer(aServer),
-            iInitialized(EFalse), iDownloadSubmitted(EFalse), iReservedSize(
-                    5242880), iNotifParams(NULL), iNotifier (NULL)
-    {
-
-    }
-
-// --------------------------------------------------------------------------
-//  The destructor
-// --------------------------------------------------------------------------
-DownloadManagerClient::~DownloadManagerClient()
-    {
-    FLOG(_L("DownloadManagerClient::~DownloadManagerClient >>"));
-
-    if (iDownloadClient)
-        {
-        delete iDownloadClient;
-        iDownloadClient = NULL;
-        }
-
-    UninitDownloadMgr(); //Closes the RFs session and iDownloadManager.
-
-    iFs.Close();
-    
-    	/*
-    if (iNotifParams)
-        {
-        FLOG(_L("DownloadManagerClient::~DownloadManagerClient, iNotifParams >>"));
-        delete iNotifParams;
-        iNotifParams = NULL;
-        FLOG(_L("DownloadManagerClient::~DownloadManagerClient, iNotifParams <<"));
-        }
-    if (iNotifier)
-        {
-        FLOG(_L("DownloadManagerClient::~DownloadManagerClient, iNotifier >>"));
-        delete iNotifier;
-        iNotifier = NULL;
-        FLOG(_L("DownloadManagerClient::~DownloadManagerClient, iNotifier <<"));
-        }*/
-    FLOG(_L("DownloadManagerClient::~DownloadManagerClient <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Two phase construction
-// --------------------------------------------------------------------------
-void DownloadManagerClient::ConstructL()
-    {
-    FLOG(_L("DownloadManagerClient::ConstructL >>"));
-
-    TInt err;
-    CRepository* centrep(NULL);
-
-    TRAP(err, centrep = CRepository::NewL( KCRUidFotaDiskStorage ) );
-    if (centrep)
-        {
-        err = centrep->Get(KFotaDiskSpaceReservationKey, iReservedSize);
-        }
-
-    delete centrep;
-    centrep = NULL;
-
-    __LEAVE_IF_ERROR(iFs.Connect());
-
-    iProgress = EFalse;
-
-    FLOG(_L("DownloadManagerClient::ConstructL, reservation needed is %d <<"),iReservedSize);
-    }
-
-// --------------------------------------------------------------------------
-//  Initializes the download manager for fota requirements
-// --------------------------------------------------------------------------
-int DownloadManagerClient::InitDownloadMgr()
-    {
-    FLOG(_L("DownloadManagerClient::InitDownloadMgr >>"));
-
-    int ret = EOk;
-
-    if (!iInitialized)
-        {
-        iDownloadManager = new DownloadManager("FotaServer"); //Step 0
-        connect(iDownloadManager,
-                SIGNAL(downloadManagerEvent(DownloadManagerEvent *)), this,
-                SLOT(DownloadMgrEventRecieved(DownloadManagerEvent *))); //step 1
-        //Scope as false signifies that the download should happen on fota process
-        bool scope = false;
-        ret = iDownloadManager->initialize(scope); //Step 2
-
-#if defined(__WINS__)
-        iDownloadManager->setProxy("bswebproxy01.americas.nokia.com", 8080); //Step 3/
-#endif
-        //Set the progress mode of download to be non quite
-        ret = iDownloadManager->setAttribute(ProgressMode, NonQuiet);
-        //Set the persistent mode of download to be active.
-        ret = iDownloadManager->setAttribute(PersistantMode, Active);
-        //Set the default destination path for all the downloads
-        ret = iDownloadManager->setAttribute(DefaultDestinationPath, DefaultPath);
-
-        if (iFotaServer->iPackageState.iIapId > 0)
-            {
-            QString name;
-            TRAPD(err, name = GetIapNameWithIdL(iFotaServer->iPackageState.iIapId));
-            HBufC* temp = XQConversions::qStringToS60Desc(name);
-            FLOG(_L("IAP name for ID %d is %S, err = %d"), iFotaServer->iPackageState.iIapId, temp, err);
-            delete temp;
-#if defined(__WINS__)
-
-#else
-            if (err == KErrNone)
-                {
-                FLOG(_L("Setting IAP =int for the single download"), iFotaServer->iPackageState.iIapId);
-                ret = iDownloadManager->setAttribute(AccessPoint, name);
-                }
-#endif  
-            }
-
-        iInitialized = ETrue;
-        }
-
-    FLOG(_L("DownloadManagerClient::InitDownloadMgr, ret = %d <<"), ret);
-    return ret;
-    }
-
-// --------------------------------------------------------------------------
-//  Uninitializes the download manager
-// --------------------------------------------------------------------------
-void DownloadManagerClient::UninitDownloadMgr()
-    {
-    FLOG(_L("DownloadManagerClient::UninitDownloadMgr >>"));
-
-    if (iDownloadManager)
-        {
-        disconnect(iDownloadManager,
-                SIGNAL(downloadManagerEvent(DownloadManagerEvent *)), this,
-                SLOT(DownloadMgrEventRecieved(DownloadManagerEvent *)));
-
-        iDownloadManager->deleteLater();
-        iDownloadManager = NULL;
-        }
-    iInitialized = EFalse;
-
-    FLOG(_L("DownloadManagerClient::UninitDownloadMgr <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Gets the access point name for a given access point id.
-// --------------------------------------------------------------------------
-QString DownloadManagerClient::GetIapNameWithIdL(TInt aIapId)
-    {
-    FLOG(_L("DownloadManagerClient::GetIapNameWithIdL, iapid = %d"), aIapId);
-    
-    QString name(NULL);
-
-    RCmManager cmManager;
-    cmManager.OpenL();
-
-    RCmConnectionMethod conn;
-    conn = cmManager.ConnectionMethodL(aIapId);
-
-    HBufC* temp = conn.GetStringAttributeL(CMManager::ECmName);
-    name = QString::fromUtf16(temp->Ptr(), temp->Length());
-    delete temp;
-    temp = NULL;
-
-    conn.Close();
-
-    cmManager.Close();
-    FLOG(_L("DownloadManagerClient::GetIapNameWithIdL <<"));
-    return name;
-    }
-
-// --------------------------------------------------------------------------
-//  Starts the download using a given url
-// --------------------------------------------------------------------------
-void DownloadManagerClient::DownloadL(const TDesC8& url)
-    {
-    FLOG(_L("DownloadManagerClient::Download >>"));
-
-    iDownloadSubmitted = EFalse;
-    iProgress = EFalse;
-    //Validate url...
-    
-    TUriParser8 parser;
-
-    if (parser.Parse(url) && !parser.IsSchemeValid())
-        {
-        FLOG(_L("URL is malformed.. finalizing download"));
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadFailed;
-        iFotaServer->iPackageState.iResult= RFotaEngineSession::EResMalformedOrBadURL;
-        iFotaServer->iDatabase->OpenDBL();
-        iFotaServer->iDatabase->SetStateL(iFotaServer->iPackageState, KNullDesC8, EFDBState | EFDBResult);
-        iFotaServer->iDatabase->CloseAndCommitDB();
-
-        iFotaServer->FinalizeDownloadL();
-        TRAP_IGNORE(ShowDialogL(EFwDLNonResumableFailure));
-        return;
-        }
-    
-    FLOG(_L("DownloadManagerClient::DownloadL, State 2 - init download manager"));
-    InitDownloadMgr();
-
-    //Remove any existing download for this client
-    iDownloadManager->removeAll();
-
-    DeleteUpdatePackageL();
-
-    DownloadType type = Parallel;
-
-    if (!iDownloadClient)
-        {
-        iDownloadClient = new DownloadClient(this);
-        }
-
-    FLOG(_L("DownloadManagerClient::DownloadL, State 3 - creating download"));
-
-    QString temp = QString::fromUtf8(
-            reinterpret_cast<const char*> (url.Ptr()), url.Length());
-    int err (0);
-    if ((err = iDownloadClient->CreateDownload(temp, type)) != 0)
-        {
-        FLOG(_L("Error in creating download"), err);
-        }
-    else if ((err = iDownloadClient->SetDownloadAttributes()) != 0)
-        {
-        FLOG(_L("Error in setting attributes for download: %d"), err);
-        }
-    else 
-        {
-        iFotaServer->iPackageState.iState  = RFotaEngineSession::EStartingDownload;
-        iFotaServer->iPackageState.iResult = KErrNotFound;
-        iFotaServer->iDatabase->OpenDBL();
-        iFotaServer->iDatabase->SetStateL(iFotaServer->iPackageState, KNullDesC8, EFDBState | EFDBResult);
-        iFotaServer->iDatabase->CloseAndCommitDB();
-        iDownloadSubmitted = ETrue;
-        iFotaServer->SetStartupReason(EFotaDownloadInterrupted);
-        
-        iDownloadClient->Start();
-        FLOG(_L("Download is submitted successfully"));
-        }
-
-    if (err == ENotOk)
-        {
-        iFotaServer->iDatabase->OpenDBL();
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadFailed;
-        iFotaServer->iPackageState.iResult = RFotaEngineSession::EResUndefinedError;
-
-        iFotaServer->iDatabase->SetStateL(iFotaServer->iPackageState,  KNullDesC8, EFDBState | EFDBResult);
-        iFotaServer->iDatabase->CloseAndCommitDB();
-
-        iFotaServer->FinalizeDownloadL();
-        TRAP_IGNORE(ShowDialogL(EFwDLNonResumableFailure));
-        }
-
-    FLOG(_L("DownloadManagerClient::Download <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Pauses an ongoing download.
-// --------------------------------------------------------------------------
-void DownloadManagerClient::PauseDownloadL()
-    {
-    FLOG(_L("DownloadManagerClient::PauseDownloadL >>"));
-
-    TInt ret(ENotOk);
-
-    if (iDownloadClient)
-        {
-        ret = iDownloadClient->Pause(UserCancelled);
-        
-        __LEAVE_IF_ERROR(ret);
-        }
-
-    FLOG(_L("DownloadManagerClient::PauseDownloadL <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Tries to resume a suspended download
-// --------------------------------------------------------------------------
-void DownloadManagerClient::TryResumeDownloadL()
-    {
-    FLOG(_L("DownloadManagerClient::TryResumeDownloadL >>"));
-
-    TInt ret(ENotOk);
-
-    FLOG(_L("DownloadManagerClient::TryResumeDownloadL, State 1 - init download manager"));
-
-    __LEAVE_IF_ERROR(InitDownloadMgr());
-
-    iDownloadSubmitted = ETrue;
-    iProgress = EFalse;
-
-    if (!iDownloadClient)
-        {
-        iDownloadClient = new DownloadClient(this);
-        }
-
-    iFotaServer->SetStartupReason(EFotaDownloadInterrupted);
-    ret = iDownloadClient->Resume();
-    
-    if (ret == ENotOk )
-        {
-        if (iFotaServer->DecrementDownloadRestartCount())
-            {
-            FLOG(_L("There is no paused download! Hence restarting download..."));
-            DownloadL(iFotaServer->iLastFwUrl);
-            }
-        else
-            {
-            FLOG(_L("There is no paused download! Restart exhausted and hence finalizing download..."));
-            iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadFailed;
-            
-            if (iFotaServer->iPackageState.iResult == -1 )
-                iFotaServer->iPackageState.iResult = RFotaEngineSession::EResUndefinedError;
-            
-            iDownloadSubmitted = EFalse;
-            iFotaServer->FinalizeDownloadL();
-            TRAP_IGNORE(ShowDialogL(EFwDLNonResumableFailure));
-            }
-        }
-    FLOG(_L("DownloadManagerClient::TryResumeDownloadL, ret = %d <<"), ret);
-    }
-
-// --------------------------------------------------------------------------
-//  The slot which gets all the download manager events.
-// --------------------------------------------------------------------------
-bool DownloadManagerClient::DownloadMgrEventRecieved(
-        DownloadManagerEvent *event)
-    {
-    FLOG(_L("DownloadManagerClient::event >>"));
-
-    DownloadManagerEvent::Event type = (DownloadManagerEvent::Event) event->type();
-    TBool ret(EFalse);
-
-    FLOG(_L("Download Manager Event Type: %d"), type);
-    switch (type)
-        {
-        case DownloadManagerEvent::Created:
-            {
-            FLOG(_L("Download is created..."));
-            ret = ETrue;
-            break;
-            }
-        case DownloadManagerEvent::Removed:
-            {
-            FLOG(_L("Download is cleared..."));
-            ret = ETrue;
-            break;
-            }
-        }
-
-    FLOG(_L("DownloadManagerClient::event, ret = %d <<"), ret);
-    return ret;
-    }
-
-// --------------------------------------------------------------------------
-//  Called by the download client when the single download begins.
-// --------------------------------------------------------------------------
-void DownloadManagerClient::StartDownloadProgress(QString name,
-        QString version, int size)
-    {
-
-    HBufC8* temp1 = XQConversions::qStringToS60Desc8(name);
-    HBufC8* temp2 = XQConversions::qStringToS60Desc8(version);
-    iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-    iFotaServer->iPackageState.iPkgSize = size;
-
-    if (temp1->Length() <= iFotaServer->iPackageState.iPkgName.MaxLength())
-        iFotaServer->iPackageState.iPkgName.Copy(temp1->Des());
-
-    if (temp2->Length() <= iFotaServer->iPackageState.iPkgVersion.MaxLength())
-        iFotaServer->iPackageState.iPkgVersion.Copy(temp2->Des());
-    delete temp1;
-    delete temp2;
-    TRAP_IGNORE(
-            iFotaServer->iDatabase->OpenDBL();
-            iFotaServer->iDatabase->SetStateL( iFotaServer->iPackageState, KNullDesC8, EFDBPkgName|EFDBVersion|EFDBPkgSize|EFDBState);
-            iFotaServer->iDatabase->CloseAndCommitDB();
-            );
-
-    if (!iFotaServer->iPackageState.iSessionType)
-        {
-        iFotaServer->StartDownloadDialog(name, version, size);
-        iFotaServer->ConstructApplicationUI(ETrue);
-        }
-    }
-
-// --------------------------------------------------------------------------
-//  Called by the download client to update the progress of download.
-// --------------------------------------------------------------------------
-void DownloadManagerClient::UpdateDownloadProgress(int progress)
-    {
-    FLOG(_L("DownloadManagerClient::UpdateDownloadProgress, progress = %d >>"),
-            progress );
-
-    iProgress = ETrue;
-    
-    if (!iFotaServer->iPackageState.iSessionType)
-        {
-        iFotaServer->UpdateDownloadDialog(progress);
-        }
-
-    FLOG(_L("DownloadManagerClient::UpdateDownloadProgress <<"));
-
-    }
-
-// --------------------------------------------------------------------------
-//  Called by the download client when the download is complete, either successfully or unsuccessfully.
-// --------------------------------------------------------------------------
-void DownloadManagerClient::HandleDownloadEvent(Download::State dlstate,
-        int err0)
-    {
-    FLOG(_L("DownloadManagerClient::HandleDownloadEvent, status = %d >>"),  dlstate);
-
-    iDownloadSubmitted = EFalse;
-    iProgress = EFalse;
-    TInt notetype(-1);
-
-    if (iDownloadClient)
-        {
-        delete iDownloadClient;
-        iDownloadClient = NULL;
-        }
-
-    if (dlstate == Download::Completed)
-        {
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadComplete;
-        iFotaServer->iPackageState.iResult = -1;
-        }
-    else if (dlstate == Download::Paused)
-        {
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-
-        MapDownloadErrors(err0);
-        }
-    else if (dlstate == Download::Failed)
-        {
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadFailed;
-
-        MapDownloadErrors(err0);
-
-        if(iFotaServer->iPackageState.iResult == RFotaEngineSession::EResDLFailDueToDeviceOOM
-           || iFotaServer->iPackageState.iResult == RFotaEngineSession::EResDLFailDueToNWIssues)
-            {
-            iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-            }
-        }
-    else if (dlstate == Download::Cancelled)
-        {
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-
-        MapDownloadErrors(err0);
-        }
-    else if (dlstate == Download::Paused)
-        {
-        iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-
-        MapDownloadErrors(err0);
-        }
-    else
-        {
-        FLOG(_L(" I DO NOT KNOW THIS DLSTATE!!"));
-        }
-    TRAPD(err,
-            iFotaServer->iDatabase->OpenDBL();
-            iFotaServer->iDatabase->SetStateL( iFotaServer->iPackageState, KNullDesC8, EFDBState|EFDBResult);
-            iFotaServer->iDatabase->CloseAndCommitDB();
-    );
-    FLOG(_L("Updating fota database, error = %d"), err);
-
-    UninitDownloadMgr();
-
-    if (iFotaServer->iPackageState.iState == RFotaEngineSession::EDownloadComplete
-            && iFotaServer->iPackageState.iUpdateLtr)
-        {
-        iFotaServer->SetStartupReason(EFotaUpdateInterrupted);
-        }
-
-    if (iFotaServer->iPackageState.iResult
-            == RFotaEngineSession::EResDLFailDueToNWIssues)
-        {
-        notetype = EFwDLConnectionFailure;
-        }
-    else if (iFotaServer->iPackageState.iState == RFotaEngineSession::EDownloadProgressing &&
-            iFotaServer->iPackageState.iResult == RFotaEngineSession::EResUndefinedError)
-        {
-        notetype = EFwDLGeneralFailure;
-        }
-    else if (iFotaServer->iPackageState.iResult == RFotaEngineSession::EResFailedSignatureAuthentication
-            || iFotaServer->iPackageState.iResult == RFotaEngineSession::EResMalformedOrBadURL
-            || iFotaServer->iPackageState.iResult == RFotaEngineSession::EResAlternateDLServerUnavailable
-            || iFotaServer->iPackageState.iResult == RFotaEngineSession::EResInvalidDownloadDescriptor
-            || iFotaServer->iPackageState.iResult == RFotaEngineSession::EResUndefinedError)
-        {
-        notetype = EFwDLNonResumableFailure;
-        }
-
-    TRAP(err, iFotaServer->FinalizeDownloadL());
-
-    FLOG(_L("Finalized download, error = %d"), err);
-
-    if (notetype != -1)
-        {
-        TRAP_IGNORE(ShowDialogL((TFwUpdNoteTypes) notetype));
-        }
-
-    FLOG(_L("DownloadManagerClient::HandleDownloadEvent <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Called by the download client when download is interrupted by fota.
-// --------------------------------------------------------------------------
-void DownloadManagerClient::HandleClientInterrupt(Download::State dlstate,
-        int err0)
-    {
-    FLOG(_L("DownloadManagerClient::HandleClientInterrupt, status = %d >>"),
-            dlstate);
-
-    iDownloadSubmitted = EFalse;
-    iProgress = EFalse;
-    TInt notetype(-1);
-
-    if (iDownloadClient)
-        {
-        delete iDownloadClient;
-        iDownloadClient = NULL;
-        }
-
-    if (dlstate == Download::Cancelled || dlstate == Download::Failed)
-        {
-        if (err0 == UserCancelled)
-            {
-            iFotaServer->iPackageState.iState  = RFotaEngineSession::EDownloadFailed;
-            iFotaServer->iPackageState.iResult = RFotaEngineSession::EResUserCancelled;
-            notetype = EFwDLNonResumableFailure;
-            }
-        else if (err0 == NeedMoreMemory)
-            {
-            iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-            iFotaServer->iPackageState.iResult= RFotaEngineSession::EResUserCancelled;
-            }
-        else if (err0 == InvalidContentType)
-            {
-            iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadFailed;
-            iFotaServer->iPackageState.iResult= RFotaEngineSession::EResContentMisMatch;
-            notetype = EFwDLNonResumableFailure;
-            }
-        }
-    else if (dlstate == Download::Paused)
-        {
-        if (err0 == UserCancelled)
-            {
-            iFotaServer->iPackageState.iState = RFotaEngineSession::EDownloadProgressing;
-            iFotaServer->iPackageState.iResult= RFotaEngineSession::EResUserCancelled;
-            
-            iFotaServer->ServerCanShut(ETrue);
-            }
-        }
-    else
-        {
-        FLOG(_L(" I DO NOT KNOW THIS!!"));
-        }
-    TRAPD(err,
-            iFotaServer->iDatabase->OpenDBL();
-            iFotaServer->iDatabase->SetStateL( iFotaServer->iPackageState, KNullDesC8, EFDBState|EFDBResult);
-            iFotaServer->iDatabase->CloseAndCommitDB();
-    );
-    FLOG(_L("Updating fota database, error = %d"), err);
-
-    UninitDownloadMgr();
-
-    TRAP(err, iFotaServer->FinalizeDownloadL());
-
-    FLOG(_L("Finalizing download, error = %d"), err);
-
-    if (notetype != -1)
-        {
-        TRAP_IGNORE(ShowDialogL((TFwUpdNoteTypes) notetype));
-        }
-
-    FLOG(_L("DownloadManagerClient::HandleClientInterrupt <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Called to map the download error codes to fota result codes (FUMO result codes)
-// --------------------------------------------------------------------------
-void DownloadManagerClient::MapDownloadErrors(int err0)
-    {
-    FLOG(_L("DownloadManagerClient::MapDownloadErrors, err =  %d >>"), err0);
-
-    if (err0 >= ConnectionRefusedError && err0 <= UnknownNetworkError)
-        {
-        //Connection related error
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResAlternateDLServerUnavailable;
-        }
-    else if (err0 == ContentNotFoundError)
-        {
-        iFotaServer->iPackageState.iResult
-                    = RFotaEngineSession::EResAlternateDLServerUnavailable;
-        }
-    else if (err0 >= ContentAccessDenied && err0 <= UnknownContentError)
-        {
-        //Content related error
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResUndefinedError;
-        }
-    else if (err0 >= ProtocolUnknownError && err0 <= ProtocolFailure)
-        {
-        //Protocol related error
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResUndefinedError;
-        }
-    else if (err0 >= ConnectionFailed && err0 <= TransactionFailed)
-        {
-        //No network coverage
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResDLFailDueToNWIssues;
-        }
-    else if (err0 >= HttpRestartFailed && err0 <= ContentExpired)
-        {
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResUndefinedError;
-        }
-    else if (err0 == ObjectNotFound)
-        {
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResAlternateDLServerUnavailable;
-        }
-    else if (err0 == BadUrl)
-        {
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResMalformedOrBadURL;
-        }
-    else if (err0 == MediaRemoved)
-        {
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResDLFailDueToDeviceOOM;
-        }
-    else if (err0 == DiskFull)
-        {
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResDLFailDueToDeviceOOM;
-        }
-    else if (err0 == InvalidDownloadDescriptor)
-        {
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResInvalidDownloadDescriptor;
-        }
-    else
-        {
-        //Unknown failure reason
-        iFotaServer->iPackageState.iResult
-                = RFotaEngineSession::EResUndefinedError;
-        }
-    FLOG(_L("DownloadManagerClient::MapDownloadErrors, mapped fota failure reason = %d"), iFotaServer->iPackageState.iResult);
-    }
-
-// --------------------------------------------------------------------------
-//  Tells whether any download is active or not.
-// --------------------------------------------------------------------------
-TBool DownloadManagerClient::IsDownloadActive()
-    {
-    return (iDownloadSubmitted || iProgress);
-    }
-
-// --------------------------------------------------------------------------
-//  Returns the download manager instance pointer
-// --------------------------------------------------------------------------
-DownloadManager* DownloadManagerClient::Manager()
-    {
-    return iDownloadManager;
-    }
-
-// --------------------------------------------------------------------------
-//  Finds the suitable drive and folder for a download, given its size.
-// --------------------------------------------------------------------------
-TFreeSpace DownloadManagerClient::GetSuitablePath(TInt aSize, QString& aPath)
-    {
-    TFreeSpace isavailable;
-    TInt swupdSize(0);
-    TInt dummySize(0);
-
-    SpaceAllocatedBySWUPDFiles(swupdSize, dummySize);
-
-    if (aSize <= dummySize)
-        {
-        // fits to reservation
-        isavailable = EFitsToReservation;
-        }
-    else
-        {
-        // doesnt fit to reservation, does it fit to filesystem?
-        TInt sizeNeededFromFS = aSize - dummySize;
-
-        if (sizeNeededFromFS < 0)
-            sizeNeededFromFS = 0;
-        TBool critical(ETrue);
-        TRAP_IGNORE(critical = SysUtil::FFSSpaceBelowCriticalLevelL( &iFs, sizeNeededFromFS ));
-
-        if (critical)
-            {
-            // how much space would be needed
-            TVolumeInfo vi;
-            iFs.Volume(vi, EDriveC);
-
-            TInt neededspace = sizeNeededFromFS - vi.iFree
-                    + KSystemCriticalWorkingspace;
-            FLOG(_L("neededspace = %d vi.iFree = %d "), neededspace, vi.iFree);
-            FLOG(_L(" neededspace = sizeNeededFromFS - vi.iFree + KSystemCriticalWorkingspace;"));
-
-            aSize = neededspace;
-            isavailable = EDoesntFitToFileSystem;
-            }
-        else
-            {
-            isavailable = EFitsToFileSystem;
-            }
-
-        }
-    aPath = DefaultPath;
-
-    FLOG(_L("DownloadManagerClient::IsPackageStoreSizeAvailableL, isavailable = %d <<"), isavailable);
-
-    return isavailable;
-    }
-
-// ---------------------------------------------------------------------------
-// DownloadManagerClient::GetUpdatePackageLocation
-// Gets update package location, that is , path.
-// ---------------------------------------------------------------------------
-void DownloadManagerClient::GetUpdatePackageLocation(TDes& aPath)
-    {
-    FLOG(_L("DownloadManagerClient::GetUpdatePackageLocation >>"));
-
-    TBuf<KMaxFileName> temp;
-    temp.Zero();
-    temp.Copy(KDefaultPath);
-
-    aPath.Zero();
-
-    if (iFotaServer->iPackageState.iState == RFotaEngineSession::EDownloadProgressing
-            || iFotaServer->iPackageState.iState == RFotaEngineSession::EDownloadFailed)
-        temp.Append(KDownloadTempDir);
-
-    TPtrC name(reinterpret_cast<const unsigned short*> (PackageName.constData()));
-
-    temp.Append(name);
-
-    if (BaflUtils::FileExists(iFs, temp))
-        aPath.Copy(temp);
-
-    FLOG(_L("DownloadManagerClient::GetUpdatePackageLocation <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Gets the download package size
-// --------------------------------------------------------------------------
-TInt DownloadManagerClient::GetDownloadPackageSize()
-    {
-    FLOG(_L("DownloadManagerClient::GetDownloadPackageSize >>"));
-
-    TInt size(0);
-    TBuf<KMaxFileName> temp;
-    temp.Zero();
-    temp.Copy(KDefaultPath);
-
-    if (iFotaServer->iPackageState.iState
-            == RFotaEngineSession::EDownloadProgressing)
-        temp.Append(KDownloadTempDir);
-
-    TPtrC  name(reinterpret_cast<const unsigned short*> (PackageName.constData()));
-
-    temp.Append(name);
-
-    TEntry entry;
-    if (iFs.Entry(temp, entry) == KErrNone)
-        size = entry.iSize;
-
-    FLOG(_L("DownloadManagerClient::GetDownloadPackageSize, size = %d >>"),
-            size);
-    return size;
-    }
-
-// --------------------------------------------------------------------------
-//  Gets the space allocated for the package and reserved memory 
-// --------------------------------------------------------------------------
-void DownloadManagerClient::SpaceAllocatedBySWUPDFiles(TInt& aSwupdSize,
-        TInt& aReservedSize)
-    {
-    // get sizes of swupd files
-    aSwupdSize = GetDownloadPackageSize();
-
-    // get size of reserved file
-    aReservedSize = 0;
-    TBuf<KMaxFileName> temp;
-    temp.Zero();
-    temp.Copy(KDefaultPath);
-    temp.Append(KReservedFileName);
-
-    TEntry entry;
-    if (iFs.Entry(temp, entry) == KErrNone)
-        aReservedSize = entry.iSize;
-
-    FLOG(_L("CFotaDiskStorage::SpaceAllocatedBySWUPDFilesL reserved:%d swupd:%d"), aReservedSize, aSwupdSize);
-    }
-
-// --------------------------------------------------------------------------
-//  Creates the disk reservation
-// --------------------------------------------------------------------------
-void DownloadManagerClient::CreateDiskReservation()
-    {
-    FLOG(_L("DownloadManagerClient::CreateDiskReservationL >>"));
-
-    // Count size reserved by .swupd files
-    // CDir*       list;
-    TInt err;
-    TInt swupdSize(0);
-    TInt dummySize(0);
-    RFile dummy;
-
-    SpaceAllocatedBySWUPDFiles(swupdSize, dummySize);
-
-    // Calculate space for dummy file
-    TInt targetsize = iReservedSize - swupdSize;
-    if (targetsize < 0)
-        {
-        targetsize = 0;
-        }
-
-    // Reduce dummy file size 
-    if (dummySize != targetsize || dummySize == 0)
-        {
-        FLOG(_L("   dummy new size %d (old %d)"), targetsize, dummySize);
-
-        err = dummy.Open(iFs, KReservedFileName, EFileWrite
-                | EFileShareExclusive);
-
-        if (err == KErrNotFound)
-            {
-            dummy.Replace(iFs, KReservedFileName, EFileWrite
-                    | EFileShareExclusive);
-            }
-
-        TInt err = KErrNone;
-        //Reservation logic - if 'x' bytes is not available, try x/2 to reserve. 
-        //Trial would end if unable to save atleast 1MB.
-
-        do {
-            FLOG(_L("Trying to reserve size: %d bytes..."), targetsize);
-            err = dummy.SetSize(targetsize);
-            if (err != KErrNoMemory)
-                break;
-            targetsize = targetsize / 2;
-
-            if (targetsize < 1024 * 1024) //Don't reserver anything lesser than 1MB
-                break;
-            }
-        while (err == KErrNoMemory);
-        dummy.Close();
-
-        if (err == KErrNone)
-            {
-            FLOG(_L("Successfully created reservation of size: %d bytes"),
-                    targetsize);
-            }
-        else
-            {
-            FLOG(_L("Error %d while creating reserved of size:  %d bytes"),
-                    err, targetsize);
-            }
-        }
-
-    FLOG(_L("DownloadManagerClient::CreateDiskReservationL <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Deletes the disk reservation in the specified path
-// --------------------------------------------------------------------------
-void DownloadManagerClient::DeleteDiskReservation(QString& path)
-    {
-    FLOG(_L("DownloadManagerClient::DeleteDiskReservation >>"));
-
-    RFile file;
-    TBuf<KMaxFileName> temp;
-    temp.Zero();
-
-    TPtrC spath(reinterpret_cast<const unsigned short*> (path.constData()));
-    temp.Copy(spath);
-    temp.Append(KReservedFileName);
-
-    TInt err = file.Open(iFs, temp, EFileWrite | EFileShareExclusive);
-
-    if (!err)
-        {
-        FLOG(_L("Removing the reserved memory as download has started"),
-                iReservedSize);
-        file.SetSize(KErrNone);
-        }
-
-    file.Close();
-
-    FLOG(_L("DownloadManagerClient::DeleteDiskReservation <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// DownloadManagerClient::DeleteUpdatePackageL 
-// ---------------------------------------------------------------------------
-void DownloadManagerClient::DeleteUpdatePackageL()
-    {
-    FLOG(_L("DownloadManagerClient::DeleteUpdatePackageL >>"));
-
-    CDir*       list;
-   
-    // get sizes of swupd files
-    TInt err = iFs.GetDir (KPackageExtensionAll, KEntryAttNormal ,ESortByName, list );
-    if (err == KErrNone)
-        {
-        CleanupStack::PushL ( list );
-
-        for(int i=0; i<list->Count() ;++i )
-            {
-            TEntry t = (*list)[i];
-            iFs.Delete(t.iName);
-            FLOG(_L("Deleted: %S"), &t.iName);
-            }
-
-        CleanupStack::PopAndDestroy( list );        
-        }
-    
-    TBuf<KMaxFileName> temp;
-    temp.Copy(KDefaultPath);
-    temp.Append(KDownloadTempDir);
-    temp.Append(KPackageExtensionAll);
-    
-    err = iFs.GetDir (temp, KEntryAttNormal ,ESortByName, list );
-    
-    if (err == KErrNone)
-        {
-        CleanupStack::PushL ( list );
-        TBuf<KMaxFileName> temp;
-
-        for(int i=0; i<list->Count() ;++i )
-            {
-            TEntry t = (*list)[i];
-            temp.Copy(KDefaultPath);
-            temp.Append(KDownloadTempDir);
-            temp.Append(t.iName);
-            iFs.Delete(temp);
-            FLOG(_L("Deleted: %S"), &temp);
-            }
-        
-        CleanupStack::PopAndDestroy( list );
-        }
-    
-    CreateDiskReservation();
-
-    FLOG(_L("DownloadManagerClient::DeleteUpdatePackageL<<"));
-    }
-
-// --------------------------------------------------------------------------
-//  Called to show any update specific dialogs
-// --------------------------------------------------------------------------
-void DownloadManagerClient::ShowDialogL(TFwUpdNoteTypes adialogid,
-        TInt aValue)
-    {
-    FLOG(_L("DownloadManagerClient::ShowDialog, dialogid = %d >>"), adialogid);
-    iFotaServer->ServerCanShut(EFalse);
-    if (iFotaServer->FullScreenDialog())
-        iFotaServer->FullScreenDialog()->Close();
-
-    if (iFotaServer->iPackageState.iSessionType && adialogid
-            != EFwDLNeedMoreMemory)
-        {
-        FLOG(_L("Differing showing dialog as session is silent."));
-        return;
-        }
-
-    iNotifParams = CHbSymbianVariantMap::NewL();
-
-    HBufC* keyDialog = HBufC::NewL(10);
-    CleanupStack::PushL(keyDialog);
-    *keyDialog = KKeyDialog;
-
-    HBufC* keyParam1 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam1);
-    *keyParam1 = KKeyParam1;
-
-    HBufC* keyParam2 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam2);
-    *keyParam2 = KKeyParam2;
-
-    HBufC* keyParam3 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam3);
-    *keyParam3 = KKeyParam3;
-
-    //adialogid = EFwUpdResumeUpdate;
-    CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&adialogid,
-            CHbSymbianVariant::EInt);
-    CleanupStack::PushL(dialogId);
-    iNotifParams->Add(*keyDialog, dialogId);
-    iNotifier = CFotaDownloadNotifHandler::NewL(this);
-
-    switch (adialogid)
-        {
-        case EFwDLNeedMoreMemory: //For Flexible memory
-            {
-            //TFwUpdNoteTypes aType = EFwDLNeedMoreMemory;
-            CHbSymbianVariant* param1Val = CHbSymbianVariant::NewL(&aValue,
-                    CHbSymbianVariant::EInt);
-
-            iNotifParams->Add(*keyParam1, param1Val);
-            iNotifier->LaunchNotifierL(iNotifParams, adialogid);
-            }
-            break;
-        case EFwDLConnectionFailure:
-            {
-            iNotifier->LaunchNotifierL(iNotifParams, adialogid);
-            }
-            break;
-        case EFwDLGeneralFailure:
-            {
-            iNotifier->LaunchNotifierL(iNotifParams, adialogid);
-            }
-            break;
-        case EFwDLNonResumableFailure:
-             {
-             iNotifier->LaunchNotifierL(iNotifParams, adialogid);
-             }
-            break;
-        default:
-            {
-
-            }
-            break;
-        }
-    CleanupStack::PopAndDestroy(5);
-
-    FLOG(_L("DownloadManagerClient::ShowDialog <<"));
-    }
-
-// --------------------------------------------------------------------------
-//  The call back when update specific dialog receives an user response
-// --------------------------------------------------------------------------
-void DownloadManagerClient::HandleDialogResponse(int response, TInt aDialogId)
-    {
-
-    FLOG(_L("DownloadManagerClient::HandleDialogResponse, response = %d, aDialogid = %d >>"), response, aDialogId);
-    //TInt dialogID;
-    //const CHbSymbianVariant* dialogId = iNotifParams->Get(KKeyDialog);
-    //dialogID = *(TFwUpdNoteTypes *)dialogId->Value<TInt>();
-
-    switch (aDialogId)
-        {
-        case EFwDLNeedMoreMemory: //For Flexible memory
-            {
-            if (response == EHbLSK) //LSK
-                {
-                iDownloadClient->Restart();
-                }
-            else //End key
-                {
-                iDownloadClient->Cancel(NeedMoreMemory);
-                }
-            }
-            break;
-        case EFwDLConnectionFailure:
-        case EFwDLGeneralFailure:
-        case EFwDLNonResumableFailure:
-            {
-            iFotaServer->ServerCanShut(ETrue);
-            }
-            break;
-        default:
-            {
-            iFotaServer->ServerCanShut(ETrue);
-            }
-            break;
-        }
-
-    FLOG(_L("DownloadManagerClient::HandleDialogResponse <<\n"));
-    }
-
-//End of file
--- a/fotaapplication/fotaserver/src/FotaNetworkRegStatus.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,392 +0,0 @@
-/*
- * 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:   GPRS and Wlan status getter for sending Generic Alerts
- *
- */
-
-// INCLUDE FILES
-
-//System Includes
-#include <startupdomainpskeys.h>	//GlobalRFsStates
-#include <rconnmon.h>	//RConnectionMonitor
-#include <featmgr.h>	//Feature Manager
-#include <features.hrh>	//Feature Manager
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
-#include <cmpluginwlandef.h>
-#include <cmpluginpacketdatadef.h>
-
-//User Includes
-#include "FotaServer.h"
-#include "FotaNetworkRegStatus.h"
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::NewL
-// Symbian 2-Phase construction, NewL used for creating object of this class
-// This method can leave
-// -----------------------------------------------------------------------------
-
-CFotaNetworkRegStatus* CFotaNetworkRegStatus::NewL(CFotaServer* aObserver)
-    {
-    CFotaNetworkRegStatus* self = CFotaNetworkRegStatus::NewLC(aObserver);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::NewLC
-// Symbian 2-Phase construction, NewLC used for creating object of this class
-// This method can leave
-// -----------------------------------------------------------------------------
-
-CFotaNetworkRegStatus* CFotaNetworkRegStatus::NewLC(CFotaServer* aObserver)
-    {
-    CFotaNetworkRegStatus* self = new (ELeave) CFotaNetworkRegStatus(
-            aObserver);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::ConstructL
-// Symbian 2-Phase construction, ConstructL used for constructing the members of this class
-// This method can leave
-// -----------------------------------------------------------------------------
-
-void CFotaNetworkRegStatus::ConstructL()
-    {
-    iTimer.CreateLocal();
-    iMonitor.ConnectL();
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::CFotaNetworkRegStatus
-// C++ Constructor
-// This method shouldn't leave
-// -----------------------------------------------------------------------------
-
-CFotaNetworkRegStatus::CFotaNetworkRegStatus(CFotaServer* aObserver) :
-    CActive(CActive::EPriorityStandard), iObserver(aObserver), iRetriesLeft(
-            KRetries), iGlobalRFState(EFalse)
-    {
-    CActiveScheduler::Add(this); // Add AO to current active scheduler
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::~CFotaNetworkRegStatus
-// C++ Desctructor
-// This method shouldn't leave
-// -----------------------------------------------------------------------------
-
-CFotaNetworkRegStatus::~CFotaNetworkRegStatus()
-    {
-    Cancel();
-
-    iTimer.Close();
-    iMonitor.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::DoCancel()
-// Cancels currently active notifier, if such exists
-// -----------------------------------------------------------------------------
-//
-void CFotaNetworkRegStatus::DoCancel()
-    {
-    FLOG(_L("CFotaNetworkRegStatus::DoCancel >>"));
-
-    if (IsActive())
-        {
-        iTimer.Cancel();
-        //		Cancel();
-        }
-
-    FLOG(_L("CFotaNetworkRegStatus::DoCancel <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::StartMonitoringL
-// Monitors for connection status
-// This method don't leave
-// -----------------------------------------------------------------------------
-
-void CFotaNetworkRegStatus::StartMonitoringL()
-    {
-    FLOG(_L("CFotaNetworkRegStatus::StartMonitoringL >>"));
-
-    //Check offline state
-    FLOG(_L("Check GlobalRF state..."));
-    if (!iGlobalRFState)
-        {
-        iGlobalRFState = CheckGlobalRFState();
-        }
-
-    if (iGlobalRFState)
-        {
-        //Check registration state only if iGlobalRFState is true
-        FLOG(_L("Check registration state..."));
-        if (CheckNetworkRegStateL())
-            {
-            //If both are successful report complete
-            FLOG(
-                    _L("Network Registration is successful, sending Status as success to FotaServer"));
-            iObserver->ReportNetworkStatus(ETrue);
-            return;
-            }
-        }
-    //If one of them is not successful, start timer and retry KRetries times...
-
-    if (--iRetriesLeft >= 0)
-        {
-        FLOG(_L("Retry count... [%d]"), KRetries - iRetriesLeft);
-        iTimer.After(iStatus, KTimeInterval);
-        if (!IsActive())
-            SetActive();
-        }
-    else
-        {
-        FLOG(
-                _L("Maximum retries (%d) reached, sending Status as failure to FotaServer"),
-                KRetries);
-        iObserver->ReportNetworkStatus(IsWlanSupportedL());
-        }
-
-    FLOG(_L("CFotaNetworkRegStatus::StartMonitoringL <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::RunL()
-// Called when event accomplished
-// -----------------------------------------------------------------------------
-//
-void CFotaNetworkRegStatus::RunL()
-    {
-    FLOG(_L("CFotaNetworkRegStatus::RunL >>"));
-
-    if (iStatus == KErrNone)
-        {
-        StartMonitoringL();
-        }
-    else
-        {
-        iObserver->ReportNetworkStatus(EFalse);
-        }
-
-    FLOG(_L("CFotaNetworkRegStatus::RunL <<"));
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::RunError
-// Called when RunL leaves
-// This method can't leave
-// -----------------------------------------------------------------------------
-
-TInt CFotaNetworkRegStatus::RunError(TInt aError)
-    {
-    FLOG(_L("CFotaNetworkRegStatus::RunL >>"));
-    iObserver->ReportNetworkStatus(EFalse);
-    FLOG(_L("CFotaNetworkRegStatus::RunL <<"));
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::CheckGlobalRFState
-// Checks for GlobalRFState, set by Starter
-// This method can't leave
-// -----------------------------------------------------------------------------
-
-TBool CFotaNetworkRegStatus::CheckGlobalRFState()
-    {
-    FLOG(_L("CFotaNetworkRegStatus::CheckGlobalRFState >>"));
-
-    RProperty prop;
-    TInt val = KErrNone;
-    TInt err = KErrNone;
-    TInt status = EFalse;
-
-    err = prop.Get(KPSUidStartup, KPSGlobalSystemState, val);
-    if (err == KErrNone && val == ESwStateNormalRfOn)
-        {
-        //Phone is not offline. Check for Network Registration status
-        FLOG(_L("Phone is online. Check for Network Registration status"));
-        status = ETrue;
-        }
-    else
-        {
-        //Phone is offline. No Network activities allowed.
-        FLOG(_L("Phone is offline. No Network activities allowed."));
-        status = EFalse;
-        }
-    FLOG(_L("CFotaNetworkRegStatus::CheckGlobalRFState, status = %d <<"),
-            status);
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::CheckNetworkRegStatusL
-// Checks for Network registration status
-// This method can leave
-// -----------------------------------------------------------------------------
-
-TBool CFotaNetworkRegStatus::CheckNetworkRegStateL()
-    {
-    FLOG(_L("CFotaNetworkRegStatus::CheckNetworkRegStateL >>"));
-
-    TBool status = EFalse;
-
-    TInt registrationStatus(KErrNone);
-    TRequestStatus status1;
-    iMonitor.GetIntAttribute(EBearerIdGSM, // See bearer ids from TConnMonBearerId
-            0, KNetworkRegistration, registrationStatus, status1);
-    User::WaitForRequest(status1);
-
-    if (status1.Int() == KErrNone)
-        {
-        switch (registrationStatus)
-            {
-            case ENetworkRegistrationHomeNetwork:
-            case ENetworkRegistrationRoaming:
-                {
-                status = ETrue;
-                break;
-                }
-            default:
-                {
-                /* Includes - 	ENetworkRegistrationNotAvailable:
-                 ENetworkRegistrationUnknown:
-                 ENetworkRegistrationNoService:
-                 ENetworkRegistrationEmergencyOnly:
-                 ENetworkRegistrationSearching:
-                 ENetworkRegistrationBusy:
-                 ENetworkRegistrationDenied:*/
-                status = EFalse;
-                break;
-                }
-            }
-        }
-
-    FLOG(_L("CFotaNetworkRegStatus::CheckNetworkRegStateL, status = %d <<"),
-            status);
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::IsWlanSupportedL
-// Checks whether Wlan supported on device and active
-// This method can leave
-// -----------------------------------------------------------------------------
-
-TBool CFotaNetworkRegStatus::IsWlanSupportedL()
-    {
-    FLOG(_L("CFotaNetworkRegStatus::IsWlanSupportedL >>"));
-
-    TBool status = EFalse;
-
-    FeatureManager::InitializeLibL();
-    if (FeatureManager::FeatureSupported(KFeatureIdProtocolWlan)) // check for feature enabled
-        {
-        status = ETrue;
-        }
-
-    FeatureManager::UnInitializeLib();
-
-#if defined(__WINS__)
-    status = ETrue;
-#endif
-
-    FLOG(_L("CFotaNetworkRegStatus::IsWlanSupportedL, status = %d <<"),
-            status);
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// CFotaNetworkRegStatus::IsConnectionPossibleL
-// Checks whether the network connection is possible in the given IAP Id
-// This method can leave
-// -----------------------------------------------------------------------------
-/*TBool CFotaNetworkRegStatus::IsConnectionPossibleL(TInt aIapid)
-    {
-    FLOG(_L("CFotaNetworkRegStatus::IsConnectionPossibleL >>"));
-    TBool status(EFalse);
-
-    TUint32 bearer = FindBearerL(aIapid);
-    if (bearer == KUidPacketDataBearerType)
-        {
-        FLOG(_L("Bearer is Packet data"));
-        if (CheckGlobalRFState() && CheckNetworkRegStateL())
-            {
-            FLOG(_L("Network is up and connection is possible "));
-            status = ETrue;
-            }
-        else
-            {
-            FLOG(_L("Network is not up and connection is not possible "));
-            status = EFalse;
-            }
-        }
-    else if (bearer == KUidWlanBearerType)//for wlan or other bearers
-        {
-        FLOG(_L("Bearer is wlan and proceeding for download "));
-        //proceed & this else loop to be removed
-        status = ETrue;
-        }
-    else
-        {
-        FLOG(_L("Bearer is not packet data or WLAN"));
-        }
-
-    FLOG(_L("CFotaNetworkRegStatus::IsConnectionPossibleL, status = %d <<"),
-            status);
-    return status;
-    }*/
-
-// ----------------------------------------------------------------------------------------
-// CFotaDownload::FindBearerId
-// Finds the Bearer Id for a given IAP Id
-// ----------------------------------------------------------------------------------------
-/*TUint32 CFotaNetworkRegStatus::FindBearerL(TInt aIapId)
-    {
-    FLOG(_L("CFotaNetworkRegStatus::FindBearerL: %d"), aIapId);
-    TUint32 bearer = 0;
-    TInt err(KErrNone);
-    // Query CM Id
-    TInt cmId(aIapId);
-    RCmManagerExt CmManagerExt;
-    TRAP( err, CmManagerExt.OpenL() );
-    FLOG(_L("CmManagerExt.OpenL() with error as  %d"), err);
-    if (err == KErrNone)
-        {
-        RCmConnectionMethodExt cm;
-        TRAP( err, cm = CmManagerExt.ConnectionMethodL( cmId ) );
-        FLOG(_L("CmManagerExt.ConnectionMethodL with error as  %d"), err);
-        if (err == KErrNone)
-            {
-            CleanupClosePushL(cm);
-            FLOG(_L("cm pushed to cleanupstack "));
-            bearer = cm.GetIntAttributeL(CMManager::ECmBearerType);
-            FLOG(_L("bearer is %d "), bearer);
-            CleanupStack::PopAndDestroy(); // cm	  
-            FLOG(_L("cm poped & destroyed from cleanupstack "));
-            }
-
-        CmManagerExt.Close();
-        FLOG(_L("CmManagerExt closed "));
-        }
-    FLOG(_L("CFotaNetworkRegStatus::FindBearerL end with bearer: %d"), bearer);
-    return bearer;
-    }*/
-
-// End of File 
--- a/fotaapplication/fotaserver/src/FotaServer.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2708 +0,0 @@
-/*
- * 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:   Fota server update and download functionality 
- *
- */
-// INCLUDE FILES
-#include <apgtask.h>
-#include <apgwgnam.h>
-#include <schtime.h>
-#include <csch_cli.h>
-#include <e32property.h>
-#include <cmmanager.h>
-#include <cmconnectionmethod.h> 
-#include <DevManInternalCRKeys.h>
-#include <nsmlconstants.h>
-#include <centralrepository.h>
-#include <sysversioninfo.h>
-#include <hbstackedlayout.h>
-#include <hbmainwindow.h>
-#include <hbview.h>
-#include <featmgr.h>
-#include <DevEncProtectedPSKey.h>
-#include <hbapplication.h>
-#include <xqconversions.h>
-#include <hbtransparentwindow.h>
-#include <es_sock.h>
-#include <es_enum_internal.h>
-#include <es_sock_partner.h>
-#include <e32property.h>
-#include <xqserviceutil.h>
-
-#include "FotaServer.h"
-#include "FotaSrvDebug.h"
-#include "FotasrvSession.h"
-#include "fotaConst.h"
-#include "nsmldmtreedbclient.h"
-#include "fotaserverPrivatePSKeys.h"
-#include "FotaNetworkRegStatus.h"
-#include "FotaDlMgrClient.h"
-#include "fotadevicedialogobserver.h"
-#include "fotanotifiers.h"
-#include "fotaserverPrivatePSKeys.h"
-
-#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
-
-TInt CFotaServer::iSessionCount = 0;
-
-
-// ============================= LOCAL FUNCTIONS =============================
-
-// ---------------------------------------------------------------------------
-// GetPredefinedNodeL
-// function to get preconfigured node for FUMO
-// ---------------------------------------------------------------------------
-void GetPredefinedNodeL(TDes8& aNode)
-    {
-    FLOG(_L("GetPredefinedNodeL() Begin"));
-    CRepository* centrep(NULL);
-    aNode.Zero();
-    centrep = CRepository::NewLC(TUid::Uid(0x101F9A0A));
-
-    if (centrep)
-        {
-        FLOG(_L("centralrepository found End"));
-        TFullName temp;
-
-        if (centrep->Get(KDevManFUMOPredefinedNodes, temp) == KErrNone
-                && temp.Length())
-            {
-            temp.Trim();
-            aNode.Copy(temp);
-            }
-        CleanupStack::PopAndDestroy(centrep);
-        }
-    FLOG(_L("GetPredefinedNodeL() End"));
-    }
-// ---------------------------------------------------------------------------
-// DeleteFUMOTreeL
-// function to get preconfigured node for FUMO
-// ---------------------------------------------------------------------------
-void DeleteFUMOTreeL()
-    {
-    FLOG(_L("DeleteFUMOTreeL() Begin"));
-    const TUint32 KNSmlFotaAdapterUid = 0x101F9A09;
-    _LIT8( KNSmlFumoPath, "FUMO" );
-    _LIT8( KNSmlFumoSeparator, "/" );
-    const TInt KGranularity = 10;
-    TBuf8<KMaxFullName> temp;
-    GetPredefinedNodeL(temp);
-    RNSmlDMCallbackSession session;
-    __LEAVE_IF_ERROR(session.Connect());
-    CleanupClosePushL(session);
-
-    CBufBase *emptyList = CBufFlat::NewL(0);
-    CleanupStack::PushL(emptyList);
-    CArrayFixFlat<TSmlDmMappingInfo>* UriSegList;
-    UriSegList = new (ELeave) CArrayFixFlat<TSmlDmMappingInfo> (KGranularity);
-
-    CleanupStack::PushL(UriSegList);
-
-    session.GetUriSegListL(KNSmlFotaAdapterUid, KNSmlFumoPath, *UriSegList);
-
-    for (TUint16 i = 0; i < UriSegList->Count(); i++)
-        {
-        if (temp.Length() && UriSegList->At(i).iURISeg.Find(temp)
-                != KErrNotFound)
-            {
-            FLOG(_L("DeleteFUMOTreeL predefined match =%S"), &temp);
-            continue;
-            }
-
-        TBuf8<KMaxFullName> tempFumo;
-        tempFumo.Append(KNSmlFumoPath);
-        tempFumo.Append(KNSmlFumoSeparator);
-        tempFumo.Append(UriSegList->At(i).iURISeg);
-        FLOG(_L("DeleteFUMOTreeL() call update mapping info for node %S"), &tempFumo);
-        session.UpdateMappingInfoL(KNSmlFotaAdapterUid, tempFumo, *emptyList);
-
-        }
-    // session.UpdateMappingInfoL(KNSmlFotaAdapterUid,KNSmlFumoPath,*emptyList);
-    CleanupStack::PopAndDestroy(UriSegList);
-    CleanupStack::PopAndDestroy(emptyList);
-    CleanupStack::PopAndDestroy(&session); //session
-    FLOG(_L("DeleteFUMOTreeL() End"));
-    }
-
-// ----------------------------------------------------------------------------------------
-// CFotaServer::NewInstance
-// ----------------------------------------------------------------------------------------
-CFotaServer* CFotaServer::NewInstance(HbMainWindow& mainwindow)
-    {
-    FLOG(_L("CFotaServer::NewInstance >>"));
-    
-    CFotaServer* self = new CFotaServer(mainwindow);
-    
-    if (self)
-        {
-        TRAPD( err, self->ConstructL());
-        
-        if (err != KErrNone)
-            {
-            delete self; self = NULL;
-            }
-        }
-    FLOG(_L("CFotaServer::NewInstance >>"));
-    return self;
-    }
-
-// ----------------------------------------------------------------------------------------
-// CFotaSrvSession::NewSessionL() 
-// ----------------------------------------------------------------------------------------
-CSession2* CFotaServer::NewSessionL(const TVersion&, const RMessage2&) const
-    {
-    iSessionCount++;
-    FLOG(_L("Number of active sessions = %d"), iSessionCount);
-    return new (ELeave) CFotaSrvSession();
-    }
-
-void CFotaServer::ReportFwUpdateStatusL(TPackageState& aState)
-    {
-    FLOG(_L("CFotaServer::ReportFwUpdateStatusL >>"));
-
-    TFotaClient requester = GetUpdateRequester();
-
-    if (requester == EDMHostServer)
-        {
-        FLOG(_L("Reporting status back to hostserver..."));
-        ServerCanShut(EFalse);
-        CreateDeviceManagementSessionL(aState);
-        }
-    else
-        {
-        //iServerCanShut = EFalse; Don't do here. Should be set in downloadmgrcli based on error type.
-        //ResetFotaStateL(aState.iPkgId);
-        SetStartupReason(EFotaDefault);
-        StopServerWhenPossible();
-        FLOG(_L("Not reporting status as requester is unknown!"));
-        }
-
-    FLOG(_L("CFotaServer::ReportFwUpdateStatusL >>"));
-    }
-
-void CFotaServer::StartDownloadDialog(const QString &aName,
-        const QString &aVersion, const TInt &aSize)
-    {
-    FLOG(_L("CFotaServer::StartDownloadDialog >>"));
-    //The dialog should not timeout here.
-    if (!iFullScreenDialog)
-        {
-        //ConstructApplicationUI(ETrue);
-        iFullScreenDialog = new FotaFullscreenDialog(this);
-        }
-
-    iFullScreenDialog->SetSoftwareDetails(aSize, aVersion, aName);
-
-    iFullScreenDialog->SetWarningDetails(EHbFotaDownload);
-
-    TBool postpone = IsUserPostponeAllowed();
-    if (!postpone)
-        {
-        FLOG(_L("Disabling option to resume later!"));
-        iFullScreenDialog->DisableRSK(ETrue);
-        }
-    
-    FLOG(_L("CFotaServer::StartDownloadDialog <<"));
-    }
-
-void CFotaServer::UpdateDownloadDialog(TInt aProgress)
-    {
-    FLOG(_L("CFotaServer::UpdateDownloadDialog >>"));
-    if (!iFullScreenDialog)
-        {
-        QString name = XQConversions::s60Desc8ToQString(
-                iPackageState.iPkgName);
-        QString version = XQConversions::s60Desc8ToQString(
-                iPackageState.iPkgVersion);
-        StartDownloadDialog(name, version, iPackageState.iPkgSize);
-        ConstructApplicationUI(ETrue);
-        }
-
-    iFullScreenDialog->UpdateProgressBar(aProgress);
-    FLOG(_L("CFotaServer::UpdateDownloadDialog <<"));
-    }
-
-void CFotaServer::ShowDialogL(TFwUpdNoteTypes adialogid)
-    {
-    FLOG(_L("CFotaServer::ShowDialogL  adialogid = %d<<"), adialogid);
-
-    if (iNotifier)
-        {
-        FLOG(_L("Deleting the open device dialog!!"));
-        iNotifier->Cancel();
-        }
-
-    ServerCanShut(EFalse);
-    iDialogId = (TInt) adialogid;
-
-    iNotifParams = CHbSymbianVariantMap::NewL();
-
-    HBufC* keyDialog = HBufC::NewL(10);
-    CleanupStack::PushL(keyDialog);
-    *keyDialog = KKeyDialog;
-
-    HBufC* keyParam1 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam1);
-    *keyParam1 = KKeyParam1;
-
-    HBufC* keyParam2 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam2);
-    *keyParam2 = KKeyParam2;
-
-    HBufC* keyParam3 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam3);
-    *keyParam3 = KKeyParam3;
-
-    HBufC* keyParam4 = HBufC::NewL(10);
-    CleanupStack::PushL(keyParam4);
-    *keyParam4 = KKeyParam4;
-
-    CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&adialogid,
-            CHbSymbianVariant::EInt);
-    CleanupStack::PushL(dialogId);
-    iNotifParams->Add(*keyDialog, dialogId);
-
-    if (!iNotifier)
-        iNotifier = CFotaDownloadNotifHandler::NewL(this);
-
-    switch (adialogid)
-        {
-        case EFwUpdNotEnoughBattery:
-        case EFwUpdDeviceBusy:
-            {
-            FLOG(_L("CFotaServer::EFwUpdNotEnoughBattery/EFwUpdDeviceBusy"));
-            iNotifier->LaunchNotifierL(iNotifParams, adialogid);
-            }
-            break;
-        case EFwUpdResumeUpdate:
-        case EFwUpdResumeDownload:
-            {
-            FLOG(_L("CFotaServer::EFwUpdResumeUpdate / EFwUpdResumeDownload"));
-            CHbSymbianVariant* param1Val = CHbSymbianVariant::NewL(
-                    &iPackageState.iPkgSize, CHbSymbianVariant::EInt);
-            CleanupStack::PushL(param1Val);
-            iNotifParams->Add(*keyParam1, param1Val);
-            TBuf16<KFotaMaxPkgNameLength>    temp1;
-            temp1.Copy(iPackageState.iPkgVersion);
-            CHbSymbianVariant* param2Val = CHbSymbianVariant::NewL(
-                    //&iPackageState.iPkgVersion, CHbSymbianVariant::EDes);
-                    &temp1, CHbSymbianVariant::EDes);
-            CleanupStack::PushL(param2Val);
-            iNotifParams->Add(*keyParam2, param2Val);
-            TBuf16<KFotaMaxPkgNameLength>    temp2;
-            temp2.Copy(iPackageState.iPkgName);
-            CHbSymbianVariant* param3Val = CHbSymbianVariant::NewL(
-                    &temp2, CHbSymbianVariant::EDes);
-            CleanupStack::PushL(param3Val);
-            iNotifParams->Add(*keyParam3, param3Val);
-            TBool postpone = IsUserPostponeAllowed();
-            CHbSymbianVariant* param4Val = CHbSymbianVariant::NewL(&postpone,
-                    CHbSymbianVariant::EInt);
-            CleanupStack::PushL(param4Val);
-            iNotifParams->Add(*keyParam4, param4Val);
-            iNotifier->LaunchNotifierL(iNotifParams, adialogid);
-            CleanupStack::PopAndDestroy(4);
-
-            }
-            break;
-
-        default:
-            {
-            FLOG(_L("CFotaServer::default"));
-            //Do nothing
-            }
-            break;
-        }
-    CleanupStack::PopAndDestroy(6);
-    FLOG(_L("CFotaServer::ShowDialogL >>"));
-
-    }
-
-void CFotaServer::HandleDialogResponse(int response, TInt aDialogId)
-    {
-    FLOG( _L("CFotaServer::HandleDialogResponse, response = %d dialog = %d >>"), response, aDialogId);
-
-    switch (aDialogId)
-        {
-        case EFwUpdNotEnoughBattery:
-        case EFwUpdDeviceBusy:
-            {
-            SetServerActive(EFalse);
-
-            StopServerWhenPossible();
-            }
-            break;
-        case EFwUpdResumeDownload:
-            {
-            if (response == EHbLSK) //Continue
-                {
-                FLOG(_L("User accepted to resume the download"));
-
-                TRAP_IGNORE(CancelFmsL());
-                TRAP_IGNORE(DownloaderL()->TryResumeDownloadL());
-                }
-            else //Resume Later
-                {
-                FLOG(_L("User denied resuming the download"));
-                DecrementUserPostponeCount();
-                SetServerActive(EFalse);
-                SetStartupReason(EFotaDownloadInterrupted);
-                
-                TRAP_IGNORE(InvokeFmsL());
-                
-                StopServerWhenPossible();
-                }
-            }
-            break;
-        case EFwUpdResumeUpdate:
-            {
-            if (response == EHbLSK) //Continue
-                {
-                FLOG(_L("User accepted to resume the update"));
-                iPackageState.iResult = KErrNotFound;
-                TRAPD(err,
-                        iDatabase->OpenDBL();
-                        iDatabase->SetStateL( iPackageState ,KNullDesC8,EFDBResult );
-                );
-                FLOG(_L("Updating the fota database... err = %d"), err);
-                iDatabase->CloseAndCommitDB();
-
-                TRAP(err, iUpdater->StartUpdateL( iPackageState ));
-                FLOG(_L("Starting update, err = %d"), err);
-                }
-            else //Update Later
-                {
-                FLOG(_L("User denied resuming the update"));
-                iPackageState.iState = RFotaEngineSession::EStartingUpdate;
-                iPackageState.iResult = RFotaEngineSession::EResUserCancelled;
-                TRAPD(err,
-                        iDatabase->OpenDBL();
-                        iDatabase->SetStateL( iPackageState ,KNullDesC8,EFDBState|EFDBResult );
-                        iDatabase->CloseAndCommitDB();
-                );
-                FLOG(_L("Updating the fota database... err = %d"), err);
-
-                DecrementUserPostponeCount();
-                SetServerActive(EFalse);
-                SetStartupReason(EFotaUpdateInterrupted);
-
-                TRAP(err, InvokeFmsL());
-                FLOG(_L("Invoking fms, err = %d"), err);
-
-                StopServerWhenPossible();
-                }
-            }
-            break;
-        default:
-            {
-            //Do nothing
-            }
-            break;
-        }
-    /*
-     if(iNotifParams)
-     {
-     delete iNotifParams; iNotifParams = NULL;
-     }
-     
-     if(iNotifier)
-     {
-     delete iNotifier; iNotifier = NULL;
-     }*/
-    iDialogId = 0;
-    FLOG(_L("CFotaServer::HandleDialogResponse<<"));
-    }
-
-void CFotaServer::SetServerActive(TBool aValue)
-    {
-    FLOG(_L("CFotaServer::SetServerActive, aValue = %d"), aValue);
-
-    TInt err = RProperty::Set(TUid::Uid(KOmaDMAppUid), KFotaServerActive,
-            aValue);
-    FLOG(_L("RProperty SetServerActive Set %d, err = %d"), aValue, err);
-
-    if (err == KErrNotFound)
-        {
-        err = RProperty::Define(TUid::Uid(KOmaDMAppUid), KFotaServerActive,
-                RProperty::EInt, KReadPolicy, KWritePolicy);
-        err = RProperty::Set(TUid::Uid(KOmaDMAppUid), KFotaServerActive,
-                aValue);
-        FLOG(_L("RProperty SetServerActive Set %d, err = %d"), aValue,
-                err);
-        }
-
-    FLOG(_L("CFotaServer::SetServerActive <<"));
-    }
-
-void CFotaServer::ShowFullScreenDialog(TInt aType)
-    {
-    FLOG(_L("CFotaServer::ShowFullScreenDialog, type = %d >>"), aType);
-
-    if (!iFullScreenDialog)
-        {
-        const QString  ver =   QString::fromUtf8( reinterpret_cast<const char*> (iPackageState.iPkgVersion.Ptr()), iPackageState.iPkgVersion.Length());
-        const QString name =   QString::fromUtf8( reinterpret_cast<const char*> (iPackageState.iPkgName.Ptr()), iPackageState.iPkgName.Length());
-        iFullScreenDialog = new FotaFullscreenDialog(this);
-
-        iFullScreenDialog->SetSoftwareDetails(iPackageState.iPkgSize, ver, name);
-        iFullScreenDialog->SetWarningDetails(EHbFotaDownload);
-        ConstructApplicationUI(ETrue);
-        }
-
-    if (aType == EHbFotaUpdate)
-        {
-        iFullScreenDialog->UpdateProgressBar(100);
-        TBool postpone = IsUserPostponeAllowed();
-        if (!postpone)
-            {
-            FLOG(_L("Disabling option to resume later!"));
-            iFullScreenDialog->DisableRSK(ETrue);
-            }
-
-        iFullScreenDialog->ShowUpdateDialog();
-        }
-    else if (aType == EHbFotaLowBattery)
-        {
-        iFullScreenDialog->UpdateProgressBar(100);
-        iFullScreenDialog->DisableRSK(EFalse);
-        iFullScreenDialog->SetWarningDetails(EHbFotaLowBattery);
-        }
-
-    FLOG(_L("CFotaServer::ShowFullScreenDialog <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CreateDeviceManagementSessionL       
-// Creates DM session 
-// --------------------------------------------------------------------------
-void CFotaServer::CreateDeviceManagementSessionL(TPackageState& aState)
-    {
-    FLOG(
-            _L("[cfotasever]   CreateDeviceManagementSessionL dms >> profid %d\
-    %d counts left ,sml handle %d, iNetworkAvailable=%d"),
-            aState.iProfileId, aState.iSmlTryCount, iSyncMLSession.Handle(),
-            iNetworkAvailable);
-
-    SetStartupReason(EFotaPendingGenAlert);
-
-    if (!iNetworkAvailable)
-        {
-        iRetryingGASend = ETrue;
-        iPackageState = aState;
-        StartNetworkMonitorL();
-        }
-    else
-        {
-
-        TBool dbAlreadyOpen = iDatabase->IsOpen();
-        TBool triesLeft(EFalse);
-
-        iNetworkAvailable = EFalse; // to check network again when GA is sent next time
-
-        if (iSyncMLSession.Handle())
-            {
-            __LEAVE_IF_ERROR( KErrAlreadyExists );
-            }
-
-        if (!dbAlreadyOpen)
-            iDatabase->OpenDBL();
-        // There is still tries left
-        if (aState.iSmlTryCount > 0)
-            {
-            triesLeft = ETrue;
-            FLOG(_L(" decrementing the retry count"));
-            aState.iSmlTryCount = aState.iSmlTryCount - 1;
-            iDatabase->SetStateL(aState, KNullDesC8, EFDBSmlTryCount);
-            }
-        // out of tries, set state to idle
-        else
-            {
-            triesLeft = EFalse;
-            FLOG(_L("   out of tries, resetting pkg state"));
-
-            SetStartupReason(EFotaDefault);
-            aState.iState = RFotaEngineSession::EIdle;
-            aState.iResult = KErrNotFound;
-            iDatabase->SetStateL(aState, KNullDesC8, EFDBState | EFDBResult);
-            }
-        if (!dbAlreadyOpen)
-            iDatabase->CloseAndCommitDB();
-
-        if (triesLeft)
-            {
-
-            CRepository *cenrep = CRepository::NewL(
-                    KCRUidDeviceManagementInternalKeys);
-            TInt x = cenrep->Set(KDevManClientInitiatedFwUpdateId,
-                    iPackageState.iProfileId);
-            delete cenrep;
-            FLOG(_L("Status writing the cenrep for GA: %d"), x);
-
-            iSyncMLSession.OpenL();
-
-            if (aState.iIapId <0)
-                aState.iIapId = 0;
-            
-            FLOG(_L("IAP set in the Fota profile %d is :%d"),
-                    aState.iProfileId, aState.iIapId);
-
-            FLOG(_L("From Db Using IAP: %d to send GA"), aState.iIapId);
-
-            RSyncMLDevManJob dmJob;
-            TBuf<10> genalertap, temp;
-            genalertap.Zero();
-            temp.Zero();
-            genalertap.Append(KNSmlDMJobIapPrefix);
-            temp.Num(aState.iIapId);//Decimal Iap
-            if (temp.Length() <= KNSmlHalfTransportIdLength && aState.iIapId
-                    > KErrNotFound && CheckIapExistsL(aState.iIapId))
-                {
-                genalertap.AppendFill('0', KNSmlHalfTransportIdLength
-                        - temp.Length());
-                genalertap.Append(temp);
-                TLex gavalue(genalertap);
-                TInt temp2(0);
-                gavalue.Val(temp2);
-                dmJob.CreateL(iSyncMLSession, aState.iProfileId, temp2);
-                iSyncMLAttempts = KSyncmlAttemptCount;
-                }
-            else
-                {
-                iSyncMLAttempts = 0;
-                dmJob.CreateL(iSyncMLSession, aState.iProfileId);
-                }
-
-            // If there's no iapid defined, sml will pop up connection dialog.
-            // In that case, only one connection attempt is allowed.
-            iSyncJobId = dmJob.Identifier();
-            iSyncProfile = aState.iProfileId;
-            dmJob.Close();
-            iSyncMLSession.RequestEventL(*this);
-            }
-        }
-
-    FLOG(_L("[cfotasever]   CreateDeviceManagementSessionL dms << profid %d"), aState.iProfileId);
-    }
-
-// ============================= MEMBER FUNCTIONS ============================
-
-// --------------------------------------------------------------------------
-// CFotaServer::CFotaServer()   
-// --------------------------------------------------------------------------
-//
-CFotaServer::CFotaServer(HbMainWindow& mainwindow) :
-    CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/,
-            iDatabase(0), iInitialized(EFalse), iDownloader(0), iUpdater(0),
-            iDownloadFinalizer(0), iUpdateFinalizer(0), iTimedExecuteResultFile(0), iTimedSMLSessionClose(0),
-            iAppShutter(0), iMonitor(NULL), iSyncMLAttempts(0), iSyncJobId(-1),iRetryingGASend(EFalse),
-            iNetworkAvailable(EFalse),iFullScreenDialog(NULL), iNotifParams(NULL), iNotifier(NULL),
-            iServerCanShut(EFalse), iAsyncOperation(EFalse),iDialogId (0), iConstructed(EFalse), iMainwindow(mainwindow)
-    {
-    RProcess pr;
-    TFullName fn = pr.FullName();
-    TUint prid = pr.Id();
-    FLOG(_L( "CFotaServer::CFotaServer process(id %d)%S. this 0x%x"), prid,
-            &fn, this);
-
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::DoExecuteResultFileL
-// Interprets result of update (file update.resp)
-// --------------------------------------------------------------------------
-//
-void CFotaServer::DoExecuteResultFileL()
-    {
-    FLOG(_L("CFotaServer::DoExecuteResultFileL() >>"));
-
-    if (iTimedExecuteResultFile)
-        {
-        iTimedExecuteResultFile->Cancel();
-        delete iTimedExecuteResultFile;
-        iTimedExecuteResultFile = NULL;
-        }
-    iUpdater = CFotaUpdate::NewL(this);
-    iUpdater->ExecuteUpdateResultFileL();
-    FLOG(_L("CFotaServer::DoExecuteResultFileL() <<"));
-    }
-
-// --------------------------------------------------------------------------
-// StaticDoExecuteResultFile
-// --------------------------------------------------------------------------
-//
-static TInt StaticDoExecuteResultFile(TAny *aPtr)
-    {
-    FLOG(_L("[cfotaserver] StaticDoExecuteResultFile() >>"));
-    __ASSERT_ALWAYS( aPtr, User::Panic(KFotaPanic, KErrBadHandle) );
-    CFotaServer* srv = (CFotaServer*) aPtr;
-    TRAPD( err, srv->DoExecuteResultFileL() );
-    if (err)
-        {
-        FLOG(_L("[cfotaserver] StaticDoExecuteResultFile ERROR %d"), err);
-        }
-
-    FLOG(_L("[cfotaserver] StaticDoExecuteResultFile() <<"));
-    return err;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::CFotaServer()   
-// Constructor. Can't do all constructing since fotaserver might call itself
-// recursively (via downloadmgr). 
-// --------------------------------------------------------------------------
-//
-void CFotaServer::ConstructL()
-    {
-    FLOG(_L("CFotaServer::ConstructL() >>"));
-    TBool updated(EFalse);
-    TInt err;
-    iLastFwUrl.Zero();
-    StartL(KFotaServerName);
-
-    __LEAVE_IF_ERROR(iFs.Connect());
-
-    err = iFs.CreatePrivatePath(EDriveC);
-    if (err != KErrNone && err != KErrAlreadyExists)
-        {
-        __LEAVE_IF_ERROR(err);
-        }
-    __LEAVE_IF_ERROR(iFs.SetSessionToPrivate(EDriveC));
-
-    if (!iDatabase)
-        {
-        TRAPD( err,iDatabase = CFotaDB::NewL() );
-        if (err)
-            {
-            FLOG(_L("CFotaServer::  DB creationg error %d"), err);
-            __LEAVE_IF_ERROR(err);
-            }
-        }
-
-    updated = CFotaUpdate::CheckUpdateResults(iFs);
-
-    // Update has happened, and result file is in place
-    if (updated)
-        {
-        FLOG(_L("scheduling update result file execution"));
-        ServerCanShut(EFalse);
-
-        if (iTimedExecuteResultFile)
-            {
-            iTimedExecuteResultFile->Cancel();
-            delete iTimedExecuteResultFile;
-            iTimedExecuteResultFile = NULL;
-            }
-        iTimedExecuteResultFile = CPeriodic::NewL(EPriorityNormal);
-        iTimedExecuteResultFile->Start(TTimeIntervalMicroSeconds32(
-                KDownloadFinalizerWaitTime), TTimeIntervalMicroSeconds32(
-                KDownloadFinalizerWaitTime), TCallBack(
-                StaticDoExecuteResultFile, this));
-        }
-
-    FLOG(_L("CFotaServer::ConstructL() <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::ClientAwareConstructL
-// Does rest of constructing, if not done. If parent of this fotaserver 
-// instance is another fotaserver, skip maintenance operations (since parent 
-// takes care of them). DmHOstserver triggers cleanup for states: 20,70,80
-// ,90,100 , must handle state 60 here
-// --------------------------------------------------------------------------
-void CFotaServer::ClientAwareConstructL(const RMessage2 &aMessage)
-    {
-    FLOG(_L("CFotaServer::ClientAwareConstructL >>"));
-    if (iInitialized)
-        return;
-
-    ConstructApplicationUI(EFalse);
-    CreateDiskReservation();
-
-    TFotaClient client = CFotaSrvSession::CheckClientSecureIdL(aMessage);
-
-    RArray<TInt> states;
-    TPackageState state;
-    CleanupClosePushL(states);
-    iDatabase->OpenDBL();
-    iDatabase->GetAllL(states);
-    TBool dlactive(EFalse);
-
-    dlactive = DownloaderL()->IsDownloadActive();
-
-    FLOG(_L("Download active value is:%d "), (TInt) dlactive);
-    // Loop states. 
-    for (TInt i = 0; i < states.Count(); ++i)
-        {
-        TPackageState tmp;
-
-        tmp = iDatabase->GetStateL(states[i],iLastFwUrl);
-        FLOG(_L("   1 got state id:%d state:%d result:%d"), tmp.iPkgId,
-                tmp.iState, tmp.iResult);
-
-        //Download was started earlier and was interrupted.
-        if (tmp.iState == RFotaEngineSession::EStartingUpdate || tmp.iState
-                == RFotaEngineSession::EDownloadProgressing || tmp.iState
-                == RFotaEngineSession::EDownloadProgressing)
-
-            {
-            TBool ispkgvalid = ETrue;
-            //Software version check from the time download started.
-            TRAPD(err1,ispkgvalid= CheckSWVersionL() )
-            if (err1 == KErrNone && !ispkgvalid)
-                {
-                FLOG(_L("Mismatch in software version  since the download started! Hence resetting!"));
-
-                DownloaderL()->DeleteUpdatePackageL();
-
-                tmp.iState = RFotaEngineSession::EUpdateFailed;
-                tmp.iResult = RFotaEngineSession::EResPackageMismatch;
-                iDatabase->SetStateL(tmp, KNullDesC8, EFDBState | EFDBResult);
-
-                }
-
-            }
-        // Update has been started (60)
-        // If there is no result file, means that update agent failed
-        // to run. Must get back to 50 to allow user to try again. 
-        if (tmp.iState == RFotaEngineSession::EUpdateProgressing
-                && iTimedExecuteResultFile == NULL)
-            {
-            FLOG(_L("     State EUpdateProgressing found, UA didnt run! id %d "), tmp.iPkgId);
-            
-            tmp.iState = RFotaEngineSession::EStartingUpdate;
-            iDatabase->SetStateL(tmp, KNullDesC8, EFDBState);
-            }
-
-        // These states need must trigger generic alert! (70+ )
-        if (tmp.iState >= RFotaEngineSession::EUpdateFailed && client != EDMHostServer)
-            {
-            if (iSyncMLSession.Handle() == NULL)
-                {
-                iDatabase->CloseAndCommitDB();
-                ReportFwUpdateStatusL(tmp);
-                iDatabase->OpenDBL();
-                }
-            }
-
-        if (tmp.iState == RFotaEngineSession::EDownloadComplete
-                && tmp.iResult == RFotaEngineSession::EResSuccessful && client != EDMHostServer)
-            {
-            ReportFwUpdateStatusL(tmp);
-            }
-
-        if (dlactive == EFalse) //if download is not active, EStartingDownload should be reset to EDownloadFailed
-            {
-            if (tmp.iState == RFotaEngineSession::EStartingDownload)
-                {
-                FLOG(_L("Resetting state %d to 20..."), tmp.iState);
-                tmp.iState = RFotaEngineSession::EDownloadFailed;
-                iDatabase->SetStateL(tmp, KNullDesC8, EFDBState);
-                iDatabase->CloseAndCommitDB();
-                iDatabase->OpenDBL();
-                }
-            else if (tmp.iState == RFotaEngineSession::EStartingDownload)
-                {
-                FLOG(_L("Resetting state %d to 30..."), tmp.iState);
-                tmp.iState = RFotaEngineSession::EDownloadProgressing;
-                iDatabase->SetStateL(tmp, KNullDesC8, EFDBState);
-                iDatabase->CloseAndCommitDB();
-                iDatabase->OpenDBL();
-                }
-            }
-        if (tmp.iState == RFotaEngineSession::EDownloadProgressing)
-            {
-            FLOG(_L("Firmware update state is EDownloadProgressing"));
-            //FMS will start fota server when it is appropriate to resume download.
-            }
-        else if (tmp.iState == RFotaEngineSession::EStartingUpdate)
-            {
-            FLOG(_L("Firmware update state is EStartingUpdate"));
-            //FMS will start fota server when it is appropriate to start install.
-            }
-        if (tmp.iState == RFotaEngineSession::EDownloadFailed && client != EDMHostServer)
-            {
-            FLOG(_L("Resetting state %d to 20..."), tmp.iState);
-            DownloaderL()->DeleteUpdatePackageL();
-            tmp.iResult = RFotaEngineSession::EResDLFailDueToNWIssues;
-            iDatabase->SetStateL(tmp, KNullDesC8, EFDBResult);
-            iDatabase->CloseAndCommitDB();
-            ReportFwUpdateStatusL(tmp);
-            iDatabase->OpenDBL();
-            }
-
-        }
-    iDatabase->CloseAndCommitDB();
-    CleanupStack::PopAndDestroy(&states);
-
-    iInitialized = ETrue;
-    FLOG(_L("CFotaServer::ClientAwareConstructL <<"));
-    }
-
-// --------------------------------------------------------------------------
-// StaticDoFinalizeDownload
-// Intermediate function
-// --------------------------------------------------------------------------
-static TInt StaticDoFinalizeDownload(TAny *aPtr)
-    {
-    FLOG(_L("[cfotaserver] StaticDoFinalizeDownload() >>"));
-    CFotaServer* srv = (CFotaServer*) aPtr;
-    TRAPD( err, srv->DoFinalizeDownloadL() );
-    if (err)
-        {
-        FLOG(_L("[cfotaserver] StaticDoFinalizeDownload ERROR %d"), err);
-        }
-
-    FLOG(_L("[cfotaserver] StaticDoFinalizeDownload() <<"));
-    return err;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::FinalizeDownload
-// Initialize finalization of download
-// --------------------------------------------------------------------------
-//
-void CFotaServer::FinalizeDownloadL()
-    {
-    FLOG(_L("CFotaServer::FinalizeDownload() >> state:%d result:%d"),
-            iPackageState.iState, iPackageState.iResult);
-    __ASSERT_ALWAYS( iDownloader, User::Panic(KFotaPanic, KErrBadHandle ));
-
-    if (iDownloadFinalizer)
-        {
-        iDownloadFinalizer->Cancel();
-        delete iDownloadFinalizer;
-        iDownloadFinalizer = NULL;
-        }
-    iDownloadFinalizer = CPeriodic::NewL(EPriorityMuchMore);
-
-    // Not restarting,quick finalize
-    iDownloadFinalizer->Start(TTimeIntervalMicroSeconds32(
-            KDownloadFinalizerWaitTime), TTimeIntervalMicroSeconds32(
-            KDownloadFinalizerWaitTime), TCallBack(StaticDoFinalizeDownload,
-            this));
-    FLOG(_L("CFotaServer::FinalizeDownload() <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::DoFinalizeDownloadL
-// Finalize download. Free resources
-// --------------------------------------------------------------------------
-//
-void CFotaServer::DoFinalizeDownloadL()
-    {
-
-    FLOG(_L("CFotaServer::DoFinalizeDownloadL() >> state:%d result:%d"),
-            iPackageState.iState, iPackageState.iResult);
-    __ASSERT_ALWAYS( iDownloader, User::Panic(KFotaPanic, KErrBadHandle ));
-
-
-    if (iDownloadFinalizer)
-        {
-        iDownloadFinalizer->Cancel();
-        delete iDownloadFinalizer;
-        iDownloadFinalizer = NULL;
-        }
-
-    // Set downloader's ending state to DB
-    iDatabase->OpenDBL();
-    iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBState | EFDBResult);
-    iDatabase->CloseAndCommitDB();
-
-    if (iPackageState.iResult != RFotaEngineSession::EResDLFailDueToDeviceOOM)
-        {
-        FLOG(_L("Adjusting the reserved memory..."));
-        DownloaderL()->CreateDiskReservation();
-        }
-
-    // Initiate update 
-    if (iPackageState.iState == RFotaEngineSession::EDownloadComplete
-            && iPackageState.iUpdateLtr)
-        {
-        TRAP_IGNORE(TryUpdateL(EOMADMAppUi));
-
-        }
-    else if (iPackageState.iState == RFotaEngineSession::EDownloadProgressing)
-        {
-        FLOG(_L("Download has paused due to an error. Invoking FMS..."));
-        if (iFullScreenDialog)
-            {
-            iFullScreenDialog->Close();
-            iFullScreenDialog->deleteLater();
-            iFullScreenDialog = NULL;
-            }
-        SetStartupReason(EFotaDownloadInterrupted);
-        InvokeFmsL();
-        StopServerWhenPossible();
-        SetServerActive(EFalse);
-        iAsyncOperation = EFalse;
-        }
-    else
-        {
-        if (iFullScreenDialog)
-            {
-            iFullScreenDialog->Close();
-            iFullScreenDialog->deleteLater();
-            iFullScreenDialog = NULL;
-            }
-        ConstructApplicationUI(EFalse);
-        ReportFwUpdateStatusL(iPackageState);
-        SetServerActive(EFalse);
-        iAsyncOperation = EFalse;
-        }
-
-    FLOG(_L("CFotaServer::DoFinalizeDownloadL() <<"));
-    }
-
-// --------------------------------------------------------------------------
-// StaticDoCloseSMLSession 
-// Intermediate function
-// --------------------------------------------------------------------------
-static TInt StaticDoCloseSMLSession(TAny *aPtr)
-    {
-    FLOG(_L("[cfotaserver] StaticDoCloseSMLSession() >>"));
-    CFotaServer* srv = (CFotaServer*) aPtr;
-    TRAPD( err, srv->DoCloseSMLSessionL() );
-    if (err)
-        {
-        FLOG(_L("[cfotaserver] StaticDoCloseSMLSession ERROR %d"), err);
-        }
-
-    FLOG(_L("[cfotaserver] StaticDoCloseSMLSession() <<"));
-    return err;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::DoCloseSMLSessionL
-// Close syncml session, or resync
-// --------------------------------------------------------------------------
-//
-void CFotaServer::DoCloseSMLSessionL()
-    {
-    FLOG(_L("CFotaServer::DoCloseSMLSessionL() >>"));
-
-    // Must still try to sync
-    if (iSyncMLAttempts > 0)
-        {
-        FLOG(_L("   trycount %d => creating new job"), iSyncMLAttempts);
-        RSyncMLDevManJob dmJob;
-        if (iPackageState.iIapId > KErrNotFound)
-            {
-            FLOG(_L("DoCloseSMLSessionL new job uses iap from fotadb %d"),
-                    iPackageState.iIapId);
-            dmJob.CreateL(iSyncMLSession, iSyncProfile, iPackageState.iIapId);
-            }
-        else
-            {
-            FLOG(_L("DoCloseSMLSessionL new job uses iap from profile"));
-            dmJob.CreateL(iSyncMLSession, iSyncProfile);
-            }
-        iSyncMLAttempts--;
-        iSyncJobId = dmJob.Identifier();
-        dmJob.Close();
-        }
-    else
-    // We ran out of attempts, close sml
-        {
-        if (iSyncMLSession.Handle())
-            {
-            FLOG(_L("   Closing syncml session"));
-            iSyncMLSession.CancelEvent();
-            iSyncMLSession.Close();
-            }
-        }
-
-    if (iTimedSMLSessionClose)
-        {
-        FLOG(_L("   closing smlsession timer"));
-        iTimedSMLSessionClose->Cancel();
-        delete iTimedSMLSessionClose;
-        iTimedSMLSessionClose = NULL;
-        }
-
-    FLOG(_L("CFotaServer::DoCloseSMLSessionL() <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::TryResumeDownloadL 
-// Tries to resume the download operation
-// --------------------------------------------------------------------------
-//
-void CFotaServer::TryResumeDownloadL(TFotaClient aClient, TBool aSilentDl)
-    {
-    FLOG(_L("CFotaServer::TryResumeDownloadL, client = %d aSilent = %d  >>"),
-            (TInt) aClient, aSilentDl);
-    //Check whether there is a paused resume actually.
-    iAsyncOperation = ETrue;
-    SetServerActive(ETrue);
-    WakeupServer();
-
-    if (DownloaderL()->IsDownloadActive())
-        {
-        FLOG(_L("Another download is already active, hence returning..."));
-        __LEAVE_IF_ERROR (KErrAlreadyExists);
-        }
-
-    if (iPackageState.iPkgId == KErrNotFound)
-        iPackageState = GetStateL(-1); //Gets the state of the current/last fota download
-
-    FLOG(_L("Session type is =%d  "), iPackageState.iSessionType);
-
-    if (iPackageState.iState != RFotaEngineSession::EDownloadProgressing)
-        {
-        FLOG(_L("There are no paused downloads currently; hence leaving with KErrNotFound..."));
-        SetServerActive(EFalse);
-        __LEAVE_IF_ERROR (KErrNotFound);
-        }
-
-    //Resume download now
-
-    iPackageState.iSessionType = aSilentDl;
-
-    if (aSilentDl && iPackageState.iResult
-            == RFotaEngineSession::EResUserCancelled)
-        {
-        //If user has paused download earlier, then resume should be non-silent.
-        FLOG(_L("Converting to non-silent download as user had paused it earlier!"));
-        iPackageState.iSessionType = EFalse;
-        }
-    
-    TRAP_IGNORE(SetIapToUseL());
-    FLOG(_L("Using IAP = %d for the download"), iPackageState.iIapId);
-    
-    FLOG(_L("Session type = %d"), iPackageState.iSessionType);
-    iDatabase->OpenDBL();
-    iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBIapId||EFDBSessionType);
-    iDatabase->CloseAndCommitDB();
-
-    if (iPackageState.iSessionType || aClient == EOMADMAppUi)
-        {
-        ConstructApplicationUI(EFalse);
-        DownloaderL()->TryResumeDownloadL();
-        }
-    else
-        {
-        ShowDialogL(EFwUpdResumeDownload);
-        }
-
-    FLOG(_L("CFotaServer::TryResumeDownloadL  <<"));
-    }
-
-void CFotaServer::PauseDownloadL()
-    {
-
-    if (DownloaderL()->IsDownloadActive())
-        {
-        DownloaderL()->PauseDownloadL();
-        }
-    else
-        {
-        FLOG(_L("No download is active. Hence leaving with KErrNotFound"));
-        __LEAVE_IF_ERROR(KErrNotFound);
-        }
-    }
-// --------------------------------------------------------------------------
-// CFotaServer::InvokeFmsL 
-// Starts Fota Monitory Service with relevant parameters for monitoring.
-// --------------------------------------------------------------------------
-//
-void CFotaServer::InvokeFmsL()
-    {
-    FLOG(_L("CFotaServer::InvokeFmsL  >>"));
-    //Collect all information needed to invoke FMS.
-    CancelFmsL();
-
-    FLOG(_L("State as recorded in fota db:"));
-    FLOG(_L("iPkgId = %d"), iPackageState.iPkgId);
-    FLOG(_L("iProfileId = %d"), iPackageState.iProfileId);
-    FLOG(_L("iPkgName = %S"), &iPackageState.iPkgName);
-    FLOG(_L("iPkgVersion = %S"), &iPackageState.iPkgVersion);
-    FLOG(_L("iSendAlert = %d"), iPackageState.iSendAlert);
-    FLOG(_L("iIapId = %d"), iPackageState.iIapId);
-    FLOG(_L("iPkgSize = %d"), iPackageState.iPkgSize);
-    FLOG(_L("iSessionType = %d"), iPackageState.iSessionType);
-    FLOG(_L("iState = %d"), iPackageState.iState);
-    FLOG(_L("iResult = %d"), iPackageState.iResult);
-
-    if (iPackageState.iState == RFotaEngineSession::EDownloadProgressing)
-        {
-        //Finding the reason for download interrupt
-        TFmsIpcCommands reason(EDLGeneralInterrupt); // 13
-
-        switch (iPackageState.iResult)
-            {
-            case RFotaEngineSession::EResUserCancelled:
-                {
-                reason = EDLUserInterrupt; //10
-                break;
-                }
-            case RFotaEngineSession::EResDLFailDueToNWIssues:
-                {
-                reason = EDLNetworkInterrupt; //11
-                break;
-                }
-            case RFotaEngineSession::EResDLFailDueToDeviceOOM:
-                {
-                reason = EDLMemoryInterrupt; //12
-                break;
-                }
-            default:
-                {
-                //reason is already EGeneralInterrupt
-                break;
-                }
-            }
-
-        //Finding the drive number
-        TBuf<KMaxPath> path;
-        path.Zero();
-        DownloaderL()->GetUpdatePackageLocation(path);
-
-        TInt drive(EDriveC); //Default drive is Phone Memory
-        TParse p;
-        if (path.Length() && !p.Set(path, NULL, NULL))
-            {
-            TDriveName drivename(p.Drive());
-            TDriveUnit driveunit(drivename);
-            if (iFs.IsValidDrive((TInt) driveunit)) //some crash here
-                drive = driveunit;
-            }
-        else
-            {
-            FLOG(_L("Error while parsing for drive number! defaulting to Phone Memory (C)"));
-            }
-
-        TInt dlsize = DownloaderL()->GetDownloadPackageSize();
-
-        TInt neededsize = iPackageState.iPkgSize - dlsize;
-
-        if (neededsize < 0)
-            neededsize = 0;
-
-        FLOG(_L("Launching FMS with params... reason = %d, iapid = %d, drive = %d, neededsize = %d"),
-                reason, iPackageState.iIapId, drive, neededsize);
-        iFMSClient.OpenL();
-        iFMSClient.NotifyForResumeL(reason, iPackageState.iIapId,
-                (TDriveNumber) drive, neededsize);
-        iFMSClient.Close();
-        }
-    else if (iPackageState.iState == RFotaEngineSession::EStartingUpdate)
-        {
-        //Finding the reason for update interrupt
-        TFmsIpcCommands reason(ENoInterrupt);
-
-        switch (iPackageState.iResult)
-            {
-            case RFotaEngineSession::EResUserCancelled:
-                {
-                reason = EDLUserInterrupt;
-                }
-                break;
-            case RFotaEngineSession::EResLowBattery:
-                {
-                reason = EUpdMonitorbattery;
-                }
-            default:
-                {
-                break;
-                }
-            }
-        FLOG(_L("Launching FMS with params... reason = %d, iapid = %d"), reason, iPackageState.iIapId);
-        iFMSClient.OpenL();
-        iFMSClient.NotifyForUpdateL(reason);
-        iFMSClient.Close();
-
-        }
-    FLOG(_L("CFotaServer::InvokeFmsL  <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::CancelFmsL 
-// Cancels any outstanding monitoring requests in Fota Monitory Service
-// --------------------------------------------------------------------------
-//
-void CFotaServer::CancelFmsL()
-    {
-    FLOG(_L("CFotaServer::CancelFmsL  >>"));
-
-    iFMSClient.OpenL();
-    iFMSClient.Cancel();
-    iFMSClient.Close();
-
-    FLOG(_L("CFotaServer::CancelFmsL  <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::SetStartupReason 
-// Sets the startup reason for Fota. This is used in Fota Startup pluggin.
-// --------------------------------------------------------------------------
-//
-void CFotaServer::SetStartupReason(TInt aReason)
-    {
-    FLOG(_L("CFotaServer::SetStartupReason, aReason = %d  >>"), aReason);
-
-    CRepository* centrep = NULL;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (err == KErrNone)
-        {
-        err = centrep->Set(KFotaUpdateState, aReason);
-        }
-    delete centrep;
-    centrep = NULL;
-
-    FLOG(_L("CFotaServer::SetStartupReason, err = %d  <<"), err);
-    }
-
-void CFotaServer::SetUpdateRequester(TFotaClient aRequester)
-    {
-    FLOG(_L("CFotaServer::SetUpdateRequester, requester = %d  >>"),
-            aRequester);
-
-    CRepository* centrep = NULL;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) )
-    if (err == KErrNone)
-        {
-        err = centrep->Set(KUpdateRequesterUid, (TInt) aRequester);
-        }
-    delete centrep;
-    centrep = NULL;
-
-    FLOG(_L("CFotaServer::SetUpdateRequester, err = %d  <<"), err);
-    }
-
-TFotaClient CFotaServer::GetUpdateRequester()
-    {
-    FLOG(_L("CFotaServer::GetUpdateRequester >>"));
-
-    TInt ret(EUnknown);
-
-    CRepository* centrep = NULL;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (err == KErrNone)
-        {
-        err = centrep->Get(KUpdateRequesterUid, ret);
-        }
-    delete centrep;
-    centrep = NULL;
-
-    FLOG(_L("CFotaServer::GetUpdateRequester, requester = %d, err = %d  <<"),
-            ret, err);
-
-    return (TFotaClient) ret;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::~CFotaServer()
-// Frees database, download, chunk, filewriter, etc resources
-// --------------------------------------------------------------------------
-//
-CFotaServer::~CFotaServer()
-    {
-    FLOG(_L("CFotaServer::~CFotaServer  >>"));
-
-    if (iDatabase)
-        {
-        iDatabase->CloseAndCommitDB();
-        delete iDatabase;
-        iDatabase = NULL;
-        }
-
-    if (iUpdater)
-        {
-        delete iUpdater;
-        iUpdater = NULL;
-        }
-
-    if (iDownloadFinalizer)
-        {
-        iDownloadFinalizer->Cancel();
-        delete iDownloadFinalizer;
-        iDownloadFinalizer = NULL;
-        }
-
-    if (iUpdateFinalizer)
-        {
-        iUpdateFinalizer->Cancel();
-        delete iUpdateFinalizer;
-        iUpdateFinalizer = NULL;
-        }
-
-    if (iTimedExecuteResultFile)
-        {
-        iTimedExecuteResultFile->Cancel();
-        delete iTimedExecuteResultFile;
-        iTimedExecuteResultFile = NULL;
-        }
-
-    if (iTimedSMLSessionClose)
-        {
-        iTimedSMLSessionClose->Cancel();
-        delete iTimedSMLSessionClose;
-        iTimedSMLSessionClose = NULL;
-        }
-
-    if (iFs.Handle())
-        iFs.Close();
-
-    if (iSyncMLSession.Handle())
-        iSyncMLSession.Close();
-
-    if (iMonitor)
-        {
-        delete iMonitor;
-        iMonitor = NULL;
-        }
-
-    if (iFMSClient.Handle())
-        iFMSClient.Close();
-
-    if (iDownloader)
-        {
-        delete iDownloader;
-        iDownloader = NULL;
-        }
-
-    if (iFullScreenDialog)
-        {
-        iFullScreenDialog->deleteLater();
-        }
-
-		/*
-    if (iNotifParams)
-        {
-        delete iNotifParams;
-        iNotifParams = NULL;
-        }
-
-    if (iNotifier)
-        {
-        delete iNotifier;
-        iNotifier = NULL;
-        }*/
-
-    FLOG(_L("CFotaServer::~CFotaServer  <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaServer::DeletePackageL 
-// Deletes update package from db
-// ---------------------------------------------------------------------------
-void CFotaServer::DeletePackageL(const TInt aPkgId)
-    {
-    FLOG(_L("CFotaServer::DeletePackageL  >> id %d"), aPkgId);
-
-    DownloaderL()->DeleteUpdatePackageL();
-
-    FLOG(_L("CFotaServer::DeletePackageL  <<"));
-    }
-
-// ---------------------------------------------------------------------------
-//  CFotaServer::DownloadL
-//  Create package downloader and download update package.
-// ---------------------------------------------------------------------------
-void CFotaServer::DownloadL(TDownloadIPCParams aParams,
-        const TDesC8& aPkgURL, TFotaClient aRequester, TBool aSilent,
-        TBool aUpdateLtr)
-    {
-    FLOG(_L("[FotaServer]  Download >>"));
-    iAsyncOperation = ETrue;
-    SetServerActive(ETrue);
-    WakeupServer();
-
-
-    if (DownloaderL()->IsDownloadActive())
-        {
-        FLOG(_L("One download is already active, hence leaving!"));
-        __LEAVE_IF_ERROR(KErrAlreadyExists);
-        }
-
-    TBuf<KSysVersionInfoTextLength> temp;
-    if (GetSoftwareVersion(temp) == KErrNone)
-        {
-
-        RFileWriteStream wstr;
-        CleanupClosePushL(wstr);
-        TInt err1 = wstr.Replace(iFs, KSWversionFile, EFileWrite);
-        if (err1 == KErrNone)
-            {
-            HBufC16* swv;
-            swv = HBufC16::NewLC(temp.Length());
-            swv->Des().Copy(temp);
-            wstr.WriteInt16L(swv->Des().Length()); // length  
-            wstr.WriteL(swv->Des());
-            wstr.WriteInt16L(0);
-            CleanupStack::PopAndDestroy(swv);
-
-            }
-
-        CleanupStack::PopAndDestroy(&wstr); // wstr      
-        }
-
-    iPackageState = aParams;
-    iPackageState.iUpdateLtr = aUpdateLtr;
-    iPackageState.iSessionType = aSilent;
-    iPackageState.iIapId = -2; //Signifies default connection to use.
-    TRAP_IGNORE(SetIapToUseL());
-    FLOG(_L("Using IAP = %d for the download"), iPackageState.iIapId);
-
-    //First entry to fota database
-    FLOG(_L("DownloadManagerClient::DownloadL, State 1 - writing to database"));
-
-    iDatabase->OpenDBL();
-    iDatabase->SetStateL(iPackageState, aPkgURL, EFDBState | EFDBResult
-            | EFDBProfileId | EFDBPkgUrl | EFDBPkgName | EFDBVersion
-            | EFDBUpdateLtr | EFDBSessionType | EFDBIapId);
-    iDatabase->CloseAndCommitDB();
-
-    //Cancel any outstanding requests to monitor.
-    CancelFmsL();
-    SetUpdateRequester(aRequester);
-    ResetCounters();
-    
-    DownloaderL()->DownloadL(aPkgURL);
-
-
-    FLOG(_L("[FotaServer]  Download <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::UpdateL
-// Start update 
-// --------------------------------------------------------------------------
-//
-void CFotaServer::TryUpdateL(TFotaClient aClient)
-    {
-    FLOG(_L("CFotaServer::TryUpdateL, client = %d  >>"), (TInt) aClient);
-    iAsyncOperation = ETrue;
-    SetServerActive(ETrue);
-    WakeupServer();
-
-    TBool isPkgvalid(ETrue);
-    isPkgvalid = CheckSWVersionL();
-
-    if (!isPkgvalid)
-        {
-        FLOG( _L("Fota Update:: Firmware version mismatch! Resetting fota state"));
-
-        ResetFotaStateToFailL();
-        SetServerActive(EFalse);
-        __LEAVE_IF_ERROR(KErrNotFound);
-        }
-    
-    if (iPackageState.iPkgId == KErrNotFound)
-        iPackageState = GetStateL(-1);
-    
-    iPackageState.iState = RFotaEngineSession::EStartingUpdate;
-    iPackageState.iResult = KErrNotFound;
-    iPackageState.iSendAlert = EFalse;
-
-    iDatabase->OpenDBL();
-    iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBState | EFDBResult);
-    iDatabase->CloseAndCommitDB();
-
-    SetStartupReason(EFotaUpdateInterrupted);
-
-    if (IsDeviceDriveBusyL())
-        {
-        FLOG(
-                _L("Fota Update:: Device encryption is onging, hence aborting update!"));
-        ShowDialogL(EFwUpdDeviceBusy);
-        
-        __LEAVE_IF_ERROR(KErrNotReady);
-        }
-
-    FLOG(_L("Fota Update:: Firmware version check okie"));
-
-    if (!iUpdater)
-        {
-        iUpdater = CFotaUpdate::NewL(this);
-        }
-
-    if (aClient != EFMSServer)
-        {
-        //Check any active phone call
-        TInt callactive(EFalse);
-        iFMSClient.OpenL();
-        TInt err1 = iFMSClient.IsPhoneCallActive(callactive);
-
-        if (callactive)
-            {
-            FLOG(_L("Fota Update:: Active call found; differing showing the install dialog!"));
-
-            iPackageState.iResult = RFotaEngineSession::EResUpdateFailed;
-            iDatabase->OpenDBL();
-            iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBResult);
-            iDatabase->CloseAndCommitDB();
-
-            iFMSClient.NotifyForUpdateL(EUpdMonitorPhoneCallEnd);
-            iFMSClient.Close();
-            SetServerActive(EFalse);
-            __LEAVE_IF_ERROR(KErrNotReady);
-            }
-        iFMSClient.Close();
-
-        FLOG(_L("Fota Update:: Active phone call check okie "));
-
-        TBool batt = iUpdater->CheckBatteryL();
-
-#if defined (__WINS__)
-        batt = ETrue;
-#endif
-
-        if (aClient == EOMADMAppUi || aClient == EDMHostServer)
-            {
-            FLOG(_L("Device Updates/Adapter. Show Full screen dialog."));
-            LoopBatteryCheckL(batt);
-            }
-        else
-            {
-            if (batt)
-                {
-                FLOG(_L("Not Device Updates. Show device dialog."));
-
-                ShowDialogL(EFwUpdResumeUpdate);
-                }
-            else
-                {
-                FLOG(_L("Not Device Updates. Leave and monitor for battery."));
-
-                iPackageState.iState = RFotaEngineSession::EStartingUpdate;
-                iPackageState.iResult = RFotaEngineSession::EResLowBattery;
-
-                iDatabase->OpenDBL();
-                iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBState
-                        | EFDBResult);
-                iDatabase->CloseAndCommitDB();
-
-                InvokeFmsL();
-
-                __LEAVE_IF_ERROR(KErrBadPower);
-                }
-            }
-        }
-    else
-        {
-        ShowDialogL(EFwUpdResumeUpdate);
-        }
-    FLOG(_L("CFotaServer::TryUpdateL  <<"));
-    }
-
-void CFotaServer::LoopBatteryCheckL(TBool aBatteryLevel)
-    {
-    FLOG(_L("CFotaServer::LoopBatteryCheckL, level = %d"), aBatteryLevel);
-    if (aBatteryLevel)
-        {
-        FLOG(_L("Fota Update:: Battery check success;  monitoring battery until update"));
-        ShowFullScreenDialog(EHbFotaUpdate);
-        ConstructApplicationUI(ETrue);
-        iUpdater->MonitorBatteryChargeLevel();
-        }
-    else
-        {
-        FLOG(_L("Fota Update:: Battery check failed;  monitoring for charger connection"));
-
-        iPackageState.iState = RFotaEngineSession::EStartingUpdate;
-        iPackageState.iResult = RFotaEngineSession::EResLowBattery;
-        iDatabase->OpenDBL();
-        iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBResult);
-        iDatabase->CloseAndCommitDB();
-
-        ShowFullScreenDialog(EHbFotaLowBattery);
-        ConstructApplicationUI(ETrue);
-        iUpdater->MonitorBatteryChargingStatus();
-        }
-    FLOG(_L("CFotaServer::LoopBatteryCheckL <<"));
-    }
-
-
-void CFotaServer::FinalizeUpdate()
-    {
-    FLOG(_L("CFotaServer::FinalizeUpdate >>"));
-    
-    if (iPackageState.iResult == RFotaEngineSession::EResLowBattery)
-        {
-        TRAP_IGNORE(InvokeFmsL());
-        }
-    SetServerActive(EFalse);
-    ServerCanShut(ETrue);
-    StopServerWhenPossible();
-    FLOG(_L("CFotaServer::FinalizeUpdate <<"));
-    }
-
-
-FotaFullscreenDialog* CFotaServer::FullScreenDialog()
-    {
-    return iFullScreenDialog;
-    }
-
-void CFotaServer::HandleFullScreenDialogResponse(TInt aResponse)
-    {
-    FLOG(_L("CFotaServer::HandleFullScreenDialogResponse, response = %d >>"),
-            aResponse);
-
-    TBool active (EFalse);
-    TRAP_IGNORE(active = DownloaderL()->IsDownloadActive());
-    CEikonEnv* env = CEikonEnv::Static();
-
-    if (iPackageState.iState == RFotaEngineSession::EDownloadProgressing)
-        {
-
-        //swapProcess(EFalse);
-        ConstructApplicationUI(EFalse);
-        if (aResponse == EHbLSK)
-            {
-            //HIDE is pressed
-            FLOG(_L("HIDE is pressed"));
-            if (env)
-                {
-                CApaWindowGroupName* wgName (NULL);
-                TRAP_IGNORE( wgName = CApaWindowGroupName::NewL(env->WsSession()));
-                if (wgName)
-                    {
-                    wgName->SetHidden(EFalse); // hides us from FSW and protects us from OOM FW etc.
-                    delete wgName;
-                    }
-                }
-            }
-        else
-            {
-            DecrementUserPostponeCount();
-            if (active)
-                {
-                FLOG(_L("CONTINUE LATER is pressed on update dialog"));
-                /*
-                if (env)
-                    {
-                    CApaWindowGroupName* wgName;
-                    TRAP_IGNORE(wgName = CApaWindowGroupName::NewL(env->WsSession()));
-                    if (wgName)
-                        {
-                        wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc.
-                        delete wgName;
-                        }
-                    }*/
-                TRAP_IGNORE(PauseDownloadL());
-                }
-            }
-        }
-    else if (iPackageState.iState == RFotaEngineSession::EDownloadComplete
-            || iPackageState.iState == RFotaEngineSession::EStartingUpdate)
-        {
-        if (aResponse == EHbLSK)
-            {
-            FLOG(_L("CONTINUE is pressed/Timeout on update dialog"));
-            iPackageState.iResult = KErrNotFound;
-            TRAPD(err,
-                    iDatabase->OpenDBL();
-                    iDatabase->SetStateL( iPackageState ,KNullDesC8,EFDBResult );
-                    iDatabase->CloseAndCommitDB();
-            );
-            FLOG(_L("Updating the fota database... err = %d"), err);
-
-            TInt callactive(EFalse);
-            
-            TRAP(err, 
-            iFMSClient.OpenL();
-            TInt err1 = iFMSClient.IsPhoneCallActive(callactive);
-            iFMSClient.Close();
-            );
-            
-            if (callactive)
-                {
-                FLOG(_L("Fota Update:: Active call found; differing showing the install dialog!"));
-
-                iPackageState.iResult = RFotaEngineSession::EResUpdateFailed;
-                TRAP(err, 
-                    iDatabase->OpenDBL();
-                    iDatabase->SetStateL(iPackageState, KNullDesC8, EFDBResult);
-                    iDatabase->CloseAndCommitDB();
-                    );
-                
-                TRAP(err,
-                    iFMSClient.OpenL();
-                    iFMSClient.NotifyForUpdateL(EUpdMonitorPhoneCallEnd);
-                    iFMSClient.Close();
-                    );
-                
-                FLOG(_L("Deleting the fullscreen dialog..."));
-                iFullScreenDialog->deleteLater();
-                iFullScreenDialog = NULL;
-                SetServerActive(EFalse);
-                return;
-                }
-
-            TRAP(err, iUpdater->StartUpdateL( iPackageState ));
-            FLOG(_L("Starting update, err = %d"), err);
-            }
-        else
-            {
-            FLOG(_L("CONTINUE LATER is pressed on update dialog"));
-            ConstructApplicationUI(EFalse);
-
-            iUpdater->CancelMonitor();
-
-            if (iFullScreenDialog->IsLSKEnabled())
-                {
-                DecrementUserPostponeCount();
-                }
-
-            iPackageState.iState = RFotaEngineSession::EStartingUpdate;
-            iPackageState.iResult = RFotaEngineSession::EResUserCancelled;
-            TRAPD(err,
-                    iDatabase->OpenDBL();
-                    iDatabase->SetStateL( iPackageState ,KNullDesC8,EFDBState|EFDBResult );
-                    iDatabase->CloseAndCommitDB();
-            );
-            FLOG(_L("Updating the fota database... err = %d"), err);
-
-            SetStartupReason(EFotaUpdateInterrupted);
-            SetServerActive(EFalse);
-            TRAP(err, InvokeFmsL());
-            StopServerWhenPossible();
-
-            iAsyncOperation = EFalse;
-            FLOG(_L("Invoking fms, err = %d"), err);
-            }
-        }
-    FLOG(_L("CFotaServer::HandleFullScreenDialogResponse <<"));
-    }
-
-void CFotaServer::UpdateBatteryLowInfo(TBool aValue)
-    {
-    FLOG(_L("CFotaServer::UpdateBatteryLowInfo >>"));
-
-    if (aValue)
-        {
-        FLOG(
-                _L("Fota Update:: Battery has become low; disabling installation"));
-        iPackageState.iResult = RFotaEngineSession::EResUpdateFailed;
-        TRAP_IGNORE(
-                iDatabase->OpenDBL();
-                iDatabase->SetStateL( iPackageState ,KNullDesC8,EFDBResult );
-                iDatabase->CloseAndCommitDB();
-            );
-
-        ShowFullScreenDialog(EHbFotaLowBattery);
-        }
-    else
-        {
-        ShowFullScreenDialog(EHbFotaUpdate);
-        FLOG(
-                _L("Fota Update:: Battery is still sufficient; enabling installation"));
-        }
-    FLOG(_L("CFotaServer::UpdateBatteryLowInfo <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::CheckSWVersionL
-// Check the s/w version
-// --------------------------------------------------------------------------
-//
-
-TBool CFotaServer::CheckSWVersionL()
-
-    {
-    FLOG(_L("CFotaServer::CheckSWVersionL  >>"));
-    TBuf<KSysVersionInfoTextLength> temp;
-    HBufC16* message16 = NULL;
-    TBool isPkgvalid(ETrue);
-    if (GetSoftwareVersion(temp) == KErrNone)
-        {
-
-        //TBuf<KSysVersionInfoTextLength>swvfromfile;
-        //Fetch the software version ...
-        RFileReadStream rstr;
-        TInt err1 = rstr.Open(iFs, KSWversionFile, EFileRead);
-        if (err1 == KErrNone)
-            {
-            CleanupClosePushL(rstr);
-            TInt msglen = rstr.ReadInt16L();
-            if (msglen > 0)
-                {
-                message16 = HBufC16::NewLC(msglen + 1);
-                TPtr16 tempswv = message16->Des();
-                TRAPD(err, rstr.ReadL(tempswv,msglen ));
-
-                if (err != KErrNone && err != KErrEof)
-                    {
-                    FLOG(_L("  file read err %d"), err); //User::Leave( err ); 
-                    msglen = 0;
-                    }
-                else
-                    {
-                    FLOG(_L("  msglen  %d"), msglen);
-                    TPtr swvfromfile = message16->Des();
-
-                    FLOG(_L("  swvfromfile=%S"), message16);
-
-                    //Compare the software versions to decide whether the download is still valid or not.
-                    if (msglen != temp.Length() || temp.Compare(tempswv)
-                            != KErrNone)
-                        {
-                        isPkgvalid = EFalse;
-                        FLOG(_L("CFotaServer::software not matching  >>"));
-
-                        }
-                    }
-
-                CleanupStack::PopAndDestroy(message16);
-                }
-            CleanupStack::PopAndDestroy(&rstr);
-
-            }
-
-        }
-
-    FLOG(_L("CFotaServer::CheckSWVersionL  <<"));
-    return isPkgvalid;
-
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::ScheduledUpdateL
-// Update, triggered by scheduler
-// --------------------------------------------------------------------------
-void CFotaServer::ScheduledUpdateL(TFotaScheduledUpdate aUpdate,
-        TFotaClient aClient)
-    {
-    FLOG(_L("CFotaServer::ScheduledUpdateL >>"));
-
-    iAsyncOperation = ETrue;
-    WakeupServer();
-
-    TPackageState s = GetStateL(aUpdate.iPkgId);
-
-    if (s.iState == RFotaEngineSession::EDownloadProgressing)
-        {
-        FLOG(_L("Trying to resume the download in non-silent mode"));
-        iPackageState = s;
-        TryResumeDownloadL(aClient, EFalse);
-        }
-    else if (s.iState == RFotaEngineSession::EStartingUpdate)
-        {
-        // If update is in progress, do not start new one (multiple popups)
-        if (iUpdater)
-            {
-            FLOG(_L("\t\tupdate in progress"));
-            return;
-            }
-        else
-            {
-            FLOG(_L("Trying to resume the installation in non-silent mode"));
-            iPackageState = s;
-            TryUpdateL(aClient);
-            }
-        }
-    FLOG(_L("CFotaServer::ScheduledUpdateL <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::DoConnect
-// From CServer2. Initializes class members. 
-// --------------------------------------------------------------------------
-void CFotaServer::DoConnect(const RMessage2 &aMessage)
-    {
-    FLOG(_L("CFotaServer::DoConnect(const RMessage2 &aMessage) >>"));
-
-    // In case shutdown is in progress, cancel it.
-    if (iInitialized == EFalse)
-        {
-        TRAPD( err, ClientAwareConstructL( aMessage ) );
-        if (err)
-            FLOG(_L("   ClientAwareConstructL err %d"), err);
-        }
-    CServer2::DoConnect(aMessage);
-    FLOG(_L("CFotaServer::DoConnect(const RMessage2 &aMessage) <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::GetStateL
-// Get state of a download package
-// --------------------------------------------------------------------------
-TPackageState CFotaServer::GetStateL(const TInt aPkgId)
-    {
-    FLOG(_L("CFotaServer::GetStateL >>"));
-    TPackageState s = RFotaEngineSession::EIdle;
-
-    if (aPkgId >= 0) // Used by all clients
-        {
-        iDatabase->OpenDBL();
-        s = iDatabase->GetStateL(aPkgId,iLastFwUrl);
-        iDatabase->CloseAndCommitDB();
-        }
-    else if (aPkgId == -1) //Used by DM UI to get the state of last fota operation
-        {
-        //Read status from fotastate last entry
-
-        iDatabase->OpenDBL();
-
-        RArray<TInt> states;
-        CleanupClosePushL(states);
-        iDatabase->GetAllL(states);
-        // Loop states. 
-        for (TInt i = 0; i < states.Count(); ++i)
-            {
-            TPackageState tmp;
-            TBuf8<KMaxFileName> tmpurl;
-            tmp = iDatabase->GetStateL(states[i], tmpurl);
-            FLOG(_L("***Package: %d, State = %d"), states[i],
-                    (TInt) tmp.iState);
-            if (tmp.iState != RFotaEngineSession::EIdle)
-                {
-                s = tmp;
-                iLastFwUrl.Copy(tmpurl);
-                }
-            }
-        FLOG(_L("Status of current operation is %d"), (TInt) s.iState);
-
-        CleanupStack::PopAndDestroy(&states);
-        iDatabase->CloseAndCommitDB();
-        }
-    FLOG(_L("CFotaServer::GetStateL <<"));
-    return s;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::OnSyncMLSessionEvent
-// --------------------------------------------------------------------------
-//
-void CFotaServer::OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier,
-        TInt aError, TInt /*aAdditionalData*/)
-    {
-    FLOG(_L("CFotaServer::OnSyncMLSessionEvent >>"));
-
-    if (iSyncJobId != aIdentifier)
-        return;
-    FLOG(_L("CFotaServer::OnSyncMLSessionEvent %d err:%d (id %d==%d?)"),
-            aEvent, aError, aIdentifier, iSyncJobId);
-    TBool end(EFalse);
-
-    if (iSyncJobId == aIdentifier)
-        {
-
-        switch (aEvent)
-            {
-            //EJobStart = 0
-            case EJobStartFailed: // 1 E
-                {
-                end = ETrue;
-                }
-                break;
-            case EJobStop: // 2 E
-                {
-                end = ETrue;
-                // Sync ok => do not try anymore
-                if (aError == KErrNone)
-                    {
-                    iSyncMLAttempts = 0;
-                    }
-                }
-                break;
-            case EJobRejected: // 3 E
-                {
-                end = ETrue;
-                }
-                break;
-                // ETransportTimeout , // 7
-            default:
-                {
-                }
-                break;
-            }
-        }
-
-    if (end && iSyncMLAttempts == 0)
-        {
-        if (iTimedSMLSessionClose)
-            {
-            FLOG(_L("   closing smlsession timer"));
-            iTimedSMLSessionClose->Cancel();
-            delete iTimedSMLSessionClose;
-            iTimedSMLSessionClose = NULL;
-            }
-        StopServerWhenPossible();
-        
-        }
-    else if (end)
-        {
-
-        if (iTimedSMLSessionClose)
-            {
-            FLOG(_L("   closing smlsession timer"));
-            iTimedSMLSessionClose->Cancel();
-            delete iTimedSMLSessionClose;
-            iTimedSMLSessionClose = NULL;
-            }
-        
-        FLOG(_L("   starting smlsession timer"));
-        TRAPD( err2, iTimedSMLSessionClose = CPeriodic::NewL (EPriorityNormal) );
-        if (!err2)
-            {
-            iTimedSMLSessionClose->Start(TTimeIntervalMicroSeconds32(
-                    KSyncmlSessionRetryInterval),
-                    TTimeIntervalMicroSeconds32(
-                            KSyncmlSessionRetryInterval), TCallBack(
-                            StaticDoCloseSMLSession, this));
-            }
-        else
-            FLOG(_L(" iTimedSMLSessionClose err %d"), err2);
-        }
-    FLOG(_L("CFotaServer::OnSyncMLSessionEvent <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::GetUpdateTimeStampL 
-// Gets time of last update. It is stored in a file.
-// --------------------------------------------------------------------------
-void CFotaServer::GetUpdateTimeStampL(TDes16& aTime)
-    {
-    FLOG(_L("CFotaServer::GetUpdateTimeStampL  >>"));
-    TInt err;
-
-    RFileReadStream rstr;
-    err = rstr.Open(iFs, _L("updatetimestamp"), EFileRead);
-
-    if (err == KErrNone)
-        {
-        FLOG(_L(" update time stamp file found,reading"));
-        CleanupClosePushL(rstr);
-        TInt year = rstr.ReadInt32L();
-        TInt month = rstr.ReadInt32L();
-        TInt day = rstr.ReadInt32L();
-        TInt hour = rstr.ReadInt32L();
-        TInt minute = rstr.ReadInt32L();
-        TInt year16 = year;
-        TInt month16 = month;
-        TInt day16 = day;
-        TInt hour16 = hour;
-        TInt minute16 = minute;
-        CleanupStack::PopAndDestroy(&rstr);
-        aTime.Append(year16);
-        aTime.Append(month16);
-        aTime.Append(day16);
-        aTime.Append(hour16);
-        aTime.Append(minute16);
-        }
-    else if (err != KErrNotFound)
-        {
-        __LEAVE_IF_ERROR ( err );
-        }
-
-    if (err == KErrNotFound)
-        {
-        FLOG(_L(" update time stamp not found "));
-        }
-
-    FLOG(_L("CFotaServer::GetUpdateTimeStampL  <<"));
-    }
-
-void CFotaServer::GetCurrentFwDetailsL(TDes8& aName, TDes8& aVersion,
-        TInt& aSize)
-    {
-    FLOG(_L("CFotaServer::GetCurrentFwDetailsL >>"));
-
-    TPackageState package = GetStateL(-1);
-
-    aName.Copy(package.iPkgName);
-    aVersion.Copy(package.iPkgVersion);
-    aSize = package.iPkgSize;
-
-    FLOG(_L("CFotaServer::GetCurrentFwDetailsL <<"));
-    }
-// --------------------------------------------------------------------------
-// CFotaServer::GetUpdatePackageIdsL
-// --------------------------------------------------------------------------
-//
-void CFotaServer::GetUpdatePackageIdsL(TDes16& aPackageIdList)
-    {
-    FLOG(_L("CFotaServer::GetUpdatePackageIdsL()"));
-    __LEAVE_IF_ERROR(KErrNotSupported);
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::GenericAlertSentL
-// Generic alert sent, do cleanup. FUMO spec specifies cleanup need to have 
-// for states 20,70,80,90,100. Called by syncml framework when it has sent
-// generic alert
-// --------------------------------------------------------------------------
-//
-void CFotaServer::ResetFotaStateL(const TInt aPackageID)
-    {
-    FLOG(_L("CFotaServer::ResetFotaStateL %d"), aPackageID);
-    TPackageState state;
-    TBool toidle(EFalse);
-    TBool deletepkg(EFalse);
-
-    iDatabase->OpenDBL();
-    state = iDatabase->GetStateL(aPackageID, iLastFwUrl);
-
-    switch (state.iState)
-        {
-        case RFotaEngineSession::EDownloadFailed:
-            {
-            toidle = ETrue;
-            deletepkg = ETrue;
-            }
-            break;
-        case RFotaEngineSession::EUpdateFailed:
-            {
-            toidle = ETrue;
-            deletepkg = ETrue;
-            }
-            break;
-        case RFotaEngineSession::EUpdateFailedNoData:
-            {
-            toidle = ETrue;
-            }
-            break;
-        case RFotaEngineSession::EUpdateSuccessful:
-            {
-            toidle = ETrue;
-            }
-            break;
-        case RFotaEngineSession::EUpdateSuccessfulNoData:
-            {
-            toidle = ETrue;
-            }
-            break;
-        case RFotaEngineSession::EDownloadComplete:
-            {
-            state.iState = RFotaEngineSession::EStartingUpdate;
-            state.iResult = KErrNotFound;
-            iDatabase->SetStateL(state, KNullDesC8, EFDBState);
-            toidle = EFalse;
-            }
-            break;
-        default:
-            {
-            FLOG(_L(" pkg %d (state:%d) doesnt need cleanup"), aPackageID,
-                    state.iState);
-            }
-            break;
-            
-        }
-
-    if (toidle)
-        {
-        state.iState = RFotaEngineSession::EIdle;
-        state.iResult = KErrNotFound;
-        iDatabase->SetStateL(state, KNullDesC8, EFDBState | EFDBResult);
-        DeleteFUMOTreeL();
-        }
-
-    iDatabase->CloseAndCommitDB();
-
-    SetStartupReason(EFotaDefault);
-
-    if (deletepkg)
-        {
-        DownloaderL()->DeleteUpdatePackageL();
-        }
-    }
-
-void CFotaServer::ResetCounters()
-    {
-    FLOG(_L("CFotaServer::ResetCounters >>"));
-
-    CRepository* centrep = NULL;
-    TInt maxcount(0);
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (err == KErrNone)
-        {
-        err = centrep->Get(KFOTAMaxPostponeCount, maxcount);
-        err = centrep->Set(KFOTAUserPostponeCount, maxcount);
-        err = centrep->Set(KFOTADownloadRestartCount, KMaxDownloadRestartCount);
-        }
-    delete centrep;
-    centrep = NULL;
-
-    FLOG(_L("CFotaServer::ResetCounters, postpone count set to %d, err = %d <<"), maxcount, err);
-    }
-
-TBool CFotaServer::IsUserPostponeAllowed()
-    {
-    FLOG(_L("CFotaServer::IsUserPostponeAllowed >>"));
-
-    TBool ret(ETrue);
-    CRepository* centrep = NULL;
-    TInt count(1);
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (err == KErrNone)
-        {
-        err = centrep->Get(KFOTAUserPostponeCount, count);
-        }
-    delete centrep;
-    centrep = NULL;
-
-    if (count == 0)
-        ret = EFalse;
-    else if (count == -1) //-1 signifies infinite postpone
-        ret = ETrue;
-    
-    FLOG(_L("CFotaServer::IsUserPostponeAllowed, count = %d, ret = %d, err = %d >>"), count, ret, err);
-    
-    return ret;
-    }
-
-void CFotaServer::DecrementUserPostponeCount()
-    {
-    FLOG(_L("CFotaServer::DecrementUserPostponeCount >>"));
-
-    CRepository* centrep = NULL;
-    TInt count;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (err == KErrNone)
-        {
-        err = centrep->Get(KFOTAUserPostponeCount, count);
-        if (--count < 0)
-            count = 0;
-        err = centrep->Set(KFOTAUserPostponeCount, count);
-        }
-    delete centrep;
-    centrep = NULL;
-
-    FLOG(
-            _L("CFotaServer::DecrementUserPostponeCount, tries left: %d, err = %d >>"),
-            count, err);
-    }
-
-TBool CFotaServer::DecrementDownloadRestartCount()
-    {
-    FLOG(_L("CFotaServer::DecrementDownloadRestartCount >>"));
-    
-    TBool ret (ETrue);
-    CRepository* centrep = NULL;
-    TInt count;
-    
-    TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    if (err == KErrNone)
-        {
-        err = centrep->Get(KFOTADownloadRestartCount, count);
-        if (--count < 0)
-            count = 0;
-        err = centrep->Set(KFOTADownloadRestartCount, count);
-        }
-    delete centrep;
-    centrep = NULL;
-    
-    if (count == 0)
-        ret = EFalse;
-    
-    FLOG(_L("CFotaServer::DecrementDownloadRestartCount, ret = %d, err = %d <<"), ret, err);
-    return ret;
-    }
-
-
-// --------------------------------------------------------------------------
-// CFotaServer::StartNetworkMonitorL       
-// Starts Network Monitoring operation for defined interval and retries (FotaNetworkRegMonitor.h)
-// --------------------------------------------------------------------------
-void CFotaServer::StartNetworkMonitorL()
-    {
-    FLOG(_L("CFotaServer::StartNetworkMonitorL >>"));
-    if (!iMonitor)
-        iMonitor = CFotaNetworkRegStatus::NewL(this);
-    iMonitor->StartMonitoringL();
-
-    FLOG(_L("CFotaServer::StartNetworkMonitorL <<"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::ReportNetworkStatus       
-// called by CFotaNetworkRegStatus for reporting status
-// --------------------------------------------------------------------------
-void CFotaServer::ReportNetworkStatus(TBool status)
-    {
-    FLOG(_L("CFotaServer::ReportNetworkStatus, status = %d >>"), status);
-    iRetryingGASend = EFalse;
-    iNetworkAvailable = status;
-
-    if (iNetworkAvailable)
-        {
-        TRAPD (err, CreateDeviceManagementSessionL (iPackageState));
-        if (err != KErrNone)
-            {
-            FLOG(_L("Error %d occured while sending GA after retries"), err);
-            }
-        }
-    //No need of iMonitor anymore	
-    if (iMonitor)
-        {
-        delete iMonitor;
-        iMonitor = NULL;
-        }
-
-    FLOG(_L("CFotaServer::ReportNetworkStatus >>"));
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::CheckIapExistsL 
-// Checks for IAP Id exists or not in commsdb
-// IAP Id used for resuming the download or for sending Generic alert
-// --------------------------------------------------------------------------
-//
-TBool CFotaServer::CheckIapExistsL(TUint32 aIapId)
-    {
-    FLOG(_L("CFotaServer::CheckIapExistsL >>"));
-    TBool exists = EFalse;  
-    RCmManager cmManager;    
-    cmManager.OpenLC();
-    RCmConnectionMethod conn;
-    TRAPD(err, conn = cmManager.ConnectionMethodL( aIapId ));
-    if(err == KErrNone)//connection method exists
-       exists = ETrue;
-    conn.Close();
-    CleanupStack::PopAndDestroy();//cmManager                    
-    FLOG(_L("CFotaServer::CheckIapExistsL <<"));
-    return exists;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::IsDeviceDriveBusyL 
-// Finds if device encryption or decryption is in progress.
-// It is harmful to restart device whilst encryption/decryption is in progress
-// --------------------------------------------------------------------------
-//
-TBool CFotaServer::IsDeviceDriveBusyL()
-    {
-    FLOG(_L("CFotaServer::IsDeviceDriveBusyL >>"));
-
-    TBool ret(EFalse);
-    FeatureManager::InitializeLibL();
-    TBool defeature = FeatureManager::FeatureSupported(
-            KFeatureIdFfDeviceEncryptionFeature);
-    FeatureManager::UnInitializeLib();
-
-    if (defeature)
-        {
-        TInt value(EOpIdle); // Encryption idle
-        RProperty::Get(KDevEncProtectedUid, KDevEncOperationKey, value);
-
-        if (value != EOpIdle)
-            ret = ETrue;
-        }
-
-    FLOG(_L("CFotaServer::IsDeviceDriveBusyL, ret = %d <<"), ret);
-    return ret;
-    }
-// --------------------------------------------------------------------------
-// CFotaDownload::SetIapToUseL
-// Sets the IAP ID to use. This menthod is used in fresh and resume download.
-// --------------------------------------------------------------------------
-//
-void CFotaServer::SetIapToUseL()
-    {
-    FLOG(_L("CFotaServer::SetIapToUseL >>"));
-
-    TInt aIapId(KErrNotFound);
-
-    // GET IAP FROM PROFILE ----------------------------------------------
-
-    FLOG(_L("[FotaServer]   1"));
-    RSyncMLSession syncsession;
-    syncsession.OpenL();
-    FLOG(_L("[FotaServer]   2"));
-    RSyncMLDevManProfile smlprof;
-    RArray<TSmlTransportId> connections;
-    TSmlTransportId transport;
-    RSyncMLConnection connection;
-
-    CleanupClosePushL(syncsession);
-    CleanupClosePushL(smlprof);
-    CleanupClosePushL(connections);
-    CleanupClosePushL(connection);
-
-    FLOG(_L("[FotaServer]   1.1 opening syncml profileid %d "),
-            iPackageState.iProfileId);
-    smlprof.OpenL(syncsession, iPackageState.iProfileId, ESmlOpenRead);
-    FLOG(_L("[FotaServer]  1.1"));
-    smlprof.ListConnectionsL(connections);
-    FLOG(_L("[FotaServer]  1.3"));
-    transport = connections[0];
-    connection.OpenL(smlprof, transport);
-    TBuf8<20> iapid2 = connection.GetPropertyL(KNSmlIAPId);
-    TLex8 iapid3(iapid2);
-    iapid3.Val(aIapId);
-
-    CleanupStack::PopAndDestroy(&connection);
-    CleanupStack::PopAndDestroy(&connections);
-    CleanupStack::PopAndDestroy(&smlprof);
-    CleanupStack::PopAndDestroy(&syncsession);
-
-    if (aIapId > KErrNotFound)
-        {
-        iPackageState.iIapId = aIapId;
-        }
-    else if (iPackageState.iState != RFotaEngineSession::EDownloadProgressing)
-        {
-        // GET IAP FROM CURRENT CONNECTION ----------------------------------------------
-
-        FLOG(_L("IAP in DM profile is default. Hence reading from the connection manager..."));
-        TInt sockIapid(-1);
-        RSocketServ serv;
-        CleanupClosePushL(serv);
-        User::LeaveIfError(serv.Connect());
-
-        RConnection conn;
-        CleanupClosePushL(conn);
-        User::LeaveIfError(conn.Open(serv));
-
-        TUint count(0);
-        User::LeaveIfError(conn.EnumerateConnections(count));
-        // enumerate connections
-        for (TUint idx = 1; idx <= count; ++idx)
-            {
-            TConnectionInfo connectionInfo;
-            TConnectionInfoBuf connInfo(connectionInfo);
-
-            TInt err = conn.GetConnectionInfo(idx, connInfo); // iapid
-            if (err != KErrNone)
-                {
-                CleanupStack::PopAndDestroy(2); // conn, serv
-                User::Leave(err);
-                }
-            // enumerate connectionclients
-            TConnectionEnumArg conArg;
-            conArg.iIndex = idx;
-            TConnEnumArgBuf conArgBuf(conArg);
-            err = conn.Control(KCOLConnection, KCoEnumerateConnectionClients,
-                    conArgBuf);
-            if (err != KErrNone)
-                {
-                CleanupStack::PopAndDestroy(2); // conn, serv
-                User::Leave(err);
-                }
-            TInt cliCount = conArgBuf().iCount;
-            for (TUint j = 1; j <= cliCount; ++j)
-                {
-                TConnectionGetClientInfoArg conCliInfo;
-                conCliInfo.iIndex = j;
-                TConnGetClientInfoArgBuf conCliInfoBuf(conCliInfo);
-                err = conn.Control(KCOLConnection,
-                        KCoGetConnectionClientInfo, conCliInfoBuf);
-
-                if (err != KErrNone)
-                    {
-                    CleanupStack::PopAndDestroy(2); // conn, serv
-                    User::Leave(err);
-                    }
-                TConnectionClientInfo conCliInf = conCliInfoBuf().iClientInfo;
-                TUid uid = conCliInf.iUid;
-                if (uid == TUid::Uid(KSosServerUid))
-                    {
-                    sockIapid = connInfo().iIapId;
-                    FLOG(_L("[FotaServer]  IAP found from ESOCK %d"), sockIapid);
-                    iPackageState.iIapId = sockIapid;
-                    }
-
-                FLOG(_L("[FotaServer]  CFotaDownload::DownloadL uid %x"),
-                        uid.iUid);
-                }
-            }
-        CleanupStack::PopAndDestroy(2); // conn, serv     
-        }
-
-    FLOG(_L("CFotaDownload::SetIapToUseL, iap = %d <<"), iPackageState.iIapId);
-    }
-// --------------------------------------------------------------------------
-// CFotaServer::GetSoftwareVersion
-// Gets the software version
-// 
-// --------------------------------------------------------------------------
-//
-TInt CFotaServer::GetSoftwareVersion(TDes& aVersion)
-    {
-    FLOG(_L("CFotaServer::GetSoftwareVersion >>"));
-    aVersion.Zero();
-
-    SysVersionInfo::TVersionInfoType what = SysVersionInfo::EFWVersion;
-    TInt error(KErrNone);
-    error = SysVersionInfo::GetVersionInfo(what, aVersion);
-    FLOG(_L("CFotaServer::GetSoftwareVersion,SwV=%S <<"), &aVersion);
-    return error;
-    }
-
-// --------------------------------------------------------------------------
-// CFotaServer::ResetFotaStateL
-// Resets the Fotastate
-// 
-// --------------------------------------------------------------------------
-//    
-void CFotaServer::ResetFotaStateToFailL()
-    {
-    FLOG(_L("CFotaServer::ResetFotaStateToFailL >>"));
-
-    TPackageState state;
-    if (!iDatabase->IsOpen())
-        iDatabase->OpenDBL();
-    //Fetch the software version that was before download from db.
-    state = iDatabase->GetStateL(iPackageState.iPkgId, iLastFwUrl);
-    state.iState = RFotaEngineSession::EUpdateFailed;
-    state.iResult = RFotaEngineSession::EResPackageMismatch;
-    iDatabase->SetStateL(state, KNullDesC8, EFDBState | EFDBResult);
-    iDatabase->CloseAndCommitDB();
-
-    DownloaderL()->DeleteUpdatePackageL();
-
-    ReportFwUpdateStatusL(state);
-
-    FLOG(_L("CFotaServer::ResetFotaStateToFailL <<"));
-    }
-
-void CFotaServer::CreateDiskReservation()
-    {
-    FLOG(_L("CFotaServer::CreateDiskReservation >>"));
-
-    TRAP_IGNORE(DownloaderL()->CreateDiskReservation());
-
-    FLOG(_L("CFotaServer::CreateDiskReservation <<"));
-    }
-
-void CFotaServer::DeleteDiskReservation(TDesC& path)
-    {
-    FLOG(_L("CFotaServer::DeleteDiskReservation >>"));
-
-    QString temp = QString::fromUtf8(reinterpret_cast<const char*> (path.Ptr()), path.Length());
-
-    TRAP_IGNORE(DownloaderL()->DeleteDiskReservation(temp));
-
-    FLOG(_L("CFotaServer::DeleteDiskReservation <<"));
-    }
-
-inline DownloadManagerClient* CFotaServer::DownloaderL()
-    {
-    if (!iDownloader)
-        {
-        FLOG(_L("Creating new download client..."));
-        iDownloader = DownloadManagerClient::NewL(this);
-        }
-
-    return iDownloader;
-    }
-
-void CFotaServer::DropSession()
-    {
-    FLOG(_L("CFotaServer::DropSession >>"));
-
-    iSessionCount--;
-
-    FLOG(_L("Number of active sessions = %d"), iSessionCount);
-
-    if (iSessionCount == 0 && !iAsyncOperation)
-        {
-        StopServerWhenPossible();
-        ServerCanShut(ETrue);
-        }
-
-    FLOG(_L("CFotaServer::DropSession <<"));
-    }
-
-static TInt StaticApplicationShutter(TAny *aPtr)
-    {
-    __ASSERT_ALWAYS( aPtr, User::Panic(KFotaPanic, KErrArgument) );
-    CFotaServer* srv = (CFotaServer*) aPtr;
-    srv->StopServerWhenPossible();
-    return KErrNone;
-    }
-
-void CFotaServer::WakeupServer()
-    {
-    FLOG(_L("CFotaServer::WakeupServer >>"));
-    ServerCanShut(EFalse);
-    if (iAppShutter)
-        {
-        iAppShutter->Cancel();
-        delete iAppShutter;
-        iAppShutter = NULL;
-        }
-
-    FLOG(_L("CFotaServer::WakeupServer >>"));
-    }
-
-void CFotaServer::StopServerWhenPossible()
-    {
-    FLOG(_L("CFotaServer::StopServerWhenPossible, sessioncount = %d, servercanshut = %d >>"), iSessionCount, iServerCanShut);
-    //Check if it's the right time to do so..
-
-    if (iSessionCount == 0 && iServerCanShut)
-        {
-        FLOG(_L("Shutting down the Fota server..."));
-        //Do some cleanup
-
-        if (iAppShutter)
-            {
-            iAppShutter->Cancel();
-            delete iAppShutter;
-            iAppShutter = NULL;
-            }
-
-        //Exit. This will stop the active scheduler too.
-        QApplication::exit();
-        }
-    else if (iSessionCount == 0)
-        {
-        FLOG(_L("Diferring shutdown now. Started shutdown timer..."));
-
-        if (!iAppShutter)
-            {
-            TRAP_IGNORE(
-                    iAppShutter = CPeriodic::NewL (EPriorityNormal);
-                    iAppShutter->Start(KFotaTimeShutDown, KFotaTimeShutDown,
-                    TCallBack(StaticApplicationShutter, this));
-                    );
-            }
-
-        }
-    else
-        {
-        //one or more client is still open
-        FLOG(_L("Diferring shutdown now."));
-        WakeupServer();
-        }
-    FLOG(_L("CFotaServer::StopServerWhenPossible <<"));
-    }
-
-void CFotaServer::ServerCanShut(TBool aParam)
-    {
-    FLOG(_L("CFotaServer::ServerCanShut, param = %d >>"), aParam);
-
-    iServerCanShut = aParam;
-
-    FLOG(_L("CFotaServer::ServerCanShut <<"));
-
-    }
-
-void CFotaServer::ConstructApplicationUI(TBool aVal)
-    {
-    FLOG(_L("CFotaServer::ConstructApplicationUI, value = %d >>"), aVal);
-
-    if (!aVal)
-        iMainwindow.lower();
-    else
-        iMainwindow.raise();
-    
-    FLOG(_L("CFotaServer::ConstructApplicationUI <<"));
-    }
-
-
-void CFotaServer::SetVisible(TBool aVisible)
-{
-    FLOG(_L("CFotaServer::SetVisible >>"));
-
-    if(iFullScreenDialog)
-	iFullScreenDialog->SetVisible(aVisible);
-
-    FLOG(_L("CFotaServer::SetVisible <<"));
-}
-
-//End of file
--- a/fotaapplication/fotaserver/src/fotaSrvSession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-/*
- * 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:   fotaengines server side session
- *
- */
-
-// INCLUDE FILES
-#include "FotasrvSession.h"
-#include "FotaSrvDebug.h"
-#include <eikenv.h>
-#include <eikappui.h>
-#include <s32mem.h>
-#include <e32base.h>
-#include <centralrepository.h>
-#include "FotaServer.h"
-
-// ============================= MEMBER FUNCTIONS ============================
-
-class CFotaServer;
-
-// ---------------------------------------------------------------------------
-// CFotaSrvSession::CheckClientSecureIdL 
-// Returns True if caller is syncml framework. False for fotasrv.
-// Leaves if client is unknown
-// ---------------------------------------------------------------------------
-//
-TFotaClient CFotaSrvSession::CheckClientSecureIdL(const RMessage2& aMessage)
-    {
-    TFotaClient client(EUnknown);
-    TUid dmhostserver1 = TUid::Uid(KDMHostServer1Uid);
-    TUid fota = TUid::Uid(KFotaServerUid);
-    TUid omadmappui = TUid::Uid(KOmaDMAppUid);
-    TUid starter = TUid::Uid(KStarterUid);
-    TUid fscheduler = TUid::Uid(KFotaScheduler);
-    TUid fms = TUid::Uid(KFMSServerUid);
-    TUid softwarechecker = TUid::Uid(0x2000BB96);
-    TUid softwarecheckerbackground = TUid::Uid(0x2000BB97);
-    TUid testapp = TUid::Uid(0x102073E4);
-    TUid testapp2 = TUid::Uid(0x10009CF4);
-
-    TUid iadclient = TUid::Uid(0x2000F85A);
-
-    // Syncml
-    if (aMessage.SecureId() == dmhostserver1.iUid)
-        {
-        FLOG(
-                _L("[CFotaSrvSession] CheckClientSecureIdL client is DmHostserver!"));
-        client = EDMHostServer;
-        }
-    else if (aMessage.SecureId() == omadmappui.iUid)
-        {
-        FLOG(
-                _L("[CFotaSrvSession] CheckClientSecureIdL client is omadmappui!"));
-        client = EOMADMAppUi;
-        }
-    else if (aMessage.SecureId() == starter.iUid)
-        {
-        FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client is starter!"));
-        client = EStarter;
-        }
-    else if (aMessage.SecureId() == softwarechecker.iUid
-            || aMessage.SecureId() == iadclient.iUid)
-        {
-        FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client is IAD!"));
-        client = ESoftwareChecker;
-        }
-    else if (aMessage.SecureId() == softwarecheckerbackground.iUid)
-        {
-        FLOG(
-                _L("[CFotaSrvSession] CheckClientSecureIdL client is IAD - background!"));
-        client = ESoftwareCheckerBackground;
-        }
-    else if (aMessage.SecureId() == fms.iUid)
-        {
-        FLOG(_L("[CFotaSrvSession] CheckClientSecureIdL client is FMS!"));
-        client = EFMSServer;
-        }
-    else if (aMessage.SecureId() == fscheduler.iUid)
-        {
-        FLOG(
-                _L("[CFotaSrvSession] CheckClientSecureIdL client is fota scheduler!"));
-        client = EFotaScheduler;
-        }
-    else if (aMessage.SecureId() == 0x0323231 || aMessage.SecureId()
-            == testapp.iUid || aMessage.SecureId() == testapp2.iUid)
-        {
-        client = EFotaTestApp;
-        }
-
-    return client;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaSrvSession::CFotaSrvSession
-// ---------------------------------------------------------------------------
-//
-CFotaSrvSession::CFotaSrvSession()
-    {
-    FLOG(_L( "CFotaSrvSession::CFotaSrvSession( )" ));
-    iError = KErrNone;
-    //iDoc = CEikonEnv::Static()->EikAppUi()->Document();
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaSrvSession::~CFotaSrvSession
-// ---------------------------------------------------------------------------
-//
-CFotaSrvSession::~CFotaSrvSession()
-    {
-    FotaServer()->DropSession();
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaSrvSession::ServiceL
-// Handle client request
-// ---------------------------------------------------------------------------
-//
-void CFotaSrvSession::ServiceL(const RMessage2& aMessage)
-    {
-    TInt err(KErrNone);
-    TInt pkgid = 0;
-    TPackageState state;
-    RThread clt;
-    aMessage.ClientL(clt);
-    TFullName cltnm = clt.FullName();
-    FLOG(_L( "CFotaSrvSession::ServiceL      %d   serving for %S?" ),
-            aMessage.Function(), &cltnm);
-
-    TFotaClient client = CheckClientSecureIdL(aMessage);
-
-    if (client == EUnknown)
-        {
-        FLOG(_L("Permission denied to use fota services!"));
-        User::Leave(KErrPermissionDenied);
-        }
-
-    TInt cmd = aMessage.Function();
-    if ((cmd != EGetState) && (cmd != EGetResult) && (cmd != EGetCurrFwDetails) && (cmd != EGetUpdateTimestamp))
-        {
-    
-        TInt fotaValue(1);
-        CRepository* centrep(NULL);
-        TUid uidValue =
-            {
-            0x101F9A08
-            }; // KCRFotaAdapterEnabled
-
-        centrep = CRepository::NewL(uidValue);
-        if (centrep)
-            {
-            FLOG(_L("centralrepository found "));
-            centrep->Get(1, fotaValue); // KCRFotaAdapterEnabled     
-            delete centrep;
-            }
-
-        if (!fotaValue)
-            {
-            FLOG(_L("Fota is disabled or not supported!"));
-            User::Leave(KErrNotSupported);
-            }
-            
-        }
-
-    switch (aMessage.Function())
-        {
-
-        case EFotaDownload:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL DOWNLOAD"));
-            TDownloadIPCParams ipc;
-            TPckg<TDownloadIPCParams> pkg(ipc);
-            aMessage.Read(0, pkg);
-            TInt deslen = aMessage.GetDesLengthL(1);
-            HBufC8* urlbuf = HBufC8::NewLC(deslen);
-            TPtr8 urlptr = urlbuf->Des();
-            aMessage.Read(1, urlptr);
-            TInt silent = aMessage.Int2();
-            FotaServer()->DownloadL(ipc, urlptr, client, silent, EFalse);
-            CleanupStack::PopAndDestroy(urlbuf); // urlbuf
-            aMessage.Complete(KErrNone);
-
-            break;
-            }
-        case EFotaUpdate:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL UPDATE" ));
-            TDownloadIPCParams ipc;
-            TPckg<TDownloadIPCParams> pkg(ipc);
-            aMessage.Read(0, pkg);
-
-            // If update started from omadmappui, no alert should be sent if 
-            // update is cancelled
-            if (client == EOMADMAppUi)
-                {
-                ipc.iSendAlert = EFalse;
-                }
-            FotaServer()->TryUpdateL(client);
-            aMessage.Complete(KErrNone);
-            break;
-            }
-        case EFotaDownloadAndUpdate:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL DOWNLOADANDUPDATE" ));
-            TDownloadIPCParams ipc;
-            TPckg<TDownloadIPCParams> pkg(ipc);
-            aMessage.Read(0, pkg);
-            TInt deslen = aMessage.GetDesLengthL(1);
-            HBufC8* urlbuf = HBufC8::NewLC(deslen);
-            TPtr8 urlptr = urlbuf->Des();
-            aMessage.Read(1, urlptr);
-            TFotaClient requester = CheckClientSecureIdL(aMessage);
-
-            TInt silent = aMessage.Int2();
-            FotaServer()->DownloadL(ipc, urlptr, requester, silent, ETrue);
-            CleanupStack::PopAndDestroy(urlbuf);
-            aMessage.Complete(KErrNone);
-            }
-            break;
-
-        case EFotaTryResumeDownload:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL TRYRESUMEDOWNLOAD" ));
-            if (client == EOMADMAppUi || client == EFMSServer || client
-                    == EFotaTestApp)
-                {
-                TInt silent = aMessage.Int0();
-                
-                FotaServer()->TryResumeDownloadL(client, silent); // silent
-                aMessage.Complete(KErrNone);
-                }
-            else
-                {
-                aMessage.Complete(KErrAccessDenied);
-                }
-
-            }
-            break;
-
-        case EDeletePackage:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL DELETEPACKAGE"));
-            pkgid = aMessage.Int0();
-            FotaServer()->DeletePackageL(pkgid);
-            aMessage.Complete(KErrNone);
-            }
-            break;
-        case EGetState:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL GETSTATE" ));
-            pkgid = aMessage.Int0();
-
-            state = FotaServer()->GetStateL(pkgid);
-
-            FLOG(_L( "CFotaSrvSession::ServiceL GETSTATE << %d" ),  state.iState);
-            TPckg<RFotaEngineSession::TState> pkg2(state.iState);
-            aMessage.Write(1, pkg2);
-            aMessage.Complete(KErrNone);
-            }
-            break;
-        case EGetResult:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL GETRESULT >>" ));
-            pkgid = aMessage.Int0();
-            state = FotaServer()->GetStateL(pkgid);
-            TPckg<TInt> pkg2(state.iResult);
-            FLOG(_L( "CFotaSrvSession::ServiceL GETRESULT << %d" ),
-                    state.iResult);
-            aMessage.Write(1, pkg2);
-            aMessage.Complete(err);
-            break;
-            }
-        case EGetUpdatePackageIds:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL EGETUPDATEPACKAGEIDS" ));
-            TPkgIdList pkgids;
-            FotaServer()->GetUpdatePackageIdsL(pkgids);
-            TPckg<TPkgIdList> pkgids_pkg(pkgids);
-            aMessage.Write(0, pkgids_pkg);
-            aMessage.Complete(KErrNone);
-            }
-            break;
-
-        case EGetUpdateTimestamp:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL EGETUPDATETIMESTAMP" ));
-            TBuf16<15> timestamp;
-            FotaServer()->GetUpdateTimeStampL(timestamp);
-            aMessage.Write(0, timestamp);
-            aMessage.Complete(KErrNone);
-            }
-            break;
-
-        case EGenericAlertSentForPackage:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL EGENERICALERTSENT FOR PKGID" ));
-            TInt pkgid = aMessage.Int0();
-            FotaServer()->ResetFotaStateL(pkgid);
-            aMessage.Complete(err);
-            }
-            break;
-
-        case EScheduledUpdate:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL ESCHEDULEDUPDATE" ));
-            TFotaScheduledUpdate sched(-1, -1);
-            TPckg<TFotaScheduledUpdate> p(sched);
-            aMessage.Read(0, p);
-
-            FLOG(_L(" pkgid: %d   scheduleid:%d"), sched.iPkgId,
-                    sched.iScheduleId);
-            FotaServer()->ScheduledUpdateL(sched, client);
-            aMessage.Complete(KErrNone);
-            
-            }
-            break;
-
-        case EPauseDownload:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL EPAUSEDOWNLOAD" ));
-            FotaServer()->PauseDownloadL();
-            aMessage.Complete(KErrNone);
-            }
-            break;
-        case EGetCurrFwDetails:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL EGETCURRFWDETAILS" ));
-
-            TBuf8<KFotaMaxPkgNameLength> name;
-            TBuf8<KFotaMaxPkgVersionLength> version;
-            TInt size(0);
-
-            FotaServer()->GetCurrentFwDetailsL(name, version, size);
-
-            /*
-            aMessage.Write(1, name);
-            aMessage.Write(2, version);
-            TPckg<TInt> psize(size);
-            aMessage.Write(3, psize);
-
-            aMessage.Complete(KErrNone);*/
-            
-            aMessage.Write(0, name);
-            aMessage.Write(1, version);
-            TPckg<TInt> psize(size);
-            aMessage.Write(2, psize);
-
-            aMessage.Complete(KErrNone);
-
-
-            }
-            break;
-        default:
-            {
-            FLOG(_L( "CFotaSrvSession::ServiceL In default case" ));
-            }
-            break;
-        }
-    }
-
-// ----------------------------------------------------------------------------------------
-// CFotaSrvSession::ServiceError
-// ----------------------------------------------------------------------------------------
-void CFotaSrvSession::ServiceError(const RMessage2& aMessage, TInt aError)
-    {
-    FLOG(_L("CFotaSrvSession::ServiceError, err = %d >>"), aError);
-    CSession2::ServiceError(aMessage, aError);
-    FLOG(_L("CFotaSrvSession::ServiceError <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaSrvSession::FotaServer
-// Helper function
-// ---------------------------------------------------------------------------
-//
-
-CFotaServer* CFotaSrvSession::FotaServer() const
-    {
-    return (CFotaServer*) Server();
-    }
-
-void DispatchMessageL(const RMessage2& aMessage)
-    {
-    return;
-    }
-
--- a/fotaapplication/fotaserver/src/fotafullscreendialog.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,455 +0,0 @@
-/*
- * 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: 
- *
- */
-
-#include "fotafullscreendialog.h"
-
-#include <hbaction.h>
-#include <hbprogressbar.h>
-#include <hbicon.h>
-#include <hbextendedlocale.h>
-#include <hbtranslator.h>
-#include <e32std.h>
-#include <e32math.h>
-
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::FotaFullscreenDialog
-// Constructor of the full screen dialogs, it takes all the widgets from the docml
-// initializes it and sets the progress bar to zero.
-// ---------------------------------------------------------------------------
-//
-
-
-FotaFullscreenDialog::FotaFullscreenDialog(CFotaServer* aObserver)
-    {
-    FLOG(_L("FotaFullscreenDialog::FotaFullscreenDialog >>"));
-    bool ok = false;
-    iServer = aObserver;
-    iloader.load(":/xml/data/fullscreendialog.docml", &ok);
-    if (!ok)
-        {
-        return;
-        }
-    iClicked = EFalse;
-    idialog = qobject_cast<HbDialog *> (iloader.findWidget("dialog"));
-
-	idialog->setTimeout(HbPopup::NoTimeout);
-   
-    iPrimaryAction = qobject_cast<HbPushButton *> (iloader.findWidget(
-            "btnHide"));
-			
-     iSecondaryAction = qobject_cast<HbPushButton *> (iloader.findWidget(
-            "btnResumeLater"));
-			
-			
-    
-    iprogressBar = qobject_cast<HbProgressBar *> (iloader.findWidget(
-            "horizontalProgressBar"));
-    iprogressBar->setProgressValue(0);
-	
-	    /*iInstallNote = qobject_cast<HbLabel *> (iloader.findWidget(
-            "lblinstallnote"));*/
-    iDownloadState = qobject_cast<HbLabel *> (iloader.findWidget(
-            "lblDownloadState"));
-    //iEmergencyIcon = qobject_cast<HbLabel *> (iloader.findWidget(
-    //        "icnEmergency"));
-    iChargerIcon = qobject_cast<HbLabel *> (iloader.findWidget("icnCharger"));
-    HbIcon iconCharger;
-    //iconCharger.setIconName(:/icons/qgn_prop_sml_http.svg);
-    //iChargerIcon->setIcon(iconCharger);
-    HbIcon iconEmergency;
-    //iconEmergency.setIconName(:/icons/qgn_prop_sml_http.svg);
-    //iEmergencyIcon->setIcon(iconEmergency);
-    //iEmergencyNote = qobject_cast<HbLabel *> (iloader.findWidget(
-    //        "lblEmergency"));
-    //iRestartIcon = qobject_cast<HbLabel *> (iloader.findWidget("icnInstall"));
-    //HbIcon iconRestart;
-    //iconRestart.setIconName(:/icons/qgn_prop_sml_http.svg);
-    //iRestartIcon->setIcon(iconRestart);
-    //iRestartNote = qobject_cast<HbLabel *> (iloader.findWidget(
-    //        "lblRestartNote"));
-    //installEventFilter(this);
-    iPrimaryAction->setText(hbTrId("txt_common_button_hide"));
-    iSecondaryAction->setText(hbTrId("txt_device_update_button_resume_later"));
-    iTitle = qobject_cast<HbLabel *> (iloader.findWidget("lblTitle"));
-    iTitle->setPlainText(hbTrId("txt_device_update_title_updating_phone"));
-    iDownloadState->setPlainText(hbTrId("txt_device_update_info_downloading"));
-    //iInstallNote->setPlainText(hbTrId(
-    //        "txt_device_update_info_installation_will_proceed_n"));
-    iChargerNote = qobject_cast<HbLabel *> (iloader.findWidget("lblcharger"));
-    iChargerNote->setPlainText(hbTrId(
-            "txt_device_update_info_FS_its_recommended_to_connec"));
-    //iRestartNote->setPlainText(hbTrId(
-    //        "txt_device_update_info_FS_after_the_installation_the"));
-    //iEmergencyNote->setPlainText(hbTrId(
-    //        "txt_device_update_info_FS_during_the_installation_the"));
-
-    QObject::connect(iPrimaryAction, SIGNAL(clicked()), this,
-            SLOT(LSKSelected()));
-    QObject::connect(iSecondaryAction, SIGNAL(clicked()), this,
-            SLOT(RSKSelected()));
-    QObject::connect(idialog, SIGNAL(aboutToClose()), this,
-            SLOT(aboutToClose()));
-
-    RefreshDialog();
-    FLOG(_L("FotaFullscreenDialog::FotaFullscreenDialog <<"));
-    }
-
-
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::refreshDialog
-// This function is used to refresh the contents of the full screen dialog
-// once it is changed.
-// ---------------------------------------------------------------------------
-//
-
-
-void FotaFullscreenDialog::RefreshDialog()
-    {
-    FLOG(_L("FotaFullscreenDialog::RefreshDialog >>"));
-    if (idialog)
-        {
-        FLOG(_L("FotaFullscreenDialog::idialog >>"));
-        iClicked = EFalse;
-        idialog->show();
-        }
-    FLOG(_L("FotaFullscreenDialog::RefreshDialog <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::setsoftwaredetails
-// This function is called to set the details of the software,which is downloaded.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::SetSoftwareDetails(int size,
-        const QString version, const QString aName)
-    {
-    //set Sw Details
-    FLOG(_L("FotaFullscreenDialog::RefreshDialog >>"));
-    iSwDetails = qobject_cast<HbLabel *> (iloader.findWidget("lblSwVersion"));
-    QString content;
-    
-    TReal sizeKB = size / 1024;
-    TReal sizeRounded = 0;
-    QString pkgsize;
-
-    if (sizeKB > 1024)
-        {
-        TReal sizeMB = sizeKB / 1024;
-        Math::Round(sizeRounded,sizeMB,2);
-        content = hbTrId("txt_device_update_info_new_device_software_availab_Mb") .arg(aName) .arg(version).arg(sizeRounded);
-        }
-    else
-        {
-        Math::Round(sizeRounded,sizeKB,2);
-        content = hbTrId("txt_device_update_info_new_device_software_availab_Kb") .arg(aName) .arg(version).arg(sizeRounded);
-        }
-
-    iSwDetails->setPlainText(content);
-    FLOG(_L("FotaFullscreenDialog::RefreshDialog <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::close
-// This slot is called to manually close the dialog.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::Close()
-    {
-    FLOG(_L("FotaFullscreenDialog::Close <<"));
-    iClicked = ETrue;
-    if (idialog)
-        idialog->close();
-    FLOG(_L("FotaFullscreenDialog::Close >>"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::setwarningdetails
-// This function is to set the warnings details of the full screen dialog
-// according to the state of the firmware update.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::SetWarningDetails(TFotaWarningType aType)
-    {
-    FLOG(_L("FotaFullscreenDialog::SetWarningDetails <<"));
-    //set heading content
-    if (aType == EHbFotaDownload)
-        {
-        FLOG(_L("FotaFullscreenDialog::EHbFotaDownload"));
-        idialog->setTimeout(HbPopup::NoTimeout);
-        iInstallNote = qobject_cast<HbLabel *> (iloader.findWidget(
-                    "lblinstallnote"));
-        iInstallNote->setPlainText(hbTrId(
-                    "txt_device_update_info_installation_will_proceed_n"));
-        //User::After(1000);
-        iInstallNote->setVisible(false);
-        
-        iRestartNote = qobject_cast<HbLabel *> (iloader.findWidget(
-                    "lblRestartNote"));
-        iRestartNote->setPlainText(hbTrId(
-                    "txt_device_update_info_FS_after_the_installation_the"));
-        //User::After(1000);
-        iRestartNote->setVisible(false);
-        
-        iRestartIcon = qobject_cast<HbLabel *> (iloader.findWidget("icnInstall"));
-        HbIcon iconRestart;
-        //iconRestart.setIconName(:/icons/qgn_prop_sml_http.svg);
-        //iRestartIcon->setIcon(iconRestart);
-        //User::After(1000);
-        iRestartIcon->setVisible(false);
-        
-        iEmergencyNote = qobject_cast<HbLabel *> (iloader.findWidget(
-                    "lblEmergency"));
-        iEmergencyNote->setPlainText(hbTrId(
-                   "txt_device_update_info_FS_during_the_installation_the"));
-        //User::After(1000);
-        iEmergencyNote->setVisible(false);
-        
-        iEmergencyIcon = qobject_cast<HbLabel *> (iloader.findWidget(
-                    "icnEmergency"));
-        HbIcon iconEmergency;
-        //iconEmergency.setIconName(:/icons/qgn_prop_sml_http.svg);
-        //iEmergencyIcon->setIcon(iconEmergency);
-        //User::After(1000);
-        iEmergencyIcon->setVisible(false);
-
-        }
-    else if (aType == EHbFotaUpdate)
-        {
-        FLOG(_L("FotaFullscreenDialog::EHbFotaUpdate"));
-        idialog->setTimeout(HbPopup::ContextMenuTimeout);
-        HbIcon iconCharger;
-        //iconCharger.setIconName(:/icons/qgn_prop_sml_http.svg);
-        //iChargerIcon->setIcon(iconCharger);
-        HbIcon iconRestart;
-        //iconRestart.setIconName(:/icons/qgn_prop_sml_http.svg);
-        //iRestartIcon->setIcon(iconRestart);
-        iInstallNote->setPlainText(hbTrId(
-                "txt_device_update_info_installation_will_proceed_n"));
-        iChargerNote->setPlainText(hbTrId(
-                "txt_device_update_info_FS_its_recommended_to_connec"));
-        iRestartNote->setPlainText(hbTrId(
-                "txt_device_update_info_FS_after_the_installation_the"));
-        iInstallNote->setVisible(true);
-        iRestartNote->setVisible(true);
-        iRestartIcon->setVisible(true);
-        iEmergencyNote->setVisible(true);
-        iEmergencyIcon->setVisible(true);
-        iDownloadState->setPlainText(hbTrId(
-                "txt_device_update_info_download_complete"));
-        iDownloadState->setVisible(true);
-        iPrimaryAction->setEnabled(ETrue);
-        }
-    else if (aType == EHbFotaLowBattery)
-        {
-        FLOG(_L("FotaFullscreenDialog::EHbFotaLowBattery"));
-        idialog->setTimeout(HbPopup::NoTimeout);
-        HbIcon iconCharger;
-        //iconCharger.setIconName(:/icons/qgn_prop_sml_http.svg);
-        //iChargerIcon->setIcon(iconCharger);
-        HbIcon iconRestart;
-        //iconRestart.setIconName(:/icons/qgn_prop_sml_http.svg);
-        //iRestartIcon->setIcon(iconRestart);
-        iInstallNote->setPlainText(hbTrId(
-                "txt_device_update_info_to_proceed_with_installatio"));
-        iChargerNote->setPlainText(hbTrId(
-                "txt_device_update_info_FS_after_the_installation_the"));
-        iRestartNote->setPlainText(hbTrId(
-                "txt_device_update_info_FS_during_the_installation_the"));
-        //iEmergencyNote->setPlainText(hbTrId("txt_device_update_info_FS_during_the_installation_the"));
-        iInstallNote->setVisible(true);
-        iRestartNote->setVisible(true);
-        iRestartIcon->setVisible(true);
-        iEmergencyNote->setVisible(false);
-        iEmergencyIcon->setVisible(false);
-        iDownloadState->setPlainText(hbTrId(
-                "txt_device_update_info_download_complete"));
-        iDownloadState->setVisible(true);
-        iPrimaryAction->setText(hbTrId("txt_device_update_button_continue"));
-        iSecondaryAction->setText(hbTrId(
-                "txt_device_update_button_install_later"));
-        iPrimaryAction->setEnabled(EFalse);
-        }
-    RefreshDialog();
-    FLOG(_L("FotaFullscreenDialog::SetWarningDetails >>"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::updateprogressbar
-// This function is called to update the progress bar with the download progress details/.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::UpdateProgressBar(TInt aProgress)
-    {
-    FLOG(_L("FotaFullscreenDialog::UpdateProgressBar <<"));
-    iprogressBar->setProgressValue(aProgress);
-    FLOG(_L("FotaFullscreenDialog::UpdateProgressBar >>"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::DisableRSK
-// This function is called disable the RSK of the dialog when the postpone limeit expires
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::DisableRSK(TBool aVal)
-    {
-    FLOG(_L("FotaFullscreenDialog::DisableRSK <<"));
-    iSecondaryAction->setEnabled(!aVal);
-    FLOG(_L("FotaFullscreenDialog::DisableRSK >>"));
-    }
-
-bool FotaFullscreenDialog::IsLSKEnabled()
-    {
-    FLOG(_L("FotaFullscreenDialog::IsLSKEnabled <<"));
-    return (iPrimaryAction->isEnabled());
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::cancelSelected
-// This slot is called when user presses the left softkey of fullscreen dialog.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::LSKSelected()
-    {
-    FLOG(_L("FotaFullscreenDialog::LSKSelected <<"));
-    iClicked = ETrue;
-    idialog->hide();
-    iServer->HandleFullScreenDialogResponse(EHbLSK);
-    FLOG(_L("FotaFullscreenDialog::LSKSelected >>"));
-    }
-	
-	
-	// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::cancelSelected
-// This slot is called when user presses the right softkey of fullscreen dialog.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::RSKSelected()
-    {
-    FLOG(_L("FotaFullscreenDialog::RSKSelected >>"));
-    iClicked = ETrue;
-    idialog->hide();
-    iServer->HandleFullScreenDialogResponse(EHbRSK);
-    FLOG(_L("FotaFullscreenDialog::RSKSelected <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::~FotaFullscreenDialog
-// Destructor which destroys all the widgets
-// ---------------------------------------------------------------------------
-//
-
-FotaFullscreenDialog::~FotaFullscreenDialog()
-    {
-    FLOG(_L("~ FotaFullscreenDialog <<"));
-
-    QObject::disconnect(iPrimaryAction, SIGNAL(clicked()), this,
-            SLOT(LSKSelected()));
-    QObject::disconnect(iSecondaryAction, SIGNAL(clicked()), this,
-            SLOT(RSKSelected()));
-    QObject::disconnect(idialog, SIGNAL(aboutToClose()), this,
-            SLOT(aboutToClose()));
-
-    if (iprogressBar)
-        iprogressBar->deleteLater();
-
-    if (iPrimaryAction)
-        delete iPrimaryAction;
-
-    if (iSecondaryAction)
-        delete iSecondaryAction;
-
-    if (iTitle)
-        delete iTitle;
-
-    if (iSwDetails)
-        delete iSwDetails;
-
-    if (iInstallNote)
-        delete iInstallNote;
-
-    if (iRestartNote)
-        delete iRestartNote;
-
-    if (iRestartIcon)
-        delete iRestartIcon;
-
-    if (iEmergencyNote)
-        delete iEmergencyNote;
-
-    if (iEmergencyIcon)
-        delete iEmergencyIcon;
-
-    if (iDownloadState)
-        delete iDownloadState;
-
-    if (idialog)
-        delete idialog;
-
-    FLOG(_L("~ FotaFullscreenDialog >>"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::showUpdateDialog
-// This function is called when download is complete and update dialog has to be shown.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::ShowUpdateDialog()
-    {
-    FLOG(_L("FotaFullscreenDialog::ShowUpdateDialog <<"));
-    iPrimaryAction->setText(hbTrId("txt_common_button_continue_dialog"));
-    iSecondaryAction->setText(
-            hbTrId("txt_device_update_button_install_later"));
-    SetWarningDetails(EHbFotaUpdate);
-    FLOG(_L("FotaFullscreenDialog::ShowUpdateDialog >>"));
-    }
-
-
-void FotaFullscreenDialog::SetVisible(TBool aVisible)
-{
-    FLOG(_L("RefreshDialog::SetVisible >>"));
-    RefreshDialog();
-    FLOG(_L("RefreshDialog::SetVisible <<"));
-}
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::aboutToClose
-// This slot is called when full screen dialogs is cloased during a timeout.
-// ---------------------------------------------------------------------------
-//
-
-void FotaFullscreenDialog::aboutToClose()
-    {
-    FLOG(_L("FotaFullscreenDialog::aboutToClose <<"));
-    if (!iClicked)
-        {
-        FLOG(_L("Calling fotaserver as timedout..."));
-        iServer->HandleFullScreenDialogResponse(EHbLSK);
-        }
-    iClicked = EFalse;
-    FLOG(_L("FotaFullscreenDialog::aboutToClose >>"));
-    }
-
-
--- a/fotaapplication/fotaserver/src/fotanotifiers.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * 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: 
- *
- */
-#include "fotanotifiers.h"
-#include "FotaDlMgrClient.h"
-_LIT(KHbNotifier,"com.nokia.hb.devicemanagementdialog/1.0");
-
-// --------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::NewL 
-// --------------------------------------------------------------------------
-//
-CFotaDownloadNotifHandler* CFotaDownloadNotifHandler::NewL(
-        MfotadevicedialogObserver* aObserver)
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::NewL >>"));
-    __ASSERT_ALWAYS( aObserver, User::Panic(KFotaPanic, KErrArgument) );
-    CFotaDownloadNotifHandler* h = new (ELeave) CFotaDownloadNotifHandler;
-    h->iObserver = aObserver;
-    
-    FLOG(_L("CFotaDownloadNotifHandler::NewL <<"));
-
-    return h;
-    }
-
-// --------------------------------------------------------------------------
-CFotaDownloadNotifHandler::CFotaDownloadNotifHandler() :
-    iDevDialog(NULL), iDialogID(0)
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::CFotaDownloadNotifHandler()"));
-    }
-
-// --------------------------------------------------------------------------
-CFotaDownloadNotifHandler::~CFotaDownloadNotifHandler()
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::~CFotaDownloadNotifHandler >>"));
-    if (iDevDialog)
-        delete iDevDialog;
-    FLOG(_L("CFotaDownloadNotifHandler::~CFotaDownloadNotifHandler <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::LaunchNotifierL
-// This function is used the observer which uses this notifer to lauch the notifier
-// It puts the necessary parameters to lauch the notifier in CHbSymbianVariantMap
-// ---------------------------------------------------------------------------
-//
-void CFotaDownloadNotifHandler::LaunchNotifierL(
-        CHbSymbianVariantMap *aNotifParams, TInt aDialogId)
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::LaunchNotifierL() >>"));
-    if (!iDevDialog)
-        iDevDialog = CHbDeviceDialogSymbian::NewL();
-    FLOG(_L("CFotaDownloadNotifHandler::CHbDeviceDialogSymbian::NewL()"));
-    if (iDevDialog == NULL)
-        FLOG(_L("Error in CHbDeviceDialogSymbian::NewL()"));
-
-    iDialogID = aDialogId;
-    //connect(mDeviceDialog, SIGNAL(dataReceived(QVariantMap)), this, SLOT(dataReceived(QVariantMap)));
-
-    TInt Err = iDevDialog->Show(KHbNotifier, *aNotifParams, this);
-    FLOG(
-            _L("CFotaDownloadNotifHandler::CHbDeviceDialogSymbian::Show() - %d"),
-            Err);
-
-    FLOG(_L("CFotaDownloadNotifHandler::LaunchNotifierL() <<"));
-    }
-
-void CFotaDownloadNotifHandler::Cancel()
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::Cancel >>"));
-    if (iDialogID)
-        iDevDialog->Cancel();
-    FLOG(_L("CFotaDownloadNotifHandler::Cancel <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::DataReceived
-// This slot is called when user gives a keypress event to the device dialog(through deviceDialogData signal).
-// CHbSymbianVariantMap is passed from the device dialog which contains the information
-// of the user input.
-// ---------------------------------------------------------------------------
-//
-void CFotaDownloadNotifHandler::DataReceived(CHbSymbianVariantMap& aData)
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::DataReceived() >>"));
-    iDevDialog->Cancel();
-    TFwUpdNoteTypes ret;
-    const CHbSymbianVariant* dialogId = aData.Get(KResult);
-    ret = *(TFwUpdNoteTypes *) dialogId->Value<TInt> ();
-    TInt temp = iDialogID;
-    iDialogID = 0;
-    iObserver->HandleDialogResponse(ret, temp);
-
-    FLOG(_L("CFotaDownloadNotifHandler::DataReceived() <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaDownloadNotifHandler::DeviceDialogClosed
-// This slot is called when the device dialog is closed due to some error.
-// aCompletionCode gives the error information on which the dialog is closed.
-// ---------------------------------------------------------------------------
-//
-void CFotaDownloadNotifHandler::DeviceDialogClosed(TInt aCompletionCode)
-    {
-    FLOG(_L("CFotaDownloadNotifHandler::DeviceDialogClosed() >>"));
-
-    FLOG(_L("CFotaDownloadNotifHandler::DeviceDialogClosed() <<"));
-    }
-
--- a/fotaapplication/fotaserver/src/fotaupdate.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,722 +0,0 @@
-/*
- * Copyright (c) 2005-2006 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:   starts update sequence
- *
- */
-
-// INCLUDE FILES
-#include <StringLoader.h>
-#include <centralrepository.h>
-#include <AknUtils.h>
-#include <AknBidiTextUtils.h> 
-#include <biditext.h>
-#include <gdi.h>
-#include <fotaengine.h>
-#include <apgtask.h>
-#include <aknradiobuttonsettingpage.h> 
-#include <akntitle.h>
-#include <schtime.h>
-#include <csch_cli.h>
-#include <fotaengine.h>
-#include <XQConversions>
-#include "fotaupdate.h"
-#include "fmsclient.h"
-#include "FotasrvSession.h"
-#include "fotaserverPrivateCRKeys.h"
-#include "fotaserverPrivatePSKeys.h"
-#include "fotanotifiers.h"
-
-#include <usbman.h>
-#include <usbstates.h>
-// ============================= MEMBER FUNCTIONS ============================
-
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::CFotaUpdate()
-// ---------------------------------------------------------------------------
-//
-CFotaUpdate::CFotaUpdate() :
-    CActive(EPriorityNormal)
-    {
-    CActiveScheduler::Add(this);
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::~CFotaUpdate()
-// ---------------------------------------------------------------------------
-//
-CFotaUpdate::~CFotaUpdate()
-    {
-    FLOG(_L("CFotaUpdate::~CFotaUpdate >>"));
-    iFotaServer = NULL;
-
-    CancelMonitor();
-
-    if (iProperty.Handle())
-        iProperty.Close();
-
-    FLOG(_L("CFotaUpdate::~CFotaUpdate <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::NewL 
-// ---------------------------------------------------------------------------
-//
-CFotaUpdate* CFotaUpdate::NewL(CFotaServer* aServer)
-    {
-    CFotaUpdate* ao = new (ELeave) CFotaUpdate();
-    ao->iFotaServer = aServer;
-    return ao;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::CheckUpdateResults
-// Checks if there is update result file available (meaning that update just
-// took place)
-// ---------------------------------------------------------------------------
-//
-TBool CFotaUpdate::CheckUpdateResults(RFs& aRfs)
-    {
-    RFile f;
-    TInt err;
-    err = f.Open(aRfs, KUpdateResultFile, EFileShareAny);
-    f.Close();
-    if (err != KErrNone)
-        {
-        return EFalse;
-        }
-    FLOG(_L(" CFotaUpdate::CheckUpdateResults  update result file Found! "));
-    return ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::ExecuteUpdateResultFileL
-// Read result code from update result file and update state accordingly. 
-// Show notifier "Update succesful". Do some cleanup.
-// ---------------------------------------------------------------------------
-//
-void CFotaUpdate::ExecuteUpdateResultFileL()
-    {
-    FLOG(_L("CFotaUpdate::ExecuteUpdateResultFileL >>"));
-
-    TInt err;
-    RFileReadStream rstr;
-    TInt result;
-    TInt msglen;
-    HBufC8* message = NULL;
-    HBufC16* message16 = NULL;
-    TBool deleteData(EFalse);
-
-    // Open update result file
-    FLOG(_L("opening rstr 1/2  "));
-    err = rstr.Open(iFotaServer->iFs, KUpdateResultFile, EFileRead
-            | EFileStream);
-    FLOG(_L("opened  rstr 2/2  "));
-    if (err)
-    	{
-        FLOG(_L("   update result file open err %d"), err);
-      }
-    User::LeaveIfError(err);
-    FLOG(_L("       0.1"));
-    CleanupClosePushL(rstr);
-    FLOG(_L("       0.2"));
-
-    // Read resultcode 
-    result = rstr.ReadUint32L();
-    msglen = rstr.ReadUint32L();
-    if (msglen != 0)
-        {
-        message = HBufC8::NewLC(msglen + 1);
-        TPtr8 ptrdesc = message->Des();
-        TRAPD ( err2, rstr.ReadL(ptrdesc) );
-        if (err2 != KErrNone && err2 != KErrEof)
-            {
-            FLOG(_L("  file read err %d"), err2);
-            User::Leave(err2);
-            }
-
-        message16 = HBufC16::NewLC(message->Des().Length());
-        message16->Des().Copy(*message);
-        FLOG(_L("   1 update result: %d"), result);
-        FLOG(_L("   2 dbg msg: %S"), message16);
-        CleanupStack::PopAndDestroy(message16);
-        CleanupStack::PopAndDestroy(message);
-        }
-
-    FLOG(_L("       0.6 "));
-    CleanupStack::PopAndDestroy(&rstr);
-
-    // Map resultcode to FUMO result code
-    RFotaEngineSession::TState fstate = RFotaEngineSession::EUpdateFailed;
-    RFotaEngineSession::TResult fresult =
-            RFotaEngineSession::EResUpdateFailed;
-
-    FLOG(_L("   3"));
-    switch (result)
-        {
-        case UPD_OK:
-            {
-            fstate = RFotaEngineSession::EUpdateSuccessfulNoData;
-            fresult = RFotaEngineSession::EResSuccessful;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdSuccess);
-            }
-            break;
-        case UPD_INSTALL_REQUEST_IS_INVALID:
-            {
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResUpdateFailed;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-        case UPD_UPDATE_PACKAGE_IS_ABSENT:
-            {
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResUpdateFailed;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-        case UPD_UPDATE_PACKAGE_IS_CORRUPTED:
-            {
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResCorruptedFWUPD;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-        case UPD_UPDATE_PACKAGE_CONTENTS_IS_INVALID:
-            {
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResCorruptedFWUPD;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-        case UPD_UPDATE_PACKAGE_IS_NOT_COMPATIBLE_WITH_CURRENT_MOBILE_DEVICE:
-            {
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResPackageMismatch;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-        case UPD_FATAL_ERROR:
-            {
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResUpdateFailed;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-
-        default:
-            {
-            FLOG(_L("   3.1 invalid result: %d"), result);
-            fstate = RFotaEngineSession::EUpdateFailedNoData;
-            fresult = RFotaEngineSession::EResUpdateFailed;
-            deleteData = ETrue;
-            ShowDialogL(EFwUpdNotCompatible);
-            }
-            break;
-        }
-
-    // Find the state 60 (update  progressing) -> 100 (etc)
-    RArray<TInt> states;
-    TPackageState state;
-    CleanupClosePushL(states);
-    iFotaServer->iDatabase->OpenDBL();
-    iFotaServer->iDatabase->GetAllL(states);
-
-    FLOG(_L("   4.1 found %d states "), states.Count());
-    for (TInt i = 0; i < states.Count(); ++i)
-        {
-        TPackageState tmp;
-        TBuf8<KMaxFileName> tmpurl;
-        tmp = iFotaServer->iDatabase->GetStateL(states[i], tmpurl);
-        FLOG(_L("   5 got state "));
-        if (tmp.iState == RFotaEngineSession::EUpdateProgressing)
-            {
-            state = tmp;
-            state.iState = fstate;
-            state.iResult = fresult;
-            FLOG(_L("   6 Updating state id %d  to %d ,result %d  "),
-                    state.iPkgId, state.iState, state.iResult);
-            iFotaServer->iDatabase->SetStateL(state, KNullDesC8, EFDBState
-                    | EFDBResult);
-            }
-        }
-    iFotaServer->iDatabase->CloseAndCommitDB();
-    CleanupStack::PopAndDestroy(&states);
-
-    // Delete request file
-    err = BaflUtils::DeleteFile(iFotaServer->iFs, KUpdateRequestFile);
-    if (err != KErrNone && err != KErrNotFound)
-        {
-        FLOG(_L("   6.1  req file deleted, err %d"), err);
-        User::Leave(err);
-        }
-
-    // Write timestamp (shown to user in device management ui)
-    if (fresult == RFotaEngineSession::EResSuccessful)
-        {
-        RFileWriteStream wstr;
-        TTime time;
-        User::LeaveIfError(wstr.Replace(iFotaServer->iFs,
-                KUpdateTimeStampFileName, EFileWrite));
-        CleanupClosePushL(wstr);
-        time.HomeTime();
-        TInt year = time.DateTime().Year();
-        TInt month = time.DateTime().Month();
-        TInt day = time.DateTime().Day();
-        TInt hour = time.DateTime().Hour();
-        TInt minute = time.DateTime().Minute();
-        wstr.WriteInt32L(year);
-        wstr.WriteInt32L(month);
-        wstr.WriteInt32L(day);
-        wstr.WriteInt32L(hour);
-        wstr.WriteInt32L(minute);
-        CleanupStack::PopAndDestroy(1); // wstr
-        }
-    // Delete package content
-    if (deleteData && state.iPkgId > KErrNotFound)
-        {
-        iFotaServer->DeletePackageL(state.iPkgId);
-        DeleteUpdateResultFileL();
-        }
-
-    // Report state back to syncml server
-    if (state.iPkgId >= 0)
-        {
-        FLOG(_L("   6.1 creating device mgmt session for profile %d"),
-                state.iProfileId);
-        iFotaServer->ReportFwUpdateStatusL(state);
-        }
-    else
-        {
-        FLOG(_L(" No state found in 'update progress' mode! cannot report status to DM server "));
-        }
-
-    FLOG(_L("CFotaUpdate::ExecuteUpdateResultFileL <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::DeleteUpdateResultsL
-// ---------------------------------------------------------------------------
-//
-void CFotaUpdate::DeleteUpdateResultFileL()
-    {
-    FLOG(_L("CFotaUpdate::DeleteUpdateResultsL >>"));
-    // Delete result file
-    RFs fs;
-    __LEAVE_IF_ERROR(fs.Connect());
-    BaflUtils::DeleteFile(fs, KUpdateResultFile);
-    BaflUtils::DeleteFile(fs, KUpdateRequestFile);
-    BaflUtils::DeleteFile(fs, KUpdateBitmap);
-    BaflUtils::DeleteFile(fs, KRestartingBitmap);
-    fs.Close();
-    FLOG(_L("CFotaUpdate::DeleteUpdateResultsL <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::UpdateL
-// Updates the fw: Creates input files for update agent and boots device to 
-// update mode.
-// ---------------------------------------------------------------------------
-void CFotaUpdate::UpdateL()
-    {
-    FLOG(_L("CFotaUpdate::UpdateL() >>"));
-    // Set state ........................................
-    iFotaServer->iPackageState.iState
-            = RFotaEngineSession::EUpdateProgressing;
-    iFotaServer->iDatabase->OpenDBL();
-    iFotaServer->iDatabase->SetStateL(iFotaServer->iPackageState, KNullDesC8,
-            EFDBState);
-    iFotaServer->iDatabase->CloseAndCommitDB();
-
-    // Write update request for update agent..............
-    FLOG(_L("CFotaUpdate::UpdateL  1 writing update.req "));
-    TBuf16<KMaxFileName> dp2filepath;
-    HBufC16* dp2;
-    RFileWriteStream wstr;
-    CleanupClosePushL(wstr);
-    FLOG(_L("CFotaUpdate::UpdateL  2 getting pkg location"));
-    iFotaServer->DownloaderL()->GetUpdatePackageLocation(dp2filepath);
-
-    FLOG(_L("CFotaUpdate::UpdateL  3 craeting update.req"));
-    User::LeaveIfError(wstr.Replace(iFotaServer->iFs, KUpdateRequestFile,
-            EFileWrite));
-    wstr.WriteInt16L(1); // version number is  1
-    wstr.WriteInt32L(1); // count   of cmds is 1
-    wstr.WriteInt16L(0); // requestid is 0
-
-    dp2 = HBufC16::NewLC(dp2filepath.Length());
-    dp2->Des().Copy(dp2filepath);
-    wstr.WriteInt32L(dp2->Des().Length() + 1); // length of filename + null
-    wstr.WriteL(dp2->Des());
-    wstr.WriteInt16L(0); // null character
-    CleanupStack::PopAndDestroy(dp2);
-    CleanupStack::PopAndDestroy(&wstr); // wstr
-
-    FLOG(_L("CFotaUpdate::UpdateL  4 craeting update.bmp"));
-
-
-    // Write update graphic for update agent ...............
-    HBufC* updatetxt;
-    HBufC* restarttxt;
-    QString installstr = hbTrId("txt_device_update_info_installing");
-    QString rebootstr = hbTrId("txt_device_update_info_rebooting");
-    updatetxt = XQConversions::qStringToS60Desc(installstr);
-    restarttxt = XQConversions::qStringToS60Desc(rebootstr);
-    
-    WriteUpdateBitmapL( updatetxt->Des(), KUpdateBitmap );
-    WriteUpdateBitmapL( restarttxt->Des(), KRestartingBitmap );
-    delete updatetxt;
-    delete restarttxt;
-    
-    // Simulate update agent by writing result file.
-    CRepository* centrep(NULL);
-    TInt err = KErrNone;
-    TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    TInt simulate(KErrNotFound);
-    if (centrep)
-        {
-        err = centrep->Get(KSimulateUpdateAgent, simulate);
-        }
-    delete centrep;
-    if (simulate > 0)
-        {
-        FLOG(_L("CFotaUpdate::UpdateL  5  - writing update.resp"));
-        RFileWriteStream respstr;
-        CleanupClosePushL(respstr);
-        User::LeaveIfError(respstr.Replace(iFotaServer->iFs,
-                KUpdateResultFile, EFileWrite));
-
-        respstr.WriteUint32L(UPD_OK);
-        respstr.WriteUint32L(15);
-        respstr.WriteL(_L("UPDATE DONE!"));
-        CleanupStack::PopAndDestroy(&respstr);
-        }
-
-    iFotaServer->SetStartupReason(EFotaDefault);
-    
-    RStarterSession starter;
-    FLOG(_L("           starter->Connect"));
-    User::LeaveIfError(starter.Connect());
-    starter.Reset(RStarterSession::EFirmwareUpdate);
-    starter.Close();
-    FLOG(_L("CFotaUpdate::UpdateL() <<"));
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::CheckBatteryL()
-// Cheks if there's enough battery power to update
-// ---------------------------------------------------------------------------
-//
-TBool CFotaUpdate::CheckBatteryL()
-    {
-    FLOG(_L("CFotaUpdate::CheckBatteryL >>"));
-
-    TInt chargingstatus(EChargingStatusError);
-    TInt batterylevel(EBatteryLevelUnknown);
-    TBool enoughPower(EFalse);
-
-    // Read battery level
-
-    RProperty pw;
-    User::LeaveIfError(pw.Attach(KPSUidHWRMPowerState, KHWRMBatteryLevel));
-    User::LeaveIfError(pw.Get(batterylevel));
-
-    if (batterylevel >= BatteryLevelAccepted)
-        {
-        FLOG(_L("Battery charge is above acceptable level!"));
-        enoughPower = ETrue;
-        }
-    else
-        {
-
-        //Read charger status
-        User::LeaveIfError(pw.Attach(KPSUidHWRMPowerState,
-                KHWRMChargingStatus));
-        User::LeaveIfError(pw.Get(chargingstatus));
-        pw.Close();
-
-        // But charger is connected, power sufficient
-        if (chargingstatus == EChargingStatusCharging || chargingstatus
-                == EChargingStatusAlmostComplete || chargingstatus
-                == EChargingStatusChargingComplete || chargingstatus
-                == EChargingStatusChargingContinued)
-            {
-            FLOG(
-                    _L("Battery charge is below acceptable level, but charger is connected!"));
-            enoughPower = ETrue;
-            }
-        }
-
-    FLOG(_L("CFotaUpdate::CheckBattery, current charge = %d, ret = %d <<"),
-            batterylevel, enoughPower);
-    return enoughPower;
-    }
-
-void CFotaUpdate::MonitorBatteryChargeLevel()
-    {
-    FLOG(_L("CFotaUpdate::MonitorBatteryChargeLevel >>"));
-
-    CancelMonitor();
-
-    iProperty.Attach(KPSUidHWRMPowerState, KHWRMBatteryLevel);
-    TInt value = 0;
-
-    iProperty.Get(KPSUidHWRMPowerState, KHWRMBatteryLevel, value);
-
-    FLOG(_L("Battery level at this time is %d, err = %d"), value);
-    iStatus = KRequestPending;
-    iProperty.Subscribe(iStatus);
-
-    iMonitorType = BatteryLevel;
-    SetActive();
-
-    FLOG(_L("CFotaUpdate::MonitorBatteryChargeLevel <<"));
-    }
-
-void CFotaUpdate::MonitorBatteryChargingStatus()
-    {
-    FLOG(_L("CFotaUpdate::MonitorBatteryChargingStatus >>"));
-
-    CancelMonitor();
-
-    iProperty.Attach(KPSUidHWRMPowerState, KHWRMChargingStatus);
-    TInt value = 0;
-
-    iProperty.Get(KPSUidHWRMPowerState, KHWRMChargingStatus, value);
-
-    FLOG(_L("Charging status at this time is %d, err = %d"), value);
-    iStatus = KRequestPending;
-    iProperty.Subscribe(iStatus);
-
-    iMonitorType = ChargingStatus;
-    SetActive();
-
-    FLOG(_L("CFotaUpdate::MonitorBatteryChargingStatus <<"));
-    }
-
-void CFotaUpdate::CancelMonitor()
-    {
-    FLOG(_L("CFotaUpdate::CancelMonitor >>"));
-    if (IsActive())
-        {
-        FLOG(_L("Cancelling...."));
-        Cancel();
-        }
-    FLOG(_L("CFotaUpdate::CancelMonitor <<"));
-    }
-
-TBool CFotaUpdate::IsUSBConnected()
-    {
-    FLOG(_L("CFotaUpdate::IsUSBConnected >>"));
-    
-    TBool ret (EFalse);
-    TUsbDeviceState state(EUsbDeviceStateUndefined);
-    RUsb usbman;
-    TInt err = usbman.Connect();
-    if (err == KErrNone)
-        {
-        usbman.GetDeviceState(state);
-        usbman.Close();
-        }
-    if (state != EUsbDeviceStateUndefined)
-    	{
-        ret = ETrue;
-      }
-    
-    FLOG(_L("CFotaUpdate::IsUSBConnected, value = %d, ret = %d <<"), state, ret);
-    return ret;
-    }
-
-void CFotaUpdate::RunL()
-    {
-    FLOG(_L("CFotaUpdate::RunL >>"));
-
-    if (iStatus.Int() == KErrNone)
-        {
-        TInt value = 0;
-
-        if (iMonitorType == BatteryLevel)
-            {
-            iProperty.Get(KPSUidHWRMPowerState, KHWRMBatteryLevel,
-                    value);
-
-            FLOG(_L("Battery level has changed to %d"), value);
-
-            iFotaServer->UpdateBatteryLowInfo(
-                    (value >= BatteryLevelAccepted) ? EFalse : ETrue);
-
-            MonitorBatteryChargeLevel();
-            }
-        else if (iMonitorType == ChargingStatus)
-            {
-            iProperty.Get(KPSUidHWRMPowerState, KHWRMChargingStatus,
-                    value);
-
-            FLOG(_L("Charging status has changed to %d"), value);
-
-            if (value == EChargingStatusCharging || value
-                    == EChargingStatusAlmostComplete || value
-                    == EChargingStatusChargingComplete || value
-                    == EChargingStatusChargingContinued)
-                {
-                if (IsUSBConnected())
-                    {
-                    ShowDialogL(EFwUpdNotEnoughBattery);
-                    }
-                else
-                    {
-                    iFotaServer->UpdateBatteryLowInfo(EFalse);
-                    }
-                }
-            else
-                {
-                iFotaServer->UpdateBatteryLowInfo(ETrue);
-                }
-            }
-
-        }
-    FLOG(_L("CFotaUpdate::RunL, iStatus = %d <<"), iStatus.Int());
-    }
-
-// ---------------------------------------------------------------------------
-// CFotaUpdate::StartUpdateL
-// Starts fw updating (shows a notifier to user). 
-// ---------------------------------------------------------------------------
-//
-void CFotaUpdate::StartUpdateL(const TDownloadIPCParams &aParams)
-    {
-    FLOG(_L("CFotaUpdate::StartUpdateL,  pkig:%d >>"), aParams.iPkgId);
-
-    //First cancel any ongoing battery monitoring.
-    CancelMonitor();
-
-    UpdateL();
-
-    FLOG(_L("CFotaUpdate::StartUpdateL <<"));
-    }
-
-TInt CFotaUpdate::RunError(TInt aError)
-    {
-    FLOG(_L("CFotaUpdate::RunError, error = %d >>"), aError);
-    return aError;
-    }
-
-void CFotaUpdate::DoCancel()
-    {
-    FLOG(_L("CFotaUpdate::DoCancel >>"));
-
-    iProperty.Cancel();
-
-    FLOG(_L("CFotaUpdate::DoCancel <<"));
-    }
-
-void CFotaUpdate::ShowDialogL(TFwUpdNoteTypes aDialogid)
-    {
-    FLOG(_L("CFotaUpdate::ShowDialogL, dialogid = %d >>"), aDialogid);
-    iFotaServer->ServerCanShut(EFalse);
-
-    if (iFotaServer->FullScreenDialog())
-        iFotaServer->FullScreenDialog()->Close();
-
-    iNotifParams = CHbSymbianVariantMap::NewL();
-
-    HBufC* keyDialog = HBufC::NewL(10);
-    CleanupStack::PushL(keyDialog);
-    *keyDialog = KKeyDialog;
-
-    CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&aDialogid,
-            CHbSymbianVariant::EInt);
-    iNotifParams->Add(*keyDialog, dialogId);
-    iNotifier = CFotaDownloadNotifHandler::NewL(this);
-
-    iNotifier->LaunchNotifierL(iNotifParams, aDialogid);
-
-    CleanupStack::PopAndDestroy();
-    FLOG(_L("CFotaUpdate::ShowDialogL <<"));
-    }
-
-void CFotaUpdate::HandleDialogResponse(int response, TInt aDialogId)
-    {
-    FLOG(_L("CFotaUpdate::HandleDialogResponse, dialogid = %d response = %d >>"), aDialogId, response);
-
-    if (aDialogId == EFwUpdNotEnoughBattery)
-        {
-        iFotaServer->FinalizeUpdate();
-        }
-
-    FLOG(_L("CFotaUpdate::HandleDialogResponse <<"));
-    }
-
-TInt CFotaUpdate::WriteUpdateBitmapL( const TDesC& aText, const TDesC& aFile)
-    {
-    FLOG(_L("WriteUpdateBitmapL writing %S to %S w/ txtdir"),&aText,&aFile);
-
-    TSize   screensize = CCoeEnv::Static()->ScreenDevice()->SizeInPixels();
-    TInt                width  = screensize.iWidth - KBmpMargin*2;
-    TInt                height =  screensize.iHeight;
-
-    CArrayFixSeg<TPtrC>*   lines = new CArrayFixSeg<TPtrC>(5);
-    CleanupStack::PushL(lines);
-    CFbsBitmap*         bitmap = new ( ELeave ) CFbsBitmap;
-    CleanupStack::PushL( bitmap );
-    bitmap->Create(  TSize(width,height), EColor64K );
-    CFbsBitmapDevice*   device = CFbsBitmapDevice::NewL( bitmap );
-    CleanupStack::PushL( device );
-    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);
-    CFbsBitGc*          context;
-    User::LeaveIfError( device->CreateContext( context ) );
-    CleanupStack::PushL( context );
-    TInt                ascent = font->AscentInPixels();
-    TInt                descent = font->DescentInPixels();
-    context->UseFont ( font );
-    context->Clear(); // bg color
-
-    // Visually ordered text
-    HBufC* wrappedstring = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
-            aText, width,*font, *lines);
-    CleanupStack::PushL ( wrappedstring );
-    TBool dirfound (ETrue);
-    // direction of text, affects alignemnt
-    TBidiText::TDirectionality direction = TBidiText::TextDirectionality(
-            *wrappedstring, &dirfound );
-
-    // Print visual text to bitmap
-    for ( TInt i=0; i<lines->Count(); ++i ) 
-        {
-        TPtrC l = (*lines)[i];
-        TInt top = (ascent+descent)*(i);
-        TInt bot = (ascent+descent)*(i+1);
-        TRect rect (0, top ,width, bot );
-        CGraphicsContext::TTextAlign alignment = 
-        direction==TBidiText::ELeftToRight ? CGraphicsContext::ELeft 
-            : CGraphicsContext::ERight;
-        context->DrawText(l, rect, ascent, alignment);
-        }
-    height = (ascent+descent)*lines->Count() + descent;
-    bitmap->Resize( TSize(width,height));
-    bitmap->Save( aFile );
-    context->DiscardFont();
-    CleanupStack::PopAndDestroy( wrappedstring );
-    CleanupStack::PopAndDestroy( context );
-    CleanupStack::PopAndDestroy( device );
-    CleanupStack::PopAndDestroy( bitmap );
-    CleanupStack::PopAndDestroy( lines );
-    return 1;
-    }
--- a/fotaapplication/fotaserver/src/fsview.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of applicationmanagement components
- *
- */
-
-#include "fsview.h"
-#include "FotaServer.h"
-
-// ------------------------------------------------------------------------------------------------
-// FSView::FSView()
-// ------------------------------------------------------------------------------------------------
-FSView::FSView()
-    {
-    
-    }
-// ------------------------------------------------------------------------------------------------
-// FSView::~FSView()
-// ------------------------------------------------------------------------------------------------
-FSView::~FSView()
-    {
-    
-    }
-// ------------------------------------------------------------------------------------------------
-// FSView::eventFilter()
-// ------------------------------------------------------------------------------------------------
-bool FSView::eventFilter(QObject *object, QEvent *event)
-{   
-    switch (event->type())
-        {
-        case QEvent::ApplicationActivate:
-            {
-//            RDEBUG( "eventFilter: QEvent::ApplicationActivate start" );
-	    iServer->SetVisible(ETrue);
-//            RDEBUG( "eventFilter: end" );
-            break;
-            }
-        default:
-            break;
-        }
-return HbView::eventFilter(object, event); 
-}
-
-
-
-void FSView::SetServer(CFotaServer * aServer)
-{
-	iServer = aServer;
-}
--- a/fotaapplication/fotaserver/src/main.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of applicationmanagement components
- *
- */
-
-
-#include <hbapplication.h>
-#include <hbtransparentwindow.h>
-#include <hbstackedlayout.h>
-#include <hbmainwindow.h>
-#include <hbview.h>
-#include <QTranslator>
-#include <QLocale>
-#include <e32property.h>
-#include "FotaServer.h"
-#include "FotaSrvDebug.h"
-#include "fsview.h"
-
-int main(int argc, char *argv[])
-    { 
-    FLOG(_L("CFotaServer::Main >>"));
-
-    FLOG(_L("CFotaServer::HbApplication >>"));
-    HbApplication a(argc, argv);
-    
-    FSView* view = new FSView();
-    FLOG(_L("CFotaServer::HbView >>"));
-    view->hideItems(Hb::AllItems);
-    FLOG(_L("CFotaServer::hideItems >>"));
-    view->setContentFullScreen();
-    FLOG(_L("CFotaServer::setContentFullScreen >>"));
-
-    HbMainWindow mainWindow(0, Hb::WindowFlagTransparent);
-    FLOG(_L("CFotaServer::mainWindow >>"));
-
-    HbTransparentWindow *transparentWindow = new HbTransparentWindow;
-    FLOG(_L("CFotaServer::transparentWindow >>"));
-    HbStackedLayout *stackedLayout = new HbStackedLayout;
-    FLOG(_L("CFotaServer::stackedLayout >>"));
-    stackedLayout->addItem(transparentWindow);
-    FLOG(_L("CFotaServer::addItem >>"));
-    view->setLayout(stackedLayout);
-    FLOG(_L("CFotaServer::setLayout >>"));
-
-    mainWindow.addView(view);
-    FLOG(_L("CFotaServer::addView >>"));
-    mainWindow.setCurrentView(view);
-    mainWindow.lower();
-    FLOG(_L("CFotaServer::setCurrentView >>"));
-
-    // create the server (leave it on the cleanup stack)
-    CFotaServer* server = CFotaServer::NewInstance(mainWindow);
-
-    if (server == NULL)
-        {
-        return 0;
-        }
-    
-    mainWindow.show();
-
-    FLOG(_L("CFotaServer::show <<"));
-    //app.installEventFilter(view);
-    RSemaphore sem;
-    TInt ret = sem.OpenGlobal(KFotaServerScem);
-    FLOG(_L("CFotaServer::OpenGlobal >>"));
-
-    FLOG(_L("CFotaServer::showMaximized <<"));
-
-    QTranslator *translator = new QTranslator();
-    QString lang = QLocale::system().name();
-    QString path = "Z:/resource/qt/translations/";
-    bool fine = translator->load("deviceupdates_" + lang, path);
-    if (fine)
-        qApp->installTranslator(translator);
-    
-    QTranslator *commontranslator = new QTranslator();
-    fine = commontranslator->load("common_" + lang, path);/*finally required once localisation available*/
-       if(fine)
-            qApp->installTranslator(commontranslator);
-       else
-            qDebug("fotaserver common translator loading failed");
-
-       a.setApplicationName("FotaServer");
-    
-    
-    view->SetServer(server);
-    a.installEventFilter(view);
-
-
-    // Initialisation complete, now signal the client
-    if (ret == KErrNone)
-        {
-        sem.Signal();
-        FLOG(_L("CFotaServer::Signal <<"));
-        sem.Close();
-        FLOG(_L("CFotaServer::Close <<"));
-        }
-    FLOG(_L("CFotaServer::KErrNone <<"));
-    //This will install and start a active scheduler for this thread.
-    ret = a.exec();
-
-    RProperty::Set(TUid::Uid(KOmaDMAppUid), KFotaServerActive, 0);  
-    delete server;
-    FLOG(_L("CFotaServer::Main <<"));
-    return ret;
-    }
--- a/fotaapplication/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/fotaapplication/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -16,50 +16,12 @@
 *
 */
 
-PRJ_PLATFORMS
-DEFAULT
-
-#ifdef __SYNCML_DM_FOTA
-
-PRJ_EXPORTS
-../rom/fotaserver.iby																							CORE_MW_LAYER_IBY_EXPORT_PATH(fotaserver.iby)
-../rom/fotaserverresources.iby																		LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(fotaserverresources.iby)
 
 
-// Generic configuration interface for component cenrep settings  
-../conf/fotadiskstorage.confml                    MW_LAYER_CONFML(fotadiskstorage.confml)
-../conf/CI_fotadiskstorage.confml                    MW_LAYER_CONFML(CI_fotadiskstorage.confml)
-../conf/fotadiskstorage_102072C6.crml 	        MW_LAYER_CRML(fotadiskstorage_102072C6.crml)
-../conf/fotaserver.confml                    MW_LAYER_CONFML(fotaserver.confml)
-../conf/CI_fotaserver.confml                    MW_LAYER_CONFML(CI_fotaserver.confml)
-../conf/fotaserver_102072C4.crml 	        MW_LAYER_CRML(fotaserver_102072C4.crml)
-
-PRJ_EXTENSIONS
-START EXTENSION s60/mifconv
-  OPTION TARGETFILE fotaserver.mif
-  OPTION HEADERFILE fotaserver.mbg
-  OPTION SOURCES \
-	  -c8,8 qgn_prop_sml_http -c8,8 qgn_prop_sml_http_off -c8,8 qgn_prop_sml_bt \
-	  -c8,8 qgn_prop_sml_bt_off -c8,8 qgn_prop_sml_usb -c8,8 qgn_prop_sml_usb_off \
-	  -c8,8 qgn_menu_dm_cxt -c8,8 qgn_menu_dm_disabled_cxt -c8,8 qgn_note_sml \
-	  -c8,8 qgn_note_sml_server	  
-END
-
-START EXTENSION s60/mifconv
-  OPTION TARGETFILE fotaserver_aif.mif
-  OPTION SOURCES -c8,8 qgn_menu_dm
-END
-
-
-PRJ_MMPFILES
-
-../FotaEngine/group/fotaengine.mmp
-../fmsclient/group/fmsclient.mmp
-../fmserver/group/fmsserver.mmp
-../FotaScheduleHandler/group/fotaschedulehandler.mmp
-
+#ifdef __SYNCML_DM_FOTA
+#include "../fotaserver/group/bld.inf"
 #endif
 
 #if ( defined (__SYNCML_DM ) || defined (__PLUG_AND_PLAY_MOBILE_SERVICES) )
-#include "../fotacustcmds/group/bld.inf"
+#include "../fotaserver/fotacustcmds/group/bld.inf"
 #endif
--- a/fotaapplication/inc/FotaIPCTypes.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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:   interprocess messages
-*
-*/
-
-
-
-// INCLUDES
-#include "FotaIPCTypes.h"
-#include <centralrepository.h>
-#include "fotaserverPrivateCRKeys.h"
-
-// ======================= MEMBER FUNCTIONS ==================================
-
-// ---------------------------------------------------------------------------
-// TDownloadIPCParams::TDownloadIPCParams 
-// ---------------------------------------------------------------------------
-TDownloadIPCParams::TDownloadIPCParams () : iPkgId(-1),iProfileId(0)
-        , iSendAlert(ETrue)
-        , iIapId(-1), iPkgSize(0), iSessionType(0), iUpdateLtr (0)
-{
-    iPkgName        = KNullDesC8;
-    iPkgVersion     = KNullDesC8;
-}
-
-// ---------------------------------------------------------------------------
-// TDownloadIPCParams::TDownloadIPCParams 
-// ---------------------------------------------------------------------------
-TDownloadIPCParams::TDownloadIPCParams (const TDownloadIPCParams& p )
-                           : iPkgId ( p.iPkgId ), iProfileId (p.iProfileId )
-                           , iSendAlert( p.iSendAlert )
-                           , iIapId(p.iIapId), iPkgSize(p.iPkgSize), iSessionType(p.iSessionType), iUpdateLtr (p.iUpdateLtr)
-    {
-    iPkgName        = p.iPkgName;
-    iPkgVersion     = p.iPkgVersion;
-    }
-
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::TPackageState
-// ---------------------------------------------------------------------------
-TPackageState::TPackageState( RFotaEngineSession::TState aState, TInt aResult)
-    : TDownloadIPCParams (),  iState(aState), iResult(aResult)
-    						,iSmlTryCount( KDefaultSmlTryCount )
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::TPackageState
-// ---------------------------------------------------------------------------
-TPackageState::TPackageState( RFotaEngineSession::TState aState) 
-    : TDownloadIPCParams (), iState(aState), iResult(-1) 
-    						,iSmlTryCount( KDefaultSmlTryCount )
-    {
-	SetSmlTryCount();
-    }
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::TPackageState
-// ---------------------------------------------------------------------------
-TPackageState::TPackageState( TDownloadIPCParams p) : 
-    TDownloadIPCParams(p),iState(RFotaEngineSession::EIdle), iResult(-1)
-    					 ,iSmlTryCount( KDefaultSmlTryCount )
-    {  
-    SetSmlTryCount();
-    
-    }
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::TPackageState
-// ---------------------------------------------------------------------------
-TPackageState::TPackageState() : TDownloadIPCParams () 
-            ,iState(RFotaEngineSession::EIdle), iResult(-1)
-            ,iSmlTryCount( KDefaultSmlTryCount )
-    {
-    SetSmlTryCount();
-    }
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::SetSmlTryCount()
-// ---------------------------------------------------------------------------
-void TPackageState::SetSmlTryCount()
-{
-	 TInt err = KErrNone;
-	 TInt retry = 0;
-	 CRepository *centrep = NULL;
-      TRAP(err, centrep = CRepository::NewL( KCRUidFotaServer ) );
-    	    if ( centrep ) 
-        	{
-        	err = centrep->Get( KGenericAlertRetries, retry );
-        	delete centrep; centrep = NULL;
-        	}
-        	if(err == KErrNone)
-        	{
-        		
-            	    if(retry < 0 )
-            	    {
-            	    iSmlTryCount = KDefaultSmlTryCount;
-            	    }
-                  	else if( retry == 0 )
-               	    {
-               	     iSmlTryCount = 2 ;
-               	    }
-                	else if (retry > KMaximumSmlTryCount )
-               	    {
-               	     iSmlTryCount = KMaximumSmlTryCount + 1;
-               	    }
-                   	else
-                    {
-                	  iSmlTryCount = retry + 1;
-                    }
-        	    }
-        	 else
-        	    {
-        	    iSmlTryCount = KDefaultSmlTryCount;
-        	    }
-}
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::operator=
-// ---------------------------------------------------------------------------
-TPackageState& TPackageState::operator= ( const TDownloadIPCParams& a )
-    {
-    iPkgId      = a.iPkgId;
-    iProfileId  = a.iProfileId;
-    iPkgName    = a.iPkgName;
-    iPkgVersion = a.iPkgVersion;
-    iIapId		= a.iIapId;
-    iPkgSize	= a.iPkgSize;
-    iSessionType= a.iSessionType;
-    iUpdateLtr 	= a.iUpdateLtr;
-
-    return *this;
-    }
-
-
-// ---------------------------------------------------------------------------
-// TPackageState::operator=
-// ---------------------------------------------------------------------------
-TPackageState& TPackageState::operator=(const TPackageState& a)
-    {
-    iPkgId      = a.iPkgId; 
-    iProfileId  = a.iProfileId; 
-    iPkgName    = a.iPkgName; 
-    iPkgVersion = a.iPkgVersion;
-    iIapId		= a.iIapId;
-    iPkgSize	= a.iPkgSize;
-    iSessionType= a.iSessionType;
-    iUpdateLtr	= a.iUpdateLtr;
-    iState      = a.iState;  
-    iResult     = a.iResult;
-    iSmlTryCount= a.iSmlTryCount;
-    return *this;
-    }
- 
-            
-// End of File
--- a/fotaapplication/inc/FotaIPCTypes.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-/*
-* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-
-
-#ifndef __FOTAIPCTYPES_H_
-#define __FOTAIPCTYPES_H_
-
-// INCLUDES 
-#include <e32std.h>
-#include <SyncMLDef.h>
-#include "fotaengine.h"
-
-// DATA TYPES
-typedef TBuf16<200> TPkgIdList;
-
-/**
- *  Inter process parameters for fotaserver
- *
- *  @lib    fotaengine.lib
- *  @since  S60 v3.1
- */
-class TDownloadIPCParams
-    {
-
-public:
-    TDownloadIPCParams (); 
-
-
-    /**
-     * Copy constructor.
-     *
-     * @since   S60 v3.1
-     * @param   p Copy of another ipc
-     * @return  None
-    */
-    TDownloadIPCParams (const TDownloadIPCParams& p ); 
-
-
-    /**
-     * Package id
-     */
-    TInt                            iPkgId;
-    
-    /**
-     * Profile id
-     */
-    TSmlProfileId                   iProfileId;
-
-    
-    /**
-     * Package name
-     */
-    TBuf8<KFotaMaxPkgNameLength>    iPkgName;
-
-    
-    /**
-     * Package version
-     */
-    TBuf8<KFotaMaxPkgVersionLength> iPkgVersion;
-
-
-    /**
-     * Should DM server be notified via generic alert.
-     * This is not saved to database!
-     */
-    TBool iSendAlert;
-
-
-    /**
-     * IAP Id used
-     */
-    TInt iIapId;
-
-    /**
-     * Total size of the package
-     */
-    TUint iPkgSize;
-
-
-    /**
-     * DM Session type
-     */
-    TInt iSessionType;
-
-
-    /**
-     * Should update happen later?
-     */
-    TBool iUpdateLtr;
-    };
-
-
-/**
- *  Extended inter process parameters for fotaserver
- *
- *  @lib    fotaengine.lib
- *  @since  S60 v3.1
- */
-class TPackageState : public TDownloadIPCParams
-    {
-
-public:
-
-
-    /**
-     * Constructor
-     *
-     * @since   S60 v3.1
-     * @param   aState  State
-     * @param   aResult Result
-     * @return  None
-    */
-    TPackageState( RFotaEngineSession::TState aState, TInt aResult);
-    
-
-    /**
-     * Constructor
-     *
-     * @since   S60 v3.1
-     * @param   aState  State
-     * @return  None
-    */
-    TPackageState( RFotaEngineSession::TState aState);
-
-
-    /**
-     * Constructor
-     *
-     * @since   S60 v3.1
-     * @param   p  Ipc params
-     * @return  None
-    */
-    TPackageState( TDownloadIPCParams p);
-
-    TPackageState();
-
-    /**
-     * Assignment operator
-     *
-     * @since   S60 v3.1
-     * @param   a  Source 
-     * @return  None
-    */
-    TPackageState& operator=(const TDownloadIPCParams& a);
-
-
-    /**
-     * Assignment operator
-     *
-     * @since   S60 v3.1
-     * @param   a  Source 
-     * @return  None
-    */
-    TPackageState& operator=(const TPackageState& a);
-
-
-public:
-
-    /**
-     * State (see FUMO specification)
-     */
-    RFotaEngineSession::TState  iState;
-
-
-    /**
-     * Result code (FUMO)
-     */
-    TInt iResult;
-
-    /**
-     * Counter for generic alert raporting. If raporting fails, try again in
-     * successive boots until counter runs to 0
-     */
-    TInt iSmlTryCount;
-
-private :
-	/*
-	* Method to set the iSmlTryCount depending on Cenrep settings
-	*/
-	void SetSmlTryCount();
-};
-
-
-
-/**
- *  Update reminder task
- *
- *  @lib    fotaengine.lib
- *  @since  S60 v3.1
- */
-class TFotaScheduledUpdate
-{
-    public:
-    TFotaScheduledUpdate(const TInt aPkgId, const TInt aScheduleId)
-        {
-        iPkgId      = aPkgId;
-        iScheduleId = aScheduleId;
-        }
-
-    TInt                            iPkgId;
-
-    TInt                            iScheduleId;
-};
-
-#endif      // __FOTAIPCTYPES_H_   
-            
-// End of File
--- a/fotaapplication/inc/fmsclientserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of fotaserver component
-* 	This is part of fotaapplication.
-*
-*/
-
-// FMSClientServer.h
-//
-//
-#ifndef __FMS_CLIENTSERVER_H__
-#define __FMS_CLIENTSERVER_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-// server name
-
-_LIT(KFMSServerName,"FMSServer");
-
-//const TUid KFMSServerUid={0x200100C8}; //To be moved to fotaconst.h
-
-enum TFmsIpcCommands
-{
-    ENoInterrupt = 0, // Not to be used for IPC.
-    //For starting of the FMS monitoring during phone startup
-    EFotaStartUpPlugin = 1, //as continuation to upper enums
-    //For all download related interrupts
-    EDLUserInterrupt = 10,
-	EDLNetworkInterrupt,
-	EDLMemoryInterrupt,
-	EDLGeneralInterrupt,
-	
-	//For all update related interrupts
-	EUpdMonitorbattery = 20, 
-    EUpdPhoneCallActive,
-	EUpdMonitorPhoneCallEnd,
-	
-	//For canceling any outstanding request
-	ECancelOutstandingRequest = 30,
-};
-#endif
--- a/fotaapplication/rom/fotaserver.iby	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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:   Image description file for project fotaserver
-*
-*/
-
-
-
-#ifndef ___FOTASERVER_IBY__
-#define ___FOTASERVER_IBY__
-
-
-#ifdef __SYNCML_DM_FOTA
-
-#include <data_caging_paths_for_iby.hrh>
-
-file=ABI_DIR\BUILD_DIR\fotaengine.dll    SHARED_LIB_DIR\fotaengine.dll
-file=ABI_DIR\BUILD_DIR\FMSClient.dll    SHARED_LIB_DIR\FMSClient.dll
-
-
-S60_APP_EXE(fotaserver)
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,fotaserver)
-S60_APP_AIF_ICONS(fotaserver)
-
-
-file=ABI_DIR\BUILD_DIR\fotaschedulehandler.exe    PROGRAMS_DIR\fotaschedulehandler.exe
-file=ABI_DIR\BUILD_DIR\FMSServer.exe    PROGRAMS_DIR\FMSServer.exe
-
-data=DATAZ_/private/10003a3f/import/apps/fotaserver_reg.rsc 	/private/10003a3f/import/apps/fotaserver_reg.rsc
-
-
-#if ( defined (__SYNCML_DM ) || defined (__PLUG_AND_PLAY_MOBILE_SERVICES) )
-
-file=ABI_DIR\BUILD_DIR\fotacustcmds.dll SHARED_LIB_DIR\fotacustcmds.dll
-
-#endif // __SYNCML_DM || __PLUG_AND_PLAY_MOBILE_SERVICES
-
-#endif // __SYNCML_DM_FOTA
-
-#endif
--- a/fotaapplication/rom/fotaserverresources.iby	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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:   Image description file for project fotaserver
-*
-*/
-
-
-
-#ifndef ___FOTASERVERRESOURCES_IBY__
-#define ___FOTASERVERRESOURCES_IBY__
-
-#ifdef __SYNCML_DM_FOTA
-// Backup registration
-#include <data_caging_paths_for_iby.hrh>
-
-data=DATAZ_/resource/apps/fotaserver.rsc 	/resource/apps/fotaserver.rsc
-#endif // __SYNCML_DM_FOTA
-
-#endif
--- a/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -37,6 +37,9 @@
 //remotemgmt_plat
 #include "../remotemgmt_plat/group/bld.inf"
 
+//devicediagnosticsfw
+#include "../devicediagnosticsfw/group/bld.inf"
+
 //dcmofw
 #include "../dcmofw/group/bld.inf"
 
@@ -45,6 +48,3 @@
 
 //remotemgmt_pub
 #include "../remotemgmt_pub/group/bld.inf"
-
-//devicemgmtnotifications
-#include "../devicemgmtnotifications/group/bld.inf"
\ No newline at end of file
--- a/layers.sysdef.xml	Tue Aug 31 16:04:06 2010 +0300
+++ b/layers.sysdef.xml	Wed Sep 01 12:27:42 2010 +0100
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
   <!ENTITY layer_real_source_path "sf/mw/remotemgmt" >
 ]>
 
-<SystemDefinition name="remotemgmt" schema="1.5.1">
+<SystemDefinition name="remotemgmt" schema="1.4.0">
   <systemModel>
     <layer name="mw_layer">
       <module name="remotemgmt">
         <unit unitID="spdo.remotemgmt" mrp="" bldFile="&layer_real_source_path;/group" name="remotemgmt" />
-		<unit unitID="spdo.remotemgmt.pro" mrp="" bldFile="&layer_real_source_path;" name="remotemgmt_pro" proFile="remotemgmt.pro"/>
       </module>
       <module name="policyenginepolicies"> 
      	<unit unitID="spdo.remotemgmt.policyenginepolicies" mrp="" bldFile="&layer_real_source_path;/policymanagement/policyengine/policyenginepolicies/group" filter="!dfs_build"  name="spdo_remotemgmt_policyenginepolicies"  />
--- a/omaprovisioning/pnputil/src/PnpProvUtil.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/pnputil/src/PnpProvUtil.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -68,7 +68,7 @@
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
-EXPORT_C CPnpProvUtil* CPnpProvUtil::NewL()
+CPnpProvUtil* CPnpProvUtil::NewL()
     {
 
     CPnpProvUtil* self = NewLC();
--- a/omaprovisioning/pnputil/src/PnpUtilImpl.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/pnputil/src/PnpUtilImpl.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -904,7 +904,7 @@
 // CPnpUtilImpl::FetchAccessPoint
 // -----------------------------------------------------------------------------
 //
-EXPORT_C TInt CPnpUtilImpl::FetchAccessPoint(TUint32& /*aAP*/)
+TInt CPnpUtilImpl::FetchAccessPoint(TUint32& /*aAP*/)
     {
     // Not used
     return KErrNotSupported;
--- a/omaprovisioning/pnputil/tsrc/ModuleTest/group/TestPnpUtil.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/pnputil/tsrc/ModuleTest/group/TestPnpUtil.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -18,7 +18,7 @@
 
 #if defined(__S60_)
         // To get the OSEXT_LAYER_SYSTEMINCLUDE-definition
-        #include <domain/osextensions/platform_paths.hrh>
+        #include <platform_paths.hrh>
 #endif
 #include <data_caging_paths.hrh>
 
@@ -35,13 +35,33 @@
 //TARGETPATH      ?target_path
 //DEFFILE         TestPnpUtil.def
 
+#ifdef SBSV2
+USERINCLUDE     ../inc 
 
+	#if defined(__S60_)
+	    OSEXT_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/internal
+	#endif // __S60_
+
+SOURCEPATH      ../src
+#else // SBSV2 not defined
 USERINCLUDE     ../inc 
 
+	#if defined(__S60_)
+OSEXT_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/internal
+	#endif // __S60_
+
+APP_LAYER_SYSTEMINCLUDE
 MW_LAYER_SYSTEMINCLUDE
 
-SYSTEMINCLUDE   /epoc32/include/internal
-
+#endif // SBSV2
+APP_LAYER_SYSTEMINCLUDE
+MW_LAYER_SYSTEMINCLUDE
 
 SOURCE          ../src/TestPnpUtil.cpp
 SOURCE          ../src/TestPnpUtilBlocks.cpp
--- a/omaprovisioning/provisioning/AuthTypePlugin/Group/Authtypeplugin.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/AuthTypePlugin/Group/Authtypeplugin.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -65,7 +65,7 @@
 LIBRARY             avkon.lib
 LIBRARY             bafl.lib
 LIBRARY             commdb.lib
-LIBRARY             CommonEngine.lib // RConeResourceLoader
+LIBRARY             commonengine.lib // RConeResourceLoader
 LIBRARY             cone.lib
 LIBRARY             ecom.lib
 LIBRARY             efsrv.lib
--- a/omaprovisioning/provisioning/Group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/Group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -38,20 +38,92 @@
 
 // Generic configuration interface for component cenrep settings  
 ../conf/s60provisioning.confml                    MW_LAYER_CONFML(provisioning.confml)
-../conf/CI_s60provisioning.confml                    MW_LAYER_CONFML(CI_provisioning.confml)
 ../conf/s60provisioning_101F87AA.crml 	        MW_LAYER_CRML(provisioning_101F87AA.crml)
 
 ../Rom/Provisioning.iby										CORE_MW_LAYER_IBY_EXPORT_PATH(provisioning.iby)
+//../rom/Provisioning_variant.iby						CUSTOMER_MW_LAYER_IBY_EXPORT_PATH(provisioning_variant.iby)
 ../Rom/ProvisioningResources.iby					LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(provisioningresources.iby)
 ../loc/Provisioning.loc									MW_LAYER_LOC_EXPORT_PATH(provisioning.loc)
+../IMAdapter/loc/WPWVAdapter.loc				MW_LAYER_LOC_EXPORT_PATH(wpwvadapter.loc)
+../MbxNbrAdapter/loc/MailboxAdapter.loc		MW_LAYER_LOC_EXPORT_PATH(mailboxadapter.loc)
+../ProvisioningBC/loc/ProvisioningBC.loc					MW_LAYER_LOC_EXPORT_PATH(provisioningbc.loc)
+//../ProvisioningCx/loc/ProvisioningCx.loc					MW_LAYER_LOC_EXPORT_PATH(provisioningcx.loc)
+../StreamingAdapter/loc/StreamingAdapter.loc				MW_LAYER_LOC_EXPORT_PATH(streamingadapter.loc)
+../AuthTypePlugin/loc/Authtypeplugin.loc 					MW_LAYER_LOC_EXPORT_PATH(authtypeplugin.loc)
+../accesspointadapter/loc/WPAPAdapter.loc                       MW_LAYER_LOC_EXPORT_PATH(wpapadapter.loc)
+../cpdestinationnwadapter/loc/wpdestinationnwadapter.loc	MW_LAYER_LOC_EXPORT_PATH(wpdestinationnwadapter.loc)
 
 PRJ_EXTENSIONS
+#ifdef SBSV2
+
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE provisioningcx.mif
+OPTION HEADERFILE provisioningcx.mbg
+OPTION SOURCES -c8,8 qgn_menu_set_cxt.bmp
+END
+
+#ifdef __SCALABLE_ICONS
+    START EXTENSION s60/mifconv
+		OPTION TARGETFILE provisioningcx_aif.mif
+		OPTION SOURCES -c8,8 qgn_menu_set.svg
+		END
+#else
+    START EXTENSION s60/mifconv
+		OPTION TARGETFILE provisioningcx_aif.mbm
+		OPTION SOURCES -c8,8 qgn_menu_set_lst.bmp -c8,8 qgn_menu_set_cxt.bmp 
+		END   
+#endif
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE Authtypeplugin.mif
+OPTION HEADERFILE Authtypeplugin.mbg
+OPTION SOURCES -c8,8 qgn_prop_set_conn_config
+END
+#endif
+
 
 PRJ_MMPFILES
 
+
 ../ProvisioningEngine/Group/ProvisioningEngine.mmp
 ../ProvisioningParser/Group/ProvisioningParser.mmp
 ../ProvisioningHandler/Group/ProvisioningHandler.mmp
+../accesspointadapter/group/WPAPAdapter.mmp
+../WAPAdapter/Group/WPWAPAdapter.mmp
+../IMAdapter/Group/IMAdapter.mmp
+../StreamingAdapter/Group/StreamingAdapter.mmp
+//../ProvisioningCx/group/ProvisioningCx.mmp
+../ProvisioningBC/Group/ProvisioningBC.mmp
+../MbxNbrAdapter/Group/MbxNbrAdapter.mmp
+../cpdestinationnwadapter/group/wpdestinationnwadapter.mmp
+
+
+
+../AuthTypePlugin/Group/Authtypeplugin.mmp
+../alwaysonadapter/Group/alwaysonadapter.mmp
+
+#ifdef __SMART_CARD_PROV
+    ../ProvisioningSC/Group/ProvisioningSC.mmp
+#endif
+
+
+#ifndef SBSV2
+
+gnumakefile ../ProvisioningCx/group/iconscxdc.mk
+
+#ifdef __SCALABLE_ICONS
+    gnumakefile ../ProvisioningCx/group/Iconscxaifscalabledc.mk
+#else
+    gnumakefile ../provisioningcx/group/Iconscxaifbitmaps.mk
+#endif
+
+gnumakefile ../AuthTypePlugin/Group/AuthtypePluginIcons.mk
+
+#endif
+
+
+
 
 PRJ_TESTMMPFILES
 
--- a/omaprovisioning/provisioning/IMAdapter/Group/IMAdapter.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Group/IMAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -57,9 +57,9 @@
 LIBRARY         provisioningengine.lib
 LIBRARY         wvsapsettingsstore.lib
 LIBRARY         msgeditorutils.lib
+LIBRARY         apengine.lib
 LIBRARY         commdb.lib
-LIBRARY         inetprotutil.lib
-LIBRARY         cmmanager.lib 
+LIBRARY         inetprotutil.lib 
 DEBUGLIBRARY    flogger.lib
 
 
--- a/omaprovisioning/provisioning/IMAdapter/Inc/CWPIMAdapter.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Inc/CWPIMAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -29,7 +29,7 @@
 // FORWARD DECLARATIONS
 class CWPCharacteristic;
 class CWPIMSAPItem;
-
+class CApAccessPointItem;
 
 // CLASS DECLARATION
 
--- a/omaprovisioning/provisioning/IMAdapter/Inc/CWPPecAdapter.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Inc/CWPPecAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -28,7 +28,7 @@
 // FORWARD DECLARATIONS
 class CWPCharacteristic;
 class CWPIMSAPItem;
-
+class CApAccessPointItem;
 
 // CLASS DECLARATION
 
--- a/omaprovisioning/provisioning/IMAdapter/Inc/WPIMUtil.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Inc/WPIMUtil.h	Wed Sep 01 12:27:42 2010 +0100
@@ -40,6 +40,7 @@
 
 // FORWARD DECLARATIONS
 class RResourceFile;
+class CApAccessPointItem;
 class CWPCharacteristic;
 // CLASS DECLARATION
 
@@ -88,7 +89,7 @@
         */
         static TBool HasIllegalChars( const TDesC& aDes );
 			
-        static TUint32 FindGPRSL( RPointerArray<CWPCharacteristic>& aLinks );
+        static CApAccessPointItem* FindGPRSL( RPointerArray<CWPCharacteristic>& aLinks );
         
         /**
         * Checks the validity of current data
--- a/omaprovisioning/provisioning/IMAdapter/Src/CWPIMAdapter.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Src/CWPIMAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -25,6 +25,9 @@
 #include <CWPParameter.h>
 #include <wpwvadapterresource.rsg>
 
+#include <ApDataHandler.h>
+#include <ApAccessPointItem.h>
+#include <ApUtils.h>
 #include <commdb.h>
 #include "WPAdapterUtil.h"
 #include "CWPIMSAPItem.h"
@@ -171,8 +174,19 @@
         TUint32 iapId(KMaxTUint32);
         if(data->iLinks.Count())
     	    {
-            iapId = WPIMUtil::FindGPRSL( data->iLinks );
-            }
+            CApAccessPointItem* item = WPIMUtil::FindGPRSL( data->iLinks );
+          	CleanupStack::PushL( item );
+
+            // get the WAP id
+        	CCommsDatabase* commDb = CCommsDatabase::NewL();
+        	CleanupStack::PushL(commDb);
+        	TUint32 uid( item->WapUid() );
+
+        	// Convert WAP uid to IAP uid
+            CApUtils* apUtils = CApUtils::NewLC( *commDb );
+        	iapId = apUtils->IapIdFromWapIdL( uid );
+        	CleanupStack::PopAndDestroy( 3 ); // apUtils, commDb, item    
+    	    }
     	// set the IAP id as part of save item.
     	sapItem->SetIAPIdL( iapId );
            
--- a/omaprovisioning/provisioning/IMAdapter/Src/CWPPecAdapter.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Src/CWPPecAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -24,6 +24,9 @@
 #include <CWPParameter.h>
 #include <wpwvadapterresource.rsg>
 
+#include <ApDataHandler.h>
+#include <ApAccessPointItem.h>
+#include <ApUtils.h>
 #include <commdb.h>
 #include "WPAdapterUtil.h"
 #include "CWPIMSAPItem.h"
@@ -170,12 +173,22 @@
         sapItem->SetSettingsNameL( data->iName );
 
     	// Find a proper GPRS access point
-        TUint32 iapId = WPIMUtil::FindGPRSL( data->iLinks );
-    	
+        CApAccessPointItem* item = WPIMUtil::FindGPRSL( data->iLinks );
+    	CleanupStack::PushL( item );
+
+        // get the WAP id
+    	CCommsDatabase* commDb = CCommsDatabase::NewL();
+    	CleanupStack::PushL(commDb);
+    	TUint32 uid( item->WapUid() );
+
+    	// Convert WAP uid to IAP uid
+        CApUtils* apUtils = CApUtils::NewLC( *commDb );
+    	TUint32 iapId = apUtils->IapIdFromWapIdL( uid );
 
     	// set the IAP id as part of save item.
     	sapItem->SetIAPIdL( iapId );
            
+    	CleanupStack::PopAndDestroy( 3 ); // apUtils, commDb, item    
         // store SAP item
         TUint32 SAPuid = sapItem->StoreL();
     	data->iSAPId = SAPuid;
--- a/omaprovisioning/provisioning/IMAdapter/Src/WPIMUtil.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/IMAdapter/Src/WPIMUtil.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -26,9 +26,9 @@
 #include <data_caging_path_literals.hrh>
 
 #include <CWPCharacteristic.h>
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
-#include <cmpluginpacketdatadef.h>
+#include <ApDataHandler.h>
+#include <ApAccessPointItem.h>
+#include <ApUtils.h>
 #include <commdb.h>
 #include "WPAdapterUtil.h"
 #include <wpwvadapterresource.rsg>
@@ -47,43 +47,40 @@
 // CWPPecAdapter::FindGPRSL
 // -----------------------------------------------------------------------------
 //
-TUint32 WPIMUtil::FindGPRSL( 
+CApAccessPointItem* WPIMUtil::FindGPRSL( 
                                       RPointerArray<CWPCharacteristic>& aLinks )
 	{
-	TUint32 iapID=NULL;
-	RCmManagerExt  cmmanagerExt;
-	cmmanagerExt.OpenL();
-	CleanupClosePushL(cmmanagerExt);
-	TUint32 bearer = 0;
+	CCommsDatabase* commDb = CCommsDatabase::NewL();
+	CleanupStack::PushL( commDb );
+	CApDataHandler* apHandler = CApDataHandler::NewLC( *commDb );
+	
+    for( TInt i( 0 ); i < aLinks.Count(); i++ )
+        {
+        CWPCharacteristic* curr = aLinks[i];
 
-	
-	for( TInt i( 0 ); i < aLinks.Count(); i++ )
-	   {
-	   CWPCharacteristic* curr = aLinks[i];
+        TPckgBuf<TUint32> uidPckg;
+        for( TInt dataNum( 0 ); curr->Data( dataNum ).Length() == uidPckg.MaxLength(); dataNum++ )
+            {
+            uidPckg.Copy( curr->Data( dataNum ) );
 
-	   TPckgBuf<TUint32> uidPckg;
-	   for( TInt dataNum( 0 ); curr->Data( dataNum ).Length() == uidPckg.MaxLength(); dataNum++ )
-	      {
-	      uidPckg.Copy( curr->Data( dataNum ) );
-	      RCmConnectionMethodExt cm;
-	      cm = cmmanagerExt.ConnectionMethodL( uidPckg() );
-	      CleanupClosePushL( cm );
-	      bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );
-	      if(bearer == KUidPacketDataBearerType)
-	        {
-	        iapID = cm.GetIntAttributeL(CMManager::ECmIapId);
-	        CleanupStack::PopAndDestroy(2);
-	        return iapID;
-	        }
-	      CleanupStack::PopAndDestroy();  // cm         
-	      }
-	    }
-	CleanupStack::PopAndDestroy(); //cmmanagerExt
-	
+			CApAccessPointItem* item = CApAccessPointItem::NewLC();
+	        // Read the access point pointed to by TO-NAPID or TO-PROXY
+	        apHandler->AccessPointDataL( uidPckg(), *item );
+
+            if( item->BearerTypeL() == EApBearerTypeGPRS )
+                {
+				CleanupStack::Pop(); // item
+	            CleanupStack::PopAndDestroy( 2 ); // apHandler, commDb
+				return item;
+                }
+			CleanupStack::PopAndDestroy( item );
+            }
+        }
+
 	// This leave is absolutely needed as it pops & destroys 
 	// data in CleanupStack
-  //  User::Leave( KErrNotFound );
-    return iapID;
+    User::Leave( KErrNotFound );
+    return NULL;
 	}
 
 // -----------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/Data/10207281.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 1020 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:  ECOM DLL interface & implementation description resource for
+*                this DLL.
+*
+*/
+
+
+//  INCLUDES
+#include <registryinfo.rh>
+
+#include "ProvisioningUIDs.h"
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM DLL interface & implementation description resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x10207281;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KProvisioningAdapterInterface;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10207282;
+                    version_no = 1;
+                    display_name = "WAP Mbx Nbr PA"; // Use short name to save RAM and ROM space
+                    default_data = "";
+                    opaque_data = "10"; // Adapter priority
+                    }
+                };
+            }
+        };
+    }
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/Data/WPMbxNbrAdapterResource.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file.
+*
+*/
+
+
+//  INCLUDES
+#include    <badef.rh>
+#include    <mailboxadapter.loc>
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// Mailbox number adapter title resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LBUF r_mailbox_number_adapter_title
+	{
+	txt = qtn_op_head_mailbox;
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/Group/MbxNbrAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for mailbox number settings adapter.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+#include <data_caging_paths.hrh>
+
+TARGET          wpmbxnbradapter.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x10207281
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_ECOM_PLUGIN
+
+SOURCEPATH      ../Src
+SOURCE          MbxNbrAdapter.cpp
+SOURCE          MbxNbrAdapterGroupProxy.cpp
+
+SOURCEPATH      ../Data
+
+START RESOURCE 10207281.rss
+TARGET wpmbxnbradapter.rsc
+END
+
+START RESOURCE WPMbxNbrAdapterResource.rss
+HEADER
+TARGET wpmbxnbradapterresource.rsc
+TARGETPATH RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+USERINCLUDE     .
+USERINCLUDE     ../Inc
+USERINCLUDE     ../../Group
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+
+LIBRARY         euser.lib
+LIBRARY         provisioningengine.lib
+LIBRARY         commonengine.lib
+LIBRARY         vmbx.lib
+LIBRARY 		centralrepository.lib
+
+DEBUGLIBRARY    flogger.lib
+
+
+SMPSAFE
+//end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/Inc/MbxNbrAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2002 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:  Handles mailbox number settings in OMA provisioning.
+*
+*/
+
+
+#ifndef MbxNbrAdapter_H
+#define MbxNbrAdapter_H
+
+// INCLUDES
+
+#include    <CWPAdapter.h>
+
+// FORWARD DECLARATIONS
+//struct TMbxNbrAdapterData;
+
+
+// MODULE DATA STRUCTURES
+    
+// ENUMERATIONS
+
+
+// CLASS DECLARATION
+
+/**
+ * CMbxNbrAdapter handles accesspoint settings.
+ */ 
+class CMbxNbrAdapter : public CWPAdapter
+    {
+    private:    // ENUMERATIONS
+    
+        enum TMailboxType
+            {
+            ECSVoiceMailbox = 1,    // Default if type is not received in XML
+            ECSVideoMailbox
+            };
+            
+    private:    // MODULE DATA STRUCTURES
+    
+        struct TMbxNbrAdapterData
+            {
+            TPtrC iName;
+            TPtrC iMailboxNumber;
+            TBool iVidiosupport;
+            TBool iIsVideosupport;
+            TMailboxType iMailboxType;
+            };    
+                
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @return a instance of class.
+        */
+        static CMbxNbrAdapter* NewL();
+
+        /**
+        * Destructor
+        */
+        virtual ~CMbxNbrAdapter();
+
+    public: // Functions from base classes
+
+        /**
+        * From CWPAdapter
+        */
+        TInt ItemCount() const;
+
+        /**
+        * From CWPAdapter
+        */
+        const TDesC16& SummaryTitle( TInt aIndex ) const;
+
+        /**
+        * From CWPAdapter
+        */
+        const TDesC16& SummaryText( TInt aIndex ) const;
+
+        /**
+        * From CWPAdapter
+        */
+        TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
+
+        /**
+        * From CWPAdapter
+        */
+        void SaveL( TInt aItem );
+
+        /**
+        * From CWPAdapter
+        */
+        TBool CanSetAsDefault( TInt aItem ) const;
+
+        /**
+        * From CWPAdapter
+        */
+        void SetAsDefaultL( TInt aItem );
+
+        /**
+        * From CWPAdapter
+        */
+        void VisitL( CWPCharacteristic& aElement );
+
+        /**
+        * From CWPAdapter
+        */
+        void VisitL( CWPParameter& aElement );
+
+        /**
+        * From CWPAdapter
+        */
+        void VisitLinkL( CWPCharacteristic& aCharacteristic );
+
+    private:  // Default constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CMbxNbrAdapter();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // New functions
+
+        /**
+        * Validates the data in iTempData.
+        */
+        TBool IsValid();
+
+        /**
+        * Validates the phone number string.
+        */
+        TBool IsValidPhoneNumber( const TDesC& aPtr );
+
+        /**
+        * Parses an mailbox type from a descriptor.
+        */
+        void ParseMbxTypeL( const TDesC& aPtr, TMailboxType& aInt );
+
+        /**
+        * Parses an video ON/OFF type from a descriptor.
+        */
+
+        void ParseVideoTypeL( const TDesC& aPtr, TBool& aInt, TBool& aInt1 );
+
+    private: // Data
+
+        HBufC* iTitle;
+
+        TPtrC iAppId;
+        RArray<TMbxNbrAdapterData> iSettings;
+        TMbxNbrAdapterData iTempData;
+
+	private:
+		friend class T_CWPMbxNbrAdapter;
+	
+
+    };
+
+#endif  // MbxNbrAdapter_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/Src/MbxNbrAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,384 @@
+/*
+* Copyright (c) 2002 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:  Handles mailbox number settings in OMA provisioning.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <f32file.h>
+#include    <CWPCharacteristic.h>
+#include    <CWPParameter.h>
+#include    <wpmbxnbradapterresource.rsg>
+#include    <vmnumber.h>
+#include    <commonphoneparser.h>
+#include 	<voicemailboxdomaincrkeys.h>
+#include 	<centralrepository.h>
+
+#include    "WPAdapterUtil.h"
+#include    "MbxNbrAdapter.h"
+#include    "ProvisioningDebug.h"
+
+// CONSTANTS
+#if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw
+    _LIT( KAdapterName, "WPMbxNbrAdapterResource" );
+#else
+    _LIT( KAdapterName, "WPMbxNbrAdapter" );
+#endif
+_LIT( KMailboxNumberStr, "MBNMBR" );
+_LIT( KMailboxTypeStr, "MBTYPE" );
+_LIT( KCSVideoMailboxType, "VIDEO" );
+_LIT( KVideoSupportType, "VIDEO_MBOX_SUPPORT" );
+_LIT( KVideoSupportTypeTrue, "TRUE" );
+_LIT( KVideoSupportTypeFalse, "FALSE" );
+_LIT( KMailboxAppId, "w9027" );        // From OMA provisioning registration document
+const TInt KSettingsGranularity = 2;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::CMbxNbrAdapter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMbxNbrAdapter::CMbxNbrAdapter() : 
+    iSettings( KSettingsGranularity )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::ConstructL()
+    {
+    FLOG( _L( "[Provisioning] CMbxNbrAdapter::ConstructL:" ) );
+    
+    TFileName fileName;
+    Dll::FileName( fileName );
+    iTitle = WPAdapterUtil::ReadHBufCL( fileName,
+                                        KAdapterName,
+                                        R_MAILBOX_NUMBER_ADAPTER_TITLE );
+                                        
+    FLOG( _L( "[Provisioning] CMbxNbrAdapter::ConstructL: Done" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMbxNbrAdapter* CMbxNbrAdapter::NewL()
+    {
+    CMbxNbrAdapter* self = new( ELeave ) CMbxNbrAdapter; 
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::~CMbxNbrAdapter
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CMbxNbrAdapter::~CMbxNbrAdapter()
+    {
+    delete iTitle;
+    iSettings.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::ItemCount
+// -----------------------------------------------------------------------------
+//
+TInt CMbxNbrAdapter::ItemCount() const
+    {
+	// SummaryTitle(), SummaryText(), SaveL(), SetAsDefaultL() and 
+	// CanSetAsDefault() are called ItemCount() times
+	return iSettings.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::SummaryTitle
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CMbxNbrAdapter::SummaryTitle( TInt /*aIndex*/ ) const
+    {
+    return *iTitle;
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::SummaryText
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CMbxNbrAdapter::SummaryText( TInt aIndex ) const
+    {
+    // SummaryText should be called ItemCount() times
+    __ASSERT_DEBUG( iSettings.Count() > aIndex, 
+        User::Panic( _L("CMbxNbrAdapter::SummaryText"),  KErrCorrupt ) );
+    __ASSERT_DEBUG( aIndex >= 0, 
+        User::Panic( _L("CMbxNbrAdapter::SummaryText"),  KErrCorrupt ) );              
+    return iSettings[ aIndex ].iName;
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::DetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CMbxNbrAdapter::DetailsL( TInt /*aItem*/, MWPPairVisitor& /*aVisitor*/ )
+    {
+    // Detail view is a feature for later release.
+    return KErrNotSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::SaveL
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::SaveL( TInt aItem )
+    {
+    FLOG( _L( "[Provisioning] CMbxNbrAdapter::SaveL:" ) );
+    __ASSERT_DEBUG( iSettings.Count() > aItem, User::Leave( KErrCorrupt ) ); 
+    __ASSERT_DEBUG( aItem >= 0, User::Leave( KErrCorrupt ) ); 
+   
+    RVmbxNumber model;
+    User::LeaveIfError( model.Open() );
+    CleanupClosePushL( model );  
+       
+    TInt err( KErrNone );    
+    switch( iSettings[aItem].iMailboxType )
+        {
+        case ECSVoiceMailbox:
+            err = model.SaveVmbxNumber( iSettings[aItem].iMailboxNumber, 
+                                        EAlsActiveLineEntry );
+            break;
+        case ECSVideoMailbox:
+        FLOG( _L( "[Provisioning] CMbxNbrAdapter::SaveL:case ECSVideoMailbox" ) );
+            err = model.SaveVideoMbxNumber( iSettings[aItem].iMailboxNumber, 
+                                            EAlsActiveLineEntry );        
+            if ( iSettings[aItem].iIsVideosupport )
+            {
+            CRepository* cenrep = CRepository::NewL( KCRUidVideoMailbox );
+	        FLOG( _L( "[Provisioning] CMbxNbrAdapter::SaveL:case Saving it to Cenrep" ) );
+	        TBuf<100> buf1;
+	        buf1.AppendNum( iSettings[aItem].iVidiosupport );
+	        
+	        FLOG( buf1 );
+            CleanupStack::PushL(cenrep);
+			User::LeaveIfError(
+			cenrep->Set( KVideoMbxSupport, iSettings[aItem].iVidiosupport )); 
+			FLOG( _L( "[Provisioning] CMbxNbrAdapter::SaveL:case Saved" ) );
+			CleanupStack::PopAndDestroy(cenrep);
+            }
+            break;
+        default:
+            User::Leave( KErrCorrupt );
+            break;  
+        }
+
+    User::LeaveIfError( err );        
+    CleanupStack::PopAndDestroy();  // Close model
+    
+    FLOG( _L( "[Provisioning] CStreamingAdapter::SaveL: Done" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CMbxNbrAdapter::CanSetAsDefault( TInt /*aItem*/ ) const
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::SetAsDefault
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::SetAsDefaultL( TInt /*aItem*/ )
+    {
+    // This shouldn't be called because CanSetAsDefault
+    // always returns EFalse.
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::VisitL( CWPCharacteristic& aCharacteristic )
+    {
+    switch( aCharacteristic.Type() )
+        {
+        case KWPApplication:
+            // Initialize iTempData's members
+            iTempData.iName.Set( KNullDesC );
+            iTempData.iMailboxNumber.Set( KNullDesC );
+            iTempData.iVidiosupport = EFalse;
+            iTempData.iIsVideosupport = EFalse;
+            iTempData.iMailboxType = ECSVoiceMailbox;
+
+            // Accept characteristic
+            aCharacteristic.AcceptL( *this );
+
+            // Check iAppId and validate data
+            if( iAppId == KMailboxAppId && IsValid() )
+                {
+                // iAppId is correct and data is valid
+                // -> Lets append it to array                
+                iSettings.Append( iTempData );
+                }
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::VisitL( CWPParameter& aParameter )
+    {   
+    switch( aParameter.ID() )
+        {
+        case EWPParameterAppID:
+            iAppId.Set( aParameter.Value() );
+            break;
+        case EWPParameterName:
+            iTempData.iName.Set( aParameter.Value() );
+            break;
+		case EWPNamedParameter:
+			{
+			if( aParameter.Name().Compare( KMailboxNumberStr ) == 0 )
+			    {
+			    iTempData.iMailboxNumber.Set( aParameter.Value() );
+			    }
+			else if( aParameter.Name().Compare( KMailboxTypeStr ) == 0 )
+			    {
+			    ParseMbxTypeL( aParameter.Value(), iTempData.iMailboxType );
+			    }
+			else if( aParameter.Name().Compare( KVideoSupportType ) == 0)
+				{
+			FLOG( _L( "[Provisioning] CMbxNbrAdapter::VisitL:Visiting to ParseVideoTypeL" ) );
+				ParseVideoTypeL( aParameter.Value(), iTempData.iVidiosupport, iTempData.iIsVideosupport );	
+			    }
+			break;
+			}
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::VisitLinkL( CWPCharacteristic& /*aCharacteristic*/ )
+    { 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::IsValid
+// -----------------------------------------------------------------------------
+//
+TBool CMbxNbrAdapter::IsValid()
+    {
+    TBool validity( EFalse );
+    
+    // Validity check:
+    //  iMailboxType is either ECSVideoMailbox or ECSVoiceMailbox and
+    //  iMailboxNumber is valid number in e.164 format  
+    if( ( iTempData.iMailboxType == ECSVideoMailbox || 
+        iTempData.iMailboxType == ECSVoiceMailbox ) &&
+        IsValidPhoneNumber( iTempData.iMailboxNumber ) )
+        {
+        validity = ETrue;
+        }    
+        
+    return validity;
+    }
+    
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::IsValidPhoneNumber
+// -----------------------------------------------------------------------------
+//
+TBool CMbxNbrAdapter::IsValidPhoneNumber( const TDesC& aPtr ) 
+    {
+    return CommonPhoneParser::IsValidPhoneNumber( aPtr, 
+                                CommonPhoneParser::EPhoneClientNumber );
+    }       
+    
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::ParseMbxTypeL
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::ParseMbxTypeL( const TDesC& aPtr, TMailboxType& aType ) 
+    {
+    if( aPtr.Length() )
+        {
+        if( aPtr.Compare( KCSVideoMailboxType ) == 0 )
+            {
+            aType = ECSVideoMailbox;   
+            }
+        else
+            {
+            User::Leave( KErrNotSupported );
+            }
+        }
+    else
+        {
+        aType = ECSVoiceMailbox;
+        }
+    }
+// -----------------------------------------------------------------------------
+// CMbxNbrAdapter::ParseVideoTypeL
+// -----------------------------------------------------------------------------
+//
+void CMbxNbrAdapter::ParseVideoTypeL( const TDesC& aPtr, TBool& aType, TBool& aType1 ) 
+    {
+    FLOG( _L( "[Provisioning] CMbxNbrAdapter::ParseVideoTypeL:in" ) );
+    if( aPtr.Length() )
+        {
+        FLOG( _L( "[Provisioning] CMbxNbrAdapter::ParseVideoTypeL:If there is ON/OFF Value" ) );
+        if( aPtr.Compare( KVideoSupportTypeTrue ) == 0 )
+            {
+            FLOG( _L( "[Provisioning] CMbxNbrAdapter::ParseVideoTypeL:if ON set TRUE" ) );
+            aType = ETrue;
+            aType1 = ETrue;
+            }
+        else if( aPtr.Compare( KVideoSupportTypeFalse ) == 0 )
+            {
+            FLOG( _L( "[Provisioning] CMbxNbrAdapter::ParseVideoTypeL:if OFF set False" ) );
+            aType = EFalse;
+            aType1 = ETrue;
+            }
+        else
+        {
+        	FLOG( _L( "[Provisioning] CMbxNbrAdapter::ParseVideoTypeL:if some thing else set False" ) );
+        	aType1 = EFalse;
+        }
+        }
+    else
+        {
+        FLOG( _L( "[Provisioning] CMbxNbrAdapter::ParseVideoTypeL:no ON/OFF" ) );
+        aType1 = EFalse;
+        }
+    }
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/Src/MbxNbrAdapterGroupProxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002 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:  Table of plugins for ECom
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32std.h>
+#include    <implementationproxy.h>
+#include    "MbxNbrAdapter.h"
+
+
+// CONSTANTS
+const TImplementationProxy ImplementationTable[] =
+    {
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207282, CMbxNbrAdapter::NewL )
+    };
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationProxy
+// ECOM implementation table entry.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+    return ImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/MbxNbrAdapter/loc/MailboxAdapter.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002 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 a localisation file for MediaSettings
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d: Summary text for mailbox settings
+//l: popup_info_list_pane_t2/opt1
+//
+#define qtn_op_head_mailbox "Mailbox settings"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/BWINS/ProvisioningBCu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewL@CWPBioControl@@SAPAV1@AAVMMsgBioControlObserver@@PAVCMsvSession@@JW4TMsgBioMode@@PBVRFile@@@Z @ 1 NONAME ; class CWPBioControl * CWPBioControl::NewL(class MMsgBioControlObserver &, class CMsvSession *, long, enum TMsgBioMode, class RFile const *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2002 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: 
+#    Makefile for building bif resource 
+#
+#
+
+PROJECT=provisioningbc
+SOURCEDIR=..\bif
+LANGUAGE=sc
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+TARGETDIR=\Epoc32\Release\$(PLATFORM)\$(CFG)\z\system\bif
+else
+TARGETDIR=\Epoc32\release\$(PLATFORM)\$(CFG)
+endif
+
+$(TARGETDIR) :
+	@perl \epoc32\tools\emkdir.pl $(TARGETDIR)
+
+
+SOURCERESOURCE=$(SOURCEDIR)\provisioningbif.rss
+TEMPRESOURCE=$(TARGETDIR)\provisioningbif.rss
+TARGETRESOURCE=$(TARGETDIR)\prov.r$(LANGUAGE)
+
+$(TARGETRESOURCE) : $(TARGETDIR) $(SOURCERESOURCE)
+	@copy $(SOURCERESOURCE) $(TEMPRESOURCE)
+	@epocrc.bat -u -I. -I\epoc32\include -I$(SOURCEDIR)\..\..\Group $(TEMPRESOURCE) -o$(TARGETRESOURCE)
+	@del $(TEMPRESOURCE)
+
+do_nothing:
+	rem do nothing
+
+
+MAKMAKE : do_nothing
+
+RESOURCE : $(TARGETRESOURCE)
+
+SAVESPACE : BLD
+
+BLD : do_nothing
+
+FREEZE : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+FINAL : do_nothing
+
+CLEAN : 
+	@erase $(TARGETRESOURCE)
+
+RELEASABLES : 
+	@echo $(TARGETRESOURCE)
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains resources for the bif file created by biftool.
+*          
+*
+*/
+
+
+//  INCLUDES
+#ifdef __MESSAGING_API_V2__
+#include <biftool2.rh>
+#else
+#include <biftool.rh>	
+#endif // __MESSAGING_API_V2__
+
+#include <provisioningbc.loc>
+#include "../Group/ProvisioningUIDs.h"
+
+
+RESOURCE BIO_INFO_FILE
+	{
+	message_type_uid    = KProvisioningMessageTypeUid;
+	message_app_uid     = KUidUseDefaultApp;
+	message_appctrl_name = "ProvisioningBC.dll";
+	description         = qtn_mce_inbox_type_smart_conf; 
+	icons_filename      = "none";
+	icon_zoom_levels    = {1};
+	ids=
+		{
+		ID
+			{
+			type=EIana;
+			confidence=ECertain;
+			text="application/vnd.wap.connectivity-wbxml";
+			}
+		};
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif_dc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2002 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: 
+#    Makefile for building bif resource 
+#
+#
+
+PROJECT=provisioningbc
+SOURCEDIR=..\bif
+LANGUAGE=sc
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+TARGETDIR=\Epoc32\Release\$(PLATFORM)\$(CFG)\z\resource\messaging\bif
+else
+TARGETDIR=\Epoc32\release\$(PLATFORM)\$(CFG)
+endif
+
+$(TARGETDIR) :
+	@perl \epoc32\tools\emkdir.pl $(TARGETDIR)
+
+
+SOURCERESOURCE=$(SOURCEDIR)\provisioningbif.rss
+TEMPRESOURCE=$(TARGETDIR)\provisioningbif.rss
+TARGETRESOURCE=$(TARGETDIR)\prov.r$(LANGUAGE)
+
+$(TARGETRESOURCE) : $(TARGETDIR) $(SOURCERESOURCE)
+	@copy $(SOURCERESOURCE) $(TEMPRESOURCE)
+	@epocrc.bat -u -I. -I\epoc32\include -I$(SOURCEDIR)\..\..\Group $(TEMPRESOURCE) -o$(TARGETRESOURCE)
+	@del $(TEMPRESOURCE)
+
+do_nothing:
+	rem do nothing
+
+
+MAKMAKE : do_nothing
+
+RESOURCE : $(TARGETRESOURCE)
+
+SAVESPACE : BLD
+
+BLD : do_nothing
+
+FREEZE : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+FINAL : do_nothing
+
+CLEAN : 
+	@erase $(TARGETRESOURCE)
+
+RELEASABLES : 
+	@echo $(TARGETRESOURCE)
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.lnt	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,6 @@
+-w2
+
+-i..\Inc
+-d_UNICODE
+APP_LAYER_SYSTEMINCLUDE
+..\Src\*.cpp 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for project the ProvisioningBC.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+#include <data_caging_paths.hrh>
+#include "../../Group/ProvisioningUIDs.h"
+
+TARGET          provisioningbc.dll
+TARGETPATH      system/libs
+TARGETTYPE      dll
+UID             KProvisioningBCUid2 KProvisioningBCUid3
+
+CAPABILITY      CAP_GENERAL_DLL
+VENDORID        VID_DEFAULT
+
+
+
+SOURCEPATH      ../Src
+SOURCE          CWPBioControl.cpp
+SOURCE          CWPSaver.cpp
+SOURCE          CWPCodeQueryDialog.cpp
+SOURCE          CWPNameValue.cpp
+
+START RESOURCE  ../Group/ProvisioningBC.rss
+HEADER
+TARGETPATH  RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+START RESOURCE ../Bif/ProvisioningBif.rss
+TARGETPATH BIOFILE_DIR
+TARGET     prov.rsc
+LANGUAGE_IDS
+END	// RESOURCE
+
+USERINCLUDE     ../Inc ../Group ../../Group ../../ProvisioningEngine/Inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+//SYSTEMINCLUDE   /epoc32/include/cshelp
+
+LIBRARY         euser.lib
+LIBRARY         eikdlg.lib          // dialog base
+LIBRARY         bafl.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         eikcoctl.lib        // bordered control
+LIBRARY         msgeditorutils.lib
+LIBRARY         cone.lib
+LIBRARY         msgs.lib            // Messaging Centre interface
+LIBRARY         commonengine.lib    // StringLoader
+LIBRARY         richbio.lib
+LIBRARY         provisioningengine.lib
+LIBRARY         avkon.lib
+LIBRARY         eikctl.lib
+LIBRARY         featmgr.lib
+LIBRARY         apengine.lib
+LIBRARY         favouritesengine.lib
+LIBRARY         sysutil.lib
+LIBRARY         centralrepository.lib
+
+DEBUGLIBRARY    flogger.lib
+
+SMPSAFE
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,394 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains all the resources for the module.
+*
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+
+NAME    PROV
+
+//  INCLUDES
+
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include "provisioningbc.loc"
+#include "../../loc/Provisioning.loc" // Localisable text
+
+
+//  RESOURCE DEFINITIONS
+// ---------------------------------------------------------
+//
+//    ProvisioningBC.rss
+//
+// ---------------------------------------------------------
+//
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_title_provisioning
+//    Provisioning message title
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_title_provisioning
+    {
+    buf=qtn_op_title_confsett;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_menu_savesetting
+//    Save text
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_menu_savesetting
+    {
+    buf=qtn_op_options_save;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_authenticated
+//    Save text
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_authenticated
+    {
+    buf=qtn_mce_inbox_sender_servprov;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_helptext
+//    Save text
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_helptext
+    {
+    buf=qtn_op_view_help;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_numitems
+//    Number of items if >=5
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_numitems
+    {
+    buf=qtn_op_sett_items;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_notsaved_singular_zero
+//    Number of items not saved
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_notsaved_singular_zero
+    {
+    buf=qtn_op_info_notsaved_singular_zero;
+    }
+    
+// ---------------------------------------------------------
+//   
+//    r_text_notsaved_singular_one
+//    Number of items not saved
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_notsaved_singular_one
+    {
+    buf=qtn_op_info_notsaved_singular_one;
+    }
+
+
+// ---------------------------------------------------------
+//   
+//    r_text_notsaved
+//    Number of items not saved
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_notsaved
+    {
+    buf=qtn_op_info_notsaved;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_saved
+//    All settings were saved
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_saved
+    {
+    buf=qtn_sm_all_serv_settings_copied;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_ap_protected
+//    Access points are protected
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_ap_protected
+    {
+    buf=qtn_sms_note_protected_ap;
+    }
+
+
+// ---------------------------------------------------------
+//   
+//    r_text_wrong_pin
+//    Error text when entered PIN is wrong.
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_wrong_pin
+    {
+    buf = qtn_op_verific_failed;                    
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_already_saved
+//    Confirmation when settings have already been saved.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_query_already_saved
+    {
+    flags = EGeneralQueryFlags;
+     #ifdef __SERIES60_32__	// KS
+    	buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
+    #else
+    	buttons = R_AVKON_SOFTKEYS_YES_NO;
+    #endif
+
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                { 
+                layout = EConfirmationLayout;
+                label = qtn_op_already_saved;                   
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_query_notauthenticated
+//    Query when message is not authenticated.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_query_notauthenticated
+    {
+    flags = EGeneralQueryFlags;
+     #ifdef __SERIES60_32__	// KS
+    	buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
+    #else
+    	buttons = R_AVKON_SOFTKEYS_YES_NO;
+    #endif
+
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                { 
+                layout = EConfirmationLayout;
+                label = qtn_op_nottsp_conf_note;                    
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_query_pin
+//    Query when a PIN should be entered
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_query_pin
+    {
+    flags=EGeneralQueryFlags;
+     #ifdef __SERIES60_32__	// KS
+    	buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    #else
+    	buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    #endif
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_DATA_QUERY 
+                { 
+                    layout = EPinLayout;
+                    label = qtn_op_enter_settpin;
+                    control = NUMSECRETED
+                        {
+                        num_code_chars = 20;            
+                        };
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_query_setdefault
+//    Query for setting the settings as default.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_query_verific_failed_totally
+    {
+    flags =  EAknErrorNoteFlags | EEikDialogFlagWait;
+    #ifdef __SERIES60_32__	// KS
+    	buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    #else
+    	buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    #endif
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EGeneralNote;
+            control = AVKON_NOTE 
+                { 
+                layout = EGeneralLayout;
+                singular_label = qtn_op_verific_failed_totally;
+                animation = R_QGN_NOTE_ERROR_ANIM;
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_query_setdefault
+//    Query for setting the settings as default.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_query_setdefault
+    {
+    flags = EGeneralQueryFlags;
+    #ifdef __SERIES60_32__	// KS
+    	buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
+    #else
+    	buttons = R_AVKON_SOFTKEYS_YES_NO;
+    #endif
+
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                { 
+                layout = EConfirmationLayout;
+                label = qtn_op_conf_setdef;                 
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_waitnote_save
+//    Save wait note
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_waitnote_save
+    {
+    flags = EAknProgressNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = 1;
+            control = AVKON_NOTE 
+                { 
+                layout = EProgressLayout;
+                singular_label = qtn_sm_wait_saving_servsett;
+                };
+            }
+        };
+    }
+
+RESOURCE DIALOG r_msg_authentication_failed
+    {
+    flags   = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items   =
+        {
+        DLG_LINE
+            {
+            type    = EAknCtPopupHeadingPane;
+            id      = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label   = qtn_op_info_sms_autfai_heading;
+                };
+            },
+        DLG_LINE
+            {
+            type    = EAknCtMessageQuery;
+            id      = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                message = qtn_op_info_sms_autfai;
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPBioControl.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,276 @@
+/*
+* Copyright (c) 2002 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: 
+*     Bio control for Provisioning documents.
+*
+*/
+
+
+#ifndef CWPBIOCONTROL_H
+#define CWPBIOCONTROL_H
+
+// INCLUDES
+#include <msgbiocontrol.h>                // for CMsgBioControl
+
+// FORWARD DECLARATIONS
+class CWPEngine;
+class CWPNameValue;
+class CWPPushMessage;
+class CRichBio;
+
+// CLASS DECLARATION
+
+/**
+ * Bio control for OMA Provisioning messages.
+ * @since 2.0
+ */
+class CWPBioControl: public CMsgBioControl
+    {
+    public:  // Constructor and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aObserver Reference to the Bio control observer.
+        * @param aSession Reference to Message Server session.
+        * @param aId Id of the message.
+        * @param aEditorOrViewerMode Enum for the mode, is it as editor or viewer.
+        * @param aFileName The newly created object.
+        * @param aFile file handle to provisioning content.
+        */
+        IMPORT_C static CWPBioControl* NewL( MMsgBioControlObserver& aObserver,
+                                             CMsvSession* aSession,
+                                             TMsvId aId,
+                                             TMsgBioMode aEditorOrViewerMode,
+                                             const RFile* aFile );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CWPBioControl();
+
+    public: // From MMsgBioControl
+        
+        /**
+        * Calculates and sets size for a Bio control according to aSize.
+        * This function might become deprecated. The SetSizeL() function will
+        * be the replacement.
+        * The height of the Bio control may be less or more than requested by
+        * aSize, but the width must be exactly the same. If width of the Bio
+        * control is not the same as given by aSize, the width must be reset
+        * back to requested one. The aSize is set to the new size.
+        * @param aSize Size.
+        */
+        void SetAndGetSizeL( TSize& aSize );
+
+        /**
+        * This is called by the container to allow the Bio control to add
+        * a menu item command. The command ID's should start from the value
+        * returned by the MMsgBioControlObserver::FirstFreeCommand().
+        * @param aMenuPane Reference to the applications menu which will be
+        * modified.
+        */
+        void SetMenuCommandSetL( CEikMenuPane& aMenuPane );
+
+        /**
+        * The command handler. The Bio Control should only handle its own
+        * commands that it has set using the function SetMenuCommandSetL().
+        * @param aCommand ID of command to be handled.
+        * @return If the command is handled, it returns ETrue, and vice versa
+        */
+        TBool HandleBioCommandL( TInt aCommand );
+
+        /**
+        * Returns a rectangle slice of the bio controls viewing area.
+        * It is used by the CMsgEditorView class for scrolling the screen.
+        * The position is given relative to the bio controls top left
+        * corner.
+        * @return TRect
+        */
+        TRect CurrentLineRect() const;
+
+        /**
+        * Used by the body container for managing focus and scrolling.
+        * @param aDirection The direction to be checked.
+        * @return ETrue if focus change is possible, and vice versa.
+        */
+        TBool IsFocusChangePossible( TMsgFocusDirection aDirection ) const;
+
+        /**
+        * Returns the header text.
+        * @return The header text.
+        */
+        HBufC* HeaderTextL()  const;
+
+        /**
+        * The application can get the option menu permissions using this
+        * function.
+        * @return The option menu permission flags. If the flag is off it
+        * means that the option menu command is not recommended with this
+        * Bio Control.
+        */
+        TUint32 OptionMenuPermissionsL() const;
+
+        /**
+        * Gives the height of the text in pixels.
+        * It is used by the scrolling framework.
+        * @return Height of the text in pixels.
+        */
+        TInt VirtualHeight();
+
+        /**
+        * Gives the cursor position in pixels.
+        * It is used by the scrolling framework.
+        * @return Cursor position in pixels.
+        */
+        TInt VirtualVisibleTop();
+
+        /**
+        * Tells whether the cursor is in the topmost or bottom position.
+        * It is used by the scrolling framework.
+        * @param aLocation Specifies either top or bottom.
+        * @return ETrue if the cursor is in the part specified by aLocation.
+        */
+        TBool IsCursorLocation( TMsgCursorLocation aLocation ) const;
+
+
+    public: // From CCoeControl
+
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aType );
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    protected: // From CCoeControl
+
+        TInt CountComponentControls() const;
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        void SizeChanged();
+        void FocusChanged( TDrawNow aDrawNow );
+        void SetContainerWindowL( const CCoeControl& aContainer );
+    /** 
+     * SetCenrepKeyL
+     * Set the Cenrep key.
+     * @param aValue Cenrep Value.
+     * @return void
+     **/
+    void SetCenrepKeyL(const TDesC8& aValue);
+
+    private: // Constructors
+
+        /**
+        * Constructor is prohibited.
+        * @param aObserver Reference to the Bio control observer.
+        * @param aSession Reference to Message Server session.
+        * @param aId Id of the message in Message Server.
+        * @param aEditorOrViewerMode Enum for the mode, is it as editor or viewer.
+        * @param aFileName The newly created object.
+        * @param aFile file handle to provisioning content.
+        */
+        CWPBioControl( MMsgBioControlObserver& aObserver,
+                       CMsvSession* aSession,
+                       TMsvId aId,
+                       TMsgBioMode aEditorOrViewerMode,
+                       const RFile* aFile );
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+    private: // New functions
+
+        /**
+        * Restores the message from messaging store.
+        */
+        void RestoreMsgL();
+
+        /**
+        * Adds the message summaries to the richbio.
+        */
+        void AddItemsL();
+
+        /**
+        * Collects the summary items from engine and 
+        * sorts them.
+        * @return Array with summary items
+        */
+        RPointerArray<CWPNameValue>* CollectItemsLC() const;
+
+        /**
+        * Collates items with same title and adds
+        * them to the rich bio.
+        * @param aItems The items to be collated
+        */
+        void CollateAndAddItemsL( RPointerArray<CWPNameValue>& aItems );
+
+        /**
+        * Save the settings.
+        */
+        void SaveSettingsL();
+
+        /**
+        * Save the message again.
+        */
+        void SaveMessageL();
+
+        /**
+        * Do the actual saving.
+        */
+        void DoSaveL();
+
+        /**
+        * Try to authenticate a message.
+        * @param aMessage The message to authenticate
+        */
+        void AuthenticateL( CWPPushMessage& aMessage );
+
+        /**
+        * ResetAndDestroy() cleanup for an RPointerArray<CMsgNameValue>.
+        * @param aAny Array
+        */
+        static void Cleanup( TAny* aAny );
+
+        /** 
+        * Comparator for two string pairs. Compares the names of the pairs.
+        * @param aImpl1 First string pair to compare
+        * @param aImpl2 Second string pair to compare
+        */
+        static TInt Compare( const CWPNameValue& aImpl1,
+                             const CWPNameValue& aImpl2 );
+    private:
+        void ErrorNoteL(const TDesC& aText);
+        void ErrorNoteL(TInt aStringResource);
+        void ConfirmationNoteL(const TDesC& aText);
+        void ConfirmationNoteL(TInt aStringResource);
+        void InformationNoteL(const TDesC& aText);
+        void InformationNoteL(TInt aStringResource);
+
+    private: //Data
+        enum TMenuCommands
+            {
+            ECmdSaveSettings
+            };
+
+        /// Pointer to richbio control. Owns.
+        CRichBio*       iRichBio;
+
+        /// Provisioning engine. Owns.
+        CWPEngine*      iEngine;
+
+        /// The message being handled. Owns.
+        CWPPushMessage* iMessage;
+    };
+
+#endif // CWPBIOCONTROL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPCodeQueryDialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2002 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 CWPCODEQUERYDIALOG_H
+#define CWPCODEQUERYDIALOG_H
+
+// INCLUDES
+#include <AknQueryDialog.h>
+#include <aknnotedialog.h>
+
+// CLASS DECLARATION
+
+/**
+ * Sortable 
+ */
+class CWPCodeQueryDialog : public CAknTextQueryDialog
+	{
+	public:
+        /**
+        * C++ default constructor.
+        */
+		CWPCodeQueryDialog(TDes& aDataText);
+
+        /**
+        * Destructor.
+        */
+		~CWPCodeQueryDialog();
+
+	public:
+		/**
+		* Allows dismissing of code queries. Only mandatory requirement is that PIN
+		* queries are dismissed by the # 
+		*
+		* @param aKeyEvent TKeyEvent&
+		* @return ETrue query is dismissed
+		*		  EFalse not dismissed
+		*/
+		TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+
+	protected://from CAknTextQueryDialog
+		/**
+		* From CAknTextQueryDialog This function is called by the UIKON dialog framework 
+		* just before the dialog is activated, after it has called
+		* PreLayoutDynInitL() and the dialog has been sized.
+		*/
+//		void PreLayoutDynInitL();
+		/**
+		* From CAknTextQueryDialog This function is called by the UIKON framework 
+		* if the user activates a button in the button panel. 
+		* It is not called if the Cancel button is activated, 
+		* unless the EEikDialogFlagNotifyEsc flag is set.
+		* @param aButtonId  The ID of the button that was activated
+		* @return           Should return ETrue if the dialog should exit, and EFalse if it should not.
+		*/
+		TBool OkToExitL(TInt aButtonId);
+		/**
+		* From CAknTextQueryDialog This function is called by the UIKON dialog framework 
+        * just after a key is pressed
+		* @param aKeyEvent TKeyEvent& 
+		* @param aType TEventCode 
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+
+	};
+
+#endif // CWPCodeQueryDialog_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPNameValue.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002 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 encapsulates a name and value pair.
+*
+*/
+
+
+
+#ifndef _CWPNameValue_H_
+#define _CWPNameValue_H_
+
+// INCLUDES
+
+#include <e32base.h>                    // CBase
+
+// CLASS DECLARATION
+
+/**
+ * Class holds name and value text pairs.
+ */
+class CWPNameValue : public CBase
+    {
+    public: // construction
+
+         /**
+         * Two phased constructor.
+         * @param aName The field name.
+         * @param aValue The field value.
+         * @return The newly constructed object.
+         */
+       static CWPNameValue* NewL( HBufC* aName, HBufC* aValue );
+        static CWPNameValue* NewL(const TDesC& aName, const TDesC& aValue);
+        static CWPNameValue* NewLC(const TDesC& aName, const TDesC& aValue);
+
+        /// Destructor
+        ~CWPNameValue();
+    
+    public: // new functions
+
+        /// @return Name or KNullDesC
+        const TDesC& Name() const;
+        /// @return Value or KNullDesC
+        const TDesC& Value() const;
+
+    private: // construction
+
+        /**
+         * Second phase constructor.
+         * @param aName The field name.
+         * @param aValue The field value.
+         */
+        void ConstructL( const TDesC& aName, const TDesC& aValue );
+
+        /**
+         * Second phase constructor.
+         * @param aName The field name.
+         * @param aValue The field value.
+         */
+        void ConstructL( HBufC* aName, HBufC* aValue );
+
+    private: // hidden
+
+        /// Default constructor.
+        CWPNameValue();
+
+        /// Another constructor
+        CWPNameValue( HBufC* aName, HBufC* aValue );
+
+        /// Copy contructor prohibited.
+        CWPNameValue(const CWPNameValue& aSource);
+
+        /// Assignment operator prohibited.
+        const CWPNameValue& operator=(const CWPNameValue& aSource);
+
+    private:
+    
+        /// Own. Pointer to the name.
+        HBufC* iName;
+
+        /// Own. Pointer to the value.
+        HBufC* iValue;
+    };
+
+#endif // _CWPNameValue_H_
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPSaver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2002-2006 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:  Settings saver with progress note.
+*
+*/
+
+
+#ifndef CWPSAVER_H
+#define CWPSAVER_H
+
+// INCLUDES
+#include <AknProgressDialog.h>
+#include <ActiveApDb.h>
+#include <favouritesdbobserver.h>
+#include <favouritesdb.h>
+
+
+// FORWARD DECLARATIONS
+class CWPEngine;
+class CActiveFavouritesDbNotifier;
+
+// CLASS DECLARATION
+
+/**
+ * Helper class for saving Provisioning settings. Provides a progress note.
+ * @since 2.0
+ */
+class CWPSaver : public CActive, 
+                 private MProgressDialogCallback,
+                 private MActiveApDbObserver, 
+                 private MFavouritesDbObserver
+    {
+    public:
+        /**
+        * C++ default constructor.
+        * @param aEngine Engine to be used for saving
+        * @param aSetAsDefault EFalse => call CWPEngine::SaveL, ETrue
+        *        => call CWPEngine::SetAsDefaultL
+        */
+        CWPSaver( CWPEngine& aEngine, TBool aSetAsDefault );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CWPSaver();
+
+    public:
+        /**
+        * Prepares the object for saving.
+        */
+        void PrepareLC();
+
+        /**
+        * Executes save with a progress note. Ownership of the
+        * CWPSaver object is transferred.
+        * @param aNumSaved When returns, contains number of settings saved.
+        * @return Status code. >= 0 if saving was completed
+        */
+        TInt ExecuteLD( TInt& aNumSaved );
+
+        TInt GetNumAccessDenied();
+        void SetNumAccessDenied(TInt aNumAccessDenied );
+    protected: // From CActive
+
+        void DoCancel();
+        void RunL();
+        TInt RunError( TInt aError );
+
+    private: // From MProgressDialogCallback
+
+        void DialogDismissedL( TInt aButtonId );
+
+    private: // from MActiveApDbObserver
+
+        void HandleApDbEventL( TEvent anEvent );
+
+    private: // from MFavouritesDbObserver
+
+        void HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent );
+
+    private:
+        /**
+        * Complete the request so that RunL() gets called.
+        */
+        void CompleteRequest();
+
+        /**
+        * Complete the request so that Timeout() gets called after
+        * a delay. Leaves with KErrTimeout if retry count is 
+        * exceeded.
+        */
+        void DelayedCompleteRequestL();
+
+        /**
+        * Retry save now.
+        */
+        void Retry();
+
+        /**
+        * Timer timed-out.
+        */
+        static TInt Timeout(TAny* aSelf);
+
+    private:
+        /// The engine used for performing the save. Refs.
+        CWPEngine& iEngine;
+
+        /// ETrue if setting as default
+        TBool iSetAsDefault;
+
+        /// The progress dialog. Owns.
+        CAknProgressDialog* iDialog;
+
+        /// The item to be saved next
+        TInt iCurrentItem;
+
+        /// Contains result to be passed to the called of ExecuteLD
+        TInt iResult;
+
+        /// Active AP database. Owns.
+        CActiveApDb* iApDbNotifier;
+
+        /// Active Favourites Database. Owns.
+        CActiveFavouritesDbNotifier* iFavouritesNotifier;
+
+        /// Contains ETrue if commsdb is being waited on
+        TBool iWaitCommsDb;
+
+        /// Contains ETrue if favourites db is being waited on
+        TBool iWaitFavourites;
+
+        /// Active scheduler.
+        CActiveSchedulerWait iWait;
+
+        /// Timer for retry. Owns.
+        CPeriodic* iRetryTimer;
+
+        /// Retry counter
+        TInt iRetryCount;
+        
+        RFavouritesDb       iBookmarkDb;
+        RFavouritesSession  iSession;       
+   	TInt iNumAccessDenied;
+    };
+
+
+#endif // CWPSAVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPStringPair.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 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: 
+*     Sortable string pair.
+*
+*/
+
+
+#ifndef CWPSTRINGPAIR_H
+#define CWPSTRINGPAIR_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+ * Sortable string pair
+ */
+class CWPStringPair : public CBase
+	{
+	public:
+        /**
+        * C++ default constructor.
+        */
+		CWPStringPair();
+
+        /**
+        * Destructor.
+        */
+		~CWPStringPair();
+
+	public:
+		/**
+		* Sets the values for string pair.
+		* @param aName The name of the string
+		* @param aValue The value of the string
+		*/
+		void SetL( const TDesC& aName, const TDesC& aValue );
+
+	public:
+		// Points to iName. Use for constructing TKeyArrayFixPtr.
+		TPtrC iNamePtr;
+
+		// Points to iValue. Use for constructing TKeyArrayFixPtr.
+		TPtrC iValuePtr;
+
+	private:
+		// The name of the pair. Owns.
+		HBufC* iName;
+
+		// The value of the pair. Owns.
+		HBufC* iValue;
+	};
+
+#endif // CWPSTRINGPAIR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Src/CWPBioControl.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,875 @@
+/*
+* Copyright (c) 2002 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: 
+*     Bio control for Provisioning documents.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CWPBioControl.h"
+
+#include <aknnotewrappers.h>
+#include <msvapi.h>
+#include <StringLoader.h>
+#include <CRichBio.h>
+#include <msgbiocontrolObserver.h>
+
+
+#include <ProvisioningBC.rsg>
+#include <bldvariant.hrh>
+#include <msvids.h>
+#include <biouids.h>
+#include <featmgr.h>
+#include <csxhelp/prov.hlp.hrh>
+#include <sysutil.h>
+#include "CWPEngine.h"
+#include "CWPAdapter.h"
+#include "MWPPhone.h"
+#include "WPPhoneFactory.h"
+#include "CWPPushMessage.h"
+#include "CWPBootstrap.h"
+#include "CWPSaver.h"
+#include "ProvisioningUIDs.h"
+#include "CWPCodeQueryDialog.h"
+#include "MWPContextManager.h"
+#include "ProvisioningDebug.h"
+#include "CWPNameValue.h"
+#include <aknmessagequerydialog.h> 
+#include "ProvisioningInternalCRKeys.h"
+// CONSTANTS
+/// Strings are loaded from this resource
+_LIT(KResourceFileName, "provisioningbc.rsc");
+/// Maximum number of items with same title before they get merged.
+const TInt KMaxDuplicates = 5;
+/// Maximum length of PIN code
+const TInt KMaxPinSize = 20;
+/// Number of retries for PIN
+// const TInt KPinRetries = 3; // Removed, because iMtmData1 data member of TMsvEntry in CWPMessage.cpp contains Max tries, default=3.
+///NONE
+_LIT(KNone,"");
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Constructor.
+// -----------------------------------------------------------------------------
+//
+CWPBioControl::CWPBioControl( MMsgBioControlObserver& aObserver,
+                              CMsvSession* aSession,
+                              TMsvId aId,
+                              TMsgBioMode aEditorOrViewerMode,
+                              const RFile* aFile )
+                            : CMsgBioControl( aObserver,
+                                              aSession,
+                                              aId,
+                                              aEditorOrViewerMode,
+                                              aFile )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDMSyncAppEngine::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPBioControl::ConstructL()
+    {
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::ConstructL:" ) );
+    
+    FeatureManager::InitializeLibL();
+
+    if( IsEditor() ) //This control does not support editing mode.
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    LoadResourceL(KResourceFileName);
+    LoadStandardBioResourceL();
+
+    iEngine = CWPEngine::NewL();
+    iRichBio = new(ELeave) CRichBio( ERichBioModeEditorBase );
+
+    // this function leaves if not enough data exists
+    RestoreMsgL();
+
+    // Add items to CRichBio
+    AddItemsL();
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::ConstructL: done" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDMSyncAppEngine::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CWPBioControl* CWPBioControl::NewL( MMsgBioControlObserver& aObserver,
+                                             CMsvSession* aSession,
+                                             TMsvId aId,
+                                             TMsgBioMode aEditorOrViewerMode,
+                                             const RFile* aFile )
+    {
+
+    CWPBioControl* self = new( ELeave ) CWPBioControl( aObserver,
+                                                       aSession,
+                                                       aId,
+                                                       aEditorOrViewerMode,
+                                                       aFile );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPBioControl::~CWPBioControl()
+    {
+    delete iRichBio;
+    delete iEngine;
+    delete iMessage;
+    FeatureManager::UnInitializeLib();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::SetAndGetSizeL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SetAndGetSizeL( TSize& aSize )
+    {
+    iRichBio->SetAndGetSizeL( aSize );
+    SetSizeWithoutNotification( aSize );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::SetMenuCommandSetL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SetMenuCommandSetL( CEikMenuPane& aMenuPane )
+    {
+    AddMenuItemL( aMenuPane, R_MENU_SAVESETTING, ECmdSaveSettings );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::CurrentLineRect
+// ----------------------------------------------------------------------------
+//
+TRect CWPBioControl::CurrentLineRect() const
+    {
+    return iRichBio->CurrentLineRect();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::IsFocusChangePossible
+// ----------------------------------------------------------------------------
+//
+TBool CWPBioControl::IsFocusChangePossible(
+                                         TMsgFocusDirection aDirection ) const
+    {
+    if (aDirection == EMsgFocusUp )
+        {
+        return iRichBio->IsCursorLocation( EMsgTop );
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::IsCursorLocation
+// ----------------------------------------------------------------------------
+//
+TBool CWPBioControl::IsCursorLocation( TMsgCursorLocation aLocation ) const
+    {
+    return iRichBio->IsCursorLocation( aLocation );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::HeaderTextL
+// ----------------------------------------------------------------------------
+//
+HBufC* CWPBioControl::HeaderTextL() const
+    {
+    return StringLoader::LoadL( R_TITLE_PROVISIONING );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::HandleBioCommandL()
+// ----------------------------------------------------------------------------
+//
+TBool CWPBioControl::HandleBioCommandL(TInt aCommand)
+    {
+    TBool result( EFalse );
+
+    if ( aCommand == iBioControlObserver.FirstFreeCommand() + ECmdSaveSettings )
+        {
+        SaveSettingsL();
+        result = ETrue;
+        }
+    return result;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::OptionMenuPermissionsL
+// ----------------------------------------------------------------------------
+//
+TUint32 CWPBioControl::OptionMenuPermissionsL() const
+    {
+    TUint32 perm( EMsgBioDelete | EMsgBioMessInfo | EMsgBioMove | EMsgBioExit );
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        perm |= EMsgBioHelp;
+        }
+    return perm;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::OfferKeyEventL
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CWPBioControl::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                            TEventCode aType )
+    {
+    return iRichBio->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::GetBioHelpContext
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::GetHelpContext( TCoeHelpContext& aContext ) const
+    {   
+    if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        {
+        aContext.iContext = KPROV_HLP_PROVISIONVIEW() ;    
+        aContext.iMajor = TUid::Uid( KProvisioningBCUid3 );
+        }
+    else
+        {
+        CCoeControl::GetHelpContext(aContext);
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::CountComponentControls
+// ----------------------------------------------------------------------------
+//
+TInt CWPBioControl::CountComponentControls() const
+    {
+    return 1;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::ComponentControl
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CWPBioControl::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return iRichBio;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::SizeChanged()
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SizeChanged()
+    {
+    iRichBio->SetExtent( Position(), iRichBio->Size() );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::FocusChanged
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::FocusChanged( TDrawNow aDrawNow )
+    {
+    iRichBio->SetFocus( IsFocused(), aDrawNow );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl::SetContainerWindowL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SetContainerWindowL( const CCoeControl& aContainer )
+    {
+    CCoeControl::SetContainerWindowL( aContainer );
+    iRichBio->ConstructL(this);
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::VirtualHeight
+// ----------------------------------------------------------------------------
+//
+TInt CWPBioControl::VirtualHeight()
+    {
+    return iRichBio->VirtualHeight();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::VirtualVisibleTop
+// ----------------------------------------------------------------------------
+//
+TInt CWPBioControl::VirtualVisibleTop()
+    {
+    return iRichBio->VirtualVisibleTop();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::RestoreMsgL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::RestoreMsgL()
+    {
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL" ) );
+    
+    // Load the message from Messaging Server
+    CMsvEntry* entry = MsvSession().GetEntryL(iId);
+    CleanupStack::PushL( entry );
+    TMsvEntry tentry( entry->Entry() );
+    iMessage = CWPPushMessage::NewL();
+    CMsvStore* readStore = entry->ReadStoreL();
+    CleanupStack::PushL( readStore );
+    iMessage->RestoreL( *readStore );
+    CleanupStack::PopAndDestroy(); // readStore
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 1" ) );
+    // Fill the engine
+    TRAPD( result, iEngine->ImportDocumentL( iMessage->Body() ) );
+    if( result == KErrCorrupt )
+        {
+        FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL KErrMsgBioMessageNotValid " ) );
+        result = KErrMsgBioMessageNotValid;
+        }
+    FTRACE(RDebug::Print(_L("[ProvisioningBC] CWPBioControl::RestoreMsgL result (%d)"), result));
+    User::LeaveIfError( result );
+    
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 2 " ) );
+    TBool preAuthenticated( iMessage->Authenticated() );
+    // If the message was not authenticated, give a warning
+    AuthenticateL( *iMessage );
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 3 " ) );
+    if( !tentry.ReadOnly() && preAuthenticated != iMessage->Authenticated() )
+        {
+        // If the entry can be written to, get its edit store and save
+        // authentication flag. Failing is not dangerous, as the only
+        // effect is that the user has to re-enter the PIN.
+        FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 4 " ) );
+        TRAPD( ignoreError, SaveMessageL() );
+        if ( ignoreError ) ignoreError = 0; // prevent compiler warning	
+        }
+    
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 5 " ) );
+    iEngine->PopulateL();
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 6 " ) );
+    // Empty messages are not supported
+    if( iEngine->ItemCount() == 0 )
+        {
+        FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 7 " ) );
+        User::Leave( KErrMsgBioMessageNotValid );
+        }
+
+    TPtrC8 orig8( iMessage->Originator() );
+    HBufC* orig16 = HBufC::NewLC( orig8.Length() );
+    orig16->Des().Copy( orig8 );
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 8 " ) );
+    if( iMessage->Authenticated() 
+        && iEngine->ContextExistsL( *orig16 ) )
+        {
+        TUint32 context( iEngine->ContextL( *orig16 ) );
+        iEngine->SetCurrentContextL( context );
+        }
+    else
+        {
+        iEngine->SetCurrentContextL( KWPMgrUidNoContext );
+        }
+
+    CleanupStack::PopAndDestroy(2); // orig16, entry
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL done" ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::AuthenticateL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::AuthenticateL( CWPPushMessage& aMessage )
+    {
+    if( !aMessage.Authenticated() )
+        {
+        // Try authentication and bootstrap without PIN.
+        
+	
+	      MWPPhone* phone = NULL;
+        TBuf<KMaxPinSize> imsi;
+        TRAPD(err, phone = WPPhoneFactory::CreateL());
+	
+	     if(err!=KErrNone)
+        {
+		      imsi = KNone;
+		
+        }
+        else
+        {
+        	imsi = phone->SubscriberId();
+        }
+        
+        
+        CWPBootstrap* bootstrap = CWPBootstrap::NewL( imsi );
+        
+        if(phone)
+        delete phone;
+
+	      CleanupStack::PushL( bootstrap );
+
+        CWPBootstrap::TBootstrapResult result( bootstrap->BootstrapL( 
+                                                                aMessage, 
+                                                                *iEngine, 
+                                                                KNullDesC ) );
+        if( result == CWPBootstrap::EPinRequired )
+            {
+            	CMsvEntry* entry = MsvSession().GetEntryL(iId);
+				TInt count = (entry->Entry()).MtmData1();
+            // We need to ask the PIN. Retry max. MtmData1 (=3, default) times if
+            // the user supplies from PIN.
+            TBuf<KMaxPinSize> pin;
+	            for( TInt i(0); i < count && !aMessage.Authenticated(); i++ )
+                {
+                pin.Zero();
+				CWPCodeQueryDialog* dlg = 
+				                        new (ELeave) CWPCodeQueryDialog( pin );
+				if (dlg->ExecuteLD( R_QUERY_PIN ) == 0) //R_DATA_QUERY
+				    {
+					    delete entry;
+					    entry = NULL;
+                    //enable user cancelling at any phase
+                    User::Leave( KLeaveWithoutAlert );
+				    }
+                result = bootstrap->BootstrapL( aMessage, *iEngine, pin );
+
+                // Wrong PIN. Give a note except on the last time. 
+                // Then the user will get note 
+                // R_QUERY_VERIFIC_FAILED_TOTALLY with OK key.
+                if( result == CWPBootstrap::EAuthenticationFailed 
+	                    && i < (const_cast <TMsvEntry&> (entry->Entry())).iMtmData1--)
+                    {
+	                      entry->ChangeL(entry->Entry());
+						i--;	                    
+						count = (entry->Entry()).MtmData1(); //(const_cast <TMsvEntry&> (entry->Entry())).iMtmData1;
+                    ErrorNoteL( R_TEXT_WRONG_PIN );
+                    }
+                }
+
+            // Still wrong PIN -> tell the user and delete the message.
+            if( !aMessage.Authenticated() )
+                {
+					delete entry;
+					entry = NULL;
+                CAknNoteDialog* dlg = new(ELeave) CAknNoteDialog;
+                dlg->ExecuteLD(R_QUERY_VERIFIC_FAILED_TOTALLY);
+                MsvSession().RemoveEntry( iId );
+                User::Leave( KLeaveWithoutAlert );
+                }
+	             if(entry)
+	             {
+	             	delete entry;
+	             }
+            }
+        if(result == CWPBootstrap::EAuthenticationFailed)
+        {
+        		
+        		CAknMessageQueryDialog* msg =  new(ELeave) CAknMessageQueryDialog;
+        		msg->ExecuteLD(R_MSG_AUTHENTICATION_FAILED);
+
+			MsvSession().RemoveEntry( iId );
+        		
+        		User::Leave( KLeaveWithoutAlert );
+        		
+        		
+        }
+        CleanupStack::PopAndDestroy( bootstrap );
+
+        // If the message is still not authenticated, show a note to user.
+        if( !aMessage.Authenticated() )
+            {   
+            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+        
+            if ( !dlg->ExecuteLD(R_QUERY_NOTAUTHENTICATED) )
+                {                
+                User::Leave( KLeaveWithoutAlert );
+                }
+            }
+        }
+    if (aMessage.Authenticated() )
+        {
+        //update Cenrep key
+        TBuf8<100> orig;
+        orig.Copy(aMessage.Originator());
+        TRAPD(err, SetCenrepKeyL(orig));
+        User::LeaveIfError(err);
+
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::AddItemsL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::AddItemsL()
+    {
+    // Add help text before the actual items
+    HBufC* help = StringLoader::LoadLC( R_TEXT_HELPTEXT );
+    iRichBio->AddItemL( *help, KNullDesC );
+    CleanupStack::PopAndDestroy(); // help
+
+    RPointerArray<CWPNameValue>* array = CollectItemsLC();
+    CollateAndAddItemsL( *array );
+    CleanupStack::PopAndDestroy(); // array
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::CollectItemsL
+// ----------------------------------------------------------------------------
+//
+RPointerArray<CWPNameValue>* CWPBioControl::CollectItemsLC() const
+    {
+    RPointerArray<CWPNameValue>* array = 
+                                    new(ELeave) RPointerArray<CWPNameValue>;
+    CleanupStack::PushL( TCleanupItem( Cleanup, array ) );
+
+    TInt count( iEngine->ItemCount() );
+    for( TInt index = 0; index < count; index++ )
+        {
+        const TDesC& text = iEngine->SummaryText( index );
+        const TDesC& title = iEngine->SummaryTitle( index );
+
+        CWPNameValue* pair = CWPNameValue::NewLC( title, text );
+        User::LeaveIfError( array->Append( pair ) );
+        CleanupStack::Pop( pair );
+        }
+
+    array->Sort( TLinearOrder<CWPNameValue>( CWPBioControl::Compare ) );
+
+    return array;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPBioControl::Cleanup
+// -----------------------------------------------------------------------------
+//
+void CWPBioControl::Cleanup( TAny* aAny )
+    {
+    RPointerArray<CWPNameValue>* array = 
+                       reinterpret_cast<RPointerArray<CWPNameValue>*>( aAny );
+    array->ResetAndDestroy();
+    array->Close();
+    delete array;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPBioControl::Compare
+// -----------------------------------------------------------------------------
+//
+TInt CWPBioControl::Compare( const CWPNameValue& aItem1,
+                             const CWPNameValue& aItem2 )
+    {
+    return aItem1.Name().Compare( aItem2.Name() );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::CollateAndAddItemsL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::CollateAndAddItemsL( RPointerArray<CWPNameValue>& aItems )
+    {
+    // Add a pivot item
+    CWPNameValue* pivot = CWPNameValue::NewLC( KNullDesC, KNullDesC );
+    User::LeaveIfError( aItems.Append( pivot ) );
+    CleanupStack::Pop( pivot );
+
+    // Title of the items being currently collected
+    TPtrC currentTitle( KNullDesC );
+    // Items under the same title
+    RArray<TPtrC> pointers;
+    CleanupClosePushL( pointers );
+    for( TInt item = 0; item < aItems.Count(); item++ )
+        {
+        CWPNameValue* pair = aItems[ item ];
+
+        if( pair->Name().Compare( currentTitle ) != 0 )
+            {
+            // Title has changed. Inserted collected items into rich bio
+            if( pointers.Count() > KMaxDuplicates )
+                {
+                // More than KMaxDuplicates items. Put only one line with
+                // number of items.
+                HBufC* string = StringLoader::LoadLC( R_TEXT_NUMITEMS,
+					                                  pointers.Count() );
+                iRichBio->AddItemL( currentTitle, *string );
+                CleanupStack::PopAndDestroy( string );
+                }
+            else
+                {
+                // Insert all collected items into rich bio
+                for( TInt index = 0; index < pointers.Count(); index++ )
+                    {
+                    iRichBio->AddItemL( currentTitle, pointers[index] );
+                    // Make sure title is repeated only once
+                    currentTitle.Set( KNullDesC );
+                    }
+			    } 
+            // Change the current title and start collecting for it
+            currentTitle.Set( pair->Name() );
+            pointers.Reset();
+            }
+		if(  pair->Value().Compare( KNullDesC ) != 0  )
+			{
+			User::LeaveIfError( pointers.Append( pair->Value() ) );
+			}
+        }
+    // Delete pivot
+    aItems.Remove( aItems.Count() - 1 );
+    delete pivot;
+    CleanupStack::PopAndDestroy( &pointers );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::SaveSettingsL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SaveSettingsL()
+    {
+    if( SysUtil::FFSSpaceBelowCriticalLevelL( &iEikonEnv->FsSession() ) )
+        {
+        User::Leave( KErrDiskFull );
+        }
+
+    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+    
+    if( !iMessage->Saved())
+    {
+    	DoSaveL();
+    	delete dlg;
+    }
+    
+    else
+    if( dlg->ExecuteLD(R_QUERY_ALREADY_SAVED) )
+        {
+        DoSaveL();
+        }
+    iMessage->SetSaved( ETrue );
+    SaveMessageL();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::DoSaveL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::DoSaveL()
+    {
+    TInt numSaved( 0 );
+    CWPSaver* saver = new(ELeave) CWPSaver( *iEngine, EFalse );
+    HBufC* text=NULL;
+    TInt err( saver->ExecuteLD( numSaved ) );
+    TInt numAccessDenied = saver->GetNumAccessDenied();
+    TInt itemCount( iEngine->ItemCount() );
+    
+	if( (numSaved != itemCount) && (iEngine->GetAccessDenied()) )
+    	{
+	  numSaved = numSaved + 1 - numAccessDenied;
+	  iEngine->SetAccessDenied(EFalse);
+    	  err= KErrAccessDenied;
+    	}
+    
+    if( err >= 0 )
+        {
+        // Check if any setting can be made default
+        TBool setDefault( EFalse );
+        
+        for( TInt i( 0 ); i < itemCount && !setDefault; i++ )
+            {
+            if( iEngine->CanSetAsDefault( i ) )
+                {
+                setDefault = ETrue;
+                }
+            }
+        
+        // Ask the user if the saved settings should be 
+        // made default.
+       TInt result = KErrNone;
+        if( setDefault )
+            {
+            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+            
+            if ( dlg->ExecuteLD(R_QUERY_SETDEFAULT) )
+                {
+                CWPSaver* setter = new(ELeave) CWPSaver( *iEngine, ETrue );
+                TInt numSet( 0 );
+                result = setter->ExecuteLD( numSet );
+                }             
+            }
+        
+        // All settings saved
+        if (result)
+            {
+            if(numSaved == 0)
+             	text = StringLoader::LoadLC( R_TEXT_NOTSAVED_SINGULAR_ZERO);
+            else if(numSaved == 1)
+            	text = StringLoader::LoadLC( R_TEXT_NOTSAVED_SINGULAR_ONE, numSaved );
+    				else        
+            	text = StringLoader::LoadLC( R_TEXT_NOTSAVED, numSaved );
+            ErrorNoteL( *text );
+            CleanupStack::PopAndDestroy(); // text
+            }
+        else
+            {
+            ConfirmationNoteL( R_TEXT_SAVED );
+            }
+        }
+    else
+        {
+        if( err == EWPAccessPointsProtected )
+            {
+            // Some problem in saving or user cancelled.
+            InformationNoteL( R_TEXT_AP_PROTECTED );
+            }
+        else
+            {
+            // Some problem in saving or user cancelled.
+            if(numSaved == 0)
+             	text = StringLoader::LoadLC( R_TEXT_NOTSAVED_SINGULAR_ZERO);
+            else if(numSaved == 1)
+            	text = StringLoader::LoadLC( R_TEXT_NOTSAVED_SINGULAR_ONE, numSaved );
+    				else        
+            	text = StringLoader::LoadLC( R_TEXT_NOTSAVED, numSaved );
+            ErrorNoteL( *text );
+            CleanupStack::PopAndDestroy( text );
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::SaveMessageL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SaveMessageL()
+    {
+    CMsvEntry* entry = MsvSession().GetEntryL(iId);
+    CleanupStack::PushL( entry );
+
+    CMsvStore* editStore = entry->EditStoreL();
+    CleanupStack::PushL( editStore );
+    iMessage->StoreL( *editStore );
+    editStore->CommitL();
+    CleanupStack::PopAndDestroy(2); // editStore, entry
+    }
+
+void CWPBioControl::ErrorNoteL(const TDesC& aText)
+    {
+    CAknErrorNote* note = new(ELeave)CAknErrorNote( ETrue );
+    note->ExecuteLD(aText);
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::ErrorNoteL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::ErrorNoteL(TInt aStringResource)
+    {
+    HBufC* buf = StringLoader::LoadLC(aStringResource);
+    ErrorNoteL(*buf);
+    CleanupStack::PopAndDestroy(buf);
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::ConfirmationNoteL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::ConfirmationNoteL(TInt aStringResource)
+    {
+    HBufC* buf = StringLoader::LoadLC(aStringResource);
+    ConfirmationNoteL(*buf);
+    CleanupStack::PopAndDestroy(buf);
+    }
+    
+// ----------------------------------------------------------------------------
+// CWPBioControl ::InformationNoteL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::InformationNoteL(TInt aStringResource)
+    {
+    HBufC* buf = StringLoader::LoadLC(aStringResource);
+    InformationNoteL(*buf);
+    CleanupStack::PopAndDestroy(buf);
+    }
+    
+// ----------------------------------------------------------------------------
+// CWPBioControl ::ConfirmationNoteL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::ConfirmationNoteL(const TDesC& aText)
+    {
+    CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote;
+    note->ExecuteLD(aText);
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::InformationNoteL
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::InformationNoteL(const TDesC& aText)
+    {
+    CAknInformationNote* note = new (ELeave) CAknInformationNote;
+    note->ExecuteLD(aText);
+    }
+
+// ----------------------------------------------------------------------------
+// CWPBioControl ::SetCenrepKey
+// ----------------------------------------------------------------------------
+//
+void CWPBioControl::SetCenrepKeyL(const TDesC8& aValue)
+    {
+
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::SetCenrepKeyL" ) );
+
+    CRepository* rep= NULL;
+    TInt errorStatus = KErrNone;
+
+    TRAPD( errVal, rep = CRepository::NewL( KCRUidOMAProvisioningLV ))
+    ;
+
+    if (errVal == KErrNone)
+        {
+        errorStatus = rep->Set(KOMAProvOriginatorContent, aValue);
+        }
+    else
+        {
+        errorStatus = errVal;
+        }
+
+    if (rep)
+        {
+        delete rep;
+        }
+
+    if (errorStatus != KErrNone)
+        {
+        User::Leave(errorStatus);
+        }
+
+    FLOG( _L( "[ProvisioningBC] CWPBioControl::SetCenrepKeyL done" ) );
+
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Src/CWPCodeQueryDialog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002 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: 
+*     Sortable pair of strings.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CWPCodeQueryDialog.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// ----------------------------------------------------------------------------
+// CCodeQueryDialog::CCodeQueryDialog()
+// C++ constructor
+// ----------------------------------------------------------------------------
+//
+CWPCodeQueryDialog::CWPCodeQueryDialog( TDes& aDataText )
+                                    : CAknTextQueryDialog( aDataText, ENoTone )
+	{
+	}
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CWPCodeQueryDialog::~CWPCodeQueryDialog()
+	{
+	}
+
+// ----------------------------------------------------------------------------
+// CWPCodeQueryDialog::OfferKeyEventL
+// called by framework when any key is pressed
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CWPCodeQueryDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                 TEventCode aType )
+	{
+	// '#' key 
+	if( aKeyEvent.iScanCode == EStdKeyHash  && aType == EEventKeyUp)
+		{ 
+		TryExitL( EEikBidOk );
+		return EKeyWasConsumed;
+		}
+	
+	// '*' key
+	if ( aKeyEvent.iCode == '*' )
+		{
+		return EKeyWasConsumed;
+		}
+
+	return CAknTextQueryDialog::OfferKeyEventL( aKeyEvent, aType );
+	}
+
+// ----------------------------------------------------------------------------
+// CWPCodeQueryDialog::NeedToDismissQueryL()
+// Handles '#' key called by CAknTextQueryDialog::OfferKeyEventL()
+// ----------------------------------------------------------------------------
+//
+TBool CWPCodeQueryDialog::NeedToDismissQueryL( const TKeyEvent& /*aKeyEvent*/ )
+	{
+	return EFalse;
+	}
+
+// ----------------------------------------------------------------------------
+// CWPCodeQueryDialog::OkToExitL()
+// called by framework when the Softkey is pressed
+// ----------------------------------------------------------------------------
+//
+TBool CWPCodeQueryDialog::OkToExitL( TInt aButtonId )
+	{
+	return CAknTextQueryDialog::OkToExitL( aButtonId );
+	}
+	
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Src/CWPNameValue.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 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 encapsulates a name and value pair
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "CWPNameValue.h"
+
+//  MEMBER FUNCTIONS
+
+CWPNameValue* CWPNameValue::NewL( HBufC* aName, HBufC* aValue)
+    {
+    CWPNameValue* self = new (ELeave) CWPNameValue(aName, aValue);
+    return self;
+    }
+
+CWPNameValue* CWPNameValue::NewL(const TDesC& aName, const TDesC& aValue)
+    {
+    CWPNameValue* self = CWPNameValue::NewLC( aName, aValue );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CWPNameValue* CWPNameValue::NewLC(const TDesC& aName, const TDesC& aValue)
+    {
+    CWPNameValue* self = new (ELeave) CWPNameValue;
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aValue);
+    return self;
+    }
+
+CWPNameValue::~CWPNameValue()
+    {
+    delete iName;
+    delete iValue;
+    }
+
+const TDesC& CWPNameValue::Name() const
+    {
+    if (iName)
+        {
+        return *iName;
+        }
+    return KNullDesC;
+    }
+
+const TDesC& CWPNameValue::Value() const
+    {
+    if (iValue)
+        {
+        return *iValue;
+        }
+    return KNullDesC;
+    }
+
+void CWPNameValue::ConstructL(const TDesC& aName, const TDesC& aValue)
+    {
+	aName.Length()==0 ? iName=KNullDesC().AllocL() : iName = aName.AllocL();
+	aValue.Length()==0 ? iValue=KNullDesC().AllocL() : iValue = aValue.AllocL();
+    }
+
+CWPNameValue::CWPNameValue()
+    {
+    }
+
+CWPNameValue::CWPNameValue( HBufC* aName, HBufC* aValue ) :
+    iName(aName),
+    iValue(aValue)
+    {
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Src/CWPSaver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,338 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Helper class for saving Provisioning settings. Provides a progress note.
+*
+*/
+
+
+// INCLUDE FILES
+#include <AknQueryDialog.h>
+#include <eikprogi.h>
+#include <ProvisioningBC.rsg>
+#include <commdb.h>
+#include <CWPEngine.h>
+#include <CWPAdapter.h>
+#include <activefavouritesdbnotifier.h>
+#include "CWPSaver.h"
+
+// CONSTANTS
+const TInt KMaxWaitTime = 2000000;
+const TInt KRetryCount = 5;
+
+// CLASS DECLARATION
+
+// ========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// C++ default constructor.
+// ----------------------------------------------------------------------------
+CWPSaver::CWPSaver( CWPEngine& aEngine, TBool aSetAsDefault )
+                  : CActive( EPriorityStandard ),
+                    iEngine( aEngine ), 
+                    iSetAsDefault( aSetAsDefault ),
+                    iCurrentItem( 0 ),
+                    iResult( KErrNone ),
+                    iNumAccessDenied(0)
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::PrepareLC
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::PrepareLC()
+    {
+    // Assume ownership of this.
+    CleanupStack::PushL( this );
+
+    iApDbNotifier = CActiveApDb::NewL( EDatabaseTypeIAP );
+    iApDbNotifier->AddObserverL( this );
+    
+    User::LeaveIfError( iSession.Connect() );
+    User::LeaveIfError( iBookmarkDb.Open( iSession, KBrowserBookmarks ) );
+    iFavouritesNotifier = 
+                new(ELeave) CActiveFavouritesDbNotifier( iBookmarkDb, *this );  
+
+    iFavouritesNotifier->Start();
+
+    iRetryTimer = CPeriodic::NewL( EPriorityStandard );
+
+    // Set up the dialog and callback mechanism.
+    iDialog = new(ELeave)CAknProgressDialog(
+        reinterpret_cast<CEikDialog**>(&iDialog), EFalse );
+    iDialog->SetCallback( this );
+    iDialog->ExecuteLD(R_WAITNOTE_SAVE);
+    CEikProgressInfo* progressInfo = iDialog->GetProgressInfoL();
+    progressInfo->SetAndDraw(iCurrentItem);
+    progressInfo->SetFinalValue(iEngine.ItemCount());
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::ExecuteLD
+// ----------------------------------------------------------------------------
+//
+TInt CWPSaver::ExecuteLD( TInt& aNumSaved )
+    {
+    PrepareLC();
+
+    // Add us to active scheduler and make sure RunL() gets called.
+    CActiveScheduler::Add( this );
+    CompleteRequest();
+    iWait.Start();
+
+    // Progress note has been finished/cancelled. Cache the result
+    // and delete this.
+    TInt result( iResult );
+    aNumSaved = iCurrentItem;
+    CleanupStack::PopAndDestroy(); // this
+
+    return result;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor
+// ----------------------------------------------------------------------------
+CWPSaver::~CWPSaver()
+    {
+    Cancel();
+
+    delete iApDbNotifier;
+
+    if( iFavouritesNotifier )
+        {
+        iFavouritesNotifier->Cancel();
+        delete iFavouritesNotifier;
+        }
+
+    iBookmarkDb.Close();
+    iSession.Close();
+    delete iRetryTimer;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::DoCancel
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::DoCancel()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::RunL
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::RunL()
+    {
+    // Choose whether to save or set as default
+    TInt err( KErrNone );
+    if( iSetAsDefault )
+        {
+        TRAP( err, 
+            if( iEngine.CanSetAsDefault( iCurrentItem ) )
+                {
+                iEngine.SetAsDefaultL( iCurrentItem );
+                } );
+        }
+    else
+        {
+        TRAP( err, iEngine.SaveL( iCurrentItem ) );
+        }
+
+    // If CommsDB or BookmarkDB are locked, schedule a retry
+    if( err == EWPCommsDBLocked || err == KErrLocked)
+        {
+        iWaitCommsDb = ETrue;
+        DelayedCompleteRequestL();
+        return;
+        }
+    else if( err == EWPBookmarksLocked )
+        {
+        iWaitFavourites = ETrue;
+        DelayedCompleteRequestL();
+        return;
+        }
+    else if( err == KErrNone || err == KErrAccessDenied)
+        {
+        if( err == 	KErrAccessDenied)
+	          {
+	          TInt 	aNumAccessDenied = GetNumAccessDenied();
+	          aNumAccessDenied++;
+	          SetNumAccessDenied(aNumAccessDenied);
+	          iEngine.SetAccessDenied(ETrue);
+	          }
+    
+        // Succesful save, so reset retry count
+        iRetryCount = 0;
+
+        // Normal progress
+        if( iCurrentItem == iEngine.ItemCount()-1 )
+            {
+            iDialog->ProcessFinishedL();
+            }
+        else
+            {
+            CEikProgressInfo* progressInfo = iDialog->GetProgressInfoL();
+            iCurrentItem++;
+            progressInfo->SetAndDraw(iCurrentItem);
+            CompleteRequest();
+            }
+        }
+    else
+        {    
+        // For all other errors, pass them through.
+        User::LeaveIfError( err );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::RunError
+// ----------------------------------------------------------------------------
+//
+TInt CWPSaver::RunError( TInt aError )
+    {
+    // There was a leave in RunL(). Store the error and
+    // stop the dialog.
+    iResult = aError;
+    iWait.AsyncStop();
+    delete iDialog;
+    iDialog = NULL;
+
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::DialogDismissedL
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::DialogDismissedL( TInt aButtonId )
+    {
+    if( aButtonId < 0 )
+        {
+        iResult = KErrCancel;
+        }
+
+    iWait.AsyncStop();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::CompleteRequest
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::CompleteRequest()
+    {
+    // Schedule an immediate complete. Make sure that there
+    // is no timer alive first
+    Cancel();
+    iRetryTimer->Cancel();
+
+    SetActive();
+    TRequestStatus* sp = &iStatus;
+    User::RequestComplete( sp, KErrNone );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::DelayedCompleteRequestL
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::DelayedCompleteRequestL()
+    {
+    if( iRetryCount < KRetryCount )
+        {
+        // Schedule a delayed complete. Cancel first in case
+        // an immediate request was scheduled.
+        iRetryTimer->Cancel();
+        iRetryTimer->Start( KMaxWaitTime, KMaxTInt32, TCallBack( Timeout, this ) );
+        iRetryCount++;
+        }
+    else
+        {
+        User::Leave( KErrTimedOut );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::Retry
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::Retry()
+    {
+    // Immediate retry. Mark that we're not waiting
+    // for an event and complete request.
+    iWaitCommsDb = EFalse;
+    iWaitFavourites = EFalse;
+    CompleteRequest();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::Timeout
+// ----------------------------------------------------------------------------
+//
+TInt CWPSaver::Timeout(TAny* aSelf)
+    {
+    // There was a time-out. Retry saving even though we
+    // didn't get a notify from database.
+    CWPSaver* self = static_cast<CWPSaver*>( aSelf );
+    self->Retry();
+
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::HandleApDbEventL
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::HandleApDbEventL( TEvent aEvent )
+    {
+    // We received an event from CommsDB. Retry if we're
+    // waiting for it.
+    if( iWaitCommsDb && aEvent == EDbAvailable )
+        {
+        Retry();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::HandleFavouritesDbEventL
+// ----------------------------------------------------------------------------
+//
+void CWPSaver::HandleFavouritesDbEventL( RDbNotifier::TEvent /*aEvent*/ )
+    {
+    // We received an event from BookmarkDB. Retry if we're
+    // waiting for it.
+    if( iWaitFavourites )
+        {
+        Retry();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPSaver::GetNumAccessDenied
+// ----------------------------------------------------------------------------
+//
+    
+TInt CWPSaver::GetNumAccessDenied()
+    {
+    return iNumAccessDenied;
+    }	
+
+// ----------------------------------------------------------------------------
+// CWPSaver::SetNumAccessDenied
+// ----------------------------------------------------------------------------
+//
+        
+void CWPSaver::SetNumAccessDenied(TInt aNumAccessDenied )
+    {
+    iNumAccessDenied = aNumAccessDenied;
+    }	
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/Src/CWPStringPair.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2002 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: 
+*     Sortable pair of strings.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CWPStringPair.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// C++ default constructor.
+CWPStringPair::CWPStringPair()
+	{
+	}
+
+// Destructor
+CWPStringPair::~CWPStringPair()
+	{
+	delete iName;
+	delete iValue;
+	}
+
+// ---------------------------------------------------------
+// CWPStringPair::SetL
+// ---------------------------------------------------------
+//
+void CWPStringPair::SetL( const TDesC& aName, const TDesC& aValue )
+	{
+	HBufC* name = aName.AllocLC();
+	HBufC* value = aValue.AllocL();
+	CleanupStack::Pop(); // name
+
+	delete iName;
+	iName = name;
+	iNamePtr.Set( *iName );
+
+	delete iValue;
+	iValue = value;
+	iValuePtr.Set( *iValue );
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/eabi/ProvisioningBCu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,11 @@
+EXPORTS
+	_ZN13CWPBioControl4NewLER22MMsgBioControlObserverP11CMsvSessionl11TMsgBioModePK5RFile @ 1 NONAME
+	_ZTI13CWPBioControl @ 2 NONAME ; #<TI>#
+	_ZTI18CWPCodeQueryDialog @ 3 NONAME ; #<TI>#
+	_ZTI8CWPSaver @ 4 NONAME ; #<TI>#
+	_ZTV13CWPBioControl @ 5 NONAME ; #<VT>#
+	_ZTV18CWPCodeQueryDialog @ 6 NONAME ; #<VT>#
+	_ZTV8CWPSaver @ 7 NONAME ; #<VT>#
+	_ZTI12CWPNameValue @ 8 NONAME ; #<TI>#
+	_ZTV12CWPNameValue @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningBC/loc/ProvisioningBC.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2002 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 a localisation file for Provisioning
+*
+*  -------------------------------------------------------------------
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//****************************************************************************
+
+//d:Message info in Message Details
+//l:list_single_heading_pane_t1
+#define qtn_sm_title_configuration "Config. msg."
+   
+//d:Provisioning message title pane item.
+//l:title_pane_t2/opt12
+//
+#define qtn_op_title_confsett     "Configuration settings"
+
+//d:Help text for the user
+//l:popup_info_list_pane_t1
+#define qtn_op_view_help "Select 'Save' from 'Options' to configure all settings"
+
+//d:Number of settings text if >5
+//l:popup_info_list_pane_t1
+#define qtn_op_sett_items "%N items"
+
+//d:Heading text for wait note in save all-operation
+//l:popup_note_wait_window
+//
+#define qtn_sm_wait_saving_servsett "Saving service settings "
+
+//d:Not all settings saved
+//l:popup_note_window
+//
+#define qtn_op_info_notsaved "%N settings saved. Uncompleted settings were not saved"
+
+//d:All settings saved
+//l:popup_note_window
+//
+#define qtn_sm_all_serv_settings_copied "Saved"
+
+//d:Set as default query
+//l:popup_note_window
+//
+#define qtn_op_conf_setdef "Set the received settings as default?"
+
+//d:Query presented when message is not authenticated.
+//l:popup_note_window
+//
+#define qtn_op_nottsp_conf_note "Sender of the message is unknown. Continue?"
+
+//d:Command in options list.
+//d:Saves the settings to the device.
+//l:list_single_pane_t1_cp2
+//
+#define qtn_op_options_save "Save"
+
+//d:Message cannot be opened
+//l:popup_note_window
+#define qtn_mce_info_message_not_opened "Unable to open. Message format not supported."
+
+//d:Message cannot be saved
+//l:popup_note_window
+#define qtn_op_error_save "No access points found in the message. Settings cannot be saved."
+
+//d:Message cannot be saved due to protected AP settings
+//l:popup_note_window
+#define qtn_sms_note_protected_ap "Unable to add access point to protected access point settings"
+
+//d:User entered a wrong PIN
+//l:popup_note_window
+#define qtn_op_verific_failed "Code error"
+
+//d:Text for PIN query
+//l:popup_query_code_window/opt1
+#define qtn_op_enter_settpin "Enter settings’ PIN:"
+
+//d:User entered wrong PIN three times
+//l:popup_note_window
+#define qtn_op_verific_failed_totally "Verification failed and message was deleted. Contact your service provider."
+
+//d:Settings already saved query
+//l:popup_note_window
+#define qtn_op_already_saved 		"Settings are already saved. Save again?"
+
+//****************************************************************
+//from the mce ui specification
+
+//d:Name of the message [type].
+//l:list_double_graphic_pane_t2
+#define qtn_mce_inbox_type_smart_conf       "Configuration message"
+
+//d:Text to be displayed on the pop up note
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_op_info_notsaved_singular_zero  "No settings saved"
+
+//d:Text to be displayed on the pop up note
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_op_info_notsaved_singular_one   "%N setting saved. Uncompleted settings were not saved " 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxApp.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002 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: 
+*     Provisioning dumpper application
+*
+*/
+
+
+#ifndef CWPCXAPP_H
+#define CWPCXAPP_H
+
+// INCLUDES
+#include <aknapp.h>
+
+// CLASS DECLARATION
+
+/**
+* CProvisioningCxApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CWPCxApp : public CAknApplication
+    {
+    
+    private:
+
+        /**
+        * From CApaApplication, creates CProvisioningCxDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidProvisioningCx).
+        * @return The value of KUidProvisioningDump.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxAppUi.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 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: 
+*     Provisioning context list application
+*
+*/
+
+
+#ifndef CWPCXAPPUI_H
+#define CWPCXAPPUI_H
+
+// INCLUDES
+#include <aknviewappui.h>
+
+// FORWARD DECLARATIONS
+class CWPCxContainer;
+
+// CLASS DECLARATION
+
+/**
+* Application UI class.
+* Provides support for the following features:
+* - EIKON control architecture
+* - view architecture
+* - status pane
+* 
+*/
+class CWPCxAppUi : public CAknViewAppUi
+    {
+    public: // // Constructors and destructor
+
+        /**
+        * EPOC default constructor.
+        */      
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        ~CWPCxAppUi();
+        
+    private: // from CEikAppUi
+
+        void HandleCommandL(TInt aCommand);
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxContainer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2002 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: 
+*     Provisioning context list container
+*
+*/
+
+
+#ifndef CWPCXCONTAINER_H
+#define CWPCXCONTAINER_H
+
+// INCLUDES
+#include <aknview.h>
+#include <bamdesca.h>
+   
+// FORWARD DECLARATIONS
+class CAknSingleStyleListBox;
+class CWPEngine;
+
+// CLASS DECLARATION
+
+/**
+*  CWPCxDocument  container control class.
+*  
+*/
+class CWPCxContainer : public CCoeControl, 
+    private MCoeControlObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * C++ constructor
+        */
+        CWPCxContainer( CWPEngine& aEngine, CAknView& aAppView );
+        
+        /**
+        * Symbian default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        ~CWPCxContainer();
+
+    public: // from CCoeControl
+
+        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+        void HandleResourceChange( TInt aType );
+
+    public: // new methods
+
+        /**
+        * Returns the UID of the currently selected context.
+        * @return Context UID
+        */
+        TUint32 CurrentContext() const;
+
+        /**
+        * Returns the UID of the currently selected context.
+        * @return Context UID
+        */
+        TPtrC CurrentContextName() const;
+
+        /**
+        * Returns number of contexts in list.
+        * @return Number of contexts
+        */
+        TInt ContextCount() const;
+
+        /**
+        * Updates the list of contexts.
+        */
+        void UpdateContextsL();
+
+    private: // from CCoeControl
+
+        void SizeChanged();
+        TInt CountComponentControls() const;
+        CCoeControl* ComponentControl(TInt aIndex) const;
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    private: // from MCoeControlObserver
+       
+        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
+        
+    private: //data
+
+        /// The list box. Owns.
+        CAknSingleStyleListBox* iListBox;
+
+        /// Provisioning engine. Refs.
+        CWPEngine& iEngine;
+
+        /// List of context uids. Owns.
+        CArrayFix<TUint32>* iCxUids;
+
+        /// List of visible lines. Owns.
+        CDesCArray* iLines;
+
+        /// The application view
+        CAknView& iAppView;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxDeleter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002-2006 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:  Settings deleter with progress note.
+*
+*/
+
+
+#ifndef CWPCXDELETER_H
+#define CWPCXDELETER_H
+
+// INCLUDES
+#include <aknprogressdialog.h>
+#include <activeapdb.h>
+#include <favouritesdbobserver.h>
+#include <FavouritesDb.h>
+
+// FORWARD DECLARATIONS
+class CWPEngine;
+class CActiveFavouritesDbNotifier;
+
+// CLASS DECLARATION
+
+/**
+ * Helper class for deleting Provisioning settings.
+ */
+class CWPCxDeleter : public CActive, 
+                     private MProgressDialogCallback, 
+                     private MActiveApDbObserver, 
+                     private MFavouritesDbObserver
+    {
+    public:
+        /**
+        * C++ default constructor.
+        * @param aEngine Engine to be used for saving
+        */
+        CWPCxDeleter( CWPEngine& aEngine, TUint32 aContext );
+
+        /**
+        * Destructor.
+        */
+        ~CWPCxDeleter();
+
+    public:
+        /**
+        * Prepares the object for saving.
+        */
+        void PrepareLC();
+
+        /**
+        * Executes save with a progress note. Ownership of the
+        * CWPSaver object is transferred.
+        * @param aNumDeleted When returns, contains number of settings saved.
+        * @return Status code. >= 0 if saving was completed
+        */
+        TInt ExecuteLD( TInt& aNumDeleted );
+
+    protected: // From CActive
+
+        void DoCancel();
+        void RunL();
+        TInt RunError( TInt aError );
+
+    private: // From MProgressDialogCallback
+
+        void DialogDismissedL( TInt aButtonId );
+
+    private: // from MActiveApDbObserver
+
+        void HandleApDbEventL( TEvent anEvent );
+
+    private: // from MFavouritesDbObserver
+
+        void HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent );
+
+    private:
+        /**
+        * Complete the request so that RunL() gets called.
+        */
+        void CompleteRequest();
+
+        /**
+        * Complete the request so that Timeout() gets called after
+        * a delay.
+        */
+        void DelayedCompleteRequestL();
+
+        /**
+        * Retry save now.
+        */
+        void Retry();
+
+        /**
+        * Timer timed-out.
+        */
+        static TInt Timeout(TAny* aSelf);
+
+    private:
+        // The engine used for performing the save. Refs.
+        CWPEngine& iEngine;
+
+        // The context being deleted
+        TUint32 iContext;
+
+        // The progress dialog. Owns.
+        CAknProgressDialog* iDialog;
+
+        // The item to be saved next
+        TInt iCurrentItem;
+
+        // Contains result to be passed to the called of ExecuteLD
+        TInt iResult;
+
+        // Active AP database
+        CActiveApDb* iApDbNotifier;
+
+        // Active Favourites Database
+        CActiveFavouritesDbNotifier* iFavouritesNotifier;
+
+        // Contains ETrue if commsdb is being waited on
+        TBool iWaitCommsDb;
+
+        // Contains ETrue if favourites db is being waited on
+        TBool iWaitFavourites;
+
+        // Active scheduler.
+        CActiveSchedulerWait iWait;
+
+        // Timer for retry
+        CPeriodic* iRetryTimer;
+
+        // Retry count
+        TInt iRetryCount;
+        
+        RFavouritesDb       iBookmarkDb;
+        RFavouritesSession  iSession;
+    };
+
+
+#endif // CWPCXDELETER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxDocument.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 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: 
+*     Provisioning context list document
+*
+*/
+
+
+#ifndef CWPCXDOCUMENT_H
+#define CWPCXDOCUMENT_H
+
+// INCLUDES
+#include <akndoc.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+
+// CLASS DECLARATION
+
+/**
+*  CWPCxDocument document class.
+*/
+class CWPCxDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CWPCxDocument* NewL(CEikApplication& aApp);
+
+        /**
+        * Destructor.
+        */
+        ~CWPCxDocument();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CWPCxDocument(CEikApplication& aApp);
+
+        /**
+        * Symbian second phase constructor.
+        */
+        void ConstructL();
+
+    private: // from CEikDocument
+
+        CEikAppUi* CreateAppUiL();
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxView.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002 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: 
+*     Provisioning context list view
+*
+*/
+
+
+#ifndef CWPCXVIEW_H
+#define CWPCXVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include "MWPContextObserver.h"
+
+// CONSTANTS
+// UID of view
+const TUid KProvisioningCxViewId = {1};
+
+// FORWARD DECLARATIONS
+class CWPCxContainer;
+class CWPEngine;
+
+// CLASS DECLARATION
+
+/**
+*  CProvisioningDumpView view class.
+* 
+*/
+class CWPCxView : public CAknView, private MWPContextObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * EPOC default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CWPCxView();
+
+    public: // from CAknView
+        
+        TUid Id() const;
+        void HandleCommandL(TInt aCommand);
+        void HandleClientRectChange();
+
+    private: // from CAknView
+
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+        void DoDeactivate();
+
+    public: // From MWPContextObserver
+        void ContextChangeL( RDbNotifier::TEvent aEvent );
+
+    private:
+        // From MEikMenuObserver
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+    private: // new methods
+        void DeleteContextL();
+        void LaunchPopupL();
+
+    private: // Data
+        /// The context list container. Owns.
+        CWPCxContainer* iContainer;
+
+        /// The ProvisioningEngine instance. Owns.
+        CWPEngine* iEngine;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Inc/ProvisioningCx.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002 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: 
+*     Provisioning context list view commands
+*
+*/
+
+
+#ifndef PROVISIONINGCX_HRH
+#define PROVISIONINGCX_HRH
+
+enum TProvisioningCxMenuCommands
+    {
+    EProvisioningCxCmdDeleteContext = 1,
+    EProvisioningCxCmdSelect
+    };
+
+
+#endif      //  PROVISIONINGCX_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains all the resources for the module ProvisioningHandler.
+*
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+
+NAME    PROV
+
+//  INCLUDES
+
+#include <eikon.rh>
+#include <avkon.loc>
+#include <eikon.rsg>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include "ProvisioningCx.hrh"
+#include <ProvisioningCx.loc>
+
+#include <appinfo.rh>
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=qtn_op_conf_cont_title; }
+
+//not_used
+RESOURCE EIK_APP_INFO not_used
+    {
+    menubar = 0;
+    cba = 0;
+    }
+
+RESOURCE LOCALISABLE_APP_INFO r_provisioningcx_localisable_app_info
+    {
+    short_caption = qtn_op_conf_cont_title;
+    caption_and_icon =
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_op_conf_cont_title;
+        #ifdef __SCALABLE_ICONS
+            number_of_icons = 1;
+           	icon_file = "Z:\\resource\\apps\\ProvisioningCx_aif.mif";
+        #else
+            number_of_icons = 2;
+            icon_file = "Z:\\resource\\apps\\ProvisioningCx_aif.mbm";
+        #endif
+        };
+    }
+
+#ifdef __SERIES60_32__
+//----------------------------------------------------
+//   
+//    r_provisioningcx_softkeys_options_back__contextoptions
+//    Provisioning context list view
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_provisioningcx_softkeys_options_back__contextoptions
+	{
+	buttons	= 
+		{
+		
+		CBA_BUTTON 
+		{
+			id = EAknSoftkeyOptions; txt = text_softkey_option;
+		},
+		
+		
+		CBA_BUTTON 
+		{
+			id = EAknSoftkeyBack; txt = text_softkey_back;
+		},
+	
+		CBA_BUTTON 
+		{
+			id = EAknSoftkeyContextOptions; txt = text_softkey_option;
+		}
+		
+		};
+	
+	}
+#endif
+//----------------------------------------------------
+//   
+//    r_provisioningcx_view1
+//    Provisioning context list view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_provisioningcx_view1
+    {
+    menubar=r_provisioningcx_menubar_view1;  
+    #ifdef __SERIES60_32__ 						// KS
+    	cba = r_provisioningcx_softkeys_options_back__contextoptions; 
+    #else
+    	cba=R_AVKON_SOFTKEYS_SELECTION_LIST;
+    #endif
+    }
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_menubar_view1
+//    Menu bar for view
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_provisioningcx_menubar_view1
+{
+    titles=
+    {
+        MENU_TITLE { menu_pane = r_provisioningcx_app_menu; }
+    };
+}
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_app_menu
+//    Menu bar for view
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_provisioningcx_app_menu
+{
+    items=
+    {
+        MENU_ITEM { command=EProvisioningCxCmdDeleteContext; txt = qtn_op_opt_delete; },
+        MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+        MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; }
+    };
+}
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_context_menubar
+//    Menu bar for view
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_provisioningcx_context_menubar
+    {
+    titles = 
+        {
+        MENU_TITLE { menu_pane = r_provisioningcx_context_menu; } 
+        };
+    }
+    
+//----------------------------------------------------
+//   
+//    r_provisioningcx_context_menu
+//    Menu bar for view
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_provisioningcx_context_menu
+{
+    items=
+    {
+        MENU_ITEM { command=EProvisioningCxCmdDeleteContext; txt = qtn_op_opt_delete; }
+    };
+}
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_listbox
+//    Context list box
+//
+//----------------------------------------------------
+//
+RESOURCE LISTBOX r_provisioningcx_listbox
+    {
+    flags = EAknListBoxSelectionList;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_provisioncx_query_delete
+//    Confirmation query for deletion
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_provisioncx_query_delete
+    {
+    flags = EGeneralQueryFlags;
+    #ifdef __SERIES60_32__	// KS
+    	buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
+    #else
+    	buttons = R_AVKON_SOFTKEYS_YES_NO;
+    #endif
+
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                { 
+                layout = EConfirmationLayout;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_empty
+//    Text when there are no configuration contexts
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_op_conf_cont_empty
+    { 
+    buf = qtn_op_conf_cont_empty; 
+    }
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_delete
+//    Text for deletion query
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_op_delete_context
+    { 
+    buf = qtn_op_delete_context; 
+    }
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_default_name
+//    Text for deletion query
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_op_context_name
+    { 
+    buf = qtn_op_context_name; 
+    }
+
+//----------------------------------------------------
+//   
+//    r_provisioningcx_default_name2
+//    Text for deletion query
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_op_context_name2    
+    { 
+    buf = qtn_op_context_name2; 
+    }
+
+
+// ---------------------------------------------------------
+//   
+//    r_waitnote_delete
+//    Save wait note
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_waitnote_delete
+    {
+    flags = EAknProgressNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = 1;
+            control = AVKON_NOTE 
+                { 
+                layout = EProgressLayout;
+                singular_label = qtn_fldr_deleting_wait_note;
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_text_qtn_op_del_cont_no
+//    Error note when a context is active.
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_text_qtn_op_del_cont_no
+    {
+    buf=qtn_op_del_cont_no;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx_Caption.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002 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: 
+*    Application information resource file that defines short and long caption
+*    for ProvisioningCx application.
+*
+*/
+
+
+#include <ProvisioningCx.loc>
+#include <apcaptionfile.rh>
+
+RESOURCE CAPTION_DATA
+    {
+    caption=qtn_op_conf_cont_title;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx_reg.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2004 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 <appinfo.rh>
+#include <ProvisioningCx.rsg>
+#include "ProvisioningUids.h"
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 KProvisioningCxUID3 // Define your application UID here
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "ProvisioningCx";
+    localisable_resource_file = APP_RESOURCE_DIR"\\ProvisioningCx";
+    localisable_resource_id = R_PROVISIONINGCX_LOCALISABLE_APP_INFO;
+    hidden = KAppIsHidden;
+    embeddability = KAppEmbeddable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxApp.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002-2006 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:  Provisioning context list
+*
+*/
+
+
+//  INCLUDE FILES
+#include <eikstart.h>
+
+#include "CWPCxApp.h"
+#include "CWPCxDocument.h"
+#include "ProvisioningUIDs.h"
+
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CWPCxApp;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CWPCxApp::AppDllUid()
+// ---------------------------------------------------------
+//
+TUid CWPCxApp::AppDllUid() const
+    {
+    return TUid::Uid( KProvisioningCxUID3 );
+    }
+
+// ---------------------------------------------------------
+// CWPCxApp::CreateDocumentL()
+// ---------------------------------------------------------
+//
+CApaDocument* CWPCxApp::CreateDocumentL()
+    {
+    return CWPCxDocument::NewL( *this );
+    }
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxAppUi.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 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:  Provisioning context list
+*
+*/
+
+
+//  INCLUDE FILES
+#include "CWPCxAppUi.h"
+
+#include <avkon.hrh>
+#include <hlplch.h>
+#include <ProvisioningCx.rsg>
+#include "CWPCxView.h"
+#include "CWPCxContainer.h" 
+#include "provisioningCx.hrh"
+
+// ================= MEMBER FUNCTIONS =======================
+//
+// ----------------------------------------------------------
+// CWPCxAppUi::ConstructL()
+// ----------------------------------------------------------
+//
+void CWPCxAppUi::ConstructL()
+    {
+    #ifdef __SERIES60_32__
+    	BaseConstructL( EAknEnableSkin | EAknEnableMSK);
+    #else
+    	BaseConstructL( EAknEnableSkin);
+    #endif
+
+    CWPCxView* view1 = new (ELeave) CWPCxView;
+
+    CleanupStack::PushL( view1 );
+    view1->ConstructL();
+    AddViewL( view1 );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // view1
+    }
+
+// Destructor
+CWPCxAppUi::~CWPCxAppUi()
+    {
+    }
+
+// ----------------------------------------------------
+// CWPCxAppUi::HandleCommandL
+// ----------------------------------------------------
+//
+void CWPCxAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch ( aCommand )
+        {
+        case EAknCmdHelp:
+            {
+            HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), AppHelpContextL() );
+            break;
+            }
+        case EEikCmdExit:
+            {
+            Exit();
+            break;
+            }
+
+        default:
+            break;      
+        }
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxContainer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,304 @@
+/*
+* Copyright (c) 2002 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:  Provisioning context list
+*
+*/
+
+
+//  INCLUDE FILES
+#include "CWPCxContainer.h"
+#include <stringloader.h>
+#include <aknlists.h>
+#include <barsread.h>
+#include <provisioningcx.rsg>
+#include <csxhelp/prov.hlp.hrh>
+#include "CWPEngine.h"
+#include "ProvisioningUids.h"
+#include "ProvisioningCx.hrh"
+#include "Provisioningdebug.h"
+
+// CONSTANTS
+/// Granularity of the lines array
+const TInt KLinesGranularity = 3;
+/// Maximum number of characters in one line
+const TInt KMaxLineLength = 128;
+/// Number of tabs in front of the line
+const TInt KNumTabsPrepended = 1;
+/// Number of tabs in the end of the line
+const TInt KNumTabsAppended = 2;
+
+//help resources
+//_LIT(KPROV_HLP_CONFCONT,"PROV_HLP_CONFCONT");
+const TUint32 KGSUid = 0x100058ec;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::CWPCxContainer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPCxContainer::CWPCxContainer( CWPEngine& aEngine, CAknView& aAppView )
+                                : iEngine( aEngine ), iAppView( aAppView )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CWPCxContainer::ConstructL( const TRect& aRect )
+    {
+    CreateWindowL();
+
+    iListBox = new(ELeave) CAknSingleStyleListBox;
+    iListBox->SetContainerWindowL( *this);
+
+	// Add vertical scroll bar for the list
+    CEikScrollBarFrame* sbFrame = iListBox->CreateScrollBarFrameL( ETrue );
+    sbFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,    
+                                      CEikScrollBarFrame::EAuto ); // vertical
+    TResourceReader rr;
+    CEikonEnv::Static()->CreateResourceReaderLC( rr, R_PROVISIONINGCX_LISTBOX );
+    iListBox->SetContainerWindowL( *this );
+    iListBox->ConstructFromResourceL( rr );
+    CleanupStack::PopAndDestroy(); // rr
+
+    iLines = new(ELeave) CDesCArrayFlat(KLinesGranularity);
+    UpdateContextsL();
+
+    iListBox->Model()->SetItemTextArray( iLines );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    HBufC* emptyText = StringLoader::LoadLC( R_QTN_OP_CONF_CONT_EMPTY );
+    iListBox->View()->SetListEmptyTextL( *emptyText );
+    CleanupStack::PopAndDestroy( emptyText );
+    
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPCxContainer::~CWPCxContainer()
+    {
+    delete iListBox;
+    delete iCxUids;
+    delete iLines;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::CurrentContext
+// -----------------------------------------------------------------------------
+//
+TUint32 CWPCxContainer::CurrentContext() const
+    {
+    TInt current( iListBox->CurrentItemIndex() );
+
+    TUint32 result( KWPUidNoContext );
+    if( current >= 0 )
+        {
+        result = iCxUids->At( current );
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::CurrentContextName
+// -----------------------------------------------------------------------------
+//
+TPtrC CWPCxContainer::CurrentContextName() const
+    {
+    TInt current( iListBox->CurrentItemIndex() );
+
+    TPtrC result( iLines->MdcaPoint( current ) );
+    result.Set( result.Mid( KNumTabsPrepended ) );
+    result.Set( result.Left( result.Length()-KNumTabsAppended ) );
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::ContextCount
+// -----------------------------------------------------------------------------
+//
+TInt CWPCxContainer::ContextCount() const
+    {
+    return iLines->MdcaCount();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::UpdateContextsL
+// -----------------------------------------------------------------------------
+//
+void CWPCxContainer::UpdateContextsL()
+    {
+    FLOG( _L( "[Provisioning] CWPCxContainer::UpdateContextsL" ) );
+    
+    delete iCxUids;
+    iCxUids = NULL;
+    iCxUids = iEngine.ContextUidsL();
+
+    iLines->Reset();
+
+    TInt defaultCount( 0 );
+    const TInt numUids( iCxUids->Count() );
+    for( TInt i( 0 ); i < numUids; i++ )
+        {
+        FLOG( _L( "[Provisioning] CWPCxContainer::UpdateContextsL 1" ) );
+        TBuf<KMaxLineLength> line;
+
+        TUint32 uid( iCxUids->At( i ) );
+
+        HBufC* tps = iEngine.ContextTPSL( uid );
+        CleanupStack::PushL( tps );
+        HBufC* name = iEngine.ContextNameL( uid );
+        if( name->Length() == 0 )
+            {
+            FLOG( _L( "[Provisioning] CWPCxContainer::UpdateContextsL name length 0" ) );
+            delete name;
+            if( defaultCount == 0 )
+                {
+                name = StringLoader::LoadL( R_QTN_OP_CONTEXT_NAME );
+                }
+            else
+                {
+                name = StringLoader::LoadL( R_QTN_OP_CONTEXT_NAME2,
+                                            defaultCount );
+                }
+            defaultCount++;
+            }
+        CleanupStack::PushL( name );
+
+        line.Zero();
+        line.Append( EKeyTab );
+        line.Append( *name );
+        line.Append( EKeyTab );
+        line.Append( EKeyTab );
+
+        CleanupStack::PopAndDestroy( name );
+        CleanupStack::PopAndDestroy( tps );
+        
+        iLines->AppendL( line );
+        }
+
+    iListBox->HandleItemAdditionL();
+
+    TInt index = iListBox->CurrentItemIndex(); 
+    TInt count = iListBox->Model()->NumberOfItems();
+    
+    if ( (index < 0 || index >= count) && count > 0 )
+        {
+        // sets the last item as focused
+        iListBox->SetCurrentItemIndexAndDraw(count-1); 
+        iListBox->HandleItemRemovalL();
+        }
+    FLOG( _L( "[Provisioning] CWPCxContainer::UpdateContextsL done" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CWPCxContainer::SizeChanged()
+    {
+    iListBox->SetRect(Rect());
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CWPCxContainer::CountComponentControls() const
+    {
+    return 1;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CWPCxContainer::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return iListBox;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::HandleControlEventL
+// -----------------------------------------------------------------------------
+//
+void CWPCxContainer::HandleControlEventL( CCoeControl* /*aControl*/,
+                                          TCoeEvent /*aEventType*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CWPCxContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                             TEventCode aType)
+    {
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyBackspace:
+            {
+            iAppView.ProcessCommandL( EProvisioningCxCmdDeleteContext );
+            break;
+            }
+        case EKeyOK:
+            {
+            iAppView.ProcessCommandL( EProvisioningCxCmdSelect );
+            break;
+            }
+        default:
+            {
+            break;     
+            }
+        }
+    
+    return iListBox->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPCxContainer::GetHelpContext
+// -----------------------------------------------------------------------------
+//
+void CWPCxContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iContext = KPROV_HLP_CONFCONT() ;    
+	aContext.iMajor=TUid::Uid( KGSUid );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPCxContainer::HandleResourceChange
+//  
+// ---------------------------------------------------------------------------
+
+void CWPCxContainer::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+                                           mainPaneRect);
+        SetRect( mainPaneRect );
+		    DrawNow();
+        }
+    CCoeControl::HandleResourceChange( aType );
+    }
+    
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxDeleter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,291 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Helper class for saving Provisioning settings. Provides a progress note.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CWPCxDeleter.h"
+#include <aknquerydialog.h>
+#include <eikprogi.h>
+#include <ProvisioningCx.rsg>
+#include <commdb.h>
+#include <CWPEngine.h>
+#include <CWPAdapter.h>
+#include <ActiveFavouritesDbNotifier.h>
+
+// CONSTANTS
+const TInt KMaxWaitTime = 2000000;
+const TInt KRetryCount = 5;
+
+// CLASS DECLARATION
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor.
+CWPCxDeleter::CWPCxDeleter( CWPEngine& aEngine, TUint32 aContext )
+: CActive( EPriorityStandard ), iEngine( aEngine ), 
+  iContext( aContext ),
+  iCurrentItem( 0 ), iResult( KErrNone )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::ExecuteLD
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::PrepareLC()
+    {
+    // Assume ownership of this.
+    CleanupStack::PushL( this );
+
+    iApDbNotifier = CActiveApDb::NewL( EDatabaseTypeIAP );
+    iApDbNotifier->AddObserverL( this );
+    
+    User::LeaveIfError( iSession.Connect() );
+    User::LeaveIfError( iBookmarkDb.Open( iSession, KBrowserBookmarks ) );
+    iFavouritesNotifier = new(ELeave) CActiveFavouritesDbNotifier( iBookmarkDb, *this );
+
+    iFavouritesNotifier->Start();
+
+    iRetryTimer = CPeriodic::NewL( EPriorityStandard );
+
+    // Set up the dialog and callback mechanism.
+    iDialog = new(ELeave)CAknProgressDialog(
+        reinterpret_cast<CEikDialog**>(&iDialog), EFalse );
+    iDialog->SetCallback( this );
+    iDialog->ExecuteLD(R_WAITNOTE_DELETE);
+    CEikProgressInfo* progressInfo = iDialog->GetProgressInfoL();
+    progressInfo->SetAndDraw(iCurrentItem);
+    progressInfo->SetFinalValue(iEngine.ContextDataCountL(iContext));
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::ExecuteLD
+// ----------------------------------------------------------------------------
+//
+TInt CWPCxDeleter::ExecuteLD( TInt& aNumDeleted )
+    {
+    PrepareLC();
+
+    // Add us to active scheduler and make sure RunL() gets called.
+    CActiveScheduler::Add( this );
+    CompleteRequest();
+    iWait.Start();
+
+    // Progress note has been finished/cancelled. Cache the result
+    // and delete this.
+    TInt result( iResult );
+    aNumDeleted = iCurrentItem;
+    CleanupStack::PopAndDestroy(); // this
+
+    return result;
+    }
+
+// Destructor
+CWPCxDeleter::~CWPCxDeleter()
+    {
+    Cancel();
+
+    delete iApDbNotifier;
+
+    if( iFavouritesNotifier )
+        {
+        iFavouritesNotifier->Cancel();
+        delete iFavouritesNotifier;
+        }
+
+    iBookmarkDb.Close();
+    iSession.Close();
+
+    delete iRetryTimer;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::DoCancel
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::DoCancel()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::RunL
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::RunL()
+    {
+    // Choose whether to save or set as default
+    TBool more( EFalse );
+    TRAPD( err, more = iEngine.DeleteContextDataL( iContext ) );
+
+    // If CommsDB or BookmarkDB are locked, schedule a retry
+    if( err == EWPCommsDBLocked )
+        {
+        iWaitCommsDb = ETrue;
+        DelayedCompleteRequestL();
+        return;
+        }
+    else if( err == EWPBookmarksLocked )
+        {
+        iWaitFavourites = ETrue;
+        DelayedCompleteRequestL();
+        return;
+        }
+    else if( err != KErrNone )
+        {
+        // For all other errors, pass them through.
+        User::LeaveIfError( err );
+        }
+    // Succesful save, so reset retry count
+    iRetryCount = 0;
+
+    // Normal progress
+    if( !more )
+        {
+        iDialog->ProcessFinishedL();
+        }
+    else
+        {
+        CEikProgressInfo* progressInfo = iDialog->GetProgressInfoL();
+        iCurrentItem++;
+        progressInfo->SetAndDraw(iCurrentItem);
+        CompleteRequest();
+        }
+    }
+
+// ---------------------------------------------------------
+// CWPCxDeleter::RunError
+// ---------------------------------------------------------
+//
+TInt CWPCxDeleter::RunError( TInt aError )
+    {
+    // There was a leave in RunL(). Store the error and
+    // stop the dialog.
+    iResult = aError;
+    iWait.AsyncStop();
+    delete iDialog;
+    iDialog = NULL;
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CWPCxDeleter::DialogDismissedL
+// ---------------------------------------------------------
+//
+void CWPCxDeleter::DialogDismissedL( TInt aButtonId )
+    {
+    if( aButtonId < 0 )
+        {
+        iResult = KErrCancel;
+        }
+
+    iWait.AsyncStop();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::CompleteRequest
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::CompleteRequest()
+    {
+    // Schedule an immediate complete. Make sure that there
+    // is no timer alive first
+    Cancel();
+    iRetryTimer->Cancel();
+
+    SetActive();
+    TRequestStatus* sp = &iStatus;
+    User::RequestComplete( sp, KErrNone );
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::DelayedCompleteRequestL
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::DelayedCompleteRequestL()
+    {
+    if( iRetryCount < KRetryCount )
+        {
+        // Schedule a delayed complete.
+        iRetryTimer->Cancel();
+        iRetryTimer->Start( KMaxWaitTime, KMaxTInt32, TCallBack( Timeout, this ) );
+        iRetryCount++;
+        }
+    else
+        {
+        User::Leave( KErrTimedOut );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::Retry
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::Retry()
+    {
+    // Immediate retry. Mark that we're not waiting
+    // for an event and complete request.
+
+    iWaitCommsDb = EFalse;
+    iWaitFavourites = EFalse;
+    CompleteRequest();
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::Timeout
+// ----------------------------------------------------------------------------
+//
+TInt CWPCxDeleter::Timeout(TAny* aSelf)
+    {
+    // There was a time-out. Retry saving even though we
+    // didn't get a notify from database.
+    CWPCxDeleter* self = STATIC_CAST(CWPCxDeleter*, aSelf);
+    self->Retry();
+
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::HandleApDbEventL
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::HandleApDbEventL( TEvent aEvent )
+    {
+    // We received an event from CommsDB. Retry if we're
+    // waiting for it.
+    if( iWaitCommsDb && aEvent == EDbAvailable )
+        {
+        Retry();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CWPCxDeleter::HandleFavouritesDbEventL
+// ----------------------------------------------------------------------------
+//
+void CWPCxDeleter::HandleFavouritesDbEventL( RDbNotifier::TEvent /*aEvent*/ )
+    {
+    // We received an event from BookmarkDB. Retry if we're
+    // waiting for it.
+    if( iWaitFavourites )
+        {
+        Retry();
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxDocument.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 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:  Dumper application
+*
+*/
+
+
+//  INCLUDE FILES
+#include "CWPCxDocument.h"
+#include "CWPCxAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ constructor
+CWPCxDocument::CWPCxDocument( CEikApplication& aApp )
+: CAknDocument(aApp)
+    {
+    }
+
+// destructor
+CWPCxDocument::~CWPCxDocument()
+    {
+    }
+
+// EPOC default constructor can leave.
+void CWPCxDocument::ConstructL()
+    {
+    }
+
+// Two-phased constructor.
+CWPCxDocument* CWPCxDocument::NewL( CEikApplication& aApp )
+    {
+    CWPCxDocument* self = new (ELeave) CWPCxDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// ----------------------------------------------------
+// CWPCxDocument::CreateAppUiL
+// ----------------------------------------------------
+//
+CEikAppUi* CWPCxDocument::CreateAppUiL()
+    {
+    return new (ELeave) CWPCxAppUi;
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxView.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,291 @@
+/*
+* Copyright (c) 2002 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:  Dumper application
+*
+*/
+
+
+//  INCLUDE FILES
+#include "CWPCxView.h"
+#include <aknviewappui.h>
+#include <aknnotewrappers.h>
+#include <aknquerydialog.h>
+#include <StringLoader.h>
+#include <ProvisioningCx.rsg>
+#include <featmgr.h>
+#include <bldvariant.hrh>
+#include <eikmenup.h>
+#include <eikmenub.h>
+#include "CWPEngine.h"
+#include "CWPCxContainer.h"
+#include "CWPCxDeleter.h"
+#include "ProvisioningCx.hrh"
+#include <csxhelp/prov.hlp.hrh>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CWPCxView::ConstructL
+// Symbian second phase constructor
+// ---------------------------------------------------------
+//
+void CWPCxView::ConstructL()
+    {
+    BaseConstructL( R_PROVISIONINGCX_VIEW1 );
+    FeatureManager::InitializeLibL();
+    iEngine = CWPEngine::NewL();
+    iEngine->RegisterContextObserverL( this );
+    }
+
+// ---------------------------------------------------------
+// CWPCxView::~CWPCxView
+// ---------------------------------------------------------
+//
+CWPCxView::~CWPCxView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        }
+
+    delete iContainer;
+    delete iEngine;
+    FeatureManager::UnInitializeLib();
+    }
+
+// ---------------------------------------------------------
+// TUid CWPCxView::Id
+// ---------------------------------------------------------
+//
+TUid CWPCxView::Id() const
+    {
+    return KProvisioningCxViewId;
+    }
+
+// ---------------------------------------------------------
+// CWPCxView::HandleCommandL
+// ---------------------------------------------------------
+//
+void CWPCxView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EProvisioningCxCmdDeleteContext:
+            {
+            DeleteContextL();
+            break;
+            }
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EEikCmdExit);
+            break;
+            }
+        case EProvisioningCxCmdSelect:
+            {
+            LaunchPopupL();
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL(aCommand);
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CWPCxView::HandleClientRectChange
+// ---------------------------------------------------------
+//
+void CWPCxView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CWPCxView::DoActivateL
+// ---------------------------------------------------------
+//
+void CWPCxView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                            TUid /*aCustomMessageId*/,
+                            const TDesC8& /*aCustomMessage*/)
+    {
+    iContainer = new (ELeave) CWPCxContainer( *iEngine, *this );
+    iContainer->ConstructL( ClientRect() );
+    iContainer->SetMopParent( this );
+    AppUi()->AddToStackL( *this, iContainer );
+    #ifdef __SERIES60_32__
+ 		MenuBar()->SetContextMenuTitleResourceId( R_PROVISIONINGCX_CONTEXT_MENUBAR );
+		
+		CEikButtonGroupContainer*	bgc(NULL);
+		CCoeControl* 				MSK(NULL);
+		CEikCba* 					cba(NULL);
+		MopGetObject				(bgc);
+		TInt 						count(iContainer->ContextCount());
+		
+		
+		if (bgc)
+			{
+			cba = ( static_cast<CEikCba*>( bgc->ButtonGroup() ) ); // downcast from MEikButtonGroup
+			if (cba)
+			   {
+			   MSK = cba->Control(3); // MSK's position is 3
+			   }
+
+			MSK->MakeVisible((count > 0));
+	   		}
+
+ 	#endif
+    }
+
+// ---------------------------------------------------------
+// CWPCxView::DoDeactivate
+// ---------------------------------------------------------
+//
+void CWPCxView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        }
+    
+    delete iContainer;
+    iContainer = NULL;
+    }
+
+// ---------------------------------------------------------
+// CWPCxView::ContextChangeL
+// ---------------------------------------------------------
+//
+void CWPCxView::ContextChangeL( RDbNotifier::TEvent /*aEvent*/ )
+    {
+    iContainer->UpdateContextsL();
+    
+    #ifdef __SERIES60_32__
+		CEikButtonGroupContainer*	bgc(NULL);
+		CCoeControl* 				MSK(NULL);
+		CEikCba* 					cba(NULL);
+		MopGetObject				(bgc);
+		TInt 						count(iContainer->ContextCount());
+		
+		
+		if (bgc)
+		   {
+           cba = ( static_cast<CEikCba*>( bgc->ButtonGroup() ) ); // downcast from MEikButtonGroup
+           if (cba)
+               {
+               MSK = cba->Control(3); // MSK's position is 3
+               }
+           
+           MSK->MakeVisible((count > 0));
+		   }
+
+ 	#endif
+    }
+
+// ------------------------------------------------------------------------------
+// CWPCxView::::DynInitMenuPaneL
+// ------------------------------------------------------------------------------
+//
+void CWPCxView::DynInitMenuPaneL(
+    TInt aResourceId,CEikMenuPane* aMenuPane)
+    {
+    switch( aResourceId )
+        {
+        case R_PROVISIONINGCX_APP_MENU:
+            {
+            if( !FeatureManager::FeatureSupported(KFeatureIdHelp) )
+                {
+                aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+                }
+            
+            if( iContainer->ContextCount() == 0 )
+                {
+                aMenuPane->SetItemDimmed( EProvisioningCxCmdDeleteContext, ETrue );
+                }
+            
+            break;
+            }
+            
+        case R_PROVISIONINGCX_CONTEXT_MENU:
+            {
+            if( iContainer->ContextCount() == 0 )
+                {
+                aMenuPane->SetItemDimmed( EProvisioningCxCmdDeleteContext, ETrue );
+                }
+            break;
+            }
+        }
+    }
+
+
+// ------------------------------------------------------------------------------
+// CWPCxView::::DeleteContextL
+// ------------------------------------------------------------------------------
+//
+void CWPCxView::DeleteContextL()
+    {
+	if(iContainer->ContextCount() == 0 )
+		{
+		return;
+		}
+    TPtrC name( iContainer->CurrentContextName() );
+    HBufC* query = StringLoader::LoadLC( R_QTN_OP_DELETE_CONTEXT, name );
+
+    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+    if ( dlg->ExecuteLD( R_PROVISIONCX_QUERY_DELETE, *query ) )
+        {                
+        TUint32 cx( iContainer->CurrentContext() );
+        CWPCxDeleter* deleter = new(ELeave) CWPCxDeleter( *iEngine, cx );
+        TInt numDeleted( 0 );
+        TInt err( deleter->ExecuteLD( numDeleted ) );
+        if( err == KErrNone )
+            {
+            iEngine->DeleteContextL( cx );
+            } 
+        else if( err != KErrCancel )
+            {
+            // Some problem in saving or user cancelled.
+            HBufC* text = StringLoader::LoadLC( R_TEXT_QTN_OP_DEL_CONT_NO );
+            CAknErrorNote* note = new(ELeave)CAknErrorNote( ETrue );
+            note->ExecuteLD(*text);
+            CleanupStack::PopAndDestroy(); // text
+            }
+        }
+    CleanupStack::PopAndDestroy(); // query
+    }
+
+
+// ----------------------------------------------------
+// CWPCxView::LaunchPopupL
+// ----------------------------------------------------
+//
+void CWPCxView::LaunchPopupL()
+    {
+    CEikMenuBar* menu = MenuBar();
+
+    menu->SetMenuTitleResourceId( R_PROVISIONINGCX_CONTEXT_MENUBAR );
+    TRAPD( err, menu->TryDisplayMenuBarL() );
+    menu->SetMenuTitleResourceId( R_PROVISIONINGCX_MENUBAR_VIEW1 );
+
+    User::LeaveIfError( err );
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/aif/ProvisioningCxaif.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     RSS for creating the aif file for ProvisioningDump.
+*     Initial content was generated by Calypso Wizard.
+*     ?description_line
+*
+*/
+/*
+* ============================================================================
+*  Name     : ProvisioningCxaif.rss
+*  Part of  : ?module_name (e.g. Continuus subproject name)
+*  Origin   : ?project,?company
+*  Created  : Tue Oct 09 19:04:31 2007 by mohanraj
+*  Description:
+*     RSS for creating the aif file for ProvisioningDump.
+*     Initial content was generated by Calypso Wizard.
+*     ?description_line
+*  Version  :
+*   %version: bh1s60#5 %, %date_modified: Wed Nov 11 14:02:02 2009 % by %derived_by: jobljose % 
+*  ---------------------------------------------------------------------------
+*  Version history:
+*  Template version: 1.0, 28.2.2000 by maparnan
+*  <ccm_history>
+*
+*  Version: bh1s60#2, Tue Oct 09 19:04:32 2007 by mohanraj
+*  Ref: ?reference_to_reason_doc_if_any (e.g. ActionDb ID)
+*  ?change_reason_comment
+*
+*  </ccm_history>
+* ============================================================================
+*/
+
+#include <aiftool.rh>
+#include <ProvisioningCx.loc>
+#include "ProvisioningUids.h"
+
+RESOURCE AIF_DATA
+{
+    app_uid=KProvisioningCxUID3;
+    caption_list=
+    { 		
+        CAPTION { code=ELangEnglish; caption=qtn_op_conf_cont_title; }
+    };
+    num_icons=1;
+    embeddability=KAppEmbeddable;
+    newfile=KAppDoesNotSupportNewFile;
+	hidden = KAppIsHidden;
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_bitmaps.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\system\apps\provisioningcx
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set_lst.bmp \
+		/c8,8 qgn_menu_set_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_scalable.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\system\apps\provisioningcx
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_scalable_dc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifbitmaps.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\system\apps\provisioningcx
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set_lst.bmp \
+		/c8,8 qgn_menu_set_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifbitmapsdc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set_lst.bmp \
+		/c8,8 qgn_menu_set_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifscalable.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\system\apps\provisioningcx
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifscalabledc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_set.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/ProvisioningCx.lnt	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,8 @@
+-w2
+
+-i..\Inc
+-d_UNICODE
+
+APP_LAYER_SYSTEMINCLUDE
+
+..\Src\*.cpp 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/ProvisioningCx.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002 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 project specification file for the ProvisioningCx.
+*
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+#include "../../Group/ProvisioningUIDs.h"
+
+TARGET	ProvisioningCx.exe
+TARGETTYPE exe
+
+UID  KProvisioningCxUID2 KProvisioningCxUID3
+
+CAPABILITY	CAP_APPLICATION 
+VENDORID	VID_DEFAULT
+
+SOURCEPATH ../src
+SOURCE  CWPCxApp.cpp 
+SOURCE  CWPCxAppUi.cpp
+SOURCE  CWPCxDocument.cpp
+SOURCE  CWPCxContainer.cpp
+SOURCE  CWPCxView.cpp
+SOURCE  CWPCxDeleter.cpp
+
+START RESOURCE ../rss/ProvisioningCx.rss
+HEADER
+TARGETPATH APP_RESOURCE_DIR
+LANGUAGE_IDS
+END	// RESOURCE
+
+START RESOURCE ../rss/ProvisioningCx_reg.rss
+DEPENDS provisioningcx.rsg
+TARGETPATH /private/10003a3f/apps
+END	// RESOURCE
+
+
+USERINCLUDE . ../Inc ../rss ../../Group ../../ProvisioningEngine/Inc
+MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+//SYSTEMINCLUDE /epoc32/include/cshelp
+
+LIBRARY euser.lib 
+LIBRARY apparc.lib 
+LIBRARY cone.lib 
+LIBRARY eikcore.lib 
+LIBRARY eikctl.lib
+LIBRARY eikcoctl.lib 
+LIBRARY avkon.lib
+LIBRARY provisioningengine.lib
+LIBRARY bafl.lib
+LIBRARY commonengine.lib
+LIBRARY featmgr.lib
+LIBRARY hlplch.lib
+LIBRARY apengine.lib
+LIBRARY favouritesengine.lib
+DEBUGLIBRARY flogger.lib
+
+SMPSAFE
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/icons.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\system\apps\provisioningcx
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx.mif
+HEADERFILENAME=$(HEADERDIR)\provisioningcx.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 qgn_menu_set_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/group/iconscxdc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2004 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: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\provisioningcx.mif
+
+HEADERDIR=\epoc32\include
+HEADERFILENAME=$(HEADERDIR)\provisioningcx.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 qgn_menu_set_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/ProvisioningCx/loc/ProvisioningCx.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 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 a localisation file for ProvisioningCx
+*
+*  -------------------------------------------------------------------
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//****************************************************************************
+
+//d:Command in options menu.
+//d:Deletes a configuration context
+//l:list_single_pane_t1_cp2
+#define qtn_op_opt_delete "Delete"
+
+//d: Application caption
+//l: title_pane_t2/opt9
+#define qtn_op_conf_cont_title "Configuration contexts"
+
+//d:Text displayed when no configuration contexts exist
+//l:main_list_empty_pane
+//
+#define qtn_op_conf_cont_empty "(no configuration contexts)"
+
+//d:Query presented when deleting a context
+//l:popup_note_window
+//
+#define qtn_op_delete_context "Delete %U?"
+
+//d:Default context name
+//l:list_single_pane_t1_cp2
+//
+#define qtn_op_context_name "Configuration Context"
+
+//d:Default context name in case of name conflict
+//l:list_single_pane_t1_cp2
+//
+#define qtn_op_context_name2 "Configuration context %N"
+
+//d:Heading text for wait note in delete context operation
+//l:popup_note_wait_window
+//
+#define qtn_op_deleting_contex "Deleting %U"
+
+//d:Error note when the context cannot be deleted
+//l:popup_note_window
+//
+#define qtn_op_del_cont_no "Some settings are currently active. Context cannot be deleted"
+
+// End of File
--- a/omaprovisioning/provisioning/ProvisioningEngine/Group/ProvisioningEngine.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningEngine/Group/ProvisioningEngine.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -70,11 +70,12 @@
 LIBRARY         etelmm.lib
 LIBRARY         inetprotutil.lib
 LIBRARY         sysutil.lib
-LIBRARY         CommonEngine.lib
+LIBRARY         commonengine.lib
 LIBRARY         edbms.lib
 LIBRARY         centralrepository.lib
 LIBRARY         cmmanager.lib 
-LIBRARY         commdb.lib          
+LIBRARY         commdb.lib    
+LIBRARY	        apengine.lib         
 
 DEBUGLIBRARY    flogger.lib
 
--- a/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPAdapterManager.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPAdapterManager.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -25,7 +25,7 @@
 #include "MWPContextManager.h"
 #include "MWPContextExtension.h"
 #include "ProvisioningDebug.h"
-
+#include <mmf/common/mmfcontrollerpluginresolver.h>
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -239,6 +239,7 @@
     // Place [0] is reserved for APPID parameter, [1] for APPREF parameter 
     // and [2] for storage id i.e. id that identifies the saved settings in its storage.
     RPointerArray< HBufC8 > savingInfo;
+    CleanupResetAndDestroy<RPointerArray<HBufC8> > :: PushL(savingInfo);
     a->GetSavingInfoL( index, savingInfo );
 
     // If the adapter had something to tell to the other adapters...
@@ -278,8 +279,8 @@
 
             }// if
 	    }// if
-	savingInfo.ResetAndDestroy();
-    savingInfo.Close();
+		
+	CleanupStack :: PopAndDestroy(1); //savingInfo
     
     // Tell the adapters that all the settings have been now saved.
     TInt quantityOfAdapter( iAdapters->Count() );
--- a/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPInternetAPDB.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPInternetAPDB.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -241,9 +241,9 @@
     Myview.Prepare(iItemsDatabase, TDbQuery(QueryBuffer));
     CleanupClosePushL(Myview);
     Myview.EvaluateAll();
-    if ( Myview.FirstL())
-    {
-    	while (Myview.AtRow())
+    Myview.FirstL();
+
+    while (Myview.AtRow())
         {
         Myview.GetL();
 
@@ -256,7 +256,6 @@
         aItemArray.Append(AccessPointItem);
         Myview.NextL();
         }
-    }
 
     CleanupStack::PopAndDestroy(); // Myview
     FLOG( _L( "[Provisioning] CWPInternetAPDB::ReadItemsL: done" ) );
@@ -324,9 +323,9 @@
     CleanupClosePushL(Myview);
 
     Myview.EvaluateAll();
-    if( Myview.FirstL())
-    {
-    	if (!Myview.IsEmptyL())
+    Myview.FirstL();
+
+    if (!Myview.IsEmptyL())
         {
         // we have autoincrement in index so it should be unique
         // but just to make sure, we use 'while', instead of 'if'
@@ -342,7 +341,6 @@
         iItemsDatabase.Compact();
         rowsdeleted = ETrue;
         }
-    }
     CleanupStack::PopAndDestroy(1); // Myview
 
     FLOG( _L( "[Provisioning] CWPInternetAPDB::DeleteFromDatabaseL: done" ) );
--- a/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPMultiContextManager.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPMultiContextManager.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -405,9 +405,8 @@
         new(ELeave) CArrayFixFlat<TUint32>( Max( 1, contexts.CountL() ) );
     CleanupStack::PushL( array );
     FTRACE(RDebug::Print(_L("[Provisioning] CWPMultiContextManager::ContextUidsL: count (%d)"), contexts.CountL()));
-    if ( contexts.FirstL())
-    {    	
-    	while( contexts.AtRow() )
+    contexts.FirstL();
+    while( contexts.AtRow() )
         {
         FLOG( _L( "[Provisioning] CWPMultiContextManager::ContextUidsL contexts.GetL()" ) );
         contexts.GetL();
@@ -416,7 +415,6 @@
         array->AppendL( uid );
         contexts.NextL();
         }
-     }
 
     CleanupStack::Pop(); // array
     CleanupStack::PopAndDestroy(); // contexts
@@ -790,10 +788,15 @@
     IssueRequest();
     }
 
+// ----------------------------------------------------------------------------
+// CWPMultiContextManager::RunError
+// ----------------------------------------------------------------------------
 TInt CWPMultiContextManager::RunError ( TInt /*aError*/ )
     {
         return KErrNone;
     }	
+    
+    
 // -----------------------------------------------------------------------------
 // CWPMultiContextManager::DoCancel
 // -----------------------------------------------------------------------------
--- a/omaprovisioning/provisioning/ProvisioningEngine/Src/WPAdapterUtil.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningEngine/Src/WPAdapterUtil.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -29,6 +29,7 @@
 #include <data_caging_path_literals.hrh>
 #include "CWPInternetAPDB.h"
 
+#include <ApUtils.h>
 #include "ProvisioningDebug.h"
 #include <cmmanager.h>
 #include <cmmanagerext.h>
@@ -388,21 +389,20 @@
     TBuf<KOriginatorMaxLength> Orig1;
     Orig1.Copy(Orig);
 
-    RCmManagerExt cmmanagerExt;
-    cmmanagerExt.OpenL();
-    CleanupClosePushL(cmmanagerExt);
-    RCmConnectionMethodExt cm;
-    cm = cmmanagerExt.ConnectionMethodL( aAPId );
-    CleanupClosePushL( cm );
-    TUint apId = 0;
-    TRAPD( ERROR, apId = cm.GetIntAttributeL(CMManager::ECmIapId) );
+    CCommsDatabase* commDb = CCommsDatabase::NewL();
+    CleanupStack::PushL( commDb );
+    CApUtils* aputils = CApUtils::NewLC( *commDb );
+
+    TUint32 apid = 0;
+    //Get IAP ID from WAPID
+    TRAPD( ERROR, apid = aputils->IapIdFromWapIdL( aAPId ) );
     User::LeaveIfError(ERROR);
 
     //Set AP to SNAP and DB
-    TRAPD(err,SetAPtoDBandSNAPL(apId, Orig1));
+    TRAPD(err,SetAPtoDBandSNAPL(apid, Orig1));
     User::LeaveIfError(err);
 
-    CleanupStack::PopAndDestroy(2); //cm, cmmanagerExt 
+    CleanupStack::PopAndDestroy(2); //aputils, commDb 
 
     FLOG( _L( "[Provisioning] WPAdapterUtil::SetAPDetailsL: done" ) );
 
--- a/omaprovisioning/provisioning/ProvisioningHandler/Group/ProvisioningHandler.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningHandler/Group/ProvisioningHandler.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -53,6 +53,7 @@
 
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/push
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE 	/epoc32/include/platform/mw/push
 #endif
--- a/omaprovisioning/provisioning/ProvisioningHandler/Src/CWPMessage.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningHandler/Src/CWPMessage.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -225,16 +225,16 @@
             	rep->Get( KOMAProvAuthFailMsgHandling, auth_value );
             	delete rep;
             	
-            	/*if(auth_value == 1)
+            	if(auth_value == 1)
             	StoreMsgclass0L(R_TEXT_AUTHENTICATION_FAILED);
             	else
-            	StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);*/
+            	StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
             	
             	User::Leave( KErrAccessDenied ); 
             }
             else
             {
-            //StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
+            StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
             User::Leave( KErrAccessDenied );                         
             }
                 }
@@ -271,17 +271,17 @@
             	rep->Get( KOMAProvAuthFailMsgHandling, auth_value );
             	delete rep;
             	
-            	/*if(auth_value == 1)
+            	if(auth_value == 1)
             	StoreMsgclass0L(R_TEXT_AUTHENTICATION_FAILED);
             	else
-            	StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);*/
+            	StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
             	
             	User::Leave( KErrAccessDenied );
             	
             }
             else
             {
-            //StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
+            StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
             User::Leave( KErrAccessDenied );
             }
             break;
--- a/omaprovisioning/provisioning/ProvisioningParser/Src/CWPWbxmlParser.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningParser/Src/CWPWbxmlParser.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -22,7 +22,7 @@
 #include "CWPWbxmlParser.h"
 #include "OMAProvisioningDictionary.h"
 #include "ProvisioningDebug.h"
-#include <xml/cxml/nw_cXML_Parser.h>
+#include <nw_cxml_parser.h>
 
 // EXTERNAL DATA STRUCTURES
 extern "C" NW_WBXML_Dictionary_t NW_omawapprovisioning_WBXMLDictionary;
--- a/omaprovisioning/provisioning/ProvisioningParser/Src/OMAProvisioningDictionary.c	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningParser/Src/OMAProvisioningDictionary.c	Wed Sep 01 12:27:42 2010 +0100
@@ -35,7 +35,7 @@
  */
 
 #include "OMAProvisioningDictionary.h"
-#include <xml/cxml/nw_wbxml_dictionary.h>
+#include "nw_wbxml_dictionary.h"
 
 
 static const NW_Ucs2 NW_omawapprovisioning_ElementTag_wap_provisioningdoc[] = {'w','a','p','-','p','r','o','v','i','s','i','o','n','i','n','g','d','o','c','\0'};
--- a/omaprovisioning/provisioning/ProvisioningSC/Src/CWPSimHandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningSC/Src/CWPSimHandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -173,10 +173,15 @@
 		}
     }
 
+// ----------------------------------------------------------------------------
+// CWPWimHandler::RunError
+// ----------------------------------------------------------------------------
 TInt CWPWimHandler::RunError ( TInt /*aError*/ )
     {
         return KErrNone;
     }	
+    
+    
 // -----------------------------------------------------------------------------
 // CWPWimHandler::DoCancel
 // Cancel active request
--- a/omaprovisioning/provisioning/ProvisioningSC/Src/CWPWimHandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningSC/Src/CWPWimHandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -230,10 +230,14 @@
 		}
     }
 
+// ----------------------------------------------------------------------------
+// CWPWimHandler::RunError
+// ----------------------------------------------------------------------------
 TInt CWPWimHandler::RunError ( TInt /*aError*/ )
     {
         return KErrNone;
     }	
+    
 // -----------------------------------------------------------------------------
 // CWPWimHandler::DoCancel
 // Cancel active request
--- a/omaprovisioning/provisioning/Rom/Provisioning.iby	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/Rom/Provisioning.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -24,8 +24,57 @@
 file=ABI_DIR\BUILD_DIR\ProvisioningEngine.dll   SHARED_LIB_DIR\ProvisioningEngine.dll
 // Parser
 file=ABI_DIR\BUILD_DIR\ProvisioningParser.dll   SHARED_LIB_DIR\ProvisioningParser.dll
+// BIO control
+file=ABI_DIR\BUILD_DIR\ProvisioningBC.dll       SHARED_LIB_DIR\ProvisioningBC.dll
 // Handler
 ECOM_PLUGIN(ProvisioningHandler.dll,101F84D2.rsc)
+// Access point adapter
+//ECOM_PLUGIN(WPAPAdapter.dll,101F84D8.rsc)
+#ifdef __MMS
+// WAP adapter
+ECOM_PLUGIN(WPWAPAdapter.dll,101F84DC.rsc)
+#endif
+// Streaming Adapter
+ECOM_PLUGIN(WPStreamingAdapter.dll,101F85CB.rsc)
+
+//Accesspoint adapter
+ECOM_PLUGIN(WPAPAdapter.dll, WPAPAdapter.rsc)
+
+//Destination Adapter
+
+ECOM_PLUGIN( wpdestinationnwadapter.dll, 2000b4af.rsc )
+
+// Mailbox Number adapter
+ECOM_PLUGIN(WPMbxNbrAdapter.dll,10207281.rsc)	// this publishes the DLL and the
+													  						// resource file to the correct location
+
+
+#if ( defined (__ALWAYS_ONLINE_PDPCONTEXT) || defined (__ALWAYS_ONLINE_PDPCONTEXT2) )
+// ALWAYS ONLINE adapter
+ECOM_PLUGIN(WPAlwaysOnAdapter.dll,200159E4.rsc)
+#endif
+
+
+// SIP adapter
+//ECOM_PLUGIN(WPSIPAdapter.dll,101FB37E.rsc)
+
+
+#ifdef __IM
+// WV adapter
+ECOM_PLUGIN(WPWVAdapter.dll,101F84E2.rsc)
+#endif
+
+/*#ifdef __MULTIPLE_PROV_CTX
+// Context list
+file=ABI_DIR\BUILD_DIR\ProvisioningCx.exe       PROGRAMS_DIR\ProvisioningCx.exe
+//normal icons
+//probably not needed, as no UI bitmaps used...
+data=DATAZ_\APP_BITMAP_DIR\ProvisioningCx.MIF	APP_BITMAP_DIR\ProvisioningCx.mif
+#endif //__MULTIPLE_PROV_CTX*/
+
+#ifdef __SMART_CARD_PROV
+    file=ABI_DIR\BUILD_DIR\ProvisioningSC.exe       PROGRAMS_DIR\ProvisioningSC.exe
+#endif
 
 #ifdef SYMBIAN_SECURE_DBMS
     data=ZPRIVATE\100012a5\policy\101F84D6.spd      PRIVATE\100012a5\policy\101F84D6.spd
--- a/omaprovisioning/provisioning/Rom/ProvisioningResources.iby	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/Rom/ProvisioningResources.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -21,9 +21,29 @@
 
 
 data=DATAZ_\RESOURCE_FILES_DIR\ProvisioningHandlerResource.rsc                  RESOURCE_FILES_DIR\ProvisioningHandler.rsc
+//data=DATAZ_\RESOURCE_FILES_DIR\WPAPAdapterResource.rsc                          RESOURCE_FILES_DIR\WPAPAdapter.rsc
+#ifdef __MMS
+ data=DATAZ_\RESOURCE_FILES_DIR\WPWAPAdapterResource.rsc                        RESOURCE_FILES_DIR\WPWAPAdapter.rsc
+#endif
+#ifdef __IM
+ data=DATAZ_\RESOURCE_FILES_DIR\WPWVAdapterResource.rsc                         RESOURCE_FILES_DIR\WPWVAdapter.rsc
+#endif
+data=DATAZ_\RESOURCE_FILES_DIR\WpstreamingadapterResource.rsc                   RESOURCE_FILES_DIR\Wpstreamingadapter.rsc
+
+data=DATAZ_\RESOURCE_FILES_DIR\WPMbxNbrAdapterResource.rsc                      RESOURCE_FILES_DIR\WPMbxNbrAdapter.rsc
+
+//data=DATAZ_\RESOURCE_FILES_DIR\WPSIPAdapterResource.rsc                         RESOURCE_FILES_DIR\WPSIPAdapter.rsc
+
+
+
+// Resource files for OMA Provisioning
+
 data=DATAZ_\RESOURCE_FILES_DIR\ProvisioningBC.rsc                       RESOURCE_FILES_DIR\ProvisioningBC.rsc
+
 data=DATAZ_\RESOURCE_FILES_DIR\messaging\bif\prov.rsc                   resource\messaging\bif\prov.rsc
 
+//data=DATAZ_\APP_RESOURCE_DIR\ProvisioningCx.rsc                         APP_RESOURCE_DIR\ProvisioningCx.rsc
+
 #ifdef __SMART_CARD_PROV
    data=DATAZ_\RESOURCE_FILES_DIR\ProvisioningSC.rsc                    RESOURCE_FILES_DIR\ProvisioningSC.rsc
 #endif
@@ -32,4 +52,7 @@
   data=DATAZ_\RESOURCE_FILES_DIR\AuthtypepluginRsc.rsc            RESOURCE_FILES_DIR\AuthtypepluginRsc.rsc
 #endif
 
+data=DATAZ_\RESOURCE_FILES_DIR\WPAPAdapterResource.rsc      RESOURCE_FILES_DIR\WPAPAdapterResource.rsc
+data=DATAZ_\RESOURCE_FILES_DIR\wpdestinationnwadapter.rsc   RESOURCE_FILES_DIR\wpdestinationnwadapter.rsc
+
 #endif // __PROVISIONINGRESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/Data/101F85CB.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002 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:  ECOM DLL interface & implementation description resource for
+*                this DLL.
+*
+*/
+
+
+//  INCLUDES
+#include <registryinfo.rh>
+
+#include "ProvisioningUIDs.h"
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// ECOM DLL interface & implementation description resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x101F85CB;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KProvisioningAdapterInterface;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F85CC;
+                    version_no = 1;
+                    display_name = "WP STREAMING PA";// Use short name to save RAM and ROM space
+                    default_data = "";
+                    opaque_data = "10"; // Adapter priority
+                    }
+                };
+            }
+        };
+    }
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/Data/WPStreamingAdapterResource.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file.
+*
+*/
+
+
+//  INCLUDES
+#include    <badef.rh>
+#include    <streamingadapter.loc>
+
+
+RESOURCE LBUF r_streaming_adapter_title
+	{
+	txt = qtn_op_head_streaming;
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/Group/StreamingAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for streaming app settings adapter.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+#include <data_caging_paths.hrh>
+
+TARGET          wpstreamingadapter.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x101F85CB
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_ECOM_PLUGIN
+
+SOURCEPATH      ../Src
+SOURCE          Streamingadapter.cpp
+SOURCE          StreamingadapterGroupProxy.cpp
+
+SOURCEPATH      ../Data
+
+START RESOURCE 101F85CB.rss
+TARGET wpstreamingadapter.rsc
+END
+
+START RESOURCE WPStreamingAdapterResource.rss
+HEADER
+TARGET wpstreamingadapterresource.rsc
+TARGETPATH RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+USERINCLUDE     .
+USERINCLUDE     ../Inc
+USERINCLUDE     ../../Group
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+
+LIBRARY         euser.lib
+LIBRARY         provisioningengine.lib
+LIBRARY         mpsettengine.lib
+LIBRARY         apengine.lib
+LIBRARY         commdb.lib
+DEBUGLIBRARY    flogger.lib
+
+
+SMPSAFE
+//end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/Inc/StreamingAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2002 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:  Handles streaming app settings in OMA provisioning.
+*
+*/
+
+
+#ifndef STREAMINGADAPTER_H
+#define STREAMINGADAPTER_H
+
+// INCLUDES
+
+#include    <CWPAdapter.h>
+#include    <MWPContextExtension.h>
+
+// FORWARD DECLARATIONS
+class CMPSettingsModel;
+struct TStreamingAdapterData;
+
+// CLASS DECLARATION
+
+/**
+ * CStreamingAdapter handles accesspoint settings.
+ */ 
+class CStreamingAdapter : public CWPAdapter,
+                          public MWPContextExtension
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @return a instance of class.
+        */
+        static CStreamingAdapter* NewL();
+
+        /**
+        * Destructor
+        */
+        virtual ~CStreamingAdapter();
+
+    public: // Functions from base classes
+
+        /**
+        * From CWPAdapter
+        */
+        TInt ItemCount() const;
+
+        /**
+        * From CWPAdapter
+        */
+        const TDesC16& SummaryTitle(TInt aIndex) const;
+
+        /**
+        * From CWPAdapter
+        */
+        const TDesC16& SummaryText(TInt aIndex) const;
+
+        /**
+        * From CWPAdapter
+        */
+        TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
+
+        /**
+        * From CWPAdapter
+        */
+        void SaveL(TInt aItem);
+
+        /**
+        * From CWPAdapter
+        */
+        TBool CanSetAsDefault(TInt aItem) const;
+
+        /**
+        * From CWPAdapter
+        */
+        void SetAsDefaultL(TInt aItem);
+
+        /**
+        * From CWPAdapter
+        */
+        void VisitL(CWPCharacteristic& aElement);
+
+        /**
+        * From CWPAdapter
+        */
+        void VisitL(CWPParameter& aElement);
+
+        /**
+        * From CWPAdapter
+        */
+        void VisitLinkL(CWPCharacteristic& aCharacteristic);
+
+        /**
+        * From CWPAdapter
+        */
+        TInt ContextExtension(MWPContextExtension*& aExtension);
+
+        /**
+        * From MWPContextExtension
+        */
+		const TDesC8& SaveDataL(TInt aIndex) const;
+
+        /**
+        * From MWPContextExtension
+        */
+		void DeleteL(const TDesC8& aSaveData);
+
+        /**
+        * From MWPContextExtension
+        */
+        TUint32 Uid() const;
+
+
+    private:  // Default constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CStreamingAdapter();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // New functions
+
+        /**
+        * Validates the data in iTempData.
+        */
+        TBool IsValid();
+
+        /**
+        * Parses an integer from a descriptor.
+        * Returns error code.
+        */
+        TInt ParseIntegerL(const TDesC& aPtr, TInt& aInt);
+
+		/**
+        * ResetAndDestroy() cleanup for ecom implementation array.
+        * @param aAny the implementation array
+        */
+        static void Cleanup( TAny* aAny );
+        
+        /**
+        * Initialise CMPSettingsModel
+        * @param None
+        * @return None
+        */
+        void InitSettingsModelL();
+
+    private: // Data
+
+        HBufC* iTitle;
+        CMPSettingsModel* iModel;
+
+        TPtrC iAppId;
+        TStreamingAdapterData* iCurrentData;
+        TStreamingAdapterData* iTempData;
+
+        TPckgBuf<TUint32> iSavedID;
+
+	private:
+		friend class TM_CWPStreamingAdapterTestCase;
+	
+
+    };
+
+#endif  // STREAMINGADAPTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/Src/Streamingadapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,543 @@
+/*
+* Copyright (c) 2002 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:  Handles streaming app settings in OMA provisioning.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <f32file.h>
+#include    <CWPCharacteristic.h>
+#include    <CWPParameter.h>
+#include    <wpstreamingadapterresource.rsg>
+#include    <commdb.h>
+#include    <ApAccessPointItem.h>
+#include    <ApDataHandler.h>
+#include    <mpsettingsmodel.h>
+
+#include    "WPAdapterUtil.h"
+#include    "StreamingAdapter.h"
+#include    "ProvisioningDebug.h"
+
+// CONSTANTS
+#if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw
+    _LIT( KAdapterName, "WPStreamingAdapterResource" );
+#else
+    _LIT( KAdapterName, "WPStreamingAdapter" );
+#endif
+_LIT(KMaxBandwidthStr,"MAX-BANDWIDTH");
+_LIT(KMaxUdpPortStr,"MAX-UDP-PORT");
+_LIT(KMinUdpPortStr,"MIN-UDP-PORT");
+_LIT(KStreamingAppId, "554");
+
+const TInt KInvalidValue = -1;
+const TInt KProxyEnabled = 1;
+
+const TInt KMinUDPPort = 1024; //6970;
+const TInt KMaxUDPPort = 65535; //32000;
+const TInt KDefaultMinUDPPort = 6970;
+const TInt KDefaultMaxUDPPort = 32000;
+
+const TInt KBandwidthValue1 = 9050;
+const TInt KBandwidthValue2 = 13400;
+const TInt KBandwidthValue3 = 18100;
+const TInt KBandwidthValue4 = 26800;
+const TInt KBandwidthValue5 = 27150;
+const TInt KBandwidthValue6 = 40200;
+
+// MODULE DATA STRUCTURES
+struct TStreamingAdapterData
+    {
+    TPtrC iName;
+    TInt iMaxBw;
+    TInt iMinUdpPort;
+    TInt iMaxUdpPort;
+    CWPCharacteristic* iNapDef;
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::CStreamingAdapter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CStreamingAdapter::CStreamingAdapter()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::ConstructL()
+    {
+    FLOG( _L( "[Provisioning] CStreamingAdapter::ConstructL:" ) );
+    
+    TFileName fileName;
+    Dll::FileName( fileName );
+    iTitle = WPAdapterUtil::ReadHBufCL( fileName,
+                                        KAdapterName,
+                                        R_STREAMING_ADAPTER_TITLE );
+                                        
+    FLOG( _L( "[Provisioning] CStreamingAdapter::ConstructL: Done" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CStreamingAdapter* CStreamingAdapter::NewL()
+    {
+    CStreamingAdapter* self = new(ELeave) CStreamingAdapter; 
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::~CStreamingAdapter
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CStreamingAdapter::~CStreamingAdapter()
+    {
+    delete iTitle;
+    delete iCurrentData;
+    delete iTempData;
+	delete iModel;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::ItemCount
+// -----------------------------------------------------------------------------
+//
+TInt CStreamingAdapter::ItemCount() const
+    {
+    // If ItemCount() returns zero, the adapter is unloaded at startup. 
+	// SummaryTitle(), SummaryText(), SaveL(), SetAsDefaultL() and 
+	// CanSetAsDefault() are called ItemCount() times
+    return iCurrentData ? 1 : 0;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::SummaryTitle
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CStreamingAdapter::SummaryTitle(TInt /*aIndex*/) const
+    {
+    return *iTitle;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::SummaryText
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CStreamingAdapter::SummaryText(TInt /*aIndex*/) const
+    {
+    return iCurrentData->iName;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::DetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CStreamingAdapter::DetailsL(TInt /*aItem*/, MWPPairVisitor& /*aVisitor*/)
+    {
+    // Detail view is a feature for later release.
+    return KErrNotSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::SaveL
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::SaveL( TInt /*aItem*/ )
+    {
+    FLOG( _L( "[Provisioning] CStreamingAdapter::SaveL:" ) );
+    
+    __ASSERT_DEBUG( iCurrentData->iNapDef, User::Leave( KErrCorrupt ) );
+
+    InitSettingsModelL();
+        
+    // Load default values
+    iModel->LoadSettingsL(EConfigDefault);
+
+    // Set max bandwidth value if valid
+    if (iCurrentData->iMaxBw != KInvalidValue)
+        {
+        iModel->SetMaxBandwidth(iCurrentData->iMaxBw, EBearerGPRS);
+        }
+
+    // Set udp port range if valid
+    if (iCurrentData->iMinUdpPort != KInvalidValue && 
+        iCurrentData->iMaxUdpPort != KInvalidValue)
+        {
+        iModel->SetMinUDPPort(iCurrentData->iMinUdpPort);
+        iModel->SetMaxUDPPort(iCurrentData->iMaxUdpPort);
+        }
+
+    // Get the IAP id
+
+    CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(commDb);
+    CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb);
+    CApAccessPointItem* apItem = CApAccessPointItem::NewLC();   
+    
+    TPckgBuf<TUint32> uid;
+    TBool proxyDefined(EFalse);
+    TBool apDefined(EFalse);
+    TBool apWithoutProxyDefined(EFalse);
+
+    for (TInt i(0); iCurrentData->iNapDef->Data(i).Length() == uid.MaxLength()
+        && !(proxyDefined && apWithoutProxyDefined); i++)
+        {
+        uid.Copy(iCurrentData->iNapDef->Data(i));
+
+        apDataHandler->AccessPointDataL(uid(), *apItem);
+    
+        TBool useProxy(EFalse);
+        apItem->ReadBool(EApProxyUseProxy, useProxy);
+
+        if (!apDefined || (!useProxy && !apWithoutProxyDefined))
+            {
+            iModel->SetDefaultAp(uid());
+            apDefined = ETrue;
+
+            iSavedID.Copy(uid);
+
+            if (!useProxy)
+                {
+                apWithoutProxyDefined = ETrue;
+                }
+            }
+        
+        if (!proxyDefined && useProxy)
+            {
+           // Get proxy port
+            TUint32 proxyPort(0);
+            apItem->ReadUint(EApProxyPortNumber, proxyPort);
+
+            // Get proxy host name
+            const HBufC* proxyHost = apItem->ReadConstLongTextL(
+												EApProxyServerAddress);
+
+            if(*proxyHost != KNullDesC && proxyPort <= 65535)
+                {
+                iModel->SetProxyHostNameL(*proxyHost);
+                iModel->SetProxyPort(static_cast<TInt>(proxyPort));
+                iModel->SetProxyMode(KProxyEnabled);
+                
+                proxyDefined = ETrue;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(3); // apItem & apDataHandler & commDb
+
+    iModel->StoreSettingsL();
+    
+    FLOG( _L( "[Provisioning] CStreamingAdapter::SaveL: Done" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CStreamingAdapter::CanSetAsDefault(TInt /*aItem*/) const
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::SetAsDefault
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::SetAsDefaultL(TInt /*aItem*/)
+    {
+    // This shouldn't be called because CanSetAsDefault
+    // always returns EFalse.
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::VisitL(CWPCharacteristic& aCharacteristic)
+    {
+    switch(aCharacteristic.Type())
+        {
+        case KWPApplication:
+            // Create new iTempData
+            if (iTempData)
+                {
+                delete iTempData;
+                iTempData = NULL;
+                }
+
+            iTempData = new (ELeave) TStreamingAdapterData;
+
+            // Initialize iTempData's members
+            iTempData->iName.Set(KNullDesC);
+            iTempData->iMaxBw = KInvalidValue;
+            iTempData->iMinUdpPort = KInvalidValue;
+            iTempData->iMaxUdpPort = KInvalidValue;
+            iTempData->iNapDef = NULL;
+
+            // Accept characteristic
+            aCharacteristic.AcceptL(*this);
+
+            // Check iAppId and validate data
+            if (iAppId == KStreamingAppId && IsValid())
+                {
+                // iAppId is correct and data is valid
+                delete iCurrentData;
+                iCurrentData = iTempData;
+                iTempData = NULL;
+                }
+            else
+                {
+                // iAppId is incorrect or data is invalid
+                delete iTempData;
+                iTempData = NULL;
+                }
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::VisitL(CWPParameter& aParameter)
+    { 
+    // Check the contents of whole characteristic before overwriting iMaxBw, 
+    // iMinUdpPort and iMaxUdpPort. Might be looking at the wrong application
+	// characteristic
+    
+    __ASSERT_DEBUG(iTempData, User::Leave(KErrCorrupt));
+    
+    TInt value;
+    switch(aParameter.ID())
+        {
+        case EWPParameterAppID:
+            iAppId.Set(aParameter.Value());
+            break;
+        case EWPParameterName:
+            if (iTempData->iName == KNullDesC)
+                {
+                iTempData->iName.Set(aParameter.Value());
+                }
+            break;
+		case EWPNamedParameter:
+			{
+			if( aParameter.Name().Compare( KMaxBandwidthStr ) == 0
+				&& !ParseIntegerL( aParameter.Value(), value ) )
+				{							
+				iTempData->iMaxBw = value;
+				}
+			else if( aParameter.Name().Compare( KMaxUdpPortStr ) == 0
+				&& !ParseIntegerL( aParameter.Value(), value ) )
+				{							
+				iTempData->iMaxUdpPort = value;
+				}
+			else if( aParameter.Name().Compare( KMinUdpPortStr ) == 0
+				&& !ParseIntegerL( aParameter.Value(), value ) )
+				{							
+                iTempData->iMinUdpPort = value;
+				}
+			break;
+			}
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::VisitLinkL(CWPCharacteristic& aCharacteristic)
+    { 
+    // Here again, do not overwrite iPXLogical before you're sure
+    // you're looking at the correct APPLICATION
+
+    __ASSERT_DEBUG(iTempData, User::Leave(KErrCorrupt));
+
+    switch(aCharacteristic.Type())
+        {
+        //intentional fall-through
+        case KWPNapDef:        
+        case KWPPxLogical:    
+            iTempData->iNapDef = &aCharacteristic;          
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::ContextExtension
+// -----------------------------------------------------------------------------
+//
+TInt CStreamingAdapter::ContextExtension(MWPContextExtension*& aExtension)
+    {
+    aExtension = this;
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::SaveDataL
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CStreamingAdapter::SaveDataL(TInt /*aIndex*/) const
+    {
+    return iSavedID;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::DeleteL
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::DeleteL(const TDesC8& aSaveData)
+    {
+    TUint32 id;
+    
+    InitSettingsModelL();
+    
+    iModel->GetDefaultAp(id);
+
+    TPckgBuf<TUint32> pckg;
+    pckg.Copy(aSaveData);
+
+    if (id == pckg())
+        {
+        iModel->LoadSettingsL(EConfigDefault);
+        iModel->StoreSettingsL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::Uid
+// -----------------------------------------------------------------------------
+//
+TUint32 CStreamingAdapter::Uid() const
+    {
+    return iDtor_ID_Key.iUid;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::IsValid
+// -----------------------------------------------------------------------------
+//
+TBool CStreamingAdapter::IsValid()
+    {
+    TBool validity(EFalse);
+    
+    if (iTempData->iNapDef)
+        {
+        // Validity checks for min and max UDP port values
+        if (iTempData->iMinUdpPort < KMinUDPPort)
+            {
+            iTempData->iMinUdpPort = KDefaultMinUDPPort; 
+            }
+
+        if (iTempData->iMaxUdpPort > KMaxUDPPort)
+            {
+            iTempData->iMaxUdpPort = KDefaultMaxUDPPort; 
+            }
+
+        if (iTempData->iMinUdpPort > iTempData->iMaxUdpPort)
+            {
+            iTempData->iMinUdpPort = KInvalidValue;
+            iTempData->iMaxUdpPort = KInvalidValue;
+            }
+        
+        // Validity check for max bandwidth value
+        switch (iTempData->iMaxBw)
+            {
+            case KBandwidthValue1:
+            case KBandwidthValue2:
+            case KBandwidthValue3:
+            case KBandwidthValue4:
+            case KBandwidthValue5:
+            case KBandwidthValue6:
+                // iMaxBw is valid
+                break;
+            default:
+                // iMaxBw is invalid
+                iTempData->iMaxBw = KInvalidValue;
+                break;
+            }
+
+        validity = ETrue;
+        }
+            
+    return validity;
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::ParseIntegerL
+// -----------------------------------------------------------------------------
+//
+TInt CStreamingAdapter::ParseIntegerL(const TDesC& aPtr, TInt& aInt) 
+    {
+    TLex lex(aPtr);
+    return lex.Val(aInt);
+    }
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::Cleanup
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::Cleanup( TAny* aAny )
+	{
+	RImplInfoPtrArray* implArray = 
+		reinterpret_cast< RImplInfoPtrArray*> ( aAny );
+	implArray->ResetAndDestroy();
+	implArray->Close();
+	}
+
+// -----------------------------------------------------------------------------
+// CStreamingAdapter::InitSettingsModelL
+// -----------------------------------------------------------------------------
+//
+void CStreamingAdapter::InitSettingsModelL()
+	{
+	FLOG( _L( "[Provisioning] CStreamingAdapter::InitSettingsModelL:" ) );
+	
+    if ( !iModel )
+        {
+        RImplInfoPtrArray impl; 
+    	CleanupStack::PushL( TCleanupItem( Cleanup, &impl ) );
+    	CMPSettingsModel::ListImplementationsL( impl );
+    	if( impl.Count() > 0 )
+            {
+            FLOG( _L( "[Provisioning] CStreamingAdapter::InitSettingsModelL: Creating CMPSettingsModel" ) );
+    	    // using the first available implementation
+            iModel= CMPSettingsModel::NewL( impl[0]->ImplementationUid() );
+            FLOG( _L( "[Provisioning] CStreamingAdapter::InitSettingsModelL: Creating CMPSettingsModel Done" ) );
+        	}
+    	CleanupStack::PopAndDestroy(); // implArray
+        }
+	}
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/Src/StreamingadapterGroupProxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002-2006 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:  Table of plugins for ECom
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32std.h>
+#include    <implementationproxy.h>
+#include    "StreamingAdapter.h"
+
+
+// CONSTANTS
+const TImplementationProxy ImplementationTable[] =
+    {
+	IMPLEMENTATION_PROXY_ENTRY(0x101F85CC, CStreamingAdapter::NewL )
+//        {{0x101F85CC}, CStreamingAdapter::NewL},
+    };
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationProxy
+// ECOM implementation table entry.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+    return ImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/StreamingAdapter/loc/StreamingAdapter.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002 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 a localisation file for MediaSettings
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d: Summary text for streaming settings
+//l: popup_info_list_pane_t2/opt1
+//
+#define qtn_op_head_streaming "Streaming settings"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Data/101F84DC.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file defining the ProvisioningAdapter plugin.
+*
+*/
+
+
+
+//  INCLUDES
+#include <registryinfo.rh>
+#include "ProvisioningUIDs.h"
+
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// Resource defining the ProvisioningAdapter plugin.
+//
+// -----------------------------------------------------------------------------
+//
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KProvisioningWAPAdapterDllUid3;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KProvisioningAdapterInterface;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KProvisioningMMSAdapterUid;
+                    version_no = 1;
+                    display_name = "";
+                    default_data = "";
+                    opaque_data = "101";
+                    },
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KProvisioningBrowserAdapterUid;
+                    version_no = 1;
+                    display_name = "";
+                    default_data = "";
+                    opaque_data = "100";
+                    }
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Data/WPWAPAdapterResource.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file.
+*
+*/
+
+
+
+//  INCLUDES
+#include <badef.rh>
+#include <provisioning.loc>
+
+// Rich text labels
+
+RESOURCE LBUF r_qtn_op_head_browser
+    { 
+    txt = qtn_op_head_browser; 
+    }
+
+RESOURCE LBUF r_qtn_sm_mms_accesspoints
+    { 
+    txt = qtn_sm_mms_accesspoints; 
+    }
+
+RESOURCE LBUF r_qtn_sm_wapap_name
+    { 
+    txt = qtn_sm_wapap_name; 
+    }
+
+RESOURCE LBUF r_qtn_sm_bookmark_name
+    { 
+    txt = qtn_sm_bookmark_name; 
+    }
+
+RESOURCE LBUF r_qtn_sm_bookmarks
+    { 
+    txt = qtn_sm_bookmarks;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Group/WPWAPAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for the WPWAPAdapter.
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+#include "../../Group/ProvisioningUIDs.h"
+#include "../Inc/WPWAPDebug.h"
+
+TARGET          wpwapadapter.dll
+TARGETTYPE      PLUGIN
+UID             KProvisioningWAPAdapterDllUid2 KProvisioningWAPAdapterDllUid3
+
+
+VENDORID        VID_DEFAULT
+CAPABILITY      CAP_ECOM_PLUGIN
+
+SOURCEPATH      ../Src
+SOURCE          CWPWAPAdapterBase.cpp
+SOURCE          CWPWAPMMSAdapter.cpp 
+SOURCE          CWPWAPBrowserAdapter.cpp
+SOURCE          CWPWAPMMSItem.cpp 
+SOURCE          CWPWAPBrowserItem.cpp
+SOURCE          CWPWAPBookmarkItem.cpp
+SOURCE          CWPWAPItemBAse.cpp
+SOURCE          WPWAPUtil.cpp
+SOURCE          WPWAPItemFactory.cpp
+SOURCE          WPWAPAdapterGroupProxy.cpp
+SOURCE          WPWAPAdapterMain.cpp
+
+SOURCEPATH      ../Data
+START RESOURCE 101F84DC.rss
+TARGET wpwapadapter.rsc
+END
+
+START RESOURCE WPWAPAdapterResource.rss
+HEADER
+TARGET wpwapadapterresource.rsc
+TARGETPATH RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+USERINCLUDE     ../Inc ../Group ../../Group
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+
+LIBRARY         euser.lib 
+LIBRARY         provisioningengine.lib
+LIBRARY         msgs.lib
+LIBRARY         apengine.lib
+LIBRARY         commdb.lib
+LIBRARY         commonengine.lib
+LIBRARY         favouritesengine.lib
+LIBRARY         centralrepository.lib
+
+DEBUGLIBRARY    flogger.lib
+
+#ifdef __MESSAGING_API_V2__
+LIBRARY         mmsserversettings.lib
+#endif
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPAdapterBase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002 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: 
+*     Base for WAP adapters.
+*
+*/
+
+
+#ifndef CWPWAPADAPTERBASE_H
+#define CWPWAPADAPTERBASE_H
+
+// INCLUDES
+#include <CWPAdapter.h>
+#include <MWPContextExtension.h>
+
+// FORWARD DECLARATIONS
+class CWPCharacteristic;
+class MWPWAPItemBase;
+class CCommsDatabase;
+class CApDataHandler;
+
+// CLASS DECLARATION
+
+/**
+ * CWPWAPAdapterBase is a base for WAP adapters.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class CWPWAPAdapterBase : public CWPAdapter, private MWPContextExtension
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPAdapterBase();
+
+    public: // from CWPAdapter
+        
+        TInt ItemCount() const;     
+        const TDesC16& SummaryTitle(TInt aIndex) const;     
+        const TDesC16& SummaryText(TInt aIndex) const;      
+        void SaveL( TInt aItem );
+        TBool CanSetAsDefault( TInt aItem ) const;
+        void SetAsDefaultL( TInt aItem );
+        TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
+        void VisitL(CWPCharacteristic& aElement);
+        void VisitL(CWPParameter& aElement);
+        void VisitLinkL(CWPCharacteristic& aCharacteristic );
+        TInt ContextExtension( MWPContextExtension*& aExtension );
+
+    public: // from MWPContextExtension
+        virtual const TDesC8& SaveDataL( TInt aIndex ) const;
+        virtual void DeleteL( const TDesC8& aSaveData );
+        TUint32 Uid() const;
+
+    public: // New methods
+        /**
+        * Handles one application characteristic.
+        * @param aCharacteristic The application characteristic
+        */
+        virtual void ApplicationL( CWPCharacteristic& aCharacteristic ) = 0;
+
+    protected:  // New functions
+        /**
+        * C++ default constructor.
+        */
+        CWPWAPAdapterBase();
+
+        /**
+        * 2nd phase base constructor. Derived classes must call this.
+        */
+        void BaseConstructL();
+
+        /**
+        * Create CCommsDatabase and APEngine if NULL.
+        */
+        void CreateDbL();
+
+    protected:  // Data
+        // The application if of the current characteristic
+        TPtrC iAppID;
+
+        // The visible setting items. Owns.
+        RPointerArray<MWPWAPItemBase> iItems;
+
+        // The hidden setting items. Owns.
+        RPointerArray<MWPWAPItemBase> iHiddenItems;
+
+        // Comms database for saving. Owns.
+        CCommsDatabase* iCommsDb;
+
+        // APEngine for saving. Owns.
+        CApDataHandler* iAPHandler;
+    };
+
+#endif  // CWPWAPADAPTERBASE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBookmarkItem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002-2006 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:  One bookmark item in browser settings.
+*
+*/
+
+
+#ifndef CWPWAPBOOKMARKITEM_H
+#define CWPWAPBOOKMARKITEM_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MWPVisitor.h>
+#include <favouritesdb.h>
+#include <favouritessession.h>
+#include "CWPWAPItemBAse.h"
+
+
+// FORWARD DECLARATIONS
+class CBookmarkDb;
+
+// CLASS DECLARATION
+
+/**
+ * CWPWAPBookmarkItem handles one bookmark item in browser settings.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class CWPWAPBookmarkItem : public CBase, public MWPWAPItemBase, private MWPVisitor
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aTitle The title to be returned in Name().
+        * @param aDefaultName The default name for bookmarks.
+        * @param aCharacteristic The RESOURCE characteristic.
+        * @param aLink Link to NAPDEF
+        * @param aDb The bookmark database to use. Created if NULL.
+        * @return CWPWAPBookmarkItem instance
+        */
+        static CWPWAPBookmarkItem* NewL(  const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CWPCharacteristic*& aLink,
+            RFavouritesDb aDb );
+
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPBookmarkItem();
+
+    public:   // From MWPMMSItemBase
+
+        const TDesC& Name() const;
+        const TDesC& Title() const;
+        TBool CanSetAsDefault() const;
+        void SaveL();
+        void SetAsDefaultL();
+        TBool ValidateL();
+        void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, 
+            RPointerArray<MWPWAPItemBase>& aHiddenItems );
+        const TDesC8& SaveData() const;
+        const TDesC& Address() const;
+
+    public:  // From MWPVisitor
+
+        void VisitL(CWPCharacteristic& aCharacteristic);
+        void VisitL(CWPParameter& aParameter);
+        void VisitLinkL(CWPCharacteristic& aCharacteristic );
+
+    private:  // New functions
+        /**
+        * C++ constructor.
+        * @param aTitle The title to be returned in Name().
+        * @param aDefaultName The default name for bookmarks.
+        * @param aLink Link to access point
+        * @param aDb The bookmark database to use. Created if NULL.
+        */
+        CWPWAPBookmarkItem( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic*& aLink,
+            RFavouritesDb aDb );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aCharacteristic The RESOURCE characteristic 
+        * to scan.
+        */
+        void ConstructL( CWPCharacteristic& aCharacteristic );
+
+        /**
+        * Create the bookmarks db.
+        */
+        void CreateDbL();
+
+    private:
+        // The title for bookmark items
+        const TDesC& iTitle;
+
+        // The default name for bookmarks.
+        const TDesC& iDefaultName;
+
+        // The access point characteristic. Refs.
+        CWPCharacteristic*& iLink;
+
+        // The name of the bookmark
+        TPtrC iName;
+
+        // The URI of the bookmark
+        TPtrC iURI;
+
+        // Startpage parameter
+        TBool iHasStartPage;
+
+        RFavouritesDb       iBookmarkDb;
+        RFavouritesSession  iSession;
+
+        // Access point uid.
+        TUint32 iUID;
+
+        // UIDs of the saved items
+        TPckgBuf<TWPWAPSaveItem> iSaveItem;
+    };
+
+#endif  // CWPWAPBOOKMARKITEM_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBrowserAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2002-2006 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:  Handles browser settings in provisioning.
+*
+*/
+
+
+#ifndef CWPWAPBROWSERADAPTER_H
+#define CWPWAPBROWSERADAPTER_H
+
+// INCLUDES
+#include "CWPWAPAdapterBase.h"
+
+#include <favouritessession.h>
+#include <favouritesdb.h>
+
+
+// FORWARD DECLARATIONS
+class CWPCharacteristic;
+class CBookmarkDb;
+// CLASS DECLARATION
+
+/**
+ * CWPWAPBrowserAdapter handles browser settings.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class CWPWAPBrowserAdapter : public CWPWAPAdapterBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @return CWPWAPBrowserAdapter instance
+        */
+        static CWPWAPBrowserAdapter* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPBrowserAdapter();
+
+    public: // from CWPWAPAdapterBase
+        
+        void ApplicationL( CWPCharacteristic& aCharacteristic );
+        void DeleteL( const TDesC8& aSaveData );
+        
+    private:  // New functions
+        /**
+        * C++ default constructor.
+        */
+        CWPWAPBrowserAdapter();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Create the bookmarks db.
+        */
+        void CreateDbL();
+
+    private:    // Data
+        // Title for browser items. Owns.
+        HBufC* iTitle;
+
+        // Title for bookmarks. Owns.
+        HBufC* iBookmarkTitle;
+
+        // Default name for browser items. Owns.
+        HBufC* iDefaultName;
+
+        // Default name for bookmarks. Owns.
+        HBufC* iDefaultBookmarkName;
+
+        // ETrue if one browser application has been processed.
+        TBool iProcessed;
+        
+        // Favourites database. Owns.
+        CBookmarkDb* iBookmarkDb;        
+
+        RFavouritesSession iSession;
+        
+        RFavouritesDb iFavouritesDb;
+    };
+
+#endif  // CWPWAPBROWSERADAPTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBrowserItem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2002-2006 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:  Setting item for browser settings.
+*
+*/
+
+
+#ifndef CWPWAPBROWSERITEM_H
+#define CWPWAPBROWSERITEM_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MWPVisitor.h>
+#include <favouritesdb.h>
+#include "CWPWAPItemBAse.h"
+
+// FORWARD DECLARATIONS
+class MWPWAPItemBase;
+class CBookmarkDb;
+
+// CLASS DECLARATION
+
+/**
+ * CWPWAPBrowserItem handles one browser setting.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+
+
+class CWPWAPBrowserItem : public CWPWAPItemBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aFirst ETrue if this browser item is first
+        * @param aTitle Title for browser items
+        * @param aBookmarkTitle Title for bookmark items
+        * @param aDefaultName Default name for browser items
+        * @param aDefaultBookmarkName Default name for bookmarks.
+        * @param aCharacteristic The APPLICATION characteristic
+        * @param aCommsDb The CommsDB to use. Created if NULL.
+        * @param aAPHandler The APEngine data handler to use. Created if NULL.
+        * @param aBookmarkDb The bookmark database to use. Created if NULL.
+        * @return CWPWAPBrowserItem instance
+        */
+        static CWPWAPBrowserItem* NewL( TBool aFirst,
+            const TDesC& aTitle, 
+            const TDesC& aBookmarkTitle,
+            const TDesC& aDefaultName, 
+            const TDesC& aDefaultBookmarkName,
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler,
+            RFavouritesDb aBookmarkDb );
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPBrowserItem();
+
+    public:   // From CWPMMSItemBase
+
+        TBool CanSetAsDefault() const;
+        void SaveL();
+        void SetAsDefaultL();
+        TBool ValidateL();
+        void ResourceL( CWPCharacteristic& aResource );
+        void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, 
+            RPointerArray<MWPWAPItemBase>& aHiddenItems );
+
+    private:  // New functions
+        /**
+        * C++ default constructor.
+        * @see CWPWAPBrowserItem::NewL() for description of parameters.
+        */
+        CWPWAPBrowserItem( TBool aFirst,
+            const TDesC& aTitle, 
+            const TDesC& aBookmarkTitle,
+            const TDesC& aDefaultName, 
+            const TDesC& aDefaultBookmarkName,
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler,
+            RFavouritesDb aBookmarkDb );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:
+        // The bookmarks. Owns.
+        RPointerArray<MWPWAPItemBase> iBookmarks;
+
+        // The default name for bookmarks.
+        const TDesC& iDefaultBookmarkName;
+
+        // The title for bookmarks
+        const TDesC& iBookmarkTitle;
+        
+        RFavouritesDb iDb;
+
+        // ETrue if this browser item is first in list.
+        TBool iFirst;
+    };
+
+#endif  // CWPWAPBROWSERITEM_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPItemBAse.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2002 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: 
+*     Base class for WAP setting items.
+*
+*/
+
+
+#ifndef CWPWAPITEMBASE_H
+#define CWPWAPITEMBASE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MWPVisitor.h>
+#include "MWPWAPItemBase.h"
+
+// FORWARD DECLARATIONS
+class CCommsDatabase;
+class CApDataHandler;
+class CApAccessPointItem;
+
+// CLASS DECLARATION
+
+/**
+ * CWPWAPItemBase is a base class for browser settings.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class CWPWAPItemBase : public CBase, private MWPVisitor, public MWPWAPItemBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPItemBase();
+
+    public:  // From MWPVisitor
+
+        void VisitL(CWPCharacteristic& aCharacteristic);
+        void VisitL(CWPParameter& aParameter);
+        void VisitLinkL(CWPCharacteristic& aCharacteristic );
+
+    public:   // From MWPWAPItemBase
+
+        const TDesC& Name() const;
+        const TDesC& Title() const;
+        const TDesC& Address() const;
+        const TDesC8& SaveData() const;
+
+    protected:   // New methods
+        /**
+        * C++ default constructor.
+        * @param aTitle Title for items
+        * @param aDefaultName Default name for items
+        * @param aCharacteristic The APPLICATION characteristic
+        * @param aCommsDb The CommsDB to use. Created if NULL.
+        * @param aAPHandler The APEngine data handler to use. Created if NULL.
+        */
+        CWPWAPItemBase( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler );
+
+        /**
+        * 2nd phase base constructor. Derived classes must call this.
+        */
+        void BaseConstructL();
+
+        /**
+        * Handles one resource item.
+        * @param aResource The RESOURCE item
+        */
+        virtual void ResourceL( CWPCharacteristic& aResource ) = 0;
+
+        /**
+        * Create CCommsDatabase and APEngine if NULL.
+        */
+        void CreateDbL();
+
+        /**
+        * Writes a home page to an access point. If access point already
+        * has a home page, create a new one.
+        * @param aItem Access point to access
+        */
+        void WriteHomePageL( CApAccessPointItem& aItem );
+
+        /**
+        * Create a valid name for the access point.
+        * @param aName The base name for access point
+        * @param aDb CommsDb instance
+        */
+        void MakeValidNameL( TDes& aName, CCommsDatabase& aDb ) const;
+
+    protected:
+        // The parent characteristic. Refs.
+        CWPCharacteristic& iCharacteristic;
+
+        // The preferred access point name
+        TPtrC iName;
+
+        // The access point address, Owns.
+        HBufC* iAddr;
+
+        // The UID of the access point
+        TUint32 iUID;
+
+        // UID of the saved item
+        TPckgBuf<TWPWAPSaveItem> iSaveItem;
+
+        // Temporary current proxy while visiting. Refs.
+        CWPCharacteristic* iLink;
+
+        // Text to return in SummaryTitle().
+        const TDesC& iTitle;
+
+        // Default name of access point.
+        const TDesC& iDefaultName;
+
+        // Comms db. Refs.
+        CCommsDatabase*& iCommsDb;
+
+        // APEngine. Refs.
+        CApDataHandler*& iAPHandler;
+    };
+
+#endif  // CWPWAPITEMBASE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPMMSAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 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: 
+*     Handles MMS settings in provisioning.
+*
+*/
+
+
+#ifndef CWPWAPMMSADAPTER_H
+#define CWPWAPMMSADAPTER_H
+
+// INCLUDES
+#include "CWPWAPAdapterBase.h"
+
+// FORWARD DECLARATIONS
+class CWPCharacteristic;
+
+// CLASS DECLARATION
+
+/**
+ * CWPWAPMMSAdapter handles MMS settings.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class CWPWAPMMSAdapter : public CWPWAPAdapterBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CWPWAPMMSAdapter* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPMMSAdapter();
+
+    public: // from CWPWAPAdapterBase
+        
+        void ApplicationL( CWPCharacteristic& aCharacteristic );
+        
+    private:  // New functions
+        /**
+        * C++ default constructor.
+        */
+        CWPWAPMMSAdapter();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+        // Title for MMS items. Owns.
+        HBufC* iTitle;
+
+        // Default name for MMS items. Owns.
+        HBufC* iDefaultName;
+    };
+
+#endif  // CWPWAPMMSADAPTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPMMSItem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002 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: 
+*     Setting item for MMS settings.
+*
+*/
+
+
+#ifndef CWPWAPMMSITEM_H
+#define CWPWAPMMSITEM_H
+
+// INCLUDES
+#include <e32base.h>
+#include <msvapi.h>
+#include "CWPWAPItemBAse.h"
+
+// FORWARD DECLARATIONS
+class CBookmarkDb;
+class CApAccessPointItem;
+
+// CLASS DECLARATION
+
+/**
+ * CWPWAPMMSItem contains one MMS setting.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class CWPWAPMMSItem : public CWPWAPItemBase, private MMsvSessionObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aTitle Title for MMS items
+        * @param aDefaultName Default name for MMS items
+        * @param aCharacteristic The APPLICATION characteristic
+        * @param aCommsDb The CommsDB to use. Created if NULL.
+        * @param aAPHandler The APEngine data handler to use. Created if NULL.
+        */
+        static CWPWAPMMSItem* NewL( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler );
+
+        /**
+        * Destructor.
+        */
+        ~CWPWAPMMSItem();
+
+    public:   // From CWPWAPMMSItemBase
+
+        TBool CanSetAsDefault() const;
+        void SaveL();
+        void SetAsDefaultL();
+        TBool ValidateL();
+        void ResourceL( CWPCharacteristic& aResource );
+        void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, 
+            RPointerArray<MWPWAPItemBase>& aHiddenItems );
+        void VisitLinkL( CWPCharacteristic& aCharacteristic );
+
+    private: // from MMsvSessionObserver
+
+        void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+
+    private:  // New functions
+        /**
+        * C++ default constructor.
+        * @see CWPWAPMMSItem::NewL() for description of parameters.
+        */
+        CWPWAPMMSItem(  const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Check if a NAPDEF characteristic is GPRS.
+        * @param aCharacteristic The NAPDEF characteristic
+        * @return GPRS access point if found
+        */
+        CApAccessPointItem* FindGPRSLC() const;
+
+    private:   // Data
+        // The bookmarks database. Refs.
+        CBookmarkDb* iDb;
+
+        // The potential links
+        RPointerArray<CWPCharacteristic> iLinks;
+    };
+
+#endif  // CWPWAPMMSITEM_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/MWPWAPItemBase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2002 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: 
+*     Base class for WAP setting items.
+*
+*/
+
+
+#ifndef MWPWAPITEMBASE_H
+#define MWPWAPITEMBASE_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+const TUint32 KWPWAPNoUID = 0;
+const TUint32 KWPWAPItemTypeNone = 0;
+const TUint32 KWPWAPItemTypeBookmark = 1;
+const TUint32 KWPWAPItemTypeAccesspoint = 2;
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+ * MWPWAPItemBase is a base class for wap settings.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class MWPWAPItemBase
+    {
+	public:
+		struct TWPWAPSaveItem
+			{
+			TUint32 iSaveItemType;
+			TUint32 iUID;
+			};
+
+    public:  // Constructors and destructor
+
+        /**
+        * Destructor.
+        */
+        virtual ~MWPWAPItemBase() {};
+
+    public:   // New functions
+
+        /**
+        * Returns the name of the item to be returned in
+        * SummaryText().
+        * @return Name of the item
+        */
+        virtual const TDesC& Name() const = 0;
+
+        /**
+        * Returns the title of the item to be returned in
+        * SummaryTitle().
+        * @return Name of the item
+        */
+        virtual const TDesC& Title() const = 0;
+
+        /**
+        * Returns the address of the service pointed by 
+        * the item.
+        * @return Address of the service
+        */
+        virtual const TDesC& Address() const = 0;
+
+        /**
+        * Saves the item. Call BaseSaveL() in beginning.
+        */
+        virtual void SaveL() = 0;
+
+        /**
+        * Returns ETrue if the item can be saved as
+        * default setting.
+        * @return Whether the item can be made default
+        */
+        virtual TBool CanSetAsDefault() const = 0;
+
+        /**
+        * Sets the item as default setting.
+        */
+        virtual void SetAsDefaultL() = 0;
+
+        /**
+        * Returns ETrue if the item is valid.
+        * @return ETrue if valid
+        */
+        virtual TBool ValidateL() = 0;
+
+        /**
+        * Adds the item and its children to a list of items.
+        * @param aShownItems The list of shown items to be appended to
+        * @param aHiddenItems The list of hidden items to be appended to
+        */
+        virtual void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, 
+            RPointerArray<MWPWAPItemBase>& aHiddenItems  ) = 0;
+
+        /**
+        * Returns the ID of the saved item.
+        * @return ID of the saved item, or KWPWAPNoUID
+        */
+        virtual const TDesC8& SaveData() const = 0;
+
+    };
+
+#endif  // MWPWAPITEMBASE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2002 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: 
+*     WPWAPDebug contains debug macros.
+*
+*/
+
+
+#ifndef WPWAPDEBUG_H 
+#define WPWAPDEBUG_H 
+
+// MACROS
+
+// Define this to enable debug output
+//#define WAPDEBUG
+
+// DEBUG can be used for outputting debug
+#ifdef WAPDEBUG
+#define DEBUG(TEXT) Debug( _L(#TEXT) );
+#define DVA(TEXT, ARG1) Debug( _L(#TEXT), (ARG1) );
+#define DVA2(TEXT, ARG1, ARG2) Debug( _L(#TEXT), (ARG1), (ARG2) );
+#define DVA3(TEXT, ARG1, ARG2, ARG3) Debug( _L(#TEXT), (ARG1), (ARG2), (ARG3) );
+#else
+#define DEBUG(TEXT)
+#define DVA(TEXT, ARG1)
+#define DVA2(TEXT, ARG1, ARG2)
+#define DVA3(TEXT, ARG1, ARG2, ARG3)
+#endif
+
+#if defined(__WINS__) || defined(__EPOC32__)
+GLDEF_C void Debug( TRefByValue<const TDesC> aText, ...);
+#endif
+
+#endif /* WPWAPDEBUG_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPItemFactory.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2002-2006 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:  Factory for WAP items.
+*
+*/
+
+
+#ifndef WPITEMFACTORY_H
+#define WPITEMFACTORY_H
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MWPWAPItemBase;
+class CWPCharacteristic;
+class CCommsDatabase;
+class CApDataHandler;
+class CBookmarkDb;
+class RFavouritesDb;
+// CLASS DECLARATION
+
+/**
+ * WPWAPItemFactory is a factory for all WAP items.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class WPWAPItemFactory
+    {
+    public:
+        /**
+        * Create an MMS item.
+        * @param aTitle Title for MMS items
+        * @param aDefaultName Default name for MMS items
+        * @param aCharacteristic The APPLICATION characteristic
+        * @param aCommsDb The CommsDB to use. Created if NULL.
+        * @param aAPHandler The APEngine data handler to use. Created if NULL.
+        * @return MWPWAPItemBase instance
+        */
+        static MWPWAPItemBase* CreateMMSLC( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler );
+
+
+        /**
+        * Create a browser item.
+        * @param aFirst ETrue if this browser item is first
+        * @param aTitle Title for browser items
+        * @param aBookmarkTitle Title for bookmark items
+        * @param aDefaultName Default name for browser items
+        * @param aCharacteristic The APPLICATION characteristic
+        * @param aDb The CommsDB to use. Created if NULL.
+        * @param aAPHandler The APEngine data handler to use. Created if NULL.
+        * @param aBookmarkDb The bookmark database to use. Created if NULL.
+        * @return MWPWAPItemBase instance
+        */
+        static MWPWAPItemBase* CreateBrowserLC( TBool aFirst,
+            const TDesC& aTitle, 
+            const TDesC& aBookmarkTitle,
+            const TDesC& aDefaultName, 
+            const TDesC& aDefaultBookmarkName,
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler,
+            RFavouritesDb aBookmarkDb );
+            
+        /**
+        * Create a bookmark item.
+        * @param aTitle The title to be returned in Name().
+        * @param aDefaultName The default name for bookmarks.
+        * @param aResource The RESOURCE characteristic.
+        * @param aLink Link to NAPDEF
+        * @param aDb The bookmark database to use. Created if NULL.
+        * @return MWPWAPItemBase instance
+        */
+        static MWPWAPItemBase* CreateBookmarkLC( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aResource, 
+            CWPCharacteristic*& aNapdef,
+            RFavouritesDb aDb);
+
+    };
+
+
+#endif  // WPITEMFACTORY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPUtil.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 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: 
+*     Utility class for reading resource strings.
+*
+*/
+
+
+#ifndef WPWAPUTIL_H
+#define WPWAPUTIL_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class RResourceFile;
+
+// CLASS DECLARATION
+
+/**
+ * WPWAPUtil is a utility class for reading resource strings.
+ *
+ * @lib WPWAPAdapter
+ * @since 2.0
+ */ 
+class WPWAPUtil
+    {
+    public: // New functions
+        /**
+        * Loads a specified resource string from resource file.
+        * @param aResourceId is of a resource string.
+        * @return pointer to loaded descriptor.
+        */
+        static HBufC* ReadHBufCL( TInt aResourceId );
+
+        /**
+        * Searches for the resource file with the correct language extension 
+        * for the language of the current locale, or failing this, the best 
+        * matching file.
+        * @param aFs reference to file server.
+        * @param aResFileName resource file name.
+        * @param aResFile reference to resource file.
+        */
+        static void FindAndOpenResourceFileLC(RFs& aFs, 
+            const TDesC& aResFileName, 
+            RResourceFile& aResFile);
+
+        /**
+        * Checks if a URL is valid.
+        * @param aURL the URL to check
+        * @return ETrue if the URL is valid
+        */
+        static TBool CheckURI( const TDesC& aUrl );
+
+    };
+
+#endif  // WPWAPUTIL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPAdapterBase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2002 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:  Base for WAP adapters.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <commdb.h>
+#include <ApDataHandler.h>
+#include <CWPAdapter.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <wpwapadapterresource.rsg>
+#include "CWPWAPItemBAse.h"
+#include "CWPWAPAdapterBase.h"
+#include "WPWAPDebug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::CWPWAPAdapterBase
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPAdapterBase::CWPWAPAdapterBase()
+    : CWPAdapter()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::BaseConstructL
+// 2nd phase base class constructor.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::BaseConstructL()
+    {
+    }
+
+// Destructor
+CWPWAPAdapterBase::~CWPWAPAdapterBase()
+    {
+    iItems.ResetAndDestroy();
+    iHiddenItems.ResetAndDestroy();
+    delete iCommsDb;
+    delete iAPHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::SummaryCount
+// -----------------------------------------------------------------------------
+//
+TInt CWPWAPAdapterBase::ItemCount() const
+    {
+    return iItems.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::SummaryTitle
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CWPWAPAdapterBase::SummaryTitle(TInt aIndex) const
+    {
+    return iItems[aIndex]->Title();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::SummaryText
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPAdapterBase::SummaryText(TInt aIndex) const
+    {
+    return iItems[aIndex]->Name();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::SaveL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::SaveL(TInt aIndex)
+    {
+    iItems[aIndex]->SaveL();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPAdapterBase::CanSetAsDefault(TInt aIndex) const
+    {
+    return iItems[aIndex]->CanSetAsDefault();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::SetAsDefaultL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::SetAsDefaultL(TInt aIndex)
+    {
+    iItems[aIndex]->SetAsDefaultL();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::DetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CWPWAPAdapterBase::DetailsL( TInt /*aItem*/, MWPPairVisitor& /*aVisitor*/ )
+    {
+    return KErrNotSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::VisitL( CWPCharacteristic& aCharacteristic )
+    {
+    switch( aCharacteristic.Type() )
+        {
+        case KWPApplication:
+            {
+            aCharacteristic.AcceptL( *this );
+            ApplicationL( aCharacteristic );
+            iAppID.Set( KNullDesC );
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::VisitL( CWPParameter& aParameter )
+    {
+    if( aParameter.ID() == EWPParameterAppID )
+        {
+        iAppID.Set( aParameter.Value() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::VisitLinkL( CWPCharacteristic& /*aLink*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::ContextExtension
+// -----------------------------------------------------------------------------
+//
+TInt CWPWAPAdapterBase::ContextExtension( MWPContextExtension*& aExtension )
+    {
+    aExtension = this;
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::SaveDataL
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CWPWAPAdapterBase::SaveDataL( TInt aIndex ) const
+    {
+    return iItems[aIndex]->SaveData();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::DeleteL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::DeleteL( const TDesC8& aSaveData )
+    {
+    CreateDbL();
+
+    TPckgBuf<MWPWAPItemBase::TWPWAPSaveItem> pckg;
+    pckg.Copy( aSaveData );
+
+    // Base class handles only access point deletion
+    if( pckg().iSaveItemType == KWPWAPItemTypeAccesspoint )
+        {
+        DVA( "DeleteL: Deleting access point %08x", pckg().iUID );
+        TRAPD( err, iAPHandler->RemoveAPL( pckg().iUID ) );
+        DVA( "DeleteL: Deleted, %d", err );
+        
+        switch( err )
+            {
+            case KErrNotFound:
+                {
+                // Item not existing is what we want, so this error is ok
+                break;
+                }
+                
+            case KErrLocked:
+                {
+                // Transform the code so that the caller can retry
+                User::Leave( EWPCommsDBLocked );
+                break;
+                }
+                
+            default:
+                {
+                User::LeaveIfError( err );
+                break;
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::Uid
+// -----------------------------------------------------------------------------
+//
+TUint32 CWPWAPAdapterBase::Uid() const
+    {
+    return iDtor_ID_Key.iUid;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPAdapterBase::CreateDbL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPAdapterBase::CreateDbL()
+    {
+    if( !iCommsDb )
+        {
+        iCommsDb = CCommsDatabase::NewL();
+        }
+
+    if( !iAPHandler )
+        {
+        iAPHandler = CApDataHandler::NewLC( *iCommsDb );
+        CleanupStack::Pop(); // iAPEngine
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBookmarkItem.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2002-2006 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:  One bookmark item.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <favouritesdb.h>
+#include <favouritesitemlist.h>         // CFavouritesItemList
+#include <wpwapadapterresource.rsg>
+#include <CWPAdapter.h>
+#include "CWPWAPBookmarkItem.h"
+#include "WPWAPUtil.h"
+
+// CONSTANTS
+const TInt KUrlMaxLength = 255;
+const TInt KNameMaxLength = 50;
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::CWPWAPBookmarkItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPBookmarkItem::CWPWAPBookmarkItem( const TDesC& aTitle, 
+    const TDesC& aDefaultName, 
+    CWPCharacteristic*& aLink, 
+    RFavouritesDb aDb )
+: iTitle( aTitle ), iDefaultName( aDefaultName ), iLink( aLink ), 
+iBookmarkDb( aDb )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::ConstructL( CWPCharacteristic& aCharacteristic )
+    {
+    aCharacteristic.AcceptL( *this );
+    if( iName == KNullDesC )
+        {
+        iName.Set( iDefaultName );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPWAPBookmarkItem* CWPWAPBookmarkItem::NewL(  const TDesC& aTitle, 
+    const TDesC& aDefaultName, 
+    CWPCharacteristic& aCharacteristic, 
+    CWPCharacteristic*& aLink,
+    RFavouritesDb aDb )
+    {
+    CWPWAPBookmarkItem* self = new(ELeave) CWPWAPBookmarkItem( aTitle, 
+        aDefaultName, aLink, aDb ); 
+    CleanupStack::PushL(self);
+    self->ConstructL( aCharacteristic );
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+CWPWAPBookmarkItem::~CWPWAPBookmarkItem()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPBookmarkItem::Name() const
+    {
+    return iName;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::Title
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPBookmarkItem::Title() const
+    {
+    return iTitle;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::Title
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPBookmarkItem::Address() const
+    {
+    return iURI;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::SaveID
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CWPWAPBookmarkItem::SaveData() const
+    {
+    if( iSaveItem().iSaveItemType != KWPWAPItemTypeNone )
+        {
+        return iSaveItem;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::AddL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::AddL( RPointerArray<MWPWAPItemBase>& aShownItems,
+                              RPointerArray<MWPWAPItemBase>& /*aHiddenItems*/ )
+    {
+    User::LeaveIfError( aShownItems.Append( this ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::SaveL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::SaveL()
+    {
+    TPckgBuf<TUint32> uid;
+    if( iLink && iLink->Data().Length() == uid.MaxLength() )
+        {
+        uid.Copy( iLink->Data() );
+        iUID = uid();
+        }
+
+    CreateDbL();
+    
+    CFavouritesItem* item = CFavouritesItem::NewL();
+    CleanupStack::PushL( item );
+    
+    item->SetType( CFavouritesItem::EItem );
+    item->SetParentFolder( KFavouritesRootUid );
+    item->SetNameL( iName );
+    item->SetUrlL( iURI ); 
+    
+    if( iUID != KWPWAPNoUID )
+        {
+        TFavouritesWapAp ap;
+        ap.SetApId( iUID );
+        item->SetWapAp( ap );
+        } 
+    TInt err( iBookmarkDb.Add( *item, ETrue ) );
+    if( err == KErrLocked )
+        {
+        err = EWPBookmarksLocked;
+        }
+    User::LeaveIfError( err );
+    iSaveItem().iSaveItemType = KWPWAPItemTypeBookmark;
+    iSaveItem().iUID = item->Uid();
+    
+    CleanupStack::PopAndDestroy(); // item
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPBookmarkItem::CanSetAsDefault() const
+    {
+    // Startpage support. This can be set as default if this is to be 
+    // interpreted as startpage.
+    return iHasStartPage;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::SetAsDefaultL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::SetAsDefaultL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::ValidateL
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPBookmarkItem::ValidateL()
+    {
+    return iURI.Length() <= KUrlMaxLength
+        && iName.Length() <= KNameMaxLength
+        && iURI.Length() > 0
+        && WPWAPUtil::CheckURI( iURI );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::VisitL( CWPCharacteristic& /*aCharacteristic*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::VisitL( CWPParameter& aParameter )
+    {
+    switch( aParameter.ID() )
+        {
+        case EWPParameterURI:
+            {
+            iURI.Set( aParameter.Value() );
+            break;
+            }
+
+        case EWPParameterName:
+            {
+            iName.Set( aParameter.Value() );
+            break;
+            }
+
+        case EWPParameterStartPage:
+            {
+            iHasStartPage = ETrue;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::VisitLinkL( CWPCharacteristic& /*aLink*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBookmarkItem::CreateDbL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBookmarkItem::CreateDbL()
+    {
+    User::LeaveIfError( iSession.Connect() );
+    User::LeaveIfError( iBookmarkDb.Open( iSession, KBrowserBookmarks ) );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBrowserAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2002-2006 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:  Handles browser settings in provisioning.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <favouritesdb.h>
+#include <CWPAdapter.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <wpwapadapterresource.rsg>
+#include <ApDataHandler.h>
+#include "CWPWAPBrowserAdapter.h"
+#include "MWPWAPItemBase.h"
+#include "WPWAPItemFactory.h"
+#include "WPWAPUtil.h"
+#include "WPWAPDebug.h"
+
+// CONSTANTS
+_LIT( KBrowserAppID, "w2" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserAdapter::CWPWAPBrowserAdapter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPBrowserAdapter::CWPWAPBrowserAdapter()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserAdapter::ConstructL()
+    {
+    BaseConstructL();
+
+    iTitle = WPWAPUtil::ReadHBufCL( R_QTN_OP_HEAD_BROWSER );
+    iBookmarkTitle = WPWAPUtil::ReadHBufCL( R_QTN_SM_BOOKMARKS );
+    iDefaultName = WPWAPUtil::ReadHBufCL( R_QTN_SM_WAPAP_NAME );
+    iDefaultBookmarkName = WPWAPUtil::ReadHBufCL( R_QTN_SM_BOOKMARK_NAME );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPWAPBrowserAdapter* CWPWAPBrowserAdapter::NewL()
+    {
+    CWPWAPBrowserAdapter* self = new(ELeave) CWPWAPBrowserAdapter; 
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+CWPWAPBrowserAdapter::~CWPWAPBrowserAdapter()
+    {
+    delete iTitle;
+    delete iBookmarkTitle;
+    delete iDefaultName;
+    delete iDefaultBookmarkName;
+    iFavouritesDb.Close();
+    iSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserAdapter::ApplicationL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserAdapter::ApplicationL( CWPCharacteristic& aCharacteristic )
+    {
+    if( iAppID == KBrowserAppID )
+        {
+        MWPWAPItemBase* item = WPWAPItemFactory::CreateBrowserLC( !iProcessed, *iTitle, 
+            *iBookmarkTitle, *iDefaultName, *iDefaultBookmarkName, 
+            aCharacteristic, iCommsDb, iAPHandler, iFavouritesDb );
+
+        if( item->ValidateL() )
+            {
+            iProcessed = ETrue;
+            item->AddL( iItems, iHiddenItems );
+            CleanupStack::Pop(); // item
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(); // item
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserAdapter::DeleteL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserAdapter::DeleteL( const TDesC8& aSaveData )
+    {
+    CreateDbL();
+
+    TPckgBuf<MWPWAPItemBase::TWPWAPSaveItem> item;
+    item.Copy( aSaveData );
+
+    switch( item().iSaveItemType )
+        {
+        case KWPWAPItemTypeAccesspoint:
+            {
+            // Access point deletion is handled by the base class
+            CWPWAPAdapterBase::DeleteL( aSaveData );
+            break;
+            }
+
+        case KWPWAPItemTypeBookmark:
+            {
+            DVA( "DeleteL: Deleting bookmark %08x", item().iUID );
+            TInt err = iFavouritesDb.Begin( ETrue );
+            iFavouritesDb.CleanupRollbackPushL();  // push a rollback
+            
+            DVA( "DeleteL: Transaction, %d", err );
+            if( err == KErrNone )
+                {
+                err = iFavouritesDb.Delete( item().iUID );
+                DVA( "DeleteL: Deleted, %d", err );
+                iFavouritesDb.Commit();
+                DEBUG( "DeleteL: Committed" );
+                }
+            CleanupStack::Pop();    // pop the rollback
+
+            switch( err )
+                {
+                case KErrNotFound:
+                    {
+                    // Item not existing is what we want, so this error is ok
+                    break;
+                    }
+                    
+                case KErrLocked:
+                    {
+                    User::Leave( EWPBookmarksLocked );
+                    break;
+                    }
+                    
+                default:
+                    {
+                    User::LeaveIfError( err );
+                    break;
+                    }
+                }
+            break;
+            }
+
+        default:
+            {
+            // Don't know how to delete an item of this type. Better
+            // just ignore it.
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserAdapter::CreateDbL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserAdapter::CreateDbL()
+    {
+    User::LeaveIfError( iSession.Connect() );
+    User::LeaveIfError( iFavouritesDb.Open( iSession, KBrowserBookmarks ) );
+
+    CWPWAPAdapterBase::CreateDbL();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBrowserItem.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2002-2006 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:  One browser setting item.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <msvapi.h>
+#include <ApDataHandler.h>
+#include <ApAccessPointItem.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <CWPAdapter.h>
+#include <centralrepository.h>
+#include <browseruisdkcrkeys.h>
+#include "CWPWAPBrowserItem.h"
+#include "WPWAPItemFactory.h"
+#include "ProvisioningDebug.h"
+
+// CONSTANTS
+/// Delay to wait for WmlBrowser to catch up with changes in CommsDb. Microseconds.
+const TInt KWmlDelay = 4*500000;
+// Force browser to use User Defined AP
+const TInt KUserDefined = 0;
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::CWPWAPBrowserItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPBrowserItem::CWPWAPBrowserItem( TBool aFirst,
+                                      const TDesC& aTitle,
+                                      const TDesC& aBookmarkTitle,
+                                      const TDesC& aDefaultName, 
+                                      const TDesC& aDefaultBookmarkName,
+                                      CWPCharacteristic& aCharacteristic, 
+                                      CCommsDatabase*& aCommsDb, 
+                                      CApDataHandler*& aAPHandler,
+                                      RFavouritesDb aBookmarkDb 
+                                    )
+                                    : CWPWAPItemBase( aTitle,
+                                                      aDefaultName, 
+                                                      aCharacteristic, 
+                                                      aCommsDb, 
+                                                      aAPHandler ), 
+                                    iDefaultBookmarkName( aDefaultBookmarkName ),
+                                    iBookmarkTitle( aBookmarkTitle ), 
+                                    iDb( aBookmarkDb ),
+                                    iFirst( aFirst )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserItem::ConstructL()
+    {
+    BaseConstructL();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPWAPBrowserItem* CWPWAPBrowserItem::NewL( TBool aFirst,
+                                            const TDesC& aTitle, 
+                                            const TDesC& aBookmarkTitle,
+                                            const TDesC& aDefaultName,  
+                                            const TDesC& aDefaultBookmarkName,
+                                            CWPCharacteristic& aCharacteristic, 
+                                            CCommsDatabase*& aCommsDb, 
+                                            CApDataHandler*& aAPHandler,
+                                            RFavouritesDb aBookmarkDb
+                                            )
+    {
+    CWPWAPBrowserItem* self = new(ELeave) CWPWAPBrowserItem( aFirst,
+                                                             aTitle, 
+                                                             aBookmarkTitle, 
+                                                             aDefaultName, 
+                                                             aDefaultBookmarkName,
+                                                             aCharacteristic, 
+                                                             aCommsDb, 
+                                                             aAPHandler, 
+                                                             aBookmarkDb ); 
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPWAPBrowserItem::~CWPWAPBrowserItem()
+    {
+    iBookmarks.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::SaveL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserItem::SaveL()
+    {
+    CreateDbL();
+
+    TPckg<TUint32> uid( iUID );
+    // Check if the iLink->Data() contains an item of the same size as uid. 
+    // This is an extra check to ensure that iLink->Data() contains a packaged
+    // TUin32.
+    if( iLink && iLink->Data().Length() == uid.MaxLength() )
+        {
+        uid.Copy( iLink->Data() );
+        }
+    
+    CApAccessPointItem* apItem = CApAccessPointItem::NewLC();
+    // will leave if AP does not exists
+    iAPHandler->AccessPointDataL( iUID, *apItem );
+    if( iAddr )
+        {
+        // Update the access point startpage
+        WriteHomePageL( *apItem );
+        }
+    CleanupStack::PopAndDestroy(); // apItem
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPBrowserItem::CanSetAsDefault() const
+    {
+    return iUID != KWPWAPNoUID;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::SetAsDefaultL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserItem::SetAsDefaultL()
+    {
+    FLOG( _L( "[Provisioning] CWPWAPBrowserItem::SetAsDefaultL:" ) );
+    
+    CreateDbL();
+    TRAPD( err, iAPHandler->SetAsDefaultL( (TInt)iUID, EIspTypeWAPOnly) );
+    if( err == KErrLocked )
+        {
+        err = EWPCommsDBLocked;
+        }
+    // This function need to leave at the end of the function
+    // otherwise we dont set the default AP when db is locked
+    //User::LeaveIfError( err );
+    
+    // There's some delay before the WmlBrowser can find the stored 
+    // accesspoint from CommsDb so therefore we wait for a while before
+    // telling the WmlBrowser that default accesspoint should be changed.
+    // The value 500000 is chosen just by trying out.
+    User::After( KWmlDelay );
+
+    CRepository* repository = CRepository::NewLC( KCRUidBrowser );
+    FTRACE(RDebug::Print(
+                _L("[Provisioning] CWPWAPBrowserItem::SetAsDefaultL: AP:(%d)"),
+                                                                  (TInt)iUID));
+    
+    // Force the browser to use the User Defined AP selection mode.
+    User::LeaveIfError( repository->Set( KBrowserAccessPointSelectionMode,
+                                         KUserDefined ) );
+    // This sets the accesspoint default for browser.
+    User::LeaveIfError( repository->Set( KBrowserDefaultAccessPoint,
+                                         (TInt)iUID ) );
+
+    //Set the HomePage to default
+    if(iUID)
+        {
+        User::LeaveIfError( repository->Set( KBrowserNGHomepageType, EBrowserCenRepAccessPoint) );
+        }
+
+    CleanupStack::PopAndDestroy(); // repository
+    FLOG( _L( "[Provisioning] CWPWAPBrowserItem::SetAsDefaultL: Set Done" ) );
+
+    User::LeaveIfError( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::ValidateL
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPBrowserItem::ValidateL()
+    {
+    return iLink != NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::ResourceL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserItem::ResourceL( CWPCharacteristic& aResource )
+    {
+    MWPWAPItemBase* item = WPWAPItemFactory::CreateBookmarkLC( 
+                                                          iBookmarkTitle, 
+                                                          iDefaultBookmarkName,
+                                                          aResource, 
+                                                          iLink, 
+                                                          iDb );
+
+    if( item->CanSetAsDefault() && !iAddr )
+        {
+        iAddr = item->Address().AllocL();
+        CleanupStack::PopAndDestroy(); // item
+        }
+    else
+        {
+        User::LeaveIfError( iBookmarks.Append( item ) );
+        CleanupStack::Pop(); // item
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPBrowserItem::AddL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPBrowserItem::AddL( RPointerArray<MWPWAPItemBase>& aShownItems,
+                              RPointerArray<MWPWAPItemBase>& aHiddenItems )
+    {
+    for( TInt i( iBookmarks.Count()-1 ); i >= 0 ; i-- )
+        {
+        MWPWAPItemBase* item = iBookmarks[i];
+
+        if( item->ValidateL() )
+            {
+            // Transfer ownership of iBookmarks[i] to aItems
+            iBookmarks[i]->AddL( aShownItems, aHiddenItems );
+            }
+        else
+            {
+            // invalid items get deleted
+            delete item;
+            }
+        iBookmarks.Remove( i );
+        }
+
+    // Only first browser item is shown to the user.
+    if( iFirst )
+        {
+        User::LeaveIfError( aShownItems.Append( this ) );
+        }
+    else
+        {
+        User::LeaveIfError( aHiddenItems.Append( this ) );
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPItemBAse.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2002 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:  Base class for WAP setting items.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <msvapi.h>
+#include <mmsclient.h> 
+#include <mtclreg.h>
+#include <ApDataHandler.h>
+#include <ApAccessPointItem.h>
+#include <ApUtils.h>
+#include <f32file.h>
+#include <barsc.h>
+#include <bautils.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <WPAdapterUtil.h>
+#include <CWPAdapter.h>
+#include "CWPWAPItemBAse.h"
+#include "ProvisioningDebug.h"
+
+// CONSTANTS
+const TInt KNamesGranularity = 1;
+const TInt KNameMaxLength = 50;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::CWPWAPItemBase
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPItemBase::CWPWAPItemBase(  const TDesC& aTitle,
+                                 const TDesC& aDefaultName, 
+                                 CWPCharacteristic& aCharacteristic, 
+                                 CCommsDatabase*& aCommsDb, 
+                                 CApDataHandler*& aAPHandler )
+                                : iCharacteristic( aCharacteristic ), 
+                                  iTitle( aTitle ), 
+                                  iDefaultName( aDefaultName ), 
+                                  iCommsDb( aCommsDb ), 
+                                  iAPHandler( aAPHandler )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::BaseConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::BaseConstructL()
+    {
+    iCharacteristic.AcceptL( *this );
+
+    if( iName == KNullDesC )
+        {
+        iName.Set( iDefaultName );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPWAPItemBase::~CWPWAPItemBase()
+    {
+    delete iAddr;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::VisitL( CWPCharacteristic& aCharacteristic )
+    {
+    if( aCharacteristic.Type() == KWPResource )
+        {
+        ResourceL( aCharacteristic );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::VisitL( CWPParameter& aParameter )
+    {
+    switch( aParameter.ID() )
+        {
+        case EWPParameterName:
+            {
+            iName.Set( aParameter.Value() );
+            break;
+            }
+
+        case EWPParameterAddr:
+            {
+            if( !iAddr )
+                {
+                iAddr = aParameter.Value().AllocL();
+                }
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::VisitLinkL( CWPCharacteristic& aLink )
+    {
+    if( !iLink )
+        {
+        iLink = &aLink;
+
+        if( iName == KNullDesC )
+            {
+            // Get the name
+            CArrayFix<TPtrC>* names = new(ELeave) CArrayFixFlat<TPtrC>( KNamesGranularity );
+            CleanupStack::PushL( names );
+            aLink.ParameterL( EWPParameterName, names );
+            if( names->Count() > 0 )
+                {
+                iName.Set( names->At(0) );
+                }
+            CleanupStack::PopAndDestroy(); // names
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPItemBase::Name() const
+    {
+    return iName;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::Title
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPItemBase::Title() const
+    {
+    return iTitle;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::Address
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPWAPItemBase::Address() const
+    {
+    if( iAddr )
+        {
+        return *iAddr;
+        }
+    else
+        {
+        return KNullDesC;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::SaveData
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CWPWAPItemBase::SaveData() const
+    {
+    if( iSaveItem().iSaveItemType != KWPWAPItemTypeNone )
+        {
+        return iSaveItem;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::CreateDbL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::CreateDbL()
+    {
+    if( !iCommsDb )
+        {
+        iCommsDb = CCommsDatabase::NewL();
+        }
+
+    if( !iAPHandler )
+        {
+        iAPHandler = CApDataHandler::NewLC( *iCommsDb );
+        CleanupStack::Pop(); // iAPEngine
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::WriteHomePageL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::WriteHomePageL( CApAccessPointItem& aItem )
+    {
+    FLOG( _L( "[Provisioning] CWPWAPItemBase::WriteHomePageL:" ) );
+
+    if( iAddr )
+        {
+        if( aItem.ReadTextLengthL( EApWapStartPage ) > 0 )
+            {
+            FLOG( _L( "[Provisioning] CWPWAPItemBase::WriteHomePageL: EApWapStartPage " ) );
+            // Make a copy of the AP
+            CApAccessPointItem* newItem = CApAccessPointItem::NewLC();
+            newItem->CopyFromL( aItem );
+            
+            // Create a proper name for the copy
+            TBuf<KNameMaxLength> name( iName.Left( KNameMaxLength ) );
+            MakeValidNameL( name, *iCommsDb );  
+            
+            // Write name 
+            User::LeaveIfError( newItem->WriteTextL( EApWapAccessPointName, name ) );
+            
+            //Write IAP name
+            User::LeaveIfError( newItem->WriteTextL( EApIapName, name ) );
+            // Write MMSC address
+            User::LeaveIfError( newItem->WriteLongTextL( EApWapStartPage, *iAddr ) );
+            
+            // Create the new access point
+            TRAPD( err, iUID = iAPHandler->CreateFromDataL( *newItem ) );
+            
+            FTRACE(RDebug::Print(_L("[Provisioning] CWPWAPItemBase::WriteHomePageL: CreateFromDataL err (%d)"), err));
+            FTRACE(RDebug::Print(_L("[Provisioning] CWPWAPItemBase::WriteHomePageL: CreateFromDataL iUID (%d)"), iUID));
+            
+            if( err == KErrLocked )
+                {
+                err = EWPCommsDBLocked;
+                }
+            User::LeaveIfError( err );
+
+            iSaveItem().iSaveItemType = KWPWAPItemTypeAccesspoint;
+            iSaveItem().iUID = iUID;
+
+            CleanupStack::PopAndDestroy(); // newItem
+            }
+        else
+            {
+            FLOG( _L( "[Provisioning] CWPWAPItemBase::WriteHomePageL: EApWapStartPage 0 " ) );
+            User::LeaveIfError( aItem.WriteLongTextL( EApWapStartPage, *iAddr ) );
+            
+            // Update the access point
+            TBool nameChanged( EFalse );
+            TRAPD( err, iAPHandler->UpdateAccessPointDataL( aItem, nameChanged ) );
+            FTRACE(RDebug::Print(_L("[Provisioning] CWPWAPItemBase::WriteHomePageL: CreateFromDataL err (%d)"), err));
+            if( err == KErrLocked )
+                {
+                err = EWPCommsDBLocked;
+                }
+            User::LeaveIfError( err );
+            iUID = aItem.WapUid();
+            FTRACE(RDebug::Print(_L("[Provisioning] CWPWAPItemBase::WriteHomePageL: CreateFromDataL iUID (%d)"), iUID));
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPItemBase::MakeValidNameL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPItemBase::MakeValidNameL( TDes& aName, CCommsDatabase& aDb ) const
+    {
+    CApUtils* utils = CApUtils::NewLC( aDb );
+    utils->MakeValidNameL( aName );
+    CleanupStack::PopAndDestroy(); // utils
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPMMSAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002 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:  Handles MMS settings in provisioning.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CWPWAPMMSAdapter.h"
+#include <e32base.h>
+#include <CWPAdapter.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <wpwapadapterresource.rsg>
+#include <ApDataHandler.h>
+#include "MWPWAPItemBase.h"
+#include "WPWAPUtil.h"
+#include "WPWAPItemFactory.h"
+
+// CONSTANTS
+_LIT( KMMSAppID, "w4" );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSAdapter::CWPWAPMMSAdapter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPMMSAdapter::CWPWAPMMSAdapter()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSAdapter::ConstructL()
+    {
+    BaseConstructL();
+
+    iTitle = WPWAPUtil::ReadHBufCL( R_QTN_SM_MMS_ACCESSPOINTS );
+    iDefaultName = WPWAPUtil::ReadHBufCL( R_QTN_SM_WAPAP_NAME );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPWAPMMSAdapter* CWPWAPMMSAdapter::NewL()
+    {
+    CWPWAPMMSAdapter* self = new(ELeave) CWPWAPMMSAdapter; 
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+CWPWAPMMSAdapter::~CWPWAPMMSAdapter()
+    {
+    delete iTitle;
+    delete iDefaultName;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSAdapter::ApplicationL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSAdapter::ApplicationL( CWPCharacteristic& aCharacteristic )
+    {
+    if( iItems.Count() == 0 && iAppID == KMMSAppID )
+        {
+        MWPWAPItemBase* item = WPWAPItemFactory::CreateMMSLC( *iTitle, *iDefaultName, 
+            aCharacteristic, iCommsDb, iAPHandler );
+        if( item->ValidateL() )
+            {
+            item->AddL( iItems, iHiddenItems );
+            CleanupStack::Pop(); // item
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(); // item
+            }
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPMMSItem.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,270 @@
+/*
+* Copyright (c) 2002-2006 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:  One MMS setting item.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <msvapi.h>
+#include <mmsclient.h> 
+#include <mtclreg.h>
+#include <ApDataHandler.h>
+#include <ApAccessPointItem.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <CWPAdapter.h>
+#include <favouritesdb.h>
+#include "CWPWAPMMSItem.h"
+#include "WPWAPItemFactory.h"
+#include "WPWAPUtil.h"
+
+#ifdef __MESSAGING_API_V2__
+#include <mmssettings.h>
+#endif
+
+// CONSTANTS
+const TInt KUrlMaxLength = 255;
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::CWPWAPMMSItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPWAPMMSItem::CWPWAPMMSItem(  const TDesC& aTitle, 
+    const TDesC& aDefaultName, 
+    CWPCharacteristic& aCharacteristic, 
+    CCommsDatabase*& aDb, 
+    CApDataHandler*& aAPHandler )
+: CWPWAPItemBase( aTitle, aDefaultName, aCharacteristic, aDb, aAPHandler )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::ConstructL()
+    {
+    BaseConstructL();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPWAPMMSItem* CWPWAPMMSItem::NewL( const TDesC& aTitle, 
+    const TDesC& aDefaultName, 
+    CWPCharacteristic& aCharacteristic, 
+    CCommsDatabase*& aDb, 
+    CApDataHandler*& aAPHandler )
+    {
+    CWPWAPMMSItem* self = new(ELeave) CWPWAPMMSItem( aTitle, aDefaultName, 
+        aCharacteristic, aDb, aAPHandler ); 
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+CWPWAPMMSItem::~CWPWAPMMSItem()
+    {
+    iLinks.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::SaveL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::SaveL()
+    {
+    CreateDbL();
+
+    // Find a proper GPRS access point
+    CApAccessPointItem* item = FindGPRSLC();
+    WriteHomePageL( *item );    
+    CleanupStack::PopAndDestroy(); // item
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPMMSItem::CanSetAsDefault() const
+    {
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::SetAsDefaultL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::SetAsDefaultL()
+    {
+    // Open Messaging Server session
+    CMsvSession* session = CMsvSession::OpenSyncL( *this );
+    CleanupStack::PushL( session );
+
+    // Read the MMS client information via registry
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL( *session );
+    CleanupStack::PushL( registry );
+    
+    CMmsClientMtm* mmsClient = 
+        static_cast<CMmsClientMtm*>( registry->NewMtmL( KUidMsgTypeMultimedia ) );
+    CleanupStack::PushL( mmsClient );
+
+#ifdef __MESSAGING_API_V2__
+
+    CMmsSettings* mmsSettings = CMmsSettings::NewL();
+    CleanupStack::PushL( mmsSettings );
+    
+    mmsClient->RestoreSettingsL();
+
+    mmsSettings->CopyL( mmsClient->MmsSettings() );
+    TInt apCount =  mmsSettings->AccessPointCount();
+    TInt index;
+    for ( index = 0; index < apCount; index++)
+	    {
+	  	    mmsSettings->DeleteAccessPointL( 0 );	
+	    }
+    mmsSettings->AddAccessPointL( iUID, 0 );
+
+    mmsClient->SetSettingsL( *mmsSettings );
+    mmsClient->StoreSettingsL();
+
+    CleanupStack::PopAndDestroy(); // mmsSettings
+
+#else
+
+    mmsClient->LoadMessageL();
+    // Set the correct access point and save
+    mmsClient->SetFirstAccessPoint( iUID );
+    mmsClient->SaveMessageL();
+
+#endif
+
+    CleanupStack::PopAndDestroy(3); // mmsClient, registry, session
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::ValidateL
+// -----------------------------------------------------------------------------
+//
+TBool CWPWAPMMSItem::ValidateL()
+    {
+    return iLinks.Count() > 0
+        && iAddr
+        && iAddr->Length() <=KUrlMaxLength
+        && WPWAPUtil::CheckURI( *iAddr );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::ResourceL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::ResourceL( CWPCharacteristic& aResource )
+    { 
+    RFavouritesDb   favouritesDb;
+    MWPWAPItemBase* item = WPWAPItemFactory::CreateBookmarkLC( KNullDesC, 
+        KNullDesC, aResource, iLink, favouritesDb ); // iDb is NULL but it's not used.
+
+    // Not supporting resources without startpage.
+    if ( item->CanSetAsDefault() && !iAddr )
+        {
+        iAddr = item->Address().AllocL();
+        }
+    CleanupStack::PopAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::AddL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::AddL( RPointerArray<MWPWAPItemBase>& aShownItems,
+                              RPointerArray<MWPWAPItemBase>& /*aHiddenItems*/ )
+    {
+    User::LeaveIfError( aShownItems.Append( this ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::VisitLinkL( CWPCharacteristic& aLink )
+    {
+    CWPWAPItemBase::VisitLinkL( aLink );
+    User::LeaveIfError( iLinks.Append( &aLink ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::HandleSessionEventL
+// -----------------------------------------------------------------------------
+//
+void CWPWAPMMSItem::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, 
+    TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWPWAPMMSItem::FindGPRSL
+// -----------------------------------------------------------------------------
+//
+CApAccessPointItem* CWPWAPMMSItem::FindGPRSLC() const
+    {
+    CApAccessPointItem* result = NULL;
+    for( TInt i( 0 ); i < iLinks.Count() && result == NULL; i++ )
+        {
+        CWPCharacteristic* curr = iLinks[i];
+
+        TPckgBuf<TUint32> uidPckg;
+        const TInt pkgLength( uidPckg.MaxLength() );
+        for( TInt dataNum( 0 ); 
+            result == NULL && curr->Data( dataNum ).Length() == pkgLength; 
+            dataNum++ )
+            {
+            uidPckg.Copy( curr->Data( dataNum ) );
+
+            // Read the access point pointed to by TO-NAPID or TO-PROXY
+            CApAccessPointItem* item = CApAccessPointItem::NewLC();
+            iAPHandler->AccessPointDataL( uidPckg(), *item );
+
+            if( item->BearerTypeL() == EApBearerTypeGPRS )
+                {
+                // Item left on cleanup stack
+                result = item;
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(); // item
+                }
+            }
+        }
+
+    if( !result )
+        {
+        // Nothing left on cleanup stack. That doesn't matter as we leave.
+        User::Leave( KErrNotFound );
+        }
+
+    return result;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPAdapterGroupProxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2002 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:  Table of plugins for ECom
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <implementationproxy.h>
+#include "ProvisioningUIDs.h"
+#include "CWPWAPMMSAdapter.h"
+#include "CWPWAPBrowserAdapter.h"
+
+// CONSTANTS
+const TImplementationProxy KImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY( KProvisioningMMSAdapterUid, CWPWAPMMSAdapter::NewL )
+//    {{KProvisioningMMSAdapterUid}, CWPWAPMMSAdapter::NewL},
+	,
+	IMPLEMENTATION_PROXY_ENTRY( KProvisioningBrowserAdapterUid, CWPWAPBrowserAdapter::NewL )
+//    {{KProvisioningBrowserAdapterUid}, CWPWAPBrowserAdapter::NewL}
+    };
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy);
+
+    return KImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPAdapterMain.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2006 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:  DLL entry point
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32debug.h>
+#include <e32std.h>
+#include <flogger.h>
+#include "WPWAPDebug.h"
+
+// CONSTANTS
+
+#ifdef WAPDEBUG
+#ifdef WINS
+/// Folder where the log resides
+_LIT( KLogFolder, "provisioning" );
+
+/// The name of the log file
+_LIT( KLogFileName, "wapadapter" );
+
+/// The format in which the time is formatted in log
+_LIT( KLogTimeFormat, "%02d.%02d:%02d:%06d ");
+
+/// The length of the string produced by KLogTimeFormat
+const TInt KLogTimeFormatLength = 16;
+
+/// How many characters a log line can contain
+const TInt KLogLineLength = 256;
+#endif
+#endif 
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// Debug
+// -----------------------------------------------------------------------------
+//
+#ifdef WAPDEBUG
+GLDEF_C void Debug( TRefByValue<const TDesC> aText, ... )
+    {
+    #ifdef WINS
+    VA_LIST args;
+    VA_START( args, aText );
+
+    TBuf<KLogLineLength> buf;
+    buf.FormatList( aText, args );
+
+    RFileLogger logger;
+    TInt ret=logger.Connect();
+    if (ret==KErrNone)
+        {
+        logger.SetDateAndTime( EFalse,EFalse );
+        logger.CreateLog( KLogFolder, KLogFileName, EFileLoggingModeAppend );       
+        TBuf<KLogTimeFormatLength> timeStamp;
+        TTime now;
+        now.HomeTime();
+        TDateTime dateTime;
+        dateTime = now.DateTime();
+        timeStamp.Format( KLogTimeFormat, 
+            dateTime.Hour(), dateTime.Minute(),
+            dateTime.Second(), dateTime.MicroSecond() );
+        buf.Insert( 0, timeStamp );
+
+        logger.Write(buf);
+        }
+
+    logger.Close();
+
+    VA_END( args );
+    #else
+    RDebug::Print(aText);
+    #endif
+    }
+#else
+GLDEF_C void Debug( TRefByValue<const TDesC> /*aText*/, ... )
+    {
+    }
+#endif
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPItemFactory.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-2006 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:  WPWAPItemFactory creates WAP settings items.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "WPWAPItemFactory.h"
+#include "CWPWAPMMSItem.h"
+#include "CWPWAPBrowserItem.h"
+#include "CWPWAPBookmarkItem.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// WPWAPItemFactory::CreateMMSL
+// -----------------------------------------------------------------------------
+//
+MWPWAPItemBase* WPWAPItemFactory::CreateMMSLC( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler )
+    {
+    CWPWAPMMSItem* item = CWPWAPMMSItem::NewL( aTitle, aDefaultName, 
+        aCharacteristic, aCommsDb, aAPHandler );
+    CleanupStack::PushL( item );
+    return item;
+    }
+
+// -----------------------------------------------------------------------------
+// WPWAPItemFactory::CreateBrowserL
+// -----------------------------------------------------------------------------
+//
+MWPWAPItemBase* WPWAPItemFactory::CreateBrowserLC( TBool aFirst,
+            const TDesC& aTitle, 
+            const TDesC& aBookmarkTitle,
+            const TDesC& aDefaultName, 
+            const TDesC& aDefaultBookmarkName,
+            CWPCharacteristic& aCharacteristic, 
+            CCommsDatabase*& aCommsDb, 
+            CApDataHandler*& aAPHandler,
+            RFavouritesDb aBookmarkDb )
+    {
+    CWPWAPBrowserItem* item = CWPWAPBrowserItem::NewL( aFirst, aTitle, aBookmarkTitle, 
+        aDefaultName, aDefaultBookmarkName, aCharacteristic, aCommsDb, aAPHandler, aBookmarkDb );
+    CleanupStack::PushL( item );
+    return item;
+    }
+
+// -----------------------------------------------------------------------------
+// WPWAPItemFactory::CreateMMSL
+// -----------------------------------------------------------------------------
+//
+MWPWAPItemBase* WPWAPItemFactory::CreateBookmarkLC( const TDesC& aTitle, 
+            const TDesC& aDefaultName, 
+            CWPCharacteristic& aResource, 
+            CWPCharacteristic*& aLink,
+            RFavouritesDb aDb)
+    {
+    CWPWAPBookmarkItem* item = CWPWAPBookmarkItem::NewL( aTitle, 
+        aDefaultName, aResource, aLink, aDb );
+    CleanupStack::PushL( item );
+    return item;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPUtil.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 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:  WPWAPUtil is a utility class for reading resource strings.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <f32file.h>
+#include <barsc.h>
+#include <bautils.h>
+#include <WPAdapterUtil.h>
+#include <CWPCharacteristic.h>
+#include <uri16.h>                // TUriParser8
+#include "WPWAPUtil.h"
+
+// CONSTANTS
+#if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw
+    _LIT( KAdapterName, "WPWAPAdapterResource" );
+#else
+    _LIT( KAdapterName, "WPWAPAdapter" );
+#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// WPWAPUtil::ReadHBufCL
+// -----------------------------------------------------------------------------
+//
+HBufC* WPWAPUtil::ReadHBufCL( TInt aResourceId )
+    {
+    TFileName fileName;
+    Dll::FileName( fileName );
+
+    return WPAdapterUtil::ReadHBufCL( fileName, KAdapterName, aResourceId );
+    }
+
+// -----------------------------------------------------------------------------
+// WPWAPUtil::CheckURL
+// -----------------------------------------------------------------------------
+//
+TBool WPWAPUtil::CheckURI( const TDesC& aUrl )
+    {
+    return WPAdapterUtil::CheckURI( aUrl );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAccesspointItem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2002 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:    Class stores data for one accesspoint
+*
+*/
+
+
+
+#ifndef CWPAPACCESSPOINTITEM_H
+#define CWPAPACCESSPOINTITEM_H
+
+// INCLUDES
+#include <e32def.h>
+#include <e32std.h>
+#include <e32base.h>
+#include <cmmanagerext.h>
+
+// FORWARD DECLARATIONS
+class CWPEngine;
+class CWPAPItemBase;
+class CWPParameter;
+class CWPCharacteristic;
+class CCommsDatabase;
+class CWPAPNapdef;
+class RCmManagerExt;
+
+// CLASS DECLARATION
+
+/**
+ * CWPAPAccesspointItem handles accesspoint settings. It links data from
+ * logical proxy, physical proxy and napdef into one item.
+ */ 
+class CWPAPAccesspointItem : public CBase
+	{
+	public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aDefaultName The default name if none is found
+        * @param aLogicalProxy The logical proxy 
+        * @param aPhysicalProxy The physical proxy 
+        * @param aNapdef The napdef
+        * @param aCharacteristic The characteristic 
+        */
+		static CWPAPAccesspointItem* NewLC(
+		                            const TDesC& aDefaultName,
+                                    CWPAPItemBase* iLogicalProxy,
+                                    CWPAPItemBase* iPhysicalProxy,
+                                    CWPAPItemBase* aNapdef,
+                                    CWPCharacteristic& aCharacteristic );
+
+        /**
+        * Destructor.
+        */
+		virtual ~CWPAPAccesspointItem();
+
+	public: // New methods
+
+		/**
+		* Get the accesspoint name.
+		* @return reference to name.
+		*/
+		const TDesC& Name() const;
+		
+		/**
+		* Get the NAPdef pointer
+		* @return pointer to napdef.
+		*/
+	  	CWPAPItemBase* NapDef();
+	  	
+	  	/**
+		* Set the pointer to the CM manager
+		* @return void
+		*/
+	  	void SetCMManager( RCmManagerExt* aCm );
+	  	
+	  	/**
+		* Get the characteristic value
+		* @return iCharacteristic.
+		*/
+	  	TInt Characteristic();
+		
+		/**
+		* Save this accesspoint to comms database.
+		* @param aCommsDb reference to CCommsdatabase
+		*/
+		TUint32 SaveL( CCommsDatabase& aCommsDb );
+
+        /**
+        * Return the UID of the saved access point.
+        * @return UID
+        */
+        const TDesC8& Uid() const;
+
+        /**
+        * Delete old data from engine model.
+        */
+        void DeleteUidData() const;
+
+	private:  // New functions
+
+		/**
+		* Store the accesspoint data to comms database.
+		* @param aCommsDb reference to CCommsdatabase
+		*/ 
+		TUint32 StoreL( CCommsDatabase& aCommsDb );
+
+		/**
+        * C++ default constructor.
+        * @param aDefaultName The default name if none is found
+        * @param aLogicalProxy The logical proxy 
+        * @param aPhysicalProxy The physical proxy 
+        * @param aNapdef The napdef
+        * @param aCharacteristic The characteristic 
+        */
+		CWPAPAccesspointItem( const TDesC& aDefaultName,
+                              CWPAPItemBase* iLogicalProxy,
+                              CWPAPItemBase* iPhysicalProxy,
+                              CWPAPItemBase* aNapdef,
+                              CWPCharacteristic& aCharacteristic );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+	private: // Data (Total ownership is assumed unless otherwise stated)
+
+        /// The default name if no other is found
+        const TDesC& iDefaultName;
+
+        /// The napdef
+        CWPAPItemBase* iNapdef;
+
+        /// The physical proxy
+        CWPAPItemBase* iPhysicalProxy;
+
+        /// The logical proxy
+        CWPAPItemBase* iLogicalProxy;
+
+        /// The uid created when saving
+        TPckgBuf<TUint32> iUid;
+
+        /// The characteristic the caused the creation of an access point
+        CWPCharacteristic& iCharacteristic;
+        RCmManagerExt* iCmManager;
+
+	private: // For testing usage.
+		friend class T_CWPAPAccesspointItem;
+		friend class T_CWPAPAdapter;
+		friend class T_WPAPTestUtils;
+	};
+
+#endif	// CWPAPACCESSPOINTITEM_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2002 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:    Main class for handling provisioning accesspoint data
+*
+*/
+
+
+
+#ifndef CWPAPADAPTER_H
+#define CWPAPADAPTER_H
+
+// INCLUDES
+
+#include <CWPAdapter.h>
+#include <MWPContextExtension.h>
+#include <cmmanagerext.h>
+
+// FORWARD DECLARATIONS
+
+class CWPAPAccesspointItem;
+class CCommsDatabase;
+
+// CLASS DECLARATION
+
+/**
+ * CWPAPAdapter handles accesspoint settings.
+ */ 
+class CWPAPAdapter : public CWPAdapter, public MWPContextExtension
+	{
+	public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+		* @return a instance of class.
+        */
+		static CWPAPAdapter* NewL();
+
+		/**
+		* Destructor
+		*/
+		~CWPAPAdapter();
+
+	public: // From CWPAdapter
+
+		TInt ItemCount() const;
+		const TDesC16& SummaryTitle(TInt aIndex) const;
+		const TDesC16& SummaryText(TInt aIndex) const;
+		TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
+		void SaveL( TInt aItem );
+		TBool CanSetAsDefault( TInt aItem ) const;
+		void SetAsDefaultL( TInt aItem );
+		void VisitL(CWPCharacteristic& aElement);
+		void VisitL(CWPParameter& aElement);
+		void VisitLinkL(CWPCharacteristic& aCharacteristic );
+		TInt ContextExtension( MWPContextExtension*& );
+
+	public: // From MWPContextExtension
+
+		const TDesC8& SaveDataL( TInt aIndex ) const;
+		void DeleteL( const TDesC8& aSaveData );
+        TUint32 Uid() const;
+
+	private:  // New functions
+
+        /**
+        * C++ default constructor.
+        */
+		CWPAPAdapter();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+		/**
+		* Check whether this characteristic is already linked.
+		* @param aCharacteristic characteristic to compare.
+		* @return ETrue if link to given characteristic was found.
+		*/
+		TBool IsAlreadyLinked( CWPCharacteristic& aCharacteristic );
+
+	private: // Data
+
+		/// Array of linked NAPDEF and PXLOGICAL characteristics. Refs.
+		RPointerArray<CWPCharacteristic> iLinks;
+		/// Array of data items for memory management. Owns.
+		RPointerArray<CBase> iDataItems;
+        /// Array of save items. Owns.
+        RPointerArray<CWPAPAccesspointItem> iSaveItems;
+		/// Pointer to commsdatabase used in saving. Owns.
+		CCommsDatabase* iCommsDb;
+		/// Summary title. Owns.
+		HBufC* iTitle;
+        /// Default name. Owns.
+        HBufC* iDefaultName;
+		/// Indicates whether these settings are already saved.
+		TBool iAlreadySavedOnce;
+		// CMManager for managing connection methods
+		RCmManagerExt* iCmManager;
+	  RArray<TInt> iAPValue;
+
+	private: // For testing.
+		friend class T_CWPAPAdapter;
+	};
+
+#endif	// CWPAPADAPTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPItemBase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2002 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:     Defines a base class for all the items in WPAPAdapter
+*
+*/
+
+
+
+
+
+#ifndef CWPAPITEMBASE_H
+#define CWPAPITEMBASE_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <cmconnectionmethodext.h>
+#include <cmmanagerext.h>
+
+// DATA TYPES
+
+// Field types that can be marked received.
+// Values defined to the power of to to enable masking.
+enum TMarkedField
+	{
+	EWPParameterPxAddrType_id	= 2,
+	EWPParameterPxAddrFQDN_id	= 4,
+	EWPParameterNapID_id		= 8,
+	EWPParameterService_id		= 16,
+	EWPParameterPortNbr_id		= 32,
+	EWPParameterPxAddr_id		= 64,
+	EWPParameterAuthentication_id = 512,
+    EWPParameterIfNetworks_id   = 1024,
+    EWPParameterInternet_id     = 2048,
+    EWPParameterWlan_id         = 4096
+	};
+
+// FORWARD DECLARATIONS
+
+class CApAccessPointItem;
+class CWPAPAccesspointItem;
+class CCommsDatabase;
+
+// CLASS DECLARATION
+
+/**
+ * CWPAPItemBase is a base class for all the items in WPAPAdapter.
+ */ 
+class CWPAPItemBase : public CBase
+	{
+	public:
+
+        /**
+        * Destructor.
+        */
+		~CWPAPItemBase();
+
+	public: // New methods
+
+		/**
+		* Store the item data to APEngine's accesspoint item.
+		* @param aAPItem item where data is stored.
+		*/
+		virtual void AddDataL( RCmConnectionMethodExt& ) = 0;
+
+        /**
+        * Add access point items to an array.
+        * @param aItems The array to add to
+        * @param aLogicalProxy The related logical proxy, if any
+        * @param aPhysicalProxy The related physical proxy, if any
+        */
+        virtual TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+            CWPAPItemBase* aLogicalProxy,
+            CWPAPItemBase* aPhysicalProxy ) = 0;
+
+        /**
+        * The name of the item to be displayed to the user.
+        * @return The name
+        */
+        virtual const TDesC& Name() = 0;
+        
+        /**
+        * SaveWlanDataL
+        */    
+        virtual void SaveWlanDataL( TUint32 aIapId, CCommsDatabase& aCommsDb ) = 0;
+    
+        virtual void UpdateLingerL(const TUint32 aIapId) = 0;
+
+	protected: // New methods. Only for subclasses use.
+
+        /**
+        * Base constructor.
+        * @param aDefaultName The default name to use for an access point
+        */
+        CWPAPItemBase( const TDesC& aDefaultName );
+
+		/**
+		* Mark that this field has arrived and was correctly handled.
+		* @param aField received field enumeration
+		*/
+		void MarkReceived( TMarkedField aField );
+
+		/**
+		* Check has the given field been received.
+		* @param aField received field enumeration
+		* @return ETrue if the field has already been received and handled
+		*/
+		TBool IsReceived( TMarkedField aField );
+
+	protected:
+
+        /// The default name for an access point
+        const TDesC& iDefaultName;
+
+	private: // Data
+
+		/// Received fields marked here.
+		TUint32 iReceivedFieldsFlags;
+
+	private: // For testing.
+		friend class T_CWPAPItemBase;
+	};
+
+#endif	// CWPAPITEMBASE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPLogicalProxy.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002 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:     Defines a class, which holds logical proxy information.
+*
+*/
+
+
+
+
+
+#ifndef CWPAPLOGICALPROXY_H
+#define CWPAPLOGICALPROXY_H
+
+// INCLUDES
+
+#include <MWPVisitor.h>
+#include "CWPAPItemBase.h"
+#include <cmconnectionmethodext.h>
+
+// FORWARD DECLARATIONS
+
+class CWPAPPhysicalProxy;
+class CWPAPAccesspointItem;
+class CWPAPPort;
+
+// CLASS DECLARATION
+
+/**
+ * CWPAPLogicalProxy contains logical proxy data.
+ */ 
+class CWPAPLogicalProxy : public CWPAPItemBase, private MWPVisitor
+	{
+	public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aDefaultName The default name of an access point
+        * @param aCharacteristic The PXLOGICAL characteristic
+        */
+		static CWPAPLogicalProxy* NewLC( const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic );
+
+        /**
+        * Destructor.
+        */
+		~CWPAPLogicalProxy();
+
+	public: // From CWPAPItemBase
+
+		TBool ValidateL();
+		void AddDataL( RCmConnectionMethodExt& aCmItem );
+        TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+            CWPAPItemBase* aLogicalProxy,
+            CWPAPItemBase* aPhysicalProxy );
+        const TDesC& Name();
+        void SaveWlanDataL( TUint32 /*aIapId*/, CCommsDatabase& /*aCommsDb*/ ) {};
+
+        void UpdateLingerL(const TUint32 /*aIapId*/){};
+
+	private: // From CWPAPItemBase
+
+		void VisitL(CWPCharacteristic& aElement);		
+		void VisitL(CWPParameter& aElement);
+        void VisitLinkL( CWPCharacteristic& /*aLink*/ ) {};
+
+	private: // New methods
+
+        /**
+        * C++ default constructor.
+        * @param aDefaultName The default name of an access point
+        */
+		CWPAPLogicalProxy( CWPCharacteristic& aCharacteristic,
+            const TDesC& aDefaultName );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+		
+	private: // Data
+
+		/// Pointer to data model parameter. Refs.
+		CWPParameter* iHomepage;
+
+		/// Pointer to data model parameter. Refs.
+		CWPParameter* iName;
+
+		/// Pointer to port object. Owns.
+		CWPAPPort* iPort;
+
+		/// Array of physical proxy objects. Owns.
+		RPointerArray<CWPAPPhysicalProxy> iPhysicalProxies;
+
+        /// Characteristic
+        CWPCharacteristic& iCharacteristic;
+
+	private: // For testing
+
+		friend class T_CWPAPLogicalProxy;
+		friend class T_CWPAPAdapter;
+		friend class T_WPAPTestUtils;
+	};
+
+#endif	// CWPAPLOGICALPROXY_H
+            
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPNapdef.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,387 @@
+/*
+* Copyright (c) 2002-2006 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:     Class stores data for one accesspoint
+*
+*/
+
+
+
+
+
+#ifndef CWPAPNAPDEF_H
+#define CWPAPNAPDEF_H
+
+// INCLUDES
+#include <e32def.h>
+#include <e32std.h>
+#include <MWPVisitor.h>
+#include "CWPAPItemBase.h"
+#include "WPAPDefs.h"
+#include <cmconnectionmethodext.h>
+#include <cmplugindialcommondefs.h>
+#include <cmmanagerext.h>
+#include <etelpckt.h>
+
+// FORWARD DECLARATIONS
+class CWPAPPhysicalProxy;
+class CApAccessPointItem;
+class CWPParameter;
+class CCommsDatabase;
+class EAPSettings;
+class CertificateEntry;
+class RCmManagerExt;
+
+
+// CLASS DECLARATION
+
+/**
+ * CEapTypeElement is arrray element for several EapTypes  
+ */ 
+class CEapTypeElement: public CBase
+        {
+        public:
+        ~CEapTypeElement();
+        TBuf8<KExpandedEapIdLength> iEapTypeString;
+        TBuf8<KExpandedEapIdLength> iEncapsulatingExpandedEapId;
+        EAPSettings* iEAPSettings;
+        CertificateEntry* iCertificate;
+        };
+
+struct SECssID
+		{
+        CWPParameter* iSSSID;
+        CWPParameter* iSUSSID;
+		}; 
+/**
+ * CWPAPNapdef handles NAPDEF characteristics.
+ */ 
+class CWPAPNapdef : public CWPAPItemBase, private MWPVisitor
+	{
+	public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aFollowingLink ETrue if the NAPDEF was reached
+        *                       via a link.
+        * @param aDefaultName   The default name of an access point
+        * @param aLogicalCharacteristic The PXLOGICAL, if following a link from 
+        *                       there, or NAPDEF, if a direct link to NAPDEF.
+        * @param aLink          The NAPDEF characteristic
+        */
+		static CWPAPNapdef* NewLC( TBool aFollowingLink,
+                                   const TDesC& aDefaultName, 
+                                   CWPCharacteristic& aLogicalCharacteristic,
+                                   CWPCharacteristic& aLink );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CWPAPNapdef();
+
+	public: // From CWPAPItemBase
+
+		/**
+		* @precondition characteristic must be set otherwise Panics.
+		*/
+		TBool ValidateL();
+		
+        /**
+        * AddDataL
+        */     		
+		void AddDataL( RCmConnectionMethodExt& aCmItem );
+		
+        /**
+        * AddItemsL
+        */           
+        TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+                        CWPAPItemBase* aLogicalProxy,
+                        CWPAPItemBase* aPhysicalProxy );
+        /**
+        * Name
+        */
+        const TDesC& Name();
+    
+        /**
+        * SaveWlanDataL
+        */    
+        void SaveWlanDataL( TUint32 aIapId, CCommsDatabase& aCommsDb );
+
+        /**
+        * UpdateLingerL from the ItemBase
+        */    
+
+        void UpdateLingerL(const TUint32 aIapId);
+        
+        /**
+        * Set The Internet Parameter Indicator 
+        */
+        void SetInternetIndicator(TInt value);
+
+        /**
+        * Get The Internet Parameter Indicator 
+        */
+        TInt GetInternetIndicator();
+
+
+	private: // From MWPVisitor
+
+        /**
+        * VisitL
+        */   
+		void VisitL( CWPCharacteristic& aElement );		
+
+        /**
+        * VisitL
+        */   
+		void VisitL( CWPParameter& aElement );
+      
+        /**
+        * VisitLinkL
+        */   
+        void VisitLinkL( CWPCharacteristic& /*aLink*/ ) {};
+
+	private:  // New functions
+
+		/**
+        * C++ default constructor.
+        * @param aFollowingLink ETrue if the NAPDEF was reached
+        *                       via a link.
+        * @param aDefaultName   The default name of an access point
+        * @param aLogicalCharacteristic The PXLOGICAL, if following a link from 
+        *                       there, or NAPDEF, if a direct link to NAPDEF.
+        */
+		CWPAPNapdef( TBool aFollowingLink,
+                     const TDesC& aDefaultName, 
+                     CWPCharacteristic& aLogicalCharacteristic );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+        /**
+        * Writes a DNS address in either IPv4 or IPv6 format
+        * to an access point item.
+        * @param aAPItem The access point item
+        * @param aValue The DNS address to write
+        */
+        void WriteDNSAddressL( RCmConnectionMethodExt& aCmItem,
+                               const TDesC& aValue );
+                               
+        /**
+        * AddWlanDataL
+        */            
+        void AddWlanDataL( RCmConnectionMethodExt& aCmItem );
+        
+        /**
+        * HandleWLanParameters
+        */            
+        void HandleWLanParametersL( CWPParameter& aParameter );
+        
+        void HandleEAPParametersCCL( CWPParameter& aParameter );
+        
+        /**
+        * ConvertAsciiToHex
+        */            
+        void ConvertAsciiToHex( const TDesC8& aSource, HBufC8*& aDest );
+        
+        /**
+        * StrCopy
+        */                    
+        void StrCopy( TDes8& aTarget, const TDesC& aSource );
+        
+        /**
+        * Add linger value
+        */                    
+        void AddLingerL( const TInt , const TInt );
+        
+        /**
+        * Update linger value	
+        */                    
+        void UdateligerValueL(CWPParameter* aLinger);
+        /**
+        * Isalpha	
+        */                    
+        TBool Notalpha(const TDesC& aValue);
+        /**
+        * CheckIPv4values	
+        */  
+        TBool CheckIPv4values(const TDesC& aValue );
+        
+        /**
+        * CheckAddressPart	
+        */  
+        TBool CheckAddressPart( TLex& aLex );
+        
+        /**
+        * ConvertEAPStringToIds
+        */  
+        void ConvertEAPStringToIds(const TDesC& aEAPString, TDes8& aExpandedId, TUint& aId);
+  public: // new function
+  
+        /**
+        * NapId value
+        */  
+        const TDesC& NapId();
+        /**
+        * Bearer value
+        */
+        TUint Bearer();
+        
+        /**
+        * SetCMManager
+        */
+        void SetCMManager( RCmManagerExt* aCm );
+
+	private: // Data (Total ownership is assumed unless otherwise stated)
+
+        enum TAPWEPKeyFormat
+            {
+            EAscii,                 // Ascii format
+            EHexadecimal            // Hex format
+            };
+        /// PXLOGICAL characteristic
+        CWPCharacteristic& iCharacteristic;
+
+        /// The human-readable name of the connection. Refs.
+		CWPParameter* iConnectionName; 
+
+        /// The access point address. Refs.
+		CWPParameter* iAccesspointName;
+
+        /// The access point address. Refs.
+		CWPParameter* iAccesspointNameType;
+
+        /// The user name. Refs.
+		CWPParameter* iUserName;
+
+        /// The password. Refs.
+		CWPParameter* iPassword;
+
+        /// The IP address of the phone. Refs.
+		CWPParameter* iPhoneIPAddress;
+
+        /// The network type of the access point. Refs.
+        CWPParameter* iIfNetworks;
+
+        /// Array of name servers. Refs.
+        RPointerArray<CWPParameter> iNameServers;
+
+        /// Number of IPv4 name servers found so far.
+        TInt iNumIPv4NameServers;
+
+        /// Number of IPv6 name servers found so far.
+        TInt iNumIPv6NameServers;
+
+        /// The bearer of the access point.
+        //TApBearerType iBearer;
+        TUint iBearer;
+        
+        // Received bearer was unsupported
+        TBool iBearerUnsupported;
+
+        /// The PDP type of a GPRS access point.
+        TUint32 iPdpType;
+
+        /// ETrue of secure authentication must be used.
+		TBool iSecureAuthentication;
+
+        /// ETrue if the user must be prompted for password.
+		TBool iPromptPassword;
+
+        /// ETrue if we arrived to NAPDEF via a link
+        TBool iFollowingLink;
+        
+//JMan for WLan        
+
+		// Is WLAN supported (queried from Feature Manager)
+        TBool iWlanSupported;
+        
+        // The Network Access Point ID.
+        CWPParameter* iNapID;
+        
+        // WLAN characteristic parameters
+        
+        // The Primary Service Set Identifier name.
+        CWPParameter* iPriSSID;
+        
+        // The Used Primary Service Set Identifier name.
+        CWPParameter* iPriUSSID;
+        
+        // The Hidden Primary Service Set Identifier name.
+        CWPParameter* iPriHSSID;
+        
+        //for secssid 
+        RPointerArray<SECssID> iSecSSID;
+        
+        
+        // The operation mode of the WLAN network.
+        TUint32 iNetMode;
+        
+        // The Security mode of the WLAN network.
+        TUint32 iSecMode;
+        
+        // The ascii formed pre-shared key.
+        CWPParameter* iWpaPresKeyAsc;
+                
+        // The wep authentication mode
+        CWPParameter* iWepAuthMode;
+        
+        // Indicates the default wepkey
+        TUint iDefaultWepKeyIndex;
+        
+        // WEPKEY characteristic parameters
+        
+        // The lenght of the wepkey
+        CWPParameter* iWepKeyLength;
+
+        // The index of the wepkey
+        TUint iWepInd;
+        
+        // The wepkey data
+        CWPParameter* iWepKeyData;
+        
+        // Type of authentication (EAuthOpen, EAuthShared)
+        TWEPAuthentication iAuthentication;
+
+        // Data of the key
+        TBuf8<KMaxLengthOfKeyData> iKeyData[KMaxNumberofKeys];
+        
+        // Format of the key
+        TAPWEPKeyFormat iKeyFormat[KMaxNumberofKeys];
+        
+        RPointerArray<CEapTypeElement> iEapTypeArray;      
+        
+		// Pointer to Linger value parameter. Refs.
+		CWPParameter*   iLinger;
+
+		//linger value
+		TUint iLingerValue;
+		TBool iLingerFlag;
+		
+		// Pointer to the used CMManager, needed to save WLAN data
+		RCmManagerExt* iCm;
+		
+		//Internet parameter Indicator
+    TInt iInternetIndicator;
+
+	private: // For testing usage.
+		friend class T_CWPAPNapdef;
+		friend class T_CWPAPAdapter;
+		friend class T_WPAPTestUtils;
+	};
+
+#endif	// CWPAPNAPDEF_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPPhysicalProxy.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2002 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:     Defines a class, which holds physical proxy information.
+*
+*/
+
+
+
+
+
+#ifndef CWPAPPHYSICALPROXY_H
+#define CWPAPPHYSICALPROXY_H
+
+// INCLUDES
+
+#include <MWPVisitor.h>
+#include "CWPAPItemBase.h"
+#include <cmconnectionmethodext.h>
+
+// DATA TYPES
+
+enum TWPAPPxAddrType
+	{
+	EPxAddrTypeIPv4 = 1,
+    EPxAddrTypeIPv6,
+	EPxAddrTypeUnsupported // (IPv6, E164, ALPHA are not supported)
+	};
+
+// FORWARD DECLARATIONS
+
+class CWPAPLogicalProxy;
+class CWPAPPort;
+class CWPAPNapdef;
+
+// CLASS DECLARATION
+
+/**
+ * CWPAPPhysicalProxy contains physical proxy information
+ */ 
+class CWPAPPhysicalProxy : public CWPAPItemBase, private MWPVisitor
+	{
+	public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+		* @param aDefaultName The default name of an access point
+        * @param aCharacteristic The PXPHYSICAL characteristic.
+        * @param aPort Reference to a pointer containing PORT of a PXLOGICAL.
+        */
+		static CWPAPPhysicalProxy* NewLC( const TDesC& aDefaultName, 
+            CWPCharacteristic& aCharacteristic, 
+            CWPCharacteristic& aLogicalCharacteristic,
+            CWPAPPort*& aPort );
+
+        /**
+        * Destructor.
+        */
+		~CWPAPPhysicalProxy();
+
+	public: // From CWPAPItemBase
+
+		TBool ValidateL();
+		void AddDataL( RCmConnectionMethodExt& aCmItem );
+        TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+            CWPAPItemBase* aLogicalProxy,
+            CWPAPItemBase* aPhysicalProxy  );
+        const TDesC& Name();
+        void SaveWlanDataL( TUint32 /*aIapId*/, CCommsDatabase& /*aCommsDb*/ ) {};
+        void UpdateLingerL(const TUint32 /*aIapId*/){};
+
+	private: // From CWPAPItemBase. Override default implementation.
+
+		void VisitL( CWPCharacteristic& aElement );		
+		void VisitL( CWPParameter& aElement );	
+		void VisitLinkL( CWPCharacteristic& aCharacteristic );
+
+	private:  // New functions
+
+        /**
+        * C++ default constructor.
+		* @param aDefaultName The default name of an access point
+        * @param aPort Reference to a pointer containing PORT of a PXLOGICAL.
+        */
+		CWPAPPhysicalProxy( const TDesC& aDefaultName, 
+            CWPCharacteristic& aLogicalCharacteristic,
+            CWPAPPort*& aPort );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+		
+	private: // Data
+
+		/// Pointer to data model parameter. Refs.
+		CWPParameter* iProxyAddr;
+
+        /// Pointer to data model parameter. Refs.
+        CWPParameter* iName;
+
+		/// Proxy address type
+		TWPAPPxAddrType iPxAddrType;
+
+		/// Pointer to port object. Owns.
+		CWPAPPort* iPort;
+
+        /// Pointer to port object owned by logical proxy. Refs.
+        CWPAPPort*& iLogicalPort;
+
+        /// Napdefs linked to by PXPHYSICAL
+        RPointerArray<CWPAPNapdef> iNapdefs;
+
+        /// Pointer to characteristic
+        CWPCharacteristic& iLogicalCharacteristic;
+
+	private: // For testing
+
+		friend class T_CWPAPLogicalProxy;
+		friend class T_CWPAPAdapter;
+		friend class T_WPAPTestUtils;
+	};
+
+#endif	// CWPAPPHYSICALPROXY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPPort.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2002 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:     Defines a class, which holds proxy port information.
+*
+*/
+
+
+
+
+
+#ifndef CWPAPPORT_H
+#define CWPAPPORT_H
+
+// INCLUDES
+
+#include <MWPVisitor.h>
+#include "CWPAPItemBase.h"
+
+// FORWARD DECLARATIONS
+
+class CApAccessPointItem;
+
+// CLASS DECLARATION
+
+/**
+ * CWPAPPort contains port information
+ */ 
+class CWPAPPort : public CWPAPItemBase, private MWPVisitor
+	{
+	public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aCharacteristic The PORT characteristic
+        */
+		static CWPAPPort* NewLC( CWPCharacteristic& aCharacteristic );
+
+        /**
+        * Destructor.
+        */
+		virtual ~CWPAPPort();
+
+	public: // From CWPAPItemBase 
+
+		TBool ValidateL();
+		void AddDataL( RCmConnectionMethodExt& aCmItem ); //CMManager
+        TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+                        CWPAPItemBase* aLogicalProxy,
+                        CWPAPItemBase* aPhysicalProxy );
+        const TDesC& Name();
+        void SaveWlanDataL( TUint32 /*aIapId*/, CCommsDatabase& /*aCommsDb*/ ) {};
+        void UpdateLingerL(const TUint32 /*aIapId*/){};
+
+	private: // From MWPVisitor
+
+		void VisitL(CWPCharacteristic& aCharacteristic);
+		void VisitL(CWPParameter& aParameter);
+        void VisitLinkL( CWPCharacteristic& /*aLink*/ ) {};
+		
+	private:  // New functions
+		
+        /**
+        * Constructor.
+        */
+		CWPAPPort();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+		
+		/**
+		* Helper method to set the internal values.
+		* @param aConnectionSecurity sets value for iConnectionSecurity.
+		* @param aSessionMode sets value for iSessionMode.
+		* @param aReceivedField marks the field as received
+		*/
+		void SetValues( TBool aConnectionSecurity, 
+			            TInt aSessionMode,
+			            TMarkedField aReceivedField );
+
+	private:  // Data
+
+        /// ETrue if secure connection should be established
+		TBool           iConnectionSecurity;
+        /// Session mode for WAP connections: connection oriented/less.
+		TInt            iSessionMode;
+		/// Pointer to port number parameter. Refs.
+		CWPParameter*   iPortNbr;
+
+	private:
+		friend class T_CWPAPProxyData;
+		friend class T_CWPAPAdapter;
+		friend class T_WPAPTestUtils;
+	};
+
+#endif // CWPAPPORT_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/ProvisioningDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,194 @@
+/*
+* 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 file defines logging macros for Provisioning
+*
+*/
+
+
+
+
+
+
+#ifndef PROVISIONINGDEBUG_H
+#define PROVISIONINGDEBUG_H
+
+#include <e32debug.h> 
+#include <f32file.h>
+
+//Examples
+//FLOG( _L( "[Provisioning] ProvisioningEngine::ConstructL:" ) );
+//FTRACE(RDebug::Print(_L("[Provisioning] ProvisioningEngine::ConstructL: err (%d)"), err));
+#ifdef _DEBUG
+
+const TInt KBTHexDumpWidth=16;
+const TInt KBTLogBufferSize=100;
+const TText KFullStopChar='.';
+
+_LIT(KBTFirstFormatString,"%04x: ");
+_LIT(KBTSecondFormatString,"%02x ");
+_LIT(KBTThirdFormatString,"%c");
+_LIT(KBTThreeSpaces,"   ");
+_LIT(KBTSeparator," ");
+
+inline void HexDump(const TUint8* aPtr, TInt aLen)
+    {
+	if( aPtr != NULL )
+	    {
+    	TBuf<KBTLogBufferSize> line;
+	    TInt i = 0;
+
+    	while (aLen>0)
+    		{
+    		TInt n = (aLen>KBTHexDumpWidth ? KBTHexDumpWidth : aLen);
+    		line.AppendFormat(KBTFirstFormatString,i);
+    		TInt j;
+    		for (j=0; j<n; j++)
+    			line.AppendFormat(KBTSecondFormatString,aPtr[i+j]);
+    		while (j++<KBTHexDumpWidth)
+    			line.Append(KBTThreeSpaces);
+    		line.Append(KBTSeparator);
+    		for (j=0; j<n; j++)
+    			line.AppendFormat(KBTThirdFormatString,(aPtr[i+j]<32 || aPtr[i+j]>126 || aPtr[i+j]==37) ? KFullStopChar : aPtr[i+j]);
+
+    		RDebug::Print(line);
+
+            line.Zero();
+    		aLen-=n;
+    		i+=n;
+    	    }
+        }
+    }
+
+
+// ------------------------------------------
+
+inline void FHex(const TUint8* aPtr, TInt aLen)
+    {
+    HexDump( aPtr, aLen );
+    }
+
+// ------------------------------------------
+
+inline void FHex(const TDesC8& aDes)
+    {
+	RFs fs;
+	RFile file;
+	_LIT( TmpOutputName, "C:\\provisioning.wbxml" );
+	fs.Connect();
+	CleanupClosePushL(fs);
+	//if( aFile.Open(aFileSession, TmpOutputName(), EFileShareAny|EFileWrite) == KErrNone )
+	file.Replace(fs, TmpOutputName(), EFileShareAny|EFileWrite);
+	CleanupClosePushL(file);
+	TInt pos(0);
+	file.Seek(ESeekEnd, pos);
+//	HBufC8* tmp = HBufC8::NewLC(line.Size());
+//	TPtr8 ptr = tmp->Des();
+//	ptr.Copy(line);
+	TInt result = file.Write(aDes);
+	CleanupStack::PopAndDestroy(2); // file,  fs
+///////////////////////////////////////////////////
+
+//    HexDump(aDes.Ptr(), aDes.Length());
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT( KLogFile, "Provisioning.log" );
+_LIT( KLogDirFullName, "c:\\logs\\" );
+_LIT( KLogDir, "Provisioning" );
+
+#define FLOG( a )   { FPrint(a); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,
+                              KLogFile,
+                              EFileLoggingModeAppend,
+                              aFmt,
+                              list );
+    }
+
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+/*#include <e32svr.h>
+
+#define FLOG( a )   { RDebug::Print( a ); }
+#define FTRACE( a ) { a; }
+
+*/
+
+//////////////MIKA///////////////
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT( KLogFile, "Provisioning.log" );
+_LIT( KLogDirFullName, "c:\\logs\\" );
+_LIT( KLogDir, "Provisioning" );
+
+#define FLOG( a )   { FPrint(a); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,
+                              KLogFile,
+                              EFileLoggingModeAppend,
+                              aFmt,
+                              list );
+    }
+
+//////////////MIKA///////////////
+
+
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG( a )
+#define FTRACE( a )
+
+#endif // _DEBUG
+
+///////// Kailash ///////////////////////
+inline void LOGX(TInt aSource)
+	{
+		HBufC *iMyBufNumber = HBufC::NewLC(255);
+   		TPtr bufNumberPtr(iMyBufNumber->Des());
+   		bufNumberPtr.FillZ();
+   		bufNumberPtr.AppendFormat(_L("%d"),aSource);
+    	FLOG(iMyBufNumber->Des());
+    	CleanupStack::PopAndDestroy();
+	}
+///////// Kailash ///////////////////////
+	
+#endif      // PROVISIONINGDEBUG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPAdapter.pan	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2002 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:    Panic codes for Provisioning accesspoint adapter
+*
+*/
+
+
+
+
+
+#ifndef WPAPADAPTER_PAN
+#define WPAPADAPTER_PAN
+
+enum TWPAPAdapterPanicCodes
+    {
+	EDebugCode = 1000,
+	EIllegalCharacteristic,
+	EIllegalState,
+	EIndexOutOfBounds,
+	ENullPointer,
+	EPreConditionFail,
+	EPostConditionFail, 
+	ESaveOperationAlreadyActive,
+	ENoUniqueNameResolved
+    };
+
+GLDEF_C void Panic( TInt aPanic );
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPDefs.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2005-2006 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:     Definitions to WPAPAdapter
+*
+*/
+
+
+
+
+
+#ifndef WPAPDEFS_H
+#define WPAPDEFS_H
+
+#include <e32base.h>
+
+// CONSTANTS
+
+const TUint32 KMaxWEPKeyLength = 29;
+// The maximum WPA Pre-Shared Key length.
+const TUint KMaxWpaPskLength = 63;
+// same as connection name max length in Prov req.
+const TInt KNameMaxLength = 30;
+const TInt KTwoNameServersPerNetworkType = 2;
+// The maximum length of key data
+const TUint KMaxLengthOfKeyData = 58;
+const TUint KMaxLengthOfEapList = 50;
+const TUint KExpandedEapIdLength = 8;
+// Number of keys
+const TUint KMaxNumberofKeys = 4;
+
+const TInt KInitialArraySize = 3;
+
+const TUint KMaxSubKeyLenght = 255;
+
+_LIT(KIPV4, "IPV4");
+_LIT(KIPV6, "IPV6");
+_LIT(KCLWSP, "CL-WSP");
+_LIT(KCOWSP, "CO-WSP");
+_LIT(KCLSECWSP, "CL-SEC-WSP");
+_LIT(KCOSECWSP, "CO-SEC-WSP");
+_LIT(K9200, "9200");
+_LIT(K9201, "9201");
+_LIT(K9202, "9202");
+_LIT(K9203, "9203");
+_LIT(K80, "80");
+_LIT(K8080, "8080");
+_LIT(K443, "443");
+
+_LIT(KGSMGPRS, "GSM-GPRS");
+
+//Characteristic WLAN
+_LIT(KWLAN, "WLAN");
+_LIT(PRISSID, "PRI-SSID");
+_LIT(PRIUSSID, "PRI-U-SSID");
+_LIT(PRIHSSID, "PRI-H-SSID");
+
+//Characteristic WLAN/SEC-SSID
+_LIT(SECSSID, "SEC-SSID");
+_LIT(SSSID, "S-SSID");
+_LIT(SUSSID, "S-U-SSID");
+
+_LIT(NETMODE, "NETMODE");
+_LIT(SECMODE, "SECMODE");
+
+//Characteristic WLAN/EAP
+_LIT(KEAP, "EAP");
+_LIT(EAPTYPE, "EAPTYPE");
+_LIT(EAPUSERNAME, "USERNAME");
+_LIT(EAPPASSWORD, "PASSWORD");
+_LIT(EAPREALM, "REALM");
+_LIT(EAPUSEPSEUD, "USE-PSEUD");
+_LIT(EAPMAXAUTHS, "MAXAUTHS");
+_LIT(EAPENCAPS, "ENCAPS");
+_LIT(EAPVERSERREALM, "VER-SER-REALM");
+_LIT(EAPCLIENTHAUTH, "CLIENTH-AUTH");
+_LIT(EAPSESVALTIME, "SES-VAL-TIME");
+_LIT(EAPCIPSUIT, "CIP-SUIT");
+_LIT(EAPPEAPV0, "PEAP-V0");
+_LIT(EAPPEAPV1, "PEAP-V1");
+_LIT(EAPPEAPV2, "PEAP-V2");
+
+//Characteristic WLAN/EAP/CERT
+_LIT(KCERT, "CERT");
+_LIT(EAPISSNAME, "ISS-NAME");
+_LIT(EAPSUBNAME, "SUB-NAME");
+_LIT(EAPCERTTYPE, "CERT-TYPE");
+_LIT(EAPSERNUM, "SER-NUM");
+_LIT(EAPSUBKEYID, "SUB-KEY-ID");
+_LIT(EAPTHUMBPRINT, "THUMBPRINT");
+
+_LIT(EAPCERTUSER, "USER");
+_LIT(EAPCERTCA, "CA");
+
+_LIT(WPAPRESKEYASC, "WPA-PRES-KEY-ASC");
+_LIT(WPAPRESKEYHEX, "WPA-PRES-KEY-HEX");
+_LIT(DEFAULTWEPIND, "WEPKEYIND");
+_LIT(WEPAUTHMODE, "WEPAUTHMODE");
+
+//Characteristic WLAN/WEPKEY
+_LIT(KWEP, "WEPKEY");
+_LIT(WEPKEYLENGTH, "LENGTH");
+_LIT(WEPKEYINDEX, "INDEX");
+_LIT(WEPKEYDATA, "DATA");
+
+_LIT(KPAP, "PAP");
+_LIT(KCHAP, "CHAP");
+_LIT(KMD5, "MD5");
+_LIT(KANALOGMODEM, "ANALOG-MODEM");
+_LIT(KV110, "V.110");
+_LIT(KV120, "V.120");
+_LIT(KAUTOBAUDING, "AUTOBAUDING");
+_LIT(K9600, "9600");
+_LIT(K14400, "14400");
+_LIT(K19200, "19200");
+_LIT(K28800, "28800");
+_LIT(K38400, "38400");
+_LIT(K43200, "43200");
+_LIT(KIPv6, "IPv6");
+_LIT(KIPv4, "IPv4");
+_LIT(KAddrTypeE164, "E164");
+_LIT(KAddrTypeAPN, "APN");
+
+_LIT(KADHOC, "ADHOC");
+
+_LIT(KWEPSEC, "WEP");
+_LIT(KWPASEC, "WPA");
+_LIT(KWPA2SEC, "WPA2");
+_LIT(K8021XSEC, "8021X");
+_LIT(KWPAPRESSEC, "WPA-PRESHARED-KEY");
+_LIT(KWPA2PRESSEC, "WPA2-PRESHARED-KEY");
+
+
+_LIT(KEAPSIM, "EAP-SIM");
+_LIT(KEAPAKA, "EAP-AKA");
+_LIT(KEAPTLS, "EAP-TLS");
+_LIT(KEAPPEAP, "EAP-PEAP");
+_LIT(KEAPTTLS, "EAP-TTLS");
+_LIT(KEAPLEAP, "EAP-LEAP");
+_LIT(KEAPMSCHAPV2, "EAP-MSCHAPV2");
+_LIT(KEAPGTC, "EAP-GTC");
+_LIT(KEAPFAST, "EAP-FAST");
+
+/*
+_LIT8(KEapNone,"0");
+_LIT8(KEapGtc,"6");
+_LIT8(KEapTls, "13"); 
+_LIT8(KEapLeap,"17");
+_LIT8(KEapSim,"18");
+_LIT8(KEapTtls,"21");
+_LIT8(KEapAka,"23");
+_LIT8(KEapPeap,"25");
+_LIT8(KEapMschapv2,"26");
+_LIT8(KEapSecurid,"32");
+_LIT8(KEapFast,"43");
+*/
+_LIT8(KEapAll,"-017,-018,-023,-013,-025,-021,-043" );
+
+const TUint8 KEapNoneId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+const TUint8 KEapTlsTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d};
+const TUint8 KEapGtcTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06};
+const TUint8 KEapLeapTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11};
+const TUint8 KEapSimTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12};
+const TUint8 KEapTtlsTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15};
+const TUint8 KEapAkaTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17};
+const TUint8 KEapPeapTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19};
+const TUint8 KEapMschapv2TypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A};
+const TUint8 KEapSecuridTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20};
+const TUint8 KEapFastTypeId[] = {0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B};
+
+
+const TUint8 KEapPlus = '+'; 
+
+_LIT(KWEPAUTHMODEOPEN, "OPEN");
+_LIT(KWEPAUTHMODESHARED, "SHARED");
+
+enum TWEPAuthentication
+    {
+    EAuthOpen,              // Open authentication
+    EAuthShared             // Shared authentication
+    };
+    
+// DATA TYPES
+
+/**
+* Data structure for storing a WEP key.
+*/
+struct TWep
+    {
+    /** Specifies which key to add or remove. Range: 0-3 */
+    TUint32 KeyIndex;
+    /** The length of KeyMaterial in bytes. Range: 0-29 */
+    TUint32 KeyLength;
+    /** Array that stores the WEP key. */
+    TUint8 KeyMaterial[KMaxWEPKeyLength];
+    };
+
+/**
+* Data structure for storing a WPA Pre-Shared Key.
+*/
+struct TWpaPsk
+	{
+	/** The length of KeyMaterial in bytes. Range: 0-63 */
+	TUint KeyLength;
+	/** Array of that stores the WPA Pre-Shared Key. */
+	TUint8 KeyMaterial[KMaxWpaPskLength];
+	};
+
+
+
+#endif // WPAPDEFS_H
+
+// End of File.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPSharedDataKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002 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:     Shared data keys for operator AP settings
+*
+*/
+
+
+
+
+
+#ifndef WPAPSHAREDDATAKEYS_H
+#define WPAPSHAREDDATAKEYS_H
+
+// CONSTANTS
+
+// -----------------------------------------------------------------------------
+// AP Operator setting 0x101F466B
+// -----------------------------------------------------------------------------
+
+const TUid KSDUidOperatorSettings = {0x101F466B};
+
+/**
+* Modification of locked APs via OTA allowed 
+*
+* Possible values:
+* 0 (no)
+* 1 (yes)
+*
+* Default value: 0
+**/
+_LIT( KOsOtaModificationAllowed, "A" );
+
+#endif // WPAPSharedDataKeys_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPUtil.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2002 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:     Class offers common utility methods.
+*
+*/
+
+
+
+
+
+#ifndef WPAPUTIL_H
+#define WPAPUTIL_H
+
+// INCLUDES
+
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+ * WPAPUtil offers common helper methods.
+ */ 
+class WPAPUtil
+	{
+	public: // New methods
+
+		/**
+		* Loads a specified resource string from resource file.
+		* @param aResourceId is of a resource string.
+		* @return pointer to loaded descriptor.
+		*/
+		static HBufC* ReadHBufCL( TInt aResourceId );
+
+	};
+
+#endif // WPAPUTIL_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPAccesspointItem.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,320 @@
+/*
+* Copyright (c) 2002 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:   Class stores data for one accesspoint
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "CWPAPAccesspointItem.h"		// Own header
+
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <CWPAdapter.h>
+
+
+#include <bldvariant.hrh>
+#include <featmgr.h>					// Feature manager
+#include <CWPAdapter.h>					// Leave code for protected	
+#include "CWPAPItemBase.h"
+#include "CWPAPNapdef.h"
+#include "WPAPAdapter.pan"
+#include "ProvisioningDebug.h"
+#include <cmconnectionmethodext.h>
+#include <cmmanagerext.h>
+#include <cmpluginpacketdatadef.h> 
+#include <cmpluginwlandef.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::NewLC
+// -----------------------------------------------------------------------------
+CWPAPAccesspointItem* CWPAPAccesspointItem::NewLC(
+                                            const TDesC& aDefaultName,
+                                            CWPAPItemBase* aLogicalProxy,
+                                            CWPAPItemBase* aPhysicalProxy,
+                                            CWPAPItemBase* aNapdef,
+                                            CWPCharacteristic& aCharacteristic )
+	{
+	CWPAPAccesspointItem* self = 
+                        new(ELeave) CWPAPAccesspointItem( aDefaultName, 
+                                                          aLogicalProxy,
+                                                          aPhysicalProxy,
+                                                          aNapdef,
+                                                          aCharacteristic ); 
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPAPAccesspointItem::~CWPAPAccesspointItem()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPAPAccesspointItem::Name() const
+	{
+	if ( iLogicalProxy && iLogicalProxy->Name() != KNullDesC )
+        {
+        return iLogicalProxy->Name();
+		}
+    else if( iPhysicalProxy && iPhysicalProxy->Name() != KNullDesC )
+        {
+        return iPhysicalProxy->Name();
+        }
+    else if( iNapdef && iNapdef->Name() != KNullDesC )
+        {
+        return iNapdef->Name();
+        }
+	else
+		{
+		return iDefaultName;
+		}
+	}
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::NapDef
+// -----------------------------------------------------------------------------
+//
+CWPAPItemBase* CWPAPAccesspointItem::NapDef()
+	{
+	return iNapdef;
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::SetCMManager
+// -----------------------------------------------------------------------------
+//
+void CWPAPAccesspointItem::SetCMManager( RCmManagerExt* aCm )
+	{
+	iCmManager = aCm;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::Characteristic
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPAccesspointItem::Characteristic()
+	{
+	return iCharacteristic.Type();
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::SaveL
+// -----------------------------------------------------------------------------
+//
+TUint32 CWPAPAccesspointItem::SaveL( CCommsDatabase& aCommsDb )
+	{
+	FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::SaveL:" ) );
+	
+	if ( FeatureManager::FeatureSupported( KFeatureIdSettingsProtection ) )
+		{
+		// This protection check is no longer needed since CMManager 
+		// initiates the transactions to the database
+		/*if( CApProtHandler::IsTableProtectedL( &aCommsDb ) )
+			{
+			// Table protected -> leave with specific code.
+			User::Leave( EWPAccessPointsProtected );
+			}*/	
+		}
+
+	  TUint32 iap = 0;
+    TRAPD( err,iap = StoreL( aCommsDb ) );
+    if( err == KErrLocked )
+        {
+        err = EWPCommsDBLocked;
+        }
+    User::LeaveIfError( err );
+    return iap;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::StoreL
+// -----------------------------------------------------------------------------
+//
+TUint32 CWPAPAccesspointItem::StoreL( CCommsDatabase& aCommsDb )
+	{
+	FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL:" ) );
+    
+    // CMManager
+    // Create the cmIten, give the bearer as parameter if it is available
+    RCmConnectionMethodExt cmItem;
+    TBool created = EFalse;
+    TUint bearer;
+    TInt err(KErrNone);
+    
+    // If the NapDef object exists and the bearer is defined, then we can
+    // create the connection method using the bearer
+    if ( iNapdef != NULL )
+    	{
+    	bearer = static_cast<CWPAPNapdef*>(iNapdef)->Bearer();
+    	if ( bearer != 0 )
+    		{
+    		cmItem = iCmManager->CreateConnectionMethodL(bearer);
+    		created = ETrue;
+    		}
+    	}
+    	
+    // If the bearer id is not known we will use packet data
+    if ( !created)
+    	{
+    	cmItem = iCmManager->CreateConnectionMethodL(KUidPacketDataBearerType);
+    	}
+    // Create the connection method into the DB
+    TRAP( err,cmItem.UpdateL() );
+    // Leave if the creation fails for some reason
+    if(err!=KErrNone)
+		{
+       	User::Leave(err);
+       	}
+       
+    if( iNapdef )
+        {
+        FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL: napdef" ) );
+        
+        // CMManager 
+        TRAP (err, iNapdef->AddDataL( cmItem ));
+       	TRAP ( err,cmItem.UpdateL() );
+       	// Leave if the update of the parameters fails
+    	if(err!=KErrNone)
+			{
+       		User::Leave(err);
+       		}
+        }
+        
+    if( iLogicalProxy )
+        {
+        FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL: logicalproxy" ) );
+        // CMManager 
+        iLogicalProxy->AddDataL( cmItem );
+        TRAP( err,cmItem.UpdateL() );
+        // Leave if the update of the parameters fails
+    	if(err!=KErrNone)
+			{
+       		User::Leave(err);
+       		}
+        }
+
+    if( iPhysicalProxy )
+        {
+        FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL: physicalproxy" ) );
+        // CMManager 
+        iPhysicalProxy->AddDataL( cmItem );
+        TRAP( err,cmItem.UpdateL() );
+        // Leave if the update of the parameters fails
+    	if(err!=KErrNone)
+			{
+       		User::Leave(err);
+       		}
+        }
+
+    FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL: cmItem.UpdateL" ) );
+    
+    // CMManager
+    iUid = cmItem.GetIntAttributeL( CMManager::ECmWapId );
+    
+    TInt test( KErrNone );
+    // Update parameter data to CM
+    TRAP( test,cmItem.UpdateL() );
+    FTRACE(RDebug::Print(_L("[AccessPointAdapter] CWPAPAccesspointItem::StoreL: UpdateL err: %d"), test ));
+    
+    TUint32 cmId = cmItem.GetIntAttributeL( CMManager::ECmId ); 
+    cmItem.Close();
+    
+	if( iNapdef )
+    	{
+		iNapdef->UpdateLingerL(iUid());
+    	}
+       
+
+    FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL: SaveWlanDataL" ) );
+    if( iNapdef )
+        { 
+        // Give CMManager pointer and save WLAN data
+		static_cast<CWPAPNapdef*>(iNapdef)->SetCMManager( iCmManager );
+        iNapdef->SaveWlanDataL( cmId, aCommsDb );
+        }
+    
+    
+    TInt i( 0 );
+    TPtrC8 data( iCharacteristic.Data(i) );
+    while( data != KNullDesC8 )
+        {
+        i++;
+        data.Set( iCharacteristic.Data(i) );
+        }
+        
+    iCharacteristic.SetDataL( iUid, i );
+    
+    FLOG( _L( "[AccessPointAdapter] CWPAPAccesspointItem::StoreL: done" ) );
+    return iUid();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::Uid
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CWPAPAccesspointItem::Uid() const
+	{
+    return iUid;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::DeleteUidData
+// -----------------------------------------------------------------------------
+//
+void CWPAPAccesspointItem::DeleteUidData() const
+	{
+    iCharacteristic.DeleteAllData();
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::CWPAPAccesspointItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPAPAccesspointItem::CWPAPAccesspointItem( const TDesC& aDefaultName,
+                                            CWPAPItemBase* aLogicalProxy,
+                                            CWPAPItemBase* aPhysicalProxy,
+                                            CWPAPItemBase* aNapdef,
+                                            CWPCharacteristic& aCharacteristic )
+                                        : iDefaultName( aDefaultName ),
+                                          iNapdef( aNapdef ),
+                                          iPhysicalProxy( aPhysicalProxy ),
+                                          iLogicalProxy( aLogicalProxy ),
+                                          iCharacteristic( aCharacteristic )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAccesspointItem::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPAPAccesspointItem::ConstructL()
+	{
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,452 @@
+/*
+* Copyright (c) 2002 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:   Main class for handling provisioning accesspoint data
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "CWPAPAdapter.h"			// Own header
+
+#include <CWPCharacteristic.h>
+#include <commdb.h>
+#include <WPAPAdapterResource.rsg>
+#include <featmgr.h>					// Feature manager
+#include "WPAPUtil.h"
+#include "CWPAPAccesspointItem.h"
+#include "CWPAPNapdef.h"
+#include "CWPAPLogicalProxy.h"
+#include "WPAPAdapter.pan"
+#include "CWPLog.h"
+#include "ProvisioningDebug.h"
+#include "WPAPDefs.h"
+#include <cmmanagerext.h>
+#include <cmconnectionmethodext.h>
+#include <WPAdapterUtil.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::CWPAPAdapter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPAPAdapter::CWPAPAdapter() : CWPAdapter(), 
+                               iLinks( KInitialArraySize ), 
+                               iDataItems( KInitialArraySize ), 
+                               iSaveItems( KInitialArraySize )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::ConstructL()
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::ConstructL:" ) );
+	
+	iTitle = WPAPUtil::ReadHBufCL( R_QTN_SM_WML_ACCESSPOINTS );
+	iDefaultName = WPAPUtil::ReadHBufCL( R_QTN_SM_WAPAP_NAME );
+
+	FeatureManager::InitializeLibL();
+	
+	iCmManager = new RCmManagerExt;
+	iCmManager->OpenL();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPAPAdapter* CWPAPAdapter::NewL()
+	{
+	CWPAPAdapter* self = new(ELeave) CWPAPAdapter; 
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPAPAdapter::~CWPAPAdapter()
+	{
+	// Contents of iLinks array are not owned
+    iLinks.Close();
+
+    iDataItems.ResetAndDestroy();
+    iDataItems.Close();
+
+    iSaveItems.ResetAndDestroy();
+    iSaveItems.Close();
+    iAPValue.Reset();
+
+	delete iTitle;
+    delete iDefaultName;
+	delete iCommsDb;
+	
+	if ( iCmManager !=  NULL )
+	    {
+	    iCmManager->Close();
+	    delete iCmManager;
+	    }
+	
+    FeatureManager::UnInitializeLib();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::ItemCount
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPAdapter::ItemCount() const
+	{
+	LOG1("Number of Access points: %d", iSaveItems.Count() );
+	return iSaveItems.Count();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::SummaryTitle
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CWPAPAdapter::SummaryTitle(TInt aIndex) const
+	{
+	__ASSERT_DEBUG( aIndex >= 0 && aIndex < iSaveItems.Count(), 
+		Panic( EIndexOutOfBounds ));
+	// The title is always the same.
+	return *iTitle;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::SummaryText
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CWPAPAdapter::SummaryText(TInt aIndex) const
+	{
+	__ASSERT_DEBUG( aIndex >= 0 && aIndex < iSaveItems.Count(), 
+		Panic( EIndexOutOfBounds ));
+	return iSaveItems[ aIndex ]->Name();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::DetailsL
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPAdapter::DetailsL( TInt /*aItem*/, MWPPairVisitor& /*aVisitor*/)
+	{
+	// Detail view is a feature for later release.
+	return KErrNotSupported;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::SaveL
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::SaveL( TInt aItem )
+	{
+    FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::SaveL:" ) );
+
+	__ASSERT_DEBUG(aItem >= 0 &&
+		aItem < iSaveItems.Count(), 
+		Panic( EPreConditionFail ));
+
+    TBool internetparmfound = EFalse;
+    TInt err1;
+
+    for (TInt i = 0; i < iAPValue.Count(); i++)
+        {
+        if (aItem == iAPValue[i])
+            {
+            internetparmfound = ETrue;
+            break;
+            }
+
+        }
+
+	// Create the commsdb when the save is initiated first time.
+	// This stays alive until the adapter is destroyed.
+	if ( !iCommsDb )
+		{
+		iCommsDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+		}
+
+    if( iAlreadySavedOnce && aItem == 0 )
+        {
+        for( TInt i( 0 ); i < iSaveItems.Count(); i++ )
+            {
+            iSaveItems[i]->DeleteUidData();
+            }
+        }
+    
+    // ********************************************************************************** //            	
+    // ***** check that the napdefs with a certain id are only saved once SKSS-79REKH *** //
+    // ********************************************************************************** //
+    TBool found = EFalse;
+    if (iSaveItems[ aItem ]->Characteristic() == KWPNapDef)
+    	{
+    	
+    	// Get the napdef pointer from the saved items and check that it is not NULL
+    	CWPAPNapdef* napdef = static_cast<CWPAPNapdef*>(iSaveItems[ aItem ]->NapDef());
+
+    	if ( napdef )
+        	{
+        	// Store the id of the NAP that is being saved now
+        	TBufC<KNameMaxLength> napId = napdef->NapId();
+        
+        	// check whether napdef with same id has been already saved.
+        	for ( TInt j( 0 ); j < aItem; j++ )
+        	    {
+        	    // If a napdef is not in question we can move to the next item
+        	    if ( iSaveItems[ j ]->Characteristic() != KWPNapDef)
+        	   		{
+        	    	continue;
+        	    	}
+        	    	
+        	    // Store the pointer to to comparison napdef and make the nap id check if
+        	    // the pointer is other than NULL
+        	    CWPAPNapdef* tmpNap = static_cast<CWPAPNapdef*>(iSaveItems[ j ]->NapDef());
+        	    
+        	    if ( tmpNap != NULL )
+        	        {
+        	        // If the id was found, the napdef with this id is already stored
+        	        if ( tmpNap->NapId() == napId )
+        	        	{
+        	        	found = ETrue;
+        	        	break;
+        	 	       	}
+       	         	}
+        	    }
+        	}
+    	}
+        
+    // if access point is not already stored, then we store it
+    if ( !found )
+        {
+        TUint32 iap = 0;
+        if (internetparmfound)
+            {    
+            // Give pointer to cm manager to access point item
+            iSaveItems[ aItem ]->SetCMManager(iCmManager);
+            TRAPD(err,iap = iSaveItems[ aItem ]->SaveL( *iCommsDb));
+            if(err!=KErrNone)
+			          {
+			          User::LeaveIfError(err);	
+			          }
+			          
+			     TRAP(err1, WPAdapterUtil::SetAPDetailsL(iap));
+			     if (err1 == KErrNone)
+               {
+               iAlreadySavedOnce = ETrue;
+               }
+           }
+			   
+			   if (!internetparmfound || (internetparmfound && err1 != KErrNone))
+             {     
+             // Give pointer to cm manager to access point item
+            iSaveItems[ aItem ]->SetCMManager(iCmManager);
+            TRAPD(err,iap = iSaveItems[ aItem ]->SaveL( *iCommsDb));
+            if(err!=KErrNone)
+			          {
+			          User::LeaveIfError(err);	
+			          }
+			      iAlreadySavedOnce = ETrue;
+            }
+        }
+  FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::SaveL: done" ) );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPAdapter::CanSetAsDefault( TInt /*aItem*/ ) const
+	{
+	return EFalse;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::SetAsDefault
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::SetAsDefaultL( TInt /*aItem*/ )
+	{
+	// This shouldn't be called because CanSetAsDefault
+	// always returns EFalse.
+	Panic( EPreConditionFail );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::VisitL( CWPCharacteristic& aCharacteristic )
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::VisitL:" ) );
+	
+	TInt type = aCharacteristic.Type();
+
+	if ( type == KWPApplication )
+		{
+		FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::VisitL: KWPApplication" ) );
+		aCharacteristic.AcceptL( *this );
+		}
+	// Check every NAPDEF characteristic. If it contains INTERNET
+	// parameter then new access point is created from NAPDEF data.
+	else if ( type == KWPNapDef && !IsAlreadyLinked( aCharacteristic ) )
+		{
+		FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::VisitL: KWPNapDef" ) );
+        CWPAPNapdef* item = CWPAPNapdef::NewLC( EFalse, 
+            *iDefaultName, 
+            aCharacteristic,
+            aCharacteristic );
+        if( item->AddItemsL( iSaveItems, NULL, NULL ) > 0 )
+            {
+            User::LeaveIfError( iLinks.InsertInAddressOrder( &aCharacteristic ) );
+            }
+        User::LeaveIfError( iDataItems.Append( item ) );
+        
+       
+    TInt val = item->GetInternetIndicator();
+    if (val != -1)
+        {
+        iAPValue.Append(val);
+        }
+    CleanupStack::Pop( item );
+		}
+		FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::VisitL:done" ) );
+
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::VisitL( CWPParameter& /*aParameter*/ ) 
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::VisitLinkL( CWPCharacteristic& aCharacteristic )
+	{
+    if( !IsAlreadyLinked( aCharacteristic ) )
+        {
+        switch( aCharacteristic.Type() )
+            {
+            // This is link in APPLICATION characteristic to certain NAPDEF or LOGICAL proxy
+            case KWPPxLogical:
+                {
+                CWPAPLogicalProxy* item = CWPAPLogicalProxy::NewLC( 
+                    *iDefaultName, aCharacteristic );
+                item->AddItemsL( iSaveItems, NULL, NULL );
+                User::LeaveIfError( iLinks.InsertInAddressOrder( &aCharacteristic ) );
+                User::LeaveIfError( iDataItems.Append( item ) );
+                CleanupStack::Pop( item );
+                break;
+                }
+            case KWPNapDef:
+                {
+                CWPAPNapdef* item = CWPAPNapdef::NewLC( ETrue, 
+                    *iDefaultName, 
+                    aCharacteristic,
+                    aCharacteristic );
+                item->AddItemsL( iSaveItems, NULL, NULL );
+                User::LeaveIfError( iLinks.InsertInAddressOrder( &aCharacteristic ) );
+                User::LeaveIfError( iDataItems.Append( item ) );
+                CleanupStack::Pop( item );
+                break;
+                }
+            }
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::ContextExtension
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPAdapter::ContextExtension( MWPContextExtension*& aContextExtension )
+	{
+	aContextExtension = this;
+	return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::SaveDataL
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CWPAPAdapter::SaveDataL( TInt aIndex ) const
+	{
+	return iSaveItems[ aIndex ]->Uid();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::DeleteL
+// -----------------------------------------------------------------------------
+//
+void CWPAPAdapter::DeleteL( const TDesC8& aSaveData )
+	{
+	if ( !iCommsDb )
+		{
+		iCommsDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+		}
+
+    TPckgBuf<TUint32> uid;
+    if( aSaveData.Length() == uid.MaxLength() )
+        {
+        LOG1( "DeleteL: Deleting %08x", uid() );
+        uid.Copy( aSaveData );
+
+        // CMManager
+        TRAPD( err, iCmManager->ConnectionMethodL( uid()).DeleteL() );
+        
+        LOG1( "DeleteL: Result: %d", err );
+        if( err == KErrLocked )
+            {
+            User::Leave( EWPCommsDBLocked );
+            }
+        else if ( err != KErrNone && err != KErrNotFound )
+            {
+            User::Leave( err );
+            }
+        }
+
+	//CleanupStack::PopAndDestroy( dataHandler );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::Uid
+// -----------------------------------------------------------------------------
+//
+TUint32 CWPAPAdapter::Uid() const
+	{
+    return iDtor_ID_Key.iUid;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPAdapter::IsAlreadyLinked
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPAdapter::IsAlreadyLinked( CWPCharacteristic& aCharacteristic )
+	{
+    return iLinks.FindInAddressOrder( &aCharacteristic ) >= 0;
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPItemBase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 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:    Defines a base class for all the items in WPAPAdapter
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+
+#include "CWPAPItemBase.h"
+#include "WPAPAdapter.pan"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPAPItemBase::~CWPAPItemBase()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// C++ constructor
+// -----------------------------------------------------------------------------
+CWPAPItemBase::CWPAPItemBase( const TDesC& aDefaultName )
+                          : iDefaultName( aDefaultName )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPItemBase::MarkReceived
+// -----------------------------------------------------------------------------
+//
+void CWPAPItemBase::MarkReceived( TMarkedField aField )
+	{
+	iReceivedFieldsFlags |= aField;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPItemBase::IsReceived
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPItemBase::IsReceived( TMarkedField aField )
+	{
+	return ( iReceivedFieldsFlags & aField );
+	}
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPLogicalProxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,269 @@
+/*
+* Copyright (c) 2002 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:    Defines a class, which holds logical proxy information.
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+
+#include "CWPAPLogicalProxy.h"
+#include <e32svr.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include "CWPLog.h"
+#include "CWPAPPhysicalProxy.h"
+#include "CWPAPPort.h"
+#include "WPAPAdapter.pan"
+#include "WPAPDefs.h"
+#include <cmconnectionmethodext.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPAPLogicalProxy* CWPAPLogicalProxy::NewLC( 
+                                        const TDesC& aDefaultName, 
+                                        CWPCharacteristic& aCharacteristic )
+	{
+	CWPAPLogicalProxy* self = new(ELeave) CWPAPLogicalProxy( aCharacteristic, 
+                                                             aDefaultName ); 
+	CleanupStack::PushL( self );
+	self->ConstructL();
+    aCharacteristic.AcceptL( *self );
+	return self;
+	}
+	
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CWPAPLogicalProxy::~CWPAPLogicalProxy()
+	{
+	delete iPort;
+	iPhysicalProxies.ResetAndDestroy();
+	iPhysicalProxies.Close();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::ValidateL
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPLogicalProxy::ValidateL()
+	{
+	// Logical proxy is valid if it contains either one or more
+	// physical proxies
+	return iPhysicalProxies.Count() > 0;
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::AddDataL
+// -----------------------------------------------------------------------------
+//
+void CWPAPLogicalProxy::AddDataL( RCmConnectionMethodExt& aCmItem )
+	{    
+	LOG("--CWPAP CWPAPLogicalProxy::AddDataL begin--");	
+	// This method is called by child physical proxy. 
+
+	// Store name if came along with the document. If missing then access point
+	// name is used.
+	if ( iName )
+		{
+		// CMManager
+		aCmItem.SetStringAttributeL( CMManager::ECmName, iName->Value() );
+		}
+
+	// Store homepage if defined.
+	if ( iHomepage )
+		{
+		// CMManager 
+		TRAPD( err, aCmItem.SetStringAttributeL( CMManager::ECmStartPage, iHomepage->Value() ));
+		
+		LOG2("CWPAP EApWapStartPage, value: %S, err: %d", &iHomepage->Value(), err);
+		User::LeaveIfError( err );
+		}
+
+	// Store port data, which overrides the data stored by child physical proxy.
+
+	if ( iPort )
+		{
+		//CMManager 
+		iPort->AddDataL (aCmItem);
+		
+		}
+	LOG("--CWPAP CWPAPLogicalProxy::AddDataL end--");	
+	}
+
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::AddItemsL
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPLogicalProxy::AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+                                   CWPAPItemBase* /*aLogicalProxy*/,
+                                   CWPAPItemBase* /*aPhysicalProxy*/ ) 
+	{
+    TInt count( 0 );
+    for( TInt i( 0 ); i < iPhysicalProxies.Count(); i++ )
+        {
+        CWPAPPhysicalProxy* pp = iPhysicalProxies[ i ];
+        if( pp->ValidateL() )
+            {
+            count += pp->AddItemsL( aItems, this, NULL );
+            }
+        }
+
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPAPLogicalProxy::Name()
+	{
+	if ( iName )
+		{
+		return iName->Value();
+		}
+	else
+		{
+		return KNullDesC;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPLogicalProxy::VisitL( CWPCharacteristic& aCharacteristic )
+	{
+	TInt type = aCharacteristic.Type();
+
+	// KWPPort
+	
+	// One valid port is enough for us.
+	if ( type == KWPPort && !iPort )
+		{
+        CWPAPPort* port = CWPAPPort::NewLC( aCharacteristic );
+
+		if ( port->ValidateL() )
+			{
+			iPort = port;
+			CleanupStack::Pop( port );
+			}
+		else // Data not valid.
+			{
+			CleanupStack::PopAndDestroy( port );
+			}
+		}
+
+	// KWPPxPhysical
+
+	else if ( type == KWPPxPhysical )
+		{
+		CWPAPPhysicalProxy* physicalProxy = CWPAPPhysicalProxy::NewLC( 
+                                                            iDefaultName, 
+                                                            aCharacteristic,
+                                                            iCharacteristic,
+                                                            iPort );
+
+		if ( physicalProxy->ValidateL() )
+			{
+            User::LeaveIfError( iPhysicalProxies.Append( physicalProxy ) );
+			CleanupStack::Pop( physicalProxy );
+			}
+		else // Data not valid.
+			{
+			CleanupStack::PopAndDestroy( physicalProxy );
+			}
+		}
+	else if ( type == KWPPxAuthInfo )
+		{
+		// Not supported
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPLogicalProxy::VisitL( CWPParameter& aParameter)
+	{
+	TInt id = aParameter.ID();
+	const TDesC& value = aParameter.Value();
+
+	if ( value.Length() == 0 )
+		{
+		// No use process zero length value.
+		return;
+		}
+
+	switch ( id )
+		{
+		case EWPParameterStartPage: // iHomepage
+			{
+			if ( !iHomepage )
+				{
+				iHomepage = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterName:
+			{
+			if ( !iName )
+				{
+				iName = &aParameter;
+				}
+			break;
+			}
+		default:
+			{
+			// Just let through
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::CWPAPLogicalProxy
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPAPLogicalProxy::CWPAPLogicalProxy( CWPCharacteristic& aCharacteristic,
+                                      const TDesC& aDefaultName )
+                                    : CWPAPItemBase( aDefaultName ),
+                                      iPhysicalProxies( KInitialArraySize ),
+                                      iCharacteristic( aCharacteristic )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPLogicalProxy::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPAPLogicalProxy::ConstructL()
+	{
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPNapdef.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,2031 @@
+/*
+* Copyright (c) 2002-2008 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:    Class stores data for one accesspoint
+*
+*/
+
+
+
+ 
+// INCLUDE FILES
+
+#include "CWPAPNapdef.h"
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <WPAPAdapterResource.rsg>
+#include <featmgr.h>
+#include <WPAdapterUtil.h>
+#include "CWPAPAccesspointItem.h"
+#include "WPAPAdapter.pan"
+#include <WlanCdbCols.h>
+#include <EapType.h>
+#include <EapSettings.h>
+#include "ProvisioningDebug.h"
+#include <cmconnectionmethodext.h>
+#include <cmpluginpacketdatadef.h>
+#include <cmpluginwlandef.h>
+#include <cmmanagerext.h>
+#include <cmconnectionmethodext.h>
+#include <commdb.h>
+#include <WlanCdbCols.h>
+
+#include <centralrepository.h>
+#include <pdpcontextmanagerinternalcrkeys.h>
+
+const TUint KIapColumn        = 0x00000100;
+const TUint KLingerColumn     = 0x00000200;
+const TUint KColumnMask       = 0xFFFFFF00;
+const TUint KRowMask          = 0x000000FF;
+
+// Delay for comms db begintransaction retry (microseconds)
+const TInt KBeginTransRetryDelay = 1000000; 
+// Maximum number of retries
+const  TInt KBeginTransRetryCount = 7;      
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::NewLC
+// -----------------------------------------------------------------------------
+//
+CWPAPNapdef* CWPAPNapdef::NewLC( TBool aFollowingLink,
+                                 const TDesC& aDefaultName, 
+                                 CWPCharacteristic& aLogicalCharacteristic,
+                                 CWPCharacteristic& aLink )
+	{
+	CWPAPNapdef* self = new(ELeave) CWPAPNapdef( aFollowingLink,
+	                                             aDefaultName,
+                                                 aLogicalCharacteristic ); 
+	CleanupStack::PushL( self );
+	self->ConstructL();
+    aLink.AcceptL( *self );
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+CWPAPNapdef::~CWPAPNapdef()
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::~CWPAPNapdef" ) );
+    
+    iEapTypeArray.ResetAndDestroy();
+    iEapTypeArray.Close();
+    iSecSSID.ResetAndDestroy();
+	iSecSSID.Close();
+    iNameServers.Close();
+  
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::ValidateL
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPNapdef::ValidateL()
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ValidateL" ) );
+	
+    TBool result( ETrue );
+
+	if ( iBearer == KUidWlanBearerType )
+	    {	    	
+	    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ValidateL wlan" ) );
+	    if ( iWlanSupported )
+	    	{	    	
+	    	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ValidateL wlan supported" ) );
+	    	return result;
+	    	}
+	    else
+	    	{
+	   		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ValidateL wlan NOT supported" ) );
+	    	return EFalse;
+	    	}
+	    }
+	    
+	// Received unsupported bearer
+	if( iBearerUnsupported )
+	    {
+	    return EFalse;
+	    }
+	    
+	// Didn't receive a bearer value.
+	if ( iBearer == 0 )
+		{
+    // Access point address type can also tell the bearer
+		if( iAccesspointNameType )
+            {
+            TPtrC addrType( iAccesspointNameType->Value() );
+            if( addrType == KAddrTypeAPN )
+                {
+                iBearer =KUidPacketDataBearerType;
+                }
+            }
+        
+        // If still couldn't determine the bearer, default to GPRS
+        if( iBearer == 0 )
+			{
+			iBearer = KUidPacketDataBearerType;
+			}
+		}
+		        
+    // "NAP-ADDRESS" (Access point name) must be defined
+    if( iAccesspointName )
+        {
+        if( iAccesspointName->Value() == KNullDesC )
+            {
+            return EFalse;
+            }
+        }
+    else
+        {
+        return EFalse;
+        }
+
+	/* 
+	Combinations of authentication type, username and password and corressponding
+	value of prompt for password field. AuthType in this table means that provisioning document
+	contained authtype parameter and it was supported by the implementation.
+	Provisioning document names are used in table.
+	x means that value of the specified parameter is received and it was valid.
+	AuthType received & supported 
+	| AuthName 
+	| | AuthSecret 
+	| |	| "Prompt for Password"
+		  no
+	x     no
+      x   no
+	x x   yes
+        x no
+    x   x yes
+      x x no
+    x x	x no
+	*/
+
+	// Set the "prompt password"-value. See the table above. Value is set to true
+	// only if we have supported authentication type and either username or password
+	// is empty.
+	if ( IsReceived( EWPParameterAuthentication_id ) &&
+	     ( ( !iPassword && iUserName ) ||( iPassword && !iUserName ) ) )
+		{
+		iPromptPassword = ETrue;	
+		}
+
+    // IFNETWORKS is a list of possible protocols that a GPRS access points can be 
+    // used for. 
+    if( iBearer == KUidPacketDataBearerType && IsReceived( EWPParameterIfNetworks_id ) )
+        {
+        TLex lex( iIfNetworks->Value() );
+        lex.Mark();
+        do
+            {
+            TChar ch( lex.Get() );
+
+            if( ( !iPdpType && !ch.IsAlphaDigit() ) || ( !iPdpType && lex.Eos() ) )
+                {
+				if(!lex.Eos())
+					{
+					lex.UnGet();
+					}
+                TPtrC value( lex.MarkedToken() );
+				if( !lex.Eos() )
+					{
+					lex.Inc();
+					}
+                
+                if( value == KIPv6 
+                    && FeatureManager::FeatureSupported( KFeatureIdIPv6 ) )
+                    {
+                    //iPdpType = EIPv6;
+                    // CMManager
+                    iPdpType = RPacketContext::EPdpTypeIPv6;
+                    result = ETrue;
+                    }
+                else if( value == KIPv6 
+                    && !FeatureManager::FeatureSupported( KFeatureIdIPv6 ) )
+                    {
+                    result = EFalse;
+                    }
+                else if( value == KIPv4 )
+                    {
+                    //iPdpType = EIPv4;
+                    // CMManager
+                    iPdpType = RPacketContext::EPdpTypeIPv4;
+                    result = ETrue;
+                    }
+                }
+            } while( !lex.Eos() );
+        }
+
+	return result;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::AddItemsL
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPNapdef::AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+                            CWPAPItemBase* aLogicalProxy,
+                            CWPAPItemBase* aPhysicalProxy ) 
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddItemsL" ) );
+	
+    TInt count( 0 );
+
+    if( ( iFollowingLink || IsReceived( EWPParameterInternet_id ) 
+                         || IsReceived( EWPParameterWlan_id ) )
+                         && ValidateL() )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddItemsL append" ) );
+        CWPAPAccesspointItem* item = CWPAPAccesspointItem::NewLC(
+                                                             iDefaultName,
+                                                             aLogicalProxy,
+                                                             aPhysicalProxy,
+                                                             this,
+                                                             iCharacteristic );
+        User::LeaveIfError( aItems.Append( item ) );
+        //Internet Parameter is received
+        if (IsReceived(EWPParameterInternet_id) && !iFollowingLink)
+            {
+            SetInternetIndicator(aItems.Count() - 1);
+            }
+
+        
+        count++;
+        CleanupStack::Pop( item );
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddItemsL append done" ) );
+        }
+    return count;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::SetInternetIndicator
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::SetInternetIndicator(TInt aValue)
+    {
+    iInternetIndicator = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::GetInternetIndicator
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPNapdef::GetInternetIndicator()
+    {
+    return iInternetIndicator;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::AddDataL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::AddDataL( /*CApAccessPointItem& aAPItem*/ RCmConnectionMethodExt& aCmItem ) 
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddDataL" ) );
+	
+	TInt err( KErrNone );
+
+    if ( iBearer == KUidWlanBearerType )    
+	    {			    	
+	    	if ( iWlanSupported )
+        	{
+        	// CMManager
+        	AddWlanDataL( aCmItem);
+        	}
+        else
+        	{
+        	// WLAN is disabled (or does not exist) in the device.
+        	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddDataL WLAN disabled." ) );
+        	User::Leave( KErrNotSupported );
+        	}
+	    }
+    else
+        {	    
+    	if ( iConnectionName )
+    		{
+    		// CMManager
+    		aCmItem.SetStringAttributeL( CMManager::ECmName, (iConnectionName->Value().Left( KNameMaxLength ))); 
+    		}
+    	else // Use default name
+    		{
+    		// CMManager
+    		aCmItem.SetStringAttributeL( CMManager::ECmName, iDefaultName );
+    		}
+    	
+    	if ( iAccesspointName )
+    		{
+    		if ( iBearer == KUidPacketDataBearerType )
+    			{
+    			// CMManager
+    			TRAP ( err, aCmItem.SetStringAttributeL( CMManager::EPacketDataAPName, iAccesspointName->Value() ));
+                FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL value: %S, err: %d"),
+                                                                     &iAccesspointName->Value(), err));    			                              
+    			}
+    		else
+    			{
+    			// CMManager
+    			TRAP ( err, aCmItem.SetStringAttributeL( CMManager::EDialDefaultTelNum, iAccesspointName->Value() ));
+                FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::EApIspDefaultTelNumber value: %S, err: %d"),
+                			      &iAccesspointName->Value(), err ) );
+    			}
+    		}
+    		
+    	TRAP ( err, aCmItem.UpdateL() );
+
+    	 if ( iUserName )
+    		{
+    		// CMManager
+    		TRAP ( err, aCmItem.SetStringAttributeL( CMManager::EDialLoginName, iUserName->Value() ));
+    		FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL EDialLoginName value: %S, err: %d"),
+    		                    		      &iUserName->Value(), err));
+    		TRAP ( err, aCmItem.SetStringAttributeL( CMManager::EDialIFAuthName, iUserName->Value() ));
+    		FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL EDialIFAuthName value: %S, err: %d"),
+    		                    		      &iUserName->Value(), err));
+    		TRAP ( err, aCmItem.SetStringAttributeL( CMManager::ECmIFAuthName, iUserName->Value() ));
+    		FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL ECmIFAuthName value: %S, err: %d"),
+    		                    		      &iUserName->Value(), err));
+    		}
+    		
+		// CMManager
+    	TRAP ( err, aCmItem.SetBoolAttributeL( CMManager::ECmIFPromptForAuth, iPromptPassword));
+    	FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL ECmIFPromptForAuth value: %d, err: %d"),
+    	                            	      iPromptPassword, err ));
+
+    	if ( iPassword )
+    		{
+    		// CMManager 
+    		TRAP ( err, aCmItem.SetStringAttributeL( CMManager::EDialLoginPassword, iPassword->Value() ));
+    		FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL EDialLoginPassword value: %d, err: %d"),
+    		                		      &iPassword->Value(), err ) );
+    		TRAP ( err, aCmItem.SetStringAttributeL( CMManager::ECmIFAuthPass, iPassword->Value() ));
+    		FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL ECmIFAuthPass value: %d, err: %d"),
+    		                		      &iPassword->Value(), err ) );
+    		}	
+
+		// CMManager
+    	TRAP ( err, aCmItem.SetBoolAttributeL( CMManager::ECmDisablePlainTextAuth, iSecureAuthentication ));
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL EApEApIspDisablePlainTextAuth value: %d, err: %d"),    	                         
+                	                        iSecureAuthentication, err ) );
+                	                        
+			
+        // IPv6 APs always have dynamic phone address
+    	//CMManager
+    	if ( iPhoneIPAddress && iPdpType != RPacketContext::EPdpTypeIPv6 )
+    		{
+    		// CMManager IS CORRECT?
+    		//err = aAPItem.WriteTextL( EApIspIPAddr, iPhoneIPAddress->Value() );
+    		TRAP ( err, aCmItem.SetStringAttributeL( CMManager::ECmIPAddress, iPhoneIPAddress->Value() ));
+    		FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddDataL EApIspIPAddr value: %S, err: %d"),
+                        		     &iPhoneIPAddress->Value(), err ) );
+    		}
+
+		TRAP ( err, aCmItem.UpdateL() );
+        for( TInt i( 0 ); i < iNameServers.Count(); i++ )
+            {
+            WriteDNSAddressL( aCmItem, iNameServers[i]->Value() );
+            }
+		TRAP ( err, aCmItem.UpdateL() );
+        if( FeatureManager::FeatureSupported( KFeatureIdIPv6 )
+            && iPdpType )
+            {
+         	// CMManager
+            TRAP ( err, aCmItem.SetIntAttributeL( CMManager::EPacketDataPDPType, iPdpType ));
+            }
+    
+    if ( err ) err = 0; // prevent compiler warning
+        }
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddDataL" ) );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::AddWlanDataL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::AddWlanDataL( RCmConnectionMethodExt& aCmItem )
+    {
+    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddWlanDataL" ) );
+    
+    if ( !iWlanSupported )
+    	{
+    		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddWlanDataL WLAN NOT supported." ) );
+    		User::Leave( KErrNotSupported);
+    	}
+        
+    TInt err = KErrNone;
+    
+	if ( iConnectionName )
+		{
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddWlanDataL iConnectionName" ) );
+		
+		//Connection name
+		// CMManager
+		aCmItem.SetStringAttributeL( CMManager::ECmName, iConnectionName->Value().Left( KNameMaxLength ) );
+		
+		// CMManager 
+		// Network name
+		aCmItem.SetStringAttributeL( CMManager::EWlanSSID, iConnectionName->Value());
+		
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddWlanDataL iConnectionName err (%d) (%S)"), err, &iConnectionName->Value()));
+				
+		}
+	else // Use default name
+		{
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddWlanDataL iConnectionName default" ) );
+		aCmItem.SetStringAttributeL( CMManager::EWlanSSID, iDefaultName);
+		}
+		   	
+   	//EApWlanNetworkMode Gives network mode, TUint32
+   	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddWlanDataL EApWlanNetworkMode" ) );
+	// CMManager
+   	TRAP ( err, aCmItem.SetIntAttributeL( CMManager::EWlanConnectionMode, iNetMode ));
+   	FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddWlanDataL EApWlanNetworkMode err (%d)"), err));
+        
+    //EApWlanSecurityMode The security mode, TUint32
+    if ( iSecMode == 0 )
+        {
+        // This is needed if Provisioning message does not contain SECMODE parameter
+        // AP does not work if secmode is not set
+        iSecMode = CMManager::EWlanSecModeOpen;
+        }
+        
+    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::AddWlanDataL EApWlanSecurityMode" ) );
+   	// CMManager, securitymode causes error -1, this will be set manually in SaveWlanData
+   	//TRAP ( err, aCmItem.SetIntAttributeL( CMManager::EWlanSecurityMode, iSecMode ));
+    FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::AddWlanDataL EApWlanSecurityMode err (%d)"), err));
+    	
+    if (err)
+        {
+        err = KErrNone;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::WriteDNSAddressL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::WriteDNSAddressL( /*CApAccessPointItem& aAPItem*/ RCmConnectionMethodExt& aCmItem,
+                                    const TDesC& aValue )
+	{
+    // GPRS access points supports IPv6 only if explicitly stated. 
+    // CMManager
+    TBool apSupportsIPv6( iPdpType == RPacketContext::EPdpTypeIPv6 | iBearer != KUidPacketDataBearerType );
+
+    // If IPv6 is supported, write the DNS address as IPv6 if
+    // bearer supports IPv6 and the address format is IPv6    
+    if( FeatureManager::FeatureSupported( KFeatureIdIPv6 )
+        && apSupportsIPv6
+        && WPAdapterUtil::CheckIPv6( aValue ) )
+        {
+        // Two name servers per network type
+        if( iNumIPv6NameServers < KTwoNameServersPerNetworkType )
+            {
+            // CMManager
+            TRAPD (err, aCmItem.SetStringAttributeL( CMManager::TConnectionMethodCommonAttributes( 
+            													( CMManager::ECmIP6NameServer1 ) + iNumIPv6NameServers ), aValue ) );
+            User::LeaveIfError( err );
+            iNumIPv6NameServers++;
+            }
+        }
+     else if( CheckIPv4values( aValue) )
+        {
+        // Two name servers per network type
+        if( iNumIPv4NameServers < KTwoNameServersPerNetworkType )
+            {
+            // CMManager 
+            TRAPD ( err, aCmItem.SetStringAttributeL( CMManager::TConnectionMethodCommonAttributes( 
+            													( CMManager::ECmIPNameServer1 ) + iNumIPv4NameServers ), aValue ) );
+            User::LeaveIfError( err );
+            aCmItem.SetBoolAttributeL( CMManager::ECmIPDNSAddrFromServer, EFalse);
+            iNumIPv4NameServers++;
+            }
+        }
+	}
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::CheckAddressPart
+// -----------------------------------------------------------------------------
+//
+
+TBool CWPAPNapdef:: CheckAddressPart( TLex& aLex )
+    {
+    TBool result( aLex.Peek().IsDigit() );
+    aLex.Inc();
+    if( aLex.Peek().IsDigit() )
+        {
+        aLex.Inc();
+        if( aLex.Peek().IsDigit() )
+            {
+            aLex.Inc();
+            }
+        }
+
+    return result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::CheckIPv4values
+// -----------------------------------------------------------------------------
+//
+
+TBool CWPAPNapdef::CheckIPv4values( const TDesC& aValue )
+{
+	
+	TLex aLex( aValue );
+	return CheckAddressPart( aLex ) 
+        && aLex.Get() == '.'
+        && CheckAddressPart( aLex ) 
+        && aLex.Get() == '.'
+        && CheckAddressPart( aLex ) 
+        && aLex.Get() == '.'
+        && CheckAddressPart( aLex )
+        && aLex.Get() == '\0';
+     
+}
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPAPNapdef::Name()
+	{
+	if ( iConnectionName )
+		{
+		return iConnectionName->Value();
+		}
+	else
+		{
+		return KNullDesC;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::VisitL( CWPCharacteristic& aCharacteristic )
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::VisitL(CWPCharacteristic)" ) );
+	
+	TInt type = aCharacteristic.Type();
+    FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::VisitL(CWPCharacteristic) type (%d)"), type));
+	switch ( type )
+		{
+		case KWPNapAuthInfo:
+		case KWPValidity:				
+			{
+			FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::VisitL(CWPCharacteristic) normal" ) );
+			aCharacteristic.AcceptL( *this );
+			break;
+			}
+		case KWPWLAN:
+		case KWPWepKey:
+			{
+			if( iWlanSupported )
+				{
+					FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::VisitL(CWPCharacteristic) accept WLAN characteristic" ) );
+					aCharacteristic.AcceptL( *this );
+				}
+			}
+		default:
+			{
+			if ( ( ( ( aCharacteristic.Name().Compare( KWLAN ) ) == 0 )    ||
+			     ( ( aCharacteristic.Name().Compare( SECSSID ) ) == 0 )  ||
+			     ( ( aCharacteristic.Name().Compare( KEAP ) ) == 0 )     ||
+			     ( ( aCharacteristic.Name().Compare( KCERT ) ) == 0 )    ||
+			     ( ( aCharacteristic.Name().Compare( KWEP ) ) == 0 ) ) && iWlanSupported )
+			    {
+			    if(aCharacteristic.Name().Compare( KEAP ) == 0)
+			        {
+                    CEapTypeElement* newEap = new (ELeave) CEapTypeElement;
+                    newEap->iEAPSettings = new (ELeave) EAPSettings;
+               	    newEap->iCertificate = new (ELeave) CertificateEntry;
+                    iEapTypeArray.AppendL(newEap);
+			        }
+			    else if(aCharacteristic.Name().Compare( SECSSID ) == 0)
+			        {
+                    SECssID* newsecSSID = new (ELeave) SECssID;
+                    newsecSSID->iSSSID = NULL;
+                    newsecSSID->iSUSSID = NULL;
+                    iSecSSID.AppendL(newsecSSID);
+			        }
+    
+			    aCharacteristic.AcceptL( *this );
+			    }
+			}
+		}
+		
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::VisitL(CWPCharacteristic) done" ) );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::VisitL( CWPParameter& aParameter )
+	{
+	TInt id = aParameter.ID();
+	TPtrC value( aParameter.Value() );
+
+	FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::VisitL(CWPParameter) id: %d value: %S"), id, &value));
+
+	switch ( id )
+		{
+		case EWPParameterName:
+			{
+			if ( !iConnectionName )
+				{
+				iConnectionName = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterBearer:
+			{
+			if ( iBearer != 0 || iBearerUnsupported )
+				{
+				break; // Already received a bearer information
+				}
+
+			if ( value == KGSMGPRS )
+				{
+				iBearer = KUidPacketDataBearerType;
+				}
+			else if ( value == KWLAN && iWlanSupported )
+				{
+				iBearer = KUidWlanBearerType;
+				MarkReceived( EWPParameterWlan_id );
+				}				
+			else
+				{
+				// Unsupported bearer type
+				iBearerUnsupported = ETrue;
+				}
+			break;
+			}
+		case EWPParameterNapAddress:
+			{
+			if ( !iAccesspointName )
+				{
+				iAccesspointName = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterLinger:
+			{
+			iLinger = &aParameter;
+			UdateligerValueL( iLinger );
+			break;
+			}
+		case EWPParameterNapAddrType:
+			{
+			if ( !iAccesspointNameType )
+				{
+				iAccesspointNameType = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterAuthName:
+			{
+			if ( !iUserName )
+				{
+				iUserName = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterAuthSecret:
+			{
+			if ( !iPassword )
+				{
+				iPassword = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterAuthType:
+			{
+			// If already received don't accept
+			if (IsReceived(EWPParameterAuthentication_id))
+				{
+				break;
+				}
+
+			if ( value == KCHAP || value == KMD5 )
+				{
+				iSecureAuthentication = ETrue;
+				MarkReceived( EWPParameterAuthentication_id );
+				}
+			else if ( value == KPAP )
+				{
+				iSecureAuthentication = EFalse;
+				MarkReceived( EWPParameterAuthentication_id );
+				}
+			else
+				{
+				// Not supported...
+				}
+			break;
+			}
+		case EWPParameterLocalAddr: // iPhoneIPAddress
+			{
+			if ( !iPhoneIPAddress )
+				{
+				iPhoneIPAddress = &aParameter;
+				}
+			break;
+			}
+		case EWPParameterDNSAddr:
+			{
+            // All name servers must be stored, as some of them might
+            // be IPv6 and some IPv4
+            User::LeaveIfError( iNameServers.Append( &aParameter ) );
+			break;
+			}
+        case EWPParameterIfNetworks:
+            {
+            if( !iIfNetworks )
+                {
+                iIfNetworks = &aParameter;
+                MarkReceived( EWPParameterIfNetworks_id );
+                }
+            break;
+            }
+        case EWPParameterInternet:
+            {
+            MarkReceived( EWPParameterInternet_id );
+            break;
+            }
+//JMan for WLan
+        case EWPParameterNapID:
+            {
+            if ( !iNapID )
+                {
+                iNapID = &aParameter;
+                }
+            break;
+            }    
+        // Here case 0 are handled the WLAN parameters that are extensions  
+        // to OMA Client Provisioning parameter set.
+        case 0:
+            {
+        if( iWlanSupported )
+        	{
+        	HandleWLanParametersL( aParameter );
+        	}
+        break;
+            }
+//JMan for WLan ends
+		default:
+			{
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::HandleWLanParametersL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::HandleWLanParametersL( CWPParameter& aParameter )
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL" ) );
+	
+	if( !iWlanSupported )
+		{
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL WLAN not supported." ) );
+		User::Leave( KErrNotSupported );
+		}
+	
+	SECssID* scssid = NULL;
+	if( iSecSSID.Count() )
+	{
+		scssid = iSecSSID[iSecSSID.Count()-1];
+	}
+	
+	TPtrC value( aParameter.Value() );
+    if( ( aParameter.Name().Compare( PRISSID ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL iPriSSID" ) );
+        if ( !iPriSSID )
+            {
+            iPriSSID = &aParameter;
+            }
+        }
+    else if( ( aParameter.Name().Compare( PRIUSSID ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL iPriUSSID" ) );
+        if ( !iPriUSSID )
+            {
+            iPriUSSID = &aParameter;
+            }
+        }// else if
+
+    else if( ( aParameter.Name().Compare( PRIHSSID ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL iPriHSSID" ) );
+        if ( !iPriHSSID )
+            {
+            iPriHSSID = &aParameter;
+            }
+        }// else if
+        
+    else if( ( aParameter.Name().Compare( SSSID ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL iPriHSSID" ) );
+        if(scssid!=NULL)
+        	{
+        	scssid->iSSSID = &aParameter;
+        	}
+			  
+
+        }// else if
+
+    else if( ( aParameter.Name().Compare( SUSSID ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL iPriHSSID" ) );
+			  if(scssid!=NULL)
+        	{
+        	scssid->iSUSSID = &aParameter;
+        	}
+        }// else if
+                        
+    else if( ( aParameter.Name().Compare( NETMODE ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL netmode" ) );
+        if ( value == KADHOC )
+			{
+			FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL netmode adhoc" ) );
+			iNetMode = CMManager::EAdhoc;
+			}
+        else // default is INFRA
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL netmode infra" ) );
+            iNetMode =CMManager::EInfra;
+            }
+        }
+
+    else if( ( aParameter.Name().Compare( SECMODE ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode" ) );
+        if ( value == KWEPSEC )
+			{
+			FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode KWEPSEC" ) );
+			iSecMode = CMManager::EWlanSecModeWep;
+			}
+        else if( value == K8021XSEC )
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode K8021XSEC" ) );
+			iSecMode = CMManager::EWlanSecMode802_1x;
+            }
+        else if( value == KWPASEC )
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode KWPASEC" ) );
+
+			iSecMode = CMManager::EWlanSecModeWpa;
+            }
+        else if( value == KWPA2SEC )
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode KWPA2SEC" ) );
+			iSecMode = CMManager::EWlanSecModeWpa2;
+            }
+        else if( value == KWPAPRESSEC )
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode KWPAPRESSEC" ) );
+			iSecMode = CMManager::EWlanSecModeWpa;
+            }
+        else if( value == KWPA2PRESSEC )
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode KWPA2PRESSEC" ) );
+			iSecMode = CMManager::EWlanSecModeWpa2;
+            }          
+        else
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL secmode open" ) );
+			iSecMode = CMManager::EWlanSecModeOpen;
+            }
+        }
+
+    else if( ( aParameter.Name().Compare( WPAPRESKEYASC ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL WPAPRESKEYASC" ) );
+        if ( !iWpaPresKeyAsc )
+            {
+            iWpaPresKeyAsc = &aParameter;
+            }
+        }// else if
+        // indicates the default wepkey index
+    else if( ( aParameter.Name().Compare( DEFAULTWEPIND ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL wepind" ) );
+
+        TLex lex( value );
+        lex.Val( iDefaultWepKeyIndex );
+        if ( iDefaultWepKeyIndex >= 4 )
+            {
+            iDefaultWepKeyIndex = 0;
+            }
+        }// else if
+        
+    else if( ( aParameter.Name().Compare( WEPAUTHMODE ) ) == 0 )
+        {
+        if ( value == KWEPAUTHMODEOPEN )
+			{
+			FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL wepauthmode OPEN" ) );
+			iAuthentication = EAuthOpen;
+			}
+		else if ( value == KWEPAUTHMODESHARED )
+		    {
+		    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL wepauthmode SHARED" ) );
+			iAuthentication = EAuthShared;
+		    }
+        }// else if
+        
+    else if( ( aParameter.Name().Compare( WEPKEYLENGTH ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL WEPKEYLENGTH" ) );
+        if ( !iWepKeyLength )
+            {
+            iWepKeyLength = &aParameter;
+            }
+        }// else if
+    else if( ( aParameter.Name().Compare( WEPKEYINDEX ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL WEPKEYINDEX" ) );
+        TLex lex( value );
+        lex.Val( iWepInd );
+        }// else if 
+    else if( ( aParameter.Name().Compare( WEPKEYDATA ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL WEPKEYDATA" ) );
+
+        if ( iWepInd <  4 )
+            {
+            const TUint8 K40Bits = 5;
+            const TUint8 K104Bits = 13;
+            const TUint8 K232Bits = 29;
+
+            TBuf8<KMaxLengthOfKeyData> buf8;
+            StrCopy( buf8, aParameter.Value() );
+            
+            if(buf8.Length() == K232Bits ||
+                buf8.Length() == K104Bits ||
+                buf8.Length() == K40Bits  )
+                {
+                FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL ASCI Wep Key" ) );
+                HBufC8* buf8Conv = HBufC8::NewLC( KMaxLengthOfKeyData );
+                ConvertAsciiToHex( buf8, buf8Conv );
+                iKeyData[iWepInd] = *buf8Conv;
+                iKeyFormat[iWepInd] = CWPAPNapdef::EAscii;
+                CleanupStack::PopAndDestroy( buf8Conv );
+                }
+            else if( buf8.Length()==K232Bits*2 ||
+                buf8.Length()== K104Bits*2 ||
+                buf8.Length() == K40Bits*2)
+                {
+                FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL HEX Wep Key" ) );
+                iKeyData[iWepInd] = buf8;
+                iKeyFormat[iWepInd] = CWPAPNapdef::EHexadecimal;
+                }
+            }
+        
+        }// else if	
+    
+    // Handle EAP parameter
+    HandleEAPParametersCCL( aParameter );        
+    
+    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleWLanParametersL done" ) );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::HandleEAPParametersL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::HandleEAPParametersCCL( CWPParameter& aParameter )
+    {
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL" ) );
+   	
+   	CEapTypeElement* eap = NULL;
+   	if ( iEapTypeArray.Count() )
+   	    {
+   	    eap = iEapTypeArray[iEapTypeArray.Count()-1];
+   	    }
+   	if(!eap)
+   	    {
+   	    return;
+   	    }    
+   	
+	TPtrC value( aParameter.Value() );
+	
+    if( ( aParameter.Name().Compare( EAPTYPE ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPTYPE" ) );
+              
+        ConvertEAPStringToIds( value, eap->iEapTypeString, reinterpret_cast<TUint &> ( eap->iEAPSettings->iEAPType )  );
+        
+        }
+    else if( ( aParameter.Name().Compare( EAPUSERNAME ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPUSERNAME" ) );
+        if ( eap->iEAPSettings->iUsername.Length() == 0 )
+            {
+            eap->iEAPSettings->iUsername = value;
+            eap->iEAPSettings->iUsernamePresent = ETrue;
+            }
+        }// else if 
+    else if( ( aParameter.Name().Compare( EAPPASSWORD ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPPASSWORD" ) );
+        if ( eap->iEAPSettings->iPassword.Length() == 0 )
+            {
+            eap->iEAPSettings->iPassword = value;
+            eap->iEAPSettings->iPasswordPresent = ETrue;
+            }
+        }// else if 
+    else if( ( aParameter.Name().Compare( EAPREALM ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPREALM" ) );
+
+        if ( eap->iEAPSettings->iRealm.Length() == 0 )
+            {
+            eap->iEAPSettings->iRealm = value;
+            eap->iEAPSettings->iRealmPresent = ETrue;
+            }
+        }// else if 
+    else if( ( aParameter.Name().Compare( EAPUSEPSEUD ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPUSEPSEUD" ) );
+        TInt pseudonyms;
+        TLex lex( value );
+        lex.Val( pseudonyms );
+        
+        eap->iEAPSettings->iUsePseudonymsPresent = ETrue;
+        if ( pseudonyms == 1 )
+            {        
+            eap->iEAPSettings->iUsePseudonyms = ETrue;
+            }
+        else
+            {
+            eap->iEAPSettings->iUsePseudonyms = EFalse;            
+            }
+        }// else if 
+    else if( ( aParameter.Name().Compare( EAPMAXAUTHS ) ) == 0 )
+        {
+        // not supported
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPMAXAUTHS" ) );
+        }// else if 
+    else if( ( aParameter.Name().Compare( EAPENCAPS ) ) == 0 )
+        {
+        
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPENCAPS" ) );
+        TUint dummy;
+        ConvertEAPStringToIds( value, eap->iEncapsulatingExpandedEapId, dummy );
+                     
+        }// else if    
+    else if( ( aParameter.Name().Compare( EAPVERSERREALM ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPVERSERREALM" ) );
+        
+        TInt serverRealm;
+        TLex lex( value );
+        lex.Val( serverRealm );
+        
+        eap->iEAPSettings->iVerifyServerRealmPresent = ETrue;
+        
+        if ( serverRealm == 1 )
+            {        
+            eap->iEAPSettings->iVerifyServerRealm = ETrue;
+            }
+        else
+            {
+            eap->iEAPSettings->iVerifyServerRealm = EFalse;            
+            }
+        }// else if    
+    else if( ( aParameter.Name().Compare( EAPCLIENTHAUTH ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPCLIENTHAUTH" ) );
+        
+        TInt clientAuthentication;
+        TLex lex( value );
+        lex.Val( clientAuthentication );
+        
+        eap->iEAPSettings->iRequireClientAuthenticationPresent = ETrue;
+        
+        if ( clientAuthentication == 1 )
+            {        
+            eap->iEAPSettings->iRequireClientAuthentication = ETrue;
+            }
+        else
+            {
+            eap->iEAPSettings->iRequireClientAuthentication = EFalse;            
+            }
+        }// else if    
+    else if( ( aParameter.Name().Compare( EAPSESVALTIME ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPSESVALTIME" ) );
+        
+        TInt sessionValidityTime;
+        TLex lex( value );
+        lex.Val( sessionValidityTime );
+        eap->iEAPSettings->iSessionValidityTime = sessionValidityTime;
+        eap->iEAPSettings->iSessionValidityTimePresent = ETrue;
+
+        }// else if    
+    else if( ( aParameter.Name().Compare( EAPCIPSUIT ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPCIPSUIT" ) );
+        
+        TInt cipherSuites;
+        TLex lex( value );
+        lex.Val( cipherSuites );
+        eap->iEAPSettings->iCipherSuites.Append( cipherSuites );
+        eap->iEAPSettings->iCipherSuitesPresent = ETrue;
+        
+        }// else if
+    else if( ( aParameter.Name().Compare( EAPPEAPV0 ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPPEAPV0" ) );
+        
+        TInt peap;
+        TLex lex( value );
+        lex.Val( peap );
+        
+        eap->iEAPSettings->iPEAPVersionsPresent = ETrue;
+        if ( peap == 1 )
+            {        
+            eap->iEAPSettings->iPEAPv0Allowed = ETrue;
+            }
+        else
+            {
+            eap->iEAPSettings->iPEAPv0Allowed = EFalse;            
+            }
+        }// else if     
+    else if( ( aParameter.Name().Compare( EAPPEAPV1 ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPPEAPV1" ) );
+        TInt peap;
+        TLex lex( value );
+        lex.Val( peap );
+        eap->iEAPSettings->iPEAPVersionsPresent = ETrue;
+        if ( peap == 1 )
+            {        
+            eap->iEAPSettings->iPEAPv1Allowed = ETrue;
+            }
+        else
+            {
+            eap->iEAPSettings->iPEAPv1Allowed = EFalse;            
+            }
+        }// else if
+    else if( ( aParameter.Name().Compare( EAPPEAPV2 ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPPEAPV2" ) );
+        TInt peap;
+        TLex lex( value );
+        lex.Val( peap );
+        eap->iEAPSettings->iPEAPVersionsPresent = ETrue;
+        if ( peap == 1 )
+            {        
+            eap->iEAPSettings->iPEAPv2Allowed = ETrue;
+            }
+        else
+            {
+            eap->iEAPSettings->iPEAPv2Allowed = EFalse;            
+            }
+        }// else if  
+        
+    else if( ( aParameter.Name().Compare( EAPISSNAME ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPISSNAME" ) );
+        
+        eap->iCertificate->iSubjectName = value;
+        eap->iCertificate->iSubjectNamePresent = ETrue;
+        }// else if        
+        
+    else if( ( aParameter.Name().Compare( EAPSUBNAME ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPSUBNAME" ) );
+        
+        eap->iCertificate->iIssuerName = value;
+        eap->iCertificate->iIssuerNamePresent = ETrue;
+       
+        }// else if        
+        
+    else if( ( aParameter.Name().Compare( EAPCERTTYPE ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPCERTTYPE" ) );
+        if ( value == EAPCERTCA )
+			{
+			FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EEapSim" ) );
+            
+            eap->iCertificate->iCertType = CertificateEntry::ECA;
+			}
+		else
+		    {
+		    eap->iCertificate->iCertType = CertificateEntry::EUser;
+		    }
+		// Certificates must be present since this field was added
+		eap->iEAPSettings->iCertificatesPresent = ETrue; 
+        
+        }// else if        
+    else if( ( aParameter.Name().Compare( EAPSERNUM ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPSERNUM" ) );
+        
+        eap->iCertificate->iSerialNumber = value;
+        eap->iCertificate->iSerialNumberPresent = ETrue;
+        }// else if
+        
+    else if( ( aParameter.Name().Compare( EAPSUBKEYID ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPSUBKEYID" ) );
+           
+        _LIT(KHexIdLC, "0x");
+       	_LIT(KHexIdUC, "0X");
+       	TBuf<2> HexIdBuf;
+       	TInt keyLen = aParameter.Value().Length();
+       	
+       	// setting the given key to the key buffer
+       	TBuf<KMaxSubKeyLenght> origKey;
+       	origKey.SetLength(keyLen);
+       	origKey = aParameter.Value();
+       	TBuf<KMaxSubKeyLenght> key;
+       	TLex tmpByte;
+       	TInt err(KErrNone);
+       	TUint16 byte;
+       	
+       	// Remove possible spaces from the beginning
+       	origKey.TrimLeft();
+       	
+       	// if the key is over two chars long, then we have to check
+       	// whether there is 0x or 0X in the beginning
+       	if (origKey.Length() >= 2)
+            {
+        	// Copy the two left most characters in to the buffer
+        	HexIdBuf.Copy(origKey.Left(2));
+        	
+        	// If the first characters are 0x or 0X, then they should be ignored
+        	if (HexIdBuf.Compare(KHexIdLC) == 0
+        			|| HexIdBuf.Compare(KHexIdUC) == 0)
+        		{
+        		// delete two characters
+        		origKey.Delete(0, 2);
+        		}
+            }
+        
+       	// looping the subject key through, removing whitespaces
+       	for (TInt i = 0; i < keyLen; i++)
+       		{
+       		// removing white spaces from the left side of the key
+       		origKey.TrimLeft();
+       		// check that there are characters left
+       		if (origKey.Length() >= 2)
+       			{
+       			// pick the two left most bytes from the key
+       			tmpByte = origKey.Left(2);
+       			// convert byte into binary format
+       			err = tmpByte.Val(byte, EHex);
+       			
+       			// delete two characters from the left side of the character array in the buffer
+       			origKey.Delete(0, 2);
+       			
+       			// check whether conversion to decimal went ok
+       			if (err != KErrNone)
+       				{
+       				// if there are problems, then leave the loop
+       				break;
+       				}
+       			
+       			// store the appended byte into the key variable
+       			key.Append(byte);
+       			}
+       			
+       		else if (origKey.Length() == 1)
+       			{
+       			// pick the left most bytes from the key
+       			tmpByte = origKey.Left(1);
+       			// convert byte into binary format
+       			err = tmpByte.Val(byte, EHex);
+       			
+       			// delete two characters from the left side of the character array in the buffer
+       			origKey.Delete(0, 1);
+       			
+       			// check whether conversion to decimal went ok
+       			if (err != KErrNone)
+       				{
+       				// if there are problems, then leave the loop
+       				break;
+       				}
+       			
+       			// store the appended byte into the key variable
+       			key.Append(byte);
+       			}
+       		else
+       			{
+       			break;
+       			}
+       		}
+       	// store key value only if no errors occurred
+       	if (err == KErrNone) 
+       		{
+       		eap->iCertificate->iSubjectKeyID.Copy(key);
+       		eap->iCertificate->iSubjectKeyIDPresent = ETrue;
+       		eap->iEAPSettings->iCertificatesPresent = ETrue; 
+       		}
+       	}
+       	
+        
+    else if( ( aParameter.Name().Compare( EAPTHUMBPRINT ) ) == 0 )
+        {
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPTHUMBPRINT" ) );
+        eap->iCertificate->iThumbprintPresent = ETrue;
+        eap->iCertificate->iThumbprint = value;
+        }// else if                  
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::CWPAPNapdef
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPAPNapdef::CWPAPNapdef( TBool aFollowingLink,
+                          const TDesC& aDefaultName, 
+                          CWPCharacteristic& aLogicalCharacteristic )
+                        : CWPAPItemBase( aDefaultName ),
+                          iCharacteristic( aLogicalCharacteristic ),
+                          iFollowingLink( aFollowingLink )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::ConstructL()
+	{
+	iLingerValue = NULL;
+	iLingerFlag = ETrue;
+	iInternetIndicator = -1;
+	//checks if Wlan feature is supported
+  FeatureManager::InitializeLibL();
+  iWlanSupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan );
+  FeatureManager::UnInitializeLib();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::SaveWlanDataL
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::SaveWlanDataL( TUint32 aIapId, CCommsDatabase& aCommsDb )
+    {
+    FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL APid: (%d)"),  aIapId) );
+    
+    if ( iBearer == KUidWlanBearerType )
+	    {
+        CCommsDbTableView* wLanServiceTable;
+        
+        // CMManager
+        // Search the Iap Service Id using the received IapId
+        RCmConnectionMethodExt cm = iCm->ConnectionMethodL( aIapId );
+        TUint32 serviceId = cm.GetIntAttributeL( CMManager::ECmIapServiceId );
+     	
+        // The BeginTransaction might fail if someone else has locked CommsDat
+        TInt dberr = aCommsDb.BeginTransaction();
+        if( dberr == KErrLocked )
+            {
+            // Try BeginTransaction again to get lock
+            TInt retry = KBeginTransRetryCount;            
+            while ( retry > 0 && dberr == KErrLocked )
+                {                   
+                User::After(KBeginTransRetryDelay);
+                dberr = aCommsDb.BeginTransaction();
+                FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL: Database locked. BeginTransaction retry." ) );
+                retry--;
+                }
+            if(dberr != KErrNone)
+                {                            
+                // Could not get lock to CommsDat at all
+                FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL: BeginTransaction failed completely." ) );
+                User::Leave( dberr ); 
+                }           
+            }                             
+        
+        TInt indexToSec = 0;
+        wLanServiceTable = aCommsDb.OpenViewMatchingUintLC( 
+                        TPtrC( WLAN_SERVICE ), TPtrC( WLAN_SERVICE_ID ), serviceId );
+        TInt errorCode = wLanServiceTable->GotoFirstRecord();
+
+        if ( errorCode == KErrNone )
+            {
+            indexToSec = serviceId;
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL updaterecord" ) );
+            wLanServiceTable->UpdateRecord();
+            }
+        else
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL insertrecord" ) );
+            TUint32 dummyUid( 0 );
+            User::LeaveIfError( wLanServiceTable->InsertRecord( dummyUid ) );
+
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL WLAN_SERVICE_ID" ) );
+            // Save link to LAN service
+            wLanServiceTable->WriteUintL( TPtrC( WLAN_SERVICE_ID ), aIapId );
+            indexToSec = aIapId;
+            }
+        
+        // Setting the security mode manually, because CMManager does not do that
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_SECURITY_MODE ), iSecMode );
+
+    	if( iSecSSID.Count() )
+			{
+	        CCommsDbTableView* wLanSecserviceTable;
+			wLanSecserviceTable = aCommsDb.OpenTableLC( TPtrC( WLAN_SECONDARY_SSID ) ); 
+			//CleanupStack::Pop(wLanSecserviceTable); // wLanSecserviceTable
+		 	TBuf<4> blank;
+		 	blank.Append(KNullDesC);
+		    
+		    TBool sssid = EFalse;
+	        TBool sussid = EFalse;
+
+	        for(TInt i = 0; i < iSecSSID.Count(); i++ )
+	        	{
+	        	TUint32 id ;
+	        	
+		        
+		        TInt retval = wLanSecserviceTable->InsertRecord(id);
+		        wLanSecserviceTable->WriteUintL(TPtrC(WLAN_SEC_SSID_SERVICE_ID), indexToSec );
+		        wLanSecserviceTable->WriteUintL(TPtrC(WLAN_SEC_SSID_ID), id );
+
+		 	    if( iSecSSID[i]->iSSSID != NULL)
+		 	    sssid = ETrue;
+		 	    if(iSecSSID[i]->iSUSSID != NULL)
+		 	    sussid = ETrue;
+		 	    
+		 	    if((sssid && iSecSSID[i]->iSSSID->Value() != blank) || (sussid && iSecSSID[i]->iSUSSID->Value() != blank ))
+		 	    {
+		 		if( sssid )
+		 		wLanSecserviceTable->WriteTextL(TPtrC(WLAN_SEC_SSID_SCANNED_SSID), iSecSSID[i]->iSSSID->Value());
+			
+				if(sussid)
+				wLanSecserviceTable->WriteTextL(TPtrC(WLAN_SEC_SSID_USED_SSID), iSecSSID[i]->iSUSSID->Value());
+		        
+		 	    }
+		 	    wLanSecserviceTable->PutRecordChanges();
+		 	    sssid = EFalse;
+	            sussid = EFalse;
+	        	}
+	        	CleanupStack::PopAndDestroy( wLanSecserviceTable );
+			}
+			
+			iSecSSID.ResetAndDestroy();
+			iSecSSID.Close();
+        if ( iPriSSID )
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL NU_WLAN_SSID" ) );
+            // Save NU_WLAN_SSID
+        	wLanServiceTable->WriteTextL( TPtrC(NU_WLAN_SSID), iPriSSID->Value() );
+            }
+        if ( iPriUSSID )
+            {        
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL WLAN_USED_SSID" ) );
+            // Save WLAN_USED_SSID	
+    	      wLanServiceTable->WriteTextL( TPtrC(WLAN_USED_SSID), iPriUSSID->Value() );
+            }
+        if ( iPriHSSID )
+            {        
+    	    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL WLAN_SCAN_SSID" ) );
+            // Save WLAN_SCAN_SSID
+    	    wLanServiceTable->WriteBoolL( TPtrC(WLAN_SCAN_SSID), ETrue );
+            }
+        else
+            {
+    	    wLanServiceTable->WriteBoolL( TPtrC(WLAN_SCAN_SSID), EFalse );            	
+            }
+
+       	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL WLAN_WEP_INDEX" ) );
+        // Save index of key in use
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_INDEX ), 
+                                      (TUint32&) iDefaultWepKeyIndex );
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL WLAN_WEP_INDEX: (%d)"),  iDefaultWepKeyIndex) );
+
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL NU_WLAN_AUTHENTICATION_MODE" ) );
+        // Open / Shared (0/1)
+        // Save index of key in use
+        wLanServiceTable->WriteUintL( TPtrC( NU_WLAN_AUTHENTICATION_MODE ), 
+                                     ( TUint32& ) iAuthentication );
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL NU_WLAN_AUTHENTICATION_MODE: (%d)"),  iAuthentication) );
+        
+        
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL NU_WLAN_WEP_KEY1" ) );
+        // Save first WEP key
+        wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY1 ), iKeyData[0] );
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY1_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[0] );
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL (%S)"), &iKeyData[0] ) );
+        
+        
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL NU_WLAN_WEP_KEY2" ) );
+        // Save second WEP key
+        wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY2 ), iKeyData[1] );
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY2_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[1] );
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL (%S)"), &iKeyData[1] ) );
+            
+        
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL NU_WLAN_WEP_KEY3" ) );
+        // Save third WEP key
+        wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY3 ), iKeyData[2] );
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY3_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[2] );
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL (%S)"), &iKeyData[2] ) );
+            
+            
+        
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL NU_WLAN_WEP_KEY4" ) );
+        // Save fourth WEP key
+        wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY4 ), iKeyData[3] );
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY4_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[3] );
+        FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL (%S)"), &iKeyData[3] ) );
+            
+        
+        if ( iWpaPresKeyAsc )
+            {     
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL convert WPAKEY to ascii" ) );
+            // convert unicode to 8-bit ascii
+            TBuf8<KMaxWpaPskLength> wpaKey;
+            StrCopy( wpaKey, iWpaPresKeyAsc->Value() );
+            
+            // Enable WPA Pre Shared key mode
+            wLanServiceTable->WriteBoolL( TPtrC( WLAN_ENABLE_WPA_PSK ), ETrue );
+            
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL WLAN_WPA_PRE_SHARED_KEY" ) );
+            // Save PreShared Key
+            wLanServiceTable->WriteTextL( TPtrC( WLAN_WPA_PRE_SHARED_KEY ), 
+                                         wpaKey );
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteUintL WLAN_WPA_KEY_LENGTH" ) ); 
+            // Save PreShared Key Length
+            wLanServiceTable->WriteUintL( TPtrC( WLAN_WPA_KEY_LENGTH ), 
+                                         wpaKey.Length() );                                         
+            }
+
+        TBuf<KMaxLengthOfEapList> eapList;
+        eapList.Copy(KEapAll);
+
+        for (TInt i=0;i<iEapTypeArray.Count();i++)
+            {
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL save EAP settings" ) );
+            CEapTypeElement* eap = iEapTypeArray[i];
+            
+            if ( eap->iEAPSettings->iCertificatesPresent )
+            	{
+            	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL Certificate was present." ) );
+            	eap->iEAPSettings->iCertificates.AppendL( *eap->iCertificate );	
+            	}                  
+
+            // Save EAP list
+            if ( eap->iEapTypeString.Length() > 0  
+            	 && eap->iEncapsulatingExpandedEapId.Length() == 0) // AND method is not encapsulated
+                {
+                FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL WriteTextL WLAN_EAPS" ) );
+                
+                TBuf8<3> buf;
+                _LIT8(KFormat, "%d");
+                // pick the last byte from the array
+                buf.Format(KFormat, eap->iEapTypeString[KExpandedEapIdLength - 1]);
+                // search for the correct offset for the eap type from the KEapAll literal
+                TInt index = KEapAll().Find(buf);
+                
+                const TUint8 offset = 2; //length = f "-0" string
+                // Add '+' to the correct offset, so that the eap is repsesented activated in the list
+                if(index >= offset)
+                    {
+                    eapList[index-offset] = KEapPlus; 
+                    }
+                
+                }
+            
+			// Set iEncapsulatingEapTypes
+			for ( TInt j = 0; j < iEapTypeArray.Count(); j++ )
+				{
+				// Check if any method has this method as the encapsulating method
+				if ( eap->iEapTypeString == iEapTypeArray[j]->iEncapsulatingExpandedEapId )
+					{
+					// Append this method to iEncapsulatedEAPType
+					eap->iEAPSettings->iEncapsulatedEAPTypes.Append( iEapTypeArray[j]->iEAPSettings->iEAPType );
+					eap->iEAPSettings->iEncapsulatedEAPTypesPresent = ETrue;
+					}
+				}			
+			
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL save EAP settings CEapType::NewL" ) );        
+            CEapType* eapType = NULL;
+
+            TRAPD( error, ( eapType = CEapType::NewL( eap->iEapTypeString, ELan, serviceId ) ) );
+
+            if ( ( error == KErrNone ) && eapType )
+                {
+                CleanupStack::PushL( eapType );
+                
+                // Check if this type is tunneled
+                if ( eap->iEncapsulatingExpandedEapId.Length() > 0 )
+                	{
+                	// It is tunneled. Take the last byte of the expanded id.
+                	eapType->SetTunnelingType( eap->iEncapsulatingExpandedEapId[KExpandedEapIdLength - 1] );
+                	
+                	}
+                
+                FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL save EAP settings SetConfigurationL" ) );
+                TRAP_IGNORE( eapType->SetConfigurationL( *eap->iEAPSettings ) );
+                
+                CleanupStack::PopAndDestroy( eapType );
+                
+                }
+            else
+                {
+                FTRACE(RDebug::Print(_L("[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL CEapType::NewL err: %d"), error ) );
+                }
+
+
+            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL save EAP settings done" ) );
+            }
+            
+            
+	
+	  		// Expanded EAP types in use. Write the eap list to the new columns.
+    		
+    		// generate appropriate entries in the new enabled and disabled list,
+    		// overwriting those values 
+    		
+    		// count the + and - signs to determine the size of enabled and 
+    		// disabled descriptors
+
+    		TLex lex( eapList );
+    		TInt numPlus = 0;
+    		TInt numMinus = 0;
+    		TChar ch;
+    		while ( !lex.Eos() )
+    		    {
+    		    ch = lex.Get();
+    		    if ( ch == '+' ) ++numPlus;
+    		    else if ( ch == '-' ) ++numMinus;
+    		    }
+    		    
+    		// each entry consumes 8 bytes in binary format
+    		HBufC8* enabledEAPPlugin = HBufC8::NewL( 8 * numPlus );
+    		CleanupStack::PushL( enabledEAPPlugin );
+    		
+    		HBufC8* disabledEAPPlugin = HBufC8::NewL( 8 * numMinus );
+    		CleanupStack::PushL( disabledEAPPlugin );
+    		    
+    		lex.Assign( eapList );
+    		
+    		while ( !lex.Eos() )
+    		    {
+    		    // beginning of implementation UID
+    		    TInt16 implUid = 0;
+    		    
+    		    if ( lex.Val( implUid ) != KErrNone || !implUid )
+    		        {
+    		        // if the old string is corrupted, null out both lists
+    		        enabledEAPPlugin->Des().Zero();
+    		        disabledEAPPlugin->Des().Zero();
+    		        break;
+    		        }
+    		
+    		    // append it to the appropriate list ('+' enabled, '-' disabled)
+    		    _LIT8( KPadding, "\xFE\0\0\0\0\0\0" );
+    		    _LIT8( KMsChapV2Padding, "\xFE\xFF\xFF\xFF\0\0\0");
+    		    const TInt KPlainMsChapV2ImplUid = 99;
+    		    
+    		    if ( implUid > 0 )
+    		        {
+    		        enabledEAPPlugin->Des().Append( 
+    		                            Abs( implUid ) == KPlainMsChapV2ImplUid? 
+    		                                        KMsChapV2Padding: KPadding );
+    		        enabledEAPPlugin->Des().Append( Abs( implUid ) );
+    		        }
+    		    else if (implUid < 0 )
+    		        {
+    		        disabledEAPPlugin->Des().Append( 
+    		                            Abs( implUid ) == KPlainMsChapV2ImplUid? 
+    		                                        KMsChapV2Padding: KPadding );
+    		        disabledEAPPlugin->Des().Append( Abs( implUid ) );
+    		        }
+    		    
+    		    // swallow the delimiter (',')
+    		    lex.Get();
+    		    }
+                	
+	
+	
+	  		wLanServiceTable->WriteTextL( TPtrC( WLAN_ENABLED_EAPS ), 
+    		                              enabledEAPPlugin? 
+    		                                    (const TDesC8&)*enabledEAPPlugin: 
+    		                                    (const TDesC8&)KNullDesC8 );
+    		
+    		wLanServiceTable->WriteTextL( TPtrC( WLAN_DISABLED_EAPS ), 
+    		                              disabledEAPPlugin? 
+    		                                    (const TDesC8&)*disabledEAPPlugin: 
+    		                                    (const TDesC8&)KNullDesC8 );
+    		CleanupStack::PopAndDestroy( disabledEAPPlugin );
+    		CleanupStack::PopAndDestroy( enabledEAPPlugin );
+    
+     
+            
+       iEapTypeArray.ResetAndDestroy();
+       wLanServiceTable->PutRecordChanges();
+  
+
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL PutRecordChanges" ) ); 
+        CleanupStack::PopAndDestroy( wLanServiceTable );
+        
+        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL done" ) );
+	    aCommsDb.CommitTransaction();
+	    }
+	else
+	    {
+	    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL ignored not a WLAN AP" ) );
+	    }
+	    
+    }
+
+//------------------------------------------------------------------------------
+// CWPAPNapdef::ConvertAsciiToHex
+//------------------------------------------------------------------------------
+//
+void CWPAPNapdef::ConvertAsciiToHex( const TDesC8& aSource, HBufC8*& aDest )
+	{
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertAsciiToHex" ) );
+	
+	_LIT( hex, "0123456789ABCDEF" );
+	TInt size = aSource.Size();
+	TPtr8 ptr = aDest->Des();
+	for ( TInt ii = 0; ii < size; ii++ )
+		{
+		TText8 ch = aSource[ii];
+		ptr.Append( hex()[(ch/16)&0x0f] );
+		ptr.Append( hex()[ch&0x0f] );
+		}
+    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertAsciiToHex Done" ) );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::StrCopy
+// String copy with lenght check.
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::StrCopy( TDes8& aTarget, const TDesC& aSource )
+    {
+    FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::StrCopy" ) );
+    
+	TInt len = aTarget.MaxLength();
+    if( len < aSource.Length() ) 
+	    {
+		aTarget.Copy( aSource.Left( len ) );
+		return;
+	    }
+	aTarget.Copy( aSource );
+	
+	FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::StrCopy Done" ) );
+    }
+
+CEapTypeElement::~CEapTypeElement()
+    {
+    delete iEAPSettings;
+    delete iCertificate;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::UpdateLingerL
+// 
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::UpdateLingerL(const TUint32 aIapId)
+{
+		if ( iLinger && ( !iLingerFlag ) )
+		{
+    	AddLingerL( aIapId , iLingerValue );
+		}
+		
+}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::UdateligerValueL
+// 
+// -----------------------------------------------------------------------------
+//
+void CWPAPNapdef::UdateligerValueL(CWPParameter* aLinger)
+{
+		TInt err(KErrNone);
+		const TDesC& value = aLinger->Value();
+		if( !Notalpha(value))
+		{
+		TLex lex( value );
+		TUint Linger = 0;
+		TInt lingerint;
+		err = lex.Val( Linger, EDecimal );
+		if( err == KErrNone )
+		{
+		    lingerint = Linger;
+			if( lingerint >= 0 )
+		    {
+		    	iLingerValue = lingerint;
+		    	iLingerFlag = EFalse;
+		    }
+		}
+		}
+}
+
+// -----------------------------------------------------------------------------
+// CWPAPNapdef::UdateligerValueL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPNapdef::Notalpha(const TDesC& aValue)
+{
+	TBool NotAlpha = EFalse;
+	TChar character;
+	for(TInt i = 0 ; i < aValue.Length(); i++)
+	{
+		character = aValue[i];
+		NotAlpha = character.IsAlpha();
+		if(NotAlpha)
+		break;
+	}
+	
+	return NotAlpha;
+}
+
+
+// ---------------------------------------------------------------------------
+// Adds iapID and linger interval to CentralRepository
+// ---------------------------------------------------------------------------
+//
+void CWPAPNapdef::AddLingerL( const TInt aIapId, const TInt aLingerInterval )
+    {
+    TInt    err( KErrNone );
+    
+    // Open repository
+    CRepository* repository = CRepository::NewLC( KCRUidPDPContextManager );
+    
+    // Find if an entry for "iapId" already exists in CentRep 
+    RArray< TUint32 > foundKeys;
+    foundKeys.Reset();
+    
+    err = repository->FindEqL( KIapColumn,       // partial key
+                               KColumnMask,      // key mask
+                               aIapId,           // value
+                               foundKeys );      // found keys
+    
+    if ( err == KErrNone || err == KErrNotFound )
+        {
+        if ( foundKeys.Count() == 0 )
+            {
+            // Add a new entry
+            TInt arrayCount( 0 );
+            
+            // Get number of iapId&linger entries in Centrep
+            err = repository->Get( KPdpContextManagerLingerArrayCount, 
+                                   arrayCount );
+        
+            if ( err == KErrNone )
+                {
+                arrayCount++;
+                
+                err = repository->Create( ( KIapColumn | arrayCount ), aIapId ); 
+                
+                if ( err == KErrNone )
+                    {
+                    err = repository->Create( ( KLingerColumn | arrayCount ), 
+                                               aLingerInterval );     
+                    }
+                
+                if ( err == KErrNone )
+                    {
+                    // Update number of iapId&linger entries in Centrep
+                    err = repository->Set( KPdpContextManagerLingerArrayCount, 
+                                           arrayCount );
+                    }
+                }
+            }
+        else
+            {
+            // Update existing entry on current row
+            TInt32 row = foundKeys[ 0 ] & KRowMask;
+            
+            err = repository->Set( ( KLingerColumn | row ), aLingerInterval ); 
+            }         
+        }
+        
+    foundKeys.Close();
+    CleanupStack::PopAndDestroy( repository );
+    
+    User::LeaveIfError( err );
+    
+    }
+
+void CWPAPNapdef::ConvertEAPStringToIds( const TDesC& aEAPString, TDes8& aExpandedId, TUint& aId)
+	{
+    if ( aEAPString == KEAPSIM )
+		{	
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapSim" ) );
+		aExpandedId.Copy( KEapSimTypeId, KExpandedEapIdLength );		
+		aId = EAPSettings::EEapSim;
+		}
+    else if( aEAPString == KEAPAKA )
+        {
+  		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapAka" ) );
+		aExpandedId.Copy( KEapAkaTypeId, KExpandedEapIdLength );	
+		aId = EAPSettings::EEapAka;	
+        }
+    else if( aEAPString == KEAPTLS )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapTls" ) );
+		aExpandedId.Copy( KEapTlsTypeId, KExpandedEapIdLength );	
+		aId = EAPSettings::EEapTls;	
+        }
+    else if( aEAPString == KEAPPEAP )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapPeap" ) );
+		aExpandedId.Copy( KEapPeapTypeId, KExpandedEapIdLength );	
+		aId = EAPSettings::EEapPeap;	
+        }
+    else if( aEAPString == KEAPTTLS )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapTtls" ) );
+		aExpandedId.Copy( KEapTtlsTypeId, KExpandedEapIdLength );		
+		aId = EAPSettings::EEapTtls;
+        }
+   else if( aEAPString == KEAPLEAP )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapLeap" ) );
+		aExpandedId.Copy( KEapLeapTypeId, KExpandedEapIdLength );
+		aId = EAPSettings::EEapLeap;		
+        }                                    
+   else if( aEAPString == KEAPMSCHAPV2 )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapMschapv2" ) );
+		aExpandedId.Copy( KEapMschapv2TypeId, KExpandedEapIdLength );		
+		aId = EAPSettings::EEapMschapv2;
+        }     
+   else if( aEAPString == KEAPGTC )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapGtc" ) );
+		aExpandedId.Copy( KEapGtcTypeId, KExpandedEapIdLength );
+		aId = EAPSettings::EEapGtc;
+        }
+   else if( aEAPString == KEAPFAST )
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapFast" ) );
+		aExpandedId.Copy( KEapFastTypeId, KExpandedEapIdLength );
+		aId = EAPSettings::EEapFast;
+        }
+
+    else
+        {
+		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapNone" ) );
+		aExpandedId.Copy( KEapNoneId, KExpandedEapIdLength );
+		aId = EAPSettings::EEapNone;
+        }
+
+	}
+ 
+// ---------------------------------------------------------------------------
+// Returns the NAP-ID
+// ---------------------------------------------------------------------------
+//
+const TDesC& CWPAPNapdef::NapId()
+    {
+	return iNapID->Value();	
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the bearer value
+// ---------------------------------------------------------------------------
+//    
+TUint CWPAPNapdef::Bearer()
+	{
+	return iBearer;
+	}
+    
+// ---------------------------------------------------------------------------
+// Returns the bearer value
+// ---------------------------------------------------------------------------
+//    
+void CWPAPNapdef::SetCMManager( RCmManagerExt* aCm )
+	{
+	iCm = aCm;
+	}
+    
+    
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPPhysicalProxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,349 @@
+/*
+* Copyright (c) 2002 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:    Defines a class, which holds physical proxy information.
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+
+#include "CWPAPPhysicalProxy.h"				// Own header
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <WPAdapterUtil.h>
+#include <featmgr.h>
+#include "CWPAPLogicalProxy.h"
+#include "CWPAPPort.h"
+#include "CWPAPNapdef.h"
+#include "WPAPAdapter.pan"
+#include "CWPLog.h"
+#include "WPAPDefs.h"
+#include <cmconnectionmethodext.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPAPPhysicalProxy* CWPAPPhysicalProxy::NewLC( 
+                                            const TDesC& aDefaultName, 
+                                            CWPCharacteristic& aCharacteristic, 
+    CWPCharacteristic& aLogicalCharacteristic,
+    CWPAPPort*& aPort )
+	{
+	CWPAPPhysicalProxy* self = new(ELeave) CWPAPPhysicalProxy( 
+	                                                    aDefaultName, 
+                                                        aLogicalCharacteristic,
+                                                        aPort ); 
+	CleanupStack::PushL( self );
+	self->ConstructL();
+    aCharacteristic.AcceptL( *self );
+	return self;
+	}
+	
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CWPAPPhysicalProxy::~CWPAPPhysicalProxy()
+	{
+	delete iPort;
+
+    iNapdefs.ResetAndDestroy();
+    iNapdefs.Close();
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::ValidateL
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPPhysicalProxy::ValidateL()
+	{
+	TBool isValid( EFalse );
+
+	// We must have proxy address otherwise this proxy isn't valid.
+	if ( iProxyAddr )
+		{
+		switch ( iPxAddrType )
+			{
+			case EPxAddrTypeIPv4:
+				{
+				isValid = WPAdapterUtil::CheckIPv4( iProxyAddr->Value() );
+				break;
+				}
+            case EPxAddrTypeIPv6:
+                {
+                isValid = FeatureManager::FeatureSupported( KFeatureIdIPv6 )
+                    && WPAdapterUtil::CheckIPv6( iProxyAddr->Value() );
+                break;
+                }
+			case EPxAddrTypeUnsupported:
+				{
+				isValid = EFalse;
+				break;
+				}
+			default: // default value is assumed to be EPxAddrTypeIPv4
+				{
+				isValid = WPAdapterUtil::CheckIPv4( iProxyAddr->Value() );
+				}
+			}
+		}
+	return isValid;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::AddDataL
+// -----------------------------------------------------------------------------
+//
+void CWPAPPhysicalProxy::AddDataL( RCmConnectionMethodExt& aCmItem )
+	{  
+	LOG("--CWPAP CWPAPPhysicalProxy::AddDataL begin--");	
+	TInt err(KErrNone);
+	
+	// CMManager
+	aCmItem.SetStringAttributeL( CMManager::ECmWapIPGatewayAddress, iProxyAddr->Value());
+	LOG2("CWPAP EApWapStartPage, value: %S, err: %d",
+	                                             &iProxyAddr->Value(), err);
+
+	//CMManager
+	aCmItem.SetStringAttributeL( CMManager::ECmIPGateway, iProxyAddr->Value());
+	LOG2("CWPAP EApIspIPGateway, value: %S, err: %d",
+	                                             &iProxyAddr->Value(), err);
+
+	//CMManager 
+	aCmItem.SetStringAttributeL( CMManager::ECmProxyServerName, iProxyAddr->Value() );
+	LOG2("CWPAP EApProxyServerAddress, value: %S, err: %d",
+	                                                &iProxyAddr->Value(), err);
+	                                               
+
+	// Store port data
+	if ( iPort )
+        {
+        iPort->AddDataL( aCmItem );
+        }
+    
+    if ( iLogicalPort)
+        {
+        iLogicalPort->AddDataL( aCmItem );
+        }
+    if ( err ) err = 0; // prevent compiler warning
+    
+	LOG("--CWPAP CWPAPPhysicalProxy::AddDataL end--");	
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::AddItemsL
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPPhysicalProxy::AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
+                                    CWPAPItemBase* iLogicalProxy, 
+                                    CWPAPItemBase* /*iPhysicalProxy*/ ) 
+	{
+    TInt count( 0 );
+    for( TInt i( 0 ); i < iNapdefs.Count(); i++ )
+        {
+        CWPAPNapdef* pp = iNapdefs[ i ];
+        if( pp->ValidateL() )
+            {
+            count += pp->AddItemsL( aItems, iLogicalProxy, this );
+            }
+        }
+
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPAPPhysicalProxy::Name()
+	{
+    if( iName )
+        {
+        return iName->Value();
+        }
+    else 
+        {
+        return KNullDesC;
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPPhysicalProxy::VisitL( CWPCharacteristic& aCharacteristic )
+	{
+	TInt type = aCharacteristic.Type();
+	
+	// Accept only KWPPort characteristics
+	// One valid port is enough for us
+	if ( type == KWPPort && !iPort )
+		{
+        CWPAPPort* port = CWPAPPort::NewLC( aCharacteristic );
+
+		if ( port->ValidateL() )
+			{
+			iPort = port;
+			CleanupStack::Pop( port );
+			}
+		else // Data not valid.
+			{
+			CleanupStack::PopAndDestroy( port );
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPPhysicalProxy::VisitL( CWPParameter& aParameter)
+	{
+	TInt id = aParameter.ID();
+	const TDesC& value = aParameter.Value();
+
+	if ( value.Length() == 0 )
+		{
+		// No use to store zero length value.
+		return;
+		}
+
+	switch ( id )
+		{
+		case EWPParameterPxAddrFQDN: // iGatewayIPAddress
+			{
+			// Implementation comments:
+			// The value of this field is a domain name but we can't 
+			// at the moment resolve this to IP address 
+			// (at least from this adapter).
+			// Therefore this field can't be used. 
+			// EWPParameterPxAddr is supported
+			// and should be used.
+
+			/// Validate the domain name
+			/// Resolve to IP address
+
+			/* // Uncomment if domain name can be validated and IP address resolved
+			// Add only if we haven't already received this field
+			if ( !IsReceived( EWPParameterPxAddrFQDN_id ))
+				{
+				iGatewayIPAddress = &aParameter;
+				MarkReceived( EWPParameterPxAddrFQDN_id );
+				}
+			*/
+			break;
+			}
+		case EWPParameterPxAddr: // iGatewayIPAddress
+			{
+			// Accept only first occurrence of either PxAddr or PxAddrFQDN
+			if ( IsReceived( EWPParameterPxAddrFQDN_id ) ||
+				IsReceived( EWPParameterPxAddr_id ) )
+				{
+				return;
+				}
+			else 
+				{
+				// The max allowed lenght for proxy address is 45 bytes. 
+				// Nothing is stored if max lenght is exceeded
+				if ( aParameter.Value().Length() < 46 )
+					{
+					iProxyAddr = &aParameter;
+					MarkReceived( EWPParameterPxAddr_id );
+					}
+				}
+			break;
+			}
+		case EWPParameterPxAddrType:
+			{
+			if ( !IsReceived( EWPParameterPxAddrType_id ) )
+				{
+				// Only IPv4 addresses are supported.
+				if ( value == KIPV4 )
+					{
+					iPxAddrType = EPxAddrTypeIPv4;
+					}
+                else if( value == KIPV6 )
+                    {
+                    iPxAddrType = EPxAddrTypeIPv6;
+                    }
+				else
+					{
+					iPxAddrType = EPxAddrTypeUnsupported;
+					}
+				MarkReceived( EWPParameterPxAddrType_id );
+				}
+			break;
+			}
+        case EWPParameterName:
+            {
+            if( !iName )
+                {
+                iName = &aParameter;
+                }
+            break;
+            }
+		default:
+			{
+			// Just let through
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPPhysicalProxy::VisitLinkL( CWPCharacteristic& aLink )
+	{
+    CWPAPNapdef* item = CWPAPNapdef::NewLC( ETrue,
+                                            iDefaultName,
+                                            iLogicalCharacteristic,
+                                            aLink );
+    User::LeaveIfError( iNapdefs.Append( item ) );
+    CleanupStack::Pop( item ); // item
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::CWPAPPhysicalProxy
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPAPPhysicalProxy::CWPAPPhysicalProxy( 
+                               const TDesC& aDefaultName, 
+                               CWPCharacteristic& aLogicalCharacteristic,
+                               CWPAPPort*& aPort ) 
+	                         : CWPAPItemBase( aDefaultName ), 
+                               iLogicalPort( aPort ),
+                               iNapdefs( KInitialArraySize ),
+                               iLogicalCharacteristic( aLogicalCharacteristic )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPhysicalProxy::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPAPPhysicalProxy::ConstructL()
+	{
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPPort.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,294 @@
+/*
+* Copyright (c) 2002 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:    Defines a class, which holds proxy port information.
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+
+#include "CWPAPPort.h"					// Own header
+#include "WPAPAdapter.pan"
+#include "CWPLog.h"
+#include "WPAPDefs.h"
+
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWPAPPort* CWPAPPort::NewLC( CWPCharacteristic& aCharacteristic )
+	{
+	CWPAPPort* self = new(ELeave) CWPAPPort(); 
+	CleanupStack::PushL( self );
+	self->ConstructL();
+    aCharacteristic.AcceptL( *self );
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::CWPAPPort
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWPAPPort::CWPAPPort() : CWPAPItemBase( KNullDesC )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CWPAPPort::~CWPAPPort()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::Validate
+// -----------------------------------------------------------------------------
+//
+TBool CWPAPPort::ValidateL()
+	{
+	// If we got either service or portnumber and 
+	// Those we successfully interpreted the port
+	// information is valid.
+	if ( IsReceived( EWPParameterService_id ) ||
+		IsReceived( EWPParameterPortNbr_id ))
+		{
+		return ETrue;
+		}
+	LOG("CWPAP ERROR! Port not valid");
+	return EFalse; // Nothing received so this is invalid.
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::AddData
+// -----------------------------------------------------------------------------
+//
+void CWPAPPort::AddDataL( RCmConnectionMethodExt& aCmItem )
+	{    
+	LOG("--CWPAP CWPAPPort::AddDataL begin--");	
+	TInt err(KErrNone);
+	
+	// CMManager
+	TRAP (err, aCmItem.SetBoolAttributeL( CMManager::ECmWapIPSecurity, iConnectionSecurity ));
+	LOG2("CWPAP EApWapSecurity, value: %d, err: %d", iConnectionSecurity, err);
+
+	// CMManager
+	TRAP (err, aCmItem.SetIntAttributeL( CMManager::ECmWapIPWSPOption, iSessionMode ));
+	LOG2("CWPAP EApWapWspOption, value: %d, err: %d", iSessionMode, err);
+
+	if ( iPortNbr )
+		{
+		const TDesC& value = iPortNbr->Value();
+		TLex lex( value );
+		TUint32 intValue=0;
+		err = lex.Val( intValue, EDecimal );
+		if ( err == KErrNone )
+			{
+			if( intValue > 65535 )
+				{
+				intValue = 0;
+				}
+				
+			// CMManager 
+			TRAP (err, aCmItem.SetIntAttributeL( CMManager::ECmProxyPortNumber, intValue ));
+			LOG2("CWPAP EApProxyPortNumber, value: %d, err: %d",
+			                                                 intValue, err);
+			}
+		}
+	LOG("--CWPAP CWPAPPort::AddDataL end--");	
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CWPAPPort::Name()
+	{
+    return KNullDesC;
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::AddItemsL
+// -----------------------------------------------------------------------------
+//
+TInt CWPAPPort::AddItemsL( RPointerArray<CWPAPAccesspointItem>& /*aItems*/,
+                           CWPAPItemBase* /*aLogicalProxy*/,
+                           CWPAPItemBase* /*aPhysicalProxy*/ ) 
+	{
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPPort::VisitL( CWPCharacteristic& /*aCharacteristic*/ )
+	{	
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::VisitL
+// -----------------------------------------------------------------------------
+//
+void CWPAPPort::VisitL( CWPParameter& aParameter )
+	{
+	TInt id = aParameter.ID();
+	const TDesC& value = aParameter.Value();
+
+	if ( value.Length() == 0 )
+		{
+		// No use of checking the zero legth parameter.
+		return;
+		}
+
+	switch ( id )
+		{
+		case EWPParameterService: // iConnectionSecurity and iSessionMode
+			{
+			// If EWPParameterService value have already received
+			// or service type has been solved from EWPParameterPortNbr value
+			// don't accept this anymore. 
+			if ( IsReceived( EWPParameterService_id ) )
+				{
+				break;
+				}
+
+			if ( value == KCLWSP)
+				{
+				// CMManager
+				SetValues( EFalse, CMManager::ECmWapWspOptionConnectionless, 
+					EWPParameterPortNbr_id );
+				}
+			else if ( value == KCOWSP)
+				{
+				// CMManager
+				SetValues( EFalse, CMManager::ECmWapWspOptionConnectionOriented, 
+					EWPParameterPortNbr_id );
+					
+				}
+			else if ( value == KCLSECWSP)
+				{
+				// CMManager
+				SetValues( ETrue, CMManager::ECmWapWspOptionConnectionless, 
+					EWPParameterPortNbr_id );
+				}
+			else if ( value == KCOSECWSP)
+				{
+				// CMManager
+				SetValues( ETrue, CMManager::ECmWapWspOptionConnectionOriented, 
+					EWPParameterPortNbr_id );
+				}
+			else
+				{
+				// Not supported...
+				}
+			break;
+			}
+		case EWPParameterPortNbr: // iConnectionSecurity and iSessionMode
+			{
+			// If EWPParameterPortNbr value have already handled 
+			// don't accept it anymore.
+			if ( IsReceived( EWPParameterPortNbr_id ) )
+				{
+				break;
+				}
+
+			// Store the pointer to port parameter
+			iPortNbr = &aParameter;
+            MarkReceived( EWPParameterPortNbr_id );
+
+			if ( value == K9200 )
+				{
+				// CMManager
+				SetValues( EFalse, CMManager::ECmWapWspOptionConnectionless, 
+					EWPParameterPortNbr_id );
+					
+				// Type of service identified. 
+				// No need for Service parameter anymore.
+				MarkReceived( EWPParameterService_id );
+				}
+			else if ( value == K9201 || value == K80 ||	value == K8080)
+				{
+				// CMManager
+				SetValues( EFalse, CMManager::ECmWapWspOptionConnectionOriented, 
+					EWPParameterPortNbr_id );
+				MarkReceived( EWPParameterService_id );
+				}
+			else if ( value == K9202 )
+				{
+				// CMManager
+				SetValues( ETrue, CMManager::ECmWapWspOptionConnectionless, 
+					EWPParameterPortNbr_id );
+				MarkReceived( EWPParameterService_id );
+				}
+			else if ( value == K9203 || value == K443 )
+				{
+				// CMManager
+				SetValues( ETrue, CMManager::ECmWapWspOptionConnectionOriented, 
+					EWPParameterPortNbr_id );
+				MarkReceived( EWPParameterService_id );
+				}
+			else
+				{
+				// Not supported...
+				}
+			break;
+			}
+		default:
+			{
+			// Just let through
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::SetValues
+// -----------------------------------------------------------------------------
+//
+void CWPAPPort::SetValues( TBool aConnectionSecurity, 
+                           TInt aSessionMode,
+	                       TMarkedField aReceivedField )
+	{
+	__ASSERT_DEBUG( aReceivedField == EWPParameterService_id || 
+                    aReceivedField == EWPParameterPortNbr_id,
+                    Panic( EPreConditionFail ) );
+
+	iConnectionSecurity = aConnectionSecurity;
+	iSessionMode = aSessionMode;
+
+	MarkReceived( aReceivedField );
+	}
+
+// -----------------------------------------------------------------------------
+// CWPAPPort::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWPAPPort::ConstructL()
+	{
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPLog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2002 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:   Class offers static utility functions for CWmlBMSubItem.
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include <e32svr.h>
+#include "CWPLog.h"
+
+
+#ifdef ENABLE_LOGGING
+#include <flogger.h>
+
+/// Folder where the WMLBC log resides
+_LIT( KLogFolder, "ringbc" );
+
+/// The name of the log file
+_LIT( KLogFileName, "ringbc.txt" );
+
+/// The format in which the time is formatted in log
+_LIT( KLogTimeFormat, "%02d.%02d:%02d:%06d ");
+
+/// The length of the string produced by KLogTimeFormat
+const TInt KLogTimeFormatLength = 16;
+
+/// How many characters a log line can contain
+const TInt KLogLineLength = 256;
+
+#endif // ENABLE_LOGGING       
+
+// ================= MEMBER FUNCTIONS =======================
+
+#ifdef ENABLE_LOGGING
+// ---------------------------------------------------------
+// Log() 
+//
+// ---------------------------------------------------------
+void Log::DoLog( TRefByValue<const TDesC> aText, ... )
+    {
+    VA_LIST args;
+    VA_START( args, aText );
+
+    TBuf<KLogLineLength> buf;
+    buf.FormatList( aText, args );
+
+#ifdef _DEBUG
+#ifdef LOG_TO_FILE
+	RFileLogger logger;
+	TInt ret = logger.Connect();
+	if (ret==KErrNone)
+		{
+		logger.SetDateAndTime( EFalse,EFalse );
+		logger.CreateLog( KLogFolder, KLogFileName, EFileLoggingModeAppend );		
+		TBuf<KLogTimeFormatLength> timeStamp;
+		TTime now;
+		now.HomeTime();
+		TDateTime dateTime;
+		dateTime = now.DateTime();
+		timeStamp.Format( KLogTimeFormat, 
+            dateTime.Hour(), dateTime.Minute(),
+            dateTime.Second(), dateTime.MicroSecond() );
+		buf.Insert( 0, timeStamp );
+
+		logger.Write(buf);
+		}
+
+	logger.Close();
+
+#else
+    RDebug::Print( buf );
+#endif // LOG_TO_FILE
+#endif // _DEBUG
+    VA_END( args );
+    }
+
+#endif // ENABLE_LOGGING
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPLog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002 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:   Logging class
+*
+*/
+
+
+
+
+
+#ifndef CWPLOG_H
+#define CWPLOG_H
+
+/////////////////////////////////////////////////////////////////////////////
+// #Defines that control printing of additional information to debug stream.
+/////////////////////////////////////////////////////////////////////////////
+
+// INCLUDES
+
+#include "CWPLogDef.h"
+#include <e32std.h>
+
+// DEFINES
+
+#ifdef ENABLE_LOGGING
+#define LOG(s) Log::DoLog(_L(s))
+#define LOG1(s, v) Log::DoLog( _L(s), v )
+#define LOG2(s, v1, v2) Log::DoLog( _L(s), v1, v2 )
+#else
+#define LOG(s)
+#define LOG1(s, v)
+#define LOG2(s, v1, v2)
+#endif // ENABLE_LOGGING
+
+// DATA TYPES
+
+
+// CLASS DECLARATION
+
+/**
+* Class offers logging functionality.
+*/
+class Log
+    {
+
+    public:
+
+        /**
+        * Log the message.
+		* @param aText text to be written to log.
+        */
+        static void DoLog( TRefByValue<const TDesC> aText, ... );
+
+    private: // constructor
+        
+		/// Prohibited default constructor
+		Log();
+
+		/// Prohibited copy constructor
+		Log( const Log& );
+    
+		/// Prohibited assignment operator
+		Log& operator=( const Log& );
+    };
+
+#endif // CWPLOG_H
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/CWPLogDef.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 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:   Logging class definition
+*
+*/
+
+
+
+
+
+#ifndef CWPLOGDEF_H
+#define CWPLOGDEF_H
+
+/////////////////////////////////////////////////////////////////////////////
+// #Defines that control printing of additional information to debug stream.
+/////////////////////////////////////////////////////////////////////////////
+
+// Defining this enables logging
+//#define ENABLE_LOGGING
+
+// Defining this will direct all messages to a log file
+//#define LOG_TO_FILE
+
+#endif // LOGDEF_H
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/WPAPAdapterGroupProxy.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002 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:    Table of plugins for ECom
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <implementationproxy.h>
+#include "CWPAPAdapter.h"
+
+// CONSTANTS
+const TImplementationProxy KImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY(0x101F84D9, CWPAPAdapter::NewL)
+	};
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy);
+
+	return KImplementationTable;
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/WPAPAdapterPanics.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002 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:    Panic implementation
+*
+*/
+
+
+
+
+// INCLUDES
+
+#include <e32std.h>             // for GLDEF_C
+#include "WPAPAdapter.pan"
+
+// CONSTANTS
+
+_LIT(KWPAPAdapter, "wpapadapter.dll");
+
+GLDEF_C void Panic( TInt aPanic )
+    {
+    User::Panic( KWPAPAdapter, aPanic );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/Src/WPAPUtil.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2002 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:    Class offers common utility methods.
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "WPAPUtil.h"			// Own header
+#include <WPAdapterUtil.h>
+
+// CONSTANTS
+// Commented out by JN
+//#if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw
+    _LIT( KAdapterName, "WPAPAdapterResource" );
+//#else
+//    _LIT( KAdapterName, "WPAPAdapter" );
+//#endif
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// WPAPUtil::ReadHBufCLC
+// -----------------------------------------------------------------------------
+//
+HBufC* WPAPUtil::ReadHBufCL( TInt aResourceId )
+	{
+    TFileName fileName;
+    Dll::FileName( fileName );
+
+    return WPAdapterUtil::ReadHBufCL( fileName, KAdapterName, aResourceId );
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/group/101F84D8.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource file defining the AccesspointAdapter plugin.
+*
+*/
+
+
+
+
+//  INCLUDES
+#include "registryinfo.rh"
+
+
+//  RESOURCE DEFINITIONS 
+// -----------------------------------------------------------------------------
+//   
+// theInfo
+// Resource defining the ProvisioningAdapter plugin.
+//
+// -----------------------------------------------------------------------------
+//
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = 0x101F84D8;
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x101F84D5;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x101F84D9;
+					version_no = 1;
+					display_name = "WAP AP PA"; // Use short name to save RAM and ROM space
+					default_data = "";
+					opaque_data = "0";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/group/WPAPAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for accesspoint adapter.
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET          WPAPAdapter.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x101F84D8
+
+
+VENDORID        VID_DEFAULT
+CAPABILITY      CAP_ECOM_PLUGIN
+
+SOURCEPATH      ../Src
+SOURCE          CWPAPAdapter.cpp 
+SOURCE          CWPAPItemBase.cpp
+SOURCE          CWPAPAccesspointItem.cpp
+SOURCE          CWPAPNapdef.cpp
+SOURCE          CWPAPLogicalProxy.cpp
+SOURCE          CWPAPPhysicalProxy.cpp
+SOURCE          CWPAPPort.cpp
+SOURCE          WPAPUtil.cpp
+SOURCE          WPAPAdapterPanics.cpp
+SOURCE          WPAPAdapterGroupProxy.cpp
+SOURCE          CWPLog.cpp
+
+SOURCEPATH      ../group
+
+START RESOURCE 101F84D8.rss
+TARGET WPAPAdapter.rsc
+END
+
+START RESOURCE WPAPAdapterResource.rss
+HEADER
+TARGET WPAPAdapterResource.rsc
+TARGETPATH RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END  
+
+
+USERINCLUDE     ../Inc
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+
+LIBRARY         euser.lib
+LIBRARY         ProvisioningEngine.lib
+LIBRARY         apengine.lib
+LIBRARY         commdb.lib
+LIBRARY         FeatMgr.lib
+LIBRARY         ecom.lib
+LIBRARY 		centralrepository.lib
+LIBRARY			cmmanager.lib
+DEBUGLIBRARY    flogger.lib     // Only in debug builds
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/group/WPAPAdapterResource.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource file.
+*
+*/
+
+
+
+
+//  INCLUDES
+#include <badef.rh>
+#include <wpapadapter.loc>
+
+// Rich text labels
+
+RESOURCE LBUF r_qtn_sm_wapap_name
+	{ 
+	txt = qtn_sm_wapap_name; 
+	}
+
+RESOURCE LBUF r_qtn_sm_wml_accesspoints
+	{ 
+	txt = qtn_sm_wml_accesspoints; 
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2001-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for AccesspointAdapter CP adapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/WPAPAdapter.iby	CORE_MW_LAYER_IBY_EXPORT_PATH(WPAPAdapter.iby) 
+../rom/WPAPAdapterResources.iby	LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(WPAPAdapterResources.iby) 
+
+// export localised loc file
+../loc/WPAPAdapter.loc        MW_LAYER_LOC_EXPORT_PATH(wpapadapter.loc)
+
+PRJ_MMPFILES
+WPAPAdapter.mmp
+
+PRJ_TESTMMPFILES
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/loc/WPAPAdapter.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002-2004 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 a localisation file for AccesspointAdapter
+*
+*/
+
+
+
+
+// LOCALISATION STRINGS
+
+//d: Summary text for access points
+//l: popup_info_list_pane_t2/opt1
+//r: 5.0 
+
+#define qtn_sm_wml_accesspoints "Access points:"
+
+//d:This is the default name for new WAP access point. 
+//l:query_popup_data_pane_t1/opt4
+//r: 5.0
+
+#define qtn_sm_wapap_name "WAP access point"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/rom/WPAPAdapter.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 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:   Image description file for project wpapadapter
+*
+*/
+
+
+
+
+#ifndef WPAPADAPTER_IBY
+#define WPAPADAPTER_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+#include <bldvariant.hrh>
+
+ECOM_PLUGIN(WPAPAdapter.dll, WPAPAdapter.rsc)
+
+#endif // WPAPADAPTER_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omaprovisioning/provisioning/accesspointadapter/rom/WPAPAdapterResources.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 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:   Image description file for project wpapadapter
+*
+*/
+
+
+
+
+#ifndef WPAPADAPTERRESOURCES_IBY
+#define WPAPADAPTERRESOURCES_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+#include <bldvariant.hrh>
+
+data=DATAZ_\RESOURCE_FILES_DIR\WPAPAdapterResource.rsc RESOURCE_FILES_DIR\WPAPAdapterResource.rsc
+
+#endif // WPAPADAPTERRESOURCES_IBY
--- a/omaprovisioning/provisioning/alwaysonadapter/Group/alwaysonadapter.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/alwaysonadapter/Group/alwaysonadapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -46,7 +46,7 @@
 
 LIBRARY         euser.lib
 LIBRARY         provisioningengine.lib
-LIBRARY         CommonEngine.lib
+LIBRARY         commonengine.lib
 LIBRARY         centralrepository.lib
 
 DEBUGLIBRARY    flogger.lib
Binary file omaprovisioning/provisioning/conf/CI_s60provisioning.confml has changed
--- a/omaprovisioning/provisioning/cpdestinationnwadapter/group/wpdestinationnwadapter.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/cpdestinationnwadapter/group/wpdestinationnwadapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -56,5 +56,6 @@
 LIBRARY         euser.lib
 LIBRARY         provisioningengine.lib
 LIBRARY         charconv.lib
+LIBRARY         apengine.lib
 LIBRARY         commdb.lib
 LIBRARY         cmmanager.lib
--- a/omaprovisioning/provisioning/help/inc/prov.hlp.hrh	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/help/inc/prov.hlp.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -2,17 +2,16 @@
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
+* under the terms of the License "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
-* Nokia Corporation - Initial contribution
-* 
+* Nokia Corporation - initial contribution.
+*
 * Contributors:
 * 
-* 
-* Description: Help file
+* Description:
 *
 */
 	
--- a/omaprovisioning/provisioning/tsrc/ModuleTest/group/moduletestprovisioning.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/omaprovisioning/provisioning/tsrc/ModuleTest/group/moduletestprovisioning.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -52,6 +52,8 @@
 #if defined(__S60_)
 SYSTEMINCLUDE 	/epoc32/include/push
 SYSTEMINCLUDE   /epoc32/include/ecom
+#else
+SYSTEMINCLUDE   /epoc32/include 
 #endif
 
 LIBRARY         euser.lib EFSRV.LIB
--- a/policymanagement/dmutilserver/group/DMUtilServer.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/dmutilserver/group/DMUtilServer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -48,10 +48,6 @@
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/ecom
 
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbcore
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbwidgets
-
-
 #ifdef __TARM_SYMBIAN_CONVERGENCY
 SYSTEMINCLUDE   /Epoc32/include/devman
 SYSTEMINCLUDE   /Epoc32/include/syncml
@@ -60,13 +56,11 @@
 #endif // __TARM_SYMBIAN_CONVERGENCY
 
 // Symbian
-LIBRARY     euser.lib
-LIBRARY     efsrv.lib
-LIBRARY     bafl.lib
-LIBRARY     centralrepository.lib
-LIBRARY		flogger.lib
-LIBRARY 	HbCore.lib
-LIBRARY     HbWidgets.lib
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         centralrepository.lib
+LIBRARY					flogger.lib
 
 #ifdef __TARM_SYMBIAN_CONVERGENCY
  LIBRARY				dmtreeclient.lib
@@ -81,13 +75,13 @@
 // S60
 LIBRARY         rfs.lib
 LIBRARY         sysutil.lib
-LIBRARY         CommonEngine.lib
+LIBRARY         commonengine.lib
 // TARM
 LIBRARY					policyengine.lib
 LIBRARY					centreptool.lib
 
 #ifdef RD_MULTIPLE_DRIVE
-LIBRARY         PlatformEnv.lib 
+LIBRARY         platformenv.lib 
 LIBRARY          estor.lib 
 LIBRARY		ecom.lib
 #endif
--- a/policymanagement/dmutilserver/src/DMUtilObserver.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/dmutilserver/src/DMUtilObserver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -291,10 +291,14 @@
 	iProperty.Subscribe( iStatus);	
 }
 
+// ----------------------------------------------------------------------------
+// CActiveObserver::RunError
+// ----------------------------------------------------------------------------
 TInt CActiveObserver::RunError ( TInt /*aError*/ )
     {    
     return KErrNone;
     }	
+    
 // -----------------------------------------------------------------------------
 // CActiveObserver::DoCancel
 // -----------------------------------------------------------------------------
--- a/policymanagement/dmutilserver/src/DMUtilSession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/dmutilserver/src/DMUtilSession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -31,8 +31,7 @@
 #include <centralrepository.h>
 
 #include <coreapplicationuisdomainpskeys.h>
-#include <hbsymbianvariant.h>
-#include <hbindicatorsymbian.h>
+
 
 
 #include <e32property.h>
@@ -49,10 +48,6 @@
 _LIT( MDriveColon, ":");
 _LIT( KMMCEraseFlagFileName, "fmmc.dat");
 
-_LIT(KDMSettingsIndicatorType, "com.nokia.devicemanagement.settingsindicatorplugin/1.0");
-_LIT(KTarmTrustManagementActive, "ManagementActive");
-_LIT(KTarmTrustTerminalSecurity, "TerminalSecurity");
-
 // MACROS
 
 
@@ -344,9 +339,6 @@
 	//get terminal security and management state from centrep
 	TInt terminalSecurity = 0;
 	TInt err( KErrNone );
-	
-	CHbIndicatorSymbian *ind = CHbIndicatorSymbian::NewL();
-	CleanupStack::PushL(ind);
 
 	if ( !aCenRep)
 		{
@@ -365,34 +357,19 @@
 	if ( CDMUtilServer::iManagementActive )			
 		{
 		RDEBUG(" iManagementActive is ETrue -> ECoreAppUIsTarmMngActiveIndicatorOn");
-		//err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmMngActiveIndicatorOn);
-		
-		CHbSymbianVariant* parameter = CHbSymbianVariant::NewL(&KTarmTrustManagementActive,  
-                            CHbSymbianVariant::EDes);
-		ind->Activate(KDMSettingsIndicatorType, parameter );
-		delete parameter;
-
+		err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmMngActiveIndicatorOn);	
 		}
 	else if ( terminalSecurity )
 		{
 		RDEBUG(" terminalSecurity is ETrue -> ECoreAppUIsTarmTerminalSecurityOnIndicatorOn");
-		//err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmTerminalSecurityOnIndicatorOn);
-		
-		CHbSymbianVariant* parameter = CHbSymbianVariant::NewL(&KTarmTrustTerminalSecurity,  
-                            CHbSymbianVariant::EDes);
-		ind->Activate(KDMSettingsIndicatorType, parameter );
-		delete parameter;
+		err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmTerminalSecurityOnIndicatorOn);	
 		}
 	else
 		{
 		RDEBUG(" terminalSecurity is EFalse -> ECoreAppUIsTarmIndicatorsOff");
-		//err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmIndicatorsOff);
-		
-		ind->Deactivate(KDMSettingsIndicatorType);
+		err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmIndicatorsOff);	
 		}	
 	
-	CleanupStack::PopAndDestroy(ind);
-	
 	if( err != KErrNone )
 		{
 		RDEBUG8_2("CDMUtilSession::SetIndicatorStateL ERROR: %d",err);
--- a/policymanagement/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -30,31 +30,10 @@
 ../conf/policy_management_10207843.crml 	        MW_LAYER_CRML(policy_management_10207843.crml)
 
 
-
 PRJ_EXTENSIONS
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 PRJ_MMPFILES
 
-
-
-
-
-
 #include "../pmdmadapter/group/bld.inf"
 #include "../dmutilserver/group/bld.inf"
 #include "../policyengine/group/bld.inf"
--- a/policymanagement/policyengine/centreptoolserver/src/RepositorySession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/centreptoolserver/src/RepositorySession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -423,8 +423,8 @@
 	if ( !aSettings.Count() )
 	{	
 		CRangeMeta * setting = CRangeMeta::NewL( aCompareValue, 0, aMask, KBackupBitMask);
-		aSettings.Append( setting );
-		iRangeMetas.Append( setting);
+		aSettings.AppendL( setting );
+		iRangeMetas.AppendL( setting);
 	}
 }
 
--- a/policymanagement/policyengine/group/PMRfsPlugin.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/group/PMRfsPlugin.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -51,7 +51,7 @@
 LIBRARY	           efsrv.lib
 LIBRARY            rfs.lib
 #ifdef RD_MULTIPLE_DRIVE
-LIBRARY         PlatformEnv.lib 
+LIBRARY         platformenv.lib 
 LIBRARY          estor.lib 
 #endif
 
--- a/policymanagement/policyengine/group/PolicyEngineServer.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/group/PolicyEngineServer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -54,15 +54,12 @@
 MW_LAYER_SYSTEMINCLUDE
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE /epoc32/include/xml
+SYSTEMINCLUDE /epoc32/include/comms-infras/commdb/protection
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE 	/epoc32/include/platform/xml
 SYSTEMINCLUDE 	/epoc32/include/platform/comms-infras/commdb/protection
 #endif
 
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbcore
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbwidgets
-
-
 LIBRARY     euser.lib 
 LIBRARY		  efsrv.lib 
 LIBRARY		  xmlframework.lib 
@@ -79,7 +76,6 @@
 LIBRARY		  commsdat.lib
 LIBRARY		  flogger.lib
 LIBRARY 	  featmgr.lib
-LIBRARY       HbWidgets.lib HbCore.lib
-LIBRARY 	  inetprotutil.lib
+LIBRARY     inetprotutil.lib
 
 SMPSAFE
--- a/policymanagement/policyengine/group/PolicyEngineUI.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/group/PolicyEngineUI.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -56,11 +56,11 @@
 LIBRARY         bafl.lib
 LIBRARY         avkon.lib
 LIBRARY         cone.lib
-LIBRARY         CommonEngine.lib
+LIBRARY         commonengine.lib
 LIBRARY         eikcoctl.lib 
 LIBRARY	    		eikdlg.lib 
 LIBRARY         eikctl.lib
-LIBRARY         PlatformEnv.lib
+LIBRARY         platformenv.lib
 LIBRARY         commondialogs.lib
 LIBRARY         efsrv.lib
 LIBRARY 		eiksrv.lib
--- a/policymanagement/policyengine/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -21,7 +21,6 @@
 
 PRJ_EXPORTS
 
-
 ../PMRfsPlugin/scripts/format_e_.txt /epoc32/release/winscw/udeb/z/private/1020783f/format_e_.txt
 ../PMRfsPlugin/scripts/format_e_.txt /epoc32/release/winscw/urel/z/private/1020783f/format_e_.txt
 ../PMRfsPlugin/scripts/format_e_.txt /epoc32/release/armv5/udeb/z/private/1020783f/format_e_.txt
@@ -29,12 +28,12 @@
 
 ../rom/policyengine.iby												CORE_MW_LAYER_IBY_EXPORT_PATH(policyengine.iby)
 ../rom/policyengineresources.iby							LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(policyengineresources.iby)
-//../policyengineui/loc/PolicyEngineUI.loc			MW_LAYER_LOC_EXPORT_PATH(policyengineui.loc)
+../policyengineui/loc/PolicyEngineUI.loc			MW_LAYER_LOC_EXPORT_PATH(policyengineui.loc)
 
 PRJ_MMPFILES
 PolicyEngineClient.mmp
 CentRepToolClient.mmp
-//PolicyEngineUI.mmp
+PolicyEngineUI.mmp
 PolicyEngineServer.mmp
 CentRepToolServer.mmp
 PMRfsPlugin.mmp
--- a/policymanagement/policyengine/policyengine.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  Policy Engine project file
-#
-TEMPLATE = subdirs
-
-SUBDIRS  += policyengineui 
-
-CONFIG += ordered
-
-symbian: {
-SYMBIAN_PLATFORMS = WINSCW \
-    ARMV5
-    }
--- a/policymanagement/policyengine/policyengineclient/src/Contexts.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineclient/src/Contexts.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -311,7 +311,7 @@
 		delete operator[](i);
 	}
 
-	RArray<HBufC8*>::Close();
+	RArray::Close();
 }
 
 void RElementIdArray::SetListL( const TDesC8& aChilds)
--- a/policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h	Wed Sep 01 12:27:42 2010 +0100
@@ -28,9 +28,6 @@
 #include "RequestContext.h"
 #include "PolicyStorage.h"
 #include <e32base.h>
-#include <msvapi.h>
-#include <hbsymbianvariant.h>
-#include <hbdevicedialogsymbian.h>
 
 // CONSTANTS
 // MACROS
@@ -145,34 +142,6 @@
 		TInt iProcessorState;
 };	
 
-
-//Class to launch PolicyEngine Dialog
-class CProcessorClient: public CActive,public MHbDeviceDialogObserver
-{
-public:
-    CProcessorClient();
-    ~CProcessorClient();
-    TInt LaunchDialog(const TDesC8& aFringerPrint, const TDesC8& aServerName);
-    // from MHbDeviceDialogObserver
-    void DataReceived(CHbSymbianVariantMap& aData);
-    void DeviceDialogClosed(TInt aCompletionCode);
-
-protected:
-    // from CActive
-    void DoCancel();
-    void RunL();
-    TInt WaitUntilDeviceDialogClosed();
-    void LaunchTrustNotificationDialog(const TDesC8& aServerName);
-private:
-    CHbDeviceDialogSymbian* iDevDialog;
-    CActiveSchedulerWait* iWait;
-    TInt iCompletionCode;
-    TInt iUserResponse;
-};
-
-
-
-
 class TCombiningAlgorith
 {
 	public:
--- a/policymanagement/policyengine/policyengineserver/src/OperationParser.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/OperationParser.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -434,9 +434,7 @@
 	// PolicyEngine expects this leave in error conditions -> prgram flow
 	// goes to correct TRAP after this. Can not remove this Leave although
 	// the function name does not have "L"
-	
-	// Commented due to RVCT4.0
-	//User::Leave( KErrOpParser ); 	
+	User::Leave( KErrOpParser ); 	
 }
 
 // -----------------------------------------------------------------------------
--- a/policymanagement/policyengine/policyengineserver/src/PolicyEngineServer.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/PolicyEngineServer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -330,7 +330,7 @@
 	CPolicyEngineServer::iServer->iSubSessionObjects = 0;
 	
 	CPolicyEngineServer::iServer->iSessionIter.SetToFirst();
-	for ( ; CPolicyEngineServer::iServer->iSessionIter != 0 ; CPolicyEngineServer::iServer->iSessionIter++)
+	for ( ; CPolicyEngineServer::iServer->iSessionIter ; CPolicyEngineServer::iServer->iSessionIter++)
 	{
 		CSession2 * session = CPolicyEngineServer::iServer->iSessionIter;
 		CPolicyEngineSession* policyenginesession = (CPolicyEngineSession*) session;
--- a/policymanagement/policyengine/policyengineserver/src/PolicyParser.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/PolicyParser.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -1014,10 +1014,7 @@
 	{
    	// we need to leave here because Policy Engine traps parser errors, even though
    	// this function does not have L in it's name.
-   	//HandleErrorL( ParserErrors::SyntaxError );
-   	
-   	// Ignoreing the leave code due to RVCT4.0
-   	TRAP_IGNORE(HandleErrorL( ParserErrors::SyntaxError ));
+   	HandleErrorL( ParserErrors::SyntaxError );
 	}
 
 // -----------------------------------------------------------------------------
--- a/policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -30,19 +30,12 @@
 #include "PolicyEngineServer.h"
 #include "PolicyEngineClientServer.h"
 #include "debug.h"
-#include <hbdevicedialogsymbian.h>
-#include <hbdevicenotificationdialogsymbian.h>
-#include <hbtextresolversymbian.h>
+
+#include "PolicyEngineUi.h"
+
 // CONSTANTS
 const TUid KUidPolicyEngineUi = { 0x10207817 };
-const TUint KDelimeterChar = '|';
-_LIT8( KUserAcceptMark, "A");
 
-enum TUserResponse
-    {
-    EUserAccept,
-    EUserDeny,
-    };
 
 // -----------------------------------------------------------------------------
 // RAttributeContainer::AppendL()
@@ -62,7 +55,7 @@
 	container->iAttributeType = aAttributeTypes; 
 
 	//append to list
-	RArray<AttributeContainerHelper::TContainer*>::AppendL( container);
+	RArray::AppendL( container);
 		
 	//remove from cleanup
 	CleanupStack::Pop( 2, aAttribute);
@@ -82,7 +75,7 @@
 		delete container;
 	}
 	
-	RArray<AttributeContainerHelper::TContainer*>::Close();
+	RArray::Close();
 }
 
 
@@ -753,24 +746,51 @@
 	//resolve name and fingerprint
 	const TDesC8& name = iTrustedSession->CommonNameForSubjectL( trustedSubject, iUseEditedElements);
 	const TDesC8& fingerPrint = iTrustedSession->FingerPrintForSubjectL( trustedSubject, iUseEditedElements);
-	TPtrC8 ptr = fingerPrint.Left(4); // send only first 4 digits.
-	
-	RDEBUG_2("CPolicyProcessor::fingerPrint: %S", &fingerPrint);
-	RDEBUG_2("CPolicyProcessor::fingerPrint: %S", &ptr);
-	
-	RDEBUG8_2("CPolicyProcessor::fingerPrint: %S", &fingerPrint);
-	RDEBUG8_2("CPolicyProcessor::fingerPrint: %S", &ptr);
-	    
+
 	TUserResponse response = EUserDeny;
 
-    CProcessorClient *client = new CProcessorClient();
-    TInt res = client->LaunchDialog(ptr, name);
-    
-    if(res == 0)
-        response = EUserAccept;
-    else
-        response = EUserDeny;  
+	if ( name.Length() && fingerPrint.Length())
+	{
+		//create notifier
+		RNotifier notifier;
+		CleanupClosePushL( notifier);
+		User::LeaveIfError( notifier.Connect() );
+		
+		//create parameter descriptor
+		TBuf8<100> responseBuf;
+		HBufC8 * data = HBufC8::NewLC( name.Length() + fingerPrint.Length() + 1);
+		TPtr8 ptr = data->Des();
+		ptr.Append(name);
+		ptr.Append(KDelimeterChar);
+		ptr.Append(fingerPrint.Left(4));
 
+		//create CAsyncHandler to Auto start/stop CActiveScheduler
+		CASyncHandler * async = CASyncHandler::NewLC();
+		notifier.StartNotifierAndGetResponse( async->GetRequestStatus(), KUidPolicyEngineUi, ptr, responseBuf);
+		
+		//Start CActiveScheduler and execute stop when request is completed
+		async->WaitForRequest();
+		CPolicyEngineServer::SetActiveSubSession( this);	
+
+		
+		if ( async->GetRequestStatus() > 0) //request pending...
+		{
+			notifier.CancelNotifier( KUidPolicyEngineUi);	
+		}
+		else
+		{
+			//Check response
+			if ( responseBuf == KUserAcceptMark)
+			{
+				RDEBUG("PolicyEngineServer: CPolicyProcessor user accept corporate policy!");
+				response = EUserAccept;
+			}
+		}
+		
+		CleanupStack::PopAndDestroy( 3, &notifier);	//notifier, data, CASyncHandler
+		
+		
+	}
 
 	MakeBooleanResponseL( response == EUserAccept, aResponseElement);
 }
@@ -959,185 +979,6 @@
 }
 
 
-// -----------------------------------------------------------------------------
-// CProcessorClient::CProcessorClient()
-// -----------------------------------------------------------------------------
-//
-
-CProcessorClient::CProcessorClient()
-    : CActive(EPriorityNormal)
-    {
-    CActiveScheduler::Add( this );
-    iWait = new( ELeave ) CActiveSchedulerWait;
-    iCompletionCode = KErrNone;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::~CProcessorClient()
-// -----------------------------------------------------------------------------
-CProcessorClient::~CProcessorClient()
-    {
-    delete iWait;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::DataReceived()
-// -----------------------------------------------------------------------------
-void CProcessorClient::DataReceived(CHbSymbianVariantMap& aData)
-{
-    _LIT(KResponse, "keyResponse");
-    const CHbSymbianVariant* key = aData.Get(KResponse);
-        
-    if(key)
-    {
-    TInt *res = key->Value<TInt>();
-    iCompletionCode = *res;        
-    iUserResponse = *res;
-    }
-}
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::DeviceDialogClosed()
-// -----------------------------------------------------------------------------
-void CProcessorClient::DeviceDialogClosed(TInt aCompletionCode)
-    {
-    iCompletionCode = aCompletionCode;
-    //iDevDialog->Cancel();
-    TRequestStatus* status(&iStatus);
-    User::RequestComplete(status, KErrNone);
-    }
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::DoCancel()
-// -----------------------------------------------------------------------------
-void CProcessorClient::DoCancel()
-{
-    if (iWait && iWait->IsStarted() && iWait->CanStopNow()) 
-    {
-        iCompletionCode = KErrCancel;
-        iWait->AsyncStop();
-    }  
-}
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::RunL()
-// -----------------------------------------------------------------------------
-void CProcessorClient::RunL()
-{
-    if (iWait) 
-    {
-        iWait->AsyncStop();
-    }    
-}
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::LaunchDialog()
-// -----------------------------------------------------------------------------
-TInt CProcessorClient::LaunchDialog(const TDesC8& aFringerPrint,
-        const TDesC8& aServerName)
-    {
-    _LIT(KHbNotifier,"com.nokia.hb.policymanagementdialog/1.0");
-    _LIT(KFingerPrint, "fingerprint");
-    _LIT(KServerdisplayname, "serverdisplayname");
-
-    RDEBUG_2("CPolicyProcessor::fingerPrint: %S", &aFringerPrint);
-    RDEBUG_2("CPolicyProcessor::fingerPrint: %S", &aServerName);
-
-    CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-    CleanupStack::PushL(varMap);
-
-    TBuf<10> fingerBuf;
-    fingerBuf.Copy(aFringerPrint);
-
-    TInt serverNameLen = aServerName.Length();
-    TBuf<50> serverName;
-    serverName.Copy(aServerName);
-
-    RDEBUG_2("CPolicyProcessor::16 fingerPrint: %S", &fingerBuf);
-    RDEBUG_2("CPolicyProcessor::16 serverName : %S", &serverName);
-
-    CHbSymbianVariant* fingerprintid = CHbSymbianVariant::NewL(&fingerBuf,
-            CHbSymbianVariant::EDes);
-
-    CHbSymbianVariant* serverdisplayname = CHbSymbianVariant::NewL(
-            &serverName, CHbSymbianVariant::EDes);
-
-    RDEBUG_2("CPolicyProcessor::fingerPrint: %S", &fingerprintid);
-    RDEBUG_2("CPolicyProcessor::fingerPrint: %S", &serverdisplayname);
-
-    varMap->Add(KFingerPrint, fingerprintid);
-    varMap->Add(KServerdisplayname, serverdisplayname);
-
-    iDevDialog = CHbDeviceDialogSymbian::NewL();
-    TInt err1 = iDevDialog->Show(KHbNotifier, *varMap, this);
-    TInt err = WaitUntilDeviceDialogClosed();
-
-    CleanupStack::PopAndDestroy();
-
-    if (iDevDialog)
-        {
-        iDevDialog->Cancel();
-        delete iDevDialog;
-        iDevDialog = NULL;
-        }
-    
-    if (err == 0)
-        {
-            LaunchTrustNotificationDialog(aServerName);
-         }
-    
-    return iUserResponse;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CProcessorClient::WaitUntilDeviceDialogClosed()
-// -----------------------------------------------------------------------------
-TInt CProcessorClient::WaitUntilDeviceDialogClosed()
-    {
-    iCompletionCode = KErrInUse;
-    if (!IsActive() && iWait && !iWait->IsStarted())
-    {
-            iStatus = KRequestPending;
-            SetActive();
-            iWait->Start();
-            }
-    return iCompletionCode;
-    }
-
-void CProcessorClient::LaunchTrustNotificationDialog(const TDesC8& aServerName)
-{
-    _LIT(KFileName, "deviceupdates_");
-    _LIT(KPath, "z:/resource/qt/translations/");
-    _LIT(KDialogIcon, "note_info.svg");
-    
-    TBool result = HbTextResolverSymbian::Init(KFileName, KPath);
-    
-    if (result) {
-        _LIT(KTrustEstablished,"txt_device_update_dpophead_trust_established");
-        _LIT(KServerID,"txt_deviceupdate_dpopinfo_trust_establised_with_1");
-        
-        HBufC* trustEstablishedText = HbTextResolverSymbian::LoadL(KTrustEstablished);
-        CleanupStack::PushL(trustEstablishedText);
- 
-        HBufC* serveridbuf = HBufC::NewLC(aServerName.Length());
-        TPtr serveridbufptr = serveridbuf->Des();
-        serveridbufptr.Copy(aServerName);
-   
-        HBufC* serverid = HbTextResolverSymbian::LoadL(KServerID,*serveridbuf);
-        CleanupStack::PushL(serverid);
-
-        CHbDeviceNotificationDialogSymbian::NotificationL(KDialogIcon, *trustEstablishedText, *serverid);
-        
-        CleanupStack::PopAndDestroy(3); //trustEstablishedText,serveridbuf,serverid
-    }
-}
 
 // -----------------------------------------------------------------------------
 // TCombiningAlgorith::TCombiningAlgorith()
--- a/policymanagement/policyengine/policyengineserver/src/SettingEnforcementManager.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/SettingEnforcementManager.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -164,13 +164,7 @@
 	//finish active enforcement base
 	if ( iActiveEnforcementBase)
 	{
-		TRAPD(err, iActiveEnforcementBase->FinishEnforcementL( aFlushSettings));
-		
-		if (err != KErrNone)
-			{
-			RDEBUG_2("	**** ERROR, iActiveEnforcementBase->FinishEnforcementL left with %d", err );
-			}
-			
+		iActiveEnforcementBase->FinishEnforcementL( aFlushSettings);
 		delete iActiveEnforcementBase;
 		iActiveEnforcementBase = 0;
 	}
--- a/policymanagement/policyengine/policyengineui/InputDialog.docml	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
-    <object name="Dialog_OK_Btn" type="HbAction">
-        <string name="role" value="HbDialog:primaryAction"/>
-        <string name="role" value="HbDialog:primaryAction"/>
-        <string name="text" value="OK"/>
-    </object>
-    <object name="Dialog_Cancel_Btn" type="HbAction">
-        <string name="role" value="HbDialog:secondaryAction"/>
-        <string name="role" value="HbDialog:secondaryAction"/>
-        <string name="text" value="Cancel"/>
-    </object>
-    <widget name="dialog" type="HbDialog">
-        <widget name="qtl_dialog_pri_heading" role="HbDialog:headingWidget" type="HbLabel">
-            <enums name="alignment" value="AlignLeft|AlignLeading"/>
-            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
-            <string name="plainText" value=""/>
-            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
-        </widget>
-        <widget name="qtl_dialog_sec" role="HbDialog:contentWidget" type="HbWidget">
-            <widget name="HeadingLabel" type="HbLabel">
-                <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="0un" right="0un" top="0un"/>
-                <bool name="visible" value="TRUE"/>
-                <string name="plainText" value=""/>
-                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
-            </widget>
-            <widget name="InfoLabel" type="HbLabel">
-                <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="0un" right="0un" top="0un"/>
-                <bool name="visible" value="TRUE"/>
-                <string name="plainText" value=""/>
-                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
-                <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
-            </widget>
-            <widget name="InputLine" type="HbLineEdit">
-                <string name="text" value=""/>
-                <bool name="visible" value="TRUE"/>
-                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
-            </widget>
-            <real name="z" value="0"/>
-            <layout spacing="0un" type="grid">
-                <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
-                <griditem column="0" itemname="InputLine" row="2"/>
-                <griditem column="0" itemname="InfoLabel" row="1"/>
-                <griditem column="0" itemname="HeadingLabel" row="0"/>
-            </layout>
-        </widget>
-        <ref object="Dialog_OK_Btn" role="HbDialog:primaryAction"/>
-        <ref object="Dialog_Cancel_Btn" role="HbDialog:secondaryAction"/>
-    </widget>
-    <section name="twoColumns">
-        <widget name="qtl_dialog_sec" role="HbDialog:contentWidget" type="HbWidget">
-            <layout spacing="0un" type="grid">
-                <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
-                <griditem column="1" itemname="InputLine" row="1"/>
-                <griditem column="0" itemname="HeadingLabel" row="0"/>
-                <griditem column="0" itemname="InfoLabel" row="1"/>
-            </layout>
-        </widget>
-        <widget name="InputLine" type="HbLineEdit">
-            <enums name="alignment" value="AlignLeft|AlignVCenter|AlignLeading"/>
-        </widget>
-        <widget name="InfoLabel" type="HbLabel">
-            <contentsmargins bottom="0un" left="0un" right="var(hb-param-margin-gene-middle-horizontal)" top="0un"/>
-        </widget>
-        <widget name="HeadingLabel" type="HbLabel">
-            <enums name="alignment" value="AlignLeft|AlignVCenter|AlignLeading"/>
-            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="0un" right="var(hb-param-margin-gene-middle-horizontal)" top="0un"/>
-        </widget>
-    </section>
-    <metadata activeUIState="Portrait" display="NHD portrait" unit="un">
-        <uistate name="Common ui state" sections="#common"/>
-        <uistate name="Landscape" sections="#common twoColumns"/>
-        <uistate name="Portrait" sections="#common"/>
-    </metadata>
-</hbdocument>
--- a/policymanagement/policyengine/policyengineui/PolicyEngineUI.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-# Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: Implementation of policymanagement components
-
-
-TEMPLATE = lib
-TARGET = PolicyEngUINotifiersplugin
-CONFIG += hb\
-          plugin
-
-DESTDIR = $${HB_BUILD_DIR}/plugins/devicedialogs
-          
-QT += core \
-    gui
-HEADERS += 	./inc/PolicyEngUINotifierplugin.h \
-    	   	./inc/PolicyEngineUI.h
-SOURCES += 	./src/PolicyEngNotifierplugin.cpp \
-   			./src/PolicyEngineUI.cpp
-RESOURCES += PolicyEngineUI.qrc
-LIBS += -lflogger
-
-symbian: {
-    TARGET.EPOCALLOWDLLDATA = 1
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.UID3 = 0x10207817
-
-    hblib.sources = Hb.dll
-    hblib.path = \sys\bin
-    hblib.depends = "(0xEEF9EA38), 1, 0, 0, {\"Hb\"}"
-
-    pluginstub.sources = PolicyEngUINotifiersplugin.dll
-    pluginstub.path = /resource/plugins/devicedialogs
-    DEPLOYMENT += pluginstub
- }
- !local {
-    target.path = $${HB_PLUGINS_DIR}/devicedialogs
-    INSTALLS += target
-}
-
--- a/policymanagement/policyengine/policyengineui/PolicyEngineUI.qrc	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<RCC>
-    <qresource prefix="/xml">
-        <file>dialog.docml</file>
-        <file>InputDialog.docml</file>
-    </qresource>
-</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/data/10207817.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of policymanagement components
+*
+*/
+//
+// 10207817.RSS
+//
+// App-framework notifier plug-in resource file.
+//
+
+#include <registryinfo.rh>
+#include <uikon.hrh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	dll_uid = 0x10207817; //should match name of this file
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUikonUidPluginInterfaceNotifiers;  // need to create this uid in the uid database
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x10207817;
+					version_no = 1;
+					display_name = "Policy Engine UI dialog";
+					default_data = "TLS policyengine fialog";    
+					opaque_data = "0";
+					}
+				};
+			}
+		};
+	} 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/data/PolicyEngineUI.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource definitions for PolicyEngineUI module.
+*
+*/
+
+
+NAME COUI
+
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+#include "policyengineui.hrh" 
+#include <policyengineui.loc>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf = ""; }
+
+//------------------------------------------------------------------------------
+//
+//    r_policyengineui_confirmation_query
+//    Defines a common confirmation dialog with cancel softkey for policyengine ui
+//
+//------------------------------------------------------------------------------
+//
+
+
+RESOURCE DIALOG r_policyengineui_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL; 
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY 
+                { 
+                layout = EConfirmationQueryLayout;  
+                bmpfile = "z:\\resource\\apps\\avkon2.mbm";              
+                bmpid = EMbmAvkonQgn_note_info;
+                bmpmask = EMbmAvkonQgn_note_info_mask;
+                };
+            }
+        };
+    }
+
+//------------------------------------------------------------------------------
+//
+//    r_policyengineui_confirmation
+//    Defines a common confirmation dialog without cancel softkey for policyengine ui
+//
+//------------------------------------------------------------------------------
+//
+
+RESOURCE DIALOG r_policyengineui_confirmation
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY; 
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY 
+                { 
+                layout = EConfirmationQueryLayout;  
+                bmpfile = "z:\\resource\\apps\\avkon2.mbm";              
+                bmpid = EMbmAvkonQgn_note_info;
+                bmpmask = EMbmAvkonQgn_note_info_mask;
+                };
+            }
+        };
+    }
+    
+//------------------------------------------------------------------------------
+//
+//    r_policyengineui_data_query
+//    Defines a common data query dialog for policyengine ui
+//
+//------------------------------------------------------------------------------
+//    
+    
+RESOURCE DIALOG r_policyengineui_data_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EDataLayout;
+               	 	control = EDWIN
+               		{
+                		flags = EEikEdwinNoHorizScrolling|EEikEdwinResizable;
+                		lines = 1;
+                		maxlength = RANDOM_PART_MAX_SIZE;
+                	};
+                };
+            }
+        };
+    } 
+
+//------------------------------------------------------------------------------
+//
+//    r_swcommon_general_wait_dialog
+//    Defines a common wait dialog
+//
+//------------------------------------------------------------------------------
+//
+
+RESOURCE DIALOG r_policy_engine_possession_info
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+         {
+        DLG_LINE 
+              {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                    {
+                };
+            },
+         DLG_LINE
+              {
+            type = EAknCtMessageQuery;
+              id = EAknMessageQueryContentId;
+                control = AVKON_MESSAGE_QUERY
+                    {
+                     };
+              }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+//
+//    String definitions
+//
+//------------------------------------------------------------------------------
+//
+
+//Confirmation dialog strings
+													
+RESOURCE TBUF r_policyengineui_control_note_header { buf = qtn_policyengineui_control_note_header; }
+RESOURCE TBUF r_policyengineui_control_note { buf = qtn_policyengineui_control_note; }
+RESOURCE TBUF r_policyengineui_question_note { buf = qtn_policyengineui_question_note ;}
+RESOURCE TBUF r_policyengineui_remove_note { buf = ""; }
+RESOURCE TBUF r_policyengineui_denied_note { buf = qtn_policyengineui_denied_note; }
+RESOURCE TBUF r_policyengineui_unmatch_note { buf = qtn_policyengineui_unmatch_note; }
+RESOURCE TBUF r_policyengineui_security_info_note { buf = qtn_policyengineui_security_info_note; }
+RESOURCE TBUF r_policyengineui_trust_established { buf = qtn_trust_established; }
+
+// End of File
--- a/policymanagement/policyengine/policyengineui/dialog.docml	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
-    <object name="qtl_dialog_softkey_2_left" type="HbAction">
-        <string name="role" value="HbDialog:primaryAction"/>
-        <string name="role" value="HbDialog:primaryAction"/>
-        <string name="text" value="OK"/>
-    </object>
-    <object name="qtl_dialog_softkey_2_right" type="HbAction">
-        <string name="role" value="HbDialog:secondaryAction"/>
-        <string name="role" value="HbDialog:secondaryAction"/>
-        <string name="text" value="Cancel"/>
-    </object>
-    <widget name="dialog" type="HbDialog">
-        <widget name="qtl_dialog_pri_heading" role="HbDialog:headingWidget" type="HbLabel">
-            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
-            <string name="plainText" value="Update available"/>
-            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
-        </widget>
-        <widget name="qtl_dialog_pri5_large_graphic" role="HbDialog:contentWidget" type="HbWidget">
-            <widget name="icon" type="HbLabel">
-                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-                <icon iconName="note_warning" name="icon"/>
-                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-                <sizehint height="var(hb-param-graphic-size-primary-large)" type="FIXED" width="var(hb-param-graphic-size-primary-large)"/>
-                <bool name="visible" value="TRUE"/>
-            </widget>
-            <widget name="qtl_dialog_pri5" type="HbLabel">
-                <enums name="textWrapping" value="TextWordWrap"/>
-                <bool name="visible" value="TRUE"/>
-                <string name="plainText" value="Recommended update is available from TarmBlr. Downloading requires connection to the internet"/>
-                <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
-            </widget>
-            <real name="z" value="0"/>
-            <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
-            <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-popup)" type="linear">
-                <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
-                <linearitem itemname="icon"/>
-                <linearitem itemname="qtl_dialog_pri5"/>
-            </layout>
-        </widget>
-        <sizehint height="42.08955un" type="PREFERRED" width="50.5un"/>
-        <ref object="qtl_dialog_softkey_2_left" role="HbDialog:primaryAction"/>
-        <ref object="qtl_dialog_softkey_2_right" role="HbDialog:secondaryAction"/>
-    </widget>
-    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
-        <resource location="TemplateIcons.qrc"/>
-        <uistate name="Common ui state" sections="#common"/>
-    </metadata>
-</hbdocument>
--- a/policymanagement/policyengine/policyengineui/inc/Logger.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
-* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of policymanagement components
-*
-*/
-
-#ifndef __LOGGER_H__
-#define __LOGGER_H__
-
-#ifdef _DEBUG
-    #define LOGGING_ENABLED
-#endif
-#ifdef LOGGING_ENABLED          // This must be enabled to use logging system
-
-#define LOGGER_LOGGING          // Log to Logger
-
-
-
-#ifdef LOGGER_LOGGING
-
-//  INCLUDES
-#include <flogger.h>
-
-// LOG SETTINGS 
-_LIT( KPMUILogFolder, "TARM" );
-_LIT( KPMUILogFile, "PMUI.TXT" );
-
-#endif
-
-// CONSTANTS  
-// None.
-
-// MACROS
-/*
------------------------------------------------------------------------------
-
-    INTERNAL MACROs. 
-
-    DO NOT USE THESE DIRECTLY !!! 
-    SEE EXTERNAL MACROS
-
------------------------------------------------------------------------------
-*/
-
-#ifdef LOGGER_LOGGING
-
-_LIT( KTextFormat, "%S%S" );
-_LIT( KPnpUtil, "PnpUtil| " );
-
-#define INTRLOGTEXT( AAA )                                                                                        \
-    {                                                                                                            \
-    RFileLogger::Write( KPMUILogFolder(), KPMUILogFile(), EFileLoggingModeAppend, AAA );            \
-    }
-#define INTRLOGSTRING( AAA )                                                                                    \
-    {                                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                                    \
-    RFileLogger::Write( KPMUILogFolder(), KPMUILogFile(), EFileLoggingModeAppend, tempLogDes() );    \
-    }
-// 20 chars is left for the formatted item
-#define INTRLOGSTRING2( AAA, BBB )                                                                                \
-    {                                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                                    \
-    RFileLogger::WriteFormat( KPMUILogFolder(), KPMUILogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB ); \
-    }
-// 40 chars is left for the formatted items
-#define INTRLOGSTRING3( AAA, BBB, CCC )                                                                            \
-    {                                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                                    \
-    RFileLogger::WriteFormat( KPMUILogFolder(), KPMUILogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB, CCC ); \
-    }
-#else
-#define INTRLOGTEXT( AAA )
-#define INTRLOGSTRING( AAA )
-#define INTRLOGSTRING2( AAA, BBB )
-#define INTRLOGSTRING3( AAA, BBB, CCC )
-#endif
-
-/*
------------------------------------------------------------------------------
-
-    EXTERNAL MACROs
-
-    USE THESE MACROS IN YOUR CODE !
-
------------------------------------------------------------------------------
-*/
-
-
-#define LOGTEXT( AAA )                { \
-                                    INTRLOGTEXT( AAA ); \
-                                    }   // Example: LOGTEXT( own_desc );
-
-#define LOGSTRING( AAA )            { \
-                                    INTRLOGSTRING( AAA ); \
-                                    }   // Example: LOGSTRING( "Test" );
-
-#define LOGSTRING2( AAA, BBB )        { \
-                                    INTRLOGSTRING2( AAA, BBB ); \
-                                    }  // Example: LOGSTRING( "Test %i", aValue );
-
-#define LOGSTRING3( AAA, BBB, CCC )    { \
-                                    INTRLOGSTRING3( AAA, BBB, CCC ); \
-                                    } // Example: LOGSTRING( "Test %i %i", aValue1, aValue2 );
-
-
-#else   // LOGGING_ENABLED
-
-#define LOGTEXT( AAA ) 
-#define LOGSTRING( AAA ) 
-#define LOGSTRING2( AAA, BBB )    
-#define LOGSTRING3( AAA, BBB, CCC )    
-
-#endif  // LOGGING_ENABLED
-
-// DATA TYPES
-// None.
-
-// FUNCTION PROTOTYPES
-// None.
-
-// FORWARD DECLARATIONS
-// None.
-
-// CLASS DECLARATION
-// None.
-
-#endif  // __LOGGER_H__
--- a/policymanagement/policyengine/policyengineui/inc/PolicyEngUINotifierplugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of policymanagement components
-*
-*/
-
-#ifndef POLICYENGUINOTIFIERPLUGIN_H_
-#define POLICYENGUINOTIFIERPLUGIN_H_
-
-#include <hbdevicedialogplugin.h>
-
-
-class PolicyEngUINotifierplugin : public HbDeviceDialogPlugin
-    {
-
-public:
-    PolicyEngUINotifierplugin();
-    ~PolicyEngUINotifierplugin();
-
-    //interface between client and plugin
-    HbDeviceDialogInterface *createDeviceDialog(
-            const QString &deviceDialogType, const QVariantMap &parameters);
-
-    bool accessAllowed(const QString &deviceDialogType,
-            const QVariantMap &parameters,
-            const QVariantMap &securityInfo) const;
-
-    bool deviceDialogInfo(const QString &deviceDialogType,
-            const QVariantMap &parameters, DeviceDialogInfo *info) const;
-    QStringList deviceDialogTypes() const;
-    PluginFlags pluginFlags() const;
-    int error() const;
-    };
-#endif /* POLICYENGUINOTIFIERPLUGIN_H_ */
--- a/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h	Wed Sep 01 12:27:42 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2002-2004 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"
@@ -13,55 +13,154 @@
 *
 * Description: Implementation of policymanagement components
 *
+*
 */
 
-#ifndef POLICYENGINEUI_H
-#define POLICYENGINEUI_H
+
+#ifndef POLICTY_ENGINE_UI_HEADER_
+#define POLICTY_ENGINE_UI_HEADER_
+
+//  INCLUDES
+#include <e32base.h>
+#include <eiknotapi.h>
+
+//  CONSTANTS
 
-#include <hbdialog.h>
-#include <hbdevicedialoginterface.h>
+_LIT8( KUserAcceptMark, "A");
+_LIT8( KUserDenyMark, "D");
+const TUint KDelimeterChar = '|';
 
-class HbDialog;
-class HbLineEdit;
+enum TUserResponse
+	{
+	EUserAccept,
+	EUserDeny,
+	};
+
+//  FORWARD DECLARATIONS
+
+class CCoeEnv;
+class CPolicyEngineUi;
+
 
-class PolicyEngineUI : public HbDialog, public HbDeviceDialogInterface
-    {
-Q_OBJECT
+class CPolicyEngineNotifier : public CBase, public MEikSrvNotifierBase2
+	{
+	public:
+	
+		CPolicyEngineNotifier();
+		~CPolicyEngineNotifier();
+		static CPolicyEngineNotifier* NewL();
+		void ConstructL();
+		
+		void Complete( TUserResponse aResponse);
+		
+    public: //From MEikSrvNotifierBase2
+    
+		void Release();
+		TNotifierInfo RegisterL();
+		TNotifierInfo Info() const;
+		TPtrC8 StartL(const TDesC8& aBuffer);
+		void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
+		void Cancel();
+		TPtrC8 UpdateL(const TDesC8& aBuffer); 
+		  
+	private:
+		CPolicyEngineUi * iPolicyEngineUi;
+		
+        /**
+        * refers connections is intialized or not
+        */
+        TNotifierInfo         iInfo;             ///< Notifier info
+        
+        TInt iReplySlot;
+        RMessagePtr2 iMessage;
+	};
 
-public:
-    PolicyEngineUI(const QVariantMap& parameters);
-    ~PolicyEngineUI();
-    void DisplayNotificationDialog(const QVariantMap &parameters);
-    void ShowInputDialog();
-    bool verifyFingerPrint();
+
+
+/**
+* This class provides a wrapper for some common dialogs for the policy engine
+*
+* @lib policyengineui.lib
+*/
+class CPolicyEngineUi : public CActive
+    {
+    public:  // Constructors and destructor
 
-public slots:
-    void onOKSelected();
-    void onCancelSelected();
-    void establishTrust();
-    void cancelTrust();
-    void onTrustCreation();
-    void codeTextChanged();
-public:
-    //derived from HbDeviceDialogInterface
-    bool setDeviceDialogParameters(const QVariantMap &parameters);
-    int deviceDialogError() const;
-    void closeDeviceDialog(bool byClient);
-    HbDialog *deviceDialogWidget() const;
+        /**
+        * Constructor.
+        */
+        CPolicyEngineUi();
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPolicyEngineUi* NewL();
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CPolicyEngineUi();
+        
+        void ActivateL( const TDesC8& aCorporate, const TDesC8& aRandomPart, CPolicyEngineNotifier* iNotifier); 
+    
+		void RunL();
+		TInt RunError(TInt aError);
+		void DoCancel();
+
+	public:
 
-signals:
-    //signal to be sent to client
-    void deviceDialogClosed();
-    void deviceDialogData(QVariantMap data);
+        /**
+        * Execute corporate policy question chain, which user deny or accept. One response generated.
+        * @param aCorporate - Corparate name used in queries
+        * @param aRandomPart - Random part of certificate, which user must know.
+        * @return TUserResponse - Response value for user
+        */
+        
+        TUserResponse ShowCorporateConfirmationDialogL( const TDesC8& aCorporate,
+        										   		 const TDesC8& aRandomPart);
+	private:
+	
+		//private enums
+		enum TDialog
+			{
+			EControl = 0, 
+			EQuestion,
+			ERemove,
+			EDenied,
+			EUnMatch
+			};
+		
+		enum TDlgResp
+			{
+			EOkResp,
+			ECancelResp
+			};
+		
+	private:
+	
+        /**
+        * Two-phased constructor.
+        */
+		void ConstructL();
+
+	
+		TInt ShowDialogL( const TDialog& aDialog);
+		TDlgResp ShowConfirmationQueryL( const TDesC& aText, const TBool& aWithCancel );
+		TDlgResp ShowPossessionMessageQueryL();
+		TDlgResp DataQueryL( const TDesC& aText, TDes& aInput );
+
+    private: // Data
     
-private:
-    // number of tries user does
-    int estbTrustCount;
-    QString iServerName;
-    QString iFingerprint;
-    QString iCode;
-    HbLineEdit *mContentEdit;
-    HbDialog* mdialog;
-    };
+    	HBufC * iCorporate;
+    	HBufC * iRandomPart;
+    	TInt iState;
+    	CPolicyEngineNotifier * iNotifier;
+    	
+	    TInt iResourceFileOffset;
+        CCoeEnv* iCoeEnv;  // not owned
+        };
 
-#endif // POLICYENGINEUI_H
+
+#endif      // POLICTY_ENGINE_UI_HEADER_
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/inc/policyengineui.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2003 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:  contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef POLICYENGINEUI_HRH
+#define POLICYENGINEUI_HRH
+
+#define RANDOM_PART_MAX_SIZE 4
+
+#endif      //  APPINST
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/loc/PolicyEngineUI.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* 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 files contains localised strings for policy engine ui
+*
+*/
+
+
+//------------------------------------------------------------------------------
+// Confirmation dialogs 
+//------------------------------------------------------------------------------
+
+//d: Text in an first info note header in corporate policy installation
+//d: Informs that corporate policy request is received from administrator
+//l: heading_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_policyengineui_control_note_header "Security info"
+
+
+//d: Text in an first info note in corporate policy installation
+//d: Informs that corporate policy request is received from administrator
+//d: %U describes corporate name from certificate
+//l: popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_policyengineui_control_note "%U want to control your terminal. It means possibility to see, delete and control data. Accept control?"
+
+
+//d: Text in an user input dialog, when user have to input part of certificate to confirm corporate policy
+//d: %U describes corporate name from certificate
+//l: popup_query_data_window
+//w:
+//r:3.1
+//
+#define qtn_policyengineui_question_note "Write first 4 numbers of %U fingerprint"
+
+//d: Text in an dialog which informs user that the trust has been established
+//l: popup_note_window
+//w:
+//r:3.2.2, 3.2.3, 5.0
+//
+#define qtn_trust_established "Trust established"
+
+//d: Text in an dialog which informs that user denied corporate control
+//d: %U describes corporate name from certificate
+//l: popup_note_window
+//w:
+//r:3.1
+//
+#define qtn_policyengineui_denied_note "%U Control request denied"
+
+//d: Text in an dialog which informs that user input is invalid
+//l: popup_note_window
+//w:
+//r:3.1
+//
+#define qtn_policyengineui_unmatch_note "Input does not match. Please try again"
+
+//d: Text in an dialog which informs that this is a security info
+//l: popup_note_window
+//w:
+//r:3.1
+//
+#define qtn_policyengineui_security_info_note "Security info"
+
+// End of File
--- a/policymanagement/policyengine/policyengineui/src/PolicyEngNotifierplugin.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of policymanagement components
-*
-*/
-
-#include <QtPlugin>
-#include "PolicyEngUINotifierplugin.h"
-#include "PolicyEngineUI.h"
-
-Q_EXPORT_PLUGIN2(PolicyEngUINotifiersplugin, PolicyEngUINotifierplugin)
-
-static const struct
-    {
-    const char *mTypeString;
-    } dialogInfos[] =
-    {
-        {
-        "com.nokia.hb.policymanagementdialog/1.0"
-        }
-    };
-
-    
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::PolicyEngUINotifierplugin()
-// -----------------------------------------------------------------------------    
-PolicyEngUINotifierplugin::PolicyEngUINotifierplugin()
-    {
-    //policyEngUI = new QtPolicyEngineUI();
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::~PolicyEngUINotifierplugin()
-// -----------------------------------------------------------------------------    
-PolicyEngUINotifierplugin::~PolicyEngUINotifierplugin()
-    {
-    //delete policyEngUI;
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::createDeviceDialog()
-// -----------------------------------------------------------------------------    
-HbDeviceDialogInterface* PolicyEngUINotifierplugin::createDeviceDialog(
-        const QString &deviceDialogType, const QVariantMap &parameters)
-    {
-	Q_UNUSED(deviceDialogType);
-    // policyEngUI->DisplayNotificationDialog(parameters);
-    return new PolicyEngineUI(parameters);
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::accessAllowed()
-// Check if client is allowed to use device dialog widget
-// -----------------------------------------------------------------------------    
-bool PolicyEngUINotifierplugin::accessAllowed(
-        const QString &deviceDialogType, const QVariantMap &parameters,
-        const QVariantMap &securityInfo) const
-    {
-	Q_UNUSED(deviceDialogType);
-	Q_UNUSED(parameters);
-	Q_UNUSED(securityInfo);
-    // This plugin doesn't perform operations that may compromise security.
-    // All clients are allowed to use.
-    return true;
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::deviceDialogInfo()
-// -----------------------------------------------------------------------------    
-bool PolicyEngUINotifierplugin::deviceDialogInfo(
-        const QString &deviceDialogType, const QVariantMap &parameters,
-        DeviceDialogInfo *info) const
-    {
-	Q_UNUSED(deviceDialogType);
-	Q_UNUSED(parameters);
-    info->group = GenericDeviceDialogGroup;
-    info->flags = NoDeviceDialogFlags;
-    info->priority = DefaultPriority;
-    return true;
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::deviceDialogTypes()
-// Return device dialog types this plugin implements
-// -----------------------------------------------------------------------------    
-QStringList PolicyEngUINotifierplugin::deviceDialogTypes() const
-    {
-    QStringList types;
-    const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]);
-    for (int i = 0; i < numTypes; i++)
-        {
-        types.append(dialogInfos[i].mTypeString);
-        }
-
-    return types;
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::pluginFlags()
-// Return plugin flags
-// -----------------------------------------------------------------------------    
-HbDeviceDialogPlugin::PluginFlags PolicyEngUINotifierplugin::pluginFlags() const
-    {
-    return NoPluginFlags;
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngUINotifierplugin::error()
-// Return last error
-// -----------------------------------------------------------------------------    
-int PolicyEngUINotifierplugin::error() const
-    {
-    return 0;
-    }
--- a/policymanagement/policyengine/policyengineui/src/PolicyEngineUi.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/policyengineui/src/PolicyEngineUi.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2002-2004 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"
@@ -11,436 +11,539 @@
 *
 * Contributors:
 *
-* Description: Implementation of policymanagement components
+* Description:  This file contains the implementation of PolicyEngineUI
 *
 */
 
-#include "PolicyEngineUI.h"
-#include <hbpopup.h>
-#include <hbinputdialog.h>
-#include <hbdocumentloader.h>
-#include <hbdialog.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <hbnotificationdialog.h>
-#include <hbmessagebox.h>
-#include <hbdevicenotificationdialog.h>
-#include "Logger.h"
+
+// INCLUDE FILES
+#include "PolicyEngineUi.h"
+#include "debug.h"
+#include "policyengineui.hrh"
+#include <policyengineuidlgs.rsg>
 
-const int KMaxTries = 4;
-const int KMaxCodeLength = 4;
+#include <bautils.h>
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <AknQueryDialog.h>
+#include <eikprogi.h>
+#include <aknnotewrappers.h>
+#include <aknmessagequerydialog.h>
+#include <data_caging_path_literals.hrh>
+#include "SyncService.h"
+
+#include <implementationproxy.h>
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::PolicyEngineUI()
-// -----------------------------------------------------------------------------
-PolicyEngineUI::PolicyEngineUI(const QVariantMap& parameters)
-    {
-    estbTrustCount = KMaxTries;
-    DisplayNotificationDialog(parameters);
-    }
+_LIT( KCUIResourceFileName, "PolicyEngineUIDlgs.rsc" );
+const TUid KUidPolicyEngineUi = { 0x10207817 };
+const TUid KScreenOutputChannel = { 0x0000781F };
+
+LOCAL_C void CreateNotifiersL( CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers );
+
+
+// ---------------------------------------------------------
+// CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+// ---------------------------------------------------------
+//
+
+LOCAL_C void CreateNotifiersL( CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers )
+{
+    MEikSrvNotifierBase2 *policyEngineNotifier = CPolicyEngineNotifier::NewL();
+    
+    CleanupStack::PushL( policyEngineNotifier );
+    aNotifiers->AppendL( policyEngineNotifier );
+    CleanupStack::Pop( policyEngineNotifier ); // serNotify
+	RDEBUG("PolicyEngineUI notifier created!");
+}
+
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::~PolicyEngineUI()
-// -----------------------------------------------------------------------------
-PolicyEngineUI::~PolicyEngineUI()
-    {
+CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+    { 
+    CArrayPtrFlat<MEikSrvNotifierBase2>* array =
+    new CArrayPtrFlat<MEikSrvNotifierBase2>( 1 );
 
+    if (array)
+        {
+        TRAPD( err, CreateNotifiersL( array ) );
+        if (err != KErrNone)
+            {
+            delete array;
+            array = NULL;
+            }
+        }
+    return array;
     }
 
+const TImplementationProxy ImplementationTable[] = { {{0x10207817},(TProxyNewLPtr)NotifierArray} };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	RDEBUG("PolicyEngineUI notifier detected!");
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+	return ImplementationTable;
+	}
+
+
+
+CPolicyEngineNotifier::CPolicyEngineNotifier()
+	{
+	}
+
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::DisplayNotificationDialog()
-// Read the parameters sent from client
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::DisplayNotificationDialog(const QVariantMap& parameters)
-    {
-    LOGSTRING( "+ DisplayNotificationDialog +" );
-    QVariantMap::const_iterator i = parameters.constBegin();
+CPolicyEngineNotifier::~CPolicyEngineNotifier()
+	{
+	//delete and close policy engine ui
+	delete iPolicyEngineUi;	
+	}
+
+
+CPolicyEngineNotifier* CPolicyEngineNotifier::NewL()
+	{
+	CPolicyEngineNotifier* self = new (ELeave) CPolicyEngineNotifier();
+	
+	CleanupStack::PushL( self);
+	self->ConstructL();	
+	CleanupStack::Pop();
+	
+	return self;
+	}
+
+void CPolicyEngineNotifier::ConstructL()
+	{
+	}
+		
 
-    while (i != parameters.constEnd())
-        {
-        if (i.key().toAscii() == "serverdisplayname")
-            {
-            iServerName = i.value().toString();
-            }
-        else if (i.key().toAscii() == "fingerprint")
-            {
-            iFingerprint = i.value().toString();
-            }
-        ++i;
-        }
-    
-    TBuf<50> server(iServerName.utf16());
-    TBuf<10> buffer(iFingerprint.utf16());
+void CPolicyEngineNotifier::Release()
+	{
+	delete this;	
+	}
+
 
-    LOGSTRING2( "serverdisplayname %S", &server );
-    LOGSTRING2( "fingerprint %S", &buffer );
+CPolicyEngineNotifier::TNotifierInfo CPolicyEngineNotifier::RegisterL()
+	{
+	//Registration info
+    iInfo.iUid = KUidPolicyEngineUi;
+    iInfo.iPriority = ENotifierPriorityHigh;
+	iInfo.iChannel = KScreenOutputChannel;	
+	
+	return iInfo;
+	}
 
-    ShowInputDialog();
-    LOGSTRING( "- DisplayNotificationDialog -" );
-    }
+
+CPolicyEngineNotifier::TNotifierInfo CPolicyEngineNotifier::Info() const
+	{
+	//Registration info
+	return iInfo;
+	}
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::ShowInputDialog()
-// Show the accept control dialog
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::ShowInputDialog()
-    {
-    LOGSTRING( "+ ShowInputDialog +" );
-    HbDocumentLoader loader;
-    bool ok = false;
-    loader.load(":/xml/dialog.docml", &ok);
-    if (!ok)
-        {
-        return;
-        }
+TPtrC8 CPolicyEngineNotifier::StartL(const TDesC8& /*aBuffer*/)
+	{
+	return KNullDesC8().Ptr();
+	}
+
+
+void CPolicyEngineNotifier::Complete( TUserResponse aResponse)
+	{
+	RDEBUG("CPolicyEngineNotifier::Complete");
 
-    HbDialog *dialog1 =
-            qobject_cast<HbDialog *> (loader.findWidget("dialog"));
+	//Write return value to message and compeltes it
+	if ( aResponse == EUserAccept )
+		{
+		iMessage.Write( iReplySlot, KUserAcceptMark, 0);	
+		}
+	else
+		{
+		iMessage.Write( iReplySlot, KUserDenyMark, 0);	
+		}
+	
+    iManager->CancelNotifier( iInfo.iUid );   // Notify framework we've done
+	iMessage.Complete( KErrNone);
+	}
 
-    //set heading content
-    HbLabel *contentheading = qobject_cast<HbLabel *> (loader.findWidget(
-            "qtl_dialog_pri_heading"));
-    QString heading(hbTrId("txt_device_update_title_security_information"));
-    contentheading->setPlainText(heading);
+
+void CPolicyEngineNotifier::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
+	{
+	RDEBUG("CPolicyEngineNotifier::StartL!");
 
-    //set body content
-    HbLabel *contentbody = qobject_cast<HbLabel *> (loader.findWidget(
-            "qtl_dialog_pri5"));
+	TInt index = aBuffer.Locate( KDelimeterChar);
+	
+	if ( index != KErrNotFound && !iPolicyEngineUi)
+		{	
+		//decode name and fingerprint from message
+		TPtrC8 name = aBuffer.Left( index);
+		TPtrC8 fingerPrint = aBuffer.Mid( index + 1);
 
-    QString body(
-            (hbTrId("txt_device_update_info_1_server_wants_to_contro").arg(
-                    iServerName)));
-    contentbody->setTextWrapping(Hb::TextWordWrap);
-    contentbody->setPlainText(body);
-
-    HbAction *primaryAction = qobject_cast<HbAction *> (
-            dialog1->actions().at(0));
-    HbAction *secondaryAction = qobject_cast<HbAction *> (
-            dialog1->actions().at(1));
+		iReplySlot = aReplySlot;
+		iMessage = aMessage;
 
-    //set dialog properties
-    dialog1->setTimeout(HbPopup::NoTimeout);
-    dialog1->setDismissPolicy(HbPopup::NoDismiss);
+		//Show policy engine ui dialogs
+		iPolicyEngineUi = CPolicyEngineUi::NewL();
+		iPolicyEngineUi->ActivateL( name, fingerPrint, this);
+		}
+	else
+		{
+		Complete( EUserDeny);
+		}
+	}
 
-    QObject::connect(primaryAction, SIGNAL(triggered()), this,
-            SLOT(onOKSelected()));
-    QObject::connect(secondaryAction, SIGNAL(triggered()), this,
-            SLOT(onCancelSelected()));
+
+void CPolicyEngineNotifier::Cancel()
+	{
+	RDEBUG("CPolicyEngineNotifier::Cancel!");
 
-    if (dialog1)
-        dialog1->show();
-
-    LOGSTRING( "- ShowInputDialog -" );
-    }
+	//Delete policy engine ui
+	delete iPolicyEngineUi;
+	iPolicyEngineUi = 0;
+	}
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::onOKSelected()
-// Show the user input dialog once control is accepted
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::onOKSelected()
-    {
-
-    LOGSTRING( "+ onOKSelected +" );
-
-    HbDocumentLoader loader;
-    bool ok = false;
-    loader.load(":/xml/InputDialog.docml", &ok);
-    if (!ok)
-        {
-        return;
-        }
-
-    mdialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
-
-    //set heading content
-    HbLabel *contentheading = qobject_cast<HbLabel *> (loader.findWidget(
-            "qtl_dialog_pri_heading"));
-    QString heading(hbTrId("txt_device_update_title_security_information"));
-    contentheading->setPlainText(heading);
+TPtrC8 CPolicyEngineNotifier::UpdateL(const TDesC8& /*aBuffer*/)
+	{
+	return KNullDesC8().Ptr();
+	}
 
-    //set label
-    HbLabel *contentlabel = qobject_cast<HbLabel *> (loader.findWidget(
-            "HeadingLabel"));
-    contentlabel->setTextWrapping(Hb::TextWordWrap);
-    QString label(
-                (hbTrId("txt_device_update_info_enter_first_4_characters_of").arg(
-                        iServerName)));
-    contentlabel ->setPlainText(label);
-
-    //set length for editline
-    mContentEdit = qobject_cast<HbLineEdit*> (loader.findWidget("InputLine"));
-    mContentEdit->setMaxLength(KMaxCodeLength);
-
-    //set dialog properties
-    mdialog->setTimeout(HbPopup::NoTimeout);
-    mdialog->setDismissPolicy(HbPopup::NoDismiss);
-    
-    HbAction* primaryAction = (HbAction*) (mdialog->actions().at(0));
-    HbAction *secondaryAction = (HbAction*) (mdialog->actions().at(1));
-    primaryAction->setEnabled(false);
-
-    QObject::connect(primaryAction, SIGNAL(triggered()), this,
-            SLOT(establishTrust()));
-    QObject::connect(secondaryAction, SIGNAL(triggered()), this,
-            SLOT(cancelTrust()));
-    QObject::connect(mContentEdit, SIGNAL(contentsChanged()), this,
-            SLOT(codeTextChanged()));
-
-    if (mdialog)
-        mdialog->show();
-
-    LOGSTRING( "- onOKSelected -" );
+CPolicyEngineUi::CPolicyEngineUi()
+	: CActive( EPriorityStandard)
+    {  
     }
 
+void CPolicyEngineUi::ConstructL()
+    {
+	RDEBUG("CPolicyEngineUi::ConstructL!");
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::onCancelSelected()
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::onCancelSelected()
-    {
-    LOGSTRING( "+ onCancelSelected +" );
+    //get pointer to CEikonEnv
+	iCoeEnv = CEikonEnv::Static();    
+    
+    if ( !iCoeEnv )
+    	{
+		RDEBUG("Policy engine ui: CoeEnv not found!");
+        User::Leave( KErrGeneral );        
+    	}
 
-    QVariantMap result;
+	//Open resource file
+    TFileName fileName;
+    fileName.Zero();
+
+    TFileName drivePath;
+    Dll::FileName( drivePath );
+
+    fileName.Append( TParsePtrC( drivePath ).Drive() );
+    fileName.Append( KDC_RESOURCE_FILES_DIR );
+    fileName.Append( KCUIResourceFileName );   
+    
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
 
-    result.insert("keyResponse", -1);
-    emit
-    deviceDialogData(result);
+	//handle to resource file
+    iResourceFileOffset = iCoeEnv->AddResourceFileL( fileName );
+
+	RDEBUG("Policy engine ui resources loaded!");
+ 	}
+
+CPolicyEngineUi* CPolicyEngineUi::NewL()
+	{
+    CPolicyEngineUi* self = new ( ELeave ) CPolicyEngineUi();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self; 
+	}
 
-    emit
-    deviceDialogClosed();
+
+CPolicyEngineUi::~CPolicyEngineUi()
+	{
+	RDEBUG("CPolicyEngineUi::~CPolicyEngineUi()");
 
-    LOGSTRING( "- onCancelSelected -" );
-    }
+    // Close non-modal dialogs
+    if( iResourceFileOffset )
+    	{
+        iCoeEnv->DeleteResourceFile( iResourceFileOffset );
+    	}
+	
+	delete iCorporate;
+	delete iRandomPart;
+	}
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::onTrustCreation()
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::onTrustCreation()
-    {
-    LOGSTRING( "+ onTrustCreation +" );
-    QVariantMap result;
+void CPolicyEngineUi::ActivateL( const TDesC8& aCorporate, const TDesC8& aRandomPart, CPolicyEngineNotifier* aNotifier)
+	{
+	RDEBUG("CPolicyEngineUi::ActivateL");
+
+	//reference to notifier (for message completion)
+	iNotifier = aNotifier;
+	
+	//allocate new space for parameters and save them
+	delete iCorporate;
+	iCorporate = NULL;
+	delete iRandomPart;
+	iRandomPart = NULL;
+	iCorporate = HBufC::NewL( aCorporate.Length());
+	iRandomPart = HBufC::NewL( aRandomPart.Length());
+
+	iCorporate->Des().Copy( aCorporate);
+	iRandomPart->Des().Copy( aRandomPart);	
+	
+	//add active object to active scheduler and set object active
+	CActiveScheduler::Add( this);
+	SetActive();
+	
+	//complete request....
+	TRequestStatus * status = &iStatus;
+	User::RequestComplete( status, KErrNone);	
+	}
+
+
+
+void CPolicyEngineUi::RunL()
+	{
+	RDEBUG("CPolicyEngineUi::RunL()");
+	
+	//in state ERemove user has already accepted query
+	if ( ERemove == iState )
+		{
+		//show info, remove from scheduler
+		ShowDialogL( ERemove);
+		Deque();
+		iNotifier->Complete( EUserAccept);
+		return;		
+		}
+
+	if ( EDenied == iState )
+		{
+		//show info, remove from scheduler
+		ShowDialogL( EDenied);
+		Deque();
+		iNotifier->Complete( EUserDeny);
+		return;		
+		}
 
-    result.insert("keyResponse", 0);
-    emit
-    deviceDialogData(result);
+	//Control dialog
+	if ( EUserAccept == ShowDialogL( (TDialog) iState))
+		{
+		//if user cancel dialog, show deny-dialog and return
+		iState = iState + 1;
+		}
+	else
+		{
+		//user press cancel -> state = EDenied
+		iState = EDenied;
+		}
+	
+	//set active and complete message
+	SetActive();
+	TRequestStatus * status = &iStatus;
+	User::RequestComplete( status, KErrNone);
+	}
+
+// ----------------------------------------------------------------------------
+// CPolicyEngineUi::RunError
+// ----------------------------------------------------------------------------
+TInt CPolicyEngineUi::RunError ( TInt /*aError*/ )
+    {
+       return KErrNone;
+    }	
+
+void CPolicyEngineUi::DoCancel()
+	{
+	}
+
+
 
-    emit
-    deviceDialogClosed();
+CPolicyEngineUi::TDlgResp CPolicyEngineUi::ShowConfirmationQueryL( 
+	const TDesC& aText, const TBool& aWithCancel)
+	{
+	//create dialog
+    CAknQueryDialog* note = 
+        CAknQueryDialog::NewL( CAknQueryDialog::EConfirmationTone );
+				
+	//select correct text resource 					 
+	TInt resource = R_POLICYENGINEUI_CONFIRMATION_QUERY;
+	
+	if ( !aWithCancel )
+		{
+		resource = R_POLICYENGINEUI_CONFIRMATION;
+		}			   
+						
+	//execute dialog, dialog contains self destruction			 
+    TInt response = note->ExecuteLD( resource, aText );
+    
+	if ( response )
+		{
+		return EOkResp;
+		}
+	
+	return ECancelResp;
+	}
 
-    LOGSTRING( "- onTrustCreation -" );
-    }
+
+CPolicyEngineUi::TDlgResp CPolicyEngineUi::DataQueryL( const TDesC& aText, TDes& aInput )
+	{
+
+	//Create dialog with reference to input descriptor
+	CAknTextQueryDialog* dlg = 
+		CAknTextQueryDialog::NewL( aInput, CAknQueryDialog::ENoTone);
+
+	//set prompt
+	CleanupStack::PushL( dlg);
+	dlg->SetPromptL( aText);
+	CleanupStack::Pop();
+	
+	//execute dialog, dialog contains self destruction			 
+	TInt response = dlg->ExecuteLD( R_POLICYENGINEUI_DATA_QUERY);
+	
+	if ( response )
+		{
+		return EOkResp;
+		}
+	
+	return ECancelResp;
+	}
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::establishTrust()
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::establishTrust()
-    {
-    LOGSTRING( "+ establishTrust +" );
-    bool retVal; // return value from code verification API.
-    estbTrustCount--;
-    retVal = verifyFingerPrint();
-
-    if (retVal)
-        {
-        LOGSTRING( "Trust Created" );
-        //Reset the counter.
-        estbTrustCount = 0;
-        onTrustCreation();
+TInt CPolicyEngineUi::ShowDialogL( const TDialog& aDialog)
+	{
+	TInt response = EUserDeny;
 
-        }
-    else
-        {
-        //check the number of tries.
-        if (estbTrustCount == 0)
-            {
-            //Access denied.
-            LOGSTRING( "Access Denied" );
-            HbMessageBox *msgBox = new HbMessageBox();
-            msgBox->setHeadingWidget(new HbLabel(hbTrId(
-                    "txt_device_update_title_security_information")));
-
-            msgBox->setText(hbTrId(
-                    "txt_device_update_info_security_info_access_denied"));
-            msgBox->setTimeout(HbDialog::NoTimeout);
-            msgBox->setDismissPolicy(HbDialog::NoDismiss);
-
-            HbAction *action = (HbAction*) (msgBox->actions().at(0));
-            QObject::connect(action, SIGNAL(triggered()), this,
-                    SLOT(onCancelSelected()));
+	//select correct dialog
+	switch ( aDialog)
+		{
+		case EControl : 
+			{
+			response = ShowPossessionMessageQueryL();
+			break;
+			}
+		case ERemove:
+			{
+			//load resource
+		    HBufC* displayString = StringLoader::LoadLC( R_POLICYENGINEUI_TRUST_ESTABLISHED );
+			
+			TInt length1 = displayString->Length();
+			HBufC16* trustString = HBufC16::NewLC ( length1  );
+			TPtr bufPtr = trustString -> Des();
+			bufPtr.Append (*displayString);
+			// Hide background connecting note
+			CSyncService *syncService =
+                            CSyncService::NewL(NULL, KDevManServiceStart);
+                    if (syncService)
+                        {
+                        syncService->EnableProgressNoteL(EFalse);
+                        }
 
-            msgBox->show();
-            }
-        else
-            {
-            LOGSTRING2( "tries left %i", estbTrustCount );
-            //Code didnot match.
-            HbDocumentLoader loader;
-            bool ok = false;
-            loader.load(":/xml/InputDialog.docml", &ok);
-            if (!ok)
-                {
-                return;
-                }
-
-            mdialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
-
-            //set heading content
-            HbLabel *contentheading = qobject_cast<HbLabel *> (
-                    loader.findWidget("qtl_dialog_pri_heading"));
-            contentheading->setTextWrapping(Hb::TextWordWrap);
-            QString heading(hbTrId(
-                    "txt_device_update_title_security_information"));
-            contentheading->setPlainText(heading);
+                    delete syncService;
+			
+			response = ShowConfirmationQueryL( *trustString, EFalse);
+			CleanupStack::PopAndDestroy();
+			CleanupStack::PopAndDestroy();
+			
+			break;
+			}
+		case EDenied:
+			{
+			//load resource
+			TBuf<100> array(*iCorporate);
+		  HBufC* displayString = StringLoader::LoadLC( R_POLICYENGINEUI_DENIED_NOTE, array);
+			
+			//show dialog and get response
+			response = ShowConfirmationQueryL( *displayString, EFalse);
+			//delete resource
+			CleanupStack::PopAndDestroy();
+			
+			break;
+			}		
+		case EUnMatch:
+			{
+			//load resource
+		    HBufC* displayString = StringLoader::LoadLC( R_POLICYENGINEUI_UNMATCH_NOTE);
+			
+			//show dialog and get response
+			response = ShowConfirmationQueryL( *displayString, ETrue);
+			//delete resource
+			CleanupStack::PopAndDestroy();
+			
+			break;
+			}
+		case EQuestion:
+			{
+			//question note prompt
+			TBuf<100> array(*iCorporate);
+    		HBufC* displayString = StringLoader::LoadLC( R_POLICYENGINEUI_QUESTION_NOTE,array);
+			TBuf<RANDOM_PART_MAX_SIZE> input;
+			TBool ready = EFalse;
 
-            //set label
-            HbLabel *contentlabel = qobject_cast<HbLabel *> (
-                    loader.findWidget("HeadingLabel"));
-            QString
-                    label(
-                            (hbTrId(
-                                    "txt_device_update_info_security_information_did_no").arg(
-                                    estbTrustCount)));
-
-            contentlabel->setTextWrapping(Hb::TextWordWrap);
-            contentlabel->setPlainText(label);
-
-            mContentEdit = qobject_cast<HbLineEdit*> (loader.findWidget(
-                    "InputLine"));
-            mContentEdit->setMaxLength(KMaxCodeLength);
-
-            mdialog->setTimeout(HbPopup::NoTimeout);
-            mdialog->setDismissPolicy(HbPopup::NoDismiss);
-
-            HbAction* primaryAction = qobject_cast<HbAction*> (
-                    mdialog->actions().at(0));
-            HbAction *secondaryAction = qobject_cast<HbAction*> (
-                    mdialog->actions().at(1));
-            primaryAction->setEnabled(false);
-
-            QObject::connect(primaryAction, SIGNAL(triggered()), this,
-                    SLOT(establishTrust()));
-            QObject::connect(secondaryAction, SIGNAL(triggered()), this,
-                    SLOT(cancelTrust()));
-            QObject::connect(mContentEdit, SIGNAL(contentsChanged()), this,
-                    SLOT(codeTextChanged()));
-
-            if (mdialog)
-                mdialog->show();
-            }
-        }
-    LOGSTRING( "- establishTrust -" );
-    }
+			//until cancel pressed or valid user gives valid certificate part
+			while ( !ready)
+				{
+				//data query
+				CPolicyEngineUi::TDlgResp resp = DataQueryL( *displayString, input);
+				if ( resp == EUserAccept )
+					{
+					if ( input.CompareF( *iRandomPart) != 0)
+						{
+						//if user input doesn't match
+						if ( EUserDeny == ShowDialogL( EUnMatch))
+							{
+							//if user cancel dialog, show deny-dialog and return
+							response = EUserDeny;
+							break;
+							}			
+						}
+					else
+						{
+						response = EUserAccept;
+						ready = ETrue;				
+						}
+					}
+				else
+					{
+					//if user cancel dialog, show deny-dialog and return
+					response = EUserDeny;
+					break;
+					}
+				}	
+	
+			//delete resource
+			CleanupStack::PopAndDestroy();
+			break;
+			}
+		default:
+		break;
+		}
+	
+	return response;
+	}
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::cancelTrust()
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::cancelTrust()
-    {
-    LOGSTRING( "+ cancelTrust +" );
-    //Reset the counter.
-    estbTrustCount = 0;
-
-    QVariantMap result;
-    result.insert("keyResponse", -1);
-    emit
-    deviceDialogData(result);
-
-    emit
-    deviceDialogClosed();
-    LOGSTRING( "- cancelTrust -" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::setDeviceDialogParameters()
-// -----------------------------------------------------------------------------
-bool PolicyEngineUI::setDeviceDialogParameters(const QVariantMap &parameters)
-    {
-	Q_UNUSED(parameters);
-    LOGSTRING( "+ setDeviceDialogParameters +" );
-    return true;
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::deviceDialogError()
-// Get error
-// -----------------------------------------------------------------------------
-int PolicyEngineUI::deviceDialogError() const
-    {
-    LOGSTRING( "+ deviceDialogError +" );
-    return 0;
-    }
+CPolicyEngineUi::TDlgResp CPolicyEngineUi::ShowPossessionMessageQueryL()
+	{
+	HBufC* securityInfoString = StringLoader::LoadLC( R_POLICYENGINEUI_SECURITY_INFO_NOTE );
+	TBuf<60> buffer;
+	buffer.Copy( *securityInfoString );
+	CleanupStack::PopAndDestroy( securityInfoString );
+		
+	//load resource
+	TBuf<100> array(*iCorporate);
+  HBufC* displayString = StringLoader::LoadLC( R_POLICYENGINEUI_CONTROL_NOTE, array);
+			
+			
+	//show dialog and get response
+	CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( *displayString );
+    dlg->PrepareLC( R_POLICY_ENGINE_POSSESSION_INFO );
+    dlg->QueryHeading()->SetTextL( buffer );
+    TInt response = dlg->RunLD();
+    
+    CleanupStack::PopAndDestroy();
+    
+	if ( response )
+		{
+		return EOkResp;
+		}
+	
+	return ECancelResp; 
+	}
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::PolicyEngineUI()
-// Close device dialog
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::closeDeviceDialog(bool byClient)
-    {
-	Q_UNUSED(byClient);
-    LOGSTRING( "+ closeDeviceDialog +" );
-    close();
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::PolicyEngineUI()
-// Return display widget
-// -----------------------------------------------------------------------------
-HbDialog *PolicyEngineUI::deviceDialogWidget() const
-    {
-    LOGSTRING( "+ deviceDialogWidget +" );
-    return const_cast<PolicyEngineUI*> (this);
-    }
 
 
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::PolicyEngineUI()
-// Verify the user entered code
-// -----------------------------------------------------------------------------
-bool PolicyEngineUI::verifyFingerPrint()
-    {
-    LOGSTRING( "+ verifyFingerPrint +" );
 
-    QString enteredCode = mContentEdit->text();
-    TBuf<10> buffer(enteredCode.utf16());
-
-    LOGSTRING2( "User entered code %i", &buffer);
-    LOGSTRING2( "User entered code %S", &buffer);
-
-    if (enteredCode.compare(iFingerprint, Qt::CaseInsensitive) == 0)
-    {
-        LOGSTRING( "+ fingerprint MATCH !!!! +" );
-        return true;
-    }
-    else
-    {
-        LOGSTRING( "+  fingerprint DOESNOT MATCH  +" );
-        return false;
-    }
-    }
-
-
-// -----------------------------------------------------------------------------
-// PolicyEngineUI::codeTextChanged()
-// checks the entered text length and enables the OK option accordingly.
-// -----------------------------------------------------------------------------
-void PolicyEngineUI::codeTextChanged()
-    {
-    QString str = mContentEdit->text();
-
-    if (str.length() >= KMaxCodeLength)
-        mdialog->actions().at(0)->setEnabled(true);
-    else
-        mdialog->actions().at(0)->setEnabled(false);
-    }
--- a/policymanagement/policyengine/rom/policyengine.iby	Tue Aug 31 16:04:06 2010 +0300
+++ b/policymanagement/policyengine/rom/policyengine.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -23,10 +23,8 @@
 	S60_APP_EXE(PolicyEngineServer)
 	S60_APP_EXE(CentRepToolServer)
 	file=ABI_DIR\BUILD_DIR\CentRepTool.dll      											SHARED_LIB_DIR\CentRepTool.dll
+	ECOM_PLUGIN(PolicyEngineUI.dll, PolicyEngineUI.rsc)
 	ECOM_PLUGIN(PMRFsPlugin.dll, PMRFsPlugin.rsc)
-	
-data=/epoc32/data/z/resource/plugins/devicedialogs/PolicyEngUINotifiersplugin.qtplugin		resource/plugins/devicedialogs/PolicyEngUINotifiersplugin.qtplugin
-file=ABI_DIR/BUILD_DIR/PolicyEngUINotifiersplugin.dll		SHARED_LIB_DIR/PolicyEngUINotifiersplugin.dll
 //#endif
 
 #endif
--- a/policymanagement/policymanagement.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  Policy Management project file
-#
-TEMPLATE = subdirs
-
-SUBDIRS  += policyengine 
-
-CONFIG += ordered
-
-symbian: {
-SYMBIAN_PLATFORMS = WINSCW \
-    ARMV5
-    }
--- a/remotemgmt.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  Remote Management project file
-#
-TEMPLATE = subdirs
-
-SUBDIRS  += policymanagement \
-						fotaapplication
-
-CONFIG += ordered
-
-symbian: {
-SYMBIAN_PLATFORMS = WINSCW \
-    ARMV5
-    }
--- a/remotemgmt_plat/common_agent_util_and_definitions_api/inc/nsmlconstants.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/common_agent_util_and_definitions_api/inc/nsmlconstants.h	Wed Sep 01 12:27:42 2010 +0100
@@ -216,10 +216,8 @@
 	{
 public:
 	inline static void PushL(T* aPtr);
-	inline static void PushL(T& aRef);
 private:
 	static void RPtrArrayDelete(TAny *aPtr);
-	static void LocalRPtrArrayDelete(TAny *aPtr);
 	};
 
 template <class T>
@@ -229,12 +227,6 @@
 	}
 
 template <class T>
-inline void CleanupRPtrArrayDelete<T>::PushL(T& aRef)
-    {
-    CleanupStack::PushL(TCleanupItem(&LocalRPtrArrayDelete,&aRef));
-    }
-
-template <class T>
 void CleanupRPtrArrayDelete<T>::RPtrArrayDelete(TAny *aPtr)
 	{
 	T* ptr = STATIC_CAST(T*,aPtr);
@@ -243,23 +235,44 @@
 	}
 
 template <class T>
-void CleanupRPtrArrayDelete<T>::LocalRPtrArrayDelete(TAny *aPtr)
-    {
-    T* ptr = STATIC_CAST(T*,aPtr);
-    ptr->ResetAndDestroy();
-    }
-
-template <class T>
 inline void CleanupRPtrArrayPushL(T* aPtr)
 	{
 	CleanupRPtrArrayDelete<T>::PushL(aPtr);
 	}
 
+// RImplInfoPtrArray cleanup pusher
 template <class T>
-inline void CleanupRPtrArrayPushL(T& aRef)
-    {
-    CleanupRPtrArrayDelete<T>::PushL(aRef);
-    }
+class CleanupRImplInfoPtrArrayDelete
+	{
+public:
+	inline static void PushL(T* aPtr);
+private:
+	static void RImplInfoPtrArrayDelete(TAny *aPtr);
+	};
+
+template <class T>
+inline void CleanupRImplInfoPtrArrayDelete<T>::PushL(T* aPtr)
+	{
+	CleanupStack::PushL(TCleanupItem(&RImplInfoPtrArrayDelete,aPtr));
+	}
+
+template <class T>
+void CleanupRImplInfoPtrArrayDelete<T>::RImplInfoPtrArrayDelete(TAny *aPtr)
+	{
+	if( aPtr )
+		{
+		T* ptr = STATIC_CAST(T*,aPtr);
+		ptr->ResetAndDestroy();
+        ptr->Close();
+		}
+	}
+
+template <class T>
+inline void CleanupRImplInfoPtrArrayPushL(T* aPtr)
+	{
+	CleanupRImplInfoPtrArrayDelete<T>::PushL(aPtr);
+	}
+
 
 // Table names
 _LIT( KNSmlTableVersion, "Version" );
--- a/remotemgmt_plat/common_agent_util_and_definitions_api/tsrc/group/TestSyncAgent.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/common_agent_util_and_definitions_api/tsrc/group/TestSyncAgent.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -37,7 +37,11 @@
 
 USERINCLUDE     ../inc 
 
-MW_LAYER_SYSTEMINCLUDE
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
--- a/remotemgmt_plat/data_synchronization_notification_api/inc/DataSyncInternalPSKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/data_synchronization_notification_api/inc/DataSyncInternalPSKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -19,6 +19,15 @@
 
 #ifndef SYNCML_DATASYNC_INTERNAL_PS_KEYS_H
 #define SYNCML_DATASYNC_INTERNAL_PS_KEYS_H
+/**
+*Device manager key UID
+*/
+const TUid KPSUidNSmlDSSyncApp = {0x101F6DE4};
+
+/**
+*PubSub key used for handling Sync Cancel operation.
+*/
+const TUint32  KDsJobCancel = 0x00000001; 
 
 /**
 * SyncML Data Synchronization Internal P&S Keys UID
--- a/remotemgmt_plat/data_synchronization_plugin_api/tsrc/group/TestStoreFormat.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/data_synchronization_plugin_api/tsrc/group/TestStoreFormat.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -38,7 +38,11 @@
 
 USERINCLUDE     ../inc 
 
-MW_LAYER_SYSTEMINCLUDE
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 START RESOURCE NSmlContactsDataStoreFormat_1_2.rss
 HEADER
--- a/remotemgmt_plat/dcmo_adapter_api/inc/DcmoConst.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/dcmo_adapter_api/inc/DcmoConst.h	Wed Sep 01 12:27:42 2010 +0100
@@ -51,4 +51,22 @@
 EDcmoUnknown
 };
 
+
+enum TLawMoStatus
+{
+    ELawMoSuccess,
+    ELawMoOk,
+    ELawMoFail,
+    ELawMoFullyLockFailed,
+    ELawMoPartialLockFailed,
+    ELawMoUnlockFailed,
+    ELawMoWipeSuccess,
+    ELawMoWipeFailed,
+    ELawMoWipeNotPerformed,
+    ELawMoUserCancelled,
+	ELawMoAccepted,
+	ELawMoInvalid,
+    ELawMoUnknown
+};
+
 #endif// __DCMOCONST_H__
--- a/remotemgmt_plat/dcmo_control_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/dcmo_control_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -25,4 +25,5 @@
 PRJ_EXPORTS
 
 ../inc/dcmoClientBase.h	     	MW_LAYER_PLATFORM_EXPORT_PATH(dcmoclientbase.h)
-../inc/dcmoClient.h	     			MW_LAYER_PLATFORM_EXPORT_PATH(dcmoclient.h)
+../inc/dcmoClient.h	     	MW_LAYER_PLATFORM_EXPORT_PATH(dcmoclient.h)
+../inc/lawmoclient.h		MW_LAYER_PLATFORM_EXPORT_PATH(lawmoclient.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dcmo_control_api/inc/lawmoclient.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  header file for lawmo Client
+*
+*/
+
+#ifndef __LAWMOCLIENT_H__
+#define __LAWMOCLIENT_H__
+
+
+#include <e32base.h>
+#include <f32file.h>
+#include <dcmoconst.h>
+
+// needed for creating server thread.
+
+class RLawmoClient : public RSessionBase
+    {
+public:
+
+	/**
+	 * connects to DCMOServer
+	 * @param None
+	 * @return KErrNone Symbian error code
+	 */	
+	IMPORT_C TInt Connect();  
+	/**
+	 * Close server connection
+	 * @param None
+	 * @return None
+	 */
+	IMPORT_C void Close();
+	/**
+	* Wipe the contents of the Device
+	* @param None
+	* @return None
+	*/
+	IMPORT_C TLawMoStatus DeviceWipe();
+
+	/**
+	* Wipe All the contents in the Device
+	* @param None
+	* @return None
+	*/
+	IMPORT_C TLawMoStatus DeviceWipeAll( );
+
+	/**
+	/*Fetches the ListItemName of the lawmo node
+	* @param ItemName - Node on which this fetch is initiated
+	* @param NodeValue- List Item name value
+	* @return Symbian error code
+	*/
+	IMPORT_C TInt GetListItemName( TDes& aItemName, TDes& aNodeValue);
+
+	/**
+	/*Fetches the tobewiped of the lawmo node
+	* @param ItemName - Node on which this fetch is initiated
+	* @param NodeValue- List Item name value
+	* @return Symbian error code
+	*/
+	IMPORT_C TInt GetToBeWipedValue( TDes& aItemName, TBool& aWipeVal);
+
+	/**
+	/*Sets the wipe value for the lawmo node	
+	* @param ItemName - Node on which this operation is initiated
+	* @param NodeValue- wipe value
+	* @return Symbian error code
+	*/	
+	IMPORT_C TInt SetToBeWipedValue( TDes& aItemName, TInt aWipeVal );
+
+private:
+
+    };
+
+#endif // __LAWMOCLIENT_H__
--- a/remotemgmt_plat/device_management_parameter_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/device_management_parameter_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -25,3 +25,4 @@
 PRJ_EXPORTS
 
 ../inc/DevManInternalCRKeys.h     MW_LAYER_PLATFORM_EXPORT_PATH(DevManInternalCRKeys.h)
+../inc/lawmoadaptercrkeys.h	  MW_LAYER_PLATFORM_EXPORT_PATH(lawmoadaptercrkeys.h)
\ No newline at end of file
--- a/remotemgmt_plat/device_management_parameter_api/inc/DevManInternalCRKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/device_management_parameter_api/inc/DevManInternalCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -136,7 +136,7 @@
 * If value is 1  then locked profile values can changed.
 * 
 */
-const TUint32 KDevManEnableHbNotifier = 0x0000000F; 
+const TUint32 KDevOverrideProfileLock = 0x0000000F; 
 
 /*
 * This key is used to store the External memory card status for DCMO
@@ -149,5 +149,32 @@
 */
 const TUint32 KDevManMemCardCtrl = 0x00000010; 
 
+/*
+* This key is used to indicate whether the privacy policy disclaimer has been accepted
+* Default value : 0 
+* Allowed values.
+* 0,1 or 2 
+* If value is 0 when disclaimer not accepted
+* If value is 1 when disclaimer has been accepted
+* If value is 2 if the dialog has been displayed but not accepted yet
+* 
+*/
+const TUint32 KDMDisclaimerAccepted = 0x00000011;
+
+/*
+* This key stores the TargetRef for SCOMO to send Alert. Default value is null.
+*/
+const TUint32 KNSmlDMSCOMOTargetRef = 0x00000012;
+
+const TUint32 KLAWMOPhoneLock = 0x00000013;
+
+const TUint32 KLAWMOfactoryDmProfileID = 0x00000014;
+
+const TUint32 KMaxFactoryDMProfileId = 0x00000015;
+
+const TUint32 KLAWMOfactoryDmServerName = 0x00000016;
+
+const TUint32 KLAWMOfactoryDmServerID = 0x00000017;
+
 #endif // SYNCML_DEVMAN_INTERNAL_CR_KEYS_H
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/device_management_parameter_api/inc/lawmoadaptercrkeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,38 @@
+/*
+*  Name        : LawmoadapterCRKeys.h
+*  Part of     : Lawmoadapter
+*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of dm adapters
+* 	This is part of omadmextensions.
+*
+*/
+
+#ifndef LAWMOADAPTERCRKEYS_H
+#define LAWMOADAPTERCRKEYS_H
+
+// CONSTANTS
+
+// key uid
+const TUid KCRUidLawmoAdapter = {0x2002EA22};
+
+// State of Lawmo Adapter
+const TUint32 KLawmoRootNode = 0x00000001;
+const TUint32 KLawmoCorrelator = 0x00000002;
+const TUint32 KLawmoWipeStatus = 0x00000003;
+const TUint32 KLawmoSourceURI = 0x00000004;
+
+#endif // LawmoADAPTERCRKEYS_H
+            
+// End of File
--- a/remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* 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:  File that exports the files belonging to 
-:                device management Dialogs
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/devicedialogconsts.h     	MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogconsts.h)
-../inc/dmindicatorconsts.h		MW_LAYER_PLATFORM_EXPORT_PATH(dmindicatorconsts.h)
-../inc/devicedialogsymbian.h		MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogsymbian.h)
--- a/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* 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:  Orbit specific constants for the device dialog.
-*
-*/
-
-#ifndef DEVICEDIALOGCONSTS_H_
-#define DEVICEDIALOGCONSTS_H_
-
-#include <e32def.h>
-#include <qstring.h>
-
-/// Number of retries for PIN
- const TInt KPinRetries = 3;
- 
- // PIN Max Length
- const TInt KCPPinMaxLength = 20;
- 
-//Strings for CP PIN Query Dialog
-const QString pinquery = "omacppinquery";
-
-const char devicedialogtype[] = "com.nokia.hb.devicemanagementdialog/1.0";
-_LIT(KDeviceDialogType, "com.nokia.hb.devicemanagementdialog/1.0");
-
-// Keys for the QVariantMap
-
-const QString keydialog = "Dialog";
-const QString keyparam1 = "Param1";
-const QString keyparam2 = "Param2";
-const QString keyparam3 = "Param3";
-const QString keyparam4 = "Param4";
-const QString returnkey = "returnkey";
-
-_LIT(KKeyDialog, "Dialog");
-_LIT(KKeyParam1, "Param1");
-_LIT(KKeyParam2, "Param2");
-_LIT(KKeyParam3, "Param3");
-_LIT(KKeyParam4, "Param4");
-_LIT(KResult,"returnkey");
-
-// Enumerations to show the type of dialog to be shown from FOTA. The Enumeration ranges from 1 to 100.
-
-enum TFwUpdNoteTypes
-    {
-    //Download related notes
-    EFwDLNeedMoreMemory = 100,
-    EFwDLConnectionFailure,
-    EFwDLGeneralFailure,
-    EFwDLNonResumableFailure,
-    
-    //Updated related notes	
-    EFwUpdNotEnoughBattery,
-    EFwUpdDeviceBusy,
-		EFwUpdSuccess,
-		EFwUpdNotCompatible,
-    EFwUpdRebootNote,
-    
-		//Download related query
-		EFwUpdResumeDownload,
-		
-		//Update related query    
-    EFwUpdResumeUpdate
-    
-    };
- 
- enum TOmaCPPinDialogTypes
-    {
-    //Download related notes
-    EOmaCPPinDialog = 200
-    
-		};  
- 
-
-enum THbNotifierKeys 
-    {
-    EHbNotifierStatus = 10,
-    EHbNotifierStatusReturn // Return the content of actual status value accepted from UI
-    };
-
-enum TSoftkeys
-    {
-    EHbLSK = 1,
-    EHbMSK,
-    EHbRSK
-    };
-
-
-
-#endif /* DEVICEDIALOGCONSTS_H_ */
--- a/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogsymbian.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* 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:  Symbian specific constants for the device dialog.
-*
-*/
-
-
-
-#ifndef DEVICEDIALOGSYMBIAN_H
-#define DEVICEDIALOGSYMBIAN_H
-
-//  INCLUDES
-
-// CONSTANTS
-const TUint KSyncMLMaxServerMsgLength = 200;
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class TSyncMLAppLaunchNotifParams;
-class TSyncMLDlgNotifParams;
-
-enum TSyncMLSessionTypes
-    {
-    ESyncMLUnknownSession,
-    ESyncMLSyncSession,
-    ESyncMLMgmtSession,
-    };
-
-enum TSyncMLDlgNoteTypes
-    {
-    ESyncMLInfoNote,
-    ESyncMLErrorNote,
-    ESyncMLOkQuery,
-    ESyncMLYesNoQuery
-  };
-  
-enum TSyncMLSANSupport
-    {
-    ESANNotSpecified,
-    ESANSilent,
-    ESANUserInformative,
-    ESANUserInteractive
-    };
-
-/**
-* Struct to allow the sending of parameters to SyncML application
-* starter notifier plugin.
-*
-*  @lib SyncMLNotifier
-*  @since Series 60 3.0
-*/
-class TSyncMLAppLaunchNotifParams
-	{
-    public:
-        // Type of the SyncML session to be initiated. 
-	    TSyncMLSessionTypes iSessionType;
-        // Identifier of the job requested.
-	    TInt iJobId;
-	    // Identifier of the profile used
-	    TInt iProfileId;
-       // Server alert Ui mode
-	    TInt iUimode;
-	};
-/**
-* Struct to allow the sending of parameters to SyncML server
-* dialog notifier plugin.
-*
-*  @lib SyncMLNotifier
-*  @since Series 60 3.0
-*/
-class TSyncMLDlgNotifParams
-	{
-    public:
-        // Type of the query or note to be shown.
-	    TSyncMLDlgNoteTypes iNoteType;
-        // Message to be shown on the screen.
-	    TBufC<KSyncMLMaxServerMsgLength> iServerMsg;		   
-        // Timeout of the note (in seconds). 0 = No timeout.
-	    TInt iMaxTime;
-	    //Max length
-	    TInt iMaxLength;	    
-	};
-	
-
-#endif      // DEVICEDIALOGSYMBIAN_H   
-
-// End of File
--- a/remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* 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:  constants for the device indicator.
-*
-*/
-
-#ifndef DMINDICATORCONSTS_H_
-#define DMINDICATORCONSTS_H_
-
-#include <qstring.h>
-
-//Indicators strings
-const QString KDMProgressIndicatorType =
-        "com.nokia.devicemanagement.progressindicatorplugin/1.0";
-const QString KDMNotificationIndicatorType =
-        "com.nokia.devicemanagement.notificationindicatorplugin/1.0";
-const QString KDMSettingsIndicatorType =
-        "com.nokia.devicemanagement.settingsindicatorplugin/1.0";
-const QString KScomoProgressIndicatorType =
-        "com.nokia.scomo.progressindicatorplugin/1.0";
-const QString KScomoNotificationIndicatorType =
-        "com.nokia.scomo.notificationindicatorplugin/1.0";
-        
-       
-const QString KTarmTrustManagementActive = "ManagementActive";
-const QString KTarmTrustTerminalSecurity = "TerminalSecurity";
-
-
-#endif /* DMINDICATORCONSTS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/diagnostics_framework_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="6785e3ef1cc0173dbbadb6541864411d" dataversion="1.0">
+  <name>Diagnostics Framework API</name>
+  <description>An API for loading and executing diagnostics test cases.</description>
+  <type>c++</type>
+  <subsystem>devicediagnosticsfw</subsystem>
+  <libs>
+    <lib name="diagframework.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                Diagnostics Framework API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/diagframeworkdebug.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagFrameworkDebug.h)
+../inc/diagengineobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagEngineObserver.h)
+../inc/diagappcommand.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagAppCommand.h)
+../inc/diagengine.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagEngine.h)
+../inc/diagpluginexecplan.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagPluginExecPlan.h)
+../inc/diagenginecommon.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagEngineCommon.h)
+../inc/diagexecplanentry.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagExecPlanEntry.h)
+../inc/diagenginewatchdogtypes.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagEngineWatchdogTypes.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagappcommand.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 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:  List of commands that plug-ins can request from application.
+*
+*/
+
+
+#ifndef DIAGAPPCOMMAND_H
+#define DIAGAPPCOMMAND_H
+
+/**
+*  Diagnostics Application command types.
+*
+*  This is a list of command that plug-in can request from the application.
+* 
+*/
+enum TDiagAppCommand
+    {
+    /**
+    * EDiagAppCommandSwitchToMainView
+    *
+    * This command can be used by interactive view plug-in to notify the 
+    * application that plug-in is done with current view and application can
+    * switch to main view. View to switch to is determined by the application.
+    *
+    * aParam1:      No parameter is needed. Always pass NULL.
+    * aParam2:      No parameter is needed. Always pass NULL.
+    *
+    * @code
+    *   
+    *   ExecutionParam().Engine().ExecuteAppCommandL( 
+    *       EDiagAppCommandSwitchToMainView, 
+    *       NULL,
+    *       NULL );
+    *   
+    *   or
+    *   
+    *   TRAPD( err, ExecutionParam().Engine().ExecuteAppCommandL( 
+    *                   EDiagAppCommandSwitchToMainView, 
+    *                   NULL,
+    *                   NULL ) );
+    *   
+    */
+    EDiagAppCommandSwitchToMainView = 1
+    };
+
+#endif // DIAGAPPCOMMAND_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagengine.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,295 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagEngine
+*
+*/
+
+
+#ifndef DIAGENGINE_H
+#define DIAGENGINE_H
+
+
+// system includes
+#include <e32base.h>                // CBase
+
+// user includes.
+#include <DiagEngineCommon.h>       // MDiagEngineCommon
+
+// Forward declarations
+class MDiagEngineObserver;
+class RDiagResultsDatabase;
+class CDiagPluginPool;
+class CDiagEngineImpl;
+
+
+/**
+*  Diagnostics Framework Engine 
+*
+*  This class is used by the client to execute tests and load plug-ins.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagEngine ) : public CBase,
+                                   public MDiagEngineCommon
+    {
+public:
+
+    /**
+    * Two-phased constructors. 
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aDisableDependency    if ETrue, plug-ins should execute
+    *                      event if dependencies are not met.
+    * @param aExecutionBatch array of plug-ins to execute.
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewL( CAknViewAppUi&          aViewAppUi, 
+                                       MDiagEngineObserver&    aObserver,
+                                       RDiagResultsDatabase&   aDbSession,
+                                       CDiagPluginPool&        aPluginPool,
+                                       TBool                   aDisableDependency,
+                                       const RArray< TUid >&   aExecutionBatch );
+
+    /**
+    * Two-phased constructors. This is identical to NewL, except that it will 
+    * keep newl instance in clean up stack.
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aDisableDependency    if ETrue, plug-ins should execute
+    *                      event if dependencies are not met.
+    * @param aExecutionBatch array of plug-ins to execute.
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewLC( CAknViewAppUi&          aViewAppUi, 
+                                        MDiagEngineObserver&    aObserver,
+                                        RDiagResultsDatabase&   aDbSession,
+                                        CDiagPluginPool&        aPluginPool,
+                                        TBool                   aDisableDependency,
+                                        const RArray< TUid >&   aExecutionBatch );
+    /**
+    * Two-phased constructors. 
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *   
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewL( CAknViewAppUi&          aViewAppUi, 
+                                       MDiagEngineObserver&    aObserver,
+                                       RDiagResultsDatabase&   aDbSession,
+                                       CDiagPluginPool&        aPluginPool,
+                                       TUid                    aIncompleteRecordUid );
+
+    /**
+    * Two-phased constructors. This is identical to NewL, except that it will 
+    * keep newl instance in clean up stack.
+    *
+    * @param aViewAppUi    View App Ui that is using this engine.
+    * @param aObserver     Engine observer.
+    * @param aDbSession    Session to RDiagResultDatabase to create record.
+    * @param aPluginPool   Initialized plug-in pool that holds plug-ins.
+    * @param aIncompleteRecordUid - Uid to the record to resume.
+    *
+    * @return New instance of CDiagEngine*.
+    */
+    IMPORT_C static CDiagEngine* NewLC( CAknViewAppUi&          aViewAppUi, 
+                                        MDiagEngineObserver&    aObserver,
+                                        RDiagResultsDatabase&   aDbSession,
+                                        CDiagPluginPool&        aPluginPool,
+                                        TUid                    aIncompleteRecordUid );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CDiagEngine();
+
+    /**
+    * Execute tests. This is a asynchronous method. 
+    * First, execution plan is sent via MDiagEngineObserver::TestExecutionBeginL(). 
+    * Then, during the execution, MDiagEngineObserver::TestExecutionProgressL() 
+    * may be called multiple times to notify execution progress.  
+    * When execution is completed, 
+    * MDiagEngineObserver::TestExecutionCompletedL() is called.
+    */
+    IMPORT_C void ExecuteL();
+
+    /**
+    * Set custom execution parameter.
+    *
+    * @param aCustomParams - Custom data. Owership is not transefrred
+    *   so, the client must delete it once test is completed.
+    *   Desipte it being a pointer, ownership cannot be transferred 
+    *   because engine does not know the type of pointer. 
+    */
+    IMPORT_C void SetCustomParam( TAny* aCustomParams );
+
+    /**
+    * Suspend execution.  This can be used to suspend test execution.
+    * If currently executing test is suspendable, it will be suspended and resumed.
+    * Otherwise, it will be stopped. When CDiagEngine::ResumeL is called, 
+    * the stopped test will be restarted from the beginning. Already executed
+    * tests are not affected. 
+    * 
+    * After engine is suspended, MDiagEngineObserver::TestExecutionSuspendedL() is called.
+    *
+    */
+    IMPORT_C void SuspendL();
+
+    /**
+    * Resume suspended execution. This function can be used to resume 
+    * previously suspended execution. If execution was suspended on a test
+    * that cannot be suspended, the test will restart. Previously executed tests
+    * will not be re-run. Also, dependent tests will not be re-run.  If 
+    * the suspended test fails to resume (e.g. leaves), it will be marked as
+    * failure.
+    *
+    * After engine is resumed, MDiagEngineObserver::TestExecutionResumedL() is called.
+    */
+    IMPORT_C void ResumeL();
+    
+    
+    // ADO & Platformization Changes
+    IMPORT_C TBool GetPluginDependencyL();
+
+public: // from MDiagEngineCommon
+
+    /**
+    * Returns current execution plan.
+    * @see MDiagEngineCommon::ExecutionPlanL
+    */
+    virtual const MDiagPluginExecPlan& ExecutionPlanL() const;
+
+    /**
+    * Stop current execution of tests.
+    * @see MDiagEngineCommon::ExecutionStopL
+    */
+    virtual void ExecutionStopL( TCancelMode aCancelMode );
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog();
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType );
+    
+    /**
+    * Resets test execution watchdog timer.
+    * @see MDiagEngineCommon::ResetWatchdog
+    */
+    virtual void ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete );
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * @see MDiagEngineCommon::ViewAppUi
+    */
+    virtual CAknViewAppUi& ViewAppUi();
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * @see MDiagEngineCommon::ViewAppUi
+    */
+    virtual const CAknViewAppUi& ViewAppUi() const;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * @see MDiagEngineCommon::DbRecord
+    */
+    virtual RDiagResultsDatabaseRecord& DbRecord();
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * @see MDiagEngineCommon::DbRecord
+    */
+    virtual const RDiagResultsDatabaseRecord& DbRecord() const;
+
+    /**
+    * Get reference to Plugin Pool
+    * @see MDiagEngineCommon::PluginPool
+    */
+    virtual CDiagPluginPool& PluginPool();
+
+    /**
+    * Get reference to Plugin Pool
+    * @see MDiagEngineCommon::PluginPool
+    */
+    virtual const CDiagPluginPool& PluginPool() const;
+
+    /**
+    * Add a text to configuraiton list option. 
+    * @see MDiagEngineCommon::AddToConfigListL
+    */
+    virtual void AddToConfigListL( TConfigListType aListType, const TDesC& aText );
+
+    /**
+    * Remove a text from configuration list.
+    * @see MDiagEngineCommon::RemoveFromConfigListL
+    */
+    virtual void RemoveFromConfigListL( TConfigListType aListType, const TDesC& aText );
+
+    /**
+    * Create a common dialog.
+    * @see MDiagEngineCommon::CreateCommonDialogL
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData );
+
+    /**
+    * Stop watchdog activity temporarily.
+    * @see MDiagEngineCommon::StopWatchdogTemporarily
+    */
+    virtual void StopWatchdogTemporarily();
+
+    /**
+    * Check if current engine is being executed with dependency disabled.
+    *  @see MDiagEngineCommon::IsDependencyDisabled
+    */
+    virtual TBool IsDependencyDisabled() const;
+
+    /**
+    * Get custom param
+    *  @see MDiagEngineCommon::CustomParam
+    */
+    virtual TAny* CustomParam() const;
+
+    /**
+    * Execute an application command. 
+    *   @see MDiagEngineCommon::ExecuteAppCommandL
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 );
+
+private:    // private data
+    CDiagEngineImpl* iEngineImpl;
+    };
+
+
+#endif // DIAGENGINE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagenginecommon.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2007 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:  Common interface to use engine
+*
+*/
+
+
+#ifndef DIAGENGINECOMMON_H
+#define DIAGENGINECOMMON_H
+
+// SYSTEM INCLUDES
+#include <e32std.h>                     // TDesC, TTimeIntervalMicroSeconds32
+#include <DiagCommonDialog.h>           // TDiagCommonDialog
+#include <DiagAppCommand.h>             // TDiagAppCommand
+#include <DiagEngineWatchdogTypes.h>    // TDiagEngineWatchdogTypes
+
+// FORWARD DECLARATION
+class MDiagPluginExecPlan;
+class MDiagPlugin;
+class CAknViewAppUi;
+class RDiagResultsDatabaseRecord;
+class CDiagPluginPool;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Engine Common Interface
+*
+*  This interface is provided for Test plug-ins, Suite plug-ins and
+*  any other clients of CDiagEngine.
+*
+*  @since S60 v5.0
+*/
+class MDiagEngineCommon
+    {
+public: // Data Structures
+    
+    /** 
+    * Possible cancellation mode.
+    */
+    enum TCancelMode
+        {
+        ESkip,        // Cancel current test only. Continue rest.
+        ECancelAll      // Cancel current test and skip rest of execution.
+        };
+
+    /**
+    *  Text List based config options
+    */
+    enum TConfigListType
+        { 
+        /**
+        * EConfigListCallIngore - List of phone numbers to ignore. 
+        *   If a phone number is added to this list, engine will ignore the number
+        *   a new MO/MT call is created by the phone, and will not suspend
+        *   the engine execution when new call is made.
+        */
+        EConfigListCallIngore = 0
+        };
+
+public: // public methods
+
+    /**
+    * Returns current execution plan.
+    * If test is not being executed, it will leave with KErrNotReady.
+    *
+    * @return Reference to current execution plan.
+    */
+    virtual const MDiagPluginExecPlan& ExecutionPlanL() const = 0;
+
+    /**
+    * Stop current execution of tests.
+    * If test is not being executed, it will leave with KErrNotReady.
+    *
+    * @param aCancelMode   ESkip       - Skip current test only. Rest will continue.
+    *                      ECancelAll  - Cancels current test and skips the rest of
+    *                                  execution.
+    */
+    virtual void ExecutionStopL( TCancelMode aCancelMode ) = 0;
+
+    /**
+    * Resets test execution watchdog timer.  It will use the last given watchdog
+    * timer value for currently executing plug-in.
+    */
+    virtual void ResetWatchdog() = 0;
+
+    /**
+    * Resets test execution watchdog timer.  
+    *   Watchog timer value will be determined by the type of watchdog requested.
+    *   Given value is valid until next plug-in is executed, or another
+    *   ResetWachdogL() or TestProgressL() is called.
+    *
+    * @param aWatchdogType Type of watchdog timer vaule to use.
+    *   @see TDiagEngineWatchdogTypes
+    */
+    virtual void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType ) = 0;
+
+    /**
+    * Resets test execution watchdog timer.  
+    *   Engine will allow specified amount of time. 
+    *   Given value is valid until next plug-in is executed, or another
+    *   ResetWachdogL() or TestProgressL() is called.
+    * 
+    * @param aTimeToWait - Amount of time to wait before watchdog is expired.
+    */
+    virtual void ResetWatchdog( TTimeIntervalMicroSeconds32 aExpectedTimeToComplete ) = 0;
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * AppUi reference can be used for tests that requires AppUi for view switching.
+    * 
+    * @return Reference to CAknViewAppUi
+    */
+    virtual CAknViewAppUi& ViewAppUi() = 0;
+
+    /**
+    * Get App Ui reference that launched Diagnostics Engine.
+    * AppUi reference can be used for tests that requires AppUi for view switching.
+    * 
+    * @return Reference to CAknViewAppUi
+    */
+    virtual const CAknViewAppUi& ViewAppUi() const = 0;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * 
+    * @return Reference to RDiagResultsDatabaseRecord
+    */
+    virtual RDiagResultsDatabaseRecord& DbRecord() = 0;
+
+    /**
+    * Get Database Subsession for record open for writing.
+    * 
+    * @return Reference to RDiagResultsDatabaseRecord
+    */
+    virtual const RDiagResultsDatabaseRecord& DbRecord() const = 0;
+
+    /**
+    * Get reference to Plugin Pool
+    * 
+    * @return Reference to CDiagPluginPool
+    */
+    virtual CDiagPluginPool& PluginPool() = 0;
+
+    /**
+    * Get reference to Plugin Pool
+    * 
+    * @return Reference to CDiagPluginPool
+    */
+    virtual const CDiagPluginPool& PluginPool() const = 0;
+
+    /**
+    * Add a text to configuraiton list option. 
+    * 
+    * @param aListType - List type to add the configuration option to. 
+    *   @see TConfigListType
+    * @param aText - text to add to the list
+    */
+    virtual void AddToConfigListL( TConfigListType aListType, const TDesC& aText ) = 0;
+
+    /**
+    * Remove a text from configuration list.
+    * If configuration item text does not exist in the list, this function will 
+    * leave with KErrNotFound.
+    * 
+    * @param aListType - List type to remove the item from. 
+    *   @see TConfigListType
+    * @param aText - text for the option
+    */
+    virtual void RemoveFromConfigListL( TConfigListType aListType, const TDesC& aText ) = 0;
+
+    /**
+    * Create a common dialog.
+    * Plug-ins can use this factory method to create a common dialog.
+    * For available dialog types, @see DiagCommonDialog.h
+    * 
+    * @param aDialogType - Type of dialog to create.
+    * @param aInitData - Initialization parameter. Ownership is passed to engine.
+    * @return a pointer to newly created dialog. Ownership is passed to caller.
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData ) = 0;
+
+    /**
+    * Stop watchdog activity temporarily. Watchdog will stay inactive until:
+    *   a ) TestProgressL() is called.
+    *   b ) ResetWatchdogL() is called.
+    *   c ) Plug-in is cancelled and the next plug-in starts to execute.
+    */
+    virtual void StopWatchdogTemporarily() = 0;
+
+    /**
+    * Check if current engine is being executed with dependency disabled.
+    *   @return TBool - ETrue if dependency is disabled.
+    *                   EFalse if depencenty is enabled.
+    */
+    virtual TBool IsDependencyDisabled() const = 0;
+
+    /**
+    * Get custom parameter passed during engine creation.
+    *   @return TAny* Custom parameter.  Ownership is not transferred.
+    */
+    virtual TAny* CustomParam() const = 0;
+
+    /**
+    * Send a command to application to execute.. This can be used by the plug-in to
+    * request certain behavior from application. For more information about
+    * types of commands possible, @see TDiagAppCommand.
+    * If the command is not supported by the application, this function will 
+    * leave with error code KErrNotSupported.
+    *
+    * Memory Ownership of Parameters.
+    *   Note that in general, parameters should be owned by the caller. This is 
+    *   because if a particular operation is not supported, application 
+    *   will not know how to deallocate the parameter, causing memory leak.
+    *   
+    *   In cases where ownership must be passed, caller must check if
+    *   ExecuteAppCommandL() leaves KErrNotSupported and deallocate
+    *   parameters.
+    *
+    * @param aCommand - Type of command to execute. @see TDiagAppCommand
+    * @param aParam1 - Data for the command. Value of this parameter depends
+    *   on the type of command. Ownership not transferred. @see TDiagAppCommand
+    * @param aParam2 - Data for the command. Value of this parameter depends
+    *   on the type of command. Ownership not transferred. @see TDiagAppCommand
+    *   
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 ) = 0;
+    };
+
+
+#endif // DIAGENGINECOMMON_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagengineobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2007 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:  Observer interface to use with CDiagEngine
+*
+*/
+
+
+#ifndef DIAGENGINEOBSERVER_H
+#define DIAGENGINEOBSERVER_H
+
+
+// SYSTEM INCLUDES
+#include <e32def.h>                 // TUint
+#include <DiagCommonDialog.h>       // TDiagCommonDialog
+#include <DiagAppCommand.h>         // TDiagAppCommand
+
+// FORWARD DECLARATION
+class CDiagResultsDatabaseItem;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Engine Observer
+*
+*  This interface is called by CDiagEngine to notify its client
+*  of progress of requests made to engine.
+*
+* @since S60 v5.0
+*/
+class MDiagEngineObserver
+    {
+public: // Public Data types
+    enum TSuspendReason
+        {
+        ESuspendByClient = 0,
+        ESuspendByPhoneCall
+        };
+
+    enum TResumeReason
+        {
+        EResumedByClient = 0,
+        EAutoResumedByCallHangup
+        };
+
+public: // Public interface
+
+    /**
+    * Notify client of test execution begin. Clients can get testplan using
+    * CDiagEngine::ExecutionPlanL. 
+    */
+    virtual void TestExecutionBeginL() = 0;
+
+    /**
+    * Notify client of test execution progress.
+    *
+    * @param aCurrentItemStep       - Progress in current entry.
+    * @param aCurrentItemTotalSteps - Total steps to execute in current entry.
+    */
+    virtual void TestExecutionProgressL( TUint aCurrentItemStep,
+                                         TUint aCurrentItemTotalSteps ) = 0;
+
+    /**
+    * Notify client of execution completion of one plug-in.
+    *   This can be either test plug-in or suite plug-in.
+    *
+    * @param aError  - KErrNone - Success.
+    *   KErrNoMemory - Out of memory.
+    *   KErrCancel   - Cancelled due to ExecutionStopL()
+    *
+    * @param aResult - Result of the test. Ownership is transferred here. 
+    *  Client must deallocate aResult to avoid memory leak. aResult is Null 
+    *  if the plug-in being executed is a suite pre/post method.
+    */
+    virtual void TestExecutionPluginExecutedL( TInt aError,
+                                               CDiagResultsDatabaseItem* aResult ) = 0;
+
+    /**
+    * Notify client of execution suspend.
+    *
+    * @param aSuspendReason - Why execution is suspended.
+    */
+    virtual void TestExecutionSuspendedL( TSuspendReason aSuspendReason ) = 0;
+
+    /**
+    * Notify client of execution resume.
+    *
+    * @param aResumeReason - Why execution is being resumed
+    */
+    virtual void TestExecutionResumedL( TResumeReason aResumeReason ) = 0;
+
+    /**
+    * Notify client of engine stopping.
+    *
+    * This indicates that engine execution has stopped. There will not be any
+    * further messages from engine. This could be called because all
+    * tests are completed, or an unrecoverable error occured during execution.
+    *
+    * Note that if cancel is called during plan creation or if plan creation
+    * fails, TestExecutionStoppedL() may be called withing first calling
+    * TestExecutionBeginL(). 
+    *
+    * @param aError - Reason for engine stopping. 
+    *   a) KErrNone - All tests are successfully completed.
+    *   b) KErrCancel - ExecutionStopL is called with ECancelAll. 
+    *       Test session cannot be resumed later.
+    *   c) KErrArgument - Parameters passed to engine are invalid.
+    *   d) Others - Other critical that could not be recovered occured during
+    *       test execution.  Test may be resumed later in this case.
+    */
+    virtual void TestExecutionCompletedL( TInt aError ) = 0;
+
+    /**
+    * Create a common Dialog.
+    * Application should create an instance of requested dialog.
+    * For available dialog types, @see DiagCommonDialog.h
+    * 
+    * @param aDialogType - Type of dialog to create.
+    * @param aData - Initialization parameter. Ownership is passed to engine.
+    * @return a pointer to newly created dialog. Ownership is passed to caller.
+    */
+    virtual CAknDialog* CreateCommonDialogLC( TDiagCommonDialog aDialogType,
+                                              TAny* aInitData ) = 0;
+
+    /**
+    * Execute a command from plug-in. Parameters are identical to 
+    * MDiagEngineCommon::ExecuteAppCommandL(). 
+    * @see MDiagEngineCommon::ExecuteAppCommandL()
+    * @see TDiagAppCommand
+    */
+    virtual void ExecuteAppCommandL( TDiagAppCommand aCommand, 
+                                     TAny* aParam1,
+                                     TAny* aParam2 ) = 0;
+    };
+
+
+#endif // DIAGENGINEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagenginewatchdogtypes.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for TDiagEngineWatchdogTypes
+*
+*/
+
+
+
+#ifndef DIAGENGINEWATCHDOGTYPES_H
+#define DIAGENGINEWATCHDOGTYPES_H
+
+/**
+* These types indicate to engine how long it should wait between each
+* test execution progress reports.  
+*
+* Typically, if a test step requires user interaction, engine should wait
+* longer before stopping its execution. For non-interactive steps,
+* engine should not wait as long. 
+* 
+* The actual values are specifed by cenrep key value owned by engine.
+*
+* Values:
+* EDiagEngineWatchdogTypeInteractive - Indicates that engine should
+*   use interactive watchdog timer value.
+*
+* EDiagEngineWatchdogTypeAutomatic - Indicates that engine should
+*   use non-interactive watchdog timer value.
+*
+* @since S60 3.2
+*/
+enum TDiagEngineWatchdogTypes
+    {
+    EDiagEngineWatchdogTypeInteractive   = 0,
+    EDiagEngineWatchdogTypeAutomatic
+    };
+
+#endif // DIAGENGINEWATCHDOGTYPES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagexecplanentry.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagExecPlanEntry
+*
+*/
+
+
+#ifndef DIAGEXECPLANENTRY_H
+#define DIAGEXECPLANENTRY_H
+
+
+// SYSTEM INCLUDE FILES
+#include <e32def.h>         // TBool
+
+// FORWARD DECLARATION
+class MDiagPlugin;
+
+/**
+* Diagnostics Plug-in Execution Plan Entry.
+*
+* This class provides the interface for test execution plan entries.
+*
+* @since S60 v5.0
+*
+*/
+class MDiagExecPlanEntry
+    {
+public: // data types
+    /**
+    * Item execution state.
+    */
+    enum TState
+        {
+        EStateQueued     = 0,   // Execution has not begun.
+        EStateInitDelay,        // Waiting for initial delay timer to expire
+        EStateRunning,          // RunTestL() is called. Waiting for completion.
+        EStateSuspended,        // Execution is suspended
+        EStateStopped,          // Plugin is stopped, but result not logged yet.
+        EStateCompleted         // Result is logged
+        };
+
+public:
+    /**
+    * Plugin associated with the entry
+    *   @return Reference to the plugin.
+    */
+    virtual const MDiagPlugin& Plugin() const = 0;
+
+    /**
+    * Returns whether item is being executed to satisfy dependency or not.
+    *   @return ETrue if item is being executed to satisfy dependency.
+    *       EFalse if item is being executed explicitly.
+    */
+    virtual TBool AsDependency() const = 0;
+
+    /**
+    * Item State
+    *   @return Current state of execution plan item
+    */
+    virtual TState State() const = 0;
+
+    };
+
+#endif // DIAGEXECPLANENTRY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagframeworkdebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2007 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:  Debugging trace definition for framework and plug-ins.
+*
+*/
+
+
+#ifndef DIAGFRAMEWORKDEBUG_H
+#define DIAGFRAMEWORKDEBUG_H
+
+/**
+* Diagnostics Framework Debug Traces
+*
+* This header file defines common debug trace macros for Diagnostics Framework.
+* It is used by the diagnostics framework internally. However, it is 
+* recomanded that application and plug-ins use the macros defined here
+* in order to allow consistent logging.
+*
+* Debugging messages are enabled only on non DEBUG build. 
+*
+* These macros can be configured to use either Flogger (RFileLogger) or
+* RDebug.  By default, it will use RFileLogger. If RDebug trace is needed,
+* uncomment //#define DIAG_DEBUG_LOG_USE_RDEBUG below.
+*
+* The following macros are provided by this files.
+*
+* LOGTEXT( aDescriptor );   
+*   - This prints a descriptor to log. E.g. if you have a TDesC type, then
+*   you can use this. e.g.
+*
+*       void CMyClass::PrintSomeText( const TDesC& aText )
+*           {
+*           LOGTEXT( aText );
+*           }
+* 
+* LOGSTRING( aFormat )
+* LOGSTRING2( aFormat, a );
+* LOGSTRING3( aFormat, a, b );
+* LOGSTRING4( aFormat, a, b, c );
+* LOGSTRING5( aFormat, a, b, c, d );
+*   - These macros are used to print debugging messages with formatting text 
+*   and several arguments. Formatting string is similar to printf.
+*
+*       void CMyClass::PrintSomeText( TInt aInt, TInt aHex )
+*           {
+*           LOGSTRING( "CMyClass::PrintSomeText() Enter" );
+*           LOGSTRING3( "CMyClass::PrintSomeText() aInt = %d, aHex = 0x%08x", 
+*                       aInt, 
+*                       aHex );
+*           }
+*
+*/
+
+#define ENABLE_DIAG_DEBUG_LOG       // Enable diagnostics debug log
+//#define DIAG_DEBUG_LOG_USE_RDEBUG   // Use RDebug::Print instead of flogger.
+
+#if ( defined _DEBUG && defined ENABLE_DIAG_DEBUG_LOG )
+
+#ifdef DIAG_DEBUG_LOG_USE_RDEBUG
+
+#include <e32debug.h> // RDebug
+
+#define LOGTEXT( aDescriptor )                              \
+    {                                                       \
+    RDebug::Print( aDescriptor );                           \
+    }
+
+#define LOGSTRING( aFormat )                                \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat );                               \
+    }
+
+#define LOGSTRING2( aFormat, a )                            \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a );                            \
+    }
+
+#define LOGSTRING3( aFormat, a, b )                         \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a, b );                         \
+    }
+
+#define LOGSTRING4( aFormat, a, b, c )                      \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a, b, c );                      \
+    }
+
+#define LOGSTRING5( aFormat, a, b, c, d )                   \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RDebug::Print( KFormat, a, b, c, d );                   \
+    }
+
+#else // #ifdef DIAG_DEBUG_LOG_USE_RDEBUG
+
+// SYSTEM INCLUDES
+#include <flogger.h>
+
+// CONSTANTS
+_LIT( KDiagFrameworkLogFolder,  "DiagFramework" );
+_LIT( KDiagFrameworkLogFile,    "LOG.TXT" );
+
+// MACROS
+#define LOGTEXT( aDescriptor )                              \
+    {                                                       \
+    RFileLogger::Write( KDiagFrameworkLogFolder(),          \
+                        KDiagFrameworkLogFile(),            \
+                        EFileLoggingModeAppend,             \
+                        aDescriptor );                      \
+    }
+
+#define LOGSTRING( aFormat )                                \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::Write( KDiagFrameworkLogFolder(),          \
+                        KDiagFrameworkLogFile(),            \
+                        EFileLoggingModeAppend,             \
+                        KFormat() );                        \
+    }
+
+#define LOGSTRING2( aFormat, a )                            \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a );                          \
+    }
+
+#define LOGSTRING3( aFormat, a, b )                         \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a, b );                       \
+    }
+
+#define LOGSTRING4( aFormat, a, b, c )                      \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend,       \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a, b, c );                    \
+    }
+
+#define LOGSTRING5( aFormat, a, b, c, d )                   \
+    {                                                       \
+    _LIT( KFormat, aFormat );                               \
+    RFileLogger::WriteFormat( KDiagFrameworkLogFolder(),    \
+                              KDiagFrameworkLogFile(),      \
+                              EFileLoggingModeAppend, \
+                              TRefByValue<const TDesC>( KFormat() ), \
+                              a, b, c, d );                 \
+    }
+
+#endif // #else DIAG_DEBUG_LOG_USE_RDEBUG
+
+#else   // _DEBUG && ENABLE_DIAG_DEBUG_LOG
+
+#define LOGTEXT( aDescriptor )
+#define LOGSTRING( aFormat )
+#define LOGSTRING2( aFormat, a )
+#define LOGSTRING3( aFormat, a, b )
+#define LOGSTRING4( aFormat, a, b, c )
+#define LOGSTRING5( aFormat, a, b, c, d )
+
+#endif  // else _DEBUG && ENABLE_DIAG_DEBUG_LOG
+
+#endif // DIAGFRAMEWORKDEBUG_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_framework_api/inc/diagpluginexecplan.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2007 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:  Class declaration for CDiagPluginExecPlan
+*
+*/
+
+
+#ifndef DIAGPLUGINEXECPLAN_H
+#define DIAGPLUGINEXECPLAN_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATION
+class MDiagPlugin;
+class MDiagExecPlanEntry;
+
+/**
+*  Diagnostics Plugin Execution Plan
+*
+*  This class provides interface to access execution plan.
+*  It also provides interface to modify execution plan.
+*  A cursor to currently executing item is also maintained.
+*
+*/
+class MDiagPluginExecPlan
+    {
+public: 
+    /**
+    * Access an item in plan.
+    *
+    * @param aIndex    - index 
+    * @return Reference to plan entry at given index.
+    */
+    virtual const MDiagExecPlanEntry& operator[]( TInt aIndex ) const = 0;
+
+    /**
+    * Get current execution plan item.
+    *
+    * @return Reference to currently executing plan item.
+    */
+    virtual const MDiagExecPlanEntry& CurrentExecutionItem() const = 0;
+
+    /**
+    * Returns index of execution cursor. Note that this index 
+    * includes both suite plug-in and test plug-in.
+    *
+    * If only interested about test plug-ins. use CurrentTestIndex().
+    *
+    * @return Index to current execution cursor.
+    */
+    virtual TInt CurrentIndex() const = 0;
+
+    /**
+    * Returns total number of items in the plan. Note that this count
+    * includes both suite plug-in and test plug-in.
+
+    * If only interested only test plug-ins. use TestCount().
+    *
+    * @return Number of items in the test plan.
+    */
+    virtual TInt Count() const = 0;
+
+    /**
+    * Get current test index.
+    *
+    * Note that only test plug-ins (MDiagTestPlugin) are counted in this
+    * case.  Suite pre/post execution are not. You cannot use this value
+    * with [] operator since this is not a real index.
+    * 
+    * To get real cursor index, use GetCurrentIndex().
+    *
+    * @param aIncludeDependency  If ETrue, test index will also include
+    *                            plugins that are included as dependency.
+    * @return current test index.
+    */
+    virtual TInt CurrentTestIndex( TBool aIncludeDependency ) const = 0;
+
+    /**
+    * Get total test count.
+    *
+    * Note that only test plug-ins (MDiagTestPlugin) are counted in this
+    * case.  Suite pre/post execution are not. You cannot use this value
+    * with [] operator since this is not a real count.
+    * 
+    * To get the real number of items in the plan, use GetCount().
+    *
+    * @param aIncludeDependency  If ETrue, test index will also include
+    *                            plug-ins that are included as dependency.
+    * @return current test index.
+    */
+    virtual TInt TestCount( TBool aIncludeDependency ) const = 0;
+
+    /**
+    * Check if this is the last test being executed.
+    *
+    * Note that only test plug-ins (MDiagTestPlugin) are counted in this
+    * case.  Suite pre/post execution are not.
+    * If you are interested in checking if it is currently running
+    * the last plug-in, including test and suites, @see IsLastPlugin()
+    *
+    * @return ETrue plan is executing the last test plug-in.
+    */
+    virtual TBool IsLastTest() const = 0;
+
+    /**
+    * Check if this is the last plug-in being executed.
+    *
+    * Note that this includes both test plug-ins and suite plug-ins.
+    * If you are interested in checking the progress on tests only,
+    * @see IsLastTest()
+    *
+    * @return ETrue plan is executing the last test or suite plug-in.
+    */
+    virtual TBool IsLastPlugin() const = 0;
+
+    /**
+    * Returns the plug-in index that plan is resuming from.
+    * If this session is not a resume session, this will return 0 (first index).
+    * Otherwise, this index will point the first real execution item.
+    *
+    * Note that this value will not change as test session progresses. Even
+    * as test progresses, this value will still point to the index that
+    * this session is being resumed from.
+    *
+    * @return Index of which session is being resumed from.
+    */
+    virtual TInt ResumeIndex() const = 0;
+    };
+
+#endif // DIAGPLUGINEXECPLAN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/diagnostics_plugin_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="bf4161c7185b3c27ea85e2824c07f5e5" dataversion="1.0">
+  <name>Diagnostics plug-in API</name>
+  <description>Diagnostics plug-ins interface</description>
+  <type>c++</type>
+  <subsystem>devicediagnosticsfw</subsystem>
+  <libs>
+    <lib name="diagpluginbase.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                Diagnostics plug-in API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/diagtestplugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagTestPlugin.h)
+../inc/diagplugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagPlugin.h)
+../inc/diagsuiteplugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagSuitePlugin.h)
+../inc/diagsuiteexecparam.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagSuiteExecParam.h)
+../inc/diagtestobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagTestObserver.h)
+../inc/diagsuitepluginbase.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagSuitePluginBase.h)
+../inc/diagtestpluginbase.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagTestPluginBase.h)
+../inc/diagpluginconstructionparam.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagPluginConstructionParam.h)
+../inc/diagtestexecparam.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagTestExecParam.h)
+../inc/diagsuiteobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagSuiteObserver.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagplugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2007 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:  Abstract class that represents a diagnostics plug-in
+*
+*/
+
+
+#ifndef DIAGPLUGIN_H
+#define DIAGPLUGIN_H
+
+// INCLUDES
+#include <badesca.h>            // CPtrCArray . Needed since this is typedef.
+
+//Forward declarations
+class CGulIcon;
+class MDiagEngineCommon;
+
+// Constants for plugin interfaces 
+const TUid KDiagPluginInterfaceUid = { 0x2000AFEB };
+
+// UID of top most root suite uid.  All plug-ins are descendant of this suite.
+const TUid KDiagRootSuiteUid = { 0x00000000 };
+
+/**
+* Abstract class that repsesents a diagnostics plug-in.
+*
+* @since S60 v5.0
+**/
+class MDiagPlugin
+    {
+public: //data structures
+
+    /**
+    * Indicates is the plug-in a suite or a test plug-in
+    **/
+    enum TPluginType
+        {
+        ETypeTestPlugin,
+        ETypeSuitePlugin
+        };
+
+    /**
+    * Layout type of name being requested.
+    */
+    enum TNameLayoutType
+        {
+        ENameLayoutListSingle,              // list_single_graphic_heading_pane_t1_cp2
+        ENameLayoutPopupNoteWaitWindow,     // popup_note_wait_window
+        ENameLayoutListLargeGraphic,        // list_single_large_graphic_pane_t1
+        ENameLayoutHeadingPane,             // heading_pane_t1
+        ENameLayoutPopupInfoPane,           // popup_info_list_pane_t1
+        ENameLayoutTitlePane,               // title_pane_t2/opt12
+        ENameLayoutListSingleGraphic,       // list_single_graphic_pane_t1
+        ENameLayoutListDoubleGraphic        // list_double_graphic_pane_t1
+        };
+
+public: // public methods
+
+    /**
+    * Virtual destructor. This ensures that when the interface is deleted,
+    * compiler will look up virtual table to find correct destructor.
+    */
+    virtual ~MDiagPlugin() {}
+
+    /**
+    * Method for getting the name of the plugin. Name returned should be based
+    * on the layout requested, and it should fit within the layout.
+    *
+    * @param aLayoutType - Layout where text will be displayed in. @see TNameLayoutType
+    * @return Localized name of the plug-in. Ownership is transferred to caller.
+    */
+    virtual HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const = 0;
+
+    /**
+    * Get the name of the service that the plug-in provides.
+    * Service name is defined in the ECOM resource file, thus, it is not localized.
+    *
+    * @return The name of the service.
+    **/
+    virtual const TDesC& ServiceLogicalName() const = 0;
+
+    /**
+    * Get logical dependencies. One plug-in can have multiple dependencies to other plug-ins.
+    *
+    * @param aArray An array of logical names.
+    * @see ServiceLogicalName.
+    **/
+    virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const = 0;
+
+    /**
+    * Return the type of the plug-in. 
+    *
+    * @return The type.
+    * @see TPluginType.
+    **/
+    virtual TPluginType Type() const = 0;
+
+    /**
+    * Create an icon that represents the plug-in.
+    *
+    * @return An icon. 
+    **/
+    virtual CGulIcon* CreateIconL() const = 0;
+
+    /** Method for checking, if plugin should be visible.
+    * (for example shown in listbox).
+    * Overwrite this function to show or hide your plugin dynamically.
+    *
+    * @return ETrue if plugin should be visible, EFalse otherwise.
+    */
+    virtual TBool IsVisible() const = 0;
+
+    /** Method for checking, if plugin is supported.
+    * Overwrite this function to enable or disable your plugin dynamically.
+    * If EFalse, plug-in will not be loaded by plugin pool.
+    *
+    * @return ETrue if plugin is supported, EFalse otherwise.
+    */
+    virtual TBool IsSupported() const = 0;
+
+    /**
+    * Get localised description of the test. Description should be used to explain 
+    * the test for the user. It can contain comments that this service needs for 
+    * example access point and it creates costs or that the duration might be long.
+    *
+    * @return Allocated buffer containing localized description of the plugin.
+    **/
+    virtual HBufC* GetDescriptionL() const = 0;
+
+    /**
+    * Get UID of this plug-in.
+    *
+    * @return the UID.
+    **/
+    virtual TUid Uid() const = 0;
+
+    /**
+    * Get the order number that this plug-in should appear in its parent list.
+    *
+    * @return TUint order number.
+    **/
+    virtual TUint Order() const = 0;
+
+    /**
+    * Get UID of the parent.
+    *
+    * @return The parent UID.
+    **/
+    virtual TUid ParentUid() const = 0;
+
+    /**
+    * Set ECom Destructor ID Key.
+    *
+    * @param aDtorIdKey Uid returned by REComSession::CreateImplementationL()
+    **/
+    virtual void SetDtorIdKey( TUid aDtorIdKey ) = 0;
+
+
+    /**
+    * Initialization Step. This method is called before any plugin are executed.
+    * This can be used to clean up any left over data from previous execution 
+    * sessions. All plug-ins in execution plan will have a chance to clean 
+    * up before any plug-ins are run.  This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in will be executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                    TBool aSkipDependencyCheck,
+                                    TAny* aCustomParams ) = 0;
+
+
+    /**
+    * Cleanup Step. This method is called after all plug-ins in the 
+    * execution plan is completed to clean up any left over data from 
+    * current sesison. This can be used to clean up any data that
+    * provides dependent service created for its dependencies.
+    * This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in as executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                  TBool aSkipDependencyCheck,
+                                  TAny* aCustomParams ) = 0;
+
+
+    /**
+    * Reserved for future use/plugin's custom functionality.
+    *
+    * @param aUid Unique identifier of the operation.
+    * @param aParam Custom parameter. 
+    * @return TAny pointer. Custom data.
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual TAny* CustomOperationL( TUid aUid, TAny* aParam ) = 0;
+        
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aParam Custom parameter.
+    * @return TAny pointer. Custom data. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual TAny* GetCustomL( TUid aUid, TAny* aParam ) = 0;
+    };
+
+#endif // DIAGPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagpluginconstructionparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Plug-in Construction Parameter
+*
+*/
+
+
+#ifndef DIAGPLUGINCONSTRUCTIONPARAM_H
+#define DIAGPLUGINCONSTRUCTIONPARAM_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class CDesC16ArrayFlat;
+
+/**
+* Parameters that are needed to construct a Diagnostics plug-in.
+*
+* @since S60 v5.0
+**/
+NONSHARABLE_CLASS( CDiagPluginConstructionParam ) : public CBase
+    {
+public:
+
+    /**
+    * Two-phased constructors.
+    *
+    * @param    aServiceProvided - Name of the service provided.
+    *           Ownership is transferred to CDiagPluginConstructionParam.
+    * @param    aServicesRequired - Array of services required.
+    *           Ownership is transferred to CDiagPluginConstructionParam.
+    * @param    aOrder - Order that this plug-in should appear in
+    *           in parent suite.
+    * @param    aImplUid - Implementation Uid of the plug-in.
+    * @return   new instance of CDiagPluginConstructionParam*
+    **/
+    IMPORT_C static CDiagPluginConstructionParam* NewL(
+                                        HBufC*              aServiceProvided,
+                                        CDesC16ArrayFlat*   aServicesRequired,
+                                        TInt                aOrder,
+                                        TUid                aImplUid,
+                                        TUid                aParentUid );
+    IMPORT_C static CDiagPluginConstructionParam* NewLC(
+                                        HBufC*              aServiceProvided,
+                                        CDesC16ArrayFlat*   aServicesRequired,
+                                        TInt                aOrder,
+                                        TUid                aImplUid,
+                                        TUid                aParentUid );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagPluginConstructionParam();
+
+    /**
+    * Get Name of the service provived.
+    *
+    * @return Name of the service provided.
+    */
+    IMPORT_C const TDesC& ServiceProvided() const;
+
+    /**
+    * Get array of services required for plug-in.
+    *
+    * @return Array of services required for plug-in.
+    */
+    IMPORT_C const CDesC16ArrayFlat& ServicesRequired() const;
+
+    /**
+    * Get the order this plug-in should appear in parent.
+    *
+    * @return Order that this plug-in should appear in parent.
+    */
+    IMPORT_C TInt Order() const;
+
+    /**
+    * Uid of plug-in.
+    *
+    * @return Uid of plug-in specified in RSS file.
+    */
+    IMPORT_C TUid Uid() const;
+
+    /**
+    * Parent Uid of plug-in.
+    *
+    * @return Parent Uid of plug-in specified in RSS file.
+    */
+    IMPORT_C TUid ParentUid() const;
+
+private:    
+    
+    /**
+    * C++ Constructor.
+    **/
+    CDiagPluginConstructionParam( HBufC*              aServiceProvided,
+                                  CDesC16ArrayFlat*   aServicesRequired,
+                                  TInt                aOrder,
+                                  TUid                aImplUid,
+                                  TUid                aParentUid );
+    
+    
+private:    // data
+
+    /**
+    * iServiceProvided - Buffer containing service name
+    * Owns.
+    */
+    HBufC* iServiceProvided;
+
+    /**
+    * iServicesRequired - Array containing list of dependency list.
+    * Owns
+    */
+    CDesC16ArrayFlat* iServicesRequired;
+
+    /**
+    * iOrder - Order in parent list.
+    */
+    TInt iOrder;
+
+    /**
+    * iImplUid - Uid of the plug-in
+    */
+    TUid iImplUid;
+
+    /**
+    * iParentUid - Uid of the parent suite plug-ins
+    */
+    TUid iParentUid;
+    };
+
+#endif // DIAGPLUGINCONSTRUCTIONPARAM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagsuiteexecparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2007 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:  Provides execution parameters for Suite plug-ins
+*
+*/
+
+
+
+#ifndef DIAGSUITEEXECPARAM_H
+#define DIAGSUITEEXECPARAM_H
+
+// SYSTEM INCLUDES
+#include <e32def.h>             // IMPORT_C / EXPORT_C
+
+
+// FORWARD DECLARATIONS
+class MDiagSuiteObserver;
+class MDiagEngineCommon;
+
+/**
+* Diagnostics Suite plug-in Execution Parameters
+*
+* This class provides the execution environment for Suite plug-ins.
+*
+* @since S60 v5.0
+**/
+NONSHARABLE_CLASS( TDiagSuiteExecParam )
+    {
+public:
+    /**
+    * C++ Constructor
+    *
+    * @param aObserver - Observer to notify continuation. 
+    * @param aEngine - Reference to engine that provides necessary environment
+    *   for suite execution, such as CDiagPluginPool, CAknViewAppUi and
+    *   CDiagPluginExecPlan.
+    */
+    IMPORT_C TDiagSuiteExecParam( MDiagSuiteObserver& aObserver,
+                                  MDiagEngineCommon& aEngine );
+    
+public: // new functions
+
+    /**
+    * Get the Suite plug-in execution observer.
+    *
+    * @return MDiagSuiteObserver - Observer of Suite-plugin.
+    **/
+    IMPORT_C MDiagSuiteObserver& Observer() const;
+
+    /**
+    * Get execution engine.
+    *
+    * @return MDiagEngineCommon - Engine that executes the plug-in.
+    *   Engine provides various functionalities needed for executing
+    *   plug-ins.
+    **/
+    IMPORT_C MDiagEngineCommon& Engine() const;
+    
+private: // data
+    /**
+    * iObserver  - Suite execution observer.
+    */
+    MDiagSuiteObserver&  iObserver;
+
+    /**
+    * iEngine - Engine common interface.
+    */
+    MDiagEngineCommon&  iEngine;
+    };
+
+#endif // DIAGSUITEEXECPARAM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagsuiteobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 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:  Interface to observe suite plug-ins
+*
+*/
+
+
+#ifndef DIAGSUITEOBSERVER_H
+#define DIAGSUITEOBSERVER_H
+
+// FORWARD DECLARTION
+class MDiagSuitePlugin;
+
+/**
+*  Diagnostics Framework Suite Plug-in Observer
+*
+*  This interface is called by Suite Plug-ins to notify the engine
+*  of its suite execution completion.
+*
+*  @since S60 v5.0
+*/
+class MDiagSuiteObserver
+    {
+public:
+    /**
+    * Notify engine of suite plug-in execution completion.
+    * This should be called when PreTestExecutionL() or
+    * PostTestExecutionL() is called.
+    *
+    * @param aSender - reference to sender object.
+    */
+    virtual void ContinueExecutionL( const MDiagSuitePlugin& aSender ) = 0;
+    };
+
+
+#endif // DIAGSUITEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagsuiteplugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2007 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 a test suite i.e. contains collection of tests. 
+*
+*/
+
+
+
+#ifndef DIAGSUITEPLUGIN_H
+#define DIAGSUITEPLUGIN_H
+
+// INCLUDES
+#include    <DiagPlugin.h>          // MDiagPlugin
+
+// FORWARD DECLARATIONS
+class MDiagSuiteObserver;
+class MDiagEngineCommon;
+class CDiagPluginPool;
+class TDiagSuiteExecParam;
+
+/**
+* Test suite plug-in abstract interface. 
+*
+* @since S60 v5.0
+**/
+class MDiagSuitePlugin: public MDiagPlugin
+    {
+public: //DATA STRUCTURES
+
+    /**
+    * Defines sorting algorithm.
+    **/
+    enum TSortOrder 
+    {
+        ENotSorted,
+        ESortByPosition
+    };
+
+    /**
+    * Reason for execution stop.
+    **/
+    enum TStopReason
+    {
+        ESkip,
+        ECancelAll,
+        EWatchdog
+    };
+
+public:    // new API
+
+    /**
+    * Get children of this plug-in. The pointer array is guaranteed to 
+    * be sorted defined by TSortOrder.
+    * @param aChildren Children are appended into this array.
+    * @param aOrder Sorting algorithm.
+    **/
+    virtual void GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                               TSortOrder aOrder ) const = 0;
+
+    /**
+    * Add one child. Child can be either a test suite or a test plug-in.
+    * @param aChild - Child to be added. Ownership is transferred to
+    *               MDiagPluginSuite.
+    **/
+    virtual void AddChildL( MDiagPlugin* aChild ) = 0;
+
+    /**
+    * Called before one of its test plug-in is executed.  Note that it will
+    * not be called if two of its children plug-ins are executed in 
+    * sequence.
+    *
+    * @param aExecParams Parameters for suite pre execution
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    virtual void PrepareChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                            TBool aSkipDependencyCheck,
+                                            TBool aDependencyExecution ) = 0;
+
+    /**
+    * Called before test execution switches to another test suite.
+    *
+    * @param aExecParams Parameters for suite post execution
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    virtual void FinalizeChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                             TBool aSkipDependencyCheck,
+                                             TBool aDependencyExecution ) = 0;
+
+    /**
+    * Get the Uids. The uid is used for database access.
+    * Test suites return a list of their childrens' uids.
+    *
+    * @param aUids An UID array.
+    * @param aOrder Sorting algorithm.
+    **/
+    virtual void GetChildrenUidsL( RArray<TUid>& aUids,
+                                   TSortOrder aOrder ) const = 0;
+
+    /**
+    * Cancels pre/post execution. Cancellation is expected to be synchronous.
+    * Suite plug-in must not call ContinueExecutionL().
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    **/
+    virtual void ExecutionStopL( TStopReason aReason ) = 0;
+    };
+
+#endif // DIAGSUITEPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagsuitepluginbase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Suite Plug-in Base class
+*
+*/
+
+
+#ifndef DIAGSUITEPLUGINBASE_H
+#define DIAGSUITEPLUGINBASE_H
+
+// INCLUDES
+#include <e32cmn.h>             // TUid
+#include <DiagSuitePlugin.h>    // MDiagSuitePlugin
+#include <ConeResLoader.h>      // RConeResourceLoader
+
+// FORWARD DECLARATIONSn
+class CDiagPluginConstructionParam;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Suite Plugin Base Class
+*
+*  This base class provides common implementation of Suite Plugin.
+*
+*  @since S60 v5.0
+*/
+class CDiagSuitePluginBase : public CActive,
+                             public MDiagSuitePlugin
+    {
+public:
+    /**
+    * Destructor. 
+    */
+    IMPORT_C virtual ~CDiagSuitePluginBase();
+
+protected:  // new API for derived class.
+    /**
+    * C++ constructor
+    * 
+    * @param aConstructionParam Construction parameters.
+    */
+    IMPORT_C CDiagSuitePluginBase( CDiagPluginConstructionParam* aParam );
+    
+    /**
+    * Base class constructor
+    * This initializes CDiagSuitePluginBase class. Derived class must call this
+    * method in its ConstructL() method.
+    *  
+    * @param aResourceFileName Drive and name of resource file in format
+    *                          <path>:<rsc_file_name>
+    */
+    IMPORT_C void BaseConstructL( const TDesC& aResourceFileName );
+
+    /**
+    * Run a dialog that waits for response. It is highly recommended that
+    * all plug-ins use this function to display dialogs since it can detect
+    * deletion of dialogs.
+    *
+    * The difference from normal dialog RunLD is that this function returns 
+    * ETrue if dialog exited due to user response and 
+    * EFalse if it was by other means, such as object deletion or
+    * by DismissWaitingDialog() method. 
+    * 
+    *   !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING  !!!!
+    *   !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!!
+    *   !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY.    !!!!
+    * 
+    * The normal dialog response is returned via aDialogResponse reference.
+    * This function can only display one dialog at a time. Calling it again 
+    * while it has not been returned will cause panic.
+    *
+    * @param aDialog - Pointer to dialog to run. If the dialog does not have
+    *   EEikDialogFlagWait flag set, it will panic with EDiagPluginBasePanicBadArgument
+    * @param aDialogResponse - Response from the dialog.  
+    *   For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes
+    *   The only exception is that if cancel is pressed, it will be 0.
+    * @return ETrue if dialog is exiting due to user response.
+    *   Efalse if dialog is dismissed withou user input. 
+    *   If EFalse is returned, plug-in MUST NOT act on the response.
+    *   Also, since plug-in may have been deleted,
+    */
+    IMPORT_C TBool RunWaitingDialogL( CAknDialog* aDialog, TInt& aDialogResponse );
+
+    /**
+    * Dismiss the waiting dialog. This will cause the RunDialogLD() function to return with
+    * aIsUserResponse = Efalse. If nothing is being displayed, this function
+    * does nothing.
+    */
+    IMPORT_C void DismissWaitingDialog();
+
+    /**
+    * CCoeEnv
+    *   @return Reference to CCoeEnv.
+    */
+    IMPORT_C CCoeEnv& CoeEnv();
+
+public: // from MDiagPlugin
+    /**
+    * Get the name of the service that the plug-in provides.
+    *
+    * @return The name of the service.
+    **/
+    IMPORT_C virtual const TDesC& ServiceLogicalName() const;
+
+    /**
+    * Get logical dependencies. One plug-in can have multiple dependencies 
+    * to other plug-ins.
+    *
+    * @param aArray An array of logical names.
+    * @see ServiceLogicalName.
+    **/
+    IMPORT_C virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const;
+
+    /**
+    * Return the type of the plug-in. 
+    *
+    * @return The type.
+    * @see TPluginType.
+    **/
+    IMPORT_C virtual TPluginType Type() const;
+
+    /**
+    * Create an icon that represents the plug-in.
+    *
+    * @return An icon. 
+    **/
+    IMPORT_C virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * Get the order number that this plug-in should appear in its parent list.
+    *
+    * @return TUint order number.
+    **/
+    IMPORT_C virtual TUint Order() const;
+
+    /**
+    * @see MDiagPlugin::IsSupported
+    **/
+    IMPORT_C virtual TBool IsSupported() const;
+
+    /**
+    * Get UID of the parent.
+    *
+    * @return The parent UID.
+    **/
+    IMPORT_C virtual TUid ParentUid() const;
+
+    /**
+    * @see MDiagPlugin::SetDTorIdKey()
+    */
+    IMPORT_C virtual void SetDtorIdKey( TUid aDtorIdKey );
+
+    /**
+    * Get title of the plugin. Default implementation in CDiagSuitePluginBase
+    *   will leave with KErrNotSupported. If plug-in has a title, plug-ins 
+    *   must override this method.
+    * @see MDiagPlugin::GetTitleL() 
+    */
+    IMPORT_C virtual HBufC* GetTitleL() const;
+
+    /**
+    * Get description of the plugin. Default implementation in 
+    *   CDiagSuitePluginBase will leave with KErrNotSupported. If plug-in 
+    *   has a description, plug-ins must override this method.
+    * @see MDiagPlugin::GetDescriptionL()
+    */
+    IMPORT_C virtual HBufC* GetDescriptionL() const;
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the operation.
+    * @param aParam Custom parameter. 
+    * @return TAny pointer. Custom data.
+    */
+    IMPORT_C virtual TAny* CustomOperationL( TUid aUid, TAny* aParam );
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the property
+    * @param aParam Custom parameter.
+    * @return TAny pointer. Custom data. 
+    */
+    IMPORT_C virtual TAny* GetCustomL( TUid aUid, TAny* aParam );
+
+    /**
+    * Initialization Step. This method is called before any plugin are executed.
+    * This can be used to clean up any left over data from previous execution 
+    * sessions. All plug-ins in execution plan will have a chance to clean 
+    * up before any plug-ins are run.  This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in will be executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    **/
+    IMPORT_C virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                             TBool aSkipDependencyCheck,
+                                             TAny* aCustomParams );
+
+    /**
+    * Cleanup Step. This method is called after all plug-ins in the 
+    * execution plan is completed to clean up any left over data from 
+    * current sesison. This can be used to clean up any data that
+    * provides dependent service created for its dependencies.
+    * This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in as executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    **/
+    IMPORT_C virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                           TBool aSkipDependencyCheck,
+                                           TAny* aCustomParams );
+
+
+public: // from MDiagSuitePlugin
+
+    /**
+    * Get children of this plug-in. The pointer array is guaranteed to 
+    * be sorted defined by TSortOrder.
+    *
+    * @param aChildren Children are appended into this array.
+    * @param aOrder Sorting algorithm.
+    **/
+    IMPORT_C virtual void GetChildrenL( RPointerArray<MDiagPlugin>& aChildren,
+                                        TSortOrder aOrder ) const;
+
+    /**
+    * Add one child. Child can be either a test suite or a test plug-in.
+    *
+    * @param aChild - Child to be added. However, ownership is not
+    *               transferred here. 
+    **/
+    IMPORT_C virtual void AddChildL( MDiagPlugin* aChild );
+
+    /**
+    * Get the Uids. The uid is used for database access.
+    * Test suites return a list of their childrens' uids.
+    *
+    * @param aUids  An UID array.
+    * @param aOrder Sorting algorithm.
+    **/
+    IMPORT_C virtual void GetChildrenUidsL( RArray<TUid>& aUids,
+                                    TSortOrder aOrder ) const;
+
+    /**
+    * Called before one of its test plug-in is executed.  Note that it will
+    * not be called if two of its children plug-ins are executed in 
+    * sequence.
+    *
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    IMPORT_C virtual void PrepareChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                                     TBool aSkipDependencyCheck,
+                                                     TBool aDependencyExecution );
+
+    /**
+    * Called before test execution switches to another test suite.
+    *
+    * @param aExecParams Parameters for suite post execution
+    * @param aSkipDependencyCheck - If ETrue dependency is disabled 
+    *   for this test session.
+    * @param aDependencyExecution - If ETrue, this suite is being
+    *   executed to satisfy dependency.
+    **/
+    IMPORT_C virtual void FinalizeChildrenExecutionL( TDiagSuiteExecParam* aParam,
+                                                      TBool aSkipDependencyCheck,
+                                                      TBool aDependencyExecution );
+
+    /**
+    * Cancels pre/post execution. Cancellation is expected to be synchronous.
+    * Suite plug-in must not call ContinueExecutionL().
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    **/
+    IMPORT_C virtual void ExecutionStopL( TStopReason aReason );
+
+private:    // Private Data Types
+    class TPrivateData;
+
+private:    // Private data
+    /**
+    * Plug-in constructor parameter.
+    * Ownership: this
+    */
+    CDiagPluginConstructionParam* iConstructionParam;
+
+    /**
+    * CCoeEnv. This is needed for handling resources. 
+    */
+    CCoeEnv& iCoeEnv;
+
+    /**
+    * Plug-in base's private data
+    */
+    TPrivateData* iData;
+    };
+
+#endif // DIAGSUITEPLUGINBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagtestexecparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2007 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:  Provides execution parameters for test plug-ins
+*
+*/
+
+
+
+#ifndef DIAGTESTEXECPARAM_H
+#define DIAGTESTEXECPARAM_H
+
+
+// SYSTEM INCLUDES
+#include <e32def.h>             // IMPORT_C / EXPORT_C
+
+// FORWARD DECLARATIONS
+class MDiagTestObserver;
+class MDiagEngineCommon;
+
+/**
+* Diagnostics test plug-in Execution Parameters
+*
+* This class provides the execution environment for test plug-ins.
+*
+* @since S60 v5.0
+**/
+NONSHARABLE_CLASS( TDiagTestExecParam )
+    {
+public: // constructor
+    /**
+    * C++ Constructor
+    *
+    * @param aObserver - Observer to notify test execution progress.
+    * @param aEngine - Reference to engine that provides necessary environment
+    *   for test execution, such as CDiagPluginPool, or CAknViewAppUi.
+    */
+    IMPORT_C TDiagTestExecParam( MDiagTestObserver& aObserver,
+                                 MDiagEngineCommon& aEngine );
+    
+public: // new functions
+
+    /**
+    * Get the test plug-in execution observer.
+    *
+    * @return MDiagTestObserver - Observer of test-plugin. Test progress
+    *   and completion should be notified via this object.
+    **/
+    IMPORT_C MDiagTestObserver& Observer() const;
+
+    /**
+    * Get execution engine.
+    *
+    * @return MDiagEngineCommon - Engine that executes the plug-in.
+    *   Engine provides various functionalities needed for executing
+    *   plug-ins.
+    **/
+    IMPORT_C MDiagEngineCommon& Engine() const;
+    
+private: // data
+    /**
+    * iObserver - Test execution observer.
+    */
+    MDiagTestObserver&  iObserver;
+
+    /**
+    * iEngine - Common Engine interface
+    */
+    MDiagEngineCommon&  iEngine;
+    };
+
+#endif // DIAGTESTEXECPARAM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagtestobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2007 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:  Interface to observe test plug-ins
+*
+*/
+
+
+#ifndef DIAGTESTOBSERVER_H
+#define DIAGTESTOBSERVER_H
+
+// INCLUDES
+#include <e32def.h>                         // TUint
+#include <DiagEngineWatchdogTypes.h>        // TDiagEngineWatchdogTypes
+
+// FORWARD DECLARATION
+class CDiagResultsDatabaseItem;
+class MDiagTestPlugin;
+
+
+/**
+* Diagnostics Framework Test Plug-in Observer
+*
+* This interface is called by Test Plug-ins to notify the engine
+* of its test execution progress or completion.
+*
+* @since S60 v3.2
+*/
+class MDiagTestObserver
+    {
+public:
+    /**
+    * Notify engine of test plug-in execution progress.
+    *
+    * @param aSender - Reference to sender object.
+    * @param aCurrentStep - Current execution step.
+    */
+    virtual void TestProgressL( const MDiagTestPlugin& aSender, 
+                                TUint aCurrentStep ) = 0;
+
+
+    /**
+    * Notify engine of test plug-in execution completion.
+    *
+    * @param aSender       Reference to sender object.
+    * @param aTestResult   Result of test execution. Ownership is transferred
+    *                      from the plug-in to engine.
+    */
+    virtual void TestExecutionCompletedL( const MDiagTestPlugin& aSender, 
+                                          CDiagResultsDatabaseItem* aTestResult ) = 0;
+    };
+
+
+#endif // DIAGTESTOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagtestplugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2007 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:  Test Plugin Abstract Interface
+*
+*/
+
+
+#ifndef DIAGTESTPLUGIN_H
+#define DIAGTESTPLUGIN_H
+
+// INCLUDES
+#include    <DiagPlugin.h>              // MDiagPlugin
+
+
+// FORWARD DECLARATION
+class CDiagPluginExecPlan;
+class MDiagTestObserver;
+class MDiagEngineCommon;
+class CDiagPluginPool;
+class TDiagTestExecParam;
+class CDiagResultsDatabaseItem;
+class MDiagResultDetail;
+
+/**
+* Diagnostics test plug-in abstract interface.
+*
+* @since S60 v5.0
+**/
+class MDiagTestPlugin: public MDiagPlugin
+    {
+public: 
+
+    /**
+    * Run mode defines what kind of behaviour is expected from this plug-in.
+    **/
+    enum TRunMode
+        {
+        EInteractiveView,       // plugin with a view
+        EInteractiveDialog,     // interactive, but with dialogs
+        EAutomatic              // automatic tests
+        };
+
+    /**
+    * Reason for execution stop.
+    **/
+    enum TStopReason
+        {
+        ESkip,
+        ECancelAll,
+        EWatchdog
+        };
+
+    /**
+    * Execute a diagnostics test. This is an asynchronous method. The plug-in
+    * must call MDiagTestObserver:TestExecutionCompletedL when test has finished.
+    *
+    * @param aExecParams   Parameters for running the test.
+    * @param aSkipDependencyCheck - If ETrue, plug-in should execute even if 
+    *   dependencies are not executed.
+    * @param aDependencyExecution - If ETrue, this is being executed to 
+    *   satisfy dependency.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   These should be used if TDiagTestExecParam is not enough. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter. Ownership is not transferred since
+    *   client does not always know the type of pointer.
+    **/
+    virtual void RunTestL( TDiagTestExecParam* aExecParam,
+                           TBool aSkipDependencyCheck,
+                           TBool aDependencyExecution,
+                           TAny* aCustomParams ) = 0;
+
+    /**
+    * Describes the run mode of the test plug-in.
+    *
+    * @return Run mode.
+    * @see TDiagRunMode.
+    **/
+    virtual TRunMode RunMode() const = 0;
+
+    /**
+    * Cancels testing. Cancellation is expected to be synchronous.
+    * Test plug-in must return the result immediately, and it must not call
+    * TestExecutionCompletedL(). Ownership of the CDiagResultsDatabaseItem is 
+    * transferred to the caller.
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    * @return Returns result object.  Test must not call TestExecutionCompletedL.
+    **/
+    virtual CDiagResultsDatabaseItem* ExecutionStopL( TStopReason aReason ) = 0;
+
+    /**
+    * Suspend test.  If test cannot be suspended, it will leave with
+    * KErrNotSupported.
+    **/
+    virtual void SuspendL() = 0;
+
+    /**
+    * Resume test. If test cannot be resumed, it will leave with 
+    * KErrNotSupported.
+    **/
+    virtual void ResumeL() = 0;
+
+    /**
+    * Get the number of steps that is needed to execute tests. 
+    * This can be used to calculate progress information. 
+    *
+    * @return The number of steps.
+    **/
+    virtual TUint TotalSteps() const = 0;
+
+    /**
+    * Create detailed information object from test result.
+    * Ownership is transferred to caller.
+    *
+    * @param aTestResult - Base test result.
+    * @return Instance of MDiagResultDetail* that can provide detailed 
+    *   information about the last test.
+    **/
+    virtual MDiagResultDetail* CreateDetailL( 
+                        const CDiagResultsDatabaseItem& aResult ) const = 0;
+    };
+
+#endif // DIAGTESTPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_api/inc/diagtestpluginbase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,589 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Test Plug-in  Base class
+*
+*/
+
+
+#ifndef DIAGTESTPLUGINBASE_H
+#define DIAGTESTPLUGINBASE_H
+
+// INCLUDES
+#include <DiagTestPlugin.h>     // MDiagTestPlugin
+#include <ConeResLoader.h>      // RConeResourceLoader
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem::TResult
+#include <DiagEngineWatchdogTypes.h>    // TDiagEngineWatchdogTypes
+
+// FORWARD DECLARATIONS
+class CDiagResultsDbItemBuilder;
+class TDiagTestPluginBasePrivateData;
+class CDiagPluginConstructionParam;
+class CAknDialog;
+
+/**
+*  Diagnostics Framework Test Plugin  Base Class
+*
+*  This class provides further simplification of test execution.
+*  It handles execution parameter and reporting results to engine
+*
+*  @since S60 v5.0
+*/
+class CDiagTestPluginBase : public CActive,
+                            public MDiagTestPlugin
+    {
+public: // C++ Destructor
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagTestPluginBase();
+
+protected: // new API for derived class
+    /**
+    * C++ constructor
+    * 
+    *   Note that BaseConstructL() must be called to complete object construction.
+    * @param aConstructionParam Construction parameters.
+    */
+    IMPORT_C CDiagTestPluginBase( CDiagPluginConstructionParam* aConstructionParam );
+    
+    /**
+    * 2nd phase Base class constructor
+    * This initializes CDiagTestPluginBase class. Derived class must call this
+    * method in its ConstructL() method.
+    *  
+    * @param aResourceFileName Drive and name of resource file in format
+    *                          <path>:<rsc_file_name>
+    */
+    IMPORT_C void BaseConstructL( const TDesC& aResourceFileName );
+
+    /**
+    * Verify that all dependencies are satisfied. Also returns a list of
+    * failed dependencies.
+    *
+    * @param aEngine. Reference to engine, which provides references to
+    *   database session and plug-in pool.
+    * @param aFailedUids. If ETrue is returned, the parameter is NULL.
+    *           if EFalse is returned, the parameter points to an array that
+    *           can be used to query UIDs of failed dependencies. Client is
+    *           responsible of closing the array.
+    * @return ETrue if all dependencies are executed successfully.
+    *         EFalse if one or more dependencies are failed.
+    */
+    IMPORT_C virtual TBool AreDependenciesSatisfiedL( MDiagEngineCommon& aEngine,
+                                            RArray<TUid>*& aFailedUids ) const;
+
+    /**
+    * Check result of dependencies. This will check each dependency and
+    * determine the best overall result of all the dependencies.
+    *
+    * @param aEngine. Reference to engine, which provides references to
+    *   database session and plug-in pool.
+    * @param aFailedUids. If ESuccess is returned, the parameter is NULL.
+    *           Otherwise the parameter points to an array that
+    *           can be used to query UIDs of failed dependencies. Client is
+    *           responsible of closing the array.
+    * @return Result of the dependency check. If multiple depencies or suites
+    *   are included, it will return the most appropreate result.
+    */
+    IMPORT_C virtual CDiagResultsDatabaseItem::TResult VerifyDependenciesL( 
+        MDiagEngineCommon& aEngine,
+        RArray<TUid>*& aFailedUids ) const;
+
+    /**
+    * Returns execution parameter. 
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return Execution parameter.
+    */
+    IMPORT_C TDiagTestExecParam& ExecutionParam();
+
+    /**
+    * Check if current test session has dependency check skip flag set.
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    * 
+    * @return ETrue if dependency check is disabled for this execution sesison.
+    *   EFalse if dependency check is enabled.
+    */
+    IMPORT_C TBool IsDependencyCheckSkipped() const;
+
+    /**
+    * Check if current test is being executed to satisfy dependency or
+    *   if it is being executed explicitly.
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return ETrue - If it is to satisfy dependency.
+    *   EFalse - If it is being executed explicitly.
+    */
+    IMPORT_C TBool IsDependencyExecution() const;
+
+    /**
+    * Get custom parameter passed to from the engine
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    * 
+    * @return Custom parameter. Ownership is not transferred.
+    */
+    IMPORT_C TAny* CustomParam() const;
+
+    /**
+    * Get currently result db item builder.
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return Reference to current CDiagResultsDbItemBuilder.
+    */
+    IMPORT_C CDiagResultsDbItemBuilder& ResultsDbItemBuilder();
+
+    /**
+    * Report test progress test observer.
+    *   This function will call engine's TestProgressL method with watchdog
+    *   type value that is based on plug-in RunMode.
+    *
+    *   If EAutomatic plug-in, it will use EDiagEngineWatchdogTypeNonInteractive.
+    *   If EInteractiveView or EInteractiveDialog, EDiagEngineWatchdogTypeInteractive. 
+    *
+    *   When watchdog is timed out, it will stop test with test result
+    *   CDiagResultsDatabaseItem::EWatchdogCancel.
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @param aCurrentStep - Current execution step
+    */
+    IMPORT_C void ReportTestProgressL( TUint aCurrentStep );
+
+    /**
+    * Reset watchdog value and watchdog failure result type.
+    *   When watchdog is timed out, it will use the given result type as
+    *   value to report back to engine.  
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @param aWatchdogType - Type of watchdog requested.
+    * @param aResultType - Result to report when wachdog is failed.
+    */
+    IMPORT_C void ResetWatchdog( TDiagEngineWatchdogTypes aWatchdogType,
+                                 CDiagResultsDatabaseItem::TResult aResultType );
+
+    /**
+    * Reset watchdog value and watchdog failure result type.
+    *   For most plug-ins, the other ResetWatchdog should be better. 
+    *   This should be used only if specific time must be given for the step.
+    *
+    *   When watchdog is timed out, it will use the given result type as
+    *   value to report back to engine.  
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @param aTimeToCompletion - Time needed to complete current operation.
+    *   Unit is in microseconds.
+    * @param aResultType - Result to report when wachdog is failed.
+    */
+    IMPORT_C void ResetWatchdog( 
+        TInt aTimeToCompletion,
+        CDiagResultsDatabaseItem::TResult aResultType );
+
+    /**
+    * Reset watchdog value and watchdog failure result type to default values.
+    *   This will also reset watchdog on engine.
+    *
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    */
+    IMPORT_C void ResetWatchdogToDefault();
+
+    /**
+    * Report test result to test observer. 
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    *   This function will also call StopAndCleanupL(), which will call 
+    *   DoStopAndCleanupL(). After CompleteTestL() is called, ExecutionParam() and
+    *   other test state specific API will fail.
+    *
+    * @param aResult - Test result.
+    */
+    IMPORT_C void CompleteTestL( CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Stop current execution and free any data associated with the test.
+    *   This method will call DoStopAndCleanupL() function to allow
+    *   derived class to clean up.
+    *   
+    *   It will also call DismissWaitingDialog() and CActive::Cancel().
+    *
+    *   If derived class overrides ExecutionStopL() function, this function
+    *   must be called by derived version of ExecutionStopL() to allow
+    *   proper clean up of CDiagTestPluginBase.
+    *
+    *   @see CDiagTestPluginBase::ExecutionStopL
+    */
+    IMPORT_C void StopAndCleanupL();
+
+    /**
+    * Run a dialog that waits for response. It is highly recommended that
+    * all plug-ins use this function to display dialogs since it can detect
+    * deletion of dialogs.
+    *
+    * The difference from normal dialog RunLD is that this function returns 
+    * ETrue if dialog exited due to user response and 
+    * EFalse if it was by other means, such as object deletion or
+    * by DismissWaitingDialog() method. 
+    * 
+    *   !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING  !!!!
+    *   !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!!
+    *   !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY.    !!!!
+    * 
+    * The normal dialog response is returned via aDialogResponse reference.
+    * This function can only display one dialog at a time. Calling it again 
+    * while it has not been returned will cause panic.
+    *
+    * @param aDialog - Pointer to dialog to run. If the dialog does not have
+    *   EEikDialogFlagWait flag set, it will panic with EDiagPluginBaseBadArgument
+    * @param aDialogResponse - Response from the dialog.  
+    *   For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes
+    *   The only exception is that if cancel is pressed, it will be 0.
+    * @return ETrue if dialog is exiting due to user response.
+    *   Efalse if dialog is dismissed withou user input. 
+    *   If EFalse is returned, plug-in MUST NOT act on the response.
+    *   Also, since plug-in may have been deleted,
+    */
+    IMPORT_C TBool RunWaitingDialogL( CAknDialog* aDialog, TInt& aDialogResponse );
+
+    /**
+    * Dismiss the waiting dialog. This will cause the RunDialogLD() function to return with
+    * aIsUserResponse = Efalse. If nothing is being displayed, this function
+    * does nothing.
+    */
+    IMPORT_C void DismissWaitingDialog();
+
+    /**
+    * CCoeEnv
+    *   @return Reference to CCoeEnv.
+    */
+    IMPORT_C CCoeEnv& CoeEnv();
+
+    /**
+    * Check if current test is being executed as a single plugin or 
+    * as a part of a suite
+    *   Note that this function should be called only during test execution. 
+    *   If called in other states, it will Panic with EDiagPluginBasePanicInvalidState
+    *
+    * @return ETrue - If run as a single plugin
+    *   EFalse - If run as a part of a suite
+    */
+    IMPORT_C TBool SinglePluginExecution() const;
+    
+protected:  // to be implemented by derived classes
+    /**
+    * Execute test. This is called by CDiagTestPluginBase::RunTestL()
+    *   Note that CDiagTestPluginBase takes ownership of all parameters
+    *   given in RunTestL() function. If specific parameter is needed
+    *   use the following set of functions:
+    *
+    *   Parameters are available via the following APIs.
+    *       Observer:               ExecutionParam().Observer();
+    *       Engine:                 ExecutionParam().Engine();
+    *       Dependency Execution:   IsDependencyExecution();
+    *       Skip Depdency:          IsDependencyCheckSkipped();
+    *       Custom Parameter:       CustomParam();
+    *
+    *   Also, a new instance of CDiagResultsDbItemBuilder is created and
+    *   accessible via:
+    *
+    *       Result Db Item Builder: ResultsDbItemBuilder();
+    */
+    virtual void DoRunTestL() = 0;
+
+    /**
+    * Stop current execution and free any data associated with the test.
+    *   This is called by StopAndCleanupL
+    */
+    virtual void DoStopAndCleanupL() = 0;
+
+    /**
+    * This is called by CDiagTestPluginBase::ExecutionStopL() to allow 
+    *   the derived class to provide additional behavior in ExecutionStopL().
+    *   Default implementation does nothing. For more information about
+    *   how this is called, @see CDiagTestPluginBase::ExecutionStopL()
+    *
+    * @param aReason - Reason why ExecutionStopL() is being called.
+    * @param aTestResult - Test result to write to in database.
+    *   This is IN/OUT parameter. By default, it contains default result based on
+    *   aReason. Plug-in can provide different test result, assign new result
+    *   to this variable.
+    *
+    */
+    IMPORT_C virtual void DoExecutionStopL( MDiagTestPlugin::TStopReason aReason,
+                                            CDiagResultsDatabaseItem::TResult& aTestResult );
+
+protected:  // From CActive
+    /**
+    * RunError. Handle leaves from test. If test is currently running, 
+    * CDiagTestPluginBase will handle the error by calling 
+    * CompleteTestL( CDiagResultsDatabaseItem::EFailed ). If test was
+    * not running, it will return the error back to active scheduler.
+    * 
+    * If this behavior is not desired, derived class should override this
+    * method.
+    * 
+    * For parameters and return value, 
+    * @see CActive::RunError
+    */
+    IMPORT_C virtual TInt RunError( TInt aError );
+
+protected: // from MDiagTestPlugin
+    /**
+    * Handle execution stop.
+    *   @see MDiagTestPlugin::ExecutionStopL()
+    * 
+    *   This method does the following:
+    *       a) Call DoExecutionStopL()   
+    *       b) Call StopAndCleanupL()  -> Calls DoStopAndCleanupL()
+    *       c) Return either EWatchdogCancel or ECancelled depending on
+    *           the stop reason. 
+    *   
+    *   Note: If derived class wants override this function, be sure to 
+    *   call StopAndCleanupL() to allow proper clean up of 
+    *   CDiagTestPluginBase class. StopAndCleanupL() will call
+    *   DoStopAndCleanupL(). 
+    *
+    *   @see DoExecutionStopL()
+    *   @see StopAndCleanupL() 
+    */
+    IMPORT_C virtual CDiagResultsDatabaseItem* ExecutionStopL( TStopReason aReason );
+
+protected:    // from MDiagTestPlugin
+    /**
+    * Get the name of the service that the plug-in provides.
+    *
+    * @return The name of the service.
+    */
+    IMPORT_C virtual const TDesC& ServiceLogicalName() const;
+
+    /**
+    * Get logical dependencies. One plug-in can have multiple dependencies to 
+    * other plug-ins.
+    *
+    * @param aArray An array of logical names.
+    * @see ServiceLogicalNameL
+    */
+    IMPORT_C virtual void GetLogicalDependenciesL( CPtrCArray& aArray ) const;
+
+    /**
+    * Return the type of the plug-in. 
+    *
+    * @return The type.
+    * @see TPluginType.
+    */
+    IMPORT_C virtual TPluginType Type() const;
+
+    /**
+    * Create an icon that represents the plug-in.
+    *
+    * @return An icon. 
+    */
+    IMPORT_C virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * @see MDiagPlugin::IsSupported
+    */
+    IMPORT_C virtual TBool IsSupported() const;
+
+    /**
+    * Get the order number that this plug-in should appear in its parent list.
+    *
+    * @return TUint order number.
+    */
+    IMPORT_C virtual TUint Order() const;
+
+    /**
+    * Get UID of the parent.
+    *
+    * @return The parent UID.
+    */
+    IMPORT_C virtual TUid ParentUid() const;
+
+    /**
+    * @see MDiagPlugin::SetDTorIdKey()
+    */
+    IMPORT_C virtual void SetDtorIdKey( TUid aDtorIdKey );
+
+    /**
+    * Get title of the plugin. Default implementation in CDiagTestPluginBase 
+    *   will leave with KErrNotSupported. If plug-in has a title, plug-ins 
+    *   must override this method.
+    * @see MDiagPlugin::GetTitleL() 
+    */
+    IMPORT_C virtual HBufC* GetTitleL() const;
+
+    /**
+    * Get description of the plugin. Default implementation in 
+    *   CDiagTestPluginBase will leave with KErrNotSupported. If plug-in 
+    *   has a description, plug-in must override this method.
+    * @see MDiagPlugin::GetDescriptionL()
+    */
+    IMPORT_C virtual HBufC* GetDescriptionL() const;
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the operation.
+    * @param aParam Custom parameter. 
+    * @return TAny pointer. Custom data.
+    */
+    IMPORT_C virtual TAny* CustomOperationL( TUid aUid, TAny* aParam );
+
+    /**
+    * Reserved for future use/plugin's custom functionality. 
+    *
+    * @param aUid   Unique identifier of the property
+    * @param aParam Custom parameter.
+    * @return TAny pointer. Custom data. 
+    */
+    IMPORT_C virtual TAny* GetCustomL( TUid aUid, TAny* aParam );
+
+    /**
+    * Initialization Step. This method is called before any plugin are executed.
+    * This can be used to clean up any left over data from previous execution 
+    * sessions. All plug-ins in execution plan will have a chance to clean 
+    * up before any plug-ins are run.  This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in will be executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    */
+    IMPORT_C virtual void TestSessionBeginL( MDiagEngineCommon& aEngine,
+                                             TBool aSkipDependencyCheck,
+                                             TAny* aCustomParams );
+
+    /**
+    * Cleanup Step. This method is called after all plug-ins in the 
+    * execution plan is completed to clean up any left over data from 
+    * current sesison. This can be used to clean up any data that
+    * provides dependent service created for its dependencies.
+    * This is a synchrouns method.
+    *
+    * @param aEngine - Reference to engine.
+    * @param aSkipDependencyCheck - If ETrue, plug-in as executed
+    *   even if dependencies are not executed.
+    * @param aCustomParams Custom parameters for plug-ins. 
+    *   It can used to pass arbitrary data from application to the plug-ins.
+    *   Owership is not transferred and plug-in must not delete
+    *   this parameter.
+    */
+    IMPORT_C virtual void TestSessionEndL( MDiagEngineCommon& aEngine,
+                                           TBool aSkipDependencyCheck,
+                                           TAny* aCustomParams );
+
+
+    /**
+    * Execute diagnostics test.
+    * @see MDiagTestPlugin::RunTestL
+    */
+    IMPORT_C virtual void RunTestL( TDiagTestExecParam* aExecParam,
+                                    TBool aSkipDependencyCheck,
+                                    TBool aDependencyExecution,
+                                    TAny* aCustomParams );
+
+    /**
+    * Suspend test.  
+    * @see MDiagTestPlugin::SuspendL
+    */
+    IMPORT_C virtual void SuspendL();
+
+    /**
+    * Resume test. 
+    * @see MDiagTestPlugin::ResumeL
+    */
+    IMPORT_C virtual void ResumeL();
+
+    /**
+    * Create test result detail.
+    * @see CDiagTestPluginBase::CreateDetailL
+    */
+    IMPORT_C virtual MDiagResultDetail* CreateDetailL( 
+        const CDiagResultsDatabaseItem& aResult ) const;
+
+private:    // private functions
+    /**
+    * Stop and clean up CDiagTestPluginBase
+    */
+    void BaseStopAndCleanup();
+
+    /**
+    * Utility function to get all dependent test plug-ins. If suite is found,
+    * it will be expanded to test plug-ins.
+
+    * @param aEngine. Reference to engine, which provides references to
+    *   database session and plug-in pool.
+    * @param aPluginList - Output array. Upon completion, it will hold
+    *   list of test plug-ins. If this plug-in does not depend on any tests, 
+    *   it will be empty.
+    *   Ownership of individual items are not trasferred, so ResetAndDestroy()
+    *   must not be called.
+    */
+    void GetAllDependentTestsL( MDiagEngineCommon& aEngine,
+                                RPointerArray< MDiagTestPlugin >& aPluginList ) const;
+
+    /**
+    * Utility function to check results of tests in array and come up with
+    * best overall result of tests. 
+    * @param aPluginList - List of test plug-ins.
+    * @param aFailedUidList - Output array. Upon completion, it will contain
+    *   list of uids that failed.
+    * @return Overall result of dependent tets.
+    */
+    CDiagResultsDatabaseItem::TResult SummarizeOverallTestResultsL( 
+        MDiagEngineCommon& aEngine,
+        const RPointerArray< MDiagTestPlugin >& aPluginList,
+        RArray< TUid >& aFailedUidList ) const;
+
+
+private:    // Private Data Type
+    // Forward declaration.
+    class TPrivateData;
+
+private:    // Private Data
+    /**
+    * Plug-in constructor parameter.
+    * Ownership: this
+    */
+    CDiagPluginConstructionParam* iConstructionParam;
+
+    /**
+    * CCoeEnv. This is needed for handling resources. 
+    */
+    CCoeEnv& iCoeEnv;
+
+    /**
+    * Plug-in base's private data
+    */
+    TPrivateData* iData;
+    };
+
+#endif // DIAGTESTPLUGINBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_pool_api/diagnostics_plugin_pool_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="400f1a7110ad1261f33dda614736cbbc" dataversion="1.0">
+  <name>Diagnostics Plugin Pool API</name>
+  <description>This is for diagnostics App and FW communication and mainatenance of plugins</description>
+  <type>c++</type>
+  <subsystem>devicediagnosticsfw</subsystem>
+  <libs>
+    <lib name="diagframework.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_pool_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                Diagnostics Plugin Pool API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/diagpluginpool.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagPluginPool.h)
+../inc/diagpluginpoolobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagPluginPoolObserver.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_pool_api/inc/diagpluginpool.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 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:  Manages Diagnostics Plug-in
+*
+*/
+
+
+#ifndef DIAGPLUGINPOOL_H
+#define DIAGPLUGINPOOL_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class MDiagPlugin;
+class MDiagPluginPoolObserver;
+class CDiagPluginPoolImpl;        
+
+
+/**
+*  Diagnostics Framework Plugin Pool Class
+*
+*  This class is used to load Diagnostics ECom plug-ins. It works with both
+*  Suite Plug-in and Test Plug-in. Once loaded, it will manage the life
+*  cycle of the plug-ins.
+*
+*  All loaded plug-ins will be destroyed when pool is deleted.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagPluginPool ) : public CBase
+    {
+public:
+
+    /**
+    * Two-phased constructors
+    *
+    * @param aObserver     Plug-in Pool observer.
+    * @return New instance of CDiagPluginPool
+    */
+    IMPORT_C static CDiagPluginPool* NewL( MDiagPluginPoolObserver& aObserver );
+    IMPORT_C static CDiagPluginPool* NewLC( MDiagPluginPoolObserver& aObserver );
+
+    /**
+    * Destructor
+    *
+    */
+    IMPORT_C virtual ~CDiagPluginPool();
+
+public:     // new API
+
+    /**
+    * Loads all plug-ins. Progress is notified via MDiagPluginPoolObserver.
+    * 
+    * @param aUid - Interface Uid to load.
+    */
+    IMPORT_C void LoadAsyncL( TUid aUid );
+    
+    /**
+    * Create an instance of a plug-in. It can be a test plug-in or suite plug-in.
+    * If this is a suite, it will not have its children associated with it since
+    * will require children to be loaded as well.
+    *
+    * Plug-ins created using this method is not part of plug-in pool. Therefore
+    * client must manage the life cycle of the plug-in.
+    * 
+    * @param aUid - Implementation Uid of plug-in. 
+    * @return Newly instantiated plug-in. Ownership is transferred to caller.
+    */
+    IMPORT_C static MDiagPlugin* CreatePluginL( TUid aUid );
+
+    /**
+    * Cancel Plug-in Loading
+    * This method cancels plug-in loading. If it was not currently loading
+    * plug-ins, it will leave with KErrNotReady
+    */
+    IMPORT_C void CancelLoadPluginsL();
+
+    /**
+    * Find Plug-in that matches given Uid.
+    *
+    * @param aUid      Uid of plug-in to search.
+    * @param aPlugin   Reference to Plugin found. Engine owns this plug-in.
+    *                  Client must not deallocate plug-in.
+    * @return TInt     KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    */
+    IMPORT_C TInt FindPlugin( TUid aUid, MDiagPlugin*& aPlugin ) const;
+
+    /**
+    * Find Plug-in that matches given Uid. This function will leave on error.
+    *  Leave codes:    KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    *
+    * @param aUid      Uid of plug-in to search.
+    * @return Refernce to the plug-in found.
+    */
+    IMPORT_C MDiagPlugin& FindPluginL( TUid aUid ) const;
+
+    /**
+    * Find Plug-in that matches given service name.
+    *
+    * @param aServiceName  Service name of the plug-in. Name must match exactly.
+    * @param aPlugin       Reference to Plugin found. Engine owns this plug-in.
+    *                      Client must not deallocate plug-in.
+    * @return TInt         KErrNone        - Success.
+    *                      KErrNotFound    - Not found.
+    *                      KErrNotReady    - Plug-ins are not yet loaded.
+    */
+    IMPORT_C TInt FindPlugin( const TDesC& aServiceName,
+                              MDiagPlugin*& aPlugin ) const;
+
+    /**
+    * Find Plug-in that matches given service name. Will leave on error.
+    *  Leave codes:    KErrNone        - Success.
+    *                  KErrNotFound    - Not found.
+    *                  KErrNotReady    - Plug-ins are not yet loaded.
+    *
+    * @param aServiceName  Service name of the plug-in. Name must match exactly.
+    * @return Reference to Plugin found.
+    */
+    IMPORT_C MDiagPlugin& FindPluginL( const TDesC& aServiceName ) const;
+
+private:  // private constructors
+    
+    /**
+    * C++ Constructor
+    *    
+    */    
+    CDiagPluginPool();
+    
+    /**
+    * 2nd phase constructor
+    *    
+    */        
+    void ConstructL( MDiagPluginPoolObserver& aObserver );
+
+private:    //  MEMBER DATA
+    
+    /**
+    * iPluginPoolImpl - Acutal implementation of CDiagPluginPool
+    * Owns
+    */
+    CDiagPluginPoolImpl* iPluginPoolImpl;
+    };
+
+
+#endif // DIAGPLUGINPOOL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_pool_api/inc/diagpluginpoolobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2007 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:  Observer interface to use with CDiagPluginPool 
+*
+*/
+
+
+#ifndef DIAGPLUGINPOOLOBSERVER_H
+#define DIAGPLUGINPOOLOBSERVER_H
+
+// INCLUDES
+#include <e32cmn.h>     // TUid
+#include <e32def.h>     // TInt
+
+// FORWARD DECLARATIONS
+class MDiagPlugin;
+
+/**
+*  Diagnostics Framework Plugin Pool Observer
+*
+*  This interface is called by CDiagPluginPool to notify the plug-in 
+*  loading progress. This is used only for LoadAsyncL() scenario.
+*
+*  @since S60 v5.0
+*/
+class MDiagPluginPoolObserver 
+    {
+public:
+
+    /**
+    * Notify client of plug-in loading progress.
+    *
+    * @param aCurrPlugin   Current plugin index in loading process. 
+    *                       Use it to display loading progress.
+    * @param aPluginCount  Totals number of plug-ins
+    * @param aLoadedPluginUid  Uid of the plug-in just loaded.
+    */
+    virtual void LoadProgressL( TUint aCurrentPlugin, 
+                                TUint aPluginCount, 
+                                const TUid& aLoadedPluginUid ) = 0;
+
+
+    /**
+    * Notify client of plug-in loading completion
+    *
+    * @param aError     KErrNone - Success
+    *                   KErrCorrupt  - One ore more plugin could not
+    *                   be loaded. 
+    *                   KErrNoMemory - Not enough memory.
+    */
+    virtual void LoadCompletedL( TInt aError ) = 0;
+    };
+
+
+#endif // DIAGPLUGINPOOLOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/diagnostics_plugin_utility_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="2ce0c116ec3d4f1195d2aeef47155698" dataversion="1.0">
+  <name>Diagnostics Plugin Utility API</name>
+  <description>Utility functions mainly used by the plugins.</description>
+  <type>c++</type>
+  <subsystem>devicediagnosticsfw</subsystem>
+  <libs>
+    <lib name="diagframework.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                Diagnostics Plugin Utility API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/diaglogeventeraser.h     MW_LAYER_PLATFORM_EXPORT_PATH(diaglogeventeraser.h)
+../inc/diagcommondialog.h      MW_LAYER_PLATFORM_EXPORT_PATH(DiagCommonDialog.h)
+../inc/diagnetworkregstatuswatcher.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagNetworkRegStatusWatcher.h)
+../inc/diagpluginwaitingdialogwrapper.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagPluginWaitingDialogWrapper.h)
+../inc/diaglogeventeraserobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(diaglogeventeraserobserver.h)
+../inc/diagnetworkregstatusobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagNetworkRegStatusObserver.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagcommondialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2007 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:  List of common dialog types
+*
+*/
+
+
+#ifndef DIAGCOMMONDIALOG_H
+#define DIAGCOMMONDIALOG_H
+
+
+/**
+*  Diagnostics Common Dialog Types
+*
+*  This is a list of common dialogs that can be used by plug-ins.
+* 
+*/
+enum TDiagCommonDialog
+    {
+    /**
+    * EDiagCommonDialogConfirmCancelAll
+    * Dialog that asks the user if all tests should be cancelled or not.
+    *
+    * aInitData:       No init data needed.  Always pass NULL.
+    * Return:          Standard dialog.  Use CAknDialog.
+    * Execution:       Call RunLD().
+    * RunLD() returns: - EAknSoftkeyYes, if the user confirmed the request to
+    *                    cancel all test execution.  Plugins should not do
+    *                    any further execution and should return immediately.
+    *                  - EAknSoftkeyNo, if the user dismissed the dialog and
+    *                    decided not to cancel all test execution.
+    *                  - 0, if the dialog is forced closed.  Generally,
+    *                    plugins should not distinguish between EAknSoftkeyNo
+    *                    and 0 (i.e., they should *only* check for
+    *                    EAknSoftkeyYes), unless there is good reason to.
+    *
+    * @code
+    *
+    *    CAknDialog* dlg = ExecutionParam().Engine().CreateCommonDialogLC(
+    *        EDiagCommonDialogConfirmCancelAll,
+    *        NULL );
+    *
+    *    TInt result = 0;
+    *    if ( !RunWaitingDialogL( dlg, result ) ||
+    *         result == EAknSoftkeyYes )
+    *        {
+    *        // Do not continue executing.  Either the dialog has been deleted
+    *        // or the user has cancelled all execution.
+    *        return;
+    *        }
+    *
+    *    dlg = NULL;
+    *
+    *    // Loop and display the plugin query again.
+    *    askAgain = ETrue;
+    *
+    */
+    EDiagCommonDialogConfirmCancelAll = 1,
+    EDiagCommonDialogConfirmSkipAll =2
+    };
+
+#endif // DIAGCOMMONDIALOG_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/inc/diaglogeventeraser.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Logs Event Eraser.
+*
+*/
+
+
+#ifndef DIAGLOGEVENTERASER_H
+#define DIAGLOGEVENTERASER_H
+
+// Include Files
+#include <e32base.h>                    // CActive
+#include <f32file.h>                    // RFs
+
+// Forward Declarations
+class MDiagLogEventEraserObserver;
+class CActiveSchedulerWait;
+class CLogClient;
+class CLogViewEvent;
+class CLogFilter;
+
+/**
+* Diagnostics Plugin Log Event Eraser
+*
+* This class is used to remove log events generated by diagnostics plugins.
+* Events could be anything that is logged by the system log, such as call or
+* data use records.
+*
+* @lib euser.lib
+* @lib logcli.lib 
+* @lib efsrv.lib
+* @lib flogger.lib
+*/
+NONSHARABLE_CLASS( CDiagLogEventEraser ) : public CActive
+    {
+
+public: // New functions
+
+    /**
+    * Symbian OS two-phase constructor.
+    *
+    * @param aObserver A reference to the observer for this event eraser.
+    * @param aFilter The filter to be used for log erasure.  Clients may pass
+    *                NULL for no filtering.  Ownership is transferred.
+    * @return An pointer to the new instance of CDiagLogEventEraser.
+    */
+    IMPORT_C static CDiagLogEventEraser* NewL(
+        MDiagLogEventEraserObserver& aObserver,
+        CLogFilter* aFilter = NULL );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagLogEventEraser();
+
+    /**
+    * This gets the filter used for the log erasure.  Clients which want to
+    * filter the logs to be erased must call this function and set the
+    * appropriate filter before calling StartAsyncEraseLogsL or EraseLogsL.
+    *
+    * @return The filter to apply to the logs to check for erasure.
+    */
+    IMPORT_C CLogFilter& Filter();
+
+    /**
+    * This gets the log client used for the log erasure.
+    *
+    * @return The log client used for log erasure.
+    */
+    IMPORT_C CLogClient& LogClient();
+
+    /**
+    * This starts an asynchronous log erase operation.  The completion of this
+    * request is notified by MDiagLogEventEraserObserver::CompleteEventEraseL.
+    */
+    IMPORT_C void StartAsyncEraseLogsL();
+
+    /**
+    * This performs a synchronous log erase operation.  The function will
+    * leave if there is any error in log erasure.
+    */
+    IMPORT_C void EraseLogsL();
+
+
+private: // New functions
+
+    /**
+    * C++ default constructor.
+    *
+    * @param aObserver A reference to the observer for this event eraser.
+    * @param aFilter The filter to be used for log erasure.  If NULL is
+    *                passed, a new filter will be created during the second
+    *                phase of construction.  Ownership is transferred.
+    */
+    CDiagLogEventEraser( MDiagLogEventEraserObserver& aObserver,
+                         CLogFilter* aFilter );
+    
+    /**
+    * Symbian OS default constructor.
+    */
+    void ConstructL();
+
+    /**
+    * Handles the completion of log erasing and performs different operations
+    * depending on whether the erasing was asynchronous or not.
+    */
+    void HandleCompletionL( TInt aError );
+
+
+private: // From base class CActive
+
+    /**
+    * Handle active object completion event.
+    */
+    virtual void RunL();
+
+    /**
+    * Handle active object cancel event.
+    */
+    virtual void DoCancel();
+
+
+private: // Data
+
+    /** The state of the log erasing operation. */
+    enum TDiagLogEventEraserState
+        {
+        EStateInitial = 0,
+        EStateApplyingFilter,
+        EStateReadingEntries,
+        EStateDeletingEntry,
+        EStateComplete
+        };
+
+    /** The observer for this instance of the log event eraser. */
+    MDiagLogEventEraserObserver& iObserver;
+
+    /** The active scheduler, used for synchronous log erasure.  Own. */
+    CActiveSchedulerWait* iWaitScheduler;
+
+    /** The Log client.  Own. */
+    CLogClient* iLogClient;
+
+    /** The Log view.  Own. */
+    CLogViewEvent* iLogView;
+
+    /** The Log filter.  Own. */
+    CLogFilter* iLogFilter;
+
+    /** A file server session used to delete the logs. */
+    RFs iFsSession;
+
+    /** The internal state of the log event eraser. */
+    TDiagLogEventEraserState iState;
+
+    /** Indicates if the log event eraser is running a synchronous delete. */
+    TBool iIsDeletingSynchronous;
+
+    /** The return code for syncronous operation. */
+    TInt iError;
+    };
+
+#endif // DIAGLOGEVENTERASER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/inc/diaglogeventeraserobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Logs Event Eraser
+*                 Observer class, which clients implement to receive events
+*                 from the Event Eraser.
+*
+*/
+
+
+#ifndef DIAGLOGEVENTERASEROBSERVER_H
+#define DIAGLOGEVENTERASEROBSERVER_H
+
+// Forward Declarations
+class CLogEvent;
+
+/**
+* Diagnostics Plugin Log Event Eraser Observer
+*   
+* This is a pure virtual class that clients of the Event Eraser must implement
+* to receive callbacks from the Log Event Eraser.
+*/
+class MDiagLogEventEraserObserver
+    {
+
+public: // New functions
+
+    /**
+    * This function is called to check if the log event needs to be deleted.
+    *
+    * @param aEvent The event to check.
+    * @return ETrue if the log event should be deleted, EFalse otherwise.
+    */
+    virtual TBool IsEventToBeDeleted( const CLogEvent& aEvent ) = 0;
+    
+    /**
+    * This function is called to notify that the erase operation is complete.
+    *
+    * @param aError Error code to indicate erase failure, or KErrNone.
+    */           
+    virtual void CompleteEventEraseL( TInt aError ) = 0;
+
+    };
+
+#endif // DIAGLOGEVENTERASEROBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagnetworkregstatusobserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Network registration
+*                 status observer interface
+*
+*/
+
+
+#ifndef DIAGNETWORKREGSTATUSOBSERVER_H
+#define DIAGNETWORKREGSTATUSOBSERVER_H
+
+/**
+* Diagnostics Plugin Network registration status observer interface
+*   
+* This is an abstract class which plugins must derive and implement to receive
+* call-backs from the Diagnostics Network registration status observer.
+*/
+class MDiagNetworkRegStatusObserver
+    {
+public:
+    /**
+    * This function is used to inform the intial network registration status
+    *
+    * @param aRegistered. 
+    *  ETrue :The device is currently registered on the network
+    *  EFalse:The device is currently not registered on the network.
+    */
+    virtual void InitialNetworkRegistrationStatusL( const TBool& aRegistered ) = 0;
+    
+    /**
+    * This interface is used to inform the clients of any changes in the network registration
+    * status
+    *
+    * @param aRegistered
+    * ETrue :The device has now changed to registered status.
+    * EFalse:The device has now lost network coverage.
+    */    
+    virtual void NetworkRegistrationStatusChangeL( const TBool& aRegistered ) = 0;
+    };
+
+#endif // DIAGNETWORKREGSTATUSOBSERVER_H
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagnetworkregstatuswatcher.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 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 header for the Diagnostics Network registration
+*                 status watcher.
+*
+*/
+
+
+#ifndef DIAGNETWORKREGSTATUSWATCHER_H
+#define DIAGNETWORKREGSTATUSWATCHER_H
+
+// Include files
+#include <e32base.h>        // CActive
+#include <etel3rdparty.h>   // CTelephony
+
+//Forward declaration
+class MDiagNetworkRegStatusObserver;
+
+
+/**
+* Diagnostics Network registration status watcher
+*
+* This class can be used as an observer for network status. After 
+* instantiating the class and calling StartObserver(), the class firstly 
+* informs the client of the current registration status and then goes into
+* an observing mode for any changes in the network registration status.
+*
+*/
+class CDiagNetworkRegStatusWatcher : public CActive
+    {
+public:
+
+    /**
+    * Symbian OS constructor.
+    *
+    * @param aCallBack A reference to the callback for this network
+             registration status watcher
+    * @return An pointer to the new instance of CDiagNetworkRegStatusWatcher.
+    */
+    IMPORT_C static CDiagNetworkRegStatusWatcher* NewL(
+                    MDiagNetworkRegStatusObserver& aCallBack );
+    
+    /**
+    * Default C++ virtual destructor
+    */               
+    IMPORT_C virtual ~CDiagNetworkRegStatusWatcher();
+    
+    /**
+    * This function is used by client to start the watcher. Firstly, the
+    * watcher will inform the clients via call
+    * MDiagNetworkRegStatusObserver::InitialNetworkRegistrationStatusL()
+    * and then go into an observing mode for any changes in the network
+    * registration status. The changes status is informed via 
+    * MDiagNetworkRegStatusObserver::NetworkRegistrationStatusChangeL()
+    */    
+    IMPORT_C void StartObserver();
+    
+
+    /**
+    * This function is used by client to stop the observer.
+    */     
+    IMPORT_C void StopObserver();
+
+private:
+
+    /**
+    * C++ constructor.
+    *
+    * @param aCallBack A reference to the callback for Network
+    * registration status observer
+    */
+    CDiagNetworkRegStatusWatcher( MDiagNetworkRegStatusObserver&
+                                                            aCallBack );
+   
+    /**
+    * Symbian C++ 2nd phase constructor.
+    *
+    */    
+    void ConstructL();
+
+private: // From base class CActive
+
+    /**
+    * Handle active object completion event.
+    */
+    virtual void RunL();
+
+    /**
+    * Handle active object cancel event.
+    */
+    virtual void DoCancel();
+    
+private: // private functions
+
+    /**
+    * Handler for the internal state EStateWaitForInitialStatus
+    */
+    void HandleInitialStatusL();
+    
+    /**
+    * Handler for the internal state EStateWaitForStatusChange
+    */    
+    void HandleNetworkStatusChangeL();
+
+    /**
+    * This function wraps the logic to decide if the device is currently 
+    * registered or not.
+    *
+    * @return ETrue if the devide is registered, EFalse if the device is 
+    * not registered.
+    */
+    TBool IsDeviceRegisteredOnNetwork();
+    
+private:
+
+    /** States of the Network registration status watcher */
+    enum TDiagNetwRegStatusWatcherState
+        {
+        EStateInit = 0,
+        EStateWaitForInitialStatus,
+        EStateWaitForStatusChange,
+        EStateStopping
+        };
+    
+    /** variable to store the internal state of the network registration
+    *   status watcher
+    */
+    TDiagNetwRegStatusWatcherState iState;        
+
+    /** Interface to phone's telephony system.  Own. */
+    CTelephony* iTelephony;
+    
+    /** Defines the current network registration status */    
+    CTelephony::TNetworkRegistrationV1 iRegV1;
+    
+    /** A typedef'd packaged CTelephony::TNetworkRegistrationV1 for
+    passing through a generic API method. */    
+    CTelephony::TNetworkRegistrationV1Pckg iRegV1Pckg;        
+                        
+    /** The callback interface for this instance of Network
+    registration status observer */
+    MDiagNetworkRegStatusObserver& iCallBack; 
+
+    /** This variable remembers whether in previous state the 
+    * the device was registered or not
+    */
+    TBool iPreviouslyRegistered;
+    };
+
+#endif // DIAGNETWORKREGSTATUSWATCHER_H
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_plugin_utility_api/inc/diagpluginwaitingdialogwrapper.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2007 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:  Provides wrapper for waiting dialogs.
+*
+*/
+
+
+#ifndef DIAGPLUGINWAITINGDIALOGWRAPPER_H
+#define DIAGPLUGINWAITINGDIALOGWRAPPER_H
+
+// INCLUDES
+#include <e32base.h>                // CBase
+
+// FORWARD DECLARATIONS
+class CAknDialog;
+
+/**
+*  Diagnostics Plugin Waiting Dialog Wrapper.
+*
+*   This class provides a wrapper for executing dialogs. The only functionality
+*   it adds is that it provides a way for the caller to find out whether
+*   the dialog was dismissed by the user response, or by application deletion.
+*
+*  @since S60 v5.0
+*/
+class CDiagPluginWaitingDialogWrapper : public CBase
+    {
+public: // new API
+    /**
+    * Two-phased constructor.
+    *
+    *   @param - aWaitingDialog.  Pointer to dialog to display. Note that 
+    *       it must be a dialog with EEikDialogFlagWait set. Otherwise, it 
+    *       will panic with EDiagPluginBasePanicBadArgument
+    *       Ownership is transferred to the wrapper.
+    *   @return - New instance of CDiagPluginWaitingDialogWrapper
+    */
+    IMPORT_C static CDiagPluginWaitingDialogWrapper* NewL( CAknDialog* aWaitingDialog );
+    
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagPluginWaitingDialogWrapper();
+
+    /**
+    * Run a dialog that waits for response. 
+    *
+    * To dismiss the dialog, simply delete CDiagPluginWaitingDialogWrapper instance.
+    *
+    * The difference from normal dialog RunLD is that this function returns 
+    * ETrue if dialog exited due to user response and 
+    * EFalse if the object was deleted.
+    * 
+    *   !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING  !!!!
+    *   !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!!
+    *   !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY.    !!!!
+    * 
+    * The normal dialog response is returned via aDialogResponse parameter.
+    *
+    * @param aDialogResponse - Response from the dialog.  
+    *   For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes
+    *   The only exception is that if cancel is pressed, it will be 0.
+    * @return ETrue if dialog is exiting due to user response.
+    *   Efalse if dialog is dismissed without user input. 
+    *   If EFalse is returned, plug-in MUST NOT act on the response.
+    */
+    IMPORT_C TBool RunLD( TInt& aDialogResponse );
+
+private:    // private interface
+    /**
+    * C++ Constructor
+    *   
+    *   @param - aWaitingDialog.  Pointer to dialog to display. Note that 
+    *       it must be a dialog with EEikDialogFlagWait set. Otherwise, it 
+    *       will panic with EDiagPluginBasePanicBadArgument
+    *       Ownership is transferred to the wrapper.
+    */
+    CDiagPluginWaitingDialogWrapper( CAknDialog* aWaitingDialog );
+
+private:    // Private Data
+    /**
+    * Pointer to the dialog being displayed.
+    * Ownership: Shared. Normally, dialog will dismiss itself. However,
+    * if plug-in is being deleted, it can be deleted by the plug-in as well.
+    */
+    CAknDialog* iWaitingDialog;
+
+    /**
+    * Indicates whether this class is deleted by caller.
+    * Ownership: Not owned. Normally, it will point to a stack entry.
+    */
+    TBool* iIsObjectDeletedPtr;
+    };
+
+#endif // DIAGTESTPLUGINBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/diagnostics_results_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="0e4bf88aa0fc3fab2fd229af2c11d0fd" dataversion="1.0">
+  <name>Diagnostics results API</name>
+  <description>An API for storing and handling test case/session results.</description>
+  <type>c++</type>
+  <subsystem>devicediagnosticsfw</subsystem>
+  <libs>
+    <lib name="diagresultsdatabase.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                Diagnostics results API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/diagresultdetailbasic.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultDetailBasic.h)
+../inc/diagresultsdbitembuilder.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultsDbItemBuilder.h)
+../inc/diagresultsdbrecordengineparam.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultsDbRecordEngineParam.h)
+../inc/diagresultsdatabase.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultsDatabase.h)
+../inc/diagresultdetail.h      MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultDetail.h)
+../inc/diagresultsdatabasetestrecordinfo.h      MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultsDatabaseTestRecordInfo.h)
+../inc/diagresultsdatabaseitem.h     MW_LAYER_PLATFORM_EXPORT_PATH(DiagResultsDatabaseItem.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultdetail.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Detail Test Result Interface
+*
+*/
+
+
+#ifndef DIAGRESULTDETAIL_H
+#define DIAGRESULTDETAIL_H
+
+// INCLUDES
+#include <e32cmn.h>         // RBuf
+
+// FORWARD DECLARATIONS
+class CGulIcon;
+
+
+/**
+*  Diagnostics Framework Test Result Details
+*
+*  This interface allows application to query addtional information about
+*  Diagnostics Test Result.  
+*
+*  @since S60 v5.0
+*/
+class MDiagResultDetail 
+    {
+public:
+    /** 
+    * Possible Output Formats.
+    */
+    enum TOutputFormat
+        {
+        EGetMoreInfo,           // Human readable text format.
+        ECorrectionUrl,         // URL for correction
+        ECorrectionUrlCaption   // Caption for the correction URL.
+        };
+
+    /**
+    * Get list of supported output
+    *
+    * @param aOutputList   - Returns supported output formats
+    */
+    virtual void GetSupportedOutput( RArray<TOutputFormat>& aOutputList ) const = 0;
+
+    /**
+    * Check if a given output format is supported.
+    *
+    * @param aOutputFormat - Possible output formate.
+    * @return ETrue if supported. EFalse otherwise.
+    */
+    virtual TBool IsOutputSupported( TOutputFormat aOutputFormat ) const = 0;
+
+    /**
+    * Output current result to a specified format.
+    *
+    * @param aFormat   Format of desired output.
+    * @param aBuffer   Output buffer.
+    */
+    virtual void GetOutputL( TOutputFormat aFormat, RBuf& aBuffer ) const = 0;
+
+    /**
+    * Create an icon. Icon can be created based on the results of the test.
+    *
+    * @return An icon that matches the result of the test.
+    **/
+    virtual CGulIcon* CreateIconL() const = 0;
+
+    /**
+    * Externalize to CBufFlat. This will be how the data will be stored in the 
+    * CDiagResultsDatabaseItem
+    *
+    * @return CBufFlat containing the externalized data. Ownership is passed 
+    *   to the caller.
+    **/
+    virtual CBufFlat* ExternalizeToBufferL() const = 0;
+
+    /**
+    * C++ Virtual destructor. Virtual destructor must be defined to make sure
+    * that correct destructor is called. 
+    *
+    **/
+    virtual ~MDiagResultDetail() {};
+    };
+
+#endif // DIAGRESULTDETAIL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultdetailbasic.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2007 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:  Basic Diagnostics Test Result Detail class
+*
+*/
+
+
+#ifndef DIAGRESULTDETAILBASIC_H
+#define DIAGRESULTDETAILBASIC_H
+
+// INCLUDES
+#include <e32base.h>                    // CBase
+#include <DiagResultDetail.h>           // MDiagResultDetail
+#include <DiagResultsDatabaseItem.h>    // CDiagResultsDatabaseItem::TResult
+
+// FORWARD DECLARATIONS
+class CDiagResultDetailBasicItem;
+
+
+// CONSTANTS
+const TInt KDiagResultDetailBasicVersion  = 1;   // verion of data format.
+
+/**
+*  Diagnostics Result Database Detail  class.
+*
+*  This  class provides  implementation of MDiagResultDetail 
+*  with commonly used methods.
+*
+*  @since S60 v5.0
+*/
+class CDiagResultDetailBasic : public CBase,
+                               public MDiagResultDetail
+    {
+public:
+    /**
+    * Constructor.
+    *
+    * @param aResult - Test Result
+    */
+    IMPORT_C CDiagResultDetailBasic( 
+                    CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagResultDetailBasic();
+
+    /**
+    * Externalize to a stream
+    *
+    * @param aWriteStream - stream to write to.
+    */
+    IMPORT_C void ExternalizeL( RWriteStream& aWriteStream ) const;
+
+    /**
+    * Update result value
+    * 
+    * @param aResult - Test result
+    */
+    IMPORT_C void SetResult( CDiagResultsDatabaseItem::TResult aResult );
+
+protected: // Interface for Derived class
+    /**
+    * Set data to a field.  This function sets a value to a field.
+    * If data already exists at the same field id, new data will 
+    * over write the old value at the same field.
+    *
+    * @param aFieldId - Unique ID to identify the data.
+    * @param aFieldName - Name of the field. This only for a 
+    *   reference.
+    * @param aValue - Value to set. This can be a TInt,
+    *   const TDesC8& or const TDesC16&.
+    */
+    IMPORT_C void SetValueL( TInt aFieldId,
+                             const TDesC8& aFieldName,
+                             TInt aValue );
+    IMPORT_C void SetValueL( TInt aFieldId,
+                             const TDesC8& aFieldName,
+                             const TDesC8& aValue );
+    IMPORT_C void SetValueL( TInt aFieldId,
+                             const TDesC8& aFieldName,
+                             const TDesC16& aValue );
+
+    /**
+    * Get value. If invalid aFieldId is passed, or type does not 
+    * match, function will leave with KErrArgument. 
+    *
+    * @param aFieldId - Unique id that identifies the data. Same
+    *   value used in SetValueL function.
+    * @param aValue - Output paramater. The data will be stored
+    *   here.
+    * @return KErrNone if successful. If not found KErrNotFound.
+    *   If type does not match, KErrArgument.
+    */
+    IMPORT_C TInt GetValue( TInt aFieldId, TInt& aValue ) const;
+    IMPORT_C TInt GetValue( TInt aFieldId, TPtrC8& aValue ) const;
+    IMPORT_C TInt GetValue( TInt aFieldId, TPtrC16& aValue ) const;
+
+public: // from MDiagResultDetail
+    /**
+    * Get list of supported output
+    *
+    * @param aOutputList   - Returns supported output formats
+    */
+    IMPORT_C virtual void GetSupportedOutput(
+                RArray<TOutputFormat>& aOutputList ) const;
+
+    /**
+    * Check if a given output format is supported.
+    *
+    * @param aOutputFormat - Possible output formate.
+    * @return ETrue if supported. EFalse otherwise.
+    */
+    IMPORT_C virtual TBool IsOutputSupported( TOutputFormat aOutputFormat ) const;
+
+    /**
+    * Output current result to a specified format.
+    *
+    * @param aFormat   Format of desired output.
+    * @param aBuffer   Output buffer.
+    */
+    IMPORT_C virtual void GetOutputL( TOutputFormat aFormat, RBuf& aBuffer ) const;
+
+    /**
+    * Create an icon. Icon can be created based on the results of the test.
+    *
+    * @return An icon that matches the result of the test.
+    **/
+    IMPORT_C virtual CGulIcon* CreateIconL() const;
+
+    /**
+    * Externalize to a CBufFlat. 
+    *   @see MDiagResultDetail::ExternalizeToBufferL
+    */
+    IMPORT_C CBufFlat* ExternalizeToBufferL() const;
+
+protected:
+    /**
+    * BaseConstructL
+    *
+    * @param aReadStream - Initialize from a stream.
+    */
+    IMPORT_C void BaseConstructL( RReadStream& aReadStream );
+
+    /**
+    * BaseConstructL
+    *
+    * @param aBuffer - Buffer to initialize from
+    */
+    IMPORT_C void BaseConstructL( const CBufFlat& aBuffer );
+
+
+private:  // internal methods
+    /**
+    * InternalizeL
+    *
+    * @param aReadStream - Initialize from a stream.
+    */
+    void InternalizeL( RReadStream& aReadStream );
+
+    /**
+    * Insert a new item. This function will delete the old item if item with 
+    * same field id already existsed.
+    *
+    * @param aNewItem - new item to set
+    */
+    void SetItemL( CDiagResultDetailBasicItem* aNewItem );
+
+    /**
+    * Find item by field id
+    *
+    * @param - Field id to look up.
+    * @return - Index in iFields array if look up is successful.
+    *   Return value is negative if look up fails.
+    */
+    TInt FindItem( TInt aFieldId ) const;
+
+
+private: // DATA
+    /**
+    * Test result.
+    */
+    CDiagResultsDatabaseItem::TResult            iResult;
+    
+    /**
+    * List of fields it contains.
+    *   All items are owned by this class.
+    */
+    RPointerArray<CDiagResultDetailBasicItem>    iFields;
+    };
+
+
+
+#endif // DIAGRESULTDETAILBASIC_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultsdatabase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,520 @@
+/*
+* Copyright (c) 2007-2007 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:  Results database client interfaces.
+*                Provides results database session and subsession.
+*  libraries   : DiagResultsDatabase.lib DiagResultsDatabase.dll
+*
+*/
+
+
+#ifndef DIAGNOSTICS_RESULTS_DATABASE_CLIENT_H
+#define DIAGNOSTICS_RESULTS_DATABASE_CLIENT_H
+
+#include <e32base.h>
+
+class CDiagResultsDatabaseItem;
+class TDiagResultsDatabaseTestRecordInfo;
+class CDiagResultsDbRecordEngineParam;
+
+/**
+* Diagnostics Results Database. Stores test results and more information.
+* Provides methods to retrieve and fetch new data.
+* Requires ReadDeviceData and WriteDeviceData capabilities even if the
+* session does not write anything.
+*
+* Results database is a permanent file store based solution.
+* Database files are stored under WINSCW\C\private\10282cd9 in emulator
+* environment.
+*
+* It is recommended to have only one open RDiagResultsDatabase per thread.
+* There should be only one writer and multiple readers at the same time
+* accessing the same database file. It is possible that there are multiple
+* DB files for example when there are two diagnostics applications in the
+* system.
+*
+* @since S60 v5.0
+**/
+class RDiagResultsDatabase : public RSessionBase
+    {
+public:
+
+    /**
+    * Constructor
+    **/
+    IMPORT_C RDiagResultsDatabase();
+    
+    /**
+    * Destructor
+    **/
+    IMPORT_C ~RDiagResultsDatabase();
+
+    /**
+    * Connect to the results database to a DB file. This must be called before 
+    * trying to use this class, otherwise KERN-EXEC 0 will crash your app. 
+    * Only one RDiagResultsDatabase connection is recommended per application,
+    * because server sessions consume significant amount of system resources.
+    * Share the session inside your thread! Subsessions are much more lighter. 
+    *
+    * Calling connect creates the DB file inside server's private directory.
+    * If for some reason database is corrupted, the DB file should be deleted
+    * manually.
+    *
+    * @param aAppUid Unique identifier of the application. Each application has 
+    *   its own store.  Applications can access to another 
+    *   applications's database if they know their UID.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. If calling process does not have access rights, 
+    *   KErrPermissionDenied is returned. ReadDeviceData+WriteDeviceData are
+    *   required. KErrDiskFull is returned if there is not enough space 
+    *   on c-drive.
+    **/
+    IMPORT_C TInt Connect( TUid aAppUid );
+
+    /**
+    * Close the session with the server. Handle is not valid anymore.
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt Close();
+
+    /**
+    * Returns the version number of the server.
+    *
+    * @return The version number.
+    **/
+    IMPORT_C TVersion Version() const;
+
+    /**
+    * Get the current number of test records in the database.
+    *
+    * @param aCount the number of records.
+    * @return KErrNone, if successful, otherwise one of the other system-wide 
+    *   error codes.
+    **/
+    IMPORT_C TInt GetRecordCount ( TUint& aCount ) const;
+
+    /**
+    * Returns the maximum number of records for each application. The number 
+    * is defined in the central repository and it is static for all applications. 
+    * It is guarenteed that the DB file contains only the maxsize records and
+    * not more. Old test records are deleted when new test records are 
+    * completed.
+    *
+    * @param aMaxSize The maximum number of test records.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C static TInt GetDatabaseMaximumSize( TInt& aMaxSize );
+
+    /**
+    * Returns an array of record Ids. The oldest records are at the beginning
+    * of the array. Test record are sorted based on creation time.
+    *
+    * @param aSortedRecordUidArray An array of UIds. The array is sorted 
+    *   based on time.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetRecordUids ( CArrayFixFlat<TUid>& aSortedRecordUidArray ) const;
+
+    /**
+    * Returns id to last test record. The last record cannot be 
+    * still open for writing! Test record are sorted based on creation time.
+    *
+    * @param aRecordUid Unique identifier of the record.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrNotFound if there are no records.
+    **/
+    IMPORT_C TInt GetLastRecord ( TUid& aRecordUid ) const;
+    
+    /**
+    * Returns id to last suspended or incompleted test record. 
+    * The last record cannot be still open for writing! Returns KErrNotFound 
+    * if there are no suspended or incomplete test records.
+    *
+    * @param aRecordUid Unique identifier of the record.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrNotFound if there are no suspended test records.
+    **/
+    IMPORT_C TInt GetLastNotCompletedRecord ( TUid& aRecordUid ) const;
+    
+    /**
+    * Returns an overview from all records. 
+    *
+    * @param aInfoArray returns an array of record infos.
+    * @see TDiagResultsDatabaseTestRecordInfo.
+    **/
+    IMPORT_C TInt GetAllRecordInfos ( 
+               CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray );
+
+    /**
+    * Initiate retrieving of last results.  After request is completed,
+    * data can be fetched using GetLastResults method.
+    *
+    * @param aUidArray An array of uid used to identify plug-ins.
+    * @param aStatus Completion status. 
+    **/
+    IMPORT_C void InitiateGetLastResults ( const CArrayFixFlat<TUid>& aUidArray,
+                                                TRequestStatus& aStatus );
+                                                
+    /**
+    * Cancel InitiateGetLastResults.
+    **/                                                
+    IMPORT_C void CancelInitiateGetLastResults () const;
+    
+    /**
+    * Get list of last results. Last result means that the plug-in has passed / failed
+    * test result. 
+    * 
+    * GetLastResults deletes data after this function 
+    * is called, so InitiateGetLastResults must be called if data is needed 
+    * again. Client is responsible for deleting the returned array. Contains
+    * null values if the searched uid was not found. There should be the same
+    * number of cells in UidArray and in the results array.   
+    *
+    * @param aResults Returned results array. Client is responsible for 
+    *                 deleting the array.
+    *
+    * @return KErrNotReady if this is called before InitiateGetLastResults.
+    */
+    IMPORT_C TInt GetLastResults ( RPointerArray<CDiagResultsDatabaseItem>& aResults ) const;
+    
+    /**
+    * Get last (the newest) test result of a test plug-in. The algorithm searches for a 
+    * test result that is either passed or failed. This is also asynchronous operation,
+    * because all records have to be browsed in worst case scenario (that is, when
+    * the plug-in uid is not found). Call GetLastResult when test result is needed.
+    *
+    *
+    * @param aTestPluginUid UID of a plug-in.    
+    * @param aStatus Asynchronous request status.
+    * 
+    */
+    IMPORT_C void InitiateGetLastResult ( TUid aTestPluginUid, 
+                                          TRequestStatus& aStatus );
+    
+
+    /**
+    * Get last result of a test plug-in.
+    *
+    * @param aItem Test result or NULL if not found.
+    * @retrun KErrNotReady if this is called before InitiateGetLastResult.
+    **/                                          
+    IMPORT_C TInt GetLastResult ( CDiagResultsDatabaseItem*& aItem );
+
+private:
+    
+    /**
+    * Leaving version of the service functions. Look above for explanations.
+    **/                    
+    void DoConnectL (TUid aAppUid);
+    
+    void DoGetRecordUidsL( CArrayFixFlat<TUid>& aSortedRecordUidArray ) const;
+
+    /*
+    * @see GetDatabaseMaximumSize()
+    */
+    static void DoGetDatabaseMaximumSizeL( TInt& aMaxSize );
+    
+    void DoGetAllRecordInfosL ( CArrayFixFlat<TDiagResultsDatabaseTestRecordInfo>& aInfoArray);
+    
+    void DoGetLastResultsL ( RPointerArray<CDiagResultsDatabaseItem>& aResults ) const;
+    
+    void WriteArrayIntoBufferL( const CArrayFixFlat<TUid>& aUidArray );   
+    
+    void DoGetLastResultL ( CDiagResultsDatabaseItem*& aItem );                                    
+
+private: 
+
+    // Flat dynamic buffer.
+    CBufFlat* iBuffer;
+    
+    // is the connection already open.
+    TBool iOpen;     
+    
+    //Buffer pointer
+    TPtr8 iPtr;                 
+    };
+   
+/**
+* Sub-session to Diagnostics Results Database. This API is used to
+* handle a Test record. A test record is a collection of test results.
+*
+* Test record is always written into the file, when updates are necessary. 
+* 
+*
+* @since S60 v5.0 
+**/
+class RDiagResultsDatabaseRecord : public RSubSessionBase
+    {
+public:
+
+    /**
+    * Test record status. 
+    **/
+     enum TRecordStatus
+        {    	      
+        EOpen,                // Currently open for writing.
+        ESuspended,   	      // ::Suspend() is called. 
+        ECrashed,		      // It was open previously, and it was not 
+                              // closed properly.
+        EPartiallyCompleted,  // Record is completed (not resumable), but not
+                              // all tests were completed.
+        ECompleted	          // Record is completed (not resumable), and all 
+                              // tests were completed. 
+        };
+
+    /**
+    * Constructor
+    **/
+    IMPORT_C RDiagResultsDatabaseRecord();
+    
+    /**
+    * Destructor
+    **/
+    IMPORT_C ~RDiagResultsDatabaseRecord();
+
+    /**
+    * Connects to a test record. There must be at least one created record.
+    * If the specified record is not found, KErrNotFound is returned.
+    * Opened test record can be modified if the test record has not been
+    * completed (= TestCompleted called).
+    *
+    * @param aSession open database session.
+    * @param aRecordId specifies the record where we want to connect.
+    * @param aReadOnly Indicates is the test record opened in read-only mode.
+    *                  If read-only = EFalse, the test record can overwrite
+    *                  test records that are not completed already. If 
+    *                  the test record is completed it can be opened only 
+    *                  in read-mode. 
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrAlreadyExists if subsession is connected.
+    **/
+    IMPORT_C TInt Connect( RDiagResultsDatabase& aSession, 
+                           TUid aRecordId, 
+                           TBool aReadOnly );
+    
+    /**
+    * Creates a new record and returns the uid of that record. 
+    * Writes empty test record into the file. Create new record opens the record
+    * always in Write mode.
+    *
+    * @param aSession open database session.
+    * @param aRecordId a new unique identifier is returned that is used to
+    *   identify particular test record. Client can use the record ID to access
+    *   the same record again.
+    * @param aEngineParam Engine parameters. 
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrAlreadyExists if subsession is connected.
+    *   KErrDiskFull is returned if there is not enough space on c-drive.
+    **/
+    IMPORT_C TInt CreateNewRecord( RDiagResultsDatabase& aSession, 
+                                   TUid& aRecordId,
+                                   CDiagResultsDbRecordEngineParam& aEngineParam );
+    
+    /**
+    * Retrieve parameters of the diagnostics engine. These are needed in
+    * Suspend/Resume functionality. 
+    *
+    * @param aEngineParam Engine parameters. Ownership is transferred.
+    *                     Client is responsible for deleting the object.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetEngineParam( CDiagResultsDbRecordEngineParam*& aEngineParam ) const;
+
+
+    /**
+    * Get record status.
+    *
+    * @param aRecordStatus The status of the record. 
+    * @see TRecordStatus in the beginning of the class declaration.
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetStatus( TRecordStatus& aRecordStatus ) const;
+
+    /**
+    * Close subsession. Does not write test record into the file.
+    *
+    * @return Symbian error code or KErrNone.
+    **/
+    IMPORT_C void Close();
+    
+    /**
+    * Suspend test record. Same as complete, but the test record can be modified
+    * on next connect.Writes test suspend time into test record info.
+    *
+    * @return Symbian error code or KErrNone.
+    **/
+    IMPORT_C TInt Suspend();
+    
+    /**
+    * Indicates has this test record been suspended.
+    * @param aSuspended Returns has this test record been suspended(ETrue), 
+    *                   otherwise EFalse.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt IsSuspended( TBool& aSuspended ) const;
+
+    /**
+    * Returns the record UID of this subsession.
+    *
+    * @param aRecordUid Record ID of the subsession.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetTestRecordId( TUid& aRecordUid ) const;
+
+    /**
+    * Write test completion time/date to the record and prevent further 
+    * writing. Handle is still valid. However, it cannot be used for adding
+    * any more test results. During completion database file is cleaned up from
+    * old test records (limited by GetDatabaseMaximumSize method).
+    *
+    * Test completion is synchronous operation because only record handle must be
+    * updated (fixed size stream).
+    *
+    * @param aFullyComplete If ETrue (default), test record is completed with
+    *                       status fully completed. Otherwise the test record is 
+    *                       considered partially completed. 
+    *
+    * @return Symbian error code or KErrNone. KErrDiskFull is returned if there 
+    |         is not enough space on c-drive.   
+    **/
+    IMPORT_C TInt TestCompleted( TBool aFullyComplete = ETrue );
+    
+    /**
+    * Indicates has this record been written into the DB file or not. 
+    *
+    * @param aCompleted Has the test record been completed.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/ 
+    IMPORT_C TInt IsTestCompleted( TBool& aCompleted ) const;
+    
+    /**
+    * Returns information about the record. If the record is not finalized,
+    * iFinishTimes contains unknown values. 
+    *
+    * @param aInfo returns an overview of the test record.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetRecordInfo ( TDiagResultsDatabaseTestRecordInfo& aInfo ) const;
+    
+    /**
+    * Get list of test UIDs inside the test record.
+    *
+    * @param aTestUidArray An array of test uids.
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    **/
+    IMPORT_C TInt GetTestUids ( CArrayFixFlat<TUid>& aTestUidArray ) const;
+    
+    /**
+    * Logs results of a test into the database including more information
+    * that there might be. See class CDiagResultsDatabaseItem. Result Item
+    * is written into the file immediately after TRequestStatus completes.
+    *
+    * @param aResultItem This structure is stored into the database. 
+    *   Client is responsible for creating the object. Also client is responsible 
+    *   for setting item's values.
+    *
+    * @param aStatus Asynchronous status. Completes when process is finished.
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes. Returns KErrAlreadyExists if record is already completed.
+    *   KErrDiskFull is returned if there is not enough space on c-drive. 
+    *   If KErrDiskFull is received, the test result is not logged.
+    *
+    **/ 
+    IMPORT_C TInt LogTestResult ( TRequestStatus& aStatus, 
+                                  const CDiagResultsDatabaseItem& aResultItem );
+
+    /**
+    * Cancel LogTestResult. Server continues to write result item into the DB.
+    * Cancelling only completes client's request.
+    **/                                  
+    IMPORT_C void CancelLogTestResult() const;                                  
+    
+    /**
+    * Get single test result from this test record identified by an uid. 
+    * 
+    * @param aPluginUid Unique identifier of the plug-in whose results are needed.
+    * @param aResultItem Contains test results.
+    * @return KErrNone, if successful, otherwise one of the other system-wide 
+    *   error codes.KErrNotFound is returned if the plug-in is not found
+    *   from the record.
+    **/
+    IMPORT_C TInt GetTestResult ( TUid aPluginUid, 
+                                  CDiagResultsDatabaseItem*& aResultItem ) const;
+   
+    /**
+    * Get all test results inside the test record. Client is responsible for 
+    * reseting/destroying the array.
+    *
+    * @param aResultsArray Returns test results for this record. 
+    *
+    * @return KErrNone, if successful, otherwise one of the other system-wide
+    *   error codes.
+    */
+    IMPORT_C TInt GetTestResults ( RPointerArray<CDiagResultsDatabaseItem>& aResultsArray ) const;
+ 
+private:
+    
+    /**
+    * Leaving version of the functions and helper functions.
+    **/ 
+    void DoConnectL ( RDiagResultsDatabase& aSession, 
+                      TUid aRecordId,
+                      TBool aReadOnly );
+        
+    void DoCreateNewRecordL ( RDiagResultsDatabase& aSession, TUid& aRecordId,
+                              CDiagResultsDbRecordEngineParam& aEngineParam );
+    
+    void DoGetTestUidsL ( CArrayFixFlat<TUid>& aTestUidArray ) const;
+    
+    void DoLogTestResultL ( TRequestStatus& aStatus, 
+                            const CDiagResultsDatabaseItem& aResultItem );
+    
+    void DoGetTestResultsL ( RPointerArray<CDiagResultsDatabaseItem>& aResultsArray ) const;
+    
+    void DoGetTestResultL ( TUid aPluginUid, CDiagResultsDatabaseItem*& aResultItem ) const;
+    
+    void WriteDatabaseItemIntoBufferL( const CDiagResultsDatabaseItem& aResultItem );
+    
+    void WriteEngineParamIntoBufferL( CDiagResultsDbRecordEngineParam& aEngineParam );
+    
+    void DoGetEngineParamL( CDiagResultsDbRecordEngineParam*& aEngineParam ) const;
+    
+private: 
+
+    // Dynamic flat buffer.
+    CBufFlat* iBuffer;  
+    
+    // Is the connection already open.
+    TBool iOpen;  
+    
+    //Buffer pointer
+    TPtr8 iPtr;
+    };
+
+#endif  // DIAGNOSTICS_RESULTS_DATABASE_CLIENT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultsdatabaseitem.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2007-2007 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:  Results database item
+*
+*/
+
+
+#ifndef DIAGRESULTSDATABASEITEM_H
+#define DIAGRESULTSDATABASEITEM_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+class TTime;
+class TStreamId;
+class CStreamStore;
+class CBufFlat;
+
+/**
+* Results database item.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDatabaseItem : public CBase
+    {
+public:
+    /** 
+    * Result of test.
+    */
+    enum TResult
+        {
+        ESuccess = 0,
+        EFailed,            // Test failed
+        ESkipped,           // Test was never executed because it was skipped 
+                            // before it is started. (e.g. during initial delay timer)
+        ECancelled,         // Test session was cancelled. ( ECancelAll )
+        EInterrupted,       // Interrupted. Test was already running, but interrupted 
+                            // by end user, or other external cause.
+        ENotPerformed,      // Not performed due to invalid set up. 
+        EDependencyFailed,  // Failed because dependent test failed.
+        EWatchdogCancel,    // Watchdog cancelled testing.
+        ESuspended,         // Test is scheduled to run later.
+        EQueuedToRun,       // Test is waiting for execution. It is possible that 
+                            // EQueuedToRun is never overwritten.
+        EDependencySkipped  // Skipped because common dependency was not executed
+                            // either due to it was skipped or interrupted.
+        };
+
+public:
+
+    /**
+    * NewL. Construct from a stream.
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewL ( RReadStream& aStream );
+        
+    /**
+    * NewL. 
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewL (
+                                        TUid            aTestUid,
+                                        TBool           aDependencyExecution,
+                                        TResult         aResult,
+                                        TTime           aStartTime,
+                                        TTime           aEndTime,
+                                        CBufFlat*       aDetailsData );
+    /**
+    * NewLC.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewLC (
+                                        TUid            aTestUid,
+                                        TBool           aDependencyExecution,
+                                        TResult         aResult,
+                                        TTime           aStartTime,
+                                        TTime           aEndTime,
+                                        CBufFlat*       aDetailsData );
+
+    /**
+    * NewL. Copy constructor. This will do a deep copy.
+    *
+    * @param aOriginal - Original to copy data from.
+    * @return a new instance of CDiagResultsDatabaseItem that is a deep
+    *   copy of the original given. Ownership is transferred.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* NewL ( 
+        const CDiagResultsDatabaseItem& aOriginal );
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagResultsDatabaseItem();
+   
+    /**
+    * Get Uid of test plug-in. 
+    *
+    * @return TUid - uid of the test plug-in.
+    */
+    IMPORT_C TUid TestUid() const;
+    
+    /**
+    * Whether the test was executed to satisfy dependency or not.
+    *
+    * @return ETrue if executed as dependency.
+    *         EFalse otherwise.
+    */
+    IMPORT_C TBool WasDependency() const;
+    
+    /**
+    * Get Test Result.
+    *
+    * @return TResult.
+    */
+    IMPORT_C TResult TestResult() const;
+
+    /**
+    * Time that test execution was started.
+    * Universal time is used.
+    *
+    * @return Time that execution was started.
+    */
+    IMPORT_C TTime TimeStarted() const;
+
+    /**
+    * Time that test execution was completed.
+    * Universal time is used.
+    *
+    * @return Time that execution was completed.
+    */
+    IMPORT_C TTime TimeCompleted() const;
+
+    /**
+    * Details data. This must be interpreted by the plug-ins before
+    * it can be used. Data is in object form.
+    */
+    IMPORT_C const CBufFlat* DetailsData() const;
+
+    /**
+    * Calculate stream size in bytes. Size can be used to evaluate needed
+    * stream size. 
+    *
+    * @return Size in bytes.
+    */
+    IMPORT_C TInt Size() const;
+
+public: 
+
+    /**
+    * Externalize the test result to a stream.
+    *
+    * @param aStream   Stream to write to.
+    */
+    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; 
+    
+    
+private: //internalization methods   
+
+    /**
+    * Internalize the test result from a stream.
+    *
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C void InternalizeL( RReadStream& aStream );
+    
+    /**
+    * Write TTime into write stream.
+    * 
+    * @param aStream Stream to write to.
+    * @param aTime TTime that is written into the stream.
+    **/
+    void WriteTimeToStreamL( RWriteStream& aStream, const TTime& aTime ) const;
+    
+    /**
+    * Read TTime from read stream.
+    * 
+    * @param aStream read stream.
+    * @param aTime Contains time after stream is read.
+    **/
+    void ReadTimeFromStreamL( RReadStream& aStream, TTime& aTime );
+
+private:
+    
+    /**
+    * C++ Constructors.
+    */
+    CDiagResultsDatabaseItem (
+                        TUid            aTestUid,
+                        TBool           aDependencyExecution,
+                        TResult         aResult,
+                        TTime           aStartTime,
+                        TTime           aEndTime,
+                        CBufFlat*       aDetailsData );
+    
+    /**
+    * Construct from a stream.
+    *
+    * @param aStream Read stream.
+    */ 
+    void ConstructL ( RReadStream& aStream );
+    
+    /**
+    * Default C++ constructor.
+    **/
+    CDiagResultsDatabaseItem ();
+    
+private:    // data
+
+    // Uid of the test plug-in.
+    TUid            iTestUid;
+    
+    // Has this been executed as a part of another execution (precondition).
+    TBool           iDependencyExecution;
+    
+    // Test result
+    TResult         iResult;
+    
+    // When the test began.
+    TTime           iStartTime;
+    
+    // When the test ended
+    TTime           iEndTime;
+    
+    // Contains flat buffer that can hold additional data 
+    // For example debugging data or further analysis.
+    CBufFlat*       iDetailsData;
+
+    };
+
+#endif // DIAGRESULTSDATABASEITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultsdatabasetestrecordinfo.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007-2007 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:  Contains overview of the test record, not actual test results.
+*  libraries   : DiagResultsDatabase.lib DiagResultsDatabase.dll
+*
+*/
+
+
+#ifndef DIAGNOSTICS_RESULTS_DATABASE_TEST_RECORD_INFO_H
+#define DIAGNOSTICS_RESULTS_DATABASE_TEST_RECORD_INFO_H
+
+#include <e32base.h>
+
+class RReadStream;
+class RWriteStream;
+
+/**
+* Results database record info. Contains information about one record.
+*
+* @since S60 v5.0
+**/
+class TDiagResultsDatabaseTestRecordInfo
+    {
+public:
+
+    enum TDbRecordStatus
+        {      
+        EOpen,                // Currently open for writing.
+        ESuspended,   	      // ::Suspend() is called. 
+        ECompleted	          // Record is completed (not resumable), and all 
+                              // tests were completed. 
+        };
+
+
+    /**
+    * Constructor
+    **/
+    IMPORT_C TDiagResultsDatabaseTestRecordInfo();
+    
+    /**
+    * Internalize from a stream.
+    *
+    * @param aStream Stream to be read from.
+    **/
+    IMPORT_C void InternalizeL( RReadStream& aStream );
+
+    /**
+    * Externalize into a stream.
+    *
+    * @param aStream Stream to be written into.
+    **/
+    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
+    
+    /**
+    * Returns DRM time.
+    *
+    * @return DRM time.
+    **/
+    IMPORT_C static TTime DRMTimeL();
+
+    //Public member data.
+    TUid            iRecordId;   // Identifies this record.
+    TTime 		    iDrmStartTime;  //When the record was opened (DRM time).
+    TTime 		    iDrmFinishTime; //when the record was completed (DRM time).
+    TTime 		    iStartTime;  //When the record was opened (Home time).
+    TTime 		    iFinishTime; //when the record was completed (Home time).
+    TUid 	        iDbUid; 	 //UID3 of the database.
+    TUint 		    iTestCount;  //The number of tests in this record.
+    TDbRecordStatus iRecordStatus; //Stored record status. 
+    TBool           iCompleted; //Writable or read-only test record
+    
+
+private:
+
+    /**
+    * Writes time(TTime) into a stream. Time has to be written into a stream 
+    * using two 32-bit values since there is no method to write 64-bit value.
+    *
+    * @param aStream Stream to be written into.
+    * @param aTime Time that is written into the stream.
+    **/
+    void WriteTimeToStreamL( RWriteStream& aStream, const TTime& aTime ) const;
+    
+    /**
+    * Reads time (TTime) from a stream. 
+    *
+    * @param aStream Stream to be read from.
+    * @param aTime Time that was read from the stream.
+    **/
+    void ReadTimeFromStreamL( RReadStream& aStream, TTime& aTime );
+    
+    };
+    
+#endif    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultsdbitembuilder.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2007 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:  Diagnostics Results Database Item Builder
+*
+*/
+
+
+
+#ifndef DIAGRESULTSDBITEMBUILDER_H
+#define DIAGRESULTSDBITEMBUILDER_H
+
+// INCLUDES
+#include <DiagResultsDatabaseItem.h>        // CDiagResultsDatabaseItem::TResult
+
+// FORWARD DECLARATIONS
+namespace DRM
+    {
+    class CDrmServiceApi;
+    }
+
+class MDiagResultDetail;
+
+
+/**
+*  Diagnostics Result Database Item Builder.
+*
+*  This class can be used to build CDiagResultsDatabaseItem, without having
+*  to have all the values avaliable.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_CLASS( CDiagResultsDbItemBuilder ) : public CBase
+    {
+public:  // Constructors and Destructors
+    /**
+    * Two-phase constructor.
+    *
+    * This will set the test started time to now.
+    *
+    * @param aTestUid - Test Uid.
+    * @param aDependencyExecution - Whether thsa was executed as dependency.
+    * @return New instance of CDiagResultsDbItemBuilder
+    */
+    IMPORT_C static CDiagResultsDbItemBuilder* NewL( TUid  aTestUid,
+                                                     TBool aDependencyExecution );
+    IMPORT_C static CDiagResultsDbItemBuilder* NewLC( TUid  aTestUid,
+                                                      TBool aDependencyExecution );
+
+    /**
+    * Destructor
+    *
+    */
+    virtual ~CDiagResultsDbItemBuilder();
+
+public: // New Interface
+
+    /**
+    * Set Test Uid
+    *
+    * @param aUid - Test uid.
+    */
+    IMPORT_C void SetTestUid( TUid aUid );
+
+    /**
+    * Get Test Uid
+    *
+    * @return Test uid.
+    */
+    IMPORT_C TUid TestUid() const;
+
+    /**
+    * Get current time. If DRM clock is available, it will use the DRM clock.
+    *
+    */
+    IMPORT_C TTime GetCurrentTime() const;
+
+    /**
+    * Set whether test was executed as dependency or not.
+    *
+    * @param aWasDependency
+    */
+    IMPORT_C void SetWasDependency( TBool aWasDependency );
+
+    /**
+    * Get was dependency value
+    *
+    * @return ETrue if test was executed as a dependency.
+    */
+    IMPORT_C TBool WasDependency() const;
+
+    /**
+    * Update test result and also set completed time to now
+    *
+    * @param aResult - Test result.
+    */
+    IMPORT_C void SetTestCompleted( CDiagResultsDatabaseItem::TResult aResult );
+
+    /**
+    * Get Test result
+    *
+    * @return Test result.
+    */
+    IMPORT_C CDiagResultsDatabaseItem::TResult TestResult() const;
+
+    /**
+    * Set Time Started 
+    *
+    * @param aTime - time started.
+    */
+    IMPORT_C void SetTimeStarted( TTime aTime );
+
+    /**
+    * Get Time started.
+    *
+    * @return Time started.
+    */
+    IMPORT_C TTime TimeStarted() const;
+
+    /**
+    * Set Time Completed
+    *
+    * @param aTime - time completed.
+    */
+    IMPORT_C void SetTimeCompleted( TTime aTime );
+
+    /**
+    * Get Time Completed..
+    *
+    * @return Time Completed.
+    */
+    IMPORT_C TTime TimeCompleted() const;
+
+    /**
+    * Set result detail object. If it was already set, previous object is deleted.
+    *
+    * @param aResultDetail - Result detail object. Ownership is transferred.
+    */
+    IMPORT_C void SetResultDetail( MDiagResultDetail* aResultDetail );
+
+    /**
+    * Get result detail object. Use static_cast to change to specific instance.
+    *   If result detail was not set previosuly, it will Panic with 
+    *   EDiagFrameworkInvalidState
+    *
+    * @return Result detail object.
+    */
+    IMPORT_C MDiagResultDetail& ResultDetail() const;
+
+    /**
+    * Create CDiagResultsDatabaseItem from data available.
+    *
+    */
+    IMPORT_C CDiagResultsDatabaseItem* ToResultsDatabaseItemL() const;
+
+    /**
+    * Create a simple CDiagResultsDatabaseItem. This function is meant to be
+    * used to create default result data with just with minimal set of information.
+    * It will use current time as both start and end time of test.
+    * If manipulation of other information in needed, either instantiate
+    * CDiagResultsDbItemBuilder or CDiagResultsDatabaseItem
+    *
+    * @param aTestUid - Uid of test plugin.
+    * @param aAsDependency - Whether it was executed as dependency or not.
+    * @param aResultType - Result of the test.
+    * @return Instance of CDiagResultsDatabaseItem* with given info. 
+    *   Ownership is transferred.
+    */
+    IMPORT_C static CDiagResultsDatabaseItem* CreateSimpleDbItemL( 
+        TUid aTestUid,
+        TBool aAsDependency,
+        CDiagResultsDatabaseItem::TResult aResultType );
+
+
+protected:  // constructors
+    /**
+    * C++ Constructor
+    *
+    * @param aTestUid - Uid of the test
+    * @param aDependencyExecution - Whether this is being executed as dependency.
+    */
+    CDiagResultsDbItemBuilder( TUid  aTestUid,
+                               TBool aDependencyExecution );
+    /**
+    * ConstructL
+    *
+    */
+    void ConstructL();
+
+private: // Data
+    /**
+    * iTestUid - Uid of the test plug-in that this result is for.
+    */
+    TUid iTestUid;
+
+    /**
+    * iDependencyExecution - Whether this test is being executed to 
+    *   satisfy dependency or not.
+    */
+    TBool iDependencyExecution;
+
+    /**
+    * iResut - Actual result of the test.
+    */
+    CDiagResultsDatabaseItem::TResult iResult;
+
+    /**
+    * iStartTime - Time test started.
+    */
+    TTime iStartTime;
+
+    /**
+    * iEndTime - Time test finished.
+    */
+    TTime iEndTime;
+
+    /**
+    * iResultDetail - Extra details data.
+    * Owns.
+    */
+    MDiagResultDetail* iResultDetail;
+
+    /**
+    * iDrmApi - Used to get accurate clock through DRM.
+    * Owns.
+    */
+    DRM::CDrmServiceApi* iDrmApi;
+    };
+
+
+#endif // DIAGRESULTSDBITEMBUILDER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/diagnostics_results_api/inc/diagresultsdbrecordengineparam.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2007-2007 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:  Capsulates parameters of the diagnostics engine.
+*
+*/
+
+
+#ifndef DIAGRESULTSDBRECORDENGINEPARAM_H
+#define DIAGRESULTSDBRECORDENGINEPARAM_H
+
+// INCLUDES
+#include <e32base.h>            // CBase
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+
+/**
+* Contains parameters of the diagnostics engine.
+* Parameters are needed only in suspend/resume functionality.
+*
+* @since S60 v5.0
+**/
+class CDiagResultsDbRecordEngineParam : public CBase
+    {
+public:
+
+
+    /**
+    * NewL. Construct from a stream.
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C static CDiagResultsDbRecordEngineParam* NewL ( RReadStream& aStream );
+        
+    /**
+    * NewL. Ownership of RArray is transferred.
+    *
+    * @param aInitialUids Execution Uid array. Should not be null. 
+    *                     Use empty array if there are no uids.
+    * @param aDependencyExecution This value is needed when resuming 
+    *                             in order to create proper test resume plan.
+    */
+    IMPORT_C static CDiagResultsDbRecordEngineParam* NewL (
+                                        RArray<TUid>*   aInitialUids,
+                                        TBool           aDependencyExecution
+                                        );
+    /**
+    * NewLC. Ownership of RArray is transferred.
+    *
+    * @param aInitialUids Execution Uid array. Should not be null. 
+    *                     Use empty array if there are no uids.
+    * @param aDependencyExecution This value is needed when resuming 
+    *                             in order to create proper test resume plan.
+    */
+    IMPORT_C static CDiagResultsDbRecordEngineParam* NewLC (
+                                        RArray<TUid>*   aInitialUids,
+                                        TBool           aDependencyExecution
+                                        );
+
+    /**
+    * Destructor.
+    */
+    IMPORT_C virtual ~CDiagResultsDbRecordEngineParam();
+   
+    /**
+    * Return execution uids. These can be used to store for example 
+    * user selections. User selections are needed when test run is suspended 
+    * or test session crashed the phone.
+    *
+    * @return Array of uids. Empty if none.
+    */
+    IMPORT_C const RArray<TUid>& ExecutionsUidArray() const;
+    
+    /**
+    * Indicates were dependencies resolved when diagnostics engine executed tests.
+    *
+    * @return ETrue if dependencies were resolved, EFalse otherwise.
+    */
+    IMPORT_C TBool DependencyExecution() const;
+    
+public: 
+
+    /**
+    * Externalize the test result to a stream.
+    *
+    * @param aStream   Stream to write to.
+    */
+    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; 
+
+
+private: //internalization methods   
+
+    /**
+    * Internalize the test result from a stream.
+    *
+    * @param aStream   Stream to read from.
+    */
+    IMPORT_C void InternalizeL( RReadStream& aStream );
+    
+  
+private:
+    
+    /**
+    * C++ Constructors.
+    */
+    CDiagResultsDbRecordEngineParam ( RArray<TUid>* aInitialUids,
+                                      TBool         aDependencyExecution );
+    
+    /**
+    * Construct from a stream.
+    *
+    * @param aStream Read stream.
+    */ 
+    void ConstructL ( RReadStream& aStream );
+    
+    /**
+    * Default constructL. Does nothing.
+    */ 
+    void ConstructL ();
+    
+    /**
+    * Default C++ constructor.
+    **/
+    CDiagResultsDbRecordEngineParam ();
+    
+private:    // data
+
+    // Execution uid array
+    RArray<TUid>*               iExecutionUids;
+    
+    //Dependency resolving state.
+    TBool                       iDependencyExecution;
+    
+    };
+
+#endif // DIAGRESULTSDBRECORDENGINEPARAM_H
--- a/remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconst.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconst.h	Wed Sep 01 12:27:42 2010 +0100
@@ -27,15 +27,19 @@
 // SyncML notification MIME type
 _LIT( KNSmlDMNotificationMIMEType, "application/vnd.syncml.notification" );
 // FOTA
+const TInt KNSmlDMResetGenAlerts = -2;
+const TInt KNSmlMaxInt32Length = 10;
+// UID of the Sosserver
 const TUid KPSUidNSmlSOSServerKey = {0x101F99FB};
-const TUint32 KNSmlDMSilentJob = 0x0000005;
+
+// PubSub key used to share information about the ongoing Device Management Job
+const TUint32 KNSmlDMSilentJob = 0x0000002;
+
 enum TDmSessionType
 {
 ESilent = 1,
 ENonSilent
 };
-const TInt KNSmlDMResetGenAlerts = -2;
-const TInt KNSmlMaxInt32Length = 10;
 // FOTA end
 
 #endif //__NSMLDMCONST_H__
\ No newline at end of file
--- a/remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconstants.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconstants.h	Wed Sep 01 12:27:42 2010 +0100
@@ -24,7 +24,6 @@
 #define KNSmlDmServerIdMaxLength 150
 #define KNSmlDmSharedSecretMaxLength 50 
 
-
 #endif //__NSMLDMCONSTANTS_H__
 
 //  End of File
--- a/remotemgmt_plat/dm_device_dialog_api/dm_device_dialog_api.metaxml	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<api id="9651272f8fa7fba2a895405c95bd25c3" dataversion="2.0">
-  <name>DM Device Dialogs API</name>
-  <description>DM Device Dialogs</description>
-  <type>c++</type>
-  <collection>devicemgmtnotifications</collection>
-  <libs>
-    <lib name="dmdevdialogclient.lib"/>
-  </libs>
-  <release category="domain"/>
-  <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>yes</htmldocprovided>
-     <adaptation>no</adaptation>
-  </attributes>
-</api>
--- a/remotemgmt_plat/dm_device_dialog_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2006 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:  File that exports the files belonging to 
-:                DM Device Dialog API
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/dmdevdialogclient.h     MW_LAYER_PLATFORM_EXPORT_PATH(dmdevdialogclient.h)
-
--- a/remotemgmt_plat/dm_device_dialog_api/inc/dmdevdialogclient.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Dm device dialog client
-*
-*/
-
-#ifndef __DMDEVDIALOG_H__
-#define __DMDEVDIALOG_H__
-
-#include <e32std.h>
-#include <e32base.h>
-
-class RDmDevDialog : public RSessionBase
-	{
-	public:
-		/**
-		 * Launches Dm device dialog server
-		 * @param None
-		 * @return None
-		 */
-		IMPORT_C TInt OpenL();
-		
-		/**
-		 * Close server connection
-		 * @param None
-		 * @return None
-		 */
-		IMPORT_C void Close();
-		
-		/**
-		 * Asynchronous call to launche package zero device dialog		 
-		 * @param aProfileId, ProfileId of the DM server
-		 * @param ajobId, Id of the DM job created due to package zero
-		 * @param aUimode, Server alert ui mode type
-		 * @param aResponse, Response from device dialog
-		 * @param aStatus, Status variable set after request completion
-		 * @return None
-		 */				  
-		IMPORT_C void LaunchPkgZero( const TInt& aProfileId, const TInt& ajobId, 
-		  const TInt& aUimode, TDes8& aResponse,TRequestStatus& aStatus);  					
-	
-	
-        /**
-         * Synchronous call to check whether server alert 
-         * connect note shown or not.       
-         * @param aConectNoteShown, Status of the server alert connect note         
-         * @return None.
-         */		
-		IMPORT_C TInt IsPkgZeroConnectNoteShown(TInt& aConectNoteShown);
-		
-        /**
-         * Synchronous call to dismiss connect dialog. 
-         * Ongoing DM session won't stop.       
-         * @param None.         
-         * @return None.		
-		 */
-		IMPORT_C TInt DismissConnectDialog();
-		
-        /**
-         * Synchronous call to Show connect dialog, if connect dialog dismissed 
-         * earlier
-         * @param None         
-         * @return None.        
-         */		
-		IMPORT_C TInt ShowConnectDialog();
-		
-        /**
-         * Asynchronous call to Show Display(1100) alert dialog          
-         * @param aNoteDisplayText, Text to be displayed on the note  
-         * @param aStatus, Status variable set after request completion       
-         * @return None.        
-         */		
-		IMPORT_C void ShowDisplayAlert(const TDesC& aNoteDisplayText,TRequestStatus& aStatus);
-		
-        /**
-         * Asynchronous call to Show Confirmation(1101) alert dialog
-         * @param aTimeout, Timeout of the dialog. 
-         * @param aNoteDisplayText, Text to be displayed on the note           
-         * @param aNoteHeader, Text to be displayed as dialog header  
-         * @param aStatus, Status variable set after request completion       
-         * @return None.        
-         */
-		IMPORT_C void ShowConfirmationAlert(const TInt& aTimeout,const TDesC& aNoteHeader,
-		        const TDesC& aNoteDisplayText,TRequestStatus& aStatus);
-		        		
-        /**
-         * Cancels earlier package zero note, if user doesn't respond
-         * @param None.      
-         * @return None.        
-         */
-		IMPORT_C TInt CancelPkgZeroNote();        
-};
-
-#endif
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/conf/dmdevicedialogstest.cfg	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-[Test]
-title Example
-create dmdevicedialogstest foobar
-foobar Example pa ra me ters
-delete foobar
-[Endtest] 
-
-[Test]
-title ShowOnlyPkgZeroNoteL
-create dmdevicedialogstest foobar
-foobar ShowOnlyPkgZeroNoteL pa ra me ters
-delete foobar
-[Endtest] 
-
-[Test]
-pause 2000
-title ShowPkgZeroandConnectNoteL
-create dmdevicedialogstest foobar
-foobar ShowPkgZeroandConnectNoteL pa ra me ters
-pause 9000
-foobar DismissConnectNoteL
-pause 2000
-foobar ShowConnectNoteAgainL
-delete foobar
-[Endtest]
-
-[Test]
-title JobCancelHide
-create dmdevicedialogstest foobar
-foobar ShowPkgZeroandConnectNoteL pa ra me ters
-delete foobar
-[Endtest]
-
-[Test]
-pause 2000
-title ShowDisplayAlertL
-create dmdevicedialogstest foobar
-foobar ShowDisplayAlertL pa ra me ters
-pause 2000
-delete foobar
-[Endtest]
-
-
-[Test]
-pause 2000
-title ShowConfirmationAlertL
-create dmdevicedialogstest foobar
-foobar ShowConfirmationAlertL pa ra me ters
-delete foobar
-[Endtest]  
-
-[Test]
-title SilentPkgZeroL
-create dmdevicedialogstest foobar
-foobar SilentPkgZeroL
-delete foobar
-[Endtest]  
-
-[Test]
-title DefaultProfilePkgZeroL
-create dmdevicedialogstest foobar
-foobar DefaultProfilePkgZeroL
-delete foobar
-[Endtest] 
-
-[Test]
-
-title realsilent
-create dmdevicedialogstest foobar
-foobar ShowPkgZeroandConnectNoteL 
-delete foobar
-[Endtest]
\ No newline at end of file
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: test code componnet for dm device dialogs
-* 	This is part of remotemgmt_plat.
-*
-*/
-
-PRJ_PLATFORMS
-// specify the platforms your component needs to be built for here
-// defaults to WINS MARM so you can ignore this if you just build these
-	
-	DEFAULT
-
-PRJ_TESTEXPORTS
-// NOTE: If using ARS requirements all export operations should be done under this.
-// 'abld test export'
-
-PRJ_EXPORTS
-// Specify the source file followed by its destination here
-// copy will be used to copy the source file to its destination
-// If there's no destination then the source file will be copied
-// to the same name in /epoc32/include
-// Example: 
-/*
-/agnmodel/inc/AGMCOMON.H
-*/
-
-PRJ_TESTMMPFILES
-
-	dmdevicedialogstest.mmp
-
-PRJ_MMPFILES
-
-// Specify the .mmp files required for building the important component
-// releasables.
-//
-// Specify "tidy" if the component you need to build doesn't need to be
-// released. Specify "ignore" if the MMP file exists but should be
-// ignored.
-// Example:
-/*
-/agnmodel/group/agnmodel.mmp
-#if defined(MARM)
-/agnmodel/group/agsvexe.mmp
-#endif
-*/
-
-//  End of File
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/group/dmdevicedialogstest.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*TYPE TESTCLASS*/
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: MMP file for STIF Test Framework's TestScripter 
-* testclass test module.
-*
-*/
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-SMPSAFE
-
-TARGET          dmdevicedialogstest.dll
-TARGETTYPE      dll
-UID             0x1000008D 0x101FB3E3
-
-CAPABILITY      ALL -TCB
-/* Remove comments and replace 0x00000000 with correct vendor id */
-// VENDORID     0x00000000
-/* Remove comments and replace 0x00000000 with correct secure id */
-// SECUREID     0x00000000
-
-//TARGETPATH      ?target_path
-DEFFILE         dmdevicedialogstest.def
-
-USERINCLUDE     ../inc 
-
-OS_LAYER_SYSTEMINCLUDE
-MW_LAYER_SYSTEMINCLUDE
-
-SOURCEPATH      ../src
-
-SOURCE          dmdevicedialogstest.cpp
-SOURCE          dmdevicedialogstestBlocks.cpp
-
-//RESOURCE        resource_file
-//RESOURCE        resource_file2
-
-LIBRARY         euser.lib
-LIBRARY         stiftestinterface.lib
-LIBRARY         stiftestengine.lib
-LIBRARY         dmdevdialogclient.lib NSmlPrivateAPI.lib centralrepository.lib
-LANG            SC
-
-/*
-START WINS      
-?wins_specific_information
-END
-
-START MARM
-?marm_specific_information
-END
-*/
-// Other possible keywords:
- 
-// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
-/*
-START BITMAP ?target
-TARGETPATH   ?emulated_path_on_target_machine
-HEADER
-SOURCE       ?color_depth ?source_bitmap
-END
-*/
-// DEFFILE ?filename
-// AIF ?filename
-
-// End of File
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/group/dmdevicedialogstest.pkg	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-; 
-; Description:
-;
-; 	Installation file for STIF
-;
-
-; Languages
-&EN
-
-; Provide value for uid
-#{"STIF"},(0x00000000),1,1,0,TYPE=SA
-
-; Series60 product id for S60 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
-
-; Install files
-"\epoc32\release\armv5\udeb\dmdevicedialogstest.dll"   -   "!:\Sys\Bin\dmdevicedialogstest.dll"
-  
-; Embedded SIS 
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/inc/dmdevicedialogstest.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: STIF testclass declaration
-*
-*/
-
-#ifndef DMDEVICEDIALOGSTEST_H
-#define DMDEVICEDIALOGSTEST_H
-
-//  INCLUDES
-#include <StifLogger.h>
-#include <TestScripterInternal.h>
-#include <StifTestModule.h>
-#include <TestclassAssert.h>
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-#define TEST_CLASS_VERSION_MAJOR 0
-#define TEST_CLASS_VERSION_MINOR 0
-#define TEST_CLASS_VERSION_BUILD 0
-
-// Logging path
-_LIT( KdmdevicedialogstestLogPath, "\\logs\\testframework\\dmdevicedialogstest\\" ); 
-// Log file
-_LIT( KdmdevicedialogstestLogFile, "dmdevicedialogstest.txt" ); 
-_LIT( KdmdevicedialogstestLogFileWithTitle, "dmdevicedialogstest_[%S].txt" );
-
-// FUNCTION PROTOTYPES
-//?type ?function_name(?arg_list);
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-class Cdmdevicedialogstest;
-
-// DATA TYPES
-//enum ?declaration
-//typedef ?declaration
-//extern ?data_type;
-
-// CLASS DECLARATION
-
-/**
-*  Cdmdevicedialogstest test class for STIF Test Framework TestScripter.
-*  ?other_description_lines
-*
-*  @lib ?library
-*  @since ?Series60_version
-*/
-NONSHARABLE_CLASS(Cdmdevicedialogstest) : public CScriptBase
-    {
-    public:  // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static Cdmdevicedialogstest* NewL( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * Destructor.
-        */
-        virtual ~Cdmdevicedialogstest();
-
-    public: // New functions
-
-        /**
-        * ?member_description.
-        * @since ?Series60_version
-        * @param ?arg1 ?description
-        * @return ?description
-        */
-        //?type ?member_function( ?type ?arg1 );
-
-    public: // Functions from base classes
-
-        /**
-        * From CScriptBase Runs a script line.
-        * @since ?Series60_version
-        * @param aItem Script line containing method name and parameters
-        * @return Symbian OS error code
-        */
-        virtual TInt RunMethodL( CStifItemParser& aItem );
-
-    protected:  // New functions
-
-        /**
-        * ?member_description.
-        * @since ?Series60_version
-        * @param ?arg1 ?description
-        * @return ?description
-        */
-        //?type ?member_function( ?type ?arg1 );
-
-    protected:  // Functions from base classes
-
-        /**
-        * From ?base_class ?member_description
-        */
-        //?type ?member_function();
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        Cdmdevicedialogstest( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-        // Prohibit copy constructor if not deriving from CBase.
-        // ?classname( const ?classname& );
-        // Prohibit assigment operator if not deriving from CBase.
-        // ?classname& operator=( const ?classname& );
-
-        /**
-        * Frees all resources allocated from test methods.
-        * @since ?Series60_version
-        */
-        void Delete();
-
-        /**
-        * Test methods are listed below. 
-        */
-
-        /**
-        * Example test method.
-        * @since ?Series60_version
-        * @param aItem Script line containing parameters.
-        * @return Symbian OS error code.
-        */
-        virtual TInt ExampleL( CStifItemParser& aItem );
-        
-        virtual TInt ShowOnlyPkgZeroNoteL( CStifItemParser& aItem );
-        virtual TInt ShowPkgZeroandConnectNoteL( CStifItemParser& aItem );
-        virtual TInt ShowConnectNoteAgainL( CStifItemParser& aItem );
-        virtual TInt DismissConnectNoteL( CStifItemParser& aItem );
-        virtual TInt IsConnectNoteShownL( CStifItemParser& aItem );
-        virtual TInt ShowDisplayAlertL( CStifItemParser& aItem );
-        virtual TInt ShowConfirmationAlertL( CStifItemParser& aItem );
-        virtual TInt CancelPkgZeroNoteL( CStifItemParser& aItem );
-        virtual TInt SilentPkgZeroL( CStifItemParser& aItem );
-        virtual TInt DefaultProfilePkgZeroL( CStifItemParser& aItem );
-        /**
-         * Method used to log version of test class
-         */
-        void SendTestClassVersion();
-
-        //ADD NEW METHOD DEC HERE
-        //[TestMethods] - Do not remove
-
-    public:     // Data
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-    protected:  // Data
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-    private:    // Data
-        
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-        // Reserved pointer for future extension
-        //TAny* iReserved;
-
-    public:     // Friend classes
-        //?friend_class_declaration;
-    protected:  // Friend classes
-        //?friend_class_declaration;
-    private:    // Friend classes
-        //?friend_class_declaration;
-
-    };
-
-#endif      // DMDEVICEDIALOGSTEST_H
-
-// End of File
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/init/dmdevicedialogs.ini	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-#
-# This is STIF initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-#	- Set Test Reporting mode. TestReportMode's possible values are:
-#		+ 'Summary': Summary of the tested test cases.
-#		+ 'Environment': Hardware and software info.
-#		+ 'TestCases': Test case report.
-#		+ 'FullReport': Set of all above ones.
-#		+ Example 'TestReportMode= Summary TestCases'
-#
-# 	- CreateTestReport setting controls report creation mode
-#		+ YES, Test report will created.
-#		+ NO, No Test report.
-#
-# 	- File path indicates the base path of the test report.
-# 	- File name indicates the name of the test report.
-#
-# 	- File format indicates the type of the test report.
-#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
-#		+ HTML, Test report will be html type, for example 'TestReport.html'.
-#   + XML, Test report will be xml type, for example 'TestReport.xml'.
-#          Note, that xml format is available only when output is set to FILE.
-#
-# 	- File output indicates output source of the test report.
-#		+ FILE, Test report logging to file.
-#		+ RDEBUG, Test report logging to using rdebug.
-#
-# 	- File Creation Mode indicates test report overwriting if file exist.
-#		+ OVERWRITE, Overwrites if the Test report file exist.
-#		+ APPEND, Continue logging after the old Test report information if
-#                 report exist.
-# 	- Sets a device reset module's dll name(Reboot).
-#		+ If Nokia specific reset module is not available or it is not correct one
-#		  StifHWResetStub module may use as a template for user specific reset
-#		  module.
-# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
-#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
-#
-
-[Engine_Defaults]
-
-TestReportMode= FullReport    # Possible values are: 'Empty', 'Summary', 'Environment',
-                              #                      'TestCases' or 'FullReport'
-
-CreateTestReport= YES         # Possible values: YES or NO
-
-TestReportFilePath= C:\LOGS\TestFramework\
-TestReportFileName= TestReport
-
-TestReportFormat= TXT         # Possible values: TXT, HTML or XML
-TestReportOutput= FILE        # Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-DisableMeasurement= stifmeasurementdisablenone  # Possible values are:
-              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
-              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
-              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
-              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
-
-Timeout= 0                    # Default timeout value for each test case. In milliseconds
-#UITestingSupport= YES        # Possible values: YES or NO
-#SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags 
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-[New_Module]
-ModuleName= testscripter
-TestCaseFile= c:\TestFramework\dmdevicedialogstest.cfg
-[End_Module]
-
-
-# Load testmoduleXXX, optionally with initialization file and/or test case files
-#[New_Module]
-#ModuleName= testmodulexxx
-
-#TestModuleXXX used initialization file
-#IniFile= c:\testframework\init.txt
-
-#TestModuleXXX used configuration file(s)
-#TestCaseFile= c:\testframework\testcases1.cfg
-#TestCaseFile= c:\testframework\testcases2.cfg
-#TestCaseFile= c:\testframework\manualtestcases.cfg
-
-#[End_Module]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIF logging overwrite parameters for Logger.
-# 	Hardware and emulator environment logging path and styles can
-# 	be configured from here to overwrite the Logger's implemented values.
-#	
-#	Settings description:
-#	- Indicates option for creation log directory/directories. If log directory/directories
-#         is/are not created by user they will make by software.
-#		+ YES, Create log directory/directories if not allready exist.
-#		+ NO, Log directory/directories not created. Only created one is used.
-#
-#	- Overwrite emulator path setting.
-#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
-#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
-#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
-#
-#	- Overwrite emulator's logging format.
-#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
-#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
-#
-#	- Overwrited emulator logging output source.
-#		+ FILE, Logging to file(s).
-#		+ RDEBUG, Logging to using rdebug(s).
-#
-#	- Overwrite hardware path setting (Same description as above in emulator path).
-#	- Overwrite hardware's logging format(Same description as above in emulator format).
-#	- Overwrite hardware's logging output source(Same description as above in emulator output).
-#
-#	- File Creation Mode indicates file overwriting if file exist.
-#		+ OVERWRITE, Overwrites if file(s) exist.
-#		+ APPEND, Continue logging after the old logging information if file(s) exist.
-#
-#	- Will thread id include to the log filename.
-#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
-#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
-#
-#	- Will time stamps include the to log file.
-#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
-#                 for example'12.Nov.2003 115958    LOGGING INFO'
-#		+ NO, No time stamp(s).
-#
-#	- Will line breaks include to the log file.
-#		+ YES, Each logging event includes line break and next log event is in own line.
-#		+ NO, No line break(s).
-#
-#	- Will event ranking include to the log file.
-#		+ YES, Event ranking number added to each line in log file(s). Ranking number
-#                 depends on environment's tics, for example(includes time stamp also)
-#                 '012   12.Nov.2003 115958    LOGGING INFO'
-#		+ NO, No event ranking.
-#
-#	- Will write log file in unicode format.
-#		+ YES, Log file will be written in unicode format
-#		+ NO, Log will be written as normal, not unicode, file.
-#
-
-[Logger_Defaults]
-
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-#NOTE: TestEngine and TestServer logging settings cannot change here
-
-#CreateLogDirectories= YES    # Possible values: YES or NO
-
-#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML         # Possible values: TXT or HTML
-#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
-
-#HardwareBasePath= D:\LOGS\TestFramework\
-#HardwareFormat= HTML         # Possible values: TXT or HTML
-#HardwareOutput= FILE         # Possible values: FILE or RDEBUG
-
-#FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
-
-#ThreadIdToLogFile= YES       # Possible values: YES or NO
-#WithTimeStamp= YES           # Possible values: YES or NO
-#WithLineBreak= YES           # Possible values: YES or NO
-#WithEventRanking= YES        # Possible values: YES or NO
-
-#FileUnicode= YES             # Possible values: YES or NO
-#AddTestCaseTitle= YES        # Possible values: YES or NO
-[End_Logger_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set filters to be used by ConsoleUI.
-# 	If you want to use filter with ConsoleUI, simply remove comments
-# 	from section below and provide valid filter entries.
-#   Each filter line has to start with "filter= " keyword.
-#   Filter can contain special wildcard characters:
-#     *  which stands for none or any literal;
-#     ?  which stands for single character.
-#   Filters are not case-sensitive.
-
-#[Filters]
-#filter= *math*
-#filter= *radio*
-#[End_Filters]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/src/dmdevicedialogstest.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains testclass implementation.
-*
-*/
-
-// INCLUDE FILES
-#include <StifTestInterface.h>
-#include "dmdevicedialogstest.h"
-#include <SettingServerClient.h>
-
-// EXTERNAL DATA STRUCTURES
-//extern  ?external_data;
-
-// EXTERNAL FUNCTION PROTOTYPES  
-//extern ?external_function( ?arg_type,?arg_type );
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-
-// LOCAL CONSTANTS AND MACROS
-//const ?type ?constant_var = ?constant;
-//#define ?macro_name ?macro_def
-
-// MODULE DATA STRUCTURES
-//enum ?declaration
-//typedef ?declaration
-
-// LOCAL FUNCTION PROTOTYPES
-//?type ?function_name( ?arg_type, ?arg_type );
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// ?function_name ?description.
-// ?description
-// Returns: ?value_1: ?description
-//          ?value_n: ?description_line1
-//                    ?description_line2
-// -----------------------------------------------------------------------------
-//
-/*
-?type ?function_name(
-    ?arg_type arg,  // ?description
-    ?arg_type arg)  // ?description
-    {
-
-    ?code  // ?comment
-
-    // ?comment
-    ?code
-    }
-*/
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::Cdmdevicedialogstest
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-Cdmdevicedialogstest::Cdmdevicedialogstest( 
-    CTestModuleIf& aTestModuleIf ):
-        CScriptBase( aTestModuleIf )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void Cdmdevicedialogstest::ConstructL()
-    {
-    //Read logger settings to check whether test case name is to be
-    //appended to log file name.
-    RSettingServer settingServer;
-    TInt ret = settingServer.Connect();
-    if(ret != KErrNone)
-        {
-        User::Leave(ret);
-        }
-    // Struct to StifLogger settigs.
-    TLoggerSettings loggerSettings; 
-    // Parse StifLogger defaults from STIF initialization file.
-    ret = settingServer.GetLoggerSettings(loggerSettings);
-    if(ret != KErrNone)
-        {
-        User::Leave(ret);
-        } 
-    // Close Setting server session
-    settingServer.Close();
-
-    TFileName logFileName;
-    
-    if(loggerSettings.iAddTestCaseTitle)
-        {
-        TName title;
-        TestModuleIf().GetTestCaseTitleL(title);
-        logFileName.Format(KdmdevicedialogstestLogFileWithTitle, &title);
-        }
-    else
-        {
-        logFileName.Copy(KdmdevicedialogstestLogFile);
-        }
-
-    iLog = CStifLogger::NewL( KdmdevicedialogstestLogPath, 
-                          logFileName,
-                          CStifLogger::ETxt,
-                          CStifLogger::EFile,
-                          EFalse );
-    
-    SendTestClassVersion();
-    }
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-Cdmdevicedialogstest* Cdmdevicedialogstest::NewL( 
-    CTestModuleIf& aTestModuleIf )
-    {
-    Cdmdevicedialogstest* self = new (ELeave) Cdmdevicedialogstest( aTestModuleIf );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-
-    }
-
-// Destructor
-Cdmdevicedialogstest::~Cdmdevicedialogstest()
-    { 
-
-    // Delete resources allocated from test methods
-    Delete();
-
-    // Delete logger
-    delete iLog; 
-
-    }
-
-//-----------------------------------------------------------------------------
-// Cdmdevicedialogstest::SendTestClassVersion
-// Method used to send version of test class
-//-----------------------------------------------------------------------------
-//
-void Cdmdevicedialogstest::SendTestClassVersion()
-	{
-	TVersion moduleVersion;
-	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
-	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
-	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
-	
-	TFileName moduleName;
-	moduleName = _L("dmdevicedialogstest.dll");
-
-	TBool newVersionOfMethod = ETrue;
-	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
-	}
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL( 
-    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
-    {
-
-    return ( CScriptBase* ) Cdmdevicedialogstest::NewL( aTestModuleIf );
-
-    }
-
-
-//  End of File
--- a/remotemgmt_plat/dm_device_dialog_api/tsrc/src/dmdevicedialogstestBlocks.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,412 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains testclass implementation.
-*
-*/
-
-// [INCLUDE FILES] - do not remove
-#include <e32svr.h>
-#include <StifParser.h>
-#include <StifTestInterface.h>
-#include "dmdevicedialogstest.h"
-#include <dmdevdialogclient.h>
-#include <nsmlprivateapi.h>
-#include <centralrepository.h>
-#include <devmaninternalcrkeys.h>
-// EXTERNAL DATA STRUCTURES
-//extern  ?external_data;
-
-// EXTERNAL FUNCTION PROTOTYPES  
-//extern ?external_function( ?arg_type,?arg_type );
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-
-// LOCAL CONSTANTS AND MACROS
-//const ?type ?constant_var = ?constant;
-//#define ?macro_name ?macro_def
-
-// MODULE DATA STRUCTURES
-//enum ?declaration
-//typedef ?declaration
-
-// LOCAL FUNCTION PROTOTYPES
-//?type ?function_name( ?arg_type, ?arg_type );
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// ?function_name ?description.
-// ?description
-// Returns: ?value_1: ?description
-//          ?value_n: ?description_line1
-//                    ?description_line2
-// -----------------------------------------------------------------------------
-//
-/*
-?type ?function_name(
-    ?arg_type arg,  // ?description
-    ?arg_type arg)  // ?description
-    {
-
-    ?code  // ?comment
-
-    // ?comment
-    ?code
-    }
-*/
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::Delete
-// Delete here all resources allocated and opened from test methods. 
-// Called from destructor. 
-// -----------------------------------------------------------------------------
-//
-void Cdmdevicedialogstest::Delete() 
-    {
-
-    }
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt Cdmdevicedialogstest::RunMethodL( 
-    CStifItemParser& aItem ) 
-    {
-
-    static TStifFunctionInfo const KFunctions[] =
-        {  
-        // Copy this line for every implemented function.
-        // First string is the function name used in TestScripter script file.
-        // Second is the actual implementation member function. 
-        ENTRY( "Example", Cdmdevicedialogstest::ExampleL ),
-        ENTRY( "ShowOnlyPkgZeroNoteL", Cdmdevicedialogstest::ShowOnlyPkgZeroNoteL ),
-        ENTRY("ShowPkgZeroandConnectNoteL",Cdmdevicedialogstest::ShowPkgZeroandConnectNoteL),
-        ENTRY("DismissConnectNoteL",Cdmdevicedialogstest::DismissConnectNoteL),
-        ENTRY("ShowConnectNoteAgainL",Cdmdevicedialogstest::ShowConnectNoteAgainL),
-        ENTRY("ShowDisplayAlertL",Cdmdevicedialogstest::ShowDisplayAlertL),
-        ENTRY("ShowConfirmationAlertL",Cdmdevicedialogstest::ShowConfirmationAlertL),
-        ENTRY("CancelPkgZeroNoteL",Cdmdevicedialogstest::CancelPkgZeroNoteL),
-        ENTRY("SilentPkgZeroL",Cdmdevicedialogstest::SilentPkgZeroL),
-                ENTRY("DefaultProfilePkgZeroL",Cdmdevicedialogstest::DefaultProfilePkgZeroL),
-        
-        //ADD NEW ENTRY HERE
-        // [test cases entries] - Do not remove
-
-        };
-
-    const TInt count = sizeof( KFunctions ) / 
-                        sizeof( TStifFunctionInfo );
-
-    return RunInternalL( KFunctions, count, aItem );
-
-    }
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::ExampleL
-// Example test method function.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt Cdmdevicedialogstest::ExampleL( CStifItemParser& aItem )
-    {
-
-    // Print to UI
-/*    _LIT( Kdmdevicedialogstest, "dmdevicedialogstest" );
-    _LIT( KExample, "In Example" );
-    TestModuleIf().Printf( 0, Kdmdevicedialogstest, KExample );
-    // Print to log file
-    iLog->Log( KExample );
-
-    TInt i = 0;
-    TPtrC string;
-    _LIT( KParam, "Param[%i]: %S" );
-    while ( aItem.GetNextString ( string ) == KErrNone )
-        {
-        TestModuleIf().Printf( i, Kdmdevicedialogstest, 
-                                KParam, i, &string );
-        i++;
-        }*/
-
-    RDmDevDialog DmDevdialog;
-    TInt err = DmDevdialog.OpenL();
-    if(err)
-        return err;
-    DmDevdialog.Close();
-    return KErrNone;
-
-    }
-
-TInt Cdmdevicedialogstest::ShowOnlyPkgZeroNoteL( CStifItemParser& aItem )
-    {
-    RDebug::Print(_L("Cdmdevicedialogstest::ShowOnlyPkgZeroNoteL"));
-    RDmDevDialog DmDevdialog;
-    
-    TInt err = DmDevdialog.OpenL();
-    RDebug::Print(_L("Cdmdevicedialogstest::ShowOnlyPkgZeroNoteL after openL"));
-    if (err)
-        return err;
-    TRequestStatus status = KRequestPending;
-    TInt ProfileId = 1000001;
-    TInt Jobid = 0;
-    TInt uimode = 0;
-    //TBuf<100> name(_L("Server name 123"));
-    TPckgBuf<TInt> iResBuf;
-    DmDevdialog.LaunchPkgZero(ProfileId, Jobid, uimode, iResBuf, status);
-    User::After(1000000 * 6);
-    //User::WaitForRequest(status); //working
-    err = DmDevdialog.CancelPkgZeroNote();
-    //Different tests to be performed
-    //Close immediately
-    DmDevdialog.Close(); //See what happens to server whether it is closed or not
-    //Close later
-    /*if (status.Int() == KErrNone || status.Int() == KErrCancel)
-        return KErrNone;
-    else
-        return KErrNotFound;*/
-    return err;
-    }
-TInt Cdmdevicedialogstest::SilentPkgZeroL( CStifItemParser& aItem )
-    {
-    RDebug::Print(_L("Cdmdevicedialogstest::SilentPkgZeroL"));
-    RDmDevDialog DmDevdialog;
-    
-    TInt err = DmDevdialog.OpenL();
-    RDebug::Print(_L("Cdmdevicedialogstest::SilentPkgZeroL after openL"));
-    if (err)
-        return err;
-    TRequestStatus status = KRequestPending;
-    TInt ProfileId = 1000001;
-    TInt Jobid = 0;
-    TInt uimode = 1;
-    TBuf<100> name(_L("Silent server"));
-    TPckgBuf<TInt> iResBuf;
-    DmDevdialog.LaunchPkgZero(ProfileId, Jobid, uimode, iResBuf, status);
-   // User::After(1000000 * 6);
-    User::WaitForRequest(status); //working
-    //err = DmDevdialog.CancelPkgZeroNote();
-    //Different tests to be performed
-    //Close immediately
-    DmDevdialog.Close(); //See what happens to server whether it is closed or not
-    //Close later
-    if (status.Int() == KErrNone || status.Int() == KErrCancel)
-        return KErrNone;
-    else
-        return KErrNotFound;
-    return err;
-    }
-
-TInt Cdmdevicedialogstest::DefaultProfilePkgZeroL( CStifItemParser& aItem )
-    {
-    RDebug::Print(_L("Cdmdevicedialogstest::DefaultProfilePkgZeroL"));
-    // Device manager key UID
-    const TUid KCRUidNSmlDMSyncApp = {0x101f6de5};
-    // CenRep keys for default dm profile used in the
-    // firmware update over the air.
-    const TUint32 KNSmlDMDefaultFotaProfileKey = 0x00000002;
-    TInt ProfileId = 1000001;
-    CRepository* centrep = NULL;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidNSmlDMSyncApp ) );
-    RDebug::Print(_L("Cdmdevicedialogstest::DefaultProfilePkgZeroL cenrep created"));
-    User::LeaveIfError( err );
-    RDebug::Print(_L("Cdmdevicedialogstest::DefaultProfilePkgZeroL cenrep fine"));
-    centrep->Set( KNSmlDMDefaultFotaProfileKey, ProfileId );
-    RDebug::Print(_L("Cdmdevicedialogstest::DefaultProfilePkgZeroL cenrep set fine"));
-    delete centrep;
-    
-    RDmDevDialog DmDevdialog;
-    
-    err = DmDevdialog.OpenL();
-    RDebug::Print(_L("Cdmdevicedialogstest::DefaultProfilePkgZeroL after openL"));
-    if (err)
-        return err;
-    TRequestStatus status = KRequestPending;
-    
-    TInt Jobid = 0;
-    TInt uimode = 0;
-    TBuf<100> name(_L("non silent def"));
-   TPckgBuf<TInt> iResBuf;
-    DmDevdialog.LaunchPkgZero(ProfileId, Jobid, uimode, iResBuf, status);
-   // User::After(1000000 * 6);
-    User::WaitForRequest(status); //working
-    //err = DmDevdialog.CancelPkgZeroNote();
-    //Different tests to be performed
-    //Close immediately
-    DmDevdialog.Close(); //See what happens to server whether it is closed or not
-    //Close later
-    if (status.Int() == KErrNone || status.Int() == KErrCancel)
-        return KErrNone;
-    else
-        return KErrNotFound;
-    return err;
-    }
-
-TInt Cdmdevicedialogstest::ShowPkgZeroandConnectNoteL( CStifItemParser& aItem )
-{
-RNSmlPrivateAPI privateApi;
-    TPtrC8 messageBody(_L8("test"));
-    
-                TRAPD(openErr, privateApi.OpenL());
-                
-                if ( openErr != KErrNone )
-                    {
-                    return openErr;
-                    }
-                    
-                TRAPD(err,privateApi.SendL( messageBody, ESmlDevMan, ESmlVersion1_2 ));                
-                privateApi.Close();
-                return err;
-}
-
-TInt Cdmdevicedialogstest::ShowConnectNoteAgainL( CStifItemParser& aItem )
-    {
-
-    RDebug::Print(_L("Cdmdevicedialogstest::ShowConnectNoteAgainL"));
-        RDmDevDialog DmDevdialog;
-        
-        TInt err = DmDevdialog.OpenL();
-        RDebug::Print(_L("Cdmdevicedialogstest::ShowConnectNoteAgainL after openL"));
-        if (err)
-            return err;
-        TInt Status(KErrNotFound);
-       err = DmDevdialog.ShowConnectDialog();
-      
-           DmDevdialog.Close();
-           return err;                 
-    }
-
-TInt Cdmdevicedialogstest::CancelPkgZeroNoteL( CStifItemParser& aItem )
-    {
-
-    RDebug::Print(_L("Cdmdevicedialogstest::CancelPkgZeroNoteL"));
-        RDmDevDialog DmDevdialog;
-        
-        TInt err = DmDevdialog.OpenL();
-        RDebug::Print(_L("Cdmdevicedialogstest::CancelPkgZeroNoteL after openL"));
-        if (err)
-            return err;
-        TInt Status(KErrNotFound);
-       err = DmDevdialog.CancelPkgZeroNote();
-      
-           DmDevdialog.Close();
-           return err;                 
-    }
-TInt Cdmdevicedialogstest::DismissConnectNoteL( CStifItemParser& aItem )
-    {
-    RDebug::Print(_L("Cdmdevicedialogstest::DismissConnectNoteL"));
-        RDmDevDialog DmDevdialog;
-        
-        TInt err = DmDevdialog.OpenL();
-        RDebug::Print(_L("Cdmdevicedialogstest::ShowOnlyPkgZeroNoteL after openL"));
-        if (err)
-            return err;
-        TInt Status(KErrNotFound);
-       err = DmDevdialog.IsPkgZeroConnectNoteShown(Status);
-       if (err)
-           {
-           DmDevdialog.Close();
-           return err;
-           }
-       if(Status == 1)
-           {
-        err = DmDevdialog.DismissConnectDialog();
-       /* if (err)
-            {
-            DmDevdialog.Close();
-            return err;
-            }*/
-        }
-       else
-           return KErrNone;
-        //Different tests to be performed
-        //Close immediately
-        DmDevdialog.Close(); //See what happens to server whether it is closed or not
-        return err;
-        //Close later
-        
-    }
-TInt Cdmdevicedialogstest::IsConnectNoteShownL( CStifItemParser& aItem )
-    {
-    return KErrNone;
-    }
-TInt Cdmdevicedialogstest::ShowDisplayAlertL( CStifItemParser& aItem )
-    {
-    RDmDevDialog DmDevdialog;
-    TInt err = DmDevdialog.OpenL();
-    if(err)
-        return err;
-    
-    TRequestStatus status = KRequestPending;
-TBuf<100> ServerMsg(_L("Information alert...."));
-    DmDevdialog.ShowDisplayAlert(ServerMsg,status);
-
-  
-    User::WaitForRequest(status);
-
-DmDevdialog.Close();
-    return KErrNone;
-    }
-TInt Cdmdevicedialogstest::ShowConfirmationAlertL( CStifItemParser& aItem )
-    {
-    RDmDevDialog DmDevdialog;
-    TInt err = DmDevdialog.OpenL();
-    if(err)
-        return err;
-    
-    TRequestStatus status = KRequestPending;
-TBuf<100> ServerMsg(_L("Confirmation alert...."));
-
-    TInt timeout = 30; // dummy
-    TBuf<30> header; // dummy
-    DmDevdialog.ShowConfirmationAlert(timeout,header,ServerMsg,status);
-       
-   
-    User::WaitForRequest(status);
-
-DmDevdialog.Close();
-    return KErrNone;
-    }
-
-
-
-// -----------------------------------------------------------------------------
-// Cdmdevicedialogstest::?member_function
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-/*
-TInt Cdmdevicedialogstest::?member_function(
-   CItemParser& aItem )
-   {
-
-   ?code
-
-   }
-*/
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-// None
-
-//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_native_notifier_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 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:  Interface file for DM Native Notifier.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/DMNativeNotifier.h       		MW_LAYER_PLATFORM_EXPORT_PATH(DMNativeNotifier.h)
+../inc/DMNativeNotifier.inl     		MW_LAYER_PLATFORM_EXPORT_PATH(DMNativeNotifier.inl)
+../inc/DMNativeNotifierInterface.h       	MW_LAYER_PLATFORM_EXPORT_PATH(DMNativeNotifierInterface.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_native_notifier_api/inc/DMNativeNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2006 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:  Interface file for DM Native Notifier.
+*
+*/
+
+#ifndef DMNATIVENOTIFIER_H
+#define DMNATIVENOTIFIER_H
+
+
+#include <DMNativeNotifierInterface.h>
+
+enum{
+    EDMDialogNotAccepted = 0,
+    EDMDialogAccepted = 1,
+    EDMDialogActive = 2
+};
+class CDMNativeNotifier : public CBase, public MDMNativeNotifierInterface
+{
+ public:
+    
+    /**
+    * Two-phased constructor.
+    */
+    static CDMNativeNotifier* NewL(TUid aOperationId);
+	
+    /**
+    * Destructor.
+    */
+	virtual ~CDMNativeNotifier();
+
+ public:
+	/**
+	* Function to list all the implementations
+	*/
+	static void ListImplementationsL(RImplInfoPtrArray& aImplInfoArray);
+
+ private:
+	// Instance identifier key
+	TUid iDtor_ID_Key;
+};
+
+#include "DMNativeNotifier.inl"
+
+#endif  // DMNATIVENOTIFIER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_native_notifier_api/inc/DMNativeNotifier.inl	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,24 @@
+
+inline CDMNativeNotifier* CDMNativeNotifier::NewL(TUid aOperationId)
+    {  
+    
+    TAny* interface = REComSession::CreateImplementationL( aOperationId
+                                        ,_FOFF (CDMNativeNotifier, iDtor_ID_Key)); 
+    return reinterpret_cast <CDMNativeNotifier*> (interface);
+    
+    }
+
+inline CDMNativeNotifier::~CDMNativeNotifier()
+    {
+    REComSession::DestroyedImplementation (iDtor_ID_Key);    
+    }
+
+inline void CDMNativeNotifier::ListImplementationsL(RImplInfoPtrArray& aImplInfoArray)
+    {
+    _LIT8(KOperationName,"DialogEcom");
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(KOperationName());
+    resolverParams.SetWildcardMatch(ETrue);     // Allow wildcard matching
+
+    REComSession::ListImplementationsL(KNotifierInterfaceUid,resolverParams,KRomOnlyResolverUid, aImplInfoArray);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_native_notifier_api/inc/DMNativeNotifierInterface.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2006 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:  Interface file for DM Native Notifier.
+*
+*/
+
+
+#ifndef DMNATIVENOTIFIERINTERFACE_H_
+#define DMNATIVENOTIFIERINTERFACE_H_
+
+#include <e32base.h>    // CBase  // TBuf
+#include <ecom/ecom.h>
+
+// The Ecom interface uid
+const TUid KNotifierInterfaceUid =  {0x2002BC4D};
+
+//Return types based on the user key press
+enum 
+    {
+    ESyncMLDlgRespKeyNone = -3, 
+    ESyncMLDlgRespKeyOk = -2, // all LSK
+    ESyncMLDlgRespKeyOthers = -1, //all call-termination key press fall here.
+    ESyncMLDlgRespKeyCancel= 0
+    };
+
+//Constants for showing the note
+enum TDmNoteType
+{
+    EPrivacyPolicy = 0
+};
+
+class MDMNativeNotifierInterface
+    {
+public:
+    virtual TInt ShowDialogL(TDmNoteType aNote)=0;
+    };
+
+
+
+#endif /* DMNATIVENOTIFIERINTERFACE_H_ */
--- a/remotemgmt_plat/ds_constant_definitions_api/inc/nsmldsconstants.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/ds_constant_definitions_api/inc/nsmldsconstants.h	Wed Sep 01 12:27:42 2010 +0100
@@ -27,6 +27,6 @@
 // Hybrid
 #define KNSmlDSMaxVersionSize 10
 
-#endif //__NSMLDSCONSTANTS_H__
+#endif __NSMLDSCONSTANTS_H__
 
 //  End of File
--- a/remotemgmt_plat/fota_engine_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -24,5 +24,6 @@
 
 PRJ_EXPORTS
 
+../inc/FotaEngStream.h			MW_LAYER_PLATFORM_EXPORT_PATH(fotaengstream.h)
 ../inc/fotaconst.h     			MW_LAYER_PLATFORM_EXPORT_PATH(fotaConst.h)
 ../inc/FotaEngine.h     		MW_LAYER_PLATFORM_EXPORT_PATH(fotaengine.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/fota_engine_api/inc/FotaEngStream.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2005-2006 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:  Stream to memorybased chunk
+*
+*/
+
+
+
+#ifndef __FOTAENGSTREAM_H__
+#define __FOTAENGSTREAM_H__
+
+// INCLUDES
+#include <s32strm.h>
+#include <s32buf.h>
+#include <e32svr.h>
+
+// FORWARD DECLARATIONS
+class RFotaEngineSession;
+class RFotaWriteStream;
+
+
+const TInt  KDefaultWriteLimit( 5000000 );
+
+// CLASS DECLARATION
+/**
+* Memory buffer
+*
+* Saves streams data to chunk.
+*
+* @lib    fotaengine.lib
+* @since  Series 60 v3.1
+*/
+class TDP2StreamBuf : public TStreamBuf
+{
+    friend class RFotaWriteStream;
+
+public: 
+
+    TDP2StreamBuf ();
+
+    /** Resets write area
+    *
+    * @param    None
+    * @return   None
+    */
+    void            ResetL();
+
+private:
+
+    /** Handles overflow of write area
+    *
+    * @param    None
+    * @return   None
+    */
+    virtual void    OverflowL();
+
+	
+    /** Handles underflow of write area
+    *
+    * @param    aMaxLength
+    * @return   Error code
+    */
+    virtual TInt    UnderflowL(TInt aMaxLength);
+
+    
+    /** Handles releasing of stream/buffer
+    *
+    * @param    None
+    * @return   None
+    */
+    virtual void    DoRelease();
+
+
+    /**
+    * Bytes written to stream
+    */
+    TInt            iBytesWritten;
+
+
+    /**
+    * Chunks sent to server
+    */
+    TInt            iSentChunks;
+    
+
+    /**
+    * Reference to parent stream
+    */
+    RFotaWriteStream* iMyWriteStream;
+
+};
+
+
+/**
+ *  RFotaWriteStream saves swupd to memory chunk
+ *
+ *  Saves written content via TDP2StreamBuf to 
+ *  the chunk.
+ *
+ *  @lib fotaengine.lib
+ *  @since S60 3.1
+ */
+class RFotaWriteStream : public RWriteStream
+    {
+    friend class RFotaEngineSession;
+
+    friend class TDP2StreamBuf;
+
+public:
+
+    RFotaWriteStream ();
+
+    /** Opens stream
+    *
+    * @param    aPkgId  package id
+    * @return   Error code
+    */
+    TInt OpenL (const TInt aPkgId);
+
+private:
+
+    /**
+     * Memory buffer
+     */
+    TDP2StreamBuf            iBuf;
+
+    /**
+     * Reference to parent session
+     */
+    RFotaEngineSession*     iFotaEngineSession;
+
+    /**
+     * Max package size. If exceeded, must throw error in this class.
+     */
+    TInt  iWriteLimit;
+    };
+
+
+#endif // __FOTAENGSTREAM_H__
\ No newline at end of file
--- a/remotemgmt_plat/fota_engine_api/inc/FotaEngine.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/inc/FotaEngine.h	Wed Sep 01 12:27:42 2010 +0100
@@ -11,47 +11,70 @@
 *
 * Contributors:
 *
- * Description:  Fotaengine api
+* Description:  Fotaengine hdr
 *
 */
 
+
+
 #ifndef __FOTAENGINE_H__
 #define __FOTAENGINE_H__
 
 // INCLUDES
 #include <e32std.h>
 #include <e32def.h>
+#include <badesca.h>
+#include <AknServerApp.h>
 #include <SyncMLDef.h>
+#include <apacmdln.h>
+#include <apgtask.h>
+#include <coemain.h>
+#include <s32file.h>
+#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <uikon.hrh>
+#else
+#include <uikon.hrh>
+#include <uiklaf/private/pluginuid.hrh>
+#endif
 
+
+#include "fotaengstream.h"
 #include "fotaConst.h"
-#include <s32strm.h>
 
 // CONSTANTS
 /**  FOTA Server commands */
 enum TFotaIPCCmds
-    {
-    EFotaDownload,              // The download command
-    EFotaDownloadAndUpdate,     // The download and update command
-    EFotaUpdate,                // The update command
-    EPauseDownload,             // The download pause command
-    EFotaTryResumeDownload,     // The download resume command
-    EGetState,                  // The get state command
-    EGetResult,                 // The get result command
-    EDeletePackage,             // The package delete command
-    EGetUpdateTimestamp,        // The get command for updated timestamp    
-    EGetUpdatePackageIds,       // The get command for all package ids
-    EGenericAlertSentForPackage,    // The generic alert sent notification command
-    EScheduledUpdate,               // The schedule update command
-    EGetCurrFwDetails               // The get command for reading current firmware package details
-    };
+	{
+	EFotaFirstCommand = RApaAppServiceBase::KServiceCmdBase,
+    EDeletePackage,
+    EFotaDownload,
+    EFotaDownloadAndUpdate,
+    EGetResult,
+    EGetState,
+    EIsPackageStoreSizeAvailable,
+    EFotaOpenUpdatePackageStore,
+    // Command for getting the downloaded & full size of the update package 
+    EFotaGetDownloadUpdatePackageSize,
+    // Command to attempt resuming of the download session for downloading the remaining parts of the update package.
+    // This service is restriced to DM UI and FMS Server.
+    EFotaTryResumeDownload, 
+    EFotaUpdate,
+    EUpdatePackageDownloadComplete,
+    EFotaSendChunk,
+    EFotaReleaseChunkHandle,
+    EGetUpdatePackageIds,
+    EGetUpdateTimestamp,
+    EGenericAlertSentForPackage,
+    EScheduledUpdate
+	};
 
-/** Fota start up action states */
+
 enum TFotaUpdateStates
     {
-    EFotaDefault,               // No action        
-    EFotaPendingGenAlert,       // Send pending generic alert
-    EFotaDownloadInterrupted,   // Try to resume download
-    EFotaUpdateInterrupted      // Try to resume update
+    EFotaDefault,
+    EFotaPendingGenAlert,
+    EFotaDownloadInterrupted,
+    EFotaUpdateInterrupted
     };
 
 class TFotaScheduledUpdate;
@@ -59,376 +82,436 @@
 // CLASS DECLARATION
 
 /**
- *	A client handle to a FOTA engine session.
- *   @lib    fotaengine.lib
- *   @since   SF4
- */
-//class RFotaEngineSession : public RAknAppServiceBase // 10.1 changes
-class RFotaEngineSession : public RSessionBase
-    {
+*	A client handle to a FOTA engine session.
+*   @lib    fotaengine.lib
+*   @since  Series 60 3.1
+*/
+class RFotaEngineSession : public RAknAppServiceBase
+	{
 
-public:
-    // enums
+    friend class    TDP2StreamBuf;  // TDP2StreamBuf will use iChunk
+
+public: // enums
 
     /** 
-     * An enumeration of the firmware update progress state codes as specified
-     * in FUMO spec.
-     */
+    * An enumeration of the firmware update progress state codes as specified
+    * in FUMO spec.
+    */
     enum TState
-        {
-        /** No firmware update has been started */
-        EIdle = 10,
-        /** Client has sent a client initiated request */
-        EClientRequest = 5,
-        /** There is no data available and download is about to start */
-        EStartingDownload = 15,
-        /** Download failed and there is no data received */
-        EDownloadFailed = 20,
-        /** Download is progressing without resume support. */
-        EDownloadProgressing = 30,
-        /** Have data and download has been completed successfully */
-        EDownloadComplete = 40,
-        /** Have data and about to start update */
-        EStartingUpdate = 50,
-        /** Denotes that the update is currently running, but has not yet 
-         completed */
-        EUpdateProgressing = 60,
-        /** Have data but update failed */
-        EUpdateFailed = 70,
-        /** Update failed and data deleted or removed */
-        EUpdateFailedNoData = 80,
-        /** Update complete and data still available */
-        EUpdateSuccessful = 90,
-        /** Data deleted or removed after a successful update */
-        EUpdateSuccessfulNoData = 100,
-        };
+	    {
+	    /** No firmware update has been started */
+	    EIdle                       = 10,
+	    /** Client has sent a client initiated request */
+	    EClientRequest              = 5,
+	    /** There is no data available and download is about to start */
+	    EStartingDownload           = 15,
+	    /** Download failed and there is no data received */
+	    EDownloadFailed             = 20,
+  		/** Download is progressing with resume support. This is an internal state and is not a valid FUMO state.
+	  	 * Only DM UI and Fota Server can get this state; others get state 30 instead.*/
+  		EDownloadProgressingWithResume	= 25,
+	    /** Download is progressing without resume support. */ 
+	    EDownloadProgressing        = 30,
+	    /** Have data and download has been completed successfully */
+	    EDownloadComplete           = 40,
+	    /** Have data and about to start update */
+	    EStartingUpdate             = 50,
+	    /** Denotes that the update is currently running, but has not yet 
+        completed */
+	    EUpdateProgressing          = 60,
+	    /** Have data but update failed */
+	    EUpdateFailed               = 70,
+	    /** Update failed and data deleted or removed */
+	    EUpdateFailedNoData         = 80,
+	    /** Update complete and data still available */
+	    EUpdateSuccessful           = 90,
+	    /** Data deleted or removed after a successful update */
+	    EUpdateSuccessfulNoData     = 100,	
+	    };
 
-    /** 
-     * An enumeration of the firmware update result codes as specified
-     * in the OMA Firmware Update Management Oobject specification. 
-     */
+	/** 
+    * An enumeration of the firmware update result codes as specified
+    * in the OMA Firmware Update Management Oobject specification. 
+    */
+
     enum TResult
         {
-        /** Requested operation is successful */
-        EResSuccessful = 200,
-        /** Requested operation is cancelled by user */
-        EResUserCancelled = 401,
-        /** Firmware update is corrupt */
-        EResCorruptedFWUPD = 402,
-        /** Firmware update mismatches with the device */
-        EResPackageMismatch = 403,
-        /** Not used */
-        EResFailedSignatureAuthentication = 404,
-        /** Undefined error occured during the operation */
-        EResUndefinedError = 409,
-        /** Update has failed */
-        EResUpdateFailed = 410,
-        /** Download failed due to malformed or bad url */
-        EResMalformedOrBadURL = 411,
-        /** The OMA DL server is unavailable */
-        EResAlternateDLServerUnavailable = 412,
-        /** Download paused due to out of memory */
-        EResDLFailDueToDeviceOOM = 501,
-        /** Download paused due to network error */
-        EResDLFailDueToNWIssues = 503,
+        EResSuccessful                     = 200,
+        EResUserCancelled                  = 401,
+        EResCorruptedFWUPD                 = 402,
+        EResPackageMismatch                = 403,
+        EResFailedSignatureAuthentication  = 404,
+        EResUndefinedError                  = 409,
+        EResUpdateFailed                   = 410,
+        EResMalformedOrBadURL              = 411,
+        EResAlternateDLServerUnavailable   = 412,
+        EResDLFailDueToDeviceOOM           = 501,
+        EResDLFailDueToNWIssues            = 503
+        };
+		    
+public: // Constructors 
 
-        //Vendor specific errors
-        /** Download failed due to content type mismatch */
-        EResContentMisMatch = 600,
-        /** Download failed due to invalid OMA DL1.0 descriptor */
-        EResInvalidDownloadDescriptor = 601,
-        /** Update suspended due to low battery */
-        EResLowBattery = 602
-        };
-
-public:
-    // Constructors 
-
-    IMPORT_C RFotaEngineSession();
-
-public:
-    // new functions
-    /**
-     * Opens session to Fota Engine
-     *         
-     * @since  SF4
-     * @param      None
-     * @return     None
-     */
-    IMPORT_C void OpenL();
-
-    /**
-     * Closes session to Fota Engine
-     * 
-     * @since   SF4
-     * @param      None
-     * @return     None
-     */
-    IMPORT_C void Close();
+	IMPORT_C RFotaEngineSession();
+	
+public: // new functions
+	/**
+	* Opens session to Fota Engine
+    *         
+    * @since  Series 60 3.1
+    * @param      None
+    * @return     None
+	*/
+	IMPORT_C void OpenL();
+	
+	/**
+	* Closes session to Fota Engine
+    * 
+    * @since  Series 60 3.1
+    * @param      None
+    * @return     None
+	*/
+	IMPORT_C void Close();
+	
+		
+	/**
+	* Called when DM server calls execute command to
+	* Firmware update object URI ./FUMO/<x>/Download
+	* Initiates a firmware download for the specified update package.
+    * 
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package.
+    * 					Mapped to Mgmt URI ./FUMO/<x> in DM Framework
+	* @param aPkgURL		Contains the URL where the firmware update package
+    *                   or download 
+	*					descriptor is located. This URL is used for 
+    *                    alternative download
+	*					mechanism such as Descriptor Based Download.
+	*					Mgmt URI ./FUMO/<x>/Download/PkgURL
+	* @param aProfileId	ProfileId of the DM server that send the execute 
+    *                   command
+	* @param aPkgName	Name associated with the firmware update package,
+    *                   may be empty
+	* 			        Mgmt URI ./FUMO/<x>/PkgName
+	* @param aPkgVersion	Version information for the firmware update 
+    *                       package,
+    *                       may be empty.
+	*					    Mgmt URI./FUMO/<x>/PkgVersion
+	* @return			Immediate result of the command
+    *                   KErrNotFound: url doesn't exist
+	*/
+	IMPORT_C TInt Download(
+                 const TInt aPkgId
+                ,const TDesC8& aPkgURL
+                ,const TSmlProfileId aProfileId
+                ,const TDesC8& aPkgName
+                ,const TDesC8& aPkgVersion);
+	
+	
+	/**
+	* Called when DM server calls execute command to
+	* Firmware update object URI ./FUMO/<x>/DownloadAndUpdate
+	* Initiates a firmware download and an immediate update for the specified
+    *                   update package.
+    *
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package.
+	*				    Mapped to Mgmt URI ./FUMO/<x> in DM Framework
+	* @param aPkgURL	Contains the URL where the firmware update package or
+    *                   download descriptor is located. This URL is used for 
+    *                   alternative download mechanism such as Descriptor 
+    *                   Based Download.
+    *                   Mgmt URI ./FUMO/<x>/DownloadAndUpdate/PkgURL
+	* @param aProfileId	ProfileId of the DM server that send the execute 
+    *                   command
+	* @param aPkgName	Name associated with the firmware update package,
+    *                   may be empty.
+	*				    Mgmt URI ./FUMO/<x>/PkgName
+	* @param aPkgVersion	Version information for the firmware update 
+    *                       package, may be empty.
+	*				        Mgmt URI./FUMO/<x>/PkgVersion
+	* @return			Immediate result of the command
+	*/
+	IMPORT_C TInt DownloadAndUpdate(
+                    const TInt aPkgId
+                    ,const TDesC8& aPkgURL
+                    ,const TSmlProfileId aProfileId
+                    ,const TDesC8& aPkgName
+                    ,const TDesC8& aPkgVersion);	
+	
 
-    /**
-     * Called when DM server calls execute command to
-     * Firmware update object URI ./FUMO/<x>/Download
-     * Initiates a firmware download for the specified update package.
-     * 
-     * @since   SF4
-     * @param aPkgId		Unique identifier of the update package.
-     * 					Mapped to Mgmt URI ./FUMO/<x> in DM Framework
-     * @param aPkgURL		Contains the URL where the firmware update package
-     *                   or download 
-     *					descriptor is located. This URL is used for 
-     *                    alternative download
-     *					mechanism such as Descriptor Based Download.
-     *					Mgmt URI ./FUMO/<x>/Download/PkgURL
-     * @param aProfileId	ProfileId of the DM server that send the execute 
-     *                   command
-     * @param aPkgName	Name associated with the firmware update package,
-     *                   may be empty
-     * 			        Mgmt URI ./FUMO/<x>/PkgName
-     * @param aPkgVersion	Version information for the firmware update 
-     *                       package,
-     *                       may be empty.
-     *					    Mgmt URI./FUMO/<x>/PkgVersion
-     * @param aSilent   Decides whether the download has to be silent or not					    
-     * @return			Immediate result of the command
-     *                   KErrNotFound: url doesn't exist
-     */
-    IMPORT_C TInt Download(const TInt aPkgId, const TDesC8& aPkgURL,
-            const TSmlProfileId aProfileId, const TDesC8& aPkgName,
-            const TDesC8& aPkgVersion, TBool aSilentDownload = EFalse);
+	/**
+	* Called when DM server calls execute command to
+	* Firmware update object URI ./FUMO/<x>/Update
+	* Initiates a firmware update for the specified update package.
+	* Firmware Update Package should be already downloaded to the device 
+	* either using DM Large Object or OMA OTA download mechanisms.
+    *
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package.
+	* @param aProfileId	ProfileId of the DM server that send the execute 
+    *                   command
+	* @param aPkgName	Name associated with the firmware update package, may
+    *                   be empty.
+	*				    Mgmt URI ./FUMO/<x>/PkgName
+	* @param aPkgVersion	Version information for the firmware update
+    *                       package, may be empty.
+	*				        Mgmt URI./FUMO/<x>/PkgVersion
+	* @return			Immediate result of the command
+	*/
+	IMPORT_C TInt Update(
+                    const TInt aPkgId
+                    ,const TSmlProfileId aProfileId
+                    ,const TDesC8& aPkgName
+                    ,const TDesC8& aPkgVersion);
+	
+	
+	/**
+	* Called when DM server is about to start sending
+	* new firmware update package using DM Large Object download.
+	* This function is used to enquire if there is enough space available
+	* for the firmware update package. 
+	* e.g when DM server is about to start sending new firmware update package using 
+	* DM Large Object download.
+
+    *
+    * @since  Series 60 3.1
+	* @param aSize		Size of the firmware update package. Since 
+    *                   continuation of interrupted downloads is not supported
+    *                   , this means new update package.
+	* @return			ETrue if there is enough space available, EFalse 
+    *                   otherwise
+	*/
+	IMPORT_C TBool IsPackageStoreSizeAvailable( const TInt aSize );
+
+	
+	/**
+    * Opens stream to update package storage.
+    * Call UpdatePackageDownloadComplete when package is completely written.
+    *
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package. Download mgr
+    *                   may use value -1.
+	* @param aPkgStore	On return, open stream in which file may be written 
+    *                   to. 
+	* @return			Immediate result of the command. KErrInUse   store is 
+    *                   already opened
+	*/
+	IMPORT_C TInt OpenUpdatePackageStore( const TInt aPkgId
+                        , RWriteStream*& aPkgStore );
 
-    /**
-     * Called when DM server calls execute command to
-     * Firmware update object URI ./FUMO/<x>/DownloadAndUpdate
-     * Initiates a firmware download and an immediate update for the specified
-     *                   update package.
-     *
-     * @since   SF4
-     * @param aPkgId		Unique identifier of the update package.
-     *				    Mapped to Mgmt URI ./FUMO/<x> in DM Framework
-     * @param aPkgURL	Contains the URL where the firmware update package or
-     *                   download descriptor is located. This URL is used for 
-     *                   alternative download mechanism such as Descriptor 
-     *                   Based Download.
-     *                   Mgmt URI ./FUMO/<x>/DownloadAndUpdate/PkgURL
-     * @param aProfileId	ProfileId of the DM server that send the execute 
-     *                   command
-     * @param aPkgName	Name associated with the firmware update package,
-     *                   may be empty.
-     *				    Mgmt URI ./FUMO/<x>/PkgName
-     * @param aPkgVersion	Version information for the firmware update 
-     *                       package, may be empty.
-     *				        Mgmt URI./FUMO/<x>/PkgVersion
-     * @param aSilent   Decides whether the download has to be silent or not
-     * @return			Immediate result of the command
-     */
-    IMPORT_C TInt DownloadAndUpdate(const TInt aPkgId, const TDesC8& aPkgURL,
-            const TSmlProfileId aProfileId, const TDesC8& aPkgName,
-            const TDesC8& aPkgVersion, TBool aSilentDownload = EFalse);
+	/**
+    * Gets the downloaded and full size of the update package.
+    * Called by Download Manager during resume operation to know the size of partially downloaded package.
+    * @since  Series 60 3.2.2
+	* @param aPkgId		Unique identifier of the update package. 
+	* @param aDownloadedSize	On return, size of the downloaded package in bytes 
+	* @param aTotalSize		On return, full size of the download package in bytes
+	*
+	* @return KErrNone when successful, else System wide errors
+    *
+	*/
+
+	IMPORT_C TInt GetDownloadUpdatePackageSize( const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize );
+
+	/**
+	* Requests to resume the suspended download of the update package.   
+    * Called by Fota Monitory Service. for ex, when network is available again.
+    * @since  Series 60 3.2.2
+	* @param			None
+    *
+	* @return			KErrNone when successful, else System wide errors
+    *
+	*/
+	
+	IMPORT_C TInt TryResumeDownload();
+
+	
+	/**
+	* Call this when download of update package is completed. In case of 
+    * software error or network interruption, this is not called and package 
+    * store is left empty. When this is called, fotaengine closes the stream 
+    * and associated storage.
+    *
+    * @since  Series 60 3.1
+	* @param      aPkgId	Unique identifier of the update package. Download
+    *                       mgr may use value -1.
+    * @return     None
+	*/
+	IMPORT_C void UpdatePackageDownloadComplete( const TInt aPkgId );
+	
+	
+	/**
+	* Called when caller wants to enquire State of specified
+	* firmware update. If the State is unknown to FOTA Engine, then it should
+	* return EIdle.
+    *
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package.
+	* @return			State reached by specified firmware update package 
+	*/	
+	IMPORT_C TState GetState( const TInt aPkgId );
+	
+		
+	/**
+	* Called when caller wants to enquire Final Result Code of specified
+	* firmware update operation. If the update operation is not yet reached 
+    * final stage, then -1 should be returned to the caller. Possible Final 
+    * Result Codes are specified in OMA FUMO Specification. Note that Download
+    * operation also ends to final result code e.g. 202 - Successful Download.
+    *
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package.
+	* @return			Result code as specified in FUMO specification, -1 if 
+    *                   not yet reached final result.
+	*/
+	IMPORT_C TInt GetResult( const TInt aPkgId );
+	
+	
+	/**
+	* Called when DM server deletes firmware update management object
+	* from device's management tree. I.e. Delete to mgmt URI ./FUMO/<x>.
+	* If FOTA Engine has not yet deleted specified update package, then it 
+    * should do so.	
+    *
+    * @since  Series 60 3.1
+	* @param aPkgId		Unique identifier of the update package.
+	* @return			Result code
+	*/
+	IMPORT_C TInt DeleteUpdatePackage( const TInt aPkgId );
+	
 
     /**
-     * Called when DM server calls execute command to
-     * Firmware update object URI ./FUMO/<x>/Update
-     * Initiates a firmware update for the specified update package.
-     * Firmware Update Package should be already downloaded to the device 
-     * either using DM Large Object or OMA OTA download mechanisms.
-     *
-     * @since   SF4
-     * @param aPkgId		Unique identifier of the update package.
-     * @param aProfileId	ProfileId of the DM server that send the execute 
-     *                   command
-     * @param aPkgName	Name associated with the firmware update package, may
-     *                   be empty.
-     *				    Mgmt URI ./FUMO/<x>/PkgName
-     * @param aPkgVersion	Version information for the firmware update
-     *                       package, may be empty.
-     *				        Mgmt URI./FUMO/<x>/PkgVersion
-     * @return			Immediate result of the command
-     */
-    IMPORT_C TInt Update(const TInt aPkgId, const TSmlProfileId aProfileId,
-            const TDesC8& aPkgName, const TDesC8& aPkgVersion);
+    * Retrieves the timestamp of last succesful update.
+    *
+    * @since  Series 60 3.1
+    * @param aUpdate    On return, contains time of last succesfull update
+	* @return			Error code. KErrUnknown if device has never been 
+    *                   updated.
+	*/
+    IMPORT_C TInt LastUpdate( TTime& aUpdate );
 
-    /**
-     * Requests to pause the ongoing download. 
-     *
-     * @since  Symbian 4
-     * @param  None
-     * @return   KErrNone if pause is successful, or any system-wide error.
-     */
-    IMPORT_C TInt PauseDownload();
+	/**
+    * Tells device FW version
+    *
+    * @since  Series 60 3.1
+    * @param aSWVersion On return, contains FW version of device.
+	* @return			Error code
+	*/
+    IMPORT_C TInt CurrentVersion( TDes& aSWVersion );
 
-    /**
-     * Requests to resume the suspended download of the update package.   
-     * Called by Fota Monitory Service. for ex, when network is available again.
-     * @since   3.2.2
-     * @param aSilent   Decides whether the download has to be silent or not
-     *
-     * @return			KErrNone when successful, else System wide errors
-     *
-     */
+	/**
+    * Gets IDs of the present update packages.
+    *
+    * @since  Series 60 3.1
+    * @param aPackageIdList   On return, contains array of pkg ids
+	* @return				  Error code
+	*/
+    IMPORT_C TInt GetUpdatePackageIds( TDes16& aPackageIdList );
 
-    IMPORT_C TInt TryResumeDownload(TBool aSilentDownload = EFalse);
+    IMPORT_C TVersion Version() const;
+
 
-    /**
-     * Called when caller wants to enquire State of specified
-     * firmware update. If the State is unknown to FOTA Engine, then it should
-     * return EIdle.
-     *
-     * @since   SF4
-     * @param aPkgId		Unique identifier of the update package.
-     * @return			State reached by specified firmware update package 
-     */
-    IMPORT_C TState GetState(const TInt aPkgId);
+	/**
+    * Tells fotaserver that generic alert for package is sent. 
+    * When fotaengine session is closed, cleanup for package
+    * is done.
+    *
+    * @since  Series 60 3.1
+	* @param    aPackageId    
+	* @return   Error code
+	*/
+    IMPORT_C void GenericAlertSentL( const TInt aPackageID ) ;
+
 
-    /**
-     * Called when caller wants to enquire Final Result Code of specified
-     * firmware update operation. If the update operation is not yet reached 
-     * final stage, then -1 should be returned to the caller. Possible Final 
-     * Result Codes are specified in OMA FUMO Specification. Note that Download
-     * operation also ends to final result code e.g. 202 - Successful Download.
-     *
-     * @since   SF4
-     * @param aPkgId		Unique identifier of the update package.
-     * @return			Result code as specified in FUMO specification, -1 if 
-     *                   not yet reached final result.
-     */
-    IMPORT_C TInt GetResult(const TInt aPkgId);
+	/**
+	* Like Update, but called by scheduler mechanism. 
+    * Needed package details (profile id etc are already known)
+    *
+    * @since  Series 60 3.2
+	* @param  aSchedule		Schedule data
+	* @return	Error code
+	*/
+	IMPORT_C TInt ScheduledUpdateL( TFotaScheduledUpdate aSchedule );
+
+
+private: // From RApaAppServiceBase
 
-    /**
-     * Called when DM server deletes firmware update management object
-     * from device's management tree. I.e. Delete to mgmt URI ./FUMO/<x>.
-     * If FOTA Engine has not yet deleted specified update package, then it 
-     * should do so.	
-     *
-     * @since   SF4
-     * @param aPkgId		Unique identifier of the update package.
-     * @return			Result code
-     */
-    IMPORT_C TInt DeleteUpdatePackage(const TInt aPkgId);
+	/** Returns the UID of the service that this session provides an 
+    * interface for. Client side service implementations must implement this
+    * function to return the UID for the service that they implement.
+    *
+    * @since  Series 60 3.1
+    * @param  None    
+	* @return The UID of the service implemented by the derived class.
+    */
+    TUid ServiceUid() const;        
 
-    /**
-     * Retrieves the timestamp of last succesful update.
-     *
-     * @since   SF4
-     * @param aUpdate    On return, contains time of last succesfull update
-     * @return			Error code. KErrUnknown if device has never been 
-     *                   updated.
-     */
-    IMPORT_C TInt LastUpdate(TTime& aUpdate);
+    IMPORT_C virtual void ExtensionInterface( 
+                        TUid aInterfaceId
+                        ,TAny*& aImplementation );
+
+private: // New methods
 
     /**
-     * Tells device FW version
-     *
-     * @since   SF4
-     * @param aSWVersion On return, contains FW version of device.
-     * @return			Error code
-     */
-    IMPORT_C TInt CurrentVersion(TDes& aSWVersion);
-
-    /**
-     * Gets IDs of the present update packages.
-     *
-     * @since   SF4
-     * @param aPackageIdList   On return, contains array of pkg ids
-     * @return				  Error code
-     */
-    IMPORT_C TInt GetUpdatePackageIds(TDes16& aPackageIdList);
-
-    /**
-     * Version of the fota server
-     *
-     * @since   SF4
-     * @return  version
-     */
-    IMPORT_C TVersion Version() const;
-
-    /**
-     * Tells fotaserver that generic alert for package is sent. 
-     * When fotaengine session is closed, cleanup for package
-     * is done.
-     *
-     * @since   SF4
-     * @param    aPackageId    
-     * @return   Error code
-     */
-    IMPORT_C void GenericAlertSentL(const TInt aPackageID);
-
-    /**
-     * Like Update, but called by scheduler mechanism. 
-     * Needed package details (profile id etc are already known)
-     *
-     * @since   3.2
-     * @param  aSchedule		Schedule data
-     * @return	Error code
-     */
-    IMPORT_C TInt ScheduledUpdateL(TFotaScheduledUpdate aSchedule);
-
-    /**
-     * Gets the details for current/last firmware update. 
-     *
-     * @since   SF4
-     * @param   aName - name of the firmware
-     * @param   aVersion - version of the firmware
-     * @param   aSize - size of the firmware in bytes
-     * @return, on return all the params would be filled. Can leave with system wide error.
-     */
-    IMPORT_C    void GetCurrentFirmwareDetailsL(TDes8& aName, TDes8& aVersion,
-            TInt& aSize);
-			
-	IMPORT_C TBool IsPackageStoreSizeAvailable(const TInt aSize);
-    
-    
-    IMPORT_C TInt OpenUpdatePackageStore(const TInt aPkgId
-                                                 ,RWriteStream*& aPkgStore);
-    
-    IMPORT_C TInt GetDownloadUpdatePackageSize(const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize);
-    	
-    IMPORT_C void UpdatePackageDownloadComplete(
-                                                          const TInt aPkgId);
-
-private:
-
-    /** Returns the UID of the service that this session provides an 
-     * interface for. Client side service implementations must implement this
-     * function to return the UID for the service that they implement.
-     *
-     * @since  SF4
-     * @param  None    
-     * @return The UID of the service implemented by the derived class.
-     */
-    TUid ServiceUid() const;
-
-
-private:
-
-    /**
-     * Starts fotaserver server application.
-     *
-     * @since SF4
-     * @param aNameUid         Differentiator.
-     * @param aAppServerUid    FotaServer app uid
-     * @return	None
-     **/
-    void StartApplicationL(const TUid& aNameUid, const TUid& aAppServerUid);
+    * Signals the server to read chunk contents
+    *
+    * @since  Series 60 3.1
+    * @param aP1      Pointer to beginning of content
+	* @param aP2      Pointer to end of content
+	* @return		
+    **/
+    void SendChunkL(const TUint8* aP1, const TUint8* aP2);
 
 
     /**
-     * Connects to the server
-     *
-     * @since SF4
-     * @return  KErrNone if successful, otherwise system wide errors
-     **/
-    
-    TBool connectToHbServer();
+    * Signals the server to release chunk handle
+    *
+    * @since  Series 60 3.1
+    * @param    None
+	* @return		
+    **/
+    TInt ReleaseChunkHandle();
+
+    /**
+    * Starts fotaserver server application.
+    *
+    * @since  Series 60 3.1
+	* @param aNameUid         Differentiator.
+    * @param aAppServerUid    FotaServer app uid
+	* @return	None
+    **/
+    void StartApplicationL( const TUid& aNameUid,const TUid& aAppServerUid );
+
+
+    /**
+    * Connects to running fotaserver instance
+    *
+    * @since  Series 60 3.1
+	* @param aNameUid         Differentiator.
+    * @param aAppServerUid    FotaServer app uid
+	* @return		None
+    **/    
+    void ConnectToServerL( const TUid& aNameUid,const TUid& aAppServerUid );
 
 private: // Data
 
+    /**
+     * Stream for writing swupd file to chunk
+     */
+    RFotaWriteStream*  iStream;
 
     /**
+     * Chunk for sending swupd contents to fotaserver
+     */
+    RChunk          iChunk;
+
+    
+    /**
      * If not -1 , indicates that generic alert has been sent for this package
      */
     TInt iGenericAlertSentPkgID;
 
-    };
+	};
+
 
 #endif // __FOTAENGINE_H__
--- a/remotemgmt_plat/fota_engine_api/inc/fotaconst.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/inc/fotaconst.h	Wed Sep 01 12:27:42 2010 +0100
@@ -23,6 +23,7 @@
 // Definition of app server uid and service uid
 #define KFotaServerUid	0x102072C4
 #define KFotaServiceUid	0x102072C5
+#define KStorageIFUid   0x10207384
 #define KDMHostServer1Uid	0x101F9A02
 #define KSosServerUid   0x101f99fb
 #define KOmaDMAppUid    0x101F6DE5
@@ -37,6 +38,9 @@
 const TInt KDefaultSmlTryCount = 4;
 const TInt KMaximumSmlTryCount = 1000;
 
+// Chunk used to transfer swupd
+const TInt  KFotaChunkMinSize = 131072;//128 KB size
+const TInt  KFotaChunkMaxSize = 3000000;
 
 const TInt KFotaMaxPkgURLLength     ( 2048 );
 const TInt KFotaMaxPkgNameLength    ( 80 );
@@ -46,21 +50,6 @@
 const TInt KBmpMargin(21);
 
 _LIT8( KNSmlIAPId,			"NSmlIapId" ); 
-_LIT( KFotaPanic, "FotaServer");
-_LIT(KFotaServerName,"FotaServer");
-_LIT( KFotaServerScem, "FotaServer_10247628");
-
-enum TFotaClient
-    {
-    EUnknown = 0,
-    EDMHostServer = 1,
-    EOMADMAppUi = 2,
-    EFotaScheduler  = 3,
-    EStarter  = 4,
-    EFMSServer = 5,
-    EFotaTestApp = 6,
-    ESoftwareChecker = 7,
-    ESoftwareCheckerBackground = 8
-    };
+_LIT( KFotaPanic, "Download");
 
 #endif
\ No newline at end of file
--- a/remotemgmt_plat/fota_engine_api/tsrc/group/fota_engine_api.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/tsrc/group/fota_engine_api.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -65,4 +65,6 @@
 // DEFFILE ?filename
 // AIF ?filename
 
+SMPSAFE
+
 // End of File
--- a/remotemgmt_plat/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -24,6 +24,7 @@
 #include "../device_management_parameter_api/group/bld.inf"
 #include "../data_synchronization_plugin_api/group/bld.inf"
 #include "../sync_alert_handler_api/group/bld.inf"
+#include "../syncml_notifier_api/group/bld.inf"
 #include "../syncml_client_api/group/bld.inf"
 #include "../device_management_plugin_api/group/bld.inf"
 #include "../dm_tree_apis/group/bld.inf"
@@ -40,14 +41,21 @@
 #include "../dm_constant_definitions_api/group/bld.inf"
 #include "../oma_ds_extensions_api/group/bld.inf"
 #include "../pnpms_utils_api/group/bld.inf"
+#include "../diagnostics_plugin_utility_api/group/bld.inf"
+#include "../diagnostics_plugin_api/group/bld.inf"
+#include "../diagnostics_framework_api/group/bld.inf"
+#include "../diagnostics_results_api/group/bld.inf"
+#include "../diagnostics_plugin_pool_api/group/bld.inf"
 #include "../adaptive_history_list_api/group/bld.inf"
 #include "../adaptive_history_list_session_api/group/bld.inf"
 #include "../fota_engine_api/group/bld.inf"
 #include "../update_package_storage_plugin_api/group/bld.inf"
+#include "../syncml_notifier_roaming_api/group/bld.inf"
+#include "../sync_service_api/group/bld.inf"
 #include "../dcmo_adapter_api/group/bld.inf"
 #include "../dcmo_control_api/group/bld.inf"
 #include "../ds_capability_mgmt_plugin_api/group/bld.inf"
+#include "../dm_native_notifier_api/group/bld.inf"
 #include "../syncml_ds_customization_api/group/bld.inf"
 #include "../syncml_ds_error_reporting_api/group/bld.inf"
-#include "../devicemgmt_dialogs_api/group/bld.inf"
-#include "../dm_device_dialog_api/group/bld.inf"
\ No newline at end of file
+#include "../lawmo_plugin_api/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/lawmo_plugin_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                LAWMO Plugin API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/lawmointerface.h										MW_LAYER_PLATFORM_EXPORT_PATH(lawmointerface.h)
+../inc/lawmointerface.inl									MW_LAYER_PLATFORM_EXPORT_PATH(lawmointerface.inl)
+../inc/lawmocallbackinterface.h									MW_LAYER_PLATFORM_EXPORT_PATH(lawmocallbackinterface.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/lawmo_plugin_api/inc/lawmocallbackinterface.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  LAWMO CallBack Interface definition
+*
+*/
+
+#ifndef _MLAWMOCALLBACKINTERFACE_H__
+#define _MLAWMOCALLBACKINTERFACE_H__
+
+#include <e32base.h>
+
+class MLawmoPluginWipeObserver
+	{
+public:
+
+	/**
+	 * Called to notify the observer that the wipe call has been completed
+	 * by the Plugin at hand.
+	 * @param aSession session
+	 * @param aError   <code>KErrNone</code>, if opening the session succeeded;
+	 *                 or one of the system-wide error codes, if opening the 
+	 *                 session failed
+	 */
+	virtual void HandleWipeCompleted(TInt status)= 0;
+
+    };
+
+#endif  // _MLAWMOCALLBACKINTERFACE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/lawmo_plugin_api/inc/lawmointerface.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  LAWMO Plugin Interface definition
+*
+*/
+
+#ifndef _MLAWMOPLUGININTERFACE_H__
+#define _MLAWMOPLUGININTERFACE_H__
+
+#include <e32base.h>
+#include <ecom/ecom.h>
+#include <lawmocallbackinterface.h>
+
+// UID of this interface
+const TUid KLAWMOPluginInterfaceUid = {0x2002EA1F}; 
+
+/**
+	An LAWMO abstract class being representative of the
+	concrete class which the client wishes to use.
+
+	It acts as a base, for a real class to provide all the 
+	functionality that a client requires.  
+	It supplies instantiation & destruction by using
+	the ECom framework, and functional services
+	by using the methods of the actual class.
+ */
+
+
+class MLAWMOPluginInterface
+	{
+public:
+	
+	virtual void WipeL() = 0;  
+	};
+ 
+class CLAWMOPluginInterface : public CBase, public MLAWMOPluginInterface
+	{
+public:
+	// Instantiates an object of this type	
+	/**
+   * Create instance of CLAWMOPluginInterface
+   * @param aUid , implementation Uid
+   * @return Instance of CLAWMOPluginInterface
+   */
+	static CLAWMOPluginInterface* NewL(TUid aUid, MLawmoPluginWipeObserver* aObserver);
+	/**
+   * C++ Destructor
+   */
+	virtual ~CLAWMOPluginInterface();
+	
+private:
+	// Unique instance identifier key
+	TUid iDtor_ID_Key;
+
+	};
+
+#include "LAWMOInterface.inl"
+
+#endif  // _MLAWMOPLUGININTERFACE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/lawmo_plugin_api/inc/lawmointerface.inl	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  LAWMO Interface 
+*
+*/
+
+/**
+ * C++ Destructor
+ */
+inline CLAWMOPluginInterface::~CLAWMOPluginInterface()
+	{
+	// Destroy any instance variables and then
+	// inform the framework that this specific 
+	// instance of the interface has been destroyed.
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+	
+/**
+ * Create instance of CLAWMOPluginInterface
+ * @param aUid , implementation Uid
+ * @return Instance of CLAWMOPluginInterface
+ */
+inline CLAWMOPluginInterface* CLAWMOPluginInterface::NewL(TUid aUid, MLawmoPluginWipeObserver* aObserver)
+	{		
+		TAny* ptr = REComSession::CreateImplementationL( aUid, _FOFF(CLAWMOPluginInterface, iDtor_ID_Key), aObserver);
+    CLAWMOPluginInterface* self = reinterpret_cast<CLAWMOPluginInterface*>( ptr );
+    return self;
+	}
+//
\ No newline at end of file
--- a/remotemgmt_plat/oma_ds_extensions_api/tsrc/group/ClientAPIAdvanced.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/oma_ds_extensions_api/tsrc/group/ClientAPIAdvanced.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -40,8 +40,15 @@
 USERINCLUDE     ../inc 
 USERINCLUDE     ../../../../inc 
 
-APP_LAYER_SYSTEMINCLUDE
-MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE     /epoc32/include/app
+#if defined(__S60_)
+//    OS_LAYER_SYSTEMINCLUDE
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+//    SYSTEMINCLUDE   /epoc32/include/internal
+//    SYSTEMINCLUDE     /epoc32/include/applications    
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
@@ -60,7 +67,8 @@
 LIBRARY apparc.lib
 LIBRARY cone.lib 
 LIBRARY eikcore.lib  
-
+LIBRARY avkon.lib 
+LIBRARY aknnotify.lib
 
 LANG            SC
 SMPSAFE
--- a/remotemgmt_plat/oma_provisioning_engine_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/oma_provisioning_engine_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -25,9 +25,3 @@
 PRJ_EXPORTS
 
 ../inc/CWPEngine.h     MW_LAYER_PLATFORM_EXPORT_PATH(CWPEngine.h)
-../inc/CWPBootstrap.h     MW_LAYER_PLATFORM_EXPORT_PATH(CWPBootstrap.h)
-../inc/CWPPushMessage.h     MW_LAYER_PLATFORM_EXPORT_PATH(CWPPushMessage.h)
-../inc/MWPPhone.h     MW_LAYER_PLATFORM_EXPORT_PATH(MWPPhone.h)
-../inc/ProvisioningInternalCRKeys.h     MW_LAYER_PLATFORM_EXPORT_PATH(ProvisioningInternalCRKeys.h)
-../inc/WPPhoneFactory.h     MW_LAYER_PLATFORM_EXPORT_PATH(WPPhoneFactory.h)
-../inc/MWPContextManager.h     MW_LAYER_PLATFORM_EXPORT_PATH(MWPContextManager.h)
\ No newline at end of file
--- a/remotemgmt_plat/oma_provisioning_engine_api/inc/CWPBootstrap.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-/*
-* Copyright (c) 2002 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:  CWPBootstrap loads/saves settings.
-*
-*/
-
-
-#ifndef CWPBOOTSTRAP_H
-#define CWPBOOTSTRAP_H
-
-// INCLUDES
-#include "MWPVisitor.h"
-#include <e32base.h>
-#include <etelmm.h>
-
-// FORWARD DECLARATIONS
-class CDesC16Array;
-class CWPPushMessage;
-class CWPEngine;
-
-//  CLASS DEFINITION
-
-/**
-*  Utility class for reading/writing data store.
-*
-*  @lib ProvisioningEngine
-*  @since 2.0
-*/
-class CWPBootstrap : public CBase, private MWPVisitor
-    {
-    public:
-        enum TBootstrapResult 
-            { 
-            // The message does not contain a bootstrap.
-            ENoBootstrap,
-
-            // The message contains a bootstrap, but no authentication
-            ENotAuthenticated,
-
-            // The message contains a bootstrap, and a PIN is required.
-            EPinRequired,
-
-            // The PIN is wrong.
-            EAuthenticationFailed, 
-
-            // Bootstrap already exists
-            EBootstrapExists,
-
-            // Authentication succeeded.
-            ESucceeded
-            };
-
-    public:  // Constructors and destructor
-        
-        /**
-        * Two-phased constructor.
-        * @param aIMSI The SIM card number
-        */
-        IMPORT_C static CWPBootstrap* NewL( 
-            const TDesC& aIMSI );
-
-        /**
-        * Two-phased constructor.
-        * @param aIMSI The SIM card number
-        */
-        static CWPBootstrap* NewLC( 
-            const TDesC& aIMSI );
-
-        /**
-        * Destructor.
-        */
-        ~CWPBootstrap();
-
-    public:
-        /**
-        * Authenticates a message and tries to perform a
-        * bootstrap if the message authenticated. If the 
-        * message has previously been authenticated, only
-        * bootstrap is performed.
-        * @param aMessage The message to authenticate
-        * @param The Provisioning Engine
-        * @param aPIN The PIN. If empty, no PIN is used.
-        * @return Result of bootstrap. If EPinRequired,
-        *         a PIN must be provided.
-        */
-        IMPORT_C TBootstrapResult BootstrapL( 
-            CWPPushMessage& aMessage,
-            CWPEngine& aEngine,
-            const TDesC& aPIN );
-
-        /**
-        * The contents of the ProvURL field.
-        * @return ProvURL
-        */
-        IMPORT_C const TDesC& TPS() const;
-
-    private:    // From MWPVisitor
-        void VisitL(CWPCharacteristic& aCharacteristic);
-        void VisitL(CWPParameter& aParameter);
-        void VisitLinkL(CWPCharacteristic& aCharacteristic );
-
-    private:
-        /**
-        * C++ default constructor.
-        * @param aIMSI The SIM card number
-        */
-        CWPBootstrap( const TDesC& aIMSI );
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-        /**
-        * Performs a bootstrap.
-        * @param aEngine The Provisioning Engine
-        * @return Result of bootstrap.
-        */
-        TBootstrapResult DoBootstrapL( CWPEngine& aEngine );
-
-        /**
-        * Processes bootstrap when the message has to be 
-        * authenticated first.
-        * @param aMessage The message to authenticate
-        * @param aPIN The PIN. If empty, no PIN is used.
-        * @param aEngine The Provisioning Engine
-        * @return Result of bootstrap. If EPinRequired,
-        *         a PIN must be provided.
-        */
-        TBootstrapResult DoAuthenticateL( CWPPushMessage& aMessage,
-            const TDesC& aPIN, 
-            CWPEngine& aEngine );
-
-        /**
-        * Saves the settings.
-        * @param aEngine The Provisioning Engine
-        */
-        void SaveL( CWPEngine& aEngine );
-
-        /**
-        * Loads the settings.
-        * @param aEngine The Provisioning Engine
-        */
-        void LoadL( CWPEngine& aEngine );
-
-        /**
-        * Checks if settings have been loaded.
-        * @return ETrue if settings have been loaded
-        */
-        TBool Loaded() const;
-
-    private:
-
-        /// ETrue if settings have been loaded
-        TBool iLoaded;
-
-        /// The trusted provisioning server. Owns.
-        HBufC* iTPS;
-
-        /// The name of the bootstrap. Owns.
-        HBufC* iName;
-
-        /// The IMSI
-        RMobilePhone::TMobilePhoneSubscriberId iIMSI;
-
-        /// The proxies. Owns.
-        CDesC16Array* iProxies;
-
-        /// The ID of the current characteristic
-        TInt iCurrentChar;
-
-    };
-
-#endif /* CWPBOOTSTRAP_H */
--- a/remotemgmt_plat/oma_provisioning_engine_api/inc/CWPPushMessage.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,422 +0,0 @@
-/*
-* Copyright (c) 2002 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:  CWPPushMessage helps in saving/restoring a push message.
-*
-*/
-
-
-#ifndef CWPPUSHMESSAGE_H
-#define CWPPUSHMESSAGE_H
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class CMsvStore;
-class CHTTPResponse;
-class RWriteStream;
-
-// CONSTANTS
-
-// Authentication result: Authenticated
-const TInt KWPAuthResultAuthenticated = 0;
-
-// Authentication result: PIN required, but not supplied
-const TInt KWPAuthResultPinRequired = 1;
-
-// Authentication result: Authentication failed
-const TInt KWPAuthResultAuthenticationFailed = 2;
-
-// Authentication result: No authentication contained in message
-const TInt KWPAuthResultNoAuthentication = 3;
-
-// Security parameter NETWPIN
-const TUint8 KSECNETWPIN = 0x00;
-
-// Security parameter USERPIN
-const TUint8 KSECUSERPIN = 0x01;
-
-// Security parameter USERNETWPIN
-const TUint8 KSECUSERNETWPIN = 0x02;
-
-// Security parameter USERPINMAC
-const TUint8 KSECUSERPINMAC = 0x03;
-
-// No security parameter
-const TUint8 KSECNONE = 0xff;
-
-
-// CLASS DECLARATION
-
-/**
-*  CWPPushMessage helps in saving/restoring a push message.
-*
-*  @lib ProvisioningEngine
-*  @since 2.0
-*/ 
-class CWPPushMessage : public CBase
-    {
-    public:  // Constructors and destructor
-        
-        /**
-        * Two-phased constructor.
-        */
-        IMPORT_C static CWPPushMessage* NewL();
-
-        /**
-        * Two-phased constructor.
-        */
-        IMPORT_C static CWPPushMessage* NewLC();
-
-        /**
-        * Destructor.
-        */
-        ~CWPPushMessage();
-
-    public: // New methods
-
-        /** 
-        * Stores the message to a message store.
-        * @param aStore The store.
-        */
-        IMPORT_C void StoreL( CMsvStore& aStore ) const;
-
-        /** 
-        * Restores the message from a message store.
-        * @param aStore The store.
-        */
-        IMPORT_C void RestoreL( CMsvStore& aStore );
-
-        /** 
-        * Externalizes the message to a stream.
-        * @param aStream The stream 
-        */
-        IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
-
-        /** 
-        * Internalizes the message from a stream.
-        * @param aStream The stream.
-        */
-        IMPORT_C void InternalizeL( RReadStream& aStream );
-
-        /** 
-        * Sets the message header and body.
-        * @param aHeader The message header
-        * @param aBody The message body
-        */
-        IMPORT_C void SetL( const TDesC8& aHeader, const TDesC8& aBody );
-
-        /** 
-        * Sets the message header and body. Ownership is transferred.
-        * @param aHeader The message header
-        * @param aBody The message body
-        */
-        IMPORT_C void Set( HBufC8* aHeader, HBufC8* aBody );
-
-        /**
-        * Sets the originator of the message. 
-        * @param aOrig Originator of the message
-        */
-        IMPORT_C void SetOriginatorL( const TDesC8& aOrig );
-
-        /** 
-        * Returns the message header.
-        * @return The message header
-        */
-        IMPORT_C const TDesC8& Header() const;
-
-        /** 
-        * Returns the message body.
-        * @return The message body
-        */
-        IMPORT_C const TDesC8& Body() const;
-
-        /**
-        * Returns the originator of the message.
-        * @return The originator
-        */
-        IMPORT_C const TDesC8& Originator() const;
-
-        /**
-        * Sets the authenticated flag.
-        * @param aAuthenticated ETrue to set the message authenticated.
-        */
-        IMPORT_C void SetAuthenticated( TBool aAuthenticated );
-
-        /**
-        * Returns ETrue if the message is authenticated.
-        * @return Whether the message is authenticated.
-        */
-        IMPORT_C TBool Authenticated() const;
-
-        /**
-        * Sets the saved flag.
-        * @param aSaved ETrue to set the message saved.
-        */
-        IMPORT_C void SetSaved( TBool aSaved );
-
-        /**
-        * Returns ETrue if the message is saved.
-        * @return Whether the message is saved.
-        */
-        IMPORT_C TBool Saved() const;
-
-        /**
-        * Returns the initiator URI of the message.
-        * @return Initiator URI
-        */
-        IMPORT_C const TDesC8& InitiatorURI() const;
-
-        /**
-        * Returns the MAC of the message.
-        * @return MAC
-        */
-        IMPORT_C const TDesC8& MAC() const;
-
-        /**
-        * Returns the SEC of the message.
-        * @return SEC
-        */
-        IMPORT_C TUint SEC() const;
-
-        /**
-        * Returns the push flag of the message.
-        * @return Push flag
-        */
-        IMPORT_C TInt PushFlag() const;
-
-        /**
-        * Parse the header.
-        */
-        IMPORT_C void ParseHeaderL();
-
-        /**
-        * Try to authenticate the message with HMAC.
-        * @param aIMSI The SIM card number
-        * @param aPIN The PIN entered by user
-        * @return The result of authentication
-        */
-        IMPORT_C TInt AuthenticateL( const TDesC& aIMSI, const TDesC& aPIN );
-
-    private:
-        /**
-        * C++ default constructor.
-        */
-        CWPPushMessage();
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-    private:
-        /**
-        * Parse the content-type header.
-        * @param aPointer Lexer pointing to content-type header.
-        */
-        void ParseContentType( TLex8& aPointer );
-
-        /**
-        * Parse the content-type header.
-        * @param aPointer Lexer pointing to content-type header.
-        */
-        void ParseInitiatorURI( TLex8& aPointer );
-
-        /**
-        * Parse the content-type header.
-        * @param aPointer Lexer pointing to content-type header.
-        */
-        void ParsePushFlag( TLex8& aPointer );
-
-        /**
-        * Retrieve a Short-integer.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The short integer
-        */
-        TUint GetShortInteger( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Long-integer.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The long integer.
-        */
-        TInt64 GetLongInteger( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Text-string.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The string
-        */
-        TPtrC8 GetTextString( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Text-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The string
-        */
-        TPtrC8 GetTextValue( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Token-text.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The text string
-        */
-        TPtrC8 GetTokenText( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Q-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The integer
-        */
-        TUint GetQValue( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Well-known-charset value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The character set number
-        */
-        TInt64 GetWellKnownCharset( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Version-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The version
-        */
-        TUint GetVersionValue( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Constrained-encoding value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The constrained encoding value
-        */
-        TUint GetConstrainedEncoding( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve an Integer-Value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The integer value
-        */
-        TInt64 GetIntegerValue( TLex8& aPointer ) const;
-
-        /**
-        * Check if lexer points to an Integer-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return ETrue if lexer points to an integer
-        */
-        TBool IsIntegerValue( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Field-name.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return Field name
-        */
-        TUint GetFieldName( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Delta-seconds-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The seconds found
-        */
-        TInt64 GetDeltaSecondsValue( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a No-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        */
-        void GetNoValue( TLex8& aPointer ) const;
-
-        /**
-        * Retrieve a Date-value.
-        * @see Wireless Session Protocol Specification WAP-230-WSP-20010705-a
-        * @param aPointer Lexer pointing to content-type header.
-        * @return The time value
-        */
-        TTime GetDateValue( TLex8& aPointer ) const;
-
-        /**
-        * Skip to content-type.
-        * @return The Content-Type header
-        */
-        TPtrC8 ContentTypeHeader( CHTTPResponse& aResponse ) const;
-
-        /**
-        * Skip to x-wap-initiator-uri.
-        * @return The X-WAP-Initiator-URI header
-        */
-        TPtrC8 InitiatorURIHeader( CHTTPResponse& aResponse ) const;
-
-        /**
-        * Skip to push-flag.
-        * @return The Push-Flag header
-        */
-        TPtrC8 PushFlagHeader( CHTTPResponse& aResponse ) const;
-
-        /**
-        * Converts a HEX ASCII strings to binary.
-        * @param aHex The hex ascii version
-        * @return The binary version
-        */
-        HBufC8* PackLC( const TDesC8& aHex ) const;
-
-        /**
-        * Create a HMAC key from the IMSI.
-        * @param aIMSI The IMSI
-        * @param aKey Space for HMAC key.
-        */
-        void ConvertIMSIL( const TDesC& aIMSI, TPtr8& aKey ) const;
-
-    private: // Data
-        /// The message body. Owns.
-        HBufC8* iBody;
-
-        /// The message header. Owns.
-        CHTTPResponse* iHeader;
-
-        /// The originator of the message. Owns.
-        HBufC8* iOriginator;
-
-        /// Whether the message is authenticated
-        TBool iAuthenticated;
-
-        /// Whether the message is saved
-        TBool iSaved;
-
-        /// The initiator URI
-        TPtrC8 iInitiator;
-
-        /// The security parameter
-        TUint iSEC;
-
-        /// The MAC value. Owns.
-        TPtrC8 iMAC;
-
-        /// The Push Flag
-        TInt iPushFlag;
-    };
-
-#endif /* CWPPUSHMESSAGE_H */
--- a/remotemgmt_plat/oma_provisioning_engine_api/inc/MWPContextManager.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/*
-* Copyright (c) 2002 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:  Context manager interface.
-*
-*/
-
-
-#ifndef MWPCONTEXTMANAGER_H
-#define MWPCONTEXTMANAGER_H
-
-// FORWARD DECLARATIONS
-class HBufC16;
-class MDesC16Array;
-class CDesC16Array;
-class MWPContextExtension;
-class MWPContextExtensionArray;
-class MWPContextObserver;
-
-// CONSTANTS
-const TUint32 KWPMgrUidNoContext = 0xffffffff;
-
-// CLASS DECLARATION
-
-/**
-*  MWPContextManager declares an interface to be implemented by
-*  context managers.
-*
-*  @lib ProvisioningEngine
-*  @since 2.0
- */ 
-class MWPContextManager
-    {
-    public:  // Constructors and destructor
-        /**
-        * Destructor.
-        */
-        virtual ~MWPContextManager() {};
-
-        /**
-        * Called after saving one setting.
-        * @param aExtension Extension interface for the saving adapter
-        * @param aItem Setting number
-        */
-        virtual void SaveL( MWPContextExtension& aExtension, TInt aItem ) = 0;
-
-        /**
-        * Creates a context. Leaves with KErrOverflow if the max. number of contexts
-        * has been reached.
-        * @param aName Name of the context
-        * @param aTPS TPS of the context
-        * @param aProxies Proxies that can be used in the context
-        * @return UID of the new context
-        */
-        virtual TUint32 CreateContextL( const TDesC& aName, const TDesC& aTPS, 
-            const MDesC16Array& aProxies ) = 0;
-
-        /**
-        * Deletes a context.
-        * @param aArray The context extension array
-        * @param aUID UID of the context
-        */
-        virtual void DeleteContextL( MWPContextExtensionArray& aArray, 
-            TUint32 aUid ) = 0;
-
-        /**
-        * Number of contexts available.
-        * @return Array of context uids. Ownership is transferred.
-        */
-        virtual CArrayFix<TUint32>* ContextUidsL() = 0;
-
-        /**
-        * Name of a context.
-        * @param aUid UID of the context.
-        * @return Context name. Ownership is transferred.
-        */
-        virtual HBufC16* ContextNameL( TUint32 aUid ) = 0;
-
-        /**
-        * TPS of a context.
-        * @param aUid UID of the context.
-        * @return TPS. Ownership is transferred.
-        */
-        virtual HBufC16* ContextTPSL( TUint32 aUid ) = 0;
-
-        /**
-        * Trusted proxies of a context.
-        * @param aUid UID of the context.
-        * @return Array of proxies. Ownership is transferred.
-        */
-        virtual CDesC16Array* ContextProxiesL( TUint32 aUid ) = 0;
-
-        /**
-        * Deletes a context data item.
-        * @param aArray The context extension array
-        * @param aUid UID of the context.
-        * @return ETrue if there is more data in the context
-        */
-        virtual TBool DeleteContextDataL( MWPContextExtensionArray& aArray, TUint32 aUid ) = 0;
-
-        /**
-        * Returns the number of context data items. Note that this
-        * count is an approximate and should not be relied on except
-        * for giving user progress feedback. 
-        * @param aUid UID of the context
-        * @return The number of context data items
-        */
-        virtual TInt ContextDataCountL( TUint32 aUid ) = 0;
-
-        /**
-        * Returns the current context.
-        * @return Current context UID
-        */
-        virtual TUint32 CurrentContextL() = 0;
-
-        /**
-        * Sets the current context.
-        * @param aUID The UID of the context
-        */
-        virtual void SetCurrentContextL( TUint32 aUid ) = 0;
-
-        /**
-        * Returns a specific context.
-        * @param aTPS TPS whose context should be looked for
-        * @return The UID of the context
-        */
-        virtual TUint32 ContextL( const TDesC& aTPS ) = 0;
-
-        /**
-        * Checks if a context exists.
-        * @param aUid The UID of the context
-        * @return ETrue if context exists
-        */
-        virtual TBool ContextExistsL( TUint32 aUid ) = 0;
-
-        /**
-        * Checks if a context exists.
-        * @param aTPS The TPS of the context
-        * @return ETrue if context exists
-        */
-        virtual TBool ContextExistsL( const TDesC& aTPS ) = 0;
-
-        /**
-        * Register an observer to context information.
-        * @param aObserver The new observer
-        */
-        virtual void RegisterContextObserverL( 
-            MWPContextObserver* aObserver ) = 0;
-
-        /**
-        * Unregister an observer to context information.
-        * @param aObserver The observer to unregister
-        * @return KErrNone, or an error code
-        */
-        virtual TInt UnregisterContextObserver( 
-            MWPContextObserver* aObserver ) = 0;
-    };
-
-#endif /* MWPCONTEXTMANAGER_H */
--- a/remotemgmt_plat/oma_provisioning_engine_api/inc/MWPPhone.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2002 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:  Phone interface for handler
-*
-*/
-
-
-#ifndef MWPPHONE_H
-#define MWPPHONE_H
-
-// INCLUDES
-#include <e32base.h>
-#include <etelmm.h>
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-
-/**
- * MWPPhone is an interface to telephony functionality.
- *
- * @since 2.0
- * @lib ProvisioningEngine
- */ 
-class MWPPhone
-    {
-    public:
-
-        /**
-        * Returns the IMSI.
-        * @return The IMSI
-        */
-        virtual const RMobilePhone::TMobilePhoneSubscriberId& SubscriberId() const = 0;
-
-        /**
-        * Returns the country code.
-        * @return Country code
-        */
-        virtual const RMobilePhone::TMobilePhoneNetworkCountryCode& Country() const = 0;
-
-        /**
-        * Returns the network id.
-        * @return Network id
-        */ 
-        virtual const RMobilePhone::TMobilePhoneNetworkIdentity& Network() const = 0;
-
-        /**
-        * Empty destructor.
-        */
-        virtual ~MWPPhone() {};
-
-    };
-
-#endif  // MWPPHONE_H
-            
-// End of File
--- a/remotemgmt_plat/oma_provisioning_engine_api/inc/ProvisioningInternalCRKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2004 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:  Provisioning internal Central Repository keys
-*
-*/
-
-
-#ifndef PROVISIONINGINTERNALCRKEYS_H
-#define PROVISIONINGINTERNALCRKEYS_H
-
-#include <e32def.h>
-
-/******************************************************************************
-* Provisioning Variation API
-* Keys under this category are used in defining Provisioning variation.
-*/
-const TUid KCRUidOMAProvisioningLV = {0x101F87AA};
-const TUid KOMAProvAuthenticationLV	= {0x101F87AA};
-
-/**
-* Provisioning Local Variation Flags. Values are defined in ProvisioningVariant.hrh.
-*/
-const TUint32 KOMAProvisioningLVFlag = 0x00000000;
-const TUint32 KOMAProvAuthenticationLVFlag 	= 0x00000001;
-const TUint32 KOMAProvAuthFailMsgHandling = 0x00000002;   
-const TUint32 KOMAProvOriginatorContent =  0x00000003;  
-
-#endif      // PROVISIONINGINTERNALCRKEYS_H
-
-// End of file
--- a/remotemgmt_plat/oma_provisioning_engine_api/inc/WPPhoneFactory.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2002 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:  WPPhoneFactory can be used to create phone interface.
-*
-*/
-
-
-#ifndef WPPHONEFACTORY_H
-#define WPPHONEFACTORY_H
-
-// FORWARD DECLARATIONS
-class MWPPhone;
-
-//  CLASS DEFINITION
-
-/**
-*  Factory class for phone interface.
-*
-*  @lib ProvisioningEngine
-*  @since 2.0
-*/
-class WPPhoneFactory 
-    {
-    public:
-        /**
-        * Creates all adapters and stores them in an array.
-        * @return Array of adapters. Ownership is transferred.
-        */
-        IMPORT_C static MWPPhone* CreateL();
-
-        /**
-        * Creates all adapters and stores them in an array.
-        * @return Array of adapters. Ownership is transferred.
-        */
-        IMPORT_C static MWPPhone* CreateLC();
-    };
-
-#endif /* WPPHONEFACTORY_H*/
\ No newline at end of file
--- a/remotemgmt_plat/oma_provisioning_engine_api/tsrc/group/testengineapis.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/oma_provisioning_engine_api/tsrc/group/testengineapis.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -53,9 +53,13 @@
 USERINCLUDE	. ../../../../omaprovisioning/provisioning/Group ../../../../omaprovisioning/provisioning/provisioningengine/Inc
 MW_LAYER_SYSTEMINCLUDE
 
-SYSTEMINCLUDE 	/epoc32/include/push
-SYSTEMINCLUDE   /epoc32/include/ecom
-
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+    SYSTEMINCLUDE 	/epoc32/include/push
+    SYSTEMINCLUDE   /epoc32/include/ecom
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib EFSRV.LIB
 LIBRARY         stiftestinterface.lib
--- a/remotemgmt_plat/pnpms_utils_api/tsrc/group/TestPnpUtil.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/pnpms_utils_api/tsrc/group/TestPnpUtil.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -35,12 +35,32 @@
 //TARGETPATH      ?target_path
 //DEFFILE         TestPnpUtil.def
 
-
+#ifdef SBSV2
 USERINCLUDE     ../inc 
 
+	#if defined(__S60_)
+	    OSEXT_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/internal
+	#endif // __S60_
 
 SOURCEPATH      ../src
+#else // SBSV2 not defined
+USERINCLUDE     ../inc 
 
+	#if defined(__S60_)
+OSEXT_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/internal
+	#endif // __S60_
+
+APP_LAYER_SYSTEMINCLUDE
+MW_LAYER_SYSTEMINCLUDE
+
+#endif // SBSV2
+APP_LAYER_SYSTEMINCLUDE
 MW_LAYER_SYSTEMINCLUDE
 
 SOURCE          ../src/TestPnpUtil.cpp
--- a/remotemgmt_plat/policy_management_certificate_api/tsrc/group/dmcertapi.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_certificate_api/tsrc/group/dmcertapi.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -41,6 +41,11 @@
 
 LANG            SC
 
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
--- a/remotemgmt_plat/policy_management_certificate_api/tsrc/group/dmcertapiexe.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_certificate_api/tsrc/group/dmcertapiexe.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -36,7 +36,7 @@
 USERINCLUDE   ../inc
 
 SYSTEMINCLUDE  /epoc32/include/ecom
-
+SYSTEMINCLUDE  /epoc32/include
 APP_LAYER_SYSTEMINCLUDE
 
 LIBRARY		euser.lib
--- a/remotemgmt_plat/policy_management_request_api/tsrc/group/TempClient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_request_api/tsrc/group/TempClient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -39,7 +39,8 @@
 
 
 SYSTEMINCLUDE 	/epoc32/include/ecom
-MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include
+APP_LAYER_SYSTEMINCLUDE
 
 
 LIBRARY     euser.lib  
--- a/remotemgmt_plat/policy_management_request_api/tsrc/group/TempServer.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_request_api/tsrc/group/TempServer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -46,6 +46,9 @@
 
 
 SYSTEMINCLUDE  /epoc32/include/ecom
+SYSTEMINCLUDE  /epoc32/include
+APP_LAYER_SYSTEMINCLUDE
+
 MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY       euser.lib
--- a/remotemgmt_plat/policy_management_request_api/tsrc/group/TrustClient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_request_api/tsrc/group/TrustClient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -39,7 +39,8 @@
 
 
 SYSTEMINCLUDE 	/epoc32/include/ecom
-MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include
+APP_LAYER_SYSTEMINCLUDE
 
 
 LIBRARY     euser.lib  
--- a/remotemgmt_plat/policy_management_request_api/tsrc/group/TrustServer.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_request_api/tsrc/group/TrustServer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -46,7 +46,8 @@
 
 
 SYSTEMINCLUDE  /epoc32/include/ecom
-
+SYSTEMINCLUDE  /epoc32/include
+APP_LAYER_SYSTEMINCLUDE
 MW_LAYER_SYSTEMINCLUDE
 
 
--- a/remotemgmt_plat/policy_management_request_api/tsrc/group/policy_management_request_api.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_request_api/tsrc/group/policy_management_request_api.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -46,7 +46,11 @@
 USERINCLUDE     ../inc 
 
 
-MW_LAYER_SYSTEMINCLUDE
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
--- a/remotemgmt_plat/policy_management_request_api/tsrc/group/request_cntxt_api.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/policy_management_request_api/tsrc/group/request_cntxt_api.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -40,7 +40,11 @@
 
 LANG            SC
 
-MW_LAYER_SYSTEMINCLUDE
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
--- a/remotemgmt_plat/scp_server_api/inc/SCPClient.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/inc/SCPClient.h	Wed Sep 01 12:27:42 2010 +0100
@@ -175,6 +175,28 @@
         * <BR><B>Contents of return value:</B> The status code of the operation.        
         */        
         IMPORT_C TInt GetParamValue( TInt aParamID, TDes& aValue ); 
+    
+        enum TSCPButtonConfig
+            {
+            SCP_OK,
+            SCP_OK_CANCEL,
+            SCP_OK_ETEL,
+            SCP_OK_CANCEL_ETEL
+            };            
+        
+        /**
+        * Request the security code from the user.
+        * 
+        */        
+        IMPORT_C TInt SecCodeQuery( RMobilePhone::TMobilePassword& aPassword, 
+                                    TSCPButtonConfig aButtonsShown, 
+                                    TBool aECSSupport,
+                                    TInt aFlags );
+        
+        /**
+        * Prompt the user to change the security code.
+        */        
+        IMPORT_C TInt ChangeCodeRequest(); 
         
         /**
         * Checks the server configuration and reports the status.
@@ -217,130 +239,37 @@
 
 
 	  IMPORT_C TInt SetAutoLockPeriod( TInt aValue );
-	  
-	/**
-	* This function would return if the Lock Code of the device is allowed to be changed at the given moment.
-	*
-	* The outcome of this function would depend on two of the policies enforced at TARM, EPasscodeMinChangeTolerance and
-	* EPasscodeMinChangeInterval. These two policies would determine how often the user is allowed to change the Lock Code
-	* of the device between a specified time interval. If the user has exceeded the maximum number of times he is allowed
-	* to change the Lock Code of the device then this function would return a non-KErrNone status
-	*
-	* @param 	aFailedPolicies: On completion of the call, If the Lock Code is not allowed to be changed at this point in time
-				then this array would contain the two policies (mentioned earlier) that failed.
-
-				The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
-	*
-	*
-	* @return The status, see below
-	* <BR><B>Name of return value:</B> Operation status
-	* <BR><B>Type of return value:</B> TInt
-	* <BR><B>Range of return value:</B> A system wide error code
-	* <BR><B>Contents of return value:</B> The status code of the operation.
-	*
-	*/
-	IMPORT_C TBool IsLockcodeChangeAllowedNow(RArray<TDevicelockPolicies> &aDevicelockPolicies);
+    private: // Methods
 
-	/**
-	* Get values for all the policies that are maintained at the server
-	*
-	* @param aDevicelockPolicies: Upon completion of the call, this array would contain the values
-								for each of the parameter that is maintained at the server. The values can be
-								accessed using the policy ID's as index to the aDevicelockPolicies array
-
-								Ex: aDevicelockPolicies[TDevicelockPolicies :: EDeviceLockMaxlength];
-
-								The policy ID's are available in SCPServerInterface.h
-	*
-	*
-	* @return The status, see below
-	* <BR><B>Name of return value:</B> Operation status
-	* <BR><B>Type of return value:</B> TInt
-	* <BR><B>Range of return value:</B> A system wide error code
-	* <BR><B>Contents of return value:</B> The status code of the operation.
-	*
-	*/
-	IMPORT_C TInt GetPolicies(RArray<TInt>& aDevicelockPolicies);
-
-	/**
-	* Verifies if a new Lock Code is in compliance with the policies enforced at TARM. Ideally this should be invoked
-	*	before a call to StoreLockCode.
-	*
-	* @param 	aNewLockcode: The new Lock Code that is to be verified against TARM policies
-
-				aFailedPolicies: On completion of the call, if the return value is other than KErrNone, this array
-				would contain the policies that were not satisfied by Lock Code provided in aLockCode
+        /**
+        * Request the security code from the user (encapsulates functionalities of SecCodeQuery()).
+        *
+        */
+    	TInt SetSecurityCodeL(RMobilePhone::TMobilePassword& aPassword, TSCPButtonConfig aButtonsShown,
+                             TBool aECSSupport, TInt aFlags, TInt& aResFileSCP, TInt& aResFileSecUi);
 
-				The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
-	*
-	*
-	* @return The status, see below
-	* <BR><B>Name of return value:</B> Operation status
-	* <BR><B>Type of return value:</B> TInt
-	* <BR><B>Range of return value:</B> A system wide error code
-	* <BR><B>Contents of return value:</B> The status code of the operation.
-	*
-	*/
-	IMPORT_C TInt VerifyNewLockcodeAgainstPolicies(TDesC& aNewLockcode, RArray<TDevicelockPolicies>& aFailedPolicies);
-
-	/**
-	* Sets a new device Lock Code
-	*
-	* @param 	aNewLockCode: The new Lock Code that is to be set on the device
-
-				aFailedPolicies: On completion of the call, if the New Lock Code is not compliant with the TARM policies
-				(if the return value is other than KErrNone) this array
-				would contain the policies that were not satisfied by Lock Code provided in aNewLockCode
-
-				The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
-	*
-	*
-	* @return The status, see below
-	* <BR><B>Name of return value:</B> Operation status
-	* <BR><B>Type of return value:</B> TInt
-	* <BR><B>Range of return value:</B> A system wide error code
-	* <BR><B>Contents of return value:</B> The status code of the operation.
-	*
-	*/
-	IMPORT_C TInt StoreLockcode(TDesC& aNewLockcode, TDesC& aOldLockcode, RArray<TDevicelockPolicies>& aFailedPolicies);
-
-	/**
-	* Verifies if the Lock Code enforced on the device is the same as the one mentioned in the argument.
-	*
-	* @param 	aLockCode: The Lock Code that is to be verified against the current device LockCode
-
-			aISACode: The Lock Code enforced through a call to StoreLockCode would hash the New Lock Code before storing
-			at the ISA (RMobilePhone) side.
-
-			On successful completion of a call to VerifyCurrentLockCode, aISACode would return
-			the Hashed code value equivalent to the current Lock Code enforced on the device
-
-			aFailedPolicies: On completion of the call, this array may contain EDeviceLockPasscodeExpiration depending on
-			if the Lock Code is marked as expired due to the current value of the policy at TARM
-
-			The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
-	*
-	*
-	* @return The status, see below
-	* <BR><B>Name of return value:</B> Operation status
-	* <BR><B>Type of return value:</B> TInt
-	* <BR><B>Range of return value:</B> A system wide error code
-	* <BR><B>Contents of return value:</B> The status code of the operation.
-	*
-	*/
-	IMPORT_C TInt VerifyCurrentLockcode(TDesC& aLockcode, RMobilePhone :: TMobilePassword& aISACode,
-		  RArray<TDevicelockPolicies>& aFailedPolicies, TInt aFlags);
-		  
-    private: // Methods
-	
-	
-	    /**
+        /**
+        * Request the new code from the user and try to change the code
+        */         
+        TInt GetNewCodeAndChange( TDes& aOldCode, TInt aMode, TSCPSecCode* aNewDOSCode = NULL, HBufC** aNewCodePptr = NULL );
+    
+        /**
+        * Process the server's response-commands
+        */         
+        void ProcessServerCommandsL( TDes8& aInParams, 
+                                    CSCPParamObject** aOutParams = NULL,
+                                    TBool isNotifierEvent = EFalse );
+        
+        /**
+        * Show UI controls based on server commands
+        */          
+        void ShowUIL( CSCPParamObject& aContext );
+        
+        /**
         * Fetch the limit-values for code length
         */          
         void FetchLimits( TInt& aMin, TInt& aMax );
-		
-        void ReadFailedPoliciesL(TDes8& aFailedPolicyBuf, RArray< TDevicelockPolicies > &aFailedPolicies);
-		
+		void InformAutolockTask();
         TBool isFlagEnabled;        
     };
 
--- a/remotemgmt_plat/scp_server_api/inc/SCPParamObject.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/inc/SCPParamObject.h	Wed Sep 01 12:27:42 2010 +0100
@@ -183,22 +183,8 @@
         * pointer is not supplied a new RFs will be connected.
         */        
         IMPORT_C void ReadFromFileL( TDesC& aFilename, RFs* aRfs = NULL );                 
-
-		/*
-		* Would store details of the policy for which the current context is incompatible
-		*
-		* NOTE: The context could be Lock Code verification, Storing a New Lock Code etc...
-		*/
-        IMPORT_C TInt AddtoFailedPolices( TInt aFailedpolicyID );
-
-        /*
-        * Returns a reference to the array that contains the policies for which the current
-        * context is incompatible
-        *
-        * NOTE: The context could be Lock Code verification, Storing a New Lock Code etc...
-        */
-        IMPORT_C const RArray<TInt>& GetFailedPolices( );
-		
+               
+                
     protected:  // Methods
                         
         // Methods from base classes       
@@ -224,7 +210,6 @@
         RArray<TInt> iParamIDs;
         /** An array containing the pointers to the parameter values */
         RPointerArray<HBufC> iParamValues;
-        RArray<TInt> iFailedPolicyIDs;
     };
 
 #endif      // SCPPARAMOBJECT_H   
--- a/remotemgmt_plat/scp_server_api/inc/SCPServerInterface.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/inc/SCPServerInterface.h	Wed Sep 01 12:27:42 2010 +0100
@@ -49,7 +49,6 @@
 	ESCPServAuthenticateS60 = 40,
 	ESCPServChangeEnhCode,
 	ESCPServCodeChangeQuery,
-	ESCPServValidateLockcode,
 	ESCPServCheckConfig = 50,
 	ESCPApplicationUninstalled = 60,
 	ESCPServUISetAutoLock = 70
@@ -70,56 +69,6 @@
     ESCPCodeChangePolicy
     };
 
-enum TDevicelockPolicies {
-    //Autolock timeout. Values in minutes
-    EDeviceLockAutolockperiod = 0,
-    // Maximum autolock timeout value, Values in minutes
-    EDeviceLockMaxAutolockPeriod,
-    //specifies the minimum lock code length
-    EDeviceLockMinlength,
-    //Allowed maxim lock code length
-    EDeviceLockMaxlength,
-    // 0 = No restriction,
-    //1 = Both upper and lower case letters are required in the password
-    EDeviceLockRequireUpperAndLower,
-    // 0 = No restriction,
-    // 1 = Both characters and numbers are required in the password
-    EDeviceLockRequireCharsAndNumbers,
-    // 0 = No restriction,
-    // 1-4 = A single character cannot be used more than X times in the password
-    EDeviceLockAllowedMaxRepeatedChars,
-    // 0 = No restriction,
-    // 1-X = The new password cannot match the previous X passwords
-    EDeviceLockHistoryBuffer,
-    // 0 = No restriction,
-    // 1-365 = The password expires after X days and must be changed by the user
-    // -1 = password expires immediately
-    EDeviceLockPasscodeExpiration,
-    // The user can change the password only X times before EPasscodeMinChangeInterval //hours have passed (default 0).
-    EDeviceLockMinChangeTolerance,
-    // 0 = No restriction,
-    // 1-1000 = The user cannot change the password more than EPasscodeMinChangeTolerance // times before X hours have passed since the previous change
-    EDeviceLockMinChangeInterval,
-    // disallow the specific string or strings given.
-    EDeviceLockDisallowSpecificStrings,
-    // 0 = No restriction,
-    // 3-100 = The device is "hard" reset after the user has consecutively failed X times // to answer the password query
-    EDeviceLockAllowedMaxAtempts,
-    // 0 = No restriction, 1 = The password cannot contain two consecutive numbers.
-    EDeviceLockConsecutiveNumbers,
-    // 0 = No restriction,
-    // 1-255 = The password should contain at least X number of special characters.
-    EDeviceLockMinSpecialCharacters,
-    // 0 = No restriction,
-    // 1 = Single character repeat not allowed (ex: 222222, aaaaaa etc) are not allowed
-    EDeviceLockSingleCharRepeatNotAllowed,
-    // 0 = No restriction,
-    // 1 = lock code shouldn’t consist of consecutive characters (ex: 12345, abcde etc) are notallowed
-    EDevicelockConsecutiveCharsNotAllowed,
-
-    EDevicelockTotalPolicies
-};
-
 // The version number of this client-server package
 const TUint KSCPServMajorVersionNumber=0;
 const TUint KSCPServMinorVersionNumber=9;
--- a/remotemgmt_plat/scp_server_api/tsrc/group/scp_autolock_exe.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/tsrc/group/scp_autolock_exe.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -49,4 +49,6 @@
 
 LIBRARY		scpclient.lib
 
+SMPSAFE
+
 //end of file
--- a/remotemgmt_plat/scp_server_api/tsrc/group/scp_server_api.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/tsrc/group/scp_server_api.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -42,6 +42,12 @@
 
 LANG            SC
 
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
+
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
 LIBRARY         efsrv.lib 
@@ -50,5 +56,6 @@
 LIBRARY         edbms.lib 
 LIBRARY         charconv.lib
 
+SMPSAFE
 
 // End of File
--- a/remotemgmt_plat/scp_server_api/tsrc/group/scp_terminal_security_exe.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/tsrc/group/scp_terminal_security_exe.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -36,8 +36,8 @@
 USERINCLUDE   ../inc
 
 SYSTEMINCLUDE  /epoc32/include/ecom
-
-MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE  /epoc32/include
+APP_LAYER_SYSTEMINCLUDE
 
 LIBRARY		euser.lib
 LIBRARY		ecom.lib
@@ -47,4 +47,5 @@
 
 LIBRARY		scpclient.lib
 
+SMPSAFE
 // end of file
\ No newline at end of file
--- a/remotemgmt_plat/scp_server_api/tsrc/group/testCSCPParamObject.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/scp_server_api/tsrc/group/testCSCPParamObject.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -53,6 +53,12 @@
 MW_LAYER_SYSTEMINCLUDE
 
 
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+    
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
@@ -84,4 +90,6 @@
 // DEFFILE ?filename
 // AIF ?filename
 
+SMPSAFE
+
 // End of File
--- a/remotemgmt_plat/setting_enforcement_info_api/tsrc/group/TestSettingEnforcementInfo.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/setting_enforcement_info_api/tsrc/group/TestSettingEnforcementInfo.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -59,6 +59,11 @@
 
 USERINCLUDE     ../inc 
 
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                Sync Service API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SyncServiceParams.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncServiceParams.h)
+../inc/SyncServiceConst.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncServiceConst.h)
+../inc/SyncService.rh     MW_LAYER_PLATFORM_EXPORT_PATH(SyncService.rh)
+../inc/SyncService.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncService.h)
+../inc/SyncServiceSession.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncServiceSession.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/inc/SyncService.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,180 @@
+/*
+* 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:  Client-side service implementations
+*
+*/
+
+
+#ifndef SYNCSERVICE_H
+#define SYNCSERVICE_H
+
+#include <AknServerApp.h>
+#include <SyncServiceConst.h>
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <apaidpartner.h>
+#else
+#include <apaid.h>
+#endif
+
+
+struct  TSyncServiceParam
+ 	{
+ 	TUint   iJobId;
+ 	TUint   iProfileId;
+ 	TUint   iServiceId;
+ 	TUint   iSilent;
+ 	};
+ 	
+/**
+*  RSyncService  
+*
+*  Lower level client side service class
+*
+*  @lib syncservice.lib
+*  @since Series 60 3.0
+*/
+class RSyncService : public RAknAppServiceBase
+	{
+	public: 
+		/**
+		* Sends the synchronisation start command to the
+		* server side with parameters aParams
+		*/
+		void StartSyncL( TSyncServiceParam aParam );
+		
+		/**
+		* Sends command that enables or disables the SyncML session
+		* progress notes to the server side.
+		* @param aEnabled Should the progress note be enabled or disabled.
+		*/
+		void EnableProgressNoteL( TBool aEnabled );
+
+	private: // From RApaAppServiceBase
+		/**
+		* Returns the uid of the service
+		*/
+		TUid ServiceUid() const;
+	};
+
+/**
+*  CSyncService  
+*
+*  Higher level client side service class
+*
+*  @lib syncservice.lib
+*  @since Series 60 3.0
+*/
+class CSyncService : public CBase
+	{
+	public:
+
+        /**
+        * Two-phased constructor.
+        */
+		IMPORT_C static CSyncService* NewL( MAknServerAppExitObserver* aObserver,
+		                                    TUint aServiceId );
+		
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncService();
+		
+    public:
+
+		/**
+		* StartSyncL
+		*
+		* @param aParam Parameters for the service so that it
+		*               knows which service command to issue
+        * @return None
+		*/
+    	IMPORT_C TUid StartSyncL( TSyncServiceParam aParam );
+
+		/**
+		* Sends a command to the sync or devman application to
+		* indicate that the progress note should be enabled
+		* or disabled.
+		* @param aEnabled Should the progress not be shown.
+        * @return None
+		*/
+        IMPORT_C void EnableProgressNoteL( TBool aEnabled );
+        
+	private:
+	
+        /**
+        * C++ default constructor.
+        */
+		CSyncService();
+	
+		/**
+		* 2nd phase constructor
+		* First calls Discover to find the right application with aParams.
+		* Then calls iService to connect to right application.
+		* Creates an instance of CApaServerAppExitMonitor		
+		* Creates an instance of CSyncService.
+		* Sets itself as observer for the service.
+		*
+		* @param aObserver  pointer of MAknServerAppExitObserver to be passed to iMonitor
+		* @param aServiceId parameters for the service so that it
+		*                   knows which application to start	
+        * @return None
+		*/
+		void ConstructL(  MAknServerAppExitObserver* aObserver,
+		                  TUint aServiceId );
+
+		/**
+		* DiscoverL
+		* Finds the right application id to be started and returns it.
+		* Connects RApaLsSession and initializes
+		* it with GetServerApps command. Then gets all the services that
+		* implement the service by using GetServiceImplementationsLC. 
+		* Calls TryMatchL for each service and if there's a match,
+		* the appId is returned. If no implementation is found, 0 is returned.
+		*
+		* @param aServiceId parameters for the service so that it
+		*                   knows which application to start	
+        * @return None
+		*/
+    	TUid DiscoverL( TUint aServiceId );
+
+		/**
+		* TryMatchL
+		* Reads the service type information from OpaqueData.
+		* Sets aAppUi as the application id.
+		*
+		* @param aInfo      Application service information.
+        * @param aAppUid    Application Uid
+		* @param aServiceId Parameters for the service so that it
+		*                   knows which application to start
+        * @return Boolean   ETrue if not found, returns EFalse.
+		*/
+    	TBool TryMatchL( const TApaAppServiceInfo aInfo,
+    	                 TUid& aAppUid,
+    	                 TUint aServiceId );
+
+	private:
+		// Lower level client-side service implementation
+		RSyncService 		        iService;
+		// Monitor for checking events from the server side
+		CApaServerAppExitMonitor* 	iMonitor;
+		TSyncServiceParam           iParameters;
+		TUid                        iUid;
+		TUint                       iServiceId;
+	};
+
+#endif  // SYNCSERVICE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/inc/SyncService.rh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* 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: definition of syncservice constants/exported methods
+* 	This is part of remotemgmt_plat.
+*/
+
+
+// Service struct for DM and DS
+// Set  KSyncServiceStart in type
+// (defined in SyncServiceConst.h)
+
+#include <SyncServiceConst.h>
+
+STRUCT SYNC_SERVICE_STRUCT
+	{
+	LONG type = 0;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/inc/SyncServiceConst.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* 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: definition of syncservice constants/exported methods
+* 	This is part of remotemgmt_plat.
+*/
+
+
+#ifndef SYNCSERVICECONST_H
+#define SYNCSERVICECONST_H
+
+// Definition of service
+#define KSyncServiceUid	0x101F8769
+
+// Service types
+#define KDevManServiceStart			1
+#define KDataSyncServiceStart		2
+
+#endif  // SYNCSERVICECONST_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/inc/SyncServiceParams.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* 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: definition of syncservice constants/exported methods
+* 	This is part of remotemgmt_plat.
+*/
+
+
+#ifndef SYNCSERVICEPARAMS_H
+#define SYNCSERVICEPARAMS_H
+
+// INCLUDE FILES
+
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+// CONSTANTS
+const TUid KUidSyncParameterValue = {0x101F8769};
+
+const TInt KSyncServCmdNone = -1;
+const TInt KSyncServCmdStartSync = 1;
+const TInt KSyncServCmdShowProgress = 2;
+
+const TInt KSyncServDisabled    = 0;
+const TInt KSyncServEnabled     = 1;
+
+//_LIT( KDevManServiceName, "101F6DE5_NSmlDMSync" );
+_LIT( KDataSyncServiceName, "101F6DE4_NSmlDSSync" );
+
+/**
+*  TSyncParameters  
+*
+*  @lib syncservice.lib
+*  @since Series 60 3.0
+*/
+class TSyncParameters
+    {
+    public:
+    
+    	/**
+		* TSyncParameters
+		*/
+        inline TSyncParameters();
+
+    	/**
+		* TSyncParameters
+		*/
+        inline TSyncParameters( const TSyncParameters& aParams );
+
+    	/**
+		* ExternalizeL
+		*/
+        inline void ExternalizeL( RWriteStream& aStream ) const;
+
+    	/**
+		* InternalizeL
+		*/
+        inline void InternalizeL( RReadStream& aStream );
+
+    public:
+        TInt    iCommand;
+        TInt    iJobId;
+        TInt    iProfileId;
+        TInt     iSilent;
+    };
+
+// ----------------------------------------------------------------------------
+// TSyncParameters::TSyncParameters
+// ----------------------------------------------------------------------------
+//
+inline TSyncParameters::TSyncParameters()
+:   iCommand( KSyncServCmdNone ),
+    iJobId( 0 ),
+    iProfileId( 0 )
+      ,iSilent(-1)
+    {}
+    
+// ----------------------------------------------------------------------------
+// TSyncParameters::TSyncParameters( aParams )
+// ----------------------------------------------------------------------------
+//
+inline TSyncParameters::TSyncParameters( const TSyncParameters& aParams )
+:   iCommand( aParams.iCommand ),
+    iJobId( aParams.iJobId ),
+    iProfileId( aParams.iProfileId )
+      ,iSilent(aParams.iSilent)
+    {}
+
+// ----------------------------------------------------------------------------
+// TSyncParameters::ExternalizeL
+// ----------------------------------------------------------------------------
+//
+inline void TSyncParameters::ExternalizeL( RWriteStream& aStream ) const
+    {
+    aStream.WriteInt32L( iCommand );
+    aStream.WriteInt32L( iJobId );
+    aStream.WriteInt32L( iProfileId );
+    aStream.WriteInt32L( iSilent );
+    }
+    
+// ----------------------------------------------------------------------------
+// TSyncParameters::InternalizeL
+// ----------------------------------------------------------------------------
+// 
+inline void TSyncParameters::InternalizeL( RReadStream& aStream )
+    {
+    iCommand = aStream.ReadInt32L();
+    iJobId = aStream.ReadInt32L();
+    iProfileId = aStream.ReadInt32L();
+    iSilent = aStream.ReadInt32L();
+    }
+    
+#endif //SYNCSERVICEPARAMS_H
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/inc/SyncServiceSession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* 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: definition of syncservice constants/exported methods
+* 	This is part of remotemgmt_plat.
+*/
+
+
+#ifndef SYNCSERVICESESSION_H
+#define SYNCSERVICESESSION_H
+
+#include <eikdoc.h>
+#include <AknServerApp.h>
+
+enum TSyncServiceCmds
+	{
+	ESyncServiceCommand = RApaAppServiceBase::KServiceCmdBase
+	};
+
+/**
+*  CSyncServiceSession  
+*
+*  @lib syncservice.lib
+*  @since Series 60 3.0
+*/
+class CSyncServiceSession : public CAknAppServiceBase
+	{
+	public:
+	
+        /**
+        * C++ default constructor.
+        */
+		IMPORT_C CSyncServiceSession( );
+		
+    	/**
+		* C++ Destructor
+		*/
+		virtual ~CSyncServiceSession();
+
+	protected: // from CSession2
+	
+		/**
+		* Just basecalls CAknAppServiceBase
+		*/
+		void CreateL();
+		
+		/**
+		* Checks the function from aMessage. If it is
+		* ESyncServiceStart -> calls
+		* OpenEmbedded. Otherwise basecalls CAknAppServiceBase.
+		* @param aMessage 
+		* @return None
+		*/
+		void ServiceL( const RMessage2& aMessage );
+		
+		/**
+		* Basecalls CAknAppServiceBase.
+		* @param aMessage 
+		* @param aError
+		* @return None
+		*/
+		void ServiceError( const RMessage2& aMessage, TInt aError );
+
+	private:
+		
+		/**
+		* Constructs TSyncParameters from aMessage
+		* Externalizes the params to store and restore
+		* CEikDocument from there (ie. starts DS DM sync observing).
+		* Completes aMessage.
+		* @param aMessage 
+		* @return None
+		*/
+		void OpenEmbeddedL( const RMessage2& aMessage );
+
+	private:
+		CEikDocument* iDoc;
+	};
+
+#endif //SYNCSERVICESESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/sync_service_api/sync_service_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="e5a64242af42471e95f4887343931055" dataversion="1.0">
+  <name>Sync Service API</name>
+  <description>This API is used to send a start command to the corresponding application server (either DS or DM). Also a request to enbale/disable a progress note can be sent.</description>
+  <type>c++</type>
+  <subsystem>omads</subsystem>
+  <libs>
+    <lib name="syncservice.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/remotemgmt_plat/syncml_client_api/inc/SyncMLErr.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_client_api/inc/SyncMLErr.h	Wed Sep 01 12:27:42 2010 +0100
@@ -121,6 +121,11 @@
 
     const TInt KErrGeneral                              = KErrSyncEngineErrorBase - 94;
 
+    /* Implementation of CMCC PIM v3 begins*/
+    /** Server is full - CMCC PIM v3 specific*/
+    const TInt KErrServerFull                           = KErrSyncEngineErrorBase - 95;
+    /* Implementation of CMCC PIM v3 ends*/
+    
 	/** Base value for push message parser-related errors. */
 	const TInt KErrPushMessageParserErrorBase					= -8451;		// 8451 - 8480
 	/** Push message is too short. */
--- a/remotemgmt_plat/syncml_client_api/tsrc/group/ClientAPI.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_client_api/tsrc/group/ClientAPI.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -44,7 +44,11 @@
 USERINCLUDE     ../inc 
 
 
-MW_LAYER_SYSTEMINCLUDE
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib bafl.lib
 LIBRARY         stiftestinterface.lib
--- a/remotemgmt_plat/syncml_client_api/tsrc/group/TestHistoryLog.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_client_api/tsrc/group/TestHistoryLog.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -45,7 +45,11 @@
 USERINCLUDE ../../../../inc
 USERINCLUDE ../../../../syncmlfw/common/historylog/inc
 
-MW_LAYER_SYSTEMINCLUDE
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+SYSTEMINCLUDE   /epoc32/include 
+#endif
 
 LIBRARY         euser.lib
 LIBRARY         estor.lib
--- a/remotemgmt_plat/syncml_ds_customization_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_ds_customization_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -23,6 +23,4 @@
 
 PRJ_EXPORTS
 
-../inc/nsmloperatordatacrkeys.h			    MW_LAYER_PLATFORM_EXPORT_PATH(nsmloperatordatacrkeys.h)
-../inc/nsmldevinfextdatacontainerplugin.h		MW_LAYER_PLATFORM_EXPORT_PATH(nsmldevinfextdatacontainerplugin.h)
-../inc/nsmldevinfextdatacontainerplugin.inl     MW_LAYER_PLATFORM_EXPORT_PATH(nsmldevinfextdatacontainerplugin.inl)
+../inc/NSmlOperatorDataCRKeys.h		MW_LAYER_PLATFORM_EXPORT_PATH(NsmlOperatorDataCRKeys.h)
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_customization_api/inc/NSmlOperatorDataCRKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_ds_customization_api/inc/NSmlOperatorDataCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  SyncML DS customization API CenRep key definitions
+* Description:  SyncMLNotifier Domain CenRep key definitions
 *
 */
 
@@ -75,32 +75,4 @@
  */
 const TUint32 KNsmlOpDsOperatorSyncServerId = 0x00000007;
 
-/**
-* KNsmlOpDsDevInfoManValue
-* Define Man value for operator devinfo
-*
-*/
-const TUint32 KNsmlOpDsDevInfoManValue = 0x00000008;
-
-/**
- * KNsmlOpDsSyncMLStatusCodeList
- * Define list of SyncML status codes for error reporting
- *
- */
-const TUint32 KNsmlOpDsSyncMLStatusCodeList = 0x00000009;
-
-/**
- * KNsmlOpDsHttpErrorReporting
- * Define if HTTP status codes are reported
- *
- */
-const TUint32 KNsmlOpDsHttpErrorReporting = 0x0000000A;
-
-/**
- * KNsmlOpDsSyncMLErrorReporting
- * Define if SyncML status codes are reported
- *
- */
-const TUint32 KNsmlOpDsSyncMLErrorReporting = 0x0000000B;
-
 #endif //NSMLOPERATORDATACRKEYS_H
--- a/remotemgmt_plat/syncml_ds_customization_api/inc/nsmldevinfextdatacontainerplugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* 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:  Device Info Extension Data Container Plugin header file.
-*
-*/
-
-#ifndef __NSMLDEVINFEXTDATACONTAINERPLUGIN_H__
-#define __NSMLDEVINFEXTDATACONTAINERPLUGIN_H__
-
-
-//  EXTERNAL INCLUDES
-#include <e32base.h>
-#include <ecom/ecom.h>
-#include <ecom/ecomresolverparams.h>
-
-// CONSTANTS
-const TUid KExtDataContainerInterfaceUid = { 0x2002DC7C };
-
-//  CLASS DEFINITION
-/**
- * Interface definition for Device Info Extension Data Container plugin
- */
-class CNSmlDevInfExtDataContainerPlugin : public CBase
-    {
-    
-    public:  // Constructor & Destructor
-
-        /**
-         * Destructor
-         */
-        virtual ~CNSmlDevInfExtDataContainerPlugin();
-
-        /**
-         * Constructor for plugin instantiation
-         */
-        static CNSmlDevInfExtDataContainerPlugin* NewL();
-
-    public:  //  Pure virtual methods to be implemented by the actual plugins
-        /**
-         * Resolve number of device info extensions <Ext>
-         *
-         * @return Number of extensions
-         */
-        virtual TInt GetExtensionCountL() = 0;
-
-        /**
-         * Resolve name <XNam> of the extension in the given extension index. 
-         * The number of extensions supported can be deduced using 
-         * GetExtensionCountL() method. If the method is called with an index
-         * out of range (i.e. negative value or value greater than/equal to 
-         * the value returned by GetExtensionCountL()), the method should
-         * leave with KErrArgument.
-         * 
-         * Note that any extension has one <XNam> field.
-         *
-         * @param aExtIndex Index of the extension to be returned.
-         * @return Name of the extension
-         */
-        virtual const TDesC8& GetExtNameL( TInt aExtIndex ) = 0;
-
-        /**
-         * Resolve number of values related to particular extension. If the 
-         * method is called with an index out of range (i.e. negative value 
-         * or value greater than/equal to the value returned by 
-         * GetExtensionCountL()), the method should leave with KErrArgument.
-         *
-         * Note that any extension can have 0...n number of values
-         *
-         * @param aExtIndex Index of an extension
-         * @return Number of available values
-         */
-        virtual TInt GetExtValueCountL( TInt aExtIndex ) = 0;
-
-        /**
-         * Resolve <XVal> field of an extension. If the method is called 
-         * with illegal index values (i.e. negative value or with non-existent
-         * index), the method should leave with KErrArgument.
-         *
-         * @param aExtIndex Index of an extension
-         * @param aValueIndex Index of a value related to particular extension
-         * @return Value on textual format
-         */
-        virtual const TDesC8& GetExtValueL( 
-            TInt aExtIndex, TInt aValueIndex ) = 0;
-
-    private:
-        TUid iDtor_ID_Key;  // Instance identifier key
-    };
-
-#include "nsmldevinfextdatacontainerplugin.inl" // Base implementations for ECOM
-
-#endif // __NSMLDEVINFEXTDATACONTAINERPLUGIN_H__
--- a/remotemgmt_plat/syncml_ds_customization_api/inc/nsmldevinfextdatacontainerplugin.inl	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* 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:  Inline methods for ECom plugin use.
-*
-*/
-
-inline CNSmlDevInfExtDataContainerPlugin::~CNSmlDevInfExtDataContainerPlugin()
-    {
-    // Inform the ECOM framework that this specific instance of the
-    // interface has been destroyed.
-    REComSession::DestroyedImplementation( iDtor_ID_Key );
-    }
-    
-inline CNSmlDevInfExtDataContainerPlugin* CNSmlDevInfExtDataContainerPlugin::NewL()
-    {
-    const TUid KExtDataContainerInterfaceUid = { 0x2002DC7C };
-    TEComResolverParams resolutionParameters;
-    resolutionParameters.SetGenericMatch( ETrue );
-	TAny* interface = REComSession::CreateImplementationL (
-		KExtDataContainerInterfaceUid, 
-        _FOFF( CNSmlDevInfExtDataContainerPlugin, iDtor_ID_Key ),
-        resolutionParameters );
-
-	return reinterpret_cast < CNSmlDevInfExtDataContainerPlugin* > ( interface );
-    }
-
--- a/remotemgmt_plat/syncml_ds_customization_api/syncml_ds_customization_api.metaxml	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" ?>
-<api id="824b33bd67b108d18fe063b94ed85ac5" dataversion="1.0">
-  <name>SyncML DS customization API</name>
-  <description>Definitions of operator settings keys related to data synchronizationk</description>
-  <type>c++</type>
-  <subsystem>syncmlfw</subsystem>
-  <libs>
-  </libs>
-  <release category="platform"/>
-  <attributes>
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
-  </attributes>
-</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/syncml_fw_customization_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="662cbc8c671c947358d5d8e2b145b8af" dataversion="1.0">
+  <name>SyncML FW Customization API</name>
+  <description>Definitions of Operator settings keys related to SyncML framework</description>
+  <type>c++</type>
+  <subsystem>syncmlfw</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/SyncFwCustomizerSettingItemList.uidesign	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,415 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<designerData version="1.1.0">
+  <componentManifest>
+    <manifestEntry id="com.nokia.sdt.series60.CAknView" version="1.2.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.DesignTimeContainer" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CommonBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPane" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.ControlBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPaneTitle" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPaneTitleBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CBA" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CBABase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknSettingItemList" version="1.1.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.ContainerBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CEikEdwin" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CEikEdwinBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.EditorBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CCoeControlBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknIntegerEdwin" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknEnumeratedTextPopupSettingItem" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.EnumeratedTextPopupBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuBar" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuPane" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuItem" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuItemBase" version="1.0.0"/>
+  </componentManifest>
+  <property id="com.nokia.sdt.symbian.dm.RESOURCE_DIRECTORY_ID">data</property>
+  <property id="com.nokia.sdt.component.symbian.version">5.0.0</property>
+  <property id="com.nokia.sdt.component.symbian.vendor">com.nokia.series60</property>
+  <property id="com.nokia.sdt.symbian.dm.COMPONENT_PROVIDER">com.nokia.sdt.component.symbian.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.INCLUDE_DIRECTORY_ID">inc</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCE_DIRECTORY_ID">src</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCEGEN_PROVIDER">com.nokia.sdt.sourcegen.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.BUILD_DIRECTORY_ID">group</property>
+  <component id="com.nokia.sdt.series60.CAknView">
+    <property id="className">CSyncFwCustomizerSettingItemListView</property>
+    <compoundProperty id="location">
+      <property id="x">51</property>
+      <property id="y">44</property>
+    </compoundProperty>
+    <property id="optionsMenu" type="componentRef">optionsMenu</property>
+    <property id="name">SyncFwCustomizerSettingItemListView</property>
+    <compoundProperty id="size">
+      <property id="width">240</property>
+      <property id="height">320</property>
+    </compoundProperty>
+    <component id="com.nokia.sdt.series60.StatusPane">
+      <compoundProperty id="location">
+        <property id="x">20</property>
+      </compoundProperty>
+      <property id="name">statusPane</property>
+      <compoundProperty id="size">
+        <property id="width">204</property>
+        <property id="height">63</property>
+      </compoundProperty>
+      <component id="com.nokia.sdt.series60.StatusPaneTitle">
+        <compoundProperty id="location">
+          <property id="x">56</property>
+        </compoundProperty>
+        <property id="name">title</property>
+        <property id="titleText" type="i18n">STR_SyncFwCustomizerSettingItemListView_5</property>
+        <compoundProperty id="size">
+          <property id="width">148</property>
+          <property id="height">43</property>
+        </compoundProperty>
+        <compoundProperty id="image"/>
+      </component>
+    </component>
+    <component id="com.nokia.sdt.series60.CBA">
+      <compoundProperty id="location">
+        <property id="y">288</property>
+      </compoundProperty>
+      <compoundProperty id="info">
+        <property id="leftText" type="i18n">STR_SyncFwCustomizerSettingItemListView_2</property>
+        <property id="rightText" type="i18n">STR_SyncFwCustomizerSettingItemListView_3</property>
+        <property id="middleText" type="i18n">STR_SyncFwCustomizerSettingItemListView_4</property>
+      </compoundProperty>
+      <property id="name">controlPane</property>
+      <compoundProperty id="size">
+        <property id="width">240</property>
+        <property id="height">32</property>
+      </compoundProperty>
+    </component>
+    <component id="com.nokia.sdt.series60.CAknSettingItemList">
+      <property id="title" type="i18n">STR_SyncFwCustomizerSettingItemListView_1</property>
+      <compoundProperty id="location">
+        <property id="y">66</property>
+      </compoundProperty>
+      <property id="className">CSyncFwCustomizerSettingItemList</property>
+      <property id="name">SyncFwCustomizerSettingItemList</property>
+      <compoundProperty id="size">
+        <property id="width">240</property>
+        <property id="height">222</property>
+      </compoundProperty>
+      <component id="com.nokia.sdt.series60.CEikEdwin">
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+        <compoundProperty id="avkonFlags"/>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">0</property>
+        </compoundProperty>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_9</property>
+        <compoundProperty id="flags"/>
+        <compoundProperty id="allowedCaseModes"/>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_45</property>
+        <property id="name">edit1</property>
+        <property id="text" type="i18n">STR_SyncFwCustomizerSettingItemListView_8</property>
+        <compoundProperty id="allowedInputModes">
+          <property id="EAknEditorKatakanaInputMode">true</property>
+          <property id="EAknEditorFullWidthTextInputMode">true</property>
+          <property id="EAknEditorFullWidthNumericInputMode">true</property>
+          <property id="EAknEditorFullWidthKatakanaInputMode">true</property>
+          <property id="EAknEditorHiraganaKanjiInputMode">true</property>
+          <property id="EAknEditorHalfWidthTextInputMode">true</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CAknIntegerEdwin">
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">54</property>
+        </compoundProperty>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_43</property>
+        <property id="name">syncAdapterEditor</property>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_11</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CAknIntegerEdwin">
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">108</property>
+        </compoundProperty>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_44</property>
+        <property id="name">integerEditor2</property>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_13</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CEikEdwin">
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+        <compoundProperty id="avkonFlags"/>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">162</property>
+        </compoundProperty>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_16</property>
+        <compoundProperty id="flags"/>
+        <compoundProperty id="allowedCaseModes"/>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_47</property>
+        <property id="name">edit2</property>
+        <property id="text" type="i18n">STR_SyncFwCustomizerSettingItemListView_15</property>
+        <compoundProperty id="allowedInputModes">
+          <property id="EAknEditorKatakanaInputMode">true</property>
+          <property id="EAknEditorFullWidthTextInputMode">true</property>
+          <property id="EAknEditorFullWidthNumericInputMode">true</property>
+          <property id="EAknEditorFullWidthKatakanaInputMode">true</property>
+          <property id="EAknEditorHiraganaKanjiInputMode">true</property>
+          <property id="EAknEditorHalfWidthTextInputMode">true</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CEikEdwin">
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+        <compoundProperty id="avkonFlags"/>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">216</property>
+        </compoundProperty>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_19</property>
+        <compoundProperty id="flags"/>
+        <compoundProperty id="allowedCaseModes"/>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_49</property>
+        <property id="name">edit3</property>
+        <property id="text" type="i18n">STR_SyncFwCustomizerSettingItemListView_18</property>
+        <compoundProperty id="allowedInputModes">
+          <property id="EAknEditorKatakanaInputMode">true</property>
+          <property id="EAknEditorFullWidthTextInputMode">true</property>
+          <property id="EAknEditorFullWidthNumericInputMode">true</property>
+          <property id="EAknEditorFullWidthKatakanaInputMode">true</property>
+          <property id="EAknEditorHiraganaKanjiInputMode">true</property>
+          <property id="EAknEditorHalfWidthTextInputMode">true</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CAknEnumeratedTextPopupSettingItem">
+        <sequenceProperty id="items">
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncFwCustomizerSettingItemListView_59</property>
+            <property id="popupText" type="i18n">STR_SyncFwCustomizerSettingItemListView_60</property>
+            <property id="value">0</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncFwCustomizerSettingItemListView_61</property>
+            <property id="popupText" type="i18n">STR_SyncFwCustomizerSettingItemListView_62</property>
+            <property id="value">1</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncFwCustomizerSettingItemListView_63</property>
+            <property id="popupText" type="i18n">STR_SyncFwCustomizerSettingItemListView_64</property>
+            <property id="value">2</property>
+          </compoundElement>
+        </sequenceProperty>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">270</property>
+        </compoundProperty>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_50</property>
+        <property id="name">enumeratedTextPopup1</property>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_23</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CEikEdwin">
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+        <compoundProperty id="avkonFlags"/>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">324</property>
+        </compoundProperty>
+        <property id="itemTitle" type="i18n">STR_SyncFwCustomizerSettingItemListView_26</property>
+        <compoundProperty id="flags"/>
+        <compoundProperty id="allowedCaseModes"/>
+        <property id="itemHint" type="i18n">STR_SyncFwCustomizerSettingItemListView_51</property>
+        <property id="name">edit4</property>
+        <property id="text" type="i18n">STR_SyncFwCustomizerSettingItemListView_25</property>
+        <compoundProperty id="allowedInputModes">
+          <property id="EAknEditorKatakanaInputMode">true</property>
+          <property id="EAknEditorFullWidthTextInputMode">true</property>
+          <property id="EAknEditorFullWidthNumericInputMode">true</property>
+          <property id="EAknEditorFullWidthKatakanaInputMode">true</property>
+          <property id="EAknEditorHiraganaKanjiInputMode">true</property>
+          <property id="EAknEditorHalfWidthTextInputMode">true</property>
+        </compoundProperty>
+      </component>
+    </component>
+    <component id="com.nokia.sdt.series60.MenuBar">
+      <compoundProperty id="location">
+        <property id="x">6</property>
+        <property id="y">221</property>
+      </compoundProperty>
+      <property id="name">optionsMenu</property>
+      <compoundProperty id="size">
+        <property id="height">67</property>
+        <property id="width">228</property>
+      </compoundProperty>
+      <component id="com.nokia.sdt.series60.MenuPane">
+        <compoundProperty id="location"/>
+        <property id="name">menuPane1</property>
+        <compoundProperty id="size">
+          <property id="height">67</property>
+          <property id="width">228</property>
+        </compoundProperty>
+        <component id="com.nokia.sdt.series60.MenuItem">
+          <compoundProperty id="location">
+            <property id="x">5</property>
+            <property id="y">2</property>
+          </compoundProperty>
+          <property id="name">menuItem1</property>
+          <property id="text" type="i18n">STR_SyncFwCustomizerSettingItemListView_7</property>
+          <compoundProperty id="size">
+            <property id="width">213</property>
+            <property id="height">28</property>
+          </compoundProperty>
+          <eventBinding id="selected" handlerDisplay="HandleChangeSelectedSettingItemL" handlerSymbol="cpp@src//SyncFwCustomizerSettingItemListView.cpp/function(CSyncFwCustomizerSettingItemListView::HandleChangeSelectedSettingItemL(TInt))"/>
+        </component>
+        <component id="com.nokia.sdt.series60.MenuItem">
+          <compoundProperty id="location">
+            <property id="x">5</property>
+            <property id="y">32</property>
+          </compoundProperty>
+          <property id="name">resetMenuItem</property>
+          <property id="text" type="i18n">STR_SyncFwCustomizerSettingItemListView_52</property>
+          <compoundProperty id="size">
+            <property id="width">213</property>
+            <property id="height">28</property>
+          </compoundProperty>
+        </component>
+      </component>
+    </component>
+  </component>
+  <stringBundle>
+    <stringTable language="LANG_English">
+      <string id="STR_SyncFwCustomizerSettingItemListView_1">Settings</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_2"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_3"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_4"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_5">SyncFwCustomizer</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_7">Change</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_8"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_9">Operator server URL</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_11">Sync adapter UID</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_13">Profile adapter UID</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_15"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_16">Customized SwV</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_18"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_19">Customized Mod</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_23">Sync profile visibility</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_25"/>
+      <string id="STR_SyncFwCustomizerSettingItemListView_26">Sync server ID</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_43">Defines UID of operator specific sync adapter</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_44">Defines UID of operator specific profile adapter</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_45">Defines URL of the operator specific sync server</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_47">Defines operator customized device info SwV field. Used when synchronizing with operator specific sync server.</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_49">Defines operator customized device info Mod field. Used only when synchronizing with operator specific sync server.</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_50">Defines visibility of operator specific sync profile</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_51">Defined serverId of operator specific sync server</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_52">Reset</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_59">Modifiable</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_60">Allows read and write operator profile details</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_61">Read only</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_62">Allows to read operator specific sync profile details</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_63">Hidden</string>
+      <string id="STR_SyncFwCustomizerSettingItemListView_64">Defines operator specific sync profile as hidden</string>
+    </stringTable>
+  </stringBundle>
+  <macroTable/>
+  <sourceMappingState>
+    <resourceMappings>
+      <resourceMapping instanceName="optionsMenu">r_sync_fw_customizer_setting_item_list_options_menu</resourceMapping>
+      <resourceMapping instanceName="integerEditor2">r_sync_fw_customizer_setting_item_list_integer_editor2_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="title">r_sync_fw_customizer_setting_item_list_title_resource</resourceMapping>
+      <resourceMapping instanceName="syncAdapterEditor" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_sync_adapter_editor_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="edit1">r_sync_fw_customizer_setting_item_list_edit1_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="SyncFwCustomizerSettingItemList">r_sync_fw_customizer_setting_item_list_sync_fw_customizer_setting_item_list</resourceMapping>
+      <resourceMapping instanceName="edit1" rsrcId="text">r_sync_fw_customizer_setting_item_list_edit1</resourceMapping>
+      <resourceMapping instanceName="edit3" rsrcId="text">r_sync_fw_customizer_setting_item_list_edit3</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="setting">r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_setting_texts_resource</resourceMapping>
+      <resourceMapping instanceName="edit2" rsrcId="text">r_sync_fw_customizer_setting_item_list_edit2</resourceMapping>
+      <resourceMapping instanceName="edit4" rsrcId="text">r_sync_fw_customizer_setting_item_list_edit4</resourceMapping>
+      <resourceMapping instanceName="edit4">r_sync_fw_customizer_setting_item_list_edit4_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="edit2">r_sync_fw_customizer_setting_item_list_edit2_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="edit3">r_sync_fw_customizer_setting_item_list_edit3_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="syncAdapterEditor">r_sync_fw_customizer_setting_item_list_sync_adapter_editor_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="popup">r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_popped_up_texts_resource</resourceMapping>
+      <resourceMapping instanceName="menuPane1">r_sync_fw_customizer_setting_item_list_menu_pane1_menu_pane</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1">r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="SyncFwCustomizerSettingItemListView">r_sync_fw_customizer_setting_item_list_sync_fw_customizer_setting_item_list_view</resourceMapping>
+      <resourceMapping instanceName="statusPane">r_sync_fw_customizer_setting_item_list_status_pane</resourceMapping>
+      <resourceMapping instanceName="integerEditor2" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_integer_editor2_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="edit2" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_edit2_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="associated">r_sync_fw_customizer_setting_item_list_enumerated_text_popup1</resourceMapping>
+      <resourceMapping instanceName="edit3" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_edit3_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="edit4" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_edit4_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="edit1" rsrcId="member$setting_page_resource">r_sync_fw_customizer_setting_item_list_edit1_setting_page_resource</resourceMapping>
+    </resourceMappings>
+    <enumMappings>
+      <enumMapping instanceName="enumeratedTextPopup1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewEnumeratedTextPopup1</enumMapping>
+      <enumMapping instanceName="syncAdapterEditor" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewSyncAdapterEditor</enumMapping>
+      <enumMapping instanceName="title" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_STATUS_PANE_ID">EEikStatusPaneUidTitle</enumMapping>
+      <enumMapping instanceName="enumeratedTextPopup1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtPopupSettingList</enumMapping>
+      <enumMapping instanceName="edit3" propertyId="defaultInputMode">EAknEditorTextInputMode</enumMapping>
+      <enumMapping instanceName="edit2" propertyId="defaultInputMode">EAknEditorTextInputMode</enumMapping>
+      <enumMapping instanceName="edit4" propertyId="defaultInputMode">EAknEditorTextInputMode</enumMapping>
+      <enumMapping instanceName="syncAdapterEditor" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtIntegerEdwin</enumMapping>
+      <enumMapping instanceName="edit1" propertyId="defaultInputMode">EAknEditorTextInputMode</enumMapping>
+      <enumMapping instanceName="edit4" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EEikCtEdwin</enumMapping>
+      <enumMapping instanceName="edit3" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EEikCtEdwin</enumMapping>
+      <enumMapping instanceName="edit2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EEikCtEdwin</enumMapping>
+      <enumMapping instanceName="integerEditor2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewIntegerEditor2</enumMapping>
+      <enumMapping instanceName="edit1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EEikCtEdwin</enumMapping>
+      <enumMapping instanceName="edit1" propertyId="numericKeymap">EAknEditorStandardNumberModeKeymap</enumMapping>
+      <enumMapping instanceName="edit4" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewEdit4</enumMapping>
+      <enumMapping instanceName="menuItem1" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncFwCustomizerSettingItemListViewMenuItem1Command</enumMapping>
+      <enumMapping instanceName="SyncFwCustomizerSettingItemListView" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_VIEW_UID">ESyncFwCustomizerSettingItemListViewId</enumMapping>
+      <enumMapping instanceName="edit1" propertyId="defaultCase">EAknEditorTextCase</enumMapping>
+      <enumMapping instanceName="edit2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewEdit2</enumMapping>
+      <enumMapping instanceName="edit3" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewEdit3</enumMapping>
+      <enumMapping instanceName="edit4" propertyId="defaultCase">EAknEditorTextCase</enumMapping>
+      <enumMapping instanceName="edit1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncFwCustomizerSettingItemListViewEdit1</enumMapping>
+      <enumMapping instanceName="integerEditor2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtIntegerEdwin</enumMapping>
+      <enumMapping instanceName="edit2" propertyId="defaultCase">EAknEditorTextCase</enumMapping>
+      <enumMapping instanceName="edit3" propertyId="defaultCase">EAknEditorTextCase</enumMapping>
+      <enumMapping instanceName="resetMenuItem" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncFwCustomizerSettingItemListViewResetMenuItemCommand</enumMapping>
+      <enumMapping instanceName="edit2" propertyId="numericKeymap">EAknEditorStandardNumberModeKeymap</enumMapping>
+      <enumMapping instanceName="edit3" propertyId="numericKeymap">EAknEditorStandardNumberModeKeymap</enumMapping>
+      <enumMapping instanceName="edit4" propertyId="numericKeymap">EAknEditorStandardNumberModeKeymap</enumMapping>
+      <enumMapping instanceName="title" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtTitlePane</enumMapping>
+    </enumMappings>
+    <arrayMappings/>
+  </sourceMappingState>
+  <generatedFiles>
+    <file>src/syncfwcustomizersettingitemlistsettings.cpp</file>
+    <file>src/syncfwcustomizersettingitemlist.cpp</file>
+    <file>inc/syncfwcustomizersettingitemlistview.h</file>
+    <file>inc/syncfwcustomizersettingitemlist.h</file>
+    <file>inc/syncfwcustomizersettingitemlistsettings.h</file>
+    <file>src/syncfwcustomizersettingitemlistview.cpp</file>
+    <file>data/syncfwcustomizer.rss</file>
+    <file>inc/syncfwcustomizer.hrh</file>
+    <file>data/syncfwcustomizersettingitemlist.rssi</file>
+    <file>inc/syncfwcustomizersettingitemlist.hrh</file>
+    <file>data/syncfwcustomizer.loc</file>
+    <file>data/syncfwcustomizer.l01</file>
+    <file>data/syncfwcustomizersettingitemlist.loc</file>
+    <file>data/syncfwcustomizersettingitemlist.l01</file>
+  </generatedFiles>
+</designerData>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/application.uidesign	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<designerData version="1.1.0">
+  <componentManifest>
+    <manifestEntry id="com.nokia.sdt.series60.CAknApplication" version="1.1.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.NonLayoutBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CommonBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknDocument" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknViewAppUi" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknAppUi" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknAppUiBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.DesignTimeContainer" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPane" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.ControlBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPaneCaption" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPaneTitleBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CBA" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CBABase" version="1.0.0"/>
+  </componentManifest>
+  <property id="com.nokia.sdt.symbian.dm.RESOURCE_DIRECTORY_ID">data</property>
+  <property id="com.nokia.sdt.component.symbian.version">5.0.0</property>
+  <property id="com.nokia.sdt.component.symbian.vendor">com.nokia.series60</property>
+  <property id="com.nokia.sdt.symbian.dm.COMPONENT_PROVIDER">com.nokia.sdt.component.symbian.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.INCLUDE_DIRECTORY_ID">inc</property>
+  <property id="com.nokia.sdt.symbian.dm.ROOT_CONTAINER">SyncFwCustomizerAppUi</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCE_DIRECTORY_ID">src</property>
+  <property id="com.nokia.sdt.symbian.dm.ROOT_APPLICATION_NAME">SyncFwCustomizer</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCEGEN_PROVIDER">com.nokia.sdt.sourcegen.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.BUILD_DIRECTORY_ID">group</property>
+  <component id="com.nokia.sdt.series60.CAknApplication">
+    <property id="className">CSyncFwCustomizerApplication</property>
+    <property id="documentBase">SyncFwCustomizer</property>
+    <property id="name">SyncFwCustomizerApplication</property>
+    <property id="uid">0x2001FDF4</property>
+    <component id="com.nokia.sdt.series60.CAknDocument">
+      <property id="className">CSyncFwCustomizerDocument</property>
+      <property id="name">SyncFwCustomizerDocument</property>
+      <component id="com.nokia.sdt.series60.CAknViewAppUi">
+        <property id="className">CSyncFwCustomizerAppUi</property>
+        <compoundProperty id="location">
+          <property id="x">51</property>
+          <property id="y">44</property>
+        </compoundProperty>
+        <property id="name">SyncFwCustomizerAppUi</property>
+        <compoundProperty id="size">
+          <property id="width">240</property>
+          <property id="height">320</property>
+        </compoundProperty>
+        <component id="com.nokia.sdt.series60.StatusPane">
+          <compoundProperty id="location">
+            <property id="x">20</property>
+          </compoundProperty>
+          <property id="name">statusPane</property>
+          <compoundProperty id="size">
+            <property id="width">204</property>
+            <property id="height">63</property>
+          </compoundProperty>
+          <component id="com.nokia.sdt.series60.StatusPaneCaption">
+            <property id="shortCaption" type="i18n">STR_SyncFwCustomizerApplication_5</property>
+            <compoundProperty id="location">
+              <property id="x">56</property>
+            </compoundProperty>
+            <property id="longCaption" type="i18n">STR_SyncFwCustomizerApplication_4</property>
+            <property id="name">caption</property>
+            <compoundProperty id="size">
+              <property id="width">148</property>
+              <property id="height">43</property>
+            </compoundProperty>
+          </component>
+        </component>
+        <component id="com.nokia.sdt.series60.CBA">
+          <compoundProperty id="location">
+            <property id="y">288</property>
+          </compoundProperty>
+          <compoundProperty id="info">
+            <property id="leftText" type="i18n">STR_SyncFwCustomizerApplication_1</property>
+            <property id="rightText" type="i18n">STR_SyncFwCustomizerApplication_2</property>
+            <property id="middleText" type="i18n">STR_SyncFwCustomizerApplication_3</property>
+          </compoundProperty>
+          <property id="name">controlPane</property>
+          <compoundProperty id="size">
+            <property id="width">240</property>
+            <property id="height">32</property>
+          </compoundProperty>
+        </component>
+      </component>
+    </component>
+  </component>
+  <stringBundle>
+    <stringTable language="LANG_English">
+      <string id="STR_SyncFwCustomizerApplication_1"/>
+      <string id="STR_SyncFwCustomizerApplication_2"/>
+      <string id="STR_SyncFwCustomizerApplication_3"/>
+      <string id="STR_SyncFwCustomizerApplication_4">SyncFwCustomizer</string>
+      <string id="STR_SyncFwCustomizerApplication_5">SyncFwCustomizer</string>
+    </stringTable>
+  </stringBundle>
+  <macroTable/>
+  <sourceMappingState>
+    <resourceMappings>
+      <resourceMapping instanceName="SyncFwCustomizerAppUi">r_application_sync_fw_customizer_app_ui</resourceMapping>
+      <resourceMapping instanceName="statusPane">r_application_status_pane</resourceMapping>
+      <resourceMapping instanceName="SyncFwCustomizerAppUi" rsrcId="localisable_app_info">r_localisable_app_info</resourceMapping>
+    </resourceMappings>
+    <enumMappings/>
+    <arrayMappings/>
+  </sourceMappingState>
+  <generatedFiles>
+    <file>inc/syncfwcustomizerapplication.h</file>
+    <file>src/syncfwcustomizerappui.cpp</file>
+    <file>src/syncfwcustomizerdocument.cpp</file>
+    <file>src/syncfwcustomizerapplication.cpp</file>
+    <file>inc/syncfwcustomizerappui.h</file>
+    <file>inc/syncfwcustomizerdocument.h</file>
+    <file>data/syncfwcustomizer.rss</file>
+    <file>inc/syncfwcustomizer.hrh</file>
+    <file>data/syncfwcustomizersettingitemlist.rssi</file>
+    <file>inc/syncfwcustomizersettingitemlist.hrh</file>
+    <file>data/syncfwcustomizer.loc</file>
+    <file>data/syncfwcustomizer.l01</file>
+    <file>data/syncfwcustomizersettingitemlist.loc</file>
+    <file>data/syncfwcustomizersettingitemlist.l01</file>
+  </generatedFiles>
+</designerData>
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/customlistview.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,478 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "customlistview.h"
-#include <hbmenu.h>
-#include <hbaction.h>
-#include <hblistwidgetitem.h>
-#include <hblistwidget.h>
-#include <QAbstractItemModel>
-#include <xqsettingsmanager.h>
-#include <nsmloperatordatacrkeys.h>
-#include <hbinputdialog.h>
-#include <syncmlclient.h>
-#include <syncmlclientds.h>
-#include <hbmessagebox.h>
-#include <centralrepository.h>
-
-CustomListView::CustomListView( QGraphicsItem *parent )
-    : HbView( parent )
-    {
-    setTitle(tr("SyncFwCustomizer"));
-    populateModel();
-    createMenu();
-    }
-
-void CustomListView::editItem()
-    {
-    HbListWidgetItem* item( mWidget->currentItem() );
-    QString text = item->text();
-    QString content = item->secondaryText();
-
-	HbInputDialog *dialog = new HbInputDialog();
-	dialog->setAttribute(Qt::WA_DeleteOnClose, true); 
-	dialog->setPromptText(text);
-	dialog->setPrimaryAction(new HbAction("Ok"));
-	dialog->setSecondaryAction(new HbAction("Cancel"));
-	dialog->setInputMode(HbInputDialog::TextInput);
-	dialog->setValue(content);
-	dialog->open(this, SLOT(handleEditItem(HbAction*)));
-	}
-
-void CustomListView::handleEditItem(HbAction* action)
-    {
-    HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
-    
-    if (dialog && action == dialog->actions().first())
-        {
-        QString text = dialog->value().toString();
-        HbListWidgetItem* item(mWidget->currentItem());
-        item->setSecondaryText(text);
-        mWidget->setCurrentItem(item);
-        saveKeyItems();
-        }
-    }
-
-void CustomListView::saveKeyItems()
-    {
-    QString notDefined = tr("Not defined");
-    XQSettingsManager* manager = new XQSettingsManager( this );
-    XQSettingsKey key1( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsOperatorSyncServerURL );
-    QVariant url = mWidget->item( 0 )->secondaryText();
-    bool err = false;
-    if( url.toString().compare( notDefined ) )
-        {
-        err = manager->writeItemValue( key1, url );
-        }
-    XQSettingsKey key2( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsOperatorAdapterUid );
-    QVariant adapter = mWidget->item( 1 )->secondaryText();
-    if( adapter.toString().compare( notDefined ) )
-        {
-        bool ok;
-        int value = adapter.toString().toInt( &ok, 10 );
-        if( !ok )
-            {
-            value = adapter.toString().toInt( &ok, 16 );
-            }
-        if( ok )
-            {
-            QVariant var( value );
-            err = manager->writeItemValue( key2, var );
-            }
-        }
-    XQSettingsKey key3( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsProfileAdapterUid );
-    QVariant profile = mWidget->item( 2 )->secondaryText();
-    if( profile.toString().compare( notDefined ) )
-        {
-        bool ok;
-        int value = profile.toString().toInt( &ok, 10 );
-        if( !ok )
-            {
-            value = profile.toString().toInt( &ok, 16 );
-            }
-        if( ok )
-            {
-            QVariant var( value );
-            err = manager->writeItemValue( key3, var );
-            }
-        }
-    XQSettingsKey key4( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsDevInfoSwVValue );
-    QVariant swv = mWidget->item( 3 )->secondaryText();
-    if( swv.toString().compare( notDefined ) )
-        {
-        err = manager->writeItemValue( key4, swv.toByteArray() );
-        }
-    XQSettingsKey key5( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsDevInfoModValue );
-    QVariant mod = mWidget->item( 4 )->secondaryText();
-    if( mod.toString().compare(notDefined) )
-        {
-        err = manager->writeItemValue( key5, mod.toByteArray() );
-        }
-    XQSettingsKey key6( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsSyncProfileVisibility );
-    QVariant visibility = mWidget->item( 5 )->secondaryText();
-    if( visibility.toString().compare( notDefined ) )
-        {
-        bool ok;
-        int value = visibility.toString().toInt( &ok, 10 );
-        if( !ok )
-            {
-            value = visibility.toString().toInt( &ok, 16 );
-            }
-        if( ok )
-            {
-            QVariant var( value );
-            err = manager->writeItemValue( key6, var );
-            }
-        }
-    XQSettingsKey key7( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsOperatorSyncServerId );
-    QVariant serverId = mWidget->item( 6 )->secondaryText();
-    if( serverId.toString().compare( notDefined ) )
-        {
-        err = manager->writeItemValue( key7, serverId.toByteArray() );
-        }
-    XQSettingsKey key8( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsSyncMLStatusCodeList );
-    QVariant syncmlStatus = mWidget->item( 7 )->secondaryText();
-    if( syncmlStatus.toString().compare( notDefined ) )
-        {
-        err = manager->writeItemValue( key8, syncmlStatus );
-        }
-    XQSettingsKey key9( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsDevInfoManValue );
-    QVariant man = mWidget->item( 8 )->secondaryText();
-    if( man.toString().compare(notDefined) )
-        {
-        err = manager->writeItemValue( key9, man.toByteArray() );
-        }
-    XQSettingsKey key10( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsHttpErrorReporting );
-    QVariant httpErrorReporting = mWidget->item( 9 )->secondaryText();
-    if( httpErrorReporting.toString().compare( notDefined ) )
-        {
-        bool ok;
-        int value = httpErrorReporting.toString().toInt( &ok, 10 );
-        if( !ok )
-            {
-            value = httpErrorReporting.toString().toInt( &ok, 16 );
-            }
-        if( ok )
-            {
-            QVariant var( value );
-            err = manager->writeItemValue( key10, var );
-            }
-        } 
-    XQSettingsKey key11( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsSyncMLErrorReporting );
-    QVariant syncMLErrorReporting = mWidget->item( 10 )->secondaryText();
-    if( syncMLErrorReporting.toString().compare( notDefined ) )
-        {
-        bool ok;
-        int value = syncMLErrorReporting.toString().toInt( &ok, 10 );
-        if( !ok )
-            {
-            value = syncMLErrorReporting.toString().toInt( &ok, 16 );
-            }
-        if( ok )
-            {
-            QVariant var( value );
-            err = manager->writeItemValue( key11, var );
-            }
-        }
-    delete manager;
-    }
-
-void CustomListView::syncNow()
-    {
-    HbInputDialog *dialog = new HbInputDialog();
-    dialog->setAttribute(Qt::WA_DeleteOnClose, true); 
-    dialog->setPromptText(tr("Profile ID"));
-    dialog->setPrimaryAction(new HbAction("Ok"));
-    dialog->setSecondaryAction(new HbAction("Cancel"));
-    dialog->setInputMode(HbInputDialog::TextInput);
-    dialog->open(this, SLOT(startSync(HbAction*)));
-    }
-
-void CustomListView::startSync(HbAction* action)
-    {
-    HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
-        
-    if (dialog && action == dialog->actions().first())
-        {
-        QString text = dialog->value().toString();
-        bool ok = false;
-        int profileId = text.toInt(&ok, 10);
-        if (ok)
-            {
-            // Open syncML session
-            RSyncMLSession syncMLSession;
-            RSyncMLDataSyncJob job;
-            CleanupClosePushL( syncMLSession );
-            CleanupClosePushL( job );
-            syncMLSession.OpenL();
-            
-            // Need instance of data sync class
-            // For creating a data sync job, need to specify id of the profile used for synchronization
-            // If profile selected is PCSuite, it searches for the bluetooth device to sync with
-            
-            job.CreateL( syncMLSession, profileId );
-            // close the job
-            job.Close();
-            // close the syncML session
-            CleanupStack::PopAndDestroy( &job );
-            CleanupStack::PopAndDestroy( &syncMLSession );
-            }
-        }
-    }
-
-void CustomListView::listSyncProfiles()
-    {
-    // Open syncML session
-    RSyncMLSession syncMLSession;
-    syncMLSession.OpenL();
-    CleanupClosePushL( syncMLSession );
-
-    RArray<TSmlProfileId> profiles;
-    // Get the list of available profiles into an array
-    syncMLSession.ListProfilesL( profiles, ESmlDataSync );
-    QString text = NULL;
-    for( TInt i = 0; i < profiles.Count(); i++ )
-        {
-        RSyncMLDataSyncProfile profile;         
-        profile.OpenL( syncMLSession,profiles[i], ESmlOpenReadWrite );
-        CleanupClosePushL( profile );
-        text.append( QString::number( profiles[i] ) );
-        text.append( tr(" ") );
-        QString qname( (QChar*)profile.DisplayName().Ptr(), profile.DisplayName().Length() );
-        text.append( qname );
-        if( profiles.Count() != ( i + 1 ) )
-            {
-            text.append( tr("; ") );
-            }
-        CleanupStack::PopAndDestroy(& profile );      
-        }
-    profiles.Close();
-    HbMessageBox::information(text);
-    CleanupStack::PopAndDestroy( &syncMLSession );    
-    }
-
-void CustomListView::resetItem()
-    {
-    //HbListWidgetItem* item( mWidget->currentItem() );
-    CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
-    rep->Reset( mWidget->currentRow() + 1 );
-    CleanupStack::PopAndDestroy( rep );
-    populateModel();
-    }
-
-void CustomListView::resetAll()
-    {
-    CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
-    rep->Reset();
-    CleanupStack::PopAndDestroy( rep );  
-    populateModel();
-    }
-
-void CustomListView::populateModel()
-    {
-    HbListWidget* widget = new HbListWidget;
-    XQSettingsManager* manager = new XQSettingsManager( this );
-    XQSettingsKey key1( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsOperatorSyncServerURL );
-    QString url = manager->readItemValue( key1, XQSettingsManager::TypeString ).toString();
-    XQSettingsKey key2( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsOperatorAdapterUid );
-    QString adapter = manager->readItemValue( key2, XQSettingsManager::TypeInt ).toString();
-    XQSettingsKey key3( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsProfileAdapterUid );
-    QString profile = manager->readItemValue( key3, XQSettingsManager::TypeInt ).toString();
-    XQSettingsKey key4( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsDevInfoSwVValue );
-    QString swv = manager->readItemValue( key4 ).toString();
-    XQSettingsKey key5( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsDevInfoModValue );
-    QString mod = manager->readItemValue( key5 ).toString();
-    XQSettingsKey key6( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsSyncProfileVisibility );
-    QString visibility = manager->readItemValue( key6, XQSettingsManager::TypeInt ).toString();
-    XQSettingsKey key7( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsOperatorSyncServerId );
-    QString serverId = manager->readItemValue( key7 ).toString();
-    XQSettingsKey key8( XQSettingsKey::TargetCentralRepository, 
-        KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsSyncMLStatusCodeList );
-    QString status = manager->readItemValue( key8, XQSettingsManager::TypeString ).toString();
-    XQSettingsKey key9( XQSettingsKey::TargetCentralRepository, 
-          KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsDevInfoManValue );
-    QString man = manager->readItemValue( key9 ).toString();
-    XQSettingsKey key10( XQSettingsKey::TargetCentralRepository, 
-          KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsHttpErrorReporting );
-    QString httpErrorReporting = manager->readItemValue( key10 ).toString();
-    XQSettingsKey key11( XQSettingsKey::TargetCentralRepository, 
-              KCRUidOperatorDatasyncInternalKeys.iUid, KNsmlOpDsSyncMLErrorReporting );
-    QString syncMLErrorReporting = manager->readItemValue( key11 ).toString();
-    
-    delete manager;
-    HbListWidgetItem* result1 = new HbListWidgetItem();
-    result1->setText( tr("Operator server URL") );
-    if( !url.isEmpty() )
-        {
-        result1->setSecondaryText( url );
-        }
-    else
-        {
-        result1->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result2 = new HbListWidgetItem();
-    result2->setText( tr("Sync adapter UID") );
-    if( !adapter.isEmpty() )
-        {
-        result2->setSecondaryText( adapter );
-        }
-    else
-        {
-        result2->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result3 = new HbListWidgetItem();
-    result3->setText( tr("Profile adapter UID") );
-    if( !profile.isEmpty() )
-        {
-        result3->setSecondaryText( profile );
-        }
-    else
-        {
-        result3->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result4 = new HbListWidgetItem();
-    result4->setText( tr("Customized SwV") );
-    if( !swv.isEmpty() )
-        {
-        result4->setSecondaryText( swv );
-        }
-    else
-        {
-        result4->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result5 = new HbListWidgetItem;
-    result5->setText( tr("Customized Mod") );
-    if( !mod.isEmpty() )
-        {
-        result5->setSecondaryText( mod );
-        }
-    else
-        {
-        result5->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result6 = new HbListWidgetItem;
-    result6->setText( tr("Sync profile visibility") );
-    if( !visibility.isEmpty() )
-        {
-        result6->setSecondaryText( visibility );
-        }
-    else
-        {
-        result6->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result7 = new HbListWidgetItem;
-    result7->setText( tr("Sync server ID") );
-    if( !serverId.isEmpty() )
-        {
-        result7->setSecondaryText( serverId );
-        }
-    else
-        {
-        result7->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result8 = new HbListWidgetItem;
-    result8->setText( tr("SyncML status codes") );
-    if( !status.isEmpty() )
-        {
-        result8->setSecondaryText( status );
-        }
-    else
-        {
-        result8->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result9 = new HbListWidgetItem;
-    result9->setText( tr("Customized Man") );
-    if( !man.isEmpty() )
-        {
-        result9->setSecondaryText( man );
-        }
-    else
-        {
-        result9->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result10 = new HbListWidgetItem;
-    result10->setText( tr("Http error reporting") );
-    if( !httpErrorReporting.isEmpty() )
-        {
-        result10->setSecondaryText( httpErrorReporting );
-        }
-    else
-        {
-        result10->setSecondaryText( tr("Not defined") );
-        }
-    HbListWidgetItem* result11 = new HbListWidgetItem;
-    result11->setText( tr("SyncML error reporting") );
-    if( !syncMLErrorReporting.isEmpty() )
-        {
-        result11->setSecondaryText( syncMLErrorReporting );
-        }
-    else
-        {
-        result11->setSecondaryText( tr("Not defined") );
-        }
-    widget->addItem( result1 );
-    widget->addItem( result2 );
-    widget->addItem( result3 );
-    widget->addItem( result4 );
-    widget->addItem( result5 );
-    widget->addItem( result6 );
-    widget->addItem( result7 );
-    widget->addItem( result8 );
-    widget->addItem( result9 );
-    widget->addItem( result10 );
-    widget->addItem( result11 );
-    
-    connect( widget,
-    SIGNAL( activated(HbListWidgetItem*) ),
-    SLOT( handleItem(HbListWidgetItem*) ) );
-    connect(widget,
-    SIGNAL( longPressed(HbListWidgetItem*, const QPointF&) ),
-    SLOT( editItem()) );
-    mWidget = widget;
-    setWidget( widget );  
-    }
-
-void CustomListView::createMenu()
-    {
-    HbMenu* theMenu = menu();
-    connect( theMenu->addAction( tr("Edit")), SIGNAL( triggered() ), SLOT( editItem() ) );
-    //connect( theMenu->addAction( tr("Save")), SIGNAL( triggered() ), SLOT( saveKeyItems() ) );
-    connect( theMenu->addAction( tr("List profiles")), SIGNAL( triggered() ), SLOT( listSyncProfiles() ) );
-    connect( theMenu->addAction( tr("Sync now")), SIGNAL( triggered() ), SLOT( syncNow() ) );
-    HbMenu* subMenu = theMenu->addMenu(tr("Reset"));
-    connect( subMenu->addAction( tr("Reset item")), SIGNAL( triggered() ), SLOT( resetItem() ) );
-    connect( subMenu->addAction( tr("Reset All")), SIGNAL( triggered() ), SLOT( resetAll() ) );
-    }
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/customlistview.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef CUSTOMLISTVIEW_H_
-#define CUSTOMLISTVIEW_H_
-
-#include <QStringListModel>
-#include <hbview.h>
-
-class HbListWidget;
-
-class CustomListView : public HbView
-{
-    Q_OBJECT
-
-public:
-    CustomListView( QGraphicsItem *parent=0 );  
-    virtual ~CustomListView() {};
-
-public slots:
-    void editItem();
-    void saveKeyItems();
-    void listSyncProfiles();
-    void syncNow();
-    void resetItem();
-    void resetAll();
-    void handleEditItem(HbAction* action);
-    void startSync(HbAction* action);
-
-protected:
-    void populateModel();
-    void createMenu();
-
-protected:
-    HbListWidget* mWidget;
-
-};
-
-#endif /* CUSTOMLISTVIEW_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer.l01	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+// localized strings for language: UK English (01)
+#define STR_SyncFwCustomizerApplication_2 ""
+#define STR_SyncFwCustomizerApplication_3 ""
+#define STR_SyncFwCustomizerApplication_4 "SyncFwCustomizer"
+#define STR_SyncFwCustomizerApplication_5 "SyncFwCustomizer"
+#define STR_SyncFwCustomizerApplication_1 ""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifdef LANGUAGE_01
+#include "SyncFwCustomizer.l01"
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+NAME SYNC
+
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <eikon.rh>
+#include <appinfo.rh>
+#include "SyncFwCustomizer.hrh"
+#include "SyncFwCustomizer.loc"
+
+RESOURCE RSS_SIGNATURE
+	{
+	}
+RESOURCE TBUF
+	{
+	buf = "SyncFwCustomizer";
+	}
+RESOURCE EIK_APP_INFO r_application_sync_fw_customizer_app_ui
+	{
+	cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+	status_pane = r_application_status_pane;
+	}
+RESOURCE STATUS_PANE_APP_MODEL r_application_status_pane
+	{
+	}
+RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
+	{
+	short_caption = STR_SyncFwCustomizerApplication_5;
+	caption_and_icon = CAPTION_AND_ICON_INFO
+		{
+		caption = STR_SyncFwCustomizerApplication_4;
+		number_of_icons = 0;
+		};
+	}
+RESOURCE TBUF r_application_akn_view_reference1
+	{
+	}
+
+#include "SyncFwCustomizerSettingItemList.rssi"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizerSettingItemList.l01	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+// localized strings for language: UK English (01)
+#define STR_SyncFwCustomizerSettingItemListView_1 "Settings"
+#define STR_SyncFwCustomizerSettingItemListView_7 "Change"
+#define STR_SyncFwCustomizerSettingItemListView_2 ""
+#define STR_SyncFwCustomizerSettingItemListView_3 ""
+#define STR_SyncFwCustomizerSettingItemListView_4 ""
+#define STR_SyncFwCustomizerSettingItemListView_5 "SyncFwCustomizer"
+#define STR_SyncFwCustomizerSettingItemListView_43 "Defines UID of operator specific sync adapter"
+#define STR_SyncFwCustomizerSettingItemListView_44 "Defines UID of operator specific profile adapter"
+#define STR_SyncFwCustomizerSettingItemListView_23 "Sync profile visibility"
+#define STR_SyncFwCustomizerSettingItemListView_45 "Defines URL of the operator specific sync server"
+#define STR_SyncFwCustomizerSettingItemListView_25 ""
+#define STR_SyncFwCustomizerSettingItemListView_47 "Defines operator customized device info SwV field. Used when synchronizing with operator specific sync server."
+#define STR_SyncFwCustomizerSettingItemListView_26 "Sync server ID"
+#define STR_SyncFwCustomizerSettingItemListView_49 "Defines operator customized device info Mod field. Used only when synchronizing with operator specific sync server."
+#define STR_SyncFwCustomizerSettingItemListView_50 "Defines visibility of operator specific sync profile"
+#define STR_SyncFwCustomizerSettingItemListView_51 "Defined serverId of operator specific sync server"
+#define STR_SyncFwCustomizerSettingItemListView_52 "Reset"
+#define STR_SyncFwCustomizerSettingItemListView_11 "Sync adapter UID"
+#define STR_SyncFwCustomizerSettingItemListView_13 "Profile adapter UID"
+#define STR_SyncFwCustomizerSettingItemListView_15 ""
+#define STR_SyncFwCustomizerSettingItemListView_16 "Customized SwV"
+#define STR_SyncFwCustomizerSettingItemListView_18 ""
+#define STR_SyncFwCustomizerSettingItemListView_19 "Customized Mod"
+#define STR_SyncFwCustomizerSettingItemListView_8 ""
+#define STR_SyncFwCustomizerSettingItemListView_9 "Operator server URL"
+#define STR_SyncFwCustomizerSettingItemListView_64 "Defines operator specific sync profile as hidden"
+#define STR_SyncFwCustomizerSettingItemListView_59 "Modifiable"
+#define STR_SyncFwCustomizerSettingItemListView_60 "Allows read and write operator profile details"
+#define STR_SyncFwCustomizerSettingItemListView_61 "Read only"
+#define STR_SyncFwCustomizerSettingItemListView_62 "Allows to read operator specific sync profile details"
+#define STR_SyncFwCustomizerSettingItemListView_63 "Hidden"
+#define STR_SyncFwCustomizerSettingItemListView_65 "Sync now"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizerSettingItemList.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifdef LANGUAGE_01
+#include "SyncFwCustomizerSettingItemList.l01"
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizerSettingItemList.rssi	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,311 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "SyncFwCustomizerSettingItemList.hrh"
+#include "SyncFwCustomizerSettingItemList.loc"
+
+RESOURCE AVKON_VIEW r_sync_fw_customizer_setting_item_list_sync_fw_customizer_setting_item_list_view
+	{
+	cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+	menubar = r_sync_fw_customizer_setting_item_list_options_menu;
+	toolbar = 0;
+	}
+RESOURCE MENU_BAR r_sync_fw_customizer_setting_item_list_options_menu
+	{
+	titles =
+		{
+		MENU_TITLE
+			{
+			menu_pane = r_sync_fw_customizer_setting_item_list_menu_pane1_menu_pane;
+			}
+		};
+	}
+RESOURCE MENU_PANE r_sync_fw_customizer_setting_item_list_menu_pane1_menu_pane
+	{
+	items =
+		{
+		MENU_ITEM
+			{
+			command = ESyncFwCustomizerSettingEdit;
+			txt = STR_SyncFwCustomizerSettingItemListView_7;
+			},
+		MENU_ITEM
+			{
+			command = ESyncFwCustomizerSettingReset;
+			txt = STR_SyncFwCustomizerSettingItemListView_52;
+			},
+		MENU_ITEM
+			{
+			command = ESyncFwCustomizerSettingSync;
+			txt = STR_SyncFwCustomizerSettingItemListView_65;
+			}
+		};
+	}
+RESOURCE STATUS_PANE_APP_MODEL r_sync_fw_customizer_setting_item_list_status_pane
+	{
+	panes =
+		{
+		SPANE_PANE
+			{
+			id = EEikStatusPaneUidTitle;
+			type = EAknCtTitlePane;
+			resource = r_sync_fw_customizer_setting_item_list_title_resource;
+			}
+		};
+	}
+RESOURCE TITLE_PANE r_sync_fw_customizer_setting_item_list_title_resource
+	{
+	txt = STR_SyncFwCustomizerSettingItemListView_5;
+	}
+RESOURCE AVKON_SETTING_ITEM_LIST r_sync_fw_customizer_setting_item_list_sync_fw_customizer_setting_item_list
+	{
+	flags = EAknSettingItemNumberedStyle;
+	items =
+		{
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_9;
+			identifier = ESyncFwCustomizerSettingItemListViewEdit1;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_edit1_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_11;
+			identifier = ESyncFwCustomizerSettingItemListViewSyncAdapterEditor;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_sync_adapter_editor_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_13;
+			identifier = ESyncFwCustomizerSettingItemListViewIntegerEditor2;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_integer_editor2_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_16;
+			identifier = ESyncFwCustomizerSettingItemListViewEdit2;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_edit2_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_19;
+			identifier = ESyncFwCustomizerSettingItemListViewEdit3;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_edit3_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_23;
+			identifier = ESyncFwCustomizerSettingItemListViewEnumeratedTextPopup1;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_setting_page_resource;
+			associated_resource = r_sync_fw_customizer_setting_item_list_enumerated_text_popup1;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncFwCustomizerSettingItemListView_26;
+			identifier = ESyncFwCustomizerSettingItemListViewEdit4;
+			setting_page_resource = r_sync_fw_customizer_setting_item_list_edit4_setting_page_resource;
+			}
+		};
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_edit1_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_45;
+	label = STR_SyncFwCustomizerSettingItemListView_9;
+	type = EEikCtEdwin;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_edit1_editor_resource_id;
+	}
+RESOURCE EDWIN r_sync_fw_customizer_setting_item_list_edit1_editor_resource_id
+	{
+	maxlength = 255;
+	default_case = EAknEditorTextCase;
+	allowed_case_modes = EAknEditorAllCaseModes;
+	numeric_keymap = EAknEditorStandardNumberModeKeymap;
+	default_input_mode = EAknEditorTextInputMode;
+	allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_sync_adapter_editor_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_43;
+	label = STR_SyncFwCustomizerSettingItemListView_11;
+	type = EAknCtIntegerEdwin;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_sync_adapter_editor_editor_resource_id;
+	}
+RESOURCE AVKON_INTEGER_EDWIN r_sync_fw_customizer_setting_item_list_sync_adapter_editor_editor_resource_id
+	{
+	unset_value = 0;
+	min = -2147483647;
+	max = 2147483647;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_integer_editor2_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_44;
+	label = STR_SyncFwCustomizerSettingItemListView_13;
+	type = EAknCtIntegerEdwin;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_integer_editor2_editor_resource_id;
+	}
+RESOURCE AVKON_INTEGER_EDWIN r_sync_fw_customizer_setting_item_list_integer_editor2_editor_resource_id
+	{
+	unset_value = 0;
+	min = -2147483647;
+	max = 2147483647;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_edit2_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_47;
+	label = STR_SyncFwCustomizerSettingItemListView_16;
+	type = EEikCtEdwin;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_edit2_editor_resource_id;
+	}
+RESOURCE EDWIN r_sync_fw_customizer_setting_item_list_edit2_editor_resource_id
+	{
+	maxlength = 255;
+	default_case = EAknEditorTextCase;
+	allowed_case_modes = EAknEditorAllCaseModes;
+	numeric_keymap = EAknEditorStandardNumberModeKeymap;
+	default_input_mode = EAknEditorTextInputMode;
+	allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_edit3_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_49;
+	label = STR_SyncFwCustomizerSettingItemListView_19;
+	type = EEikCtEdwin;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_edit3_editor_resource_id;
+	}
+RESOURCE EDWIN r_sync_fw_customizer_setting_item_list_edit3_editor_resource_id
+	{
+	maxlength = 255;
+	default_case = EAknEditorTextCase;
+	allowed_case_modes = EAknEditorAllCaseModes;
+	numeric_keymap = EAknEditorStandardNumberModeKeymap;
+	default_input_mode = EAknEditorTextInputMode;
+	allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_50;
+	label = STR_SyncFwCustomizerSettingItemListView_23;
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_editor_resource_id;
+	}
+RESOURCE POPUP_SETTING_LIST r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_editor_resource_id
+	{
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_sync_fw_customizer_setting_item_list_enumerated_text_popup1
+	{
+	setting_texts_resource = r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_setting_texts_resource;
+	popped_up_texts_resource = r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_popped_up_texts_resource;
+	}
+RESOURCE ARRAY r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_setting_texts_resource
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncFwCustomizerSettingItemListView_59;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncFwCustomizerSettingItemListView_61;
+			value = 1;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncFwCustomizerSettingItemListView_63;
+			value = 2;
+			}
+		};
+}
+RESOURCE ARRAY r_sync_fw_customizer_setting_item_list_enumerated_text_popup1_popped_up_texts_resource
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = STR_SyncFwCustomizerSettingItemListView_59;
+			},
+		LBUF
+			{
+			txt = STR_SyncFwCustomizerSettingItemListView_61;
+			},
+		LBUF
+			{
+			txt = STR_SyncFwCustomizerSettingItemListView_63;
+			}
+		};
+}
+RESOURCE AVKON_SETTING_PAGE r_sync_fw_customizer_setting_item_list_edit4_setting_page_resource
+	{
+	hint_text = STR_SyncFwCustomizerSettingItemListView_51;
+	label = STR_SyncFwCustomizerSettingItemListView_26;
+	type = EEikCtEdwin;
+	editor_resource_id = r_sync_fw_customizer_setting_item_list_edit4_editor_resource_id;
+	}
+RESOURCE EDWIN r_sync_fw_customizer_setting_item_list_edit4_editor_resource_id
+	{
+	maxlength = 255;
+	default_case = EAknEditorTextCase;
+	allowed_case_modes = EAknEditorAllCaseModes;
+	numeric_keymap = EAknEditorStandardNumberModeKeymap;
+	default_input_mode = EAknEditorTextInputMode;
+	allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
+	}
+RESOURCE TBUF r_sync_fw_customizer_setting_item_list_edit1
+	{
+	buf = STR_SyncFwCustomizerSettingItemListView_8;
+	}
+RESOURCE TBUF r_sync_fw_customizer_setting_item_list_edit2
+	{
+	buf = STR_SyncFwCustomizerSettingItemListView_15;
+	}
+RESOURCE TBUF r_sync_fw_customizer_setting_item_list_edit3
+	{
+	buf = STR_SyncFwCustomizerSettingItemListView_18;
+	}
+RESOURCE TBUF r_sync_fw_customizer_setting_item_list_edit4
+	{
+	buf = STR_SyncFwCustomizerSettingItemListView_25;
+	}
+
+//------------------------------------------------------------------------------
+// number query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_sync_fw_customizer_number_query
+    {
+    flags=EAknGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+
+			control = AVKON_DATA_QUERY
+				{ 
+				layout = ENumberLayout;
+				label = "Profile ID:";
+				control = AVKON_INTEGER_EDWIN
+					{
+					min=1;
+					max=100;
+					};
+				};
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer_reg.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+//  LOCALISATION STRINGS
+
+// Caption string for app.
+#define qtn_caption_string "SyncFwCustomizer"
+
+// Short caption string for app.
+#define qtn_short_caption_string "SyncCust"
+
+#define qtn_loc_resource_file_1 "\\resource\\apps\\SyncFwCustomizer"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/data/SyncFwCustomizer_reg.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include "SyncFwCustomizer_reg.loc"
+#include <SyncFwCustomizer.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2001FDF4
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="SyncFwCustomizer";
+	localisable_resource_file =  qtn_loc_resource_file_1;
+	localisable_resource_id = R_LOCALISABLE_APP_INFO;
+
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	}
+
Binary file remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/list_icon.bmp has changed
Binary file remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/list_icon_mask.bmp has changed
Binary file remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/mark_icon.bmp has changed
Binary file remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/mark_icon_mask.bmp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/gfx/qgn_menu_SyncFwCustomizer.svg	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 88 87.999">
+<g>
+<g>
+<g>
+<g>
+<rect fill="none" width="88" height="87.999"/>
+</g>
+</g>
+<g>
+<linearGradient id="XMLID_7_" gradientUnits="userSpaceOnUse" x1="12.3042" y1="18.3799" x2="63.4113" y2="79.287">
+<stop offset="0" style="stop-color:#B3DDFF"/>
+<stop offset="0.8146" style="stop-color:#084296"/>
+<stop offset="1" style="stop-color:#084296"/>
+</linearGradient>
+<path fill="url(#XMLID_7_)" d="M32.135,7.415L14.363,17.432v23.167c0,0,8.926,15.351,10.468,18.001       c-2.386,1.704-15.44,11.03-15.44,11.03l21.613,12.652c0,0,12.907-9.85,14.71-11.226c1.979,1.109,16.231,9.101,16.231,9.101       l16.664-15.132c0,0-14.066-6.929-16.888-8.318c1.467-3.01,10.531-21.604,10.531-21.604l-22.298-9.59       c0,0-1.486,3.173-2.093,4.467c-2.046-0.88-6.573-2.826-6.573-2.826s-3.713,2.463-5.696,3.778       c-0.327-0.744-0.542-1.233-0.657-1.495c0.007-0.824,0.213-23.72,0.213-23.72L32.135,7.415z"/>
+<linearGradient id="XMLID_8_" gradientUnits="userSpaceOnUse" x1="40.8276" y1="52.1914" x2="16.1997" y2="21.1353">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_8_)" points="59.051,57.621 69.536,36.111 50.944,28.115 48.852,32.581 41.493,29.418 34.719,33.911        32.932,29.849 33.117,9.157 16.363,18.601 16.363,40.06 27.476,59.169 13.064,69.463 30.856,79.879 45.546,68.669        61.667,77.708 75.089,65.521 "/>
+<linearGradient id="XMLID_9_" gradientUnits="userSpaceOnUse" x1="60.585" y1="31.876" x2="53.8582" y2="45.1125">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_9_)" points="41.26,48.783 50.944,28.115 69.536,36.111 59.051,57.621 "/>
+<polygon fill="#0046B7" points="16.363,40.06 27.476,59.169 41.26,48.783 32.932,29.849 "/>
+<polygon fill="#3366CC" points="16.363,40.06 16.363,18.601 33.117,9.157 32.932,29.849 "/>
+<polygon fill="#CFECFF" points="26.696,39.23 41.493,29.418 59.523,37.168 45.546,47.954 "/>
+<path fill="#5AA7E0" d="M41.954,55.286"/>
+<polygon fill="#3366CC" points="26.696,39.23 27.476,59.169 45.546,68.669 45.546,47.954 "/>
+<polygon fill="#5AA7E0" points="13.064,69.463 27.476,59.169 45.546,68.669 30.856,79.879 "/>
+<linearGradient id="XMLID_10_" gradientUnits="userSpaceOnUse" x1="29.2085" y1="63.6836" x2="48.7102" y2="56.1976">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="0.0056" style="stop-color:#5AA7E0"/>
+<stop offset="0.85" style="stop-color:#3366CC"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_10_)" points="43.423,46.971 27.476,59.169 45.546,68.669 45.546,47.954 "/>
+<polygon fill="#0046B7" points="45.546,47.954 45.546,68.669 59.051,57.621 59.523,37.168 "/>
+<linearGradient id="XMLID_11_" gradientUnits="userSpaceOnUse" x1="45.3936" y1="59.5186" x2="59.0508" y2="59.5186">
+<stop offset="0" style="stop-color:#0046B7"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_11_)" points="45.394,50.368 45.546,68.669 59.051,57.621 "/>
+<linearGradient id="XMLID_12_" gradientUnits="userSpaceOnUse" x1="60.8945" y1="68.6807" x2="57.2953" y2="58.792">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="0.4101" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_12_)" points="61.667,77.708 45.546,68.669 59.051,57.621 75.089,65.521 "/>
+</g>
+</g>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/group/Icons_aif_scalable_dc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+# ============================================================================
+#  Name	 : Icons_aif_scalable_dc.mk
+#  Part of  : SyncFwCustomizer
+#
+#  Description:
+# 
+# ============================================================================
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=$(EPOCROOT)epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\SyncFwCustomizer_aif.mif
+HEADERDIR=$(EPOCROOT)epoc32\include
+HEADERFILENAME=$(HEADERDIR)\SyncFwCustomizer_aif.mbg
+
+ICONDIR=..\gfx
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN :
+	@echo ...Deleting $(ICONTARGETFILENAME)
+	del /q /f $(ICONTARGETFILENAME)
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : $(ICONTARGETFILENAME)
+
+$(ICONTARGETFILENAME) : $(ICONDIR)\qgn_menu_SyncFwCustomizer.svg
+	mifconv $(ICONTARGETFILENAME) \
+		/H$(HEADERFILENAME) \
+		/c32,8 $(ICONDIR)\qgn_menu_SyncFwCustomizer.svg
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/group/SyncFwCustomizer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <data_caging_paths.hrh>
+//#include <domain/osextensions/platform_paths.hrh>
+#include <bldvariant.hrh>
+
+// set vendor id (from epoc32/include/oem/defaultcaps.hrh)
+VENDORID VID_DEFAULT
+
+APP_LAYER_SYSTEMINCLUDE
+
+CAPABILITY 		All -TCB
+
+TARGET			SyncFwCustomizer.exe
+UID			   0x100039CE 0x2001FDF4
+TARGETTYPE		exe
+EPOCSTACKSIZE	 0x5000
+
+SOURCEPATH		..\src
+
+SOURCE SyncFwCustomizerSettingItemListSettings.cpp 
+SOURCE SyncFwCustomizerSettingItemList.cpp 
+SOURCE SyncFwCustomizerAppUi.cpp 
+SOURCE SyncFwCustomizerDocument.cpp 
+SOURCE SyncFwCustomizerApplication.cpp
+SOURCE SyncFwCustomizerSettingItemListView.cpp
+
+SOURCEPATH		..\data
+USERINCLUDE	   ..\inc ..\data
+
+START RESOURCE	SyncFwCustomizer.rss
+HEADER
+TARGETPATH resource\apps
+END //RESOURCE
+
+START RESOURCE	SyncFwCustomizer_reg.rss
+TARGETPATH 	  \private\10003a3f\apps
+END //RESOURCE
+
+LIBRARY			euser.lib apparc.lib cone.lib eikcore.lib avkon.lib
+LIBRARY			commonengine.lib efsrv.lib estor.lib eikcoctl.lib eikdlg.lib 
+LIBRARY			eikctl.lib bafl.lib fbscli.lib aknnotify.lib aknicon.lib
+LIBRARY			etext.lib gdi.lib egul.lib insock.lib
+LIBRARY			ecom.lib InetProtUtil.lib http.lib esock.lib
+LIBRARY			centralrepository.lib syncmlclientapi.lib
+LANG 			01
+
+START BITMAP	SyncFwCustomizer.mbm
+HEADER
+TARGETPATH		\resource\apps
+SOURCEPATH		..\gfx
+SOURCE	c12,1	list_icon.bmp list_icon_mask.bmp
+END
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+PRJ_PLATFORMS
+WINSCW ARMV5 GCCE
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+gnumakefile icons_aif_scalable_dc.mk
+SyncFwCustomizer.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizer.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+enum TSyncFwCustomizerViewUids
+	{
+	ESyncFwCustomizerSettingItemListViewId = 1
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizer.pan	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZER_PAN_H
+#define SYNCFWCUSTOMIZER_PAN_H
+
+/** SyncFwCustomizer application panic codes */
+enum TSyncFwCustomizerPanics
+	{
+	ESyncFwCustomizerUi = 1
+	// add further panics here
+	};
+
+inline void Panic(TSyncFwCustomizerPanics aReason)
+	{
+	_LIT(applicationName,"SyncFwCustomizer");
+	User::Panic(applicationName, aReason);
+	}
+
+#endif // SYNCFWCUSTOMIZER_PAN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerAppUi.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZERAPPUI_H
+#define SYNCFWCUSTOMIZERAPPUI_H
+
+#include <aknviewappui.h>
+
+class CSyncFwCustomizerSettingItemListView;
+
+/**
+ * @class	CSyncFwCustomizerAppUi SyncFwCustomizerAppUi.h
+ * @brief The AppUi class handles application-wide aspects of the user interface, including
+ *        view management and the default menu, control pane, and status pane.
+ */
+class CSyncFwCustomizerAppUi : public CAknViewAppUi
+	{
+public: 
+	// constructor and destructor
+	CSyncFwCustomizerAppUi();
+	virtual ~CSyncFwCustomizerAppUi();
+	void ConstructL();
+
+public:
+	// from CCoeAppUi
+	TKeyResponse HandleKeyEventL(
+				const TKeyEvent& aKeyEvent,
+				TEventCode aType );
+
+	// from CEikAppUi
+	void HandleCommandL( TInt aCommand );
+	void HandleResourceChangeL( TInt aType );
+
+	// from CAknAppUi
+	void HandleViewDeactivation( 
+			const TVwsViewId& aViewIdToBeDeactivated, 
+			const TVwsViewId& aNewlyActivatedViewId );
+
+private:
+	void InitializeContainersL();
+
+private: 
+	CSyncFwCustomizerSettingItemListView* iSyncFwCustomizerSettingItemListView;
+	};
+
+#endif // SYNCFWCUSTOMIZERAPPUI_H			
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerApplication.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZERAPPLICATION_H
+#define SYNCFWCUSTOMIZERAPPLICATION_H
+
+#include <aknapp.h>
+
+const TUid KUidSyncFwCustomizerApplication = { 0x2001FDF4 };
+
+/**
+ *
+ * @class	CSyncFwCustomizerApplication SyncFwCustomizerApplication.h
+ * @brief	A CAknApplication-derived class is required by the S60 application 
+ *          framework. It is subclassed to create the application's document 
+ *          object.
+ */
+class CSyncFwCustomizerApplication : public CAknApplication
+	{
+private:
+	TUid AppDllUid() const;
+	CApaDocument* CreateDocumentL();	
+	};
+			
+#endif // SYNCFWCUSTOMIZERAPPLICATION_H		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerDocument.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZERDOCUMENT_H
+#define SYNCFWCUSTOMIZERDOCUMENT_H
+
+#include <akndoc.h>
+		
+class CEikAppUi;
+
+/**
+* @class	CSyncFwCustomizerDocument SyncFwCustomizerDocument.h
+* @brief	A CAknDocument-derived class is required by the S60 application 
+*           framework. It is responsible for creating the AppUi object. 
+*/
+class CSyncFwCustomizerDocument : public CAknDocument
+	{
+public: 
+	// constructor
+	static CSyncFwCustomizerDocument* NewL( CEikApplication& aApp );
+
+private: 
+	// constructors
+	CSyncFwCustomizerDocument( CEikApplication& aApp );
+	void ConstructL();
+	
+public: 
+	// from base class CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+
+#endif // SYNCFWCUSTOMIZERDOCUMENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemList.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZERSETTINGITEMLIST_H
+#define SYNCFWCUSTOMIZERSETTINGITEMLIST_H
+
+#include <aknsettingitemlist.h>
+
+class MEikCommandObserver;
+class TSyncFwCustomizerSettingItemListSettings;
+class CRepository;
+
+/**
+ * @class	CSyncFwCustomizerSettingItemList SyncFwCustomizerSettingItemList.h
+ */
+class CSyncFwCustomizerSettingItemList : public CAknSettingItemList
+	{
+public: // constructors and destructor
+
+	CSyncFwCustomizerSettingItemList( 
+			TSyncFwCustomizerSettingItemListSettings& settings, 
+			MEikCommandObserver* aCommandObserver,
+	        CRepository& aRepository );
+	virtual ~CSyncFwCustomizerSettingItemList();
+
+public:
+
+	// from CCoeControl
+	void HandleResourceChange( TInt aType );
+
+	// overrides of CAknSettingItemList
+	CAknSettingItem* CreateSettingItemL( TInt id );
+	void EditItemL( TInt aIndex, TBool aCalledFromMenu );
+	TKeyResponse OfferKeyEventL( 
+			const TKeyEvent& aKeyEvent, 
+			TEventCode aType );
+
+public:
+	// utility function for menu
+	void ChangeSelectedItemL();
+	void ResetSelectedItemL();
+	void LoadSettingValuesL();
+	void SaveSettingValuesL();
+		
+private:
+	// override of CAknSettingItemList
+	void SizeChanged();
+
+private:
+	// current settings values
+	TSyncFwCustomizerSettingItemListSettings& iSettings;
+	MEikCommandObserver* iCommandObserver;
+	CRepository& iRepository;	
+	};
+
+#endif // SYNCFWCUSTOMIZERSETTINGITEMLIST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemList.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+enum TSyncFwCustomizerSettingItemListViewCommands
+	{
+	ESyncFwCustomizerSettingEdit = 0x6000,
+	ESyncFwCustomizerSettingReset,
+	ESyncFwCustomizerSettingSync
+	};
+
+enum TSyncFwCustomizerSettingItemListViewItems
+	{
+	ESyncFwCustomizerSettingItemListViewEdit1 = 1,
+	ESyncFwCustomizerSettingItemListViewSyncAdapterEditor,
+	ESyncFwCustomizerSettingItemListViewIntegerEditor2,
+	ESyncFwCustomizerSettingItemListViewEdit2,
+	ESyncFwCustomizerSettingItemListViewEdit3,
+	ESyncFwCustomizerSettingItemListViewEnumeratedTextPopup1,
+	ESyncFwCustomizerSettingItemListViewEdit4
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemListSettings.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZERSETTINGITEMLISTSETTINGS_H
+#define SYNCFWCUSTOMIZERSETTINGITEMLISTSETTINGS_H
+			
+#include <e32std.h>
+
+const int KEdit1MaxLength = 255;
+const int KEdit2MaxLength = 255;
+const int KEdit3MaxLength = 255;
+const int KEdit4MaxLength = 255;
+
+class CRepository;
+
+
+/**
+ * @class	TSyncFwCustomizerSettingItemListSettings SyncFwCustomizerSettingItemListSettings.h
+ */
+class TSyncFwCustomizerSettingItemListSettings
+	{
+public:
+	// construct and destroy
+	static TSyncFwCustomizerSettingItemListSettings* NewL(CRepository& aRepository);
+	
+private:
+	// constructor
+	TSyncFwCustomizerSettingItemListSettings(CRepository& aRepository);
+    void ConstructL();
+
+public:
+	TDes& ServerUrl();
+	void SetServerUrl(const TDesC& aValue);
+	TInt& OperatorAdapterUid();
+	void SetOperatorAdapterUid(const TInt& aValue);
+	TInt& ProfileAdapterUid();
+	void SetProfileAdapterUid(const TInt& aValue);
+	TDes& SwV();
+	void SetSwV(const TDesC8& aValue);
+	TDes& Mod();
+	void SetMod(const TDesC8& aValue);
+	TInt& SyncProfileVisibility();
+	void SetSyncProfileVisibility(const TInt& aValue);
+	TDes& OperatorServerId();
+	void SetOperatorServerId(const TDesC8& aValue);
+
+protected:
+    CRepository& iRepository; // Not owned
+	TBuf<KEdit1MaxLength> iEdit1;
+	TInt iSyncAdapterEditor;
+	TInt iProfileAdapterUid;
+	TBuf<KEdit2MaxLength> iSwV;
+	TBuf<KEdit3MaxLength> iMod;
+	TInt iSyncProfileVisibility;
+	TBuf<KEdit4MaxLength> iOperatorServerId;	
+	};
+
+#endif // SYNCFWCUSTOMIZERSETTINGITEMLISTSETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/inc/SyncFwCustomizerSettingItemListView.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCFWCUSTOMIZERSETTINGITEMLISTVIEW_H
+#define SYNCFWCUSTOMIZERSETTINGITEMLISTVIEW_H
+
+#include <aknview.h>
+#include "SyncFwCustomizerSettingItemListSettings.h"
+
+class CRepository;
+class CSyncFwCustomizerSettingItemList;
+
+/**
+ * Avkon view class for SyncFwCustomizerSettingItemListView. It is register with the view server
+ * by the AppUi. It owns the container control.
+ * @class	CSyncFwCustomizerSettingItemListView SyncFwCustomizerSettingItemListView.h
+ */						
+			
+class CSyncFwCustomizerSettingItemListView : public CAknView
+	{
+	
+public:
+	// constructors and destructor
+	CSyncFwCustomizerSettingItemListView();
+	static CSyncFwCustomizerSettingItemListView* NewL();
+	static CSyncFwCustomizerSettingItemListView* NewLC();        
+	void ConstructL();
+	virtual ~CSyncFwCustomizerSettingItemListView();
+						
+	// from base class CAknView
+	TUid Id() const;
+	void HandleCommandL( TInt aCommand );
+	
+protected:
+	// from base class CAknView
+	void DoActivateL(
+		const TVwsViewId& aPrevViewId,
+		TUid aCustomMessageId,
+		const TDesC8& aCustomMessage );
+	void DoDeactivate();
+	void HandleStatusPaneSizeChange();
+	TBool HandleChangeSelectedSettingItemL();
+	TBool ResetSelectedSettingItemL();
+	TBool StartSyncL();
+
+private:
+	void SetupStatusPaneL();
+	void CleanupStatusPane();
+
+private:	
+	CSyncFwCustomizerSettingItemList* iSyncFwCustomizerSettingItemList;
+	TSyncFwCustomizerSettingItemListSettings* iSettings;
+	CRepository* iRepository;
+	};
+
+#endif // SYNCFWCUSTOMIZERSETTINGITEMLISTVIEW_H
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/main.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include <QtGui>
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-#include "customlistview.h"
-
-int main(int argc, char *argv[])
-{
-    HbApplication app( argc, argv );
-    HbMainWindow mainWindow;
-    CustomListView* listView = new CustomListView;
-    mainWindow.addView( listView );  
-    mainWindow.show();
-    return app.exec();
-}
-    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/sis/SyncFwCustomizer.pkg	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 
+;
+; SyncFwCustomizer.pkg
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+; Also, the resource file entries should be changed to match the language
+; used in the build. For example, if building for LANGUAGE_01, change the file
+; extensions .rsc to .r01.
+;
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"SyncFwCustomizer"},(0x2001FDF4),1,0,0
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+;Supports Series 60 v 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+;Files to install
+;You should change the source paths to match that of your environment
+;<source> <destination>
+"\Epoc32\RELEASE\ARMV5\urel\SyncFwCustomizer.exe"		-"!:\sys\bin\SyncFwCustomizer.exe"
+"\Epoc32\data\z\resource\apps\SyncFwCustomizer.r01"		-"!:\resource\apps\SyncFwCustomizer.r01"
+"\Epoc32\data\z\private\10003a3f\apps\SyncFwCustomizer_reg.r01"	-"!:\private\10003a3f\import\apps\SyncFwCustomizer_reg.r01"
+"\epoc32\data\z\resource\apps\SyncFwCustomizer_aif.mif" -"!:\resource\apps\SyncFwCustomizer_aif.mif"
+"\epoc32\data\z\resource\apps\SyncFwCustomizer.mbm" -"!:\resource\apps\SyncFwCustomizer.mbm"
+; Add any installation notes if applicable
+;"SyncFwCustomizer.txt"					  -"!:\private\0x2001FDF4\SyncFwCustomizer.txt"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/sis/backup_registration.xml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+  <system_backup/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerAppUi.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <eikmenub.h>
+#include <akncontext.h>
+#include <akntitle.h>
+#include <SyncFwCustomizer.rsg>
+
+#include "SyncFwCustomizerAppUi.h"
+#include "SyncFwCustomizerSettingItemList.hrh"
+#include "SyncFwCustomizer.hrh"
+#include "SyncFwCustomizerSettingItemListView.h"
+
+/**
+ * Construct the CSyncFwCustomizerAppUi instance
+ */ 
+CSyncFwCustomizerAppUi::CSyncFwCustomizerAppUi()
+	{
+	}
+
+/** 
+ * The appui's destructor removes the container from the control
+ * stack and destroys it.
+ */
+CSyncFwCustomizerAppUi::~CSyncFwCustomizerAppUi()
+	{
+	}
+
+void CSyncFwCustomizerAppUi::InitializeContainersL()
+	{
+	iSyncFwCustomizerSettingItemListView = CSyncFwCustomizerSettingItemListView::NewL();
+	AddViewL( iSyncFwCustomizerSettingItemListView );
+	SetDefaultViewL( *iSyncFwCustomizerSettingItemListView );
+	}
+
+/**
+ * Handle a command for this appui (override)
+ * @param aCommand command id to be handled
+ */
+void CSyncFwCustomizerAppUi::HandleCommandL( TInt aCommand )
+	{
+	TBool commandHandled = EFalse;
+	switch ( aCommand )
+		{ // code to dispatch to the AppUi's menu and CBA commands is generated here
+		default:
+			break;
+		}
+		
+	if ( !commandHandled ) 
+		{
+		if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
+			{
+			Exit();
+			}
+		}
+	}
+
+/** 
+ * Override of the HandleResourceChangeL virtual function
+ */
+void CSyncFwCustomizerAppUi::HandleResourceChangeL( TInt aType )
+	{
+	CAknViewAppUi::HandleResourceChangeL( aType );
+	}
+				
+/** 
+ * Override of the HandleKeyEventL virtual function
+ * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not
+ * @param aKeyEvent 
+ * @param aType 
+ */
+TKeyResponse CSyncFwCustomizerAppUi::HandleKeyEventL(
+		const TKeyEvent& aKeyEvent,
+		TEventCode aType )
+	{
+	// The inherited HandleKeyEventL is private and cannot be called
+	return EKeyWasNotConsumed;
+	}
+
+/** 
+ * Override of the HandleViewDeactivation virtual function
+ *
+ * @param aViewIdToBeDeactivated 
+ * @param aNewlyActivatedViewId 
+ */
+void CSyncFwCustomizerAppUi::HandleViewDeactivation( 
+		const TVwsViewId& aViewIdToBeDeactivated, 
+		const TVwsViewId& aNewlyActivatedViewId )
+	{
+	CAknViewAppUi::HandleViewDeactivation( 
+			aViewIdToBeDeactivated, 
+			aNewlyActivatedViewId );
+	}
+
+/**
+ * @brief Completes the second phase of Symbian object construction. 
+ * Put initialization code that could leave here. 
+ */ 
+void CSyncFwCustomizerAppUi::ConstructL()
+	{
+	BaseConstructL( EAknEnableSkin  | 
+					 EAknEnableMSK ); 
+	InitializeContainersL();
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerApplication.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "SyncFwCustomizerApplication.h"
+#include "SyncFwCustomizerDocument.h"
+
+#ifdef EKA2
+#include <eikstart.h>
+#endif
+
+/**
+ * @brief Returns the application's UID (override from CApaApplication::AppDllUid())
+ * @return UID for this application (KUidSyncFwCustomizerApplication)
+ */
+TUid CSyncFwCustomizerApplication::AppDllUid() const
+	{
+	return KUidSyncFwCustomizerApplication;
+	}
+
+/**
+ * @brief Creates the application's document (override from CApaApplication::CreateDocumentL())
+ * @return Pointer to the created document object (CSyncFwCustomizerDocument)
+ */
+CApaDocument* CSyncFwCustomizerApplication::CreateDocumentL()
+	{
+	return CSyncFwCustomizerDocument::NewL( *this );
+	}
+
+#ifdef EKA2
+
+/**
+ *	@brief Called by the application framework to construct the application object
+ *  @return The application (CSyncFwCustomizerApplication)
+ */	
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CSyncFwCustomizerApplication;
+	}
+
+/**
+* @brief This standard export is the entry point for all Series 60 applications
+* @return error code
+ */	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+	
+#else 	// Series 60 2.x main DLL program code
+
+/**
+* @brief This standard export constructs the application object.
+* @return The application (CSyncFwCustomizerApplication)
+*/
+EXPORT_C CApaApplication* NewApplication()
+	{
+	return new CSyncFwCustomizerApplication;
+	}
+
+/**
+* @brief This standard export is the entry point for all Series 60 applications
+* @return error code
+*/
+GLDEF_C TInt E32Dll(TDllReason /*reason*/)
+	{
+	return KErrNone;
+	}
+
+#endif // EKA2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerDocument.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "SyncFwCustomizerDocument.h"
+#include "SyncFwCustomizerAppUi.h"
+
+/**
+ * @brief Constructs the document class for the application.
+ * @param anApplication the application instance
+ */
+CSyncFwCustomizerDocument::CSyncFwCustomizerDocument( CEikApplication& anApplication )
+	: CAknDocument( anApplication )
+	{
+	}
+
+/**
+ * @brief Completes the second phase of Symbian object construction. 
+ * Put initialization code that could leave here.  
+ */ 
+void CSyncFwCustomizerDocument::ConstructL()
+	{
+	}
+	
+/**
+ * Symbian OS two-phase constructor.
+ *
+ * Creates an instance of CSyncFwCustomizerDocument, constructs it, and
+ * returns it.
+ *
+ * @param aApp the application instance
+ * @return the new CSyncFwCustomizerDocument
+ */
+CSyncFwCustomizerDocument* CSyncFwCustomizerDocument::NewL( CEikApplication& aApp )
+	{
+	CSyncFwCustomizerDocument* self = new ( ELeave ) CSyncFwCustomizerDocument( aApp );
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/**
+ * @brief Creates the application UI object for this document.
+ * @return the new instance
+ */	
+CEikAppUi* CSyncFwCustomizerDocument::CreateAppUiL()
+	{
+	return new ( ELeave ) CSyncFwCustomizerAppUi;
+	}
+				
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerSettingItemList.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,328 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <eikmenup.h>
+#include <aknappui.h>
+#include <eikcmobs.h>
+#include <barsread.h>
+#include <stringloader.h>
+#include <gdi.h>
+#include <eikedwin.h>
+#include <eikenv.h>
+#include <aknnumedwin.h>
+#include <aknpopupfieldtext.h>
+#include <eikappui.h>
+#include <aknviewappui.h>
+#include <SyncFwCustomizer.rsg>
+#include <centralrepository.h>
+#include <NSmlOperatorDataCRKeys.h>
+
+#include "SyncFwCustomizerSettingItemList.h"
+#include "SyncFwCustomizerSettingItemListSettings.h"
+#include "SyncFwCustomizer.hrh"
+#include "SyncFwCustomizerSettingItemList.hrh"
+#include "SyncFwCustomizerSettingItemListView.h"
+
+/**
+ * Construct the CSyncFwCustomizerSettingItemList instance
+ * @param aCommandObserver command observer
+ */ 
+CSyncFwCustomizerSettingItemList::CSyncFwCustomizerSettingItemList( 
+		TSyncFwCustomizerSettingItemListSettings& aSettings, 
+		MEikCommandObserver* aCommandObserver,
+        CRepository& aRepository )
+	: iSettings( aSettings ), 
+	  iCommandObserver( aCommandObserver ), 
+	  iRepository( aRepository )
+	{
+	}
+
+/** 
+ * Destroy any instance variables
+ */
+CSyncFwCustomizerSettingItemList::~CSyncFwCustomizerSettingItemList()
+	{
+	}
+
+/**
+ * Handle system notification that the container's size has changed.
+ */
+void CSyncFwCustomizerSettingItemList::SizeChanged()
+	{
+	if ( ListBox() ) 
+		{
+		ListBox()->SetRect( Rect() );
+		}
+	}
+
+/**
+ * Create one setting item at a time, identified by id.
+ * CAknSettingItemList calls this method and takes ownership
+ * of the returned value.  The CAknSettingItem object owns
+ * a reference to the underlying data, which EditItemL() uses
+ * to edit and store the value.
+ */
+CAknSettingItem* CSyncFwCustomizerSettingItemList::CreateSettingItemL( TInt aId )
+	{
+	switch ( aId )
+		{
+		case ESyncFwCustomizerSettingItemListViewEdit1:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.ServerUrl() );
+			return item;
+			}
+			
+		case ESyncFwCustomizerSettingItemListViewSyncAdapterEditor:
+			{			
+			CAknIntegerEdwinSettingItem* item = new ( ELeave ) 
+				CAknIntegerEdwinSettingItem( 
+					aId,
+					iSettings.OperatorAdapterUid() );
+			return item;			
+			}
+			
+		case ESyncFwCustomizerSettingItemListViewIntegerEditor2:
+			{			
+			CAknIntegerEdwinSettingItem* item = new ( ELeave ) 
+				CAknIntegerEdwinSettingItem( 
+					aId,
+					iSettings.ProfileAdapterUid() );
+			return item;
+			}
+			
+		case ESyncFwCustomizerSettingItemListViewEdit2:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.SwV() );
+			return item;
+			}
+			
+		case ESyncFwCustomizerSettingItemListViewEdit3:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.Mod() );
+			return item;
+			}
+			
+		case ESyncFwCustomizerSettingItemListViewEnumeratedTextPopup1:
+			{			
+			CAknEnumeratedTextPopupSettingItem* item = new ( ELeave ) 
+				CAknEnumeratedTextPopupSettingItem( 
+					aId,
+					iSettings.SyncProfileVisibility() );
+			return item;
+			}
+			
+		case ESyncFwCustomizerSettingItemListViewEdit4:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.OperatorServerId() );
+			return item;
+			}
+		}
+		
+	return NULL;
+	}
+	
+/**
+ * Edit the setting item identified by the given id and store
+ * the changes into the store.
+ * @param aIndex the index of the setting item in SettingItemArray()
+ * @param aCalledFromMenu true: a menu item invoked editing, thus
+ *	always show the edit page and interactively edit the item;
+ *	false: change the item in place if possible, else show the edit page
+ */
+void CSyncFwCustomizerSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
+	{
+	CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
+	switch ( item->Identifier() )
+		{
+		}
+	
+	CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
+	
+	TBool storeValue = ETrue;
+	switch ( item->Identifier() )
+		{
+		}
+		
+	if ( storeValue )
+		{
+		item->StoreL();
+		SaveSettingValuesL();
+		}	
+	}
+
+/**
+ *	Handle the "Change" option on the Options menu.  This is an
+ *	alternative to the Selection key that forces the settings page
+ *	to come up rather than changing the value in place (if possible).
+ */
+void CSyncFwCustomizerSettingItemList::ChangeSelectedItemL()
+	{
+	if ( ListBox()->CurrentItemIndex() >= 0 )
+		{
+		EditItemL( ListBox()->CurrentItemIndex(), ETrue );
+		}
+	}
+
+void CSyncFwCustomizerSettingItemList::ResetSelectedItemL()
+    {
+    TInt key = 0;
+    switch( ListBox()->CurrentItemIndex() )
+        {
+        case 0:
+            key = KNsmlOpDsOperatorSyncServerURL;
+            break;
+        case 1:
+            key = KNsmlOpDsOperatorAdapterUid;
+            break;
+        case 2:
+            key = KNsmlOpDsProfileAdapterUid;
+            break;
+        case 3:
+            key = KNsmlOpDsDevInfoSwVValue;
+            break;
+        case 4:
+            key = KNsmlOpDsDevInfoModValue;
+            break;
+        case 5:
+            key =  KNsmlOpDsSyncProfileVisibility;
+            break;
+        case 6:
+            key = KNsmlOpDsOperatorSyncServerId;
+            break;
+        default:
+            iRepository.Reset();
+            break;
+        }
+
+    iRepository.Reset( key );
+    LoadSettingValuesL();
+    LoadSettingsL();
+    DrawDeferred();
+    }
+
+/**
+ *	Load the initial contents of the setting items.  By default,
+ *	the setting items are populated with the default values from
+ * 	the design.  You can override those values here.
+ *	<p>
+ *	Note: this call alone does not update the UI.  
+ *	LoadSettingsL() must be called afterwards.
+ */
+void CSyncFwCustomizerSettingItemList::LoadSettingValuesL()
+	{
+    TBuf<100> tmpDesc;  
+    TBuf8<100> tmpDesc8;  
+    TInt tmpInt = 0;
+    
+    iRepository.Get( KNsmlOpDsOperatorSyncServerURL, tmpDesc );
+    iSettings.SetServerUrl( tmpDesc );
+        
+    iRepository.Get( KNsmlOpDsOperatorAdapterUid, tmpInt );     
+    iSettings.SetOperatorAdapterUid( tmpInt ); 
+    
+    iRepository.Get( KNsmlOpDsProfileAdapterUid, tmpInt );     
+    iSettings.SetProfileAdapterUid( tmpInt ); 
+    
+    iRepository.Get( KNsmlOpDsDevInfoSwVValue, tmpDesc8 );
+    iSettings.SetSwV( tmpDesc8 );
+
+    iRepository.Get( KNsmlOpDsDevInfoModValue, tmpDesc8 );
+    iSettings.SetMod( tmpDesc8 );
+
+    iRepository.Get( KNsmlOpDsSyncProfileVisibility, tmpInt );
+    iSettings.SetSyncProfileVisibility( tmpInt );
+    
+    iRepository.Get( KNsmlOpDsOperatorSyncServerId, tmpDesc8 );
+    iSettings.SetOperatorServerId( tmpDesc8 );   
+	}
+	
+/**
+ *	Save the contents of the setting items.  Note, this is called
+ *	whenever an item is changed and stored to the model, so it
+ *	may be called multiple times or not at all.
+ */
+void CSyncFwCustomizerSettingItemList::SaveSettingValuesL()
+	{
+    TBuf<100> tmpDesc;  
+    TBuf8<100> tmpDesc8;  
+    TInt tmpInt = 0;
+    
+    tmpDesc = iSettings.ServerUrl();
+    iRepository.Set( KNsmlOpDsOperatorSyncServerURL, tmpDesc );
+        
+    tmpInt = iSettings.OperatorAdapterUid(); 
+    iRepository.Set( KNsmlOpDsOperatorAdapterUid, tmpInt );     
+    
+    tmpInt = iSettings.ProfileAdapterUid(); 
+    iRepository.Set( KNsmlOpDsProfileAdapterUid, tmpInt );     
+    
+    tmpDesc8.Copy( iSettings.SwV() );
+    iRepository.Set( KNsmlOpDsDevInfoSwVValue, tmpDesc8 );
+
+    tmpDesc8.Copy( iSettings.Mod() );
+    iRepository.Set( KNsmlOpDsDevInfoModValue, tmpDesc8 );
+
+    tmpInt = iSettings.SyncProfileVisibility();
+    iRepository.Set( KNsmlOpDsSyncProfileVisibility, tmpInt );
+    
+    tmpDesc8.Copy( iSettings.OperatorServerId() );
+    iRepository.Set( KNsmlOpDsOperatorSyncServerId, tmpDesc8 );
+	}
+
+/** 
+ * Handle global resource changes, such as scalable UI or skin events (override)
+ */
+void CSyncFwCustomizerSettingItemList::HandleResourceChange( TInt aType )
+	{
+	CAknSettingItemList::HandleResourceChange( aType );
+	SetRect( iAvkonViewAppUi->View( TUid::Uid( ESyncFwCustomizerSettingItemListViewId ) )->ClientRect() );
+	}
+				
+/** 
+ * Handle key event (override)
+ * @param aKeyEvent key event
+ * @param aType event code
+ * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed
+ */
+TKeyResponse CSyncFwCustomizerSettingItemList::OfferKeyEventL( 
+		const TKeyEvent& aKeyEvent, 
+		TEventCode aType )
+	{
+	if ( aKeyEvent.iCode == EKeyLeftArrow 
+		|| aKeyEvent.iCode == EKeyRightArrow )
+		{
+		// allow the tab control to get the arrow keys
+		return EKeyWasNotConsumed;
+		}
+	
+	return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType );
+	}
+				
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerSettingItemListSettings.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+ 
+#include <e32base.h>
+#include <stringloader.h>
+#include <barsread.h>
+#include <SyncFwCustomizer.rsg>
+#include "SyncFwCustomizerSettingItemListSettings.h"
+#include <centralrepository.h>
+#include <NSmlOperatorDataCRKeys.h>
+
+/**
+ * C/C++ constructor for settings data, cannot throw
+ */
+TSyncFwCustomizerSettingItemListSettings::TSyncFwCustomizerSettingItemListSettings(CRepository& aRepository):
+    iRepository( aRepository )
+	{
+	}
+
+/**
+ * Two-phase constructor for settings data
+ */
+TSyncFwCustomizerSettingItemListSettings* TSyncFwCustomizerSettingItemListSettings::NewL(CRepository& aRepository)
+	{
+	TSyncFwCustomizerSettingItemListSettings* data = new( ELeave ) TSyncFwCustomizerSettingItemListSettings(aRepository);
+	CleanupStack::PushL( data );
+	data->ConstructL();
+	CleanupStack::Pop( data );
+	return data;
+	}
+	
+/**
+ *	Second phase for initializing settings data
+ */
+void TSyncFwCustomizerSettingItemListSettings::ConstructL()
+	{
+    TBuf<100> tmpDesc;  
+    TBuf8<100> tmpDesc8;  
+    TInt tmpInt = 0;
+    
+    iRepository.Get( KNsmlOpDsOperatorSyncServerURL, tmpDesc );
+	SetServerUrl( tmpDesc );
+		
+	iRepository.Get( KNsmlOpDsOperatorAdapterUid, tmpInt );		
+	SetOperatorAdapterUid( tmpInt ); 
+	
+    iRepository.Get( KNsmlOpDsProfileAdapterUid, tmpInt );     
+    SetProfileAdapterUid( tmpInt ); 
+	
+    iRepository.Get( KNsmlOpDsDevInfoSwVValue, tmpDesc8 );
+    SetSwV( tmpDesc8 );
+
+    iRepository.Get( KNsmlOpDsDevInfoModValue, tmpDesc8 );
+    SetMod( tmpDesc8 );
+
+    iRepository.Get( KNsmlOpDsSyncProfileVisibility, tmpInt );
+    SetSyncProfileVisibility( tmpInt );
+    
+    iRepository.Get( KNsmlOpDsOperatorSyncServerId, tmpDesc8 );
+    SetOperatorServerId( tmpDesc8 );    
+	}
+	
+TDes& TSyncFwCustomizerSettingItemListSettings::ServerUrl()
+	{
+	return iEdit1;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetServerUrl(const TDesC& aValue)
+	{
+	if ( aValue.Length() < KEdit1MaxLength)
+		iEdit1.Copy( aValue );
+	else
+		iEdit1.Copy( aValue.Ptr(), KEdit1MaxLength);
+	}
+
+TInt& TSyncFwCustomizerSettingItemListSettings::OperatorAdapterUid()
+	{
+	return iSyncAdapterEditor;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetOperatorAdapterUid(const TInt& aValue)
+	{
+	iSyncAdapterEditor = aValue;
+	}
+
+TInt& TSyncFwCustomizerSettingItemListSettings::ProfileAdapterUid()
+	{
+	return iProfileAdapterUid;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetProfileAdapterUid(const TInt& aValue)
+	{
+    iProfileAdapterUid = aValue;
+	}
+
+TDes& TSyncFwCustomizerSettingItemListSettings::SwV()
+	{
+	return iSwV;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetSwV(const TDesC8& aValue)
+	{
+	iSwV.Copy( aValue );
+	}
+
+TDes& TSyncFwCustomizerSettingItemListSettings::Mod()
+	{
+	return iMod;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetMod(const TDesC8& aValue)
+	{
+	iMod.Copy( aValue );
+	}
+
+TInt& TSyncFwCustomizerSettingItemListSettings::SyncProfileVisibility()
+	{
+	return iSyncProfileVisibility;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetSyncProfileVisibility(const TInt& aValue)
+	{
+    iSyncProfileVisibility = aValue;
+	}
+
+TDes& TSyncFwCustomizerSettingItemListSettings::OperatorServerId()
+	{
+	return iOperatorServerId;
+	}
+
+void TSyncFwCustomizerSettingItemListSettings::SetOperatorServerId(const TDesC8& aValue)
+	{
+    iOperatorServerId.Copy( aValue );
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/src/SyncFwCustomizerSettingItemListView.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <aknviewappui.h>
+#include <eikmenub.h>
+#include <avkon.hrh>
+#include <akncontext.h>
+#include <akntitle.h>
+#include <stringloader.h>
+#include <barsread.h>
+#include <eikbtgpc.h>
+#include <SyncFwCustomizer.rsg>
+#include <centralrepository.h>
+#include <NSmlOperatorDataCRKeys.h>
+#include <syncmlclient.h>
+#include <syncmlclientds.h>
+#include <syncmldef.h>
+#include <AknQueryDialog.h>
+
+#include "SyncFwCustomizer.hrh"
+#include "SyncFwCustomizerSettingItemListView.h"
+#include "SyncFwCustomizerSettingItemList.hrh"
+#include "SyncFwCustomizerSettingItemList.h"
+
+const TInt KOperatorProfileId = 4;
+
+/**
+ * First phase of Symbian two-phase construction. Should not contain any
+ * code that could leave.
+ */
+CSyncFwCustomizerSettingItemListView::CSyncFwCustomizerSettingItemListView()
+	{
+	}
+
+/** 
+ * The view's destructor removes the container from the control
+ * stack and destroys it.
+ */
+CSyncFwCustomizerSettingItemListView::~CSyncFwCustomizerSettingItemListView()
+	{
+	delete iRepository;
+	}
+
+/**
+ * Symbian two-phase constructor.
+ * This creates an instance then calls the second-phase constructor
+ * without leaving the instance on the cleanup stack.
+ * @return new instance of CSyncFwCustomizerSettingItemListView
+ */
+CSyncFwCustomizerSettingItemListView* CSyncFwCustomizerSettingItemListView::NewL()
+	{
+	CSyncFwCustomizerSettingItemListView* self = CSyncFwCustomizerSettingItemListView::NewLC();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/**
+ * Symbian two-phase constructor.
+ * This creates an instance, pushes it on the cleanup stack,
+ * then calls the second-phase constructor.
+ * @return new instance of CSyncFwCustomizerSettingItemListView
+ */
+CSyncFwCustomizerSettingItemListView* CSyncFwCustomizerSettingItemListView::NewLC()
+	{
+	CSyncFwCustomizerSettingItemListView* self = new ( ELeave ) CSyncFwCustomizerSettingItemListView();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+
+/**
+ * Second-phase constructor for view.  
+ * Initialize contents from resource.
+ */ 
+void CSyncFwCustomizerSettingItemListView::ConstructL()
+	{
+	BaseConstructL( R_SYNC_FW_CUSTOMIZER_SETTING_ITEM_LIST_SYNC_FW_CUSTOMIZER_SETTING_ITEM_LIST_VIEW );
+	iRepository = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys );	
+	}
+
+/**
+ * @return The UID for this view
+ */
+TUid CSyncFwCustomizerSettingItemListView::Id() const
+	{
+	return TUid::Uid( ESyncFwCustomizerSettingItemListViewId );
+	}
+
+/**
+ * Handle a command for this view (override)
+ * @param aCommand command id to be handled
+ */
+void CSyncFwCustomizerSettingItemListView::HandleCommandL( TInt aCommand )
+	{
+	TBool commandHandled = EFalse;
+	switch ( aCommand )
+		{	// code to dispatch to the AknView's menu and CBA commands is generated here
+		case ESyncFwCustomizerSettingEdit:
+			commandHandled = HandleChangeSelectedSettingItemL();
+			break;
+        case ESyncFwCustomizerSettingReset:
+            commandHandled = ResetSelectedSettingItemL();
+            break;
+		case ESyncFwCustomizerSettingSync:
+			commandHandled = StartSyncL();
+			break;
+		
+		default:
+			break;
+		}
+		
+	if ( !commandHandled ) 
+		{
+		if ( aCommand == EAknSoftkeyExit )
+			{
+			AppUi()->HandleCommandL( EEikCmdExit );
+			}
+		}	
+	}
+
+/**
+ *	Handles user actions during activation of the view, 
+ *	such as initializing the content.
+ */
+void CSyncFwCustomizerSettingItemListView::DoActivateL( 
+		const TVwsViewId& /*aPrevViewId*/,
+		TUid /*aCustomMessageId*/,
+		const TDesC8& /*aCustomMessage*/ )
+	{
+	SetupStatusPaneL();	
+	
+	if ( iSyncFwCustomizerSettingItemList == NULL )
+		{
+		iSettings = TSyncFwCustomizerSettingItemListSettings::NewL(*iRepository);
+		iSyncFwCustomizerSettingItemList = new ( ELeave ) CSyncFwCustomizerSettingItemList( *iSettings, this, *iRepository );
+		iSyncFwCustomizerSettingItemList->SetMopParent( this );
+		iSyncFwCustomizerSettingItemList->ConstructFromResourceL( R_SYNC_FW_CUSTOMIZER_SETTING_ITEM_LIST_SYNC_FW_CUSTOMIZER_SETTING_ITEM_LIST );
+		iSyncFwCustomizerSettingItemList->ActivateL();
+		iSyncFwCustomizerSettingItemList->LoadSettingValuesL();
+		iSyncFwCustomizerSettingItemList->LoadSettingsL();
+		AppUi()->AddToStackL( *this, iSyncFwCustomizerSettingItemList );
+		} 
+	}
+
+/**
+ */
+void CSyncFwCustomizerSettingItemListView::DoDeactivate()
+	{
+	CleanupStatusPane();
+	
+	if ( iSyncFwCustomizerSettingItemList != NULL )
+		{
+		AppUi()->RemoveFromStack( iSyncFwCustomizerSettingItemList );
+		delete iSyncFwCustomizerSettingItemList;
+		iSyncFwCustomizerSettingItemList = NULL;
+		delete iSettings;
+		iSettings = NULL;
+		}
+	}
+
+/** 
+ * Handle status pane size change for this view (override)
+ */
+void CSyncFwCustomizerSettingItemListView::HandleStatusPaneSizeChange()
+	{
+	CAknView::HandleStatusPaneSizeChange();
+	
+	// this may fail, but we're not able to propagate exceptions here
+	TVwsViewId view;
+	AppUi()->GetActiveViewId( view );
+	if ( view.iViewUid == Id() )
+		{
+		TInt result;
+		TRAP( result, SetupStatusPaneL() );
+		}
+	}
+
+void CSyncFwCustomizerSettingItemListView::SetupStatusPaneL()
+	{
+	// reset the context pane
+	TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
+	CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
+		StatusPane()->PaneCapabilities( contextPaneUid );
+	if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
+		{
+		CAknContextPane* context = static_cast< CAknContextPane* > ( 
+			StatusPane()->ControlL( contextPaneUid ) );
+		context->SetPictureToDefaultL();
+		}
+	
+	// setup the title pane
+	TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
+	CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
+		StatusPane()->PaneCapabilities( titlePaneUid );
+	if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
+		{
+		CAknTitlePane* title = static_cast< CAknTitlePane* >( 
+			StatusPane()->ControlL( titlePaneUid ) );
+		TResourceReader reader;
+		iEikonEnv->CreateResourceReaderLC( reader, R_SYNC_FW_CUSTOMIZER_SETTING_ITEM_LIST_TITLE_RESOURCE );
+		title->SetFromResourceL( reader );
+		CleanupStack::PopAndDestroy(); // reader internal state
+		}		
+	}
+
+void CSyncFwCustomizerSettingItemListView::CleanupStatusPane()
+	{
+	}
+
+/** 
+ * Handle the selected event.
+ * @param aCommand the command id invoked
+ * @return ETrue if the command was handled, EFalse if not
+ */
+TBool CSyncFwCustomizerSettingItemListView::HandleChangeSelectedSettingItemL()
+	{
+	iSyncFwCustomizerSettingItemList->ChangeSelectedItemL();
+	return ETrue;
+	}
+
+TBool CSyncFwCustomizerSettingItemListView::ResetSelectedSettingItemL( )
+    {
+    iSyncFwCustomizerSettingItemList->ResetSelectedItemL();
+    return ETrue;    
+    }
+
+TBool CSyncFwCustomizerSettingItemListView::StartSyncL( )
+	{
+	// Open syncML session
+	RSyncMLSession syncMLSession;
+	RSyncMLDataSyncJob job;
+	CleanupClosePushL(syncMLSession);
+	CleanupClosePushL(job);
+	syncMLSession.OpenL();
+	
+	// Need instance of data sync class
+	// For creating a data sync job, need to specify id of the profile used for synchronization
+	// If profile selected is PCSuite, it searches for the bluetooth device to sync with
+	TInt profileId = KOperatorProfileId;
+	CAknNumberQueryDialog* d = CAknNumberQueryDialog::NewL( profileId );
+	d->ExecuteLD( R_SYNC_FW_CUSTOMIZER_NUMBER_QUERY );
+	job.CreateL( syncMLSession, profileId );
+	// close the job
+	job.Close();
+	// close the syncML session
+	CleanupStack::PopAndDestroy(&job);
+	CleanupStack::PopAndDestroy(&syncMLSession);
+    return ETrue;    
+	}
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/syncfwcustomizer.iby	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include <bldvariant.hrh>
-
-#ifndef __SYNCFWCUSTOMIZER_IBY__
-#define __SYNCFWCUSTOMIZER_IBY__
-
-file=ABI_DIR\BUILD_DIR\syncfwcustomizer.exe    PROGRAMS_DIR\syncfwcustomizer.exe
-data=\epoc32\data\z\resource\apps\syncfwcustomizer.rsc    RESOURCE_FILES_DIR\syncfwcustomizer.rsc
-data=\epoc32\data\z\private\10003a3f\import\apps\syncfwcustomizer_reg.rsc    \private\10003a3f\apps\syncfwcustomizer_reg.rsc
-
-#endif //__SYNCFWCUSTOMIZER_IBY__
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/SyncFwCustomizer/syncfwcustomizer.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-
-
-TEMPLATE = app
-TARGET = 
-DEPENDPATH += .
-CONFIG += hb
-LIBS += -lxqsettingsmanager
-INCLUDEPATH += \epoc32\include\platform\mw
-
-# Input
-SOURCES += customlistview.cpp \
-    main.cpp
-HEADERS = customlistview.h
-
-symbian:TARGET.UID3 = 0x2001FDF4
-symbian:LIBS += -lsyncmlclientapi \
-	-lcentralrepository
-TARGET.CAPABILITY = ALL \
-    -TCB
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/UT_devinfextmgmtinterface.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  MMP file for device info extension management
-*  interface unit tests.
-*
-*/
-
-#include <Digia/Eunit/EUnitCaps.h>
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-// Build target
-TARGET          UT_devinfextmgmtif.dll
-TARGETTYPE      dll
-UID             0x1000af5a 0x01700000
-
-CAPABILITY      EUNIT_CAPS
-VENDORID        0x00000000
-
-#if defined(ARMCC)
-DEFFILE		./def/eabidevinfextmgmtif_test
-#elif defined(WINSCW)
-DEFFILE		./def/bwinscwdevinfextmgmtif_test
-#endif
-
-// Source files
-SOURCEPATH      .
-SOURCE          dllmain.cpp
-SOURCE          devinfextmgmtif_test.cpp
-
-// Code under test
-SOURCEPATH      ../exampledevinfextdataplugin/src
-SOURCE          exampledevinfextdatacontainerplugin.cpp
-
-// Include paths
-USERINCLUDE     . ../exampledevinfextdataplugin/inc
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE 	/epoc32/include/ecom
-SYSTEMINCLUDE   /epoc32/include/Digia/EUnit
-
-// Dependencies to system components
-LIBRARY         ecom.lib
-LIBRARY         euser.lib
-LIBRARY         EUnit.lib
-LIBRARY         bafl.lib
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build info file for device info extension management
-*  interface unit tests.
-*
-*/
-
-PRJ_MMPFILES
-UT_devinfextmgmtinterface.mmp
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/def/bwinscwdevinfextmgmtif_testu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/def/eabidevinfextmgmtif_testu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z16CreateTestSuiteLv @ 1 NONAME
-	_ZTI36CExampleDevInfExtDataContainerPlugin @ 2 NONAME
-	_ZTV36CExampleDevInfExtDataContainerPlugin @ 3 NONAME
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/devinfextmgmtif_test.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-/*
-* 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:  Source code file for device info extension management
-*  interface unit tests.
-*
-*/
-
-// CLASS HEADER
-#include "devinfextmgmtif_test.h"
-
-// EXTERNAL INCLUDES
-#include <EUnitMacros.h>
-#include <EUnitDecorators.h>
-#include <nsmldevinfextdatacontainerplugin.h>
-
-// INTERNAL INCLUDES
-#include "exampledevinfextdatacontainerplugin.h"
-
-//  LOCAL DEFINITIONS
-namespace
-    {
-    _LIT8( KTestXNam1, "TestExtensionName" );
-    _LIT8( KTestXNam2, "AnotherExtensionName" );
-    _LIT8( KTestXNam3, "ExtensionNameWithNoValues" );
-
-    _LIT8( KTestXVal1, "FirstValue" );
-    _LIT8( KTestXVal2, "SecondValue" );
-    _LIT8( KTestXVal3, "ThirdValue" );
-    _LIT8( KTestXVal4, "FourthValue" );
-    }
-
-// - Construction -----------------------------------------------------------
-CDevInfExtMgmtIf_Test* CDevInfExtMgmtIf_Test::NewL()
-    {
-    CDevInfExtMgmtIf_Test* self = CDevInfExtMgmtIf_Test::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-CDevInfExtMgmtIf_Test* CDevInfExtMgmtIf_Test::NewLC()
-    {
-    CDevInfExtMgmtIf_Test* self = new ( ELeave ) CDevInfExtMgmtIf_Test();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-CDevInfExtMgmtIf_Test::~CDevInfExtMgmtIf_Test()
-    {
-    if( iEcomPlugin )
-        {
-        delete iEcomPlugin;
-        REComSession::FinalClose();
-        }
-    }
-
-CDevInfExtMgmtIf_Test::CDevInfExtMgmtIf_Test()
-    {
-    }
-
-void CDevInfExtMgmtIf_Test::ConstructL()
-    {
-    CEUnitTestSuiteClass::ConstructL();
-    }
-
-// - Setup & Teardown ---------------------------------------------------------
-
-void CDevInfExtMgmtIf_Test::SetupEmptyL()
-    {
-    // Construct the plugin normally; in its default construction, no
-    //  extensions are available.
-    TRAPD( err, iEcomPlugin = CNSmlDevInfExtDataContainerPlugin::NewL() );
-    if( err != KErrNone )
-        {
-        EUNIT_PRINT( _L( "Leave while instantiating plugin: %d" ), err );
-        }
-    EUNIT_ASSERT_DESC( iEcomPlugin, "Plugin instantiation failed." );
-    }
-
-void CDevInfExtMgmtIf_Test::SetupOneXNamL()
-    {
-    // Default construction
-    SetupEmptyL();
-
-    // Add XNam + XVals
-    CExampleDevInfExtDataContainerPlugin* plugin = 
-        reinterpret_cast < CExampleDevInfExtDataContainerPlugin* >( iEcomPlugin );
-
-    plugin->InsertExtension( KTestXNam1, KTestXVal1 );
-    plugin->InsertExtension( KTestXNam1, KTestXVal2 );
-    }
-
-void CDevInfExtMgmtIf_Test::SetupMultipleXNamL()
-    {
-    // Default construction
-    SetupEmptyL();
-
-    // Add XNam + XVals
-    CExampleDevInfExtDataContainerPlugin* plugin = 
-        reinterpret_cast < CExampleDevInfExtDataContainerPlugin* >( iEcomPlugin );
-
-    plugin->InsertExtension( KTestXNam1, KTestXVal1 );
-    plugin->InsertExtension( KTestXNam1, KTestXVal2 );
-    plugin->InsertExtension( KTestXNam2, KTestXVal3 );
-    plugin->InsertExtension( KTestXNam2, KTestXVal4 );
-    plugin->InsertExtension( KTestXNam3, KNullDesC8 );
-    }
-
-void CDevInfExtMgmtIf_Test::Teardown()
-    {
-    if( iEcomPlugin )
-        {
-        delete iEcomPlugin;
-        }
-    REComSession::FinalClose();
-    }
-
-// - Actual test methods ------------------------------------------------------
-void CDevInfExtMgmtIf_Test::NewLL()
-    {
-    // Instantiate the example plugin
-    CNSmlDevInfExtDataContainerPlugin* ecomPlugin = NULL;
-
-    // Instantiate the plugin
-    TRAPD( err, ecomPlugin = CNSmlDevInfExtDataContainerPlugin::NewL() );
-    if( err != KErrNone )
-        {
-        EUNIT_PRINT( _L( "Leave while instantiating plugin: %d" ), err );
-        }
-
-    EUNIT_ASSERT( ecomPlugin );    
-    delete ecomPlugin;
-    ecomPlugin = NULL;
-
-    // Tell the framework that plugin is no longer used - resources are released
-    REComSession::FinalClose();
-    }
-
-// Run tests for the test plugin, when there are no extension configured
-// in the plugin.
-void CDevInfExtMgmtIf_Test::TestEmptyPluginL()
-    {
-    // Debug
-    PrintExtensions();
-
-    TInt extCount = 0;
-    TRAPD( err, extCount = iEcomPlugin->GetExtensionCountL() );
-    EUNIT_ASSERT_DESC( err == KErrNone, "GetExtensionCountL() leaves" );
-    EUNIT_ASSERT( extCount == 0 );
-
-    // Ensure that other methods leave, as there are not extensions
-    TRAP( err, iEcomPlugin->GetExtNameL( 0 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-    TRAP( err, iEcomPlugin->GetExtNameL( 1 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-
-    TRAP( err, iEcomPlugin->GetExtValueCountL( 0 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-    TRAP( err, iEcomPlugin->GetExtValueCountL( 1 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-
-    TRAP( err, iEcomPlugin->GetExtValueL( 0, 0 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-    }
-
-// Run tests for the test plugin, when there is one extension configured
-// in the plugin.
-void CDevInfExtMgmtIf_Test::TestOneXNamPluginL()
-    {
-    // Debug
-    PrintExtensions();
-
-    TInt extCount = 0;
-    TRAPD( err, extCount = iEcomPlugin->GetExtensionCountL() );
-    EUNIT_ASSERT_DESC( err == KErrNone, "GetExtensionCountL() leaves" );
-    EUNIT_ASSERT( extCount == 1 );
-
-    // Check legal values
-    TBuf8< 50 > tmpBuf;
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtNameL( 0 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXNam1 ) == 0 );
-
-    TInt xValCount = 0;
-    EUNIT_ASSERT_NO_LEAVE( xValCount = iEcomPlugin->GetExtValueCountL( 0 ) );
-    EUNIT_ASSERT( xValCount == 2 );
-
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtValueL( 0, 0 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXVal1 ) == 0 );
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtValueL( 0, 1 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXVal2 ) == 0 );
-
-    // Ensure that methods leave with illegal indices
-    TRAP( err, iEcomPlugin->GetExtNameL( 1 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-
-    TRAP( err, iEcomPlugin->GetExtValueCountL( 1 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-
-    TRAP( err, iEcomPlugin->GetExtValueL( 1, 0 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-    }
-
-// Run tests for the test plugin, when there are multiple extensions configured
-// in the plugin.
-void CDevInfExtMgmtIf_Test::TestMultipleXNamPluginL()
-    {
-    // Debug
-    PrintExtensions();   
-
-    TInt extCount = 0;
-    TRAPD( err, extCount = iEcomPlugin->GetExtensionCountL() );
-    EUNIT_ASSERT_DESC( err == KErrNone, "GetExtensionCountL() leaves" );
-    EUNIT_ASSERT( extCount == 3 );
-
-    // Check legal values
-    //  1st extension (index 0)
-    TBuf8< 50 > tmpBuf;
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtNameL( 0 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXNam1 ) == 0 );
-
-    TInt xValCount = 0;
-    EUNIT_ASSERT_NO_LEAVE( xValCount = iEcomPlugin->GetExtValueCountL( 0 ) );
-    EUNIT_ASSERT( xValCount == 2 );
-
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtValueL( 0, 0 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXVal1 ) == 0 );
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtValueL( 0, 1 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXVal2 ) == 0 );
-
-    //  2nd extension (index 1)
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtNameL( 1 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXNam2 ) == 0 );
-
-    xValCount = 0;
-    EUNIT_ASSERT_NO_LEAVE( xValCount = iEcomPlugin->GetExtValueCountL( 1 ) );
-    EUNIT_ASSERT( xValCount == 2 );
-
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtValueL( 1, 0 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXVal3 ) == 0 );
-    tmpBuf.Zero();
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtValueL( 1, 1 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXVal4 ) == 0 );
-
-    //  3nd extension (index 2)
-    EUNIT_ASSERT_NO_LEAVE( tmpBuf = iEcomPlugin->GetExtNameL( 2 ) );
-    EUNIT_ASSERT( tmpBuf.Compare( KTestXNam3 ) == 0 );
-
-    xValCount = 0;
-    EUNIT_ASSERT_NO_LEAVE( xValCount = iEcomPlugin->GetExtValueCountL( 2 ) );
-    EUNIT_ASSERT( xValCount == 0 );
-
-    // Ensure that methods leave with illegal indices
-    TRAP( err, iEcomPlugin->GetExtNameL( -1 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-
-    TRAP( err, iEcomPlugin->GetExtValueCountL( 3 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-
-    TRAP( err, iEcomPlugin->GetExtValueL( 5, 2 ) );
-    EUNIT_ASSERT( err == KErrArgument );
-    }
-
-// - Utilities ----------------------------------------------------------------
-void CDevInfExtMgmtIf_Test::PrintExtensions()
-    {
-    EUNIT_PRINT( _L( "Extension count %d" ), iEcomPlugin->GetExtensionCountL() );
-
-    for ( TInt i = 0; i < iEcomPlugin->GetExtensionCountL(); i++ )
-        {
-        EUNIT_PRINT( _L("EXTENSION NUMBER %d"), i );
-
-        EUNIT_PRINT( _L( "Name" ) );
-        EUNIT_PRINT( iEcomPlugin->GetExtNameL( i ) );
-
-        EUNIT_PRINT( _L( "Values" ) );
-        for ( TInt j = 0; j < iEcomPlugin->GetExtValueCountL( i ); j++ )
-            { 
-            EUNIT_PRINT( iEcomPlugin->GetExtValueL( i, j ) );
-            }
-
-        EUNIT_PRINT( _L("END OF EXTENSION %d"), i );
-        }
-    }
-
-// - EUnit test table -------------------------------------------------------
-
-EUNIT_BEGIN_TEST_TABLE(
-    CDevInfExtMgmtIf_Test,
-    "Unit tests for Device info ext management interface.",
-    "UNIT" )
-
-EUNIT_TEST(
-    "Verify Ecom plugin instantiation",
-    "CNSmlDevInfExtDataContainerPlugin",
-    "NewL",
-    "FUNCTIONALITY",
-    Empty, NewLL, Empty)
-
-EUNIT_TEST(
-    "Test the behaviour with no extensions",
-    "CNSmlDevInfExtDataContainerPlugin",
-    "NewL",
-    "FUNCTIONALITY",
-    SetupEmptyL, TestEmptyPluginL, Teardown)
-
-EUNIT_TEST(
-    "Test the behaviour with one extension",
-    "CNSmlDevInfExtDataContainerPlugin",
-    "NewL",
-    "FUNCTIONALITY",
-    SetupOneXNamL, TestOneXNamPluginL, Teardown)
-
-EUNIT_TEST(
-    "Test the behaviour with multiple extensions",
-    "CNSmlDevInfExtDataContainerPlugin",
-    "NewL",
-    "FUNCTIONALITY",
-    SetupMultipleXNamL, TestMultipleXNamPluginL, Teardown)
-    
-EUNIT_END_TEST_TABLE
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/devinfextmgmtif_test.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* 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:  Header file for device info extension management
-*  interface unit tests.
-*
-*/
-
-#ifndef __DEVINFEXTMGMTIF_TEST_H__
-#define __DEVINFEXTMGMTIF_TEST_H__
-
-// INCLUDES
-#include <CEUnitTestSuiteClass.h>
-#include <EUnitDecorators.h>
-
-// FORWARD DECLARATION
-class CNSmlDevInfExtDataContainerPlugin;
-
-// CLASS DEFINITION
-/**
- * Unit test class for Device info extension management interface
- * (ECom plugin).
- */
-NONSHARABLE_CLASS( CDevInfExtMgmtIf_Test )
-	: public CEUnitTestSuiteClass
-    {
-    public:  // Constructors and destructor
-
-        static CDevInfExtMgmtIf_Test* NewL();
-        static CDevInfExtMgmtIf_Test* NewLC();
-        ~CDevInfExtMgmtIf_Test();
-
-    private: // Constructors
-
-        CDevInfExtMgmtIf_Test();
-        void ConstructL();
-
-    private:
-        // Setup and teardown
-        void Empty() {};
-        void SetupEmptyL();
-        void SetupOneXNamL();
-        void SetupMultipleXNamL();
-        void Teardown();
-
-        // Test methods
-        void NewLL();
-        void TestEmptyPluginL();
-        void TestOneXNamPluginL();
-        void TestMultipleXNamPluginL();
-
-        // Utilities
-        void PrintExtensions();
-
-    private: // Data
-        CNSmlDevInfExtDataContainerPlugin* iEcomPlugin;
-
-    EUNIT_DECLARE_TEST_TABLE;
-
-    };
-
-#endif // __DEVINFEXTMGMTIF_TEST_H__
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/devinfextmgmtinterface/dllmain.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  DllMain file for device info extension management
-*  interface unit tests.
-*
-*/
-
-//  EXTERNAL INCLUDES
-#include <CEUnitTestSuite.h>
-#include "devinfextmgmtif_test.h"
-
-/**
-* UT_nsmldscontactsdataprovider.dll test suite factory function.
-*/
-EXPORT_C MEUnitTest* CreateTestSuiteL()
-    {
-    CEUnitTestSuite* rootSuite = 
-        CEUnitTestSuite::NewLC( _L( "Unit test for DevInfo extension mgmt interface" ) );
-
-    MEUnitTest* extMgmtIfSuite = CDevInfExtMgmtIf_Test::NewL();
-    CleanupStack::PushL( extMgmtIfSuite );
-    rootSuite->AddL( extMgmtIfSuite );
-    CleanupStack::Pop( extMgmtIfSuite );
-
-    CleanupStack::Pop( rootSuite );
-
-    return rootSuite;
-    }
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/data/exampledevinfextdatacontainerplugin.rss	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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:  Registery info for Device Info Extension Data Container Plugin.
-*/
-
-#include <RegistryInfoV2.rh>
-
-RESOURCE REGISTRY_INFO theRegistryInfo
-  {
-  resource_format_version = RESOURCE_FORMAT_VERSION_2;
-  dll_uid = 0x2002DC7D; // Interface implementation UID
-  interfaces = 
-      {
-      INTERFACE_INFO
-          {
-          interface_uid = 0x2002DC7C; // Interface UID
-          implementations = 
-            {
-            IMPLEMENTATION_INFO
-                {
-                implementation_uid = 0x2002DC7D; // Interface implementation UID
-                version_no = 1; 
-                display_name = "DevInfo extension data plugin";
-                default_data = "";
-                opaque_data = "";
-                rom_only = 1;
-                }
-            };
-          }
-      };
-    }
-
-// End of File  
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/*
-* 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:  Device Info Extension Data Container Plugin header file.
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_MMPFILES
-./exampledevinfextdatacontainerplugin.mmp
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/def/bwinscwexampledevinfextdatacontainerpluginu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/def/eabiexampledevinfextdatacontainerpluginu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZTI36CExampleDevInfExtDataContainerPlugin @ 2 NONAME
-	_ZTV36CExampleDevInfExtDataContainerPlugin @ 3 NONAME
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/group/exampledevinfextdatacontainerplugin.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* 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:  Device Info Extension Data Container Plugin header file.
-*
-*/
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-CAPABILITY CAP_ECOM_PLUGIN
-
-TARGET          exampledevinfextdatacontainerplugin.dll
-TARGETPATH      PLUGINS_1_DIR
-TARGETTYPE      PLUGIN
-UID             0x10009D8D 0x2002DC7D
-VENDORID        VID_DEFAULT
-
-#if defined(ARMCC)
-DEFFILE            ./def/eabiexampledevinfextdatacontainerplugin
-#elif defined(WINSCW)
-DEFFILE            ./def/bwinscwexampledevinfextdatacontainerplugin
-#endif
-
-SOURCEPATH      ../src
-SOURCE          exampledevinfextdatacontainerplugin.cpp
-SOURCE          exampledevinfextdatacontainerplugindllmain.cpp
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE 	/epoc32/include/ecom
-
-USERINCLUDE     ../inc
-
-SOURCEPATH      ../data
-START RESOURCE exampledevinfextdatacontainerplugin.rss
-    HEADER
-    TARGET exampledevinfextdatacontainerplugin.rsc
-    TARGETPATH ECOM_RESOURCE_DIR
-    LANG    sc
-END
-
-LIBRARY        ecom.lib
-LIBRARY        euser.lib
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/inc/exampledevinfextdatacontainerplugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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:  Example Device Info Extension Data Container Plugin 
-*  header file.
-*
-*/
-
-#ifndef __EXAMPLEDEVINFEXTDATACONTAINERPLUGIN_H__
-#define __EXAMPLEDEVINFEXTDATACONTAINERPLUGIN_H__
-
-// EXTERNAL INCLUDES
-#include <nsmldevinfextdatacontainerplugin.h>
-
-// FORWARD DECLARATIONS
-class CDesCArrayFlat;
-
-//  CONSTANTS
-const TUint KExampleDevInfExtDataContainerImplUid = 0x2002DC7D;
-const TInt KExtensionElementMaxLength = 50;
-
-// CLASS DEFINITION
-/**
- * Type definition for TExampleDevInfExtExtensionItem, which holds
- * the contents for a single extension (i.e. XNam value + 0..N 
- * XVal values). Note that this type is only for testing purposes,
- * e.g. the maximum length of the XNam/XVal elements is set to 
- * 50 characters.
- */
-NONSHARABLE_CLASS( TExampleDevInfExtExtensionItem )
-    {
-    public:
-        TBuf8< KExtensionElementMaxLength > iXNam;
-        RArray< TBuf8 < KExtensionElementMaxLength > > iXValArray;
-    };
-
-
-// CLASS DEFINITION
-/**
- * CExampleDevInfExtDataContainerPlugin is an example plugin,
- * which implements the CNSmlDevInfExtDataContainerPlugin ECom interface.
- * The example plugin is primarily used for unit test purposes.
- * It allows modifying the XNam & XVal entries stored in the plugin,
- * which in turn makes it possible to test the plugin interface
- * with different configurations.
- * 
- * Note that the maximum length for the XNam & XVal is limited to
- * 50 characters; with longer strings the values become truncated
- * to 50 characters.
- */
-class CExampleDevInfExtDataContainerPlugin : 
-    public CNSmlDevInfExtDataContainerPlugin
-    {
-
-    public:  // Constructor(s) and destructor
-        ~CExampleDevInfExtDataContainerPlugin();
-        CExampleDevInfExtDataContainerPlugin();
-        void ConstructL();
-        static CExampleDevInfExtDataContainerPlugin* NewL();
-    
-    public: // From CNSmlDevInfExtDataContainerPlugin
-        TInt GetExtensionCountL();
-        const TDesC8& GetExtNameL( TInt aExtIndex );
-        TInt GetExtValueCountL( TInt aExtIndex );
-        const TDesC8& GetExtValueL( TInt aExtIndex, TInt aValueIndex );
-
-    public:  // New methods
-        /**
-         * Removes all extension definitions currently configured
-         *  to the plugin. After a call to this method, the extension
-         *  count is zero.
-         */
-        void ClearExtensions();
-        
-        /**
-         * Inserts a new extension with the given XNam name and XVal value
-         * to the plugin. If there are multiple XVal to be defined per
-         * XNam, this method shall be called multiple times with the same
-         * XNam value.
-         * 
-         * @param aXNam XNam value for the extension to be added.
-         * @param aXVal XVal value for the extension to be added.
-         */
-        void InsertExtension( const TDesC8& aXNam, const TDesC8& aXVal );
-        
-        /**
-         * Removes the given extensions from the Plugin. If an extension with
-         * the given XNam name is not found, does nothing.
-         * 
-         * @param aXNam The XNam value for the extension to be removed.
-         */
-        void RemoveExtension( const TDesC8& aXNam );
-
-    private:  // Private utility methods
-        TInt FindExtensionIndex( const TDesC8& aXNam );
-        void AddXValToItem( const TInt aIndex, const TDesC8& aXVal );
-        void AddNewXValItem( const TDesC8& aXNam, const TDesC8& aXVal );
-        
-    private:  // Data
-        RArray< TExampleDevInfExtExtensionItem > iExtensionArray;
-
-    };
-        
-#endif // __EXAMPLEDEVINFEXTDATACONTAINERPLUGIN_H__
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/src/exampledevinfextdatacontainerplugin.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
-* 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:  Example Device Info Extension Data Container Plugin source file.
-*
-*/
-
-// EXTERNAL INCLUDES
-#include <e32base.h>
-
-// CLASS HEADER
-#include "exampledevinfextdatacontainerplugin.h"
-
-// -----------------------------------------------------------------------------
-// CExampleDevInfExtDataContainerPlugin::CExampleDevInfExtDataContainerPlugin()
-// -----------------------------------------------------------------------------
-CExampleDevInfExtDataContainerPlugin::CExampleDevInfExtDataContainerPlugin()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::ConstructL()
-// -----------------------------------------------------------------------------
-void CExampleDevInfExtDataContainerPlugin::ConstructL()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CExampleDevInfExtDataContainerPlugin* CExampleDevInfExtDataContainerPlugin::NewL()
-// -----------------------------------------------------------------------------
-CExampleDevInfExtDataContainerPlugin* CExampleDevInfExtDataContainerPlugin::NewL()
-    {
-    CExampleDevInfExtDataContainerPlugin* self = 
-        new (ELeave) CExampleDevInfExtDataContainerPlugin();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-    
-// -----------------------------------------------------------------------------
-// CExampleDevInfExtDataContainerPlugin::~CExampleDevInfExtDataContainerPlugin()
-// -----------------------------------------------------------------------------
-CExampleDevInfExtDataContainerPlugin::~CExampleDevInfExtDataContainerPlugin()
-    {
-    for( TInt i = 0; i < iExtensionArray.Count(); i++ )
-        {
-        iExtensionArray[ i ].iXValArray.Close();
-        }
-    iExtensionArray.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// TInt CExampleDevInfExtDataContainerPlugin::GetExtensionCountL()
-// -----------------------------------------------------------------------------
-TInt CExampleDevInfExtDataContainerPlugin::GetExtensionCountL()
-    {
-    return iExtensionArray.Count();
-    }
-
-// -----------------------------------------------------------------------------
-// const TDesC8& CExampleDevInfExtDataContainerPlugin::GetExtNameL()
-// -----------------------------------------------------------------------------
-const TDesC8& CExampleDevInfExtDataContainerPlugin::GetExtNameL( TInt aExtIndex )
-    {
-    if( aExtIndex < 0 || aExtIndex >= iExtensionArray.Count() )
-        {
-        // Illegal index
-        User::Leave( KErrArgument );
-        }
-
-    return iExtensionArray[ aExtIndex ].iXNam;
-    }
-
-// -----------------------------------------------------------------------------
-// TInt CExampleDevInfExtDataContainerPlugin::GetExtValueCountL()
-// -----------------------------------------------------------------------------
-TInt CExampleDevInfExtDataContainerPlugin::GetExtValueCountL( TInt aExtIndex )
-    {
-    if( aExtIndex < 0 || aExtIndex >= iExtensionArray.Count() )
-        {
-        // Illegal index
-        User::Leave( KErrArgument );
-        }
-
-    return iExtensionArray[ aExtIndex ].iXValArray.Count();
-    }
-
-// -----------------------------------------------------------------------------
-// const TDesC8& CExampleDevInfExtDataContainerPlugin::GetExtValueL()
-// -----------------------------------------------------------------------------
-const TDesC8& CExampleDevInfExtDataContainerPlugin::GetExtValueL( TInt aExtIndex, 
-    TInt aValueIndex )
-    {
-
-    // Check for illegal indices
-    if( aExtIndex < 0 || aExtIndex >= iExtensionArray.Count() )
-        {
-        User::Leave( KErrArgument );
-        }
-    if( aValueIndex < 0 || 
-        aValueIndex >= iExtensionArray[ aExtIndex ].iXValArray.Count() )
-        {
-        User::Leave( KErrArgument );
-        }
-
-    return iExtensionArray[ aExtIndex ].iXValArray[ aValueIndex ];
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::ClearExtensions()
-// -----------------------------------------------------------------------------
-void CExampleDevInfExtDataContainerPlugin::ClearExtensions()
-    {
-    for( TInt i = 0; i < iExtensionArray.Count(); i++ )
-        {
-        iExtensionArray[ i ].iXValArray.Reset();
-        }
-    iExtensionArray.Reset();
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::InsertExtension()
-// -----------------------------------------------------------------------------
-void CExampleDevInfExtDataContainerPlugin::InsertExtension(
-    const TDesC8& aXNam, const TDesC8& aXVal )
-    {
-    TInt index = FindExtensionIndex( aXNam );
-    if( index != KErrNotFound )
-        {
-        AddXValToItem( index, aXVal );
-        }
-    else
-        {
-        AddNewXValItem( aXNam, aXVal );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::RemoveExtension()
-// -----------------------------------------------------------------------------
-void CExampleDevInfExtDataContainerPlugin::RemoveExtension( const TDesC8& aXNam )
-    {
-    TInt index = FindExtensionIndex( aXNam );
-    if( index != KErrNotFound )
-        {
-        iExtensionArray.Remove( index );    
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::FindExtensionIndex()
-// -----------------------------------------------------------------------------
-TInt CExampleDevInfExtDataContainerPlugin::FindExtensionIndex( 
-    const TDesC8& aXNam )
-    {
-    TInt index = KErrNotFound;
-
-    for( TInt i = 0; i < iExtensionArray.Count(); i++ )
-        {
-        TExampleDevInfExtExtensionItem item = iExtensionArray[ i ];
-        if( aXNam.Compare( item.iXNam ) == 0 )
-            {
-            index = i;
-            break;
-            }
-        }
-    return index;
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::AddXValToItem()
-// -----------------------------------------------------------------------------
-void CExampleDevInfExtDataContainerPlugin::AddXValToItem(
-        const TInt aIndex, const TDesC8& aXVal )
-    {
-    ASSERT( aIndex >= 0 );
-    ASSERT( aIndex < iExtensionArray.Count() );
-
-    if( aXVal.Length() == 0 )
-        {
-        // No XVal set, do not insert anything to XVal array
-        return;
-        }
-    else if( aXVal.Length() <= KExtensionElementMaxLength )
-        {
-        iExtensionArray[ aIndex ].iXValArray.Append( aXVal );
-        }
-    else
-        {
-        iExtensionArray[ aIndex ].iXValArray.Append( 
-            aXVal.Left( KExtensionElementMaxLength ) );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// void CExampleDevInfExtDataContainerPlugin::AddNewXValItem()
-// -----------------------------------------------------------------------------
-void CExampleDevInfExtDataContainerPlugin::AddNewXValItem( 
-    const TDesC8& aXNam, const TDesC8& aXVal )
-    {    
-    TExampleDevInfExtExtensionItem item;
-
-    // Insert XNam
-    if( aXNam.Length() <= KExtensionElementMaxLength )
-        {
-        item.iXNam = aXNam;
-        }
-    else
-        {
-        item.iXNam = aXNam.Left( KExtensionElementMaxLength );
-        }
-
-    // Insert XVal
-    if( aXVal.Length() > 0 )
-        {
-        if( aXVal.Length() <= KExtensionElementMaxLength )
-            {
-            item.iXValArray.Append( aXVal );
-            }
-        else
-            {
-            item.iXValArray.Append( aXVal.Left( KExtensionElementMaxLength ) );
-            }
-        }
-
-    // Add to extension array as a new entry
-    iExtensionArray.Append( item );
-    }
-
-// End of file        
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/exampledevinfextdataplugin/src/exampledevinfextdatacontainerplugindllmain.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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:  Example Device Info Extension Data Container Plugin 
-*  implementation group proxy definitions.
-*
-*/
-
-// EXTERNAL INCLUDES
-#include <ImplementationProxy.h>
-
-// INTERNAL INCLUDES
-#include "exampledevinfextdatacontainerplugin.h"
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy array
-// -----------------------------------------------------------------------------
-//
-#ifndef IMPLEMENTATION_PROXY_ENTRY
-#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) {{aUid},(aFuncPtr)}
-#endif
-
-const TImplementationProxy ImplementationTable[] = 
-    {
-    IMPLEMENTATION_PROXY_ENTRY( KExampleDevInfExtDataContainerImplUid, 
-        CExampleDevInfExtDataContainerPlugin::NewL )
-    };
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
-    {
-    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-    return ImplementationTable;
-    }
-    
-// End of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build info file for DS operator settings unit tests.
-*
-*/
-
-//#include <platform_paths.hrh>
-
-PRJ_MMPFILES
-UT_nsmldsoperatorsettings.mmp
-
-PRJ_EXPORTS
-testdata/2001E2E1.txt   /epoc32/release/winscw/udeb/z/private/10202be9/2001E2E1.txt
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/def/bwinscwdsoperatorsettings_testu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/def/eabidsoperatorsettings_testu.def	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	_Z16CreateTestSuiteLv @ 1 NONAME
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/dllmain.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  DllMain file for operator settings unit tests.
-*
-*/
-
-// INCLUDES
-#include <CEUnitTestSuite.h>
-#include "nsmldsoperatorsettings_test.h"
-#include <nsmldebug.h>
-/**
-* ut_nsmldsoperatorsettings.dll test suite factory function.
-*/
-EXPORT_C MEUnitTest* CreateTestSuiteL()
-    {
-    _DBG_FILE(_S8("CreateTestSuiteL : Begin"));
-    CEUnitTestSuite* rootSuite = 
-        CEUnitTestSuite::NewLC( _L( "Unit test for operator settings" ) );
-
-    // Unit tests for operator settings class (CNSmlDSOperatorSettings)
-    MEUnitTest* settingsSuite = CNSmlDSOperatorSettings_Test::NewL();
-    CleanupStack::PushL( settingsSuite );
-    rootSuite->AddL( settingsSuite );
-    CleanupStack::Pop( settingsSuite );
-
-    CleanupStack::Pop( rootSuite );
-
-    _DBG_FILE(_S8("CreateTestSuiteL : Begin"));
-    return rootSuite;
-    }
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/nsmldsoperatorsettings_test.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-/*
-* 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:  Operator settings unit tests
-*
-*/
-
-// INTERNAL INCLUDES
-#include "nsmldsoperatorsettings_test.h"
-
-// EXTERNAL INCLUDES
-#include <NSmlDSOperatorSettings.h>
-#include <EUnitMacros.h>
-#include <centralrepository.h> //CRepository
-#include <nsmloperatordatacrkeys.h> // KCRUidOperatorDatasyncInternalKeys
-
-// CONSTANTS
-
-// - Construction -----------------------------------------------------------
-
-CNSmlDSOperatorSettings_Test* CNSmlDSOperatorSettings_Test::NewL()
-    {
-    CNSmlDSOperatorSettings_Test* self = CNSmlDSOperatorSettings_Test::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-CNSmlDSOperatorSettings_Test* CNSmlDSOperatorSettings_Test::NewLC()
-    {
-    CNSmlDSOperatorSettings_Test* self = new( ELeave ) CNSmlDSOperatorSettings_Test();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-CNSmlDSOperatorSettings_Test::~CNSmlDSOperatorSettings_Test()
-    {
-
-    }
-
-CNSmlDSOperatorSettings_Test::CNSmlDSOperatorSettings_Test()
-    {
-    
-    }
-
-void CNSmlDSOperatorSettings_Test::ConstructL()
-    {
-    CEUnitTestSuiteClass::ConstructL();
-    CRepository* rep = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys );
-    rep->Reset();
-    delete rep;
-    }
-
-// - Setup & teardown ---------------------------------------------------------
-
-// ++++++++++++ SETUP METHODS ++++++++++++
-
-void CNSmlDSOperatorSettings_Test::SetupL()
-    {
-    iOperatorSettings = CNSmlDSOperatorSettings::NewL();
-    }
-
-//// ++++++++++++ TEARDOWN METHODS ++++++++++++
-//
-void CNSmlDSOperatorSettings_Test::Teardown()
-    {
-    delete iOperatorSettings;
-    iOperatorSettings = NULL;
-    }
-
-// - Test methods -------------------------------------------------------------
-
-// MEMORY ALLOCATION FOR DATASTORE
-void CNSmlDSOperatorSettings_Test::NewLL()
-    {
-    CNSmlDSOperatorSettings* settings = NULL;
-    EUNIT_ASSERT_NO_LEAVE( settings = CNSmlDSOperatorSettings::NewL() );
-    EUNIT_ASSERT( settings );
-    delete settings;
-    }
-
-void CNSmlDSOperatorSettings_Test::IsOperatorProfileLL()
-    {
-    EUNIT_ASSERT( iOperatorSettings->IsOperatorProfileL( _L("www.test.com") ) )
-    EUNIT_ASSERT( !iOperatorSettings->IsOperatorProfileL( _L("www.test2.com") ) )    
-    }
-
-void CNSmlDSOperatorSettings_Test::CustomSwvValueLCL()
-    {
-    HBufC8* swv( NULL );
-    swv = iOperatorSettings->CustomSwvValueLC();
-    EUNIT_PRINT( *swv );
-    if( swv->Compare( _L8("1.0") ) != 0 )
-        {
-        EUNIT_FAIL_TEST( "Wrong software value" );
-        }
-    CleanupStack::PopAndDestroy( swv );
-    }
-
-void CNSmlDSOperatorSettings_Test::CustomModValueLCL()
-    {
-    HBufC8* model( NULL );
-    model = iOperatorSettings->CustomModValueLC();
-    EUNIT_PRINT( *model );
-    if( model->Compare( _L8("Mod") ) != 0 )
-        {
-        EUNIT_FAIL_TEST( "Wrong model value" );
-        }
-    CleanupStack::PopAndDestroy( model );
-    }
-
-void CNSmlDSOperatorSettings_Test::CustomManValueLCL()
-    {
-    HBufC8* manufacturer( NULL );
-    manufacturer = iOperatorSettings->CustomManValueLC();
-    EUNIT_PRINT( *manufacturer );
-    if( manufacturer->Compare( _L8("Nokia") ) != 0 )
-        {
-        EUNIT_FAIL_TEST( "Wrong manufacturer value" );
-        }
-    CleanupStack::PopAndDestroy( manufacturer );
-    }
-
-
-void CNSmlDSOperatorSettings_Test::PopulateStatusCodeListLL()
-    {
-    RArray< TInt > statusCodeArray;
-    iOperatorSettings->PopulateStatusCodeListL( statusCodeArray );
-    for( TInt i = 0; i < statusCodeArray.Count(); i++ )
-        {
-        TBuf<10> code;
-        TInt j = statusCodeArray[ i ];
-        code.AppendNum( j );
-        EUNIT_PRINT( code );
-        }
-
-    EUNIT_ASSERT( statusCodeArray[ 0 ] == 211 );
-    EUNIT_ASSERT( statusCodeArray[ 1 ] == 400 );
-    EUNIT_ASSERT( statusCodeArray[ 2 ] == 401 );
-    EUNIT_ASSERT( !( statusCodeArray[ 3 ] == 401 ) );
-
-    statusCodeArray.Close();
-    }
-
-// - EUnit test table -------------------------------------------------------
-
-EUNIT_BEGIN_TEST_TABLE(
-    CNSmlDSOperatorSettings_Test,
-    "Unit test for operator settings",
-    "UNIT" )
-
-EUNIT_TEST(
-    "Test to verify memory allocation for the object",
-    "CNSmlDSOperatorSettings",
-    "NewL",
-    "FUNCTIONALITY",
-    Empty, NewLL, Empty)
-
-EUNIT_TEST(
-    "Test to if profile is operator profile",
-    "CNSmlDSOperatorSettings",
-    "IsOperatorProfileL",
-    "FUNCTIONALITY",
-    SetupL, IsOperatorProfileLL, Teardown )
-
-EUNIT_TEST(
-    "Test to verify Swv value",
-    "CNSmlDSOperatorSettings",
-    "CustomSwvValueLC",
-    "FUNCTIONALITY",
-    SetupL, CustomSwvValueLCL, Teardown )
-
-EUNIT_TEST(
-    "Test to verify Model value",
-    "CNSmlDSOperatorSettings",
-    "CustomModValueLC",
-    "FUNCTIONALITY",
-    SetupL, CustomModValueLCL, Teardown )
-
-EUNIT_TEST(
-    "Test to verify Manufacture value",
-    "CNSmlDSOperatorSettings",
-    "CustomManValueLC",
-    "FUNCTIONALITY",
-    SetupL, CustomManValueLCL, Teardown )
-
-EUNIT_TEST(
-    "Test to verify status code values",
-    "CNSmlDSOperatorSettings",
-    "PopulateStatusCodeListL",
-    "FUNCTIONALITY",
-    SetupL, PopulateStatusCodeListLL, Teardown )
-
-EUNIT_END_TEST_TABLE
-
-//  End of File
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/nsmldsoperatorsettings_test.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* 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:  Header file for operator settings unit tests.
-*
-*/
-
-#ifndef __NSMLDSOPERATORSETTINGS_TEST_H
-#define __NSMLDSOPERATORSETTINGS_TEST_H
-
-// INCLUDES
-#include <CEUnitTestSuiteClass.h>
-#include <EUnitDecorators.h>
-
-// FORWARD DECLARATIONS
-class CNSmlDSOperatorSettings;
-
-NONSHARABLE_CLASS( CNSmlDSOperatorSettings_Test ): public CEUnitTestSuiteClass
-    {
-    public:
-        static CNSmlDSOperatorSettings_Test* NewL();
-        static CNSmlDSOperatorSettings_Test* NewLC();
-       ~CNSmlDSOperatorSettings_Test();
-
-    private: // Constructors
-
-        CNSmlDSOperatorSettings_Test();
-        void ConstructL();
-
-    private: // New methods
-
-        void Empty() {};
-
-        void SetupL();
-
-        void Teardown();
-        
-        void NewLL();
-        
-        void IsOperatorProfileLL();
-
-        void CustomSwvValueLCL();
-
-        void CustomModValueLCL();
-
-        void CustomManValueLCL();
-        
-        void PopulateStatusCodeListLL();
-	
-    private: // data
-        
-        CNSmlDSOperatorSettings* iOperatorSettings;
-        
-        EUNIT_DECLARE_TEST_TABLE;
-    };
-
-#endif // __NSMLDSOPERATORSETTINGS_TEST_H
-
-// End of File  
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/readme.txt	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-WARNING
-
-- Central repository file 2001E2E1.txt is copied from forder operatorsettings\testdata to 
-  epoc32\release\winscw\udeb\z\private\10202be9 that we can test return values of CNSmlDSOperatorSettings API
-
-- After running module unit tests, user must replace test central repository file 2001E2E1.txt with 
-  right platform Central repository file, otherwise emulator might not work correctly.
Binary file remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/testdata/2001E2E1.txt has changed
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/operatorsettings/ut_nsmldsoperatorsettings.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  MMP file for operator settings unit tests.
-*
-*/
-
-#include <Digia/Eunit/EUnitCaps.h>
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-// DEFINES
-MACRO 			__NSML_MODULETEST__
-
-// Build target
-TARGET          ut_nsmldsoperatorsettings.dll
-TARGETTYPE      dll
-UID             0x1000af5a 0x01700000
-
-CAPABILITY      EUNIT_CAPS
-VENDORID        0x00000000
-
-#if defined(ARMCC)
-DEFFILE		./def/eabidsoperatorsettings_test
-#elif defined(WINSCW)
-DEFFILE		./def/bwinscwdsoperatorsettings_test
-#endif
-
-// Source files
-SOURCEPATH      .
-SOURCE          dllmain.cpp
-SOURCE          nsmldsoperatorsettings_test.cpp
-
-// Code under test
-//SOURCEPATH      ../../../../syncmlfw/ds/settings/src
-//SOURCE          NSmlDSOperatorSettings.cpp
-
-// Include paths
-USERINCLUDE     . ../../../../syncmlfw/ds/settings/inc
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE 	/epoc32/include/ecom
-SYSTEMINCLUDE 	/epoc32/include/syncml
-SYSTEMINCLUDE	/epoc32/include/internal
-SYSTEMINCLUDE   /epoc32/include/Digia/EUnit
-
-// Dependencies to system components
-LIBRARY         euser.lib
-LIBRARY         EUnit.lib
-LIBRARY         bafl.lib
-LIBRARY         nsmldssettings.lib
-LIBRARY         efsrv.lib
-LIBRARY         cntmodel.lib
-LIBRARY         estor.lib
-LIBRARY         nsmldebug.lib
-LIBRARY			centralrepository.lib
-
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidator.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-// CLASS HEADER
-#include "customdatasynchconfigvalidator.h"
-
-// INTERNAL INCLUDES
-#include "customdatasynchconfigvalidatorenginewrapper.h"
-
-// EXTERNAL INCLUDES
-#include <qmessagebox.h>
-#include <qgraphicseffect.h>
-#include <qlabel.h>
-
-const int TESTNAMECOLUMN = 0;
-const int RESULTCOLUMN = 1;
-const int MOREINFOCOLUMN = 2;
-const QString MOREINFO_SYMBOL = "!";
-const QString MOREINFO_VERIFY_BY_USER_SYMBOL = "?";
-const QString NOK_SYMBOL = "NOK";
-const QString OK_SYMBOL = "OK";
-
-// ----------------------------------------------------------------------------
-void CustomDataSynchConfigValidator::Initialize()
-{
-    //TODO: cleanup QTableWidgetItem settings and harmonize layout for columns
-    QFont font;
-    font.setPointSize(4);
-    ui.buttonTestActivator->setFont(font);
-    for (int r = 0; r < ui.tableWidget->rowCount(); r++) {
-        for (int c = 0; c < ui.tableWidget->columnCount(); c++) {
-            ui.tableWidget->item(r, c)->setFlags(ui.tableWidget->item(r, c)->flags()
-                & ~Qt::ItemIsEditable);
-            ui.tableWidget->item(r, c)->setFont(font);
-        }
-    }
-    //Split columns widths for first time
-    const int descriptionColumnInitialWidth = 260;
-    ui.tableWidget->setColumnWidth(TESTNAMECOLUMN, descriptionColumnInitialWidth);
-    ui.tableWidget->resizeColumnToContents(RESULTCOLUMN);
-    ui.tableWidget->resizeColumnToContents(MOREINFOCOLUMN);
-}
-
-// ----------------------------------------------------------------------------
-CustomDataSynchConfigValidator::CustomDataSynchConfigValidator(QWidget *parent) :
-    QMainWindow(parent)
-{
-    ui.setupUi(this);
-    Initialize();
-
-    mEngineWrapper = new CustomDataSynchConfigValidatorEngineWrapper(this);
-
-    bool connectSucceeded;
-    connectSucceeded = QObject::connect(ui.buttonTestActivator, SIGNAL(clicked()), this,
-        SLOT(activateValidation()));
-    connectSucceeded = QObject::connect(ui.tableWidget, SIGNAL(itemClicked(QTableWidgetItem *)),
-        this, SLOT(handleMoreInfoItemsClicks(QTableWidgetItem *)));
-}
-
-// ----------------------------------------------------------------------------
-void CustomDataSynchConfigValidator::resizeEvent(QResizeEvent* event)
-{
-    //TODO: in basic QT how to detect landscape vs portrait
-    if (ui.tableWidget && ui.tableWidget->isVisible()) {
-        ui.tableWidget->resizeColumnToContents(RESULTCOLUMN);//result column
-        ui.tableWidget->resizeColumnToContents(MOREINFOCOLUMN);//info column
-    }
-    QMainWindow::resizeEvent(event);
-}
-
-// ----------------------------------------------------------------------------
-CustomDataSynchConfigValidator::~CustomDataSynchConfigValidator()
-{
-}
-
-// ----------------------------------------------------------------------------
-void CustomDataSynchConfigValidator::activateValidation()
-{
-    bool cenrepCheck;
-    for (int r = 0; r < ui.tableWidget->rowCount(); r++) {
-        if (matchCheckNameWithTableRowIdAndString(r, "OperatorDataSynchErrorCenrepExistsTest")) {
-            cenrepCheck = mEngineWrapper->operatordataSynchErrorCenrepExists();
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "OperatorDataSynchCenrepExistsTest")) {
-            cenrepCheck = mEngineWrapper->operatordataSynchCenrepExists();
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "DataSynchCenrepExistsTest")) {
-            cenrepCheck = mEngineWrapper->dataSynchCenrepExists();
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "CustomProfilesTest")) {
-            cenrepCheck = mEngineWrapper->customSynchProfilesAllowed();
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "ContactsAdapterAvailabilityTest")) {
-            bool adapterCheck = mEngineWrapper->configuredContactsAdapterExists(
-                mContactsAdapterAvailabilityTestErrorNote);
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(adapterCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(adapterCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "CustomSynchProfileServerIdTest")) {
-            cenrepCheck = mEngineWrapper->configuredCustomSynchProfileExists(mCustomSynchProfileServerIdTestErrorNote);
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "ContactsAdapterSynchProfileTest")) {
-            cenrepCheck = mEngineWrapper->contactAdapterCenrepValueToProfileMatches(mContactsAdapterSynchProfileTestErrorNote);
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : NOK_SYMBOL);
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_SYMBOL);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "MyprofileAdapterSynchProfileTest")) {
-            cenrepCheck = mEngineWrapper->myprofileAdapterCenrepValueToProfileMatches(mMyprofileAdapterSynchProfileTestErrorNote);
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(cenrepCheck ? OK_SYMBOL : "VERIFY");
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(cenrepCheck ? "" : MOREINFO_VERIFY_BY_USER_SYMBOL);
-        }
-        // Check if Device info extension plugin exists
-        else if (matchCheckNameWithTableRowIdAndString(r, "DeviceInfoExtensionPluginTest"))
-        {
-            bool devInfoExtCheck = mEngineWrapper->devInfoExtensionPluginAvailable();
-            ui.tableWidget->item(r, RESULTCOLUMN)->setText(
-                devInfoExtCheck ? OK_SYMBOL : "VERIFY");
-            ui.tableWidget->item(r, MOREINFOCOLUMN)->setText(
-                devInfoExtCheck ? "" : MOREINFO_VERIFY_BY_USER_SYMBOL);
-        }
-        else {
-            continue;
-        }
-    }
-}
-
-// ----------------------------------------------------------------------------
-void CustomDataSynchConfigValidator::handleMoreInfoItemsClicks(
-    QTableWidgetItem *itemClicked)
-{
-    if ((0 == itemClicked->text().compare(MOREINFO_SYMBOL))||(0 == itemClicked->text().compare(MOREINFO_VERIFY_BY_USER_SYMBOL))) {
-        //user wants to have some info,
-        //and possible hint regarding how to solve NOK case
-        int r = itemClicked->row();
-
-        QScopedPointer<QMessageBox> msgBox(new QMessageBox());
-        msgBox->setWindowTitle(ui.tableWidget->verticalHeaderItem(r)->text());
-
-        if (matchCheckNameWithTableRowIdAndString(r, "OperatorDataSynchErrorCenrepExistsTest")) {
-            QString
-                line1 =
-                    "OperatorDataSynchErrorCenrep ini file z:\\private\\10202be9\\2001FDF1.txt was not found from image";
-            QString line2 = "\n\nCheck image creation \\output subfolder for the cenrep ini file.";
-            QString line3 =
-                "\n\nCheck also that .\\s60\\root.confml that operatordatasyncerror.confml is included.";
-            msgBox->setText(line1 + line2 + line3);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "OperatorDataSynchCenrepExistsTest")) {
-            QString line1 =
-                "OperatorDataSynchCenrep ini file z:\\private\\10202be9\\2001E2E1.txt was not found from image";
-            QString line2 = "\n\nCheck image creation \\output subfolder for the cenrep ini file.";
-            QString line3 =
-                "\n\nCheck also that .\\s60\\root.confml that operatordatasyncerror.confml is included.";
-            msgBox->setText(line1 + line2 + line3);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "DataSynchCenrepExistsTest")) {
-            QString line1 =
-                "DataSynchCenrep ini file z:\\private\\10202be9\\2000CF7E.txt was not found from image";
-            QString line2 = "\n\nCheck image creation \\output subfolder for the cenrep ini file.";
-            QString line3 =
-                "\n\nCheck also that .\\s60\\root.confml that operatordatasyncerror.confml is included.";
-            msgBox->setText(line1 + line2 + line3);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "CustomProfilesTest")) {
-            QString line1 =
-                "Support for custom synch profiles defined using z:\\private\\101F99FB\\variantdata.xml is (0) now disabled in cenrep.";
-            QString
-                line2 =
-                    "\n\nCheck that variant.confml has KCRUidDataSyncInternalKeys cenrep key KNsmlDsCustomProfiles set to 1.";
-            QString
-                line3 =
-                    "\n\nCheck also that DataSynchCenrep ini file z:\\private\\10202be9\\2000CF7E.txt exists in image, see check above.";
-            msgBox->setText(line1 + line2 + line3);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "ContactsAdapterAvailabilityTest")) {
-            QString line1 = "Configured contact adapter does not exist.";
-            QString line2 = "\n\n" + mContactsAdapterAvailabilityTestErrorNote;
-            QString line3 = "\n\n";
-            msgBox->setText(line1 + line2 + line3);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "CustomSynchProfileServerIdTest")) {
-            QString line1 = "ServerId match failed."+mCustomSynchProfileServerIdTestErrorNote;
-            QString line2 = 
-                "\n\noperator datasync cenrep z:\\private\\10202be9\\2001E2E1.txt and synch profile was not found.";
-            QString line3 = "\n\nCheck variantdata.xml also.";
-            msgBox->setText(line1 + line2 + line3);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "ContactsAdapterSynchProfileTest")) {
-            QString errorMsg = mContactsAdapterSynchProfileTestErrorNote;
-            msgBox->setText(errorMsg);
-        }
-        else if (matchCheckNameWithTableRowIdAndString(r, "MyprofileAdapterSynchProfileTest")) {
-            QString errorMsg = mMyprofileAdapterSynchProfileTestErrorNote;
-            msgBox->setText(errorMsg);
-        }
-        // DevInfo extension error note
-        else if (matchCheckNameWithTableRowIdAndString(r, "DeviceInfoExtensionPluginTest")) {
-            msgBox->setText("DevInfo extension plugin not found.");
-        }
-        QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
-        effect->setOpacity(0.85);
-        msgBox->setGraphicsEffect(effect);
-        msgBox->exec();
-    }
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidator::matchCheckNameWithTableRowIdAndString(
-    int row, QString matchString)
-{
-    bool match = ui.tableWidget->verticalHeaderItem(row)->text().compare(matchString) == 0 ? true
-        : false;
-    return match;
-}
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidator.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef CUSTOMDATASYNCHCONFIGVALIDATOR_H
-#define CUSTOMDATASYNCHCONFIGVALIDATOR_H
-
-#include <QtGui/QMainWindow>
-#include "ui_synchconfigvalidator.h"
-
-// FORWARD DECLARATIONS
-class CustomDataSynchConfigValidatorEngineWrapper;
-
-class CustomDataSynchConfigValidator : public QMainWindow
-{
-    Q_OBJECT
-    
-public:
-    CustomDataSynchConfigValidator(QWidget *parent = 0);
-    ~CustomDataSynchConfigValidator();
-
-protected:
-    void resizeEvent (QResizeEvent* event);
-
-private:
-    Ui::CustomDataSynchConfigValidator ui;
-    void Initialize();
-    bool matchCheckNameWithTableRowIdAndString(int row, QString matchString);
-
-public Q_SLOTS:
-    void activateValidation();
-    void handleMoreInfoItemsClicks(QTableWidgetItem *itemClicked);
-
-private:
-    CustomDataSynchConfigValidatorEngineWrapper *mEngineWrapper;
-    QString mContactsAdapterAvailabilityTestErrorNote;
-    QString mCustomSynchProfileServerIdTestErrorNote;
-    QString mContactsAdapterSynchProfileTestErrorNote;
-    QString mMyprofileAdapterSynchProfileTestErrorNote;
-};
-
-#endif // CUSTOMDATASYNCHCONFIGVALIDATOR_H
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorengine_p.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,463 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-// CLASS HEADER
-#include "customdatasynchconfigvalidatorengine_p.h"
-
-// INTERNAL INCLUDES
-#include "customdatasynchconfigvalidatorenginewrapper.h"
-#include "customdatasynchdeviceinfo.h"
-
-// EXTERNAL INCLUDES
-#include <etel3rdparty.h>
-#include <sysutil.h>
-#include <centralrepository.h>
-#include <ecom/ecom.h>
-#include <e32def.h>
-#include <utf.h>
-#include <nsmloperatordatacrkeys.h>
-#include <nsmloperatorerrorcrkeys.h>
-#include <syncmlclientds.h>
-
-#include <d32dbms.h>
-#include <f32file.h>
-
-const TUid KCRUidDatasyncKeys = { 0x2000CF7E };
-const TUint32 KDataSynchCustomProfileKey = 0x0;
-const QString SERVERID_DB_COLUMN_NAME = "ServerId";
-const QString PROFILEID_DB_COLUMN_NAME = "Id";
-
-// Utility clean up function
-void CleanupEComArray(TAny* aArray);
-
-// ----------------------------------------------------------------------------
-CustomDataSynchConfigValidatorEngine::CustomDataSynchConfigValidatorEngine(
-    CustomDataSynchConfigValidatorEngineWrapper *parent) :
-    q(parent)
-{
-}
-
-// ----------------------------------------------------------------------------
-CustomDataSynchConfigValidatorEngine::~CustomDataSynchConfigValidatorEngine()
-{
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::dataSynchCenrepExists()
-{
-    int initError = KErrGeneral;
-    TRAP(initError,
-        CRepository* dataSynchCenrep = CRepository::NewL(KCRUidDatasyncKeys);
-        delete dataSynchCenrep;
-    )
-    return (initError == KErrNone ? true : false);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::operatordataSynchCenrepExists()
-{
-    int initError = KErrGeneral;
-    TRAP(initError,
-        CRepository* operatordataSynchCenrep = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys);
-        delete operatordataSynchCenrep;
-    )
-    return (initError == KErrNone ? true : false);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::operatordataSynchErrorCenrepExists()
-{
-    int initError = KErrGeneral;
-    TRAP(initError,
-        CRepository* operatordataSynchErrorCenrep = CRepository::NewL(KCRUidOperatorDatasyncErrorKeys);
-        delete operatordataSynchErrorCenrep;
-    )
-    return (initError == KErrNone ? true : false);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::customSynchProfilesAllowed()
-{
-    int initError = KErrGeneral;//CRepository::Get or CRepository::NewL
-    int customProfileKeyValue = 0;//value 1 means allowed
-    TRAP(initError,
-        CRepository* dataSynchCenrep = CRepository::NewL(KCRUidDatasyncKeys);
-        initError = dataSynchCenrep->Get(KDataSynchCustomProfileKey,customProfileKeyValue);
-        delete dataSynchCenrep;
-    )
-    return (initError == KErrNone && customProfileKeyValue == 1 ? true : false);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::configuredContactsAdapterExists(
-    QString & errorMsg)
-{
-    int initError = KErrGeneral;//CRepository::Get or CRepository::NewL
-    int pluginloadError = KErrGeneral;
-    
-    TUid adapterUid = {0x101F6DDD};//platformcontactadapter Uid
-    
-    TRAP(initError,
-        CRepository* operatordataSynchCenrep = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys);
-    int adapterUidInt = 0;
-    int errorCode = operatordataSynchCenrep->Get(KNsmlOpDsOperatorAdapterUid,adapterUidInt);
-    delete operatordataSynchCenrep;
-    if( adapterUidInt > 0 )
-    {//if greater than 0 custom contact adapter is 'likely' to be used
-        adapterUid = TUid::Uid(adapterUidInt);
-    }
-    )
-    TRAP(pluginloadError,
-        TAny* any = REComSession::CreateImplementationL(adapterUid, _FOFF(CustomDataSynchConfigValidatorEngine, iEComDtorKey));
-        REComSession::DestroyedImplementation(iEComDtorKey);
-    )
-    bool success = (initError == KErrNone && pluginloadError == KErrNone) ? true : false;
-    if(!success)
-    {
-        errorMsg = "Problems loading adapter UID: 0x";
-        errorMsg = errorMsg+QString::number(adapterUid.iUid,16).toUpper(); 
-    }
-    
-    return success;
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::configuredCustomSynchProfileExists(QString & errorMsg)
-{
-    int cenrepError = KErrGeneral;//CRepository::Get or CRepository::NewL
-    bool serverIdmatchFound = false;
-    bool dbOk = false;
-    
-    QString cenrepServerIdString;
-    QString profileServerId;
-    
-    TRAP(cenrepError,      
-        CRepository* operatordataSynchCenrep = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys);
-        TBuf8<50> cenrepServerIdBuf;
-        cenrepError = operatordataSynchCenrep->Get(KNsmlOpDsOperatorSyncServerId,cenrepServerIdBuf);
-        delete operatordataSynchCenrep;
-        HBufC* cenrepServerIdHBufC;
-        cenrepServerIdHBufC = CnvUtfConverter::ConvertToUnicodeFromUtf8L(cenrepServerIdBuf);
-        cenrepServerIdString = QString::fromUtf16(cenrepServerIdHBufC->Ptr(), cenrepServerIdHBufC->Length());
-        delete cenrepServerIdHBufC;
-    )
-    dbOk = getStringValueFromSyncProfileSettingsDb(profileServerId,SERVERID_DB_COLUMN_NAME);
-    serverIdmatchFound = cenrepServerIdString.compare(profileServerId)==0 ? true : false;
-
-    bool success = (cenrepError == KErrNone && dbOk) ? serverIdmatchFound : false;
-    if(!success){
-        errorMsg = "Problems with Cenrep defined ServerId:["+cenrepServerIdString+"]"; 
-    }
-    return success;
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::contactAdapterCenrepValueToProfileMatches(QString & errorMsg)
-{
-    int cenrepError = KErrGeneral;//CRepository::Get or CRepository::NewL
-    
-    TUid cenrepAdapterUid = { 0x101F6DDD };//platformcontactadapter Uid
-    int adapterUidInt = 0;
-    TRAP(cenrepError, 
-        CRepository* operatordataSynchCenrep = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys);
-        cenrepError = operatordataSynchCenrep->Get(KNsmlOpDsOperatorAdapterUid,adapterUidInt);
-        delete operatordataSynchCenrep;
-        )
-    if( adapterUidInt > 0 )
-    {//if greater than 0 custom contact adapter is 'likely' to be used
-        cenrepAdapterUid = TUid::Uid(adapterUidInt);
-    }
-    return adapterCenrepValueToProfileMatches(errorMsg, cenrepAdapterUid);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::myprofileAdapterCenrepValueToProfileMatches(QString & errorMsg)
-{
-    int cenrepError = KErrGeneral;//CRepository::Get or CRepository::NewL  
-    TUid cenrepAdapterUid = { 0x0 };
-    int adapterUidInt = 0;
-    TRAP(cenrepError,
-        CRepository* operatordataSynchCenrep = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys);
-        cenrepError = operatordataSynchCenrep->Get(KNsmlOpDsProfileAdapterUid,adapterUidInt);
-        delete operatordataSynchCenrep;
-    )
-    if( adapterUidInt > 0 )
-    {//if greater than 0 custom contact adapter is 'likely' to be used
-        cenrepAdapterUid = TUid::Uid(adapterUidInt);
-    }    
-    return adapterCenrepValueToProfileMatches(errorMsg, cenrepAdapterUid);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::devInfoExtensionPluginAvailable()
-{
-    TUid devInfoExtensionPluginUid = { 0x2002DC7C };
-    int err = KErrGeneral;
-    bool pluginExists = false;
-    RImplInfoPtrArray implInfoArray;
-    TCleanupItem cleanup( CleanupEComArray, &implInfoArray );
-    TRAP(err,
-        CleanupStack::PushL( cleanup );
-        REComSession::ListImplementationsL(
-            devInfoExtensionPluginUid, implInfoArray );
-    if( err == KErrNone && implInfoArray.Count() > 0 )
-    {
-        pluginExists = true;
-    }
-
-    CleanupStack::PopAndDestroy(); // implInfoArray
-    )
-    return pluginExists;
-}
-
-//
-// Helper functions
-//
-//
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::adapterCenrepValueToProfileMatches(QString & errorMsg, TUid adapterUid)
-{
-    int profileOpenError = KErrGeneral;
-    bool adapterMatchFound = false;
-    
-    int dbProfileId = operatorProfileIdFromProfilesDB();
-    if(dbProfileId<0)
-    {//No profile Id or cenrep server Id could not found
-        errorMsg = "Test cannot proceed. No profile id was acquired or cenrepServerId was not configured.";
-        return false;//RSyncMLDataSyncProfile.OpenL panics
-    }
-    //Get Contact Adapter UID from synch profile 
-    TRAP(profileOpenError,
-        RSyncMLSession syncMLSession;
-        RArray<TSmlProfileId> profiles;
-        syncMLSession.OpenL();
-        CleanupClosePushL(syncMLSession);
-        // Get the list of available profiles into an array
-        syncMLSession.ListProfilesL(profiles, ESmlDataSync);
-        QString dataProviderString = NULL;
-        QString serverDataSourceName;
-    
-        for(int i=0; i < profiles.Count(); i++)
-        {
-            RSyncMLDataSyncProfile profile;
-            profile.OpenL(syncMLSession,profiles[i],ESmlOpenRead);
-            if (!profileOpenError) {//-42 PermissionDenied -> Capabilities problem
-                CleanupClosePushL(profile);
-                RArray<TSmlTaskId> profileTasks;
-                CleanupClosePushL(profileTasks);
-                profile.ListTasksL(profileTasks);
-                for (int j = 0; j < profileTasks.Count(); j++) {
-                    RSyncMLTask task;
-                    task.OpenL(profile, profileTasks[j]);
-                    CleanupClosePushL(task);
-                    if(task.Profile() == dbProfileId)
-                    {
-                        int taskProviderInt = task.DataProvider();
-                        int cenrepProviderInt = adapterUid.iUid;
-                        if(task.DataProvider()==adapterUid.iUid)
-                        {
-                            serverDataSourceName = QString((QChar*) task.ServerDataSource().Ptr(),
-                                task.ServerDataSource().Length());
-                            adapterMatchFound = true;
-                        }
-                    }
-                    CleanupStack::PopAndDestroy(&task);
-                }
-                CleanupStack::PopAndDestroy(&profileTasks);
-                CleanupStack::PopAndDestroy(&profile);
-            }
-        }
-        if(profileOpenError==KErrNone)
-        {
-            profiles.Close();
-        }
-        CleanupStack::PopAndDestroy(&syncMLSession);
-    )
-    bool success = (profileOpenError == KErrNone) ? adapterMatchFound : false;
-    if(!success)
-    {
-        errorMsg = "No match found.";
-        errorMsg = errorMsg + "\n\n [dbProfileId]=("+QString::number(dbProfileId)+")";
-        errorMsg = errorMsg + "\n [cenrepAdapterUid]=\n("+"0x"+QString::number(adapterUid.iUid,16).toUpper()+")";
-        errorMsg = errorMsg + "\n\n [profileOpenError]=("+QString::number(profileOpenError)+")";
-    }
-    return success;
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngine::getStringValueFromSyncProfileSettingsDb(QString& value,QString columnName,QString whereTypeConditionForSql)
-{
-    //profileDbOpenError can be caused by RFs,RDbs,RDbNamedDatabase,RDbTable or RDbView startup sequences
-    int profileDbOpenError = KErrGeneral;
-    bool resultsFromDbWithQuery = false;
-    
-    TPtrC columnNamePtr (static_cast<const TUint16*>(columnName.utf16()), columnName.length());
-       
-    QString syncSettingsDbName = "\\private\\100012a5\\DBS_101F99FB_nsmldssettings.db";
-    QString syncSettingsDbTableProfiles = "Profiles";
-    TPtrC syncSettingsDbNamePtr (static_cast<const TUint16*>(syncSettingsDbName.utf16()), syncSettingsDbName.length());
-    TPtrC syncSettingsDbTableProfilesPtr (static_cast<const TUint16*>(syncSettingsDbTableProfiles.utf16()), syncSettingsDbTableProfiles.length());
-    
-    //Query & where condition handling
-    QString sqlGetProfileQuery = "SELECT * FROM Profiles";
-    if(whereTypeConditionForSql.length()>0)
-    {
-        sqlGetProfileQuery = sqlGetProfileQuery+" WHERE "+whereTypeConditionForSql;
-    }
-    TPtrC sqlQueryPtr (static_cast<const TUint16*>(sqlGetProfileQuery.utf16()), sqlGetProfileQuery.length());
-    
-    //DB INIT
-    RDbNamedDatabase database;
-    RFs fsSession;
-    RDbs rdbSession;
-    RDbTable dbTableProfiles;
-    CDbColSet* dbColSet;
-    RDbView dbView;   
-    TRAP(profileDbOpenError,
-        //DB CONNECT
-        profileDbOpenError = fsSession.Connect();
-        CleanupClosePushL(fsSession);
-        profileDbOpenError = rdbSession.Connect();
-        CleanupClosePushL(rdbSession);
-        int i = 0;
-        profileDbOpenError = KErrGeneral;//else DBMS 2 panic is rised in dbTableProfiles.Open
-        while (i < 10 && profileDbOpenError != KErrNone)
-        {//100ms synchronous waits max. 1sec
-            profileDbOpenError = database.Open(fsSession,syncSettingsDbNamePtr);
-            User::After(100000);
-            i++;
-        }
-        CleanupClosePushL(database);
-        profileDbOpenError = dbTableProfiles.Open( database, syncSettingsDbTableProfilesPtr );
-        CleanupClosePushL(dbTableProfiles);
-    
-        //DB QUERY
-        profileDbOpenError = dbView.Prepare( database, TDbQuery( sqlQueryPtr ), dbView.EReadOnly );
-        CleanupClosePushL(dbView);
-        dbColSet = dbTableProfiles.ColSetL();
-        CleanupStack::PushL(dbColSet);
-    
-        while(profileDbOpenError!=KErrArgument&&dbView.NextL())
-        {//if results and no db error
-            resultsFromDbWithQuery = true;
-            dbView.GetL();
-            if(columnName.compare(PROFILEID_DB_COLUMN_NAME)==0)
-            {//Uint 
-                TUint valueFromDb = dbView.ColUint( dbColSet->ColNo( columnNamePtr ));
-                value.setNum(valueFromDb);
-            }
-            else if(columnName.compare(SERVERID_DB_COLUMN_NAME)==0)
-            {//String types
-                QString valueFromDb ((QChar*)dbView.ColDes( dbColSet->ColNo( columnNamePtr )).Ptr(),
-                    dbView.ColDes(dbColSet->ColNo( columnNamePtr )).Length());
-                value=valueFromDb;
-            }
-        }
-        //DB CLOSE
-        CleanupStack::PopAndDestroy(dbColSet);
-        CleanupStack::PopAndDestroy(5,&fsSession);
-    )
-    
-    return profileDbOpenError == KErrNone ? resultsFromDbWithQuery : false;
-}
-
-// ----------------------------------------------------------------------------
-int CustomDataSynchConfigValidatorEngine::operatorProfileIdFromProfilesDB()
-{
-    int profileId = -1;//Return this value if problems during fetch
-    int cenrepError = KErrGeneral; //CRepository::Get or CRepository::NewL
-    bool dbOk = false;
-    
-    //Find right Synch profile based on trusted cenrep configured Server Id
-    QString profileIdString;
-    QString cenrepServerIdString;
-    
-    TRAP(cenrepError,
-        CRepository* operatordataSynchCenrep = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys);
-        TBuf8<50> cenrepServerIdBuf;
-        cenrepError = operatordataSynchCenrep->Get(KNsmlOpDsOperatorSyncServerId,cenrepServerIdBuf);
-        delete operatordataSynchCenrep;
-        HBufC* cenrepServerIdHBufC;
-        cenrepServerIdHBufC = CnvUtfConverter::ConvertToUnicodeFromUtf8L(cenrepServerIdBuf);
-        cenrepServerIdString = QString::fromUtf16(cenrepServerIdHBufC->Ptr(), cenrepServerIdHBufC->Length());
-        delete cenrepServerIdHBufC;
-    )
-    if(cenrepServerIdString.compare("")==0)
-    {//protect against DBMS panic 2
-        return profileId;//-1
-    }
-    QString whereCondition = SERVERID_DB_COLUMN_NAME+"='"+cenrepServerIdString+"'";
-    dbOk = getStringValueFromSyncProfileSettingsDb(profileIdString,PROFILEID_DB_COLUMN_NAME,whereCondition);
-    if(dbOk)
-    {
-        profileId = profileIdString.toInt();
-    }
-    return profileId;//error handling needs to be done in calling code
-}
-
-// ----------------------------------------------------------------------------
-QString CustomDataSynchConfigValidatorEngine::imei() const
-{
-    QScopedPointer<CDeviceInfo> deviceInfo(CDeviceInfo::NewL());
-    TBuf<CTelephony::KPhoneSerialNumberSize> imei(deviceInfo->imei());
-    return QString::fromUtf16(imei.Ptr(), imei.Length());
-}
-
-// ----------------------------------------------------------------------------
-QString CustomDataSynchConfigValidatorEngine::model() const
-{
-    QScopedPointer<CDeviceInfo> deviceInfo(CDeviceInfo::NewL());
-    TBuf<CTelephony::KPhoneModelIdSize> model(deviceInfo->model());
-    return QString::fromUtf16(model.Ptr(), model.Length());
-}
-
-// ----------------------------------------------------------------------------
-QString CustomDataSynchConfigValidatorEngine::manufacturer() const
-{
-    QScopedPointer<CDeviceInfo> deviceInfo(CDeviceInfo::NewL());
-    TBuf<CTelephony::KPhoneModelIdSize> manufacturer(deviceInfo->manufacturer());
-    return QString::fromUtf16(manufacturer.Ptr(), manufacturer.Length());
-}
-
-// ----------------------------------------------------------------------------
-QString CustomDataSynchConfigValidatorEngine::imsi() const
-{
-    QScopedPointer<CDeviceInfo> deviceInfo(CDeviceInfo::NewL());
-    TBuf<CTelephony::KIMSISize> imsi(deviceInfo->imsi());
-    return QString::fromUtf16(imsi.Ptr(), imsi.Length());
-}
-
-// ----------------------------------------------------------------------------
-QString CustomDataSynchConfigValidatorEngine::softwareVersion() const
-{
-    QString version;
-    TBuf<KSysUtilVersionTextLength> versionBuf;
-    if (SysUtil::GetSWVersion(versionBuf) == KErrNone) {
-        version = QString::fromUtf16(versionBuf.Ptr(), versionBuf.Length());
-    }
-    return version;
-}
-
-// ----------------------------------------------------------------------------
-// CleanupEComArray function is used for cleanup support of locally declared arrays
-void CleanupEComArray(TAny* aArray)
-{
-    (static_cast<RImplInfoPtrArray*> (aArray))->ResetAndDestroy();
-    (static_cast<RImplInfoPtrArray*> (aArray))->Close();
-}
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorengine_p.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef CUSTOMDATASYNCHCONFIGVALIDATORENGINE_H
-#define CUSTOMDATASYNCHCONFIGVALIDATORENGINE_H
-
-// INCLUDES
-#include "customdatasynchconfigvalidatorenginewrapper.h"
-#include <e32base.h>
-
-// CLASS DECLARATION
-class CustomDataSynchConfigValidatorEngine: public QObject, public CBase
-{
-    Q_OBJECT
-    
-public:
-    CustomDataSynchConfigValidatorEngine(CustomDataSynchConfigValidatorEngineWrapper* parent);
-    ~CustomDataSynchConfigValidatorEngine();
-    
-    //Tests
-    bool dataSynchCenrepExists();
-    bool operatordataSynchCenrepExists();
-    bool operatordataSynchErrorCenrepExists();
-    bool customSynchProfilesAllowed();
-    bool configuredContactsAdapterExists(QString & errorMsg);
-    bool configuredCustomSynchProfileExists(QString & errorMsg);
-    bool contactAdapterCenrepValueToProfileMatches(QString & errorMsg);
-    bool myprofileAdapterCenrepValueToProfileMatches(QString & errorMsg);
-
-    /**
-     * Tests whether a device info extension plugin is available
-     * @return True, if plugin is found, false otherwise.
-     */
-    bool devInfoExtensionPluginAvailable();
-    
-private:
-    bool getStringValueFromSyncProfileSettingsDb(QString & value, QString columnName, QString whereTypeConditionForSql="");
-    /*@returns profileId -1 if problems acquiring the op.specific profile Id*/
-    int operatorProfileIdFromProfilesDB();
-    bool adapterCenrepValueToProfileMatches(QString & errorMsg, TUid adapterUid);
-    
-    QString imsi() const;
-    QString imei() const;
-    QString softwareVersion() const;
-    QString model() const;
-    QString manufacturer() const;
-
-private:
-    CustomDataSynchConfigValidatorEngineWrapper* q;//for emitting signals in q
-    TUid iEComDtorKey;
-};
-
-#endif /*CUSTOMDATASYNCHCONFIGVALIDATORENGINE_H*/
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorenginewrapper.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-// CLASS HEADER
-#include "customdatasynchconfigvalidatorenginewrapper.h"
-
-// INTERNAL INCLUDES
-#include "customdatasynchconfigvalidatorengine_p.h"
-
-// ----------------------------------------------------------------------------
-CustomDataSynchConfigValidatorEngineWrapper::CustomDataSynchConfigValidatorEngineWrapper (QObject* parent):
-QObject(parent),engine(new CustomDataSynchConfigValidatorEngine(this))
-{
-}
-
-// ----------------------------------------------------------------------------
-CustomDataSynchConfigValidatorEngineWrapper::~CustomDataSynchConfigValidatorEngineWrapper()
-{
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::dataSynchCenrepExists()
-{
-    return engine->dataSynchCenrepExists();
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::operatordataSynchCenrepExists()
-{
-    return engine->operatordataSynchCenrepExists();
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::operatordataSynchErrorCenrepExists()
-{
-    return engine->operatordataSynchErrorCenrepExists();
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::customSynchProfilesAllowed()
-{
-    return engine->customSynchProfilesAllowed();
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::configuredContactsAdapterExists(QString & errorMsg)
-{
-    return engine->configuredContactsAdapterExists(errorMsg);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::configuredCustomSynchProfileExists(QString & errorMsg)
-{
-    return engine->configuredCustomSynchProfileExists(errorMsg);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::contactAdapterCenrepValueToProfileMatches(QString & errorMsg)
-{
-    return engine->contactAdapterCenrepValueToProfileMatches(errorMsg);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::myprofileAdapterCenrepValueToProfileMatches(QString & errorMsg)
-{
-    return engine->myprofileAdapterCenrepValueToProfileMatches(errorMsg);
-}
-
-// ----------------------------------------------------------------------------
-bool CustomDataSynchConfigValidatorEngineWrapper::devInfoExtensionPluginAvailable()
-{
-    return engine->devInfoExtensionPluginAvailable();
-}
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchconfigvalidatorenginewrapper.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef CUSTOMDATASYNCHCONFIGVALIDATORENGINEWRAPPER_H
-#define CUSTOMDATASYNCHCONFIGVALIDATORENGINEWRAPPER_H
-#include <qobject.h>
-
-// FORWARD DECLARATIONS
-class CustomDataSynchConfigValidatorEngine;
-
-class CustomDataSynchConfigValidatorEngineWrapper : public QObject
-{
-    Q_OBJECT
-    
-public:
-
-    CustomDataSynchConfigValidatorEngineWrapper (QObject* parent = 0);
-    ~CustomDataSynchConfigValidatorEngineWrapper();
-    bool dataSynchCenrepExists();
-    bool operatordataSynchCenrepExists();
-    bool operatordataSynchErrorCenrepExists();
-    bool customSynchProfilesAllowed();
-    bool configuredContactsAdapterExists(QString & errorMsg);
-    bool configuredCustomSynchProfileExists(QString & errorMsg);
-    bool contactAdapterCenrepValueToProfileMatches(QString & errorMsg);
-    bool myprofileAdapterCenrepValueToProfileMatches(QString & errorMsg);
-    bool devInfoExtensionPluginAvailable();
-    
-private:
-    friend class CustomDataSynchConfigValidatorEngine;
-    CustomDataSynchConfigValidatorEngine* engine;
-    
-};
-
-#endif // CUSTOMDATASYNCHCONFIGVALIDATORENGINEWRAPPER_H
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchdeviceinfo.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "customdatasynchdeviceinfo.h"
-
-#include <Etel3rdParty.h>
- 
-CDeviceInfo* CDeviceInfo::NewL()
-    {
-    CDeviceInfo* self = NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-    
-CDeviceInfo* CDeviceInfo::NewLC()
-    {
-    CDeviceInfo* self = new ( ELeave ) CDeviceInfo();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-void CDeviceInfo::ConstructL()
-    {   
-    CActiveScheduler::Add( this );
-    iTelephony = CTelephony::NewL();  
-    iWait = new ( ELeave ) CActiveSchedulerWait();
-    }
-    
-CDeviceInfo::CDeviceInfo()
-:CActive( EPriorityNormal ), iBatteryInfoV1Pkg( iBatteryInfoV1 ),
-        iPhoneIdV1Pkg( iPhoneIdV1 ),
-        iSignalStrengthV1Pckg( iSignalStrengthV1 ),
-        iSubscriberIdV1Pckg( iSubscriberIdV1 )
-    {
-    }
- 
-CDeviceInfo::~CDeviceInfo()
-    {
-    Cancel();
-    delete iTelephony;  
-    }
-
-TBuf<CTelephony::KPhoneSerialNumberSize> CDeviceInfo::imei()
-    {
-    Cancel();
-    iTelephony->GetPhoneId( iStatus, iPhoneIdV1Pkg );
-    SetActive();
-    
-    if ( !iWait->IsStarted() ) 
-        {
-        iWait->Start();
-        }
-    return iPhoneIdV1.iSerialNumber;
-    }
-
-TBuf<CTelephony::KPhoneModelIdSize> CDeviceInfo::model()
-    {
-    Cancel();
-    iTelephony->GetPhoneId( iStatus, iPhoneIdV1Pkg );
-    SetActive();
-    
-    if ( !iWait->IsStarted() ) 
-        {
-        iWait->Start();
-        }
-    return iPhoneIdV1.iModel;
-    }
-
-TBuf<CTelephony::KPhoneManufacturerIdSize> CDeviceInfo::manufacturer()
-    {
-    Cancel();
-    iTelephony->GetPhoneId( iStatus, iPhoneIdV1Pkg );
-    SetActive();
-    
-    if ( !iWait->IsStarted() ) 
-        {
-        iWait->Start();
-        }
-    return iPhoneIdV1.iManufacturer;
-    }
-
-TBuf<CTelephony::KIMSISize> CDeviceInfo::imsi()
-    {
-    Cancel();
-    iTelephony->GetSubscriberId( iStatus,iSubscriberIdV1Pckg );
-    SetActive();
-    
-    if (!iWait->IsStarted()) 
-        {
-        iWait->Start();
-        }
-    return iSubscriberIdV1.iSubscriberId;
-    }
-
-TUint CDeviceInfo::batteryLevel()
-    {
-    Cancel();
-    iTelephony->GetBatteryInfo( iStatus,iBatteryInfoV1Pkg );
-    SetActive();
-    
-    if ( !iWait->IsStarted() ) 
-        {
-        iWait->Start();
-        }
-    return iBatteryInfoV1.iChargeLevel;
-    }
-
-TInt32 CDeviceInfo::signalStrength()
-    {
-    Cancel();
-    iTelephony->GetSignalStrength( iStatus, iSignalStrengthV1Pckg );
-    SetActive();
-    if ( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-    return iSignalStrengthV1.iSignalStrength;
-    }
- 
-void CDeviceInfo::DoCancel()
-    {
-    iTelephony->CancelAsync( CTelephony::EGetPhoneIdCancel );
-    }
- 
-void CDeviceInfo::RunL()
-    {
-    iWait->AsyncStop();
-    }
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/customdatasynchdeviceinfo.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef CIMEIREADER_H
-#define CIMEIREADER_H
-
-#include <exception>
-#include <e32base.h>
-#include <Etel3rdParty.h>
-
-class CDeviceInfo : public CActive
-{
-public:
-    enum States
-    {
-        EModel, 
-        EManufacturer, 
-        ESerialnumber,
-    };
-    
-    static CDeviceInfo* NewL();
-    static CDeviceInfo* NewLC();
-    ~CDeviceInfo();
-
-    TBuf<CTelephony::KPhoneSerialNumberSize> imei();
-    TBuf<CTelephony::KPhoneModelIdSize> model();
-    TBuf<CTelephony::KPhoneManufacturerIdSize> manufacturer();
-    TBuf<CTelephony::KIMSISize> imsi();
-    TUint batteryLevel();
-    TInt32 signalStrength();
-    
-protected:  
-    void DoCancel();
-    void RunL();
-    
-private:
-    CDeviceInfo();
-    void ConstructL();
-
-private:
-    CTelephony*                 iTelephony;
-        
-    CTelephony::TBatteryInfoV1Pckg iBatteryInfoV1Pkg; 
-    CTelephony::TBatteryInfoV1 iBatteryInfoV1;
-    
-    CTelephony::TPhoneIdV1      iPhoneIdV1;    
-    CTelephony::TPhoneIdV1Pckg  iPhoneIdV1Pkg;
-        
-    CTelephony::TSignalStrengthV1Pckg iSignalStrengthV1Pckg; 
-    CTelephony::TSignalStrengthV1 iSignalStrengthV1;
-    
-    CTelephony::TSubscriberIdV1Pckg iSubscriberIdV1Pckg;
-    CTelephony::TSubscriberIdV1 iSubscriberIdV1; 
-    
-    CActiveSchedulerWait *iWait;
-    
-    bool phoneIdFetched;
-};
-
-#endif /* CIMEIREADER_H */
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/main.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "CustomDataSynchConfigValidator.h"
-
-#include <QtGui>
-#include <QApplication>
-
-int main(int argc, char *argv[])
-{
-    QApplication a(argc, argv);
-    CustomDataSynchConfigValidator w;
-    w.showMaximized();
-    return a.exec();
-}
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/synchconfigvalidator.iby	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#include <bldvariant.hrh>
-#ifndef __SYNCHCONFIGVALIDATOR_IBY__
-#define __SYNCHCONFIGVALIDATOR_IBY__
-
-#ifdef _DEBUG //add param USE_UDEB=1 with imaker if you want to enable this tool
-file=ABI_DIR/BUILD_DIR/synchconfigvalidator.exe    PROGRAMS_DIR\synchconfigvalidator.exe
-data=/epoc32/data/z/resource/apps/synchconfigvalidator.rsc    RESOURCE_FILES_DIR\synchconfigvalidator.rsc
-data=/epoc32/data/z/private/10003a3f/import/apps/synchconfigvalidator_reg.rsc    \private\10003a3f\apps\synchconfigvalidator_reg.rsc
-#endif // _DEBUG
-
-#endif __SYNCHCONFIGVALIDATOR_IBY__
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/synchconfigvalidator.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-TEMPLATE = app
-TARGET = synchconfigvalidator
-QT += core \
-    gui
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-symbian:LIBS += -letel3rdparty \
-    -lsysutil \
-    -lcentralrepository \
-    -lsyncmlclientapi \
-    -lecom \
-    -ledbms \
-    -lefsrv \
-    -lcharconv
-HEADERS += synchconfigvalidator.loc \
-    customdatasynchconfigvalidator.h \
-    customdatasynchconfigvalidatorenginewrapper.h \
-    customdatasynchconfigvalidatorengine_p.h \
-    customdatasynchdeviceinfo.h
-SOURCES += synchconfigvalidator_reg.rss \
-    main.cpp \
-    customdatasynchconfigvalidator.cpp \
-    customdatasynchconfigvalidatorenginewrapper.cpp \
-    customdatasynchconfigvalidatorengine_p.cpp \
-    customdatasynchdeviceinfo.cpp
-FORMS += synchconfigvalidator.ui
-RESOURCES += 
-symbian:TARGET.UID3 = 0x2002DC7B
-symbian:TARGET.CAPABILITY = All \
-    -TCB
-symbian { 
-    SYNCHCONFIGTOOL_IBY_DIR = $$section(PWD,":",1)
-    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>"
-    BLD_INF_RULES.prj_exports += "$$SYNCHCONFIGTOOL_IBY_DIR/synchconfigvalidator.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(synchconfigvalidator.iby)"
-}
--- a/remotemgmt_plat/syncml_ds_customization_api/tsrc/synchconfigvalidator/synchconfigvalidator.ui	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,553 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CustomDataSynchConfigValidator</class>
- <widget class="QMainWindow" name="CustomDataSynchConfigValidator">
-  <property name="enabled">
-   <bool>true</bool>
-  </property>
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>482</width>
-    <height>396</height>
-   </rect>
-  </property>
-  <property name="font">
-   <font>
-    <pointsize>4</pointsize>
-    <weight>50</weight>
-    <bold>false</bold>
-    <kerning>false</kerning>
-   </font>
-  </property>
-  <property name="windowTitle">
-   <string>SynchConfigValidator</string>
-  </property>
-  <property name="autoFillBackground">
-   <bool>false</bool>
-  </property>
-  <property name="dockNestingEnabled">
-   <bool>false</bool>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <property name="sizePolicy">
-    <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="minimumSize">
-    <size>
-     <width>360</width>
-     <height>360</height>
-    </size>
-   </property>
-   <property name="maximumSize">
-    <size>
-     <width>480</width>
-     <height>480</height>
-    </size>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <item>
-     <widget class="QTableWidget" name="tableWidget">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>280</width>
-        <height>200</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>640</width>
-        <height>640</height>
-       </size>
-      </property>
-      <property name="font">
-       <font>
-        <pointsize>6</pointsize>
-        <kerning>true</kerning>
-       </font>
-      </property>
-      <property name="layoutDirection">
-       <enum>Qt::LeftToRight</enum>
-      </property>
-      <property name="autoFillBackground">
-       <bool>false</bool>
-      </property>
-      <property name="locale">
-       <locale language="English" country="UnitedKingdom"/>
-      </property>
-      <property name="lineWidth">
-       <number>1</number>
-      </property>
-      <property name="midLineWidth">
-       <number>0</number>
-      </property>
-      <property name="verticalScrollBarPolicy">
-       <enum>Qt::ScrollBarAlwaysOff</enum>
-      </property>
-      <property name="horizontalScrollBarPolicy">
-       <enum>Qt::ScrollBarAlwaysOff</enum>
-      </property>
-      <property name="autoScroll">
-       <bool>true</bool>
-      </property>
-      <property name="editTriggers">
-       <set>QAbstractItemView::NoEditTriggers</set>
-      </property>
-      <property name="dragDropOverwriteMode">
-       <bool>false</bool>
-      </property>
-      <property name="alternatingRowColors">
-       <bool>false</bool>
-      </property>
-      <property name="selectionMode">
-       <enum>QAbstractItemView::SingleSelection</enum>
-      </property>
-      <property name="textElideMode">
-       <enum>Qt::ElideRight</enum>
-      </property>
-      <property name="verticalScrollMode">
-       <enum>QAbstractItemView::ScrollPerItem</enum>
-      </property>
-      <property name="horizontalScrollMode">
-       <enum>QAbstractItemView::ScrollPerPixel</enum>
-      </property>
-      <property name="showGrid">
-       <bool>true</bool>
-      </property>
-      <property name="gridStyle">
-       <enum>Qt::SolidLine</enum>
-      </property>
-      <property name="sortingEnabled">
-       <bool>false</bool>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-      <property name="cornerButtonEnabled">
-       <bool>true</bool>
-      </property>
-      <attribute name="horizontalHeaderVisible">
-       <bool>true</bool>
-      </attribute>
-      <attribute name="horizontalHeaderDefaultSectionSize">
-       <number>180</number>
-      </attribute>
-      <attribute name="horizontalHeaderHighlightSections">
-       <bool>true</bool>
-      </attribute>
-      <attribute name="horizontalHeaderMinimumSectionSize">
-       <number>25</number>
-      </attribute>
-      <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="horizontalHeaderStretchLastSection">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="verticalHeaderVisible">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="verticalHeaderCascadingSectionResizes">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="verticalHeaderDefaultSectionSize">
-       <number>30</number>
-      </attribute>
-      <attribute name="verticalHeaderHighlightSections">
-       <bool>true</bool>
-      </attribute>
-      <attribute name="verticalHeaderStretchLastSection">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="verticalHeaderVisible">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="verticalHeaderDefaultSectionSize">
-       <number>30</number>
-      </attribute>
-      <attribute name="horizontalHeaderStretchLastSection">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="horizontalHeaderVisible">
-       <bool>true</bool>
-      </attribute>
-      <attribute name="verticalHeaderCascadingSectionResizes">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="horizontalHeaderMinimumSectionSize">
-       <number>25</number>
-      </attribute>
-      <attribute name="horizontalHeaderHighlightSections">
-       <bool>true</bool>
-      </attribute>
-      <attribute name="verticalHeaderHighlightSections">
-       <bool>true</bool>
-      </attribute>
-      <attribute name="verticalHeaderStretchLastSection">
-       <bool>false</bool>
-      </attribute>
-      <attribute name="horizontalHeaderDefaultSectionSize">
-       <number>180</number>
-      </attribute>
-      <row>
-       <property name="text">
-        <string>DataSynchCenrepExistsTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>OperatorDataSynchCenrepExistsTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>OperatorDataSynchErrorCenrepExistsTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>CustomProfilesTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>ContactsAdapterAvailabilityTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>CustomSynchProfileServerIdTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>ContactsAdapterSynchProfileTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>MyprofileAdapterSynchProfileTest</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </row>
-      <row>
-       <property name="text">
-        <string>DeviceInfoExtensionPluginTest</string>
-       </property>
-      </row>
-      <column>
-       <property name="text">
-        <string>Test name</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </column>
-      <column>
-       <property name="text">
-        <string>Result</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </column>
-      <column>
-       <property name="text">
-        <string>Info</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </column>
-      <item row="0" column="0">
-       <property name="text">
-        <string>Datasync cen.rep supports custom sync profiles</string>
-       </property>
-       <property name="toolTip">
-        <string>Datasync cen.rep supports custom sync profiles</string>
-       </property>
-       <property name="whatsThis">
-        <string>Datasync cen.rep supports custom sync profiles</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="0" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="0" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="1" column="0">
-       <property name="text">
-        <string>Operatordatasync cen.rep exists</string>
-       </property>
-       <property name="toolTip">
-        <string>Operatordatasync cen.rep exists</string>
-       </property>
-       <property name="whatsThis">
-        <string>Operatordatasync</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="1" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="1" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="2" column="0">
-       <property name="text">
-        <string>Operatordatasync error cen.rep exists</string>
-       </property>
-       <property name="toolTip">
-        <string>Operatordatasync error cen.rep exists</string>
-       </property>
-       <property name="whatsThis">
-        <string>Operatordatasync</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="2" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="2" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="3" column="0">
-       <property name="text">
-        <string>Custom Synch Profiles allowed</string>
-       </property>
-       <property name="toolTip">
-        <string>Test4</string>
-       </property>
-       <property name="whatsThis">
-        <string>Test4</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="3" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="3" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="4" column="0">
-       <property name="text">
-        <string>Configured Contacts Adapter exists</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="4" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="4" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="5" column="0">
-       <property name="text">
-        <string>Configured Custom Synch Profile exists</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="5" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="5" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="6" column="0">
-       <property name="text">
-        <string>Contacts Adapter in Synch Profile exists</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="6" column="1">
-       <property name="text">
-        <string>NOK</string>
-       </property>
-      </item>
-      <item row="6" column="2">
-       <property name="text">
-        <string>!</string>
-       </property>
-      </item>
-      <item row="7" column="0">
-       <property name="text">
-        <string>Myprofile Adapter in Synch Profile exists</string>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>6</pointsize>
-        </font>
-       </property>
-      </item>
-      <item row="7" column="1">
-       <property name="text">
-        <string>VERIFY</string>
-       </property>
-      </item>
-      <item row="7" column="2">
-       <property name="text">
-        <string>?</string>
-       </property>
-      </item>
-      <item row="8" column="0">
-       <property name="text">
-        <string>DevInfo extension plugin exists</string>
-       </property>
-      </item>
-      <item row="8" column="1">
-       <property name="text">
-        <string>VERIFY</string>
-       </property>
-      </item>
-      <item row="8" column="2">
-       <property name="text">
-        <string>?</string>
-       </property>
-      </item>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="buttonTestActivator">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="autoFillBackground">
-       <bool>false</bool>
-      </property>
-      <property name="text">
-       <string>Run</string>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>482</width>
-     <height>18</height>
-    </rect>
-   </property>
-  </widget>
-  <widget class="QStatusBar" name="statusbar"/>
- </widget>
- <resources/>
- <connections/>
-</ui>
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  File that exports the files belonging to 
-:               SyncML DS Error reporting API
+:               SyncML FW Error reporting API
 *
 */
 
@@ -23,4 +23,4 @@
 
 PRJ_EXPORTS
 
-../inc/nsmloperatorerrorcrkeys.h		MW_LAYER_PLATFORM_EXPORT_PATH(nsmloperatorerrorcrkeys.h)
\ No newline at end of file
+../inc/NSmlOperatorErrorCRKeys.h		MW_LAYER_PLATFORM_EXPORT_PATH(NsmlOperatorErrorCRKeys.h)
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/inc/NSmlOperatorErrorCRKeys.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/inc/NSmlOperatorErrorCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  SyncML DS Error reporting API CenRep key definitions
+* Description:  SyncMLNotifier Domain CenRep key definitions
 *
 */
 
@@ -21,34 +21,35 @@
 #include <e32std.h>
 
 /**
- * SyncML DS error reporting keys
+ * SyncML framework operator settings
  *
  */
 const TUid KCRUidOperatorDatasyncErrorKeys = { 0x2001FDF1 };
 
 /**
- * KNsmlOpDsSyncErrorCode
- * Holds error code of latest DS sync (0 if no error occured).
- * Storing of error codes is configured in KCRUidOperatorDatasyncInternalKeys
- * (nsmloperatordatacrkeys.h).
+ * KNsmlOpDsErrorCode
+ * Define operator specific SyncML error code
+ *
  */
-const TUint32 KNsmlOpDsSyncErrorCode = 0x00000001;
+const TUint32 KNsmlOpDsErrorCode = 0x00000001;
 
 /**
- * KNsmlOpDsSyncProfId
- * Holds sync profile Id used in last DS sync
+ * KNsmlOpDsSyncProfUid
+ * Defines operator sync profile uid
  */
-const TUint32 KNsmlOpDsSyncProfId = 0x00000002;
+const TUint32 KNsmlOpDsSyncProfUid = 0x00000002;
 
 /**
  * KNsmlOpDsSyncType
- * Holds sync type used in last DS sync
+ * Define sync type
+ *
  */
 const TUint32 KNsmlOpDsSyncType = 0x00000003;
 
 /**
  * KNsmlOpDsSyncInitiation
- * Holds sync initiation used in last DS sync
+ * Define sync initiation
+ *
  */
 const TUint32 KNsmlOpDsSyncInitiation = 0x00000004;
 
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/syncml_ds_error_reporting_api.metaxml	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" ?>
-<api id="5d568c0272bed4d13d40e9eace6350db" dataversion="1.0">
-  <name>SyncML DS Error reporting API</name>
-  <description>Definitions of Error reporting keys related to SyncML framework</description>
-  <type>c++</type>
-  <subsystem>syncmlfw</subsystem>
-  <libs>
-  </libs>
-  <release category="platform"/>
-  <attributes>
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
-  </attributes>
-</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/syncml_fw_error_reporting_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="7175af7d37a1808a3ce2c0d5c4040ef2" dataversion="1.0">
+  <name>SyncML FW Error reporting API</name>
+  <description>Definitions of Error reporting keys related to SyncML framework</description>
+  <type>c++</type>
+  <subsystem>syncmlfw</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/QtSyncStatusSpy.pro	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-TEMPLATE = app
-TARGET = 
-DEPENDPATH += .
-INCLUDEPATH += .
-CONFIG += hb
-LIBS += -lxqsettingsmanager \
-	-lxqserviceutil
-INCLUDEPATH += \epoc32\include\platform\mw
-HEADERS += qtsyncstatuslog.h \
-    qtsyncstatuslogview.h \
-    qtsyncstatusmodel.h \
-    qtsyncstatusview.h
-SOURCES += qtsyncstatuslog.cpp \
-    qtsyncstatuslogview.cpp \
-    qtsyncstatusmodel.cpp \
-    qtsyncstatusview.cpp \
-    main.cpp \
-    QtSyncStatusSpy_reg.rss
-FORMS += 
-RESOURCES += 
-symbian:TARGET.UID3 = 0x2001FDF3
-TARGET.CAPABILITY = ALL \
-    -TCB
-        
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/main.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Trolltech hereby grants a license to use the Qt/Eclipse Integration
-** plug-in (the software contained herein), in binary form, solely for the
-** purpose of creating code to be used with Trolltech's Qt software.
-**
-** Qt Designer is licensed under the terms of the GNU General Public
-** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the
-** right to use certain no GPL licensed software under the terms of its GPL
-** Exception version 1.2 (http://trolltech.com/products/qt/gplexception).
-**
-** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "AS
-** IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
-** OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** Since we now have the GPL exception I think that the "special exception
-** is no longer needed. The license text proposed above (other than the
-** special exception portion of it) is the BSD license and we have added
-** the BSD license as a permissible license under the exception.
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-#include "qtsyncstatusview.h"
-#include "qtsyncstatuslogview.h"
-#include "qtsyncstatuslog.h"
-
-//class QtSyncStatusApp : public HbMainWindow
-//{
-//    Q_OBJECT
-//
-//public:
-//    QtSyncStatusApp();
-//    ~QtSyncStatusApp();
-//    
-//    virtual bool event(QEvent *event);
-//};
-//
-//QtSyncStatusApp::QtSyncStatusApp()
-//{
-//}
-//
-//QtSyncStatusApp::~QtSyncStatusApp()
-//{
-//}
-//
-//
-//bool QtSyncStatusApp::event(QEvent *event)
-//{
-//    if (event->type() == QEvent::ApplicationActivate) {
-//        show();
-//    }
-//    return HbMainWindow::event(event);
-//}
-
-int main(int argc, char *argv[])
-{
-    HbApplication app( argc, argv );
-    HbMainWindow mainWindow;
-    
-    QtSyncStatusLog* log = new QtSyncStatusLog();
-            
-    QtSyncStatusView* listView = new QtSyncStatusView(*log);
-    mainWindow.addView( listView );
-    
-    QtSyncStatusLogView* logView = new QtSyncStatusLogView(*log);
-    mainWindow.addView( logView );
-    
-    QObject::connect(logView, SIGNAL(comingBack()), listView, SLOT(activateView()));
-    QObject::connect(listView, SIGNAL(showLog()), logView, SLOT(activateView()));
-     
-    mainWindow.show();
-    int error = app.exec();
-    delete log;
-    return error;
-}
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslog.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#include <qtextstream.h>
-#include <qstringlist.h>
-#include <qdir.h>
-#include "qtsyncstatuslog.h"
-
-const QString LogFilePath = "C:/logs/Sync/";
-const QString LogFileName = LogFilePath + "QtSyncStatus.txt";
-
-QtSyncStatusLog::QtSyncStatusLog() : mLogFile(LogFileName)
-{
-    open();
-}
-
-QtSyncStatusLog::~QtSyncStatusLog()
-{
-    mLogFile.close();
-}
-
-void QtSyncStatusLog::clear()
-{
-    mLogFile.remove();
-    open();    
-}
-
-void QtSyncStatusLog::write(QString& string)
-{
-    QTextStream stream(&mLogFile);
-    stream << string;
-    stream.flush();
-}
-
-QStringList QtSyncStatusLog::lines()
-{
-    QStringList list;
-    QTextStream stream(&mLogFile);
-    stream.seek(0);
-    while (!stream.atEnd()) {
-        list.append(stream.readLine());
-    }
-    return list;
-}
-
-void QtSyncStatusLog::open()
-{
-    QDir dir(LogFilePath);
-    if (!dir.exists()) {
-        dir.mkpath(LogFilePath);
-    }
-    if (!mLogFile.open(QIODevice::ReadWrite | QIODevice::Append | QIODevice::Text)) {
-        qFatal("error opening log file");
-        return;
-    }    
-}
-
-   
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslog.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#ifndef QTSYNCSTATUSLOG_H
-#define QTSYNCSTATUSLOG_H
-
-#include <QObject>
-#include <qfile.h>
-
-class QtSyncStatusLog : public QObject
-{
-public:
-    QtSyncStatusLog();
-    ~QtSyncStatusLog();
-    
-    void clear();
-    void write(QString& string);
-    QStringList lines();
-    
-private:
-    void open();
-
-private:
-    QFile mLogFile;
-};
-
-#endif // QTSYNCSTATUSLOG_H
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslogview.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:  Source file for the class QtSyncStatusLogView
-*
-*/
-#include <QGraphicsItem>
-#include <QtGui>
-#include <QTimer>
-#include <QWidget>
-#include <QDebug>
-#include <hbdataform.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <hbmainwindow.h>
-#include <hbmenu.h>
-#include <hbtoolbar.h>
-#include <hbscrollarea.h>
-#include <hbscrollbar.h>
-#include <hbtextitem.h>
-#include <hblistwidget.h>
-#include <qgraphicslinearlayout.h>
-#include <hbpushbutton.h>
-#include <qlistiterator>
-
-#include "qtsyncstatuslogview.h"
-#include "qtsyncstatuslog.h"
-
-
-QtSyncStatusLogView::QtSyncStatusLogView(QtSyncStatusLog& log, QGraphicsItem *parent)
-    : HbView(parent),
-      mSyncLog(log)
-{
-    setTitle("QtSyncStatusSpy");
-    createMenu();
-    
-    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
-    HbScrollArea* scrollArea = new HbScrollArea(this);
-    scrollArea->setScrollDirections(Qt::Vertical);
-    QGraphicsLinearLayout* layout2 = new QGraphicsLinearLayout(Qt::Vertical);
-    QGraphicsWidget* content = new QGraphicsWidget(this);
-    
-    mTextItem = new HbTextItem();
-    layout2->addItem(mTextItem);
-    layout2->setContentsMargins(5, 5, 5, 5);
-    content->setLayout(layout2);
-    scrollArea->setContentWidget(content);
-
-    layout->addItem(scrollArea);
-    layout->setStretchFactor(scrollArea, 1);
-    setLayout(layout);
-}
-
-QtSyncStatusLogView::~QtSyncStatusLogView()
-{
-    
-}
-
-void QtSyncStatusLogView::updateView()
-    {
-    readLog();
-    }
-
-void QtSyncStatusLogView::deleteLog()
-    {
-    mSyncLog.clear();
-    readLog();
-    }
-
-void QtSyncStatusLogView::goToMainView()
-    {
-    emit comingBack();
-    }
-
-void QtSyncStatusLogView::activateView()
-{
-    mainWindow()->setCurrentView(this);
-}
-
-void QtSyncStatusLogView::createMenu()
-{
-    HbMenu* myMenu = menu();
-    connect( myMenu->addAction( tr("Update")), SIGNAL( triggered() ), SLOT( updateView() ) );
-    connect( myMenu->addAction( tr("Delete log")), SIGNAL( triggered() ), SLOT( deleteLog() ) );
-    connect( myMenu->addAction( tr("Back")), SIGNAL( triggered() ), SLOT( goToMainView() ) );
-    
-    HbToolBar* myToolBar = toolBar();
-    connect( myToolBar->addAction( tr("Update")), SIGNAL( triggered() ), SLOT( updateView() ) );
-    connect( myToolBar->addAction( tr("Delete log")), SIGNAL( triggered() ), SLOT( deleteLog() ) );
-    connect( myToolBar->addAction( tr("Back")), SIGNAL( triggered() ), SLOT( goToMainView() ) );
-}
-
-void QtSyncStatusLogView::showEvent(QShowEvent* event)
-    {
-    readLog();
-    HbView::showEvent(event);
-    }
-
-void QtSyncStatusLogView::readLog()
-    {
-    QString logData;
-    QString line;
-    QStringList list;
-    QStringList lines;
-    QString prevDate;
-    
-    lines = mSyncLog.lines();
-    QListIterator<QString> iter(lines);
-
-    while (iter.hasNext()) {
-        line = iter.next();
-        line.remove(QChar('['));
-        line.remove(QChar(']'));
-        list = line.split(" ");
-        if (list.at(0).compare(prevDate)) {
-         logData.append(list.at(0) + "\n");
-         prevDate = list.at(0); 
-        }
-        logData.append(list.at(1) + " " + list.at(2) + list.at(3) + "\n");
-    }
-    mTextItem->setText(logData);
-}
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatuslogview.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-#ifndef QTSYNCSTATUSLOGVIEW_H
-#define QTSYNCSTATUSLOGVIEW_H
-
-#include <QObject>
-#include <hbview.h>
-#include <QFile>
-#include <QTextStream>
-
-class QGraphicsItem;
-class HbDataForm;
-class HbAction;
-class QtSyncStatusModel;
-class HbMainWindow;
-class HbWidget;
-class HbTextItem;
-class QGraphicsLinearLayout;
-class QtSyncStatusLog;
-
-
-class QtSyncStatusLogView : public HbView
-{
-    Q_OBJECT
-
-public:
-    QtSyncStatusLogView(QtSyncStatusLog& log, QGraphicsItem *parent = 0);
-    ~QtSyncStatusLogView();
-    
-signals:
-    void comingBack();
-    
-public slots:
-    void activateView();
-    
-private slots:
-    void updateView();
-    void deleteLog();
-    void goToMainView();
-
-private:
-    void createMenu();
-    void openSyncLogFile();
-    virtual void showEvent(QShowEvent * event);
-    void readLog();
-
-private:    
-    HbTextItem* mTextItem;
-    QtSyncStatusLog& mSyncLog;
-};
-
-#endif // QTSYNCSTATUSLOGVIEW_H
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusmodel.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#include <QModelIndex>
-#include <QDateTime>
-#include <QDir>
-#include <hbdataform.h>
-#include <hbdataformmodel.h>
-#include <hbmainwindow.h>
-//#include <hbstyleoptioncommonnote.h> //<hbcommonnote.h> this new header compensate oldone ??
-#include <HbDataFormModelItem.h>
-#include <hbdataformviewitem.h>
-#include <hblineedit.h>
-#include <HbComboBox.h>
-#include <HbPushButton.h>
-#include <HbAbstractButton.h>
-#include <HbLineEdit.h>
-#include <xqsettingsmanager.h>
-#include <xqsettingskey.h>
-#include <XQServiceUtil.h>
-
-#include <nsmloperatorerrorcrkeys.h>
-#include <DataSyncInternalPSKeys.h>
-#include "qtsyncstatusmodel.h"
-#include "qtsyncstatuslog.h"
-
-QtSyncStatusModel::QtSyncStatusModel(QtSyncStatusLog& log, HbDataForm *form, QObject *parent)
-:QObject(parent),
- mSettingsForm(form),
- mSettingsModel(0),
- mSyncLog(log)
-{
-    connect(mSettingsForm, SIGNAL(activated(const QModelIndex)),
-            this, SLOT(itemDisplayed(const QModelIndex)));
-    
-    mSettingsManager = new XQSettingsManager(this);
-    mNsmlOpDsSyncErrorCode = new XQSettingsKey(XQSettingsKey::TargetCentralRepository,
-            KCRUidOperatorDatasyncErrorKeys.iUid, KNsmlOpDsSyncErrorCode);
-    mSettingsManager->startMonitoring(*mNsmlOpDsSyncErrorCode);
-    mNsmlOpDsSyncProfUid = new XQSettingsKey(XQSettingsKey::TargetCentralRepository,
-            KCRUidOperatorDatasyncErrorKeys.iUid, KNsmlOpDsSyncProfId);
-    mSettingsManager->startMonitoring(*mNsmlOpDsSyncProfUid);
-    mNsmlOpDsSyncType = new XQSettingsKey(XQSettingsKey::TargetCentralRepository,
-            KCRUidOperatorDatasyncErrorKeys.iUid, KNsmlOpDsSyncType);
-    mSettingsManager->startMonitoring(*mNsmlOpDsSyncType);
-    mNsmlOpDsSyncInitiation = new XQSettingsKey(XQSettingsKey::TargetCentralRepository,
-            KCRUidOperatorDatasyncErrorKeys.iUid, KNsmlOpDsSyncInitiation);
-    mSettingsManager->startMonitoring(*mNsmlOpDsSyncInitiation);
-    
-    mDataSyncStatusKey = new XQSettingsKey(XQSettingsKey::TargetPublishAndSubscribe,
-            KPSUidDataSynchronizationInternalKeys.iUid, KDataSyncStatus);
-    
-    connect(mSettingsManager, SIGNAL(valueChanged(const XQSettingsKey&, const QVariant&)),
-            this, SLOT(valueChanged(const XQSettingsKey&, const QVariant&)));
-    
-    // Read the initial values from the cenrep
-    QVariant value = mSettingsManager->readItemValue(*mNsmlOpDsSyncErrorCode);
-    mSyncErrorCode = value.toUInt();
-    value = mSettingsManager->readItemValue(*mNsmlOpDsSyncProfUid);
-    mSyncProfileUid = value.toUInt();
-    value = mSettingsManager->readItemValue(*mNsmlOpDsSyncType);
-    mSyncType = value.toUInt();
-    value = mSettingsManager->readItemValue(*mNsmlOpDsSyncInitiation);
-    mSyncInitiation = value.toUInt();
-}
-
-QtSyncStatusModel::~QtSyncStatusModel()
-{
-    delete mSettingsModel;
-    delete mSettingsManager;
-    delete mNsmlOpDsSyncErrorCode;
-    delete mNsmlOpDsSyncProfUid;
-    delete mNsmlOpDsSyncType;
-    delete mNsmlOpDsSyncInitiation;
-    delete mDataSyncStatusKey;
-}
-
-void QtSyncStatusModel::initModel()
-{
-    // Remove the model.
-    if (mSettingsForm->model()) {
-        delete mSettingsForm->model();
-        mSettingsForm->setModel(0);
-        mSettingsModel = 0;
-    }
-        
-    mSettingsModel = new HbDataFormModel();
-        
-    mNsmlOpDsSyncErrorCodeItem = new HbDataFormModelItem(
-            HbDataFormModelItem::TextItem, QString( tr("Sync error code") ), 0);
-    QString errorCode;
-    errorCode.setNum(mSyncErrorCode);
-    mNsmlOpDsSyncErrorCodeItem->setContentWidgetData( "text", errorCode );
-    mNsmlOpDsSyncErrorCodeItem->setContentWidgetData( QString("readOnly"), QString("false") );
-    mSettingsModel->appendDataFormItem(mNsmlOpDsSyncErrorCodeItem);
-    
-    mNsmlOpDsSyncProfUidItem = new HbDataFormModelItem(
-            HbDataFormModelItem::TextItem, QString(tr("Sync profile ID")), 0);
-            //HbDataFormModelItem::TextItem, QString(tr("Sync profile ID")), mSettingsModel->invisibleRootItem());
-    QString profileUId;
-    profileUId.setNum(mSyncProfileUid);
-    mNsmlOpDsSyncProfUidItem->setContentWidgetData( "text", profileUId );
-    mNsmlOpDsSyncProfUidItem->setContentWidgetData( QString("readOnly"), QString("false") );
-    mSettingsModel->appendDataFormItem(mNsmlOpDsSyncProfUidItem);
-    
-    QStringList syncTypes;
-    syncTypes << tr("ESmlTwoWay")
-               << tr("ESmlOneWayFromServer")
-               << tr("ESmlOneWayFromClient")
-               << tr("ESmlSlowSync")
-               << tr("ESmlRefreshFromServer")
-               << tr("ESmlRefreshFromClient");
-    
-    mNsmlOpDsSyncTypeItem = new HbDataFormModelItem();
-    mNsmlOpDsSyncTypeItem->setType(HbDataFormModelItem::ComboBoxItem);
-    mNsmlOpDsSyncTypeItem->setData(HbDataFormModelItem::LabelRole, QString(tr("Sync type")));
-    mNsmlOpDsSyncTypeItem->setContentWidgetData(QString("items"), syncTypes);
-    mNsmlOpDsSyncTypeItem->setContentWidgetData(QString("currentIndex"), mSyncType);
-    mSettingsModel->appendDataFormItem(mNsmlOpDsSyncTypeItem);
-
-    QStringList syncInitiation;
-    syncInitiation << tr("No sync ongoing")
-               << tr("Client initiated")
-               << tr("Server alerted");
-    
-    mNsmlOpDsSyncInitiationItem = new HbDataFormModelItem();
-    mNsmlOpDsSyncInitiationItem->setType(HbDataFormModelItem::ComboBoxItem);
-    mNsmlOpDsSyncInitiationItem->setData(HbDataFormModelItem::LabelRole, QString(tr("Sync initiation")));
-    mNsmlOpDsSyncInitiationItem->setContentWidgetData(QString("items"), syncInitiation);
-    mNsmlOpDsSyncInitiationItem->setContentWidgetData(QString("currentIndex"), mSyncInitiation);
-    mSettingsModel->appendDataFormItem(mNsmlOpDsSyncInitiationItem);
-    
-    mSettingsForm->setModel(mSettingsModel);
-}
-
-void QtSyncStatusModel::itemDisplayed(const QModelIndex &index)
-{   
-    //HbDataFormModelItem *data = static_cast<HbDataFormModelItem*>(index.internalPointer());
-    HbDataFormViewItem *viewItem = static_cast<HbDataFormViewItem*>( mSettingsForm->itemByIndex(index) );
-       
-    switch (index.row())
-        {
-        case 0:
-            {
-            HbWidget* contentWidget = viewItem->dataItemContentWidget();
-            mSyncErrorCodeEdit = static_cast<HbLineEdit *>(contentWidget);
-            mSyncErrorCodeEdit->setInputMethodHints(Qt::ImhPreferNumbers);
-            connect(mSyncErrorCodeEdit, SIGNAL(editingFinished()),
-                    this, SLOT(handleSyncMLErrorCodeChangeFinished()));
-            break;
-            }
-            
-        case 1:
-            {
-            HbWidget* contentWidget = viewItem->dataItemContentWidget();
-            mSyncProfileUidEdit = static_cast<HbLineEdit *>(contentWidget);
-            mSyncProfileUidEdit->setInputMethodHints(Qt::ImhPreferNumbers);
-            connect(mSyncProfileUidEdit, SIGNAL(editingFinished()),
-                    this, SLOT(handleProfileUidChangeFinished()));            
-            break;
-            }
-           
-        case 2:
-            {
-            HbWidget* contentWidget = viewItem->dataItemContentWidget();
-            mmSyncTypeComboBox = static_cast<HbComboBox *>(contentWidget);
-            connect(mmSyncTypeComboBox, SIGNAL(currentIndexChanged(int)),
-                    this, SLOT(handleSyncTypeChange(int)));                
-            break;
-            }
-                
-        case 3:
-            {
-            HbWidget* contentWidget = viewItem->dataItemContentWidget();
-            mSyncInitiationComboBox = static_cast<HbComboBox *>(contentWidget);
-            connect(mSyncInitiationComboBox, SIGNAL(currentIndexChanged(int)),
-                    this, SLOT(handleSyncInitiationChange(int)));                
-            break;
-            }
-        
-        default:
-        break;
-        }
-}
-
-void QtSyncStatusModel::handleSyncErrorCodeChangeFinished()
-{
-    mSettingsManager->writeItemValue(*mNsmlOpDsSyncErrorCode, mSyncErrorCodeEdit->text().toInt()); 
-}
-
-void QtSyncStatusModel::handleProfileUidChangeFinished()
-{
-    mSettingsManager->writeItemValue(*mNsmlOpDsSyncProfUid, mSyncProfileUidEdit->text().toInt());
-}
-
-void QtSyncStatusModel::handleSyncTypeChange(int index)
-{
-    mSettingsManager->writeItemValue(*mNsmlOpDsSyncType, index);
-}
-
-void QtSyncStatusModel::handleSyncInitiationChange(int index)
-{
-    mSettingsManager->writeItemValue(*mNsmlOpDsSyncInitiation, index);
-}
-
-void QtSyncStatusModel::valueChanged(const XQSettingsKey& key, const QVariant& value)
-{
-    QDateTime dt = QDateTime::currentDateTime();
-    QString logLine;
-    
-    unsigned long int crKey = key.key();
-    if (crKey == mNsmlOpDsSyncErrorCode->key()) {
-        mSyncErrorCode = value.toUInt();
-        QString errorCode;
-        errorCode.setNum(mSyncErrorCode);
-        mNsmlOpDsSyncErrorCodeItem->setContentWidgetData( "text", errorCode );
-        logLine.append("[" + dt.toString("dd.MM.yyyy hh:mm:ss") + "] [SyncErrCode: " + errorCode + "]\r\n");
-    }
-    else if (crKey == mNsmlOpDsSyncProfUid->key()) {
-        mSyncProfileUid = value.toUInt();
-        QString profileUId;
-        profileUId.setNum(mSyncProfileUid);
-        mNsmlOpDsSyncProfUidItem->setContentWidgetData( "text", profileUId );
-        logLine.append("[" + dt.toString("dd.MM.yyyy hh:mm:ss") + "] [SyncProfileId: " + profileUId + "]\r\n");
-    }
-    else if (crKey == mNsmlOpDsSyncType->key()) {
-        mSyncType = value.toUInt();
-        QString syncType;
-        syncType.setNum(mSyncType);
-        mNsmlOpDsSyncTypeItem->setContentWidgetData(QString("currentIndex"), mSyncType);
-        logLine.append("[" + dt.toString("dd.MM.yyyy hh:mm:ss") + "] [SyncType: " + syncType + "]\r\n");
-    }
-    else if (crKey == mNsmlOpDsSyncInitiation->key()) {
-        mSyncInitiation = value.toUInt();
-        QString syncInitiation;
-        syncInitiation.setNum(mSyncInitiation);
-        mNsmlOpDsSyncInitiationItem->setContentWidgetData(QString("currentIndex"), mSyncInitiation);
-        logLine.append("[" + dt.toString("dd.MM.yyyy hh:mm:ss") + "] [SyncInitiation: " + syncInitiation + "]\r\n");        
-    }
-    mSyncLog.write(logLine);
-    XQServiceUtil::toBackground( false );
-}
-
-void QtSyncStatusModel::clearSyncLog()
-{
-    mSyncLog.clear();
-}
-
-
-void QtSyncStatusModel::publishSyncStatusKey()
-{
-    mSettingsManager->writeItemValue(*mDataSyncStatusKey,EDataSyncRunning12);
-    mSettingsManager->writeItemValue(*mDataSyncStatusKey,EDataSyncNotRunning);
-}
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusmodel.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-#ifndef QTSYNCSTATUSMODEL_H
-#define QTSYNCSTATUSMODEL_H
-
-#include <QObject>
-#include <QFile>
-#include <QTextStream>
-
-class QPersistentModelIndex;
-class QModelIndex;
-class HbDataForm;
-class HbDataFormModel;
-class HbDataFormModelItem;
-class HbComboBox;
-class HbPushButton;
-class HbAbstractButton;
-class HbLineEdit;
-class XQSettingsManager;
-class XQSettingsKey;
-class HbMainWindow;
-class QtSyncStatusLog;
-
-class QtSyncStatusModel : public QObject
-{
-    Q_OBJECT
-
-public:
-    QtSyncStatusModel(QtSyncStatusLog& log, HbDataForm *form, QObject *parent = 0);
-    ~QtSyncStatusModel();
-    void initModel();
-    void clearSyncLog();
-    void publishSyncStatusKey();
-    
-public slots:
-    void itemDisplayed(const QModelIndex &index);
-    void handleSyncErrorCodeChangeFinished();
-    void handleProfileUidChangeFinished();
-    void handleSyncTypeChange(int index);
-    void handleSyncInitiationChange(int index);
-    
-    void valueChanged(const XQSettingsKey& key, const QVariant& value);
-
-private:    
-    void openSyncLogFile();
-    
-
-private:
-    HbDataForm *mSettingsForm;
-    HbDataFormModel *mSettingsModel;
-    HbDataFormModelItem *mNsmlOpDsSyncErrorCodeItem;
-    HbDataFormModelItem* mNsmlOpDsSyncProfUidItem;
-    HbDataFormModelItem *mNsmlOpDsSyncTypeItem;
-    HbDataFormModelItem* mNsmlOpDsSyncInitiationItem;
-    
-    HbLineEdit *mSyncErrorCodeEdit;
-    HbLineEdit *mSyncProfileUidEdit;
-    HbComboBox *mmSyncTypeComboBox;
-    HbComboBox *mSyncInitiationComboBox;
-    
-    XQSettingsManager *mSettingsManager;
-    XQSettingsKey *mNsmlOpDsSyncErrorCode;
-    XQSettingsKey *mNsmlOpDsSyncProfUid;
-    XQSettingsKey *mNsmlOpDsSyncType;
-    XQSettingsKey *mNsmlOpDsSyncInitiation;
-    
-    XQSettingsKey *mDataSyncStatusKey;
-    
-    uint mSyncErrorCode;
-    uint mSyncProfileUid;
-    uint mSyncType;
-    uint mSyncInitiation;
-    
-    QtSyncStatusLog& mSyncLog;
-    };
-
-#endif // QTSYNCSTATUSMODEL_H
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusspy.iby	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include <bldvariant.hrh>
-
-#ifndef __QTSYNCSTATUSSPY_IBY__
-#define __QTSYNCSTATUSSPY_IBY__
-
-file=ABI_DIR\BUILD_DIR\QtSyncStatusSpy.exe    PROGRAMS_DIR\QtSyncStatusSpy.exe
-data=\epoc32\data\z\resource\apps\QtSyncStatusSpy.rsc    RESOURCE_FILES_DIR\QtSyncStatusSpy.rsc
-data=\epoc32\data\z\private\10003a3f\import\apps\QtSyncStatusSpy_reg.rsc    \private\10003a3f\apps\QtSyncStatusSpy_reg.rsc
-
-#endif //__QTSYNCSTATUSSPY_IBY__
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusview.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,663 +0,0 @@
-/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:  Source file for the class CalenSettingsView
-*
-*/
-#include <QGraphicsItem>
-#include <QtGui>
-#include <QTimer>
-#include <QWidget>
-#include <QDebug>
-#include <hbdataform.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <hbmainwindow.h>
-#include <hbmenu.h>
-#include <hbtoolbar.h>
-#include <XQServiceUtil.h>
-
-#include "qtsyncstatusview.h"
-#include "qtsyncstatusmodel.h"
-#include "qtsyncstatuslog.h"
-
-
-QtSyncStatusView::QtSyncStatusView(QtSyncStatusLog& log, QGraphicsItem *parent )
-: HbView(parent)
-{
-    setTitle(tr("QtSyncStatusSpy"));
-    createMenu();
-    mSyncStatusForm = new HbDataForm(this);
-    mSyncStatusModel = new QtSyncStatusModel(log, mSyncStatusForm);
-    mSyncStatusModel->initModel();
-    setWidget(mSyncStatusForm);
-}
-
-QtSyncStatusView::~QtSyncStatusView()
-{
-    delete mSyncStatusModel;
-}
-
-void QtSyncStatusView::publish()
-{
-    mSyncStatusModel->publishSyncStatusKey();
-}
-
-void QtSyncStatusView::viewLog()
-{
-    emit showLog();
-}
-
-void QtSyncStatusView::hideView()
-{
-    XQServiceUtil::toBackground( true );
-}
-
-void QtSyncStatusView::deleteLog()
-{
-    mSyncStatusModel->clearSyncLog();
-}
-
-void QtSyncStatusView::activateView()
-{
-    mainWindow()->setCurrentView(this);
-}
-
-void QtSyncStatusView::createMenu()
-{
-    HbMenu* myMenu = menu();
-    connect( myMenu->addAction( tr("Publish")), SIGNAL( triggered() ), SLOT( publish() ) );
-    connect( myMenu->addAction( tr("View log")), SIGNAL( triggered() ), SLOT( viewLog() ) );
-    connect( myMenu->addAction( tr("Hide")), SIGNAL( triggered() ), SLOT( hideView() ) );
-    connect( myMenu->addAction( tr("Delete log")), SIGNAL( triggered() ), SLOT( deleteLog() ) );
-    
-    HbToolBar* myToolBar = toolBar();
-    connect( myToolBar->addAction( tr("Publish")), SIGNAL( triggered() ), SLOT( publish() ) );
-    connect( myToolBar->addAction( tr("View log")), SIGNAL( triggered() ), SLOT( viewLog() ) );
-    connect( myToolBar->addAction( tr("Hide")), SIGNAL( triggered() ), SLOT( hideView() ) );
-    connect( myToolBar->addAction( tr("Delete log")), SIGNAL( triggered() ), SLOT( deleteLog() ) );
-}
-bool QtSyncStatusView::event(QEvent *event)
-{
-    debugEvent(event);
-//    if (event->type() == QEvent::ApplicationActivate) {
-//        mMainWindow.show();
-//    }
-    return HbView::event(event);
-}
-
-void  QtSyncStatusView::debugEvent(QEvent *event)
-{
-    qDebug() << "event->type() = " << event->type();
-    switch (event->type())
-        {
-        case 0:
-            qDebug() << "QEvent::None, Not an event";
-        break;
-        
-        case 130:
-            qDebug() << "QEvent::AccessibilityDescription, Used to query accessibility description texts (QAccessibleEvent).";
-        break;
-        
-        case 119:
-            qDebug() << "QEvent::AccessibilityHelp, Used to query accessibility help texts (QAccessibleEvent).";
-        break;
-        
-        case 86:
-            qDebug() << "QEvent::AccessibilityPrepare, Accessibility information is requested.";
-        break;
-        
-        case 114:
-            qDebug() << "QEvent::ActionAdded, A new action has been added (QActionEvent).";
-        break;
-        
-        case 113:
-            qDebug() << "QEvent::ActionChanged, An action has been changed (QActionEvent).";
-        break;
-        
-        case 115:
-            qDebug() << "QEvent::ActionRemoved, An action has been removed (QActionEvent).";
-        break;
-        
-        case 99:
-            qDebug() << "QEvent::ActivationChange, A widget's top-level window activation state has changed.";
-        break;
-        
-        case 121:
-            qDebug() << "QEvent::ApplicationActivate, The application has been made available to the user.";
-        break;
-        
-        //qDebug() << "QEvent::ApplicationActivated, ApplicationActivate This enum has been deprecated. Use ApplicationActivate instead.";    
-        
-        case 122:
-            qDebug() << "QEvent::ApplicationDeactivate, The application has been suspended, and is unavailable to the user.";
-        break;
-        
-        case 36:
-           qDebug() << "QEvent::ApplicationFontChange, The default application font has changed.";
-        break;
-            
-        case 37:
-            qDebug() << "QEvent::ApplicationLayoutDirectionChange, The default application layout direction has changed.";
-        break;
-        
-        case 38:
-            qDebug() << "QEvent::ApplicationPaletteChange, The default application palette has changed.";
-        break;
-    
-        case 35:
-            qDebug() << "QEvent::ApplicationWindowIconChange, The application's icon has changed.";
-        break;
-        
-        case 68:
-            qDebug() << "QEvent::ChildAdded, An object gets a child (QChildEvent).";
-        break;
-        
-        case 70:
-            qDebug() << "QEvent::ChildInserted , An object gets a child (QChildEvent). Qt3Support only, use ChildAdded instead.";
-        break;
-        
-        case 69:
-            qDebug() << "QEvent::ChildPolished, A widget child gets polished (QChildEvent).";
-        break;
-        
-        case 71:
-            qDebug() << "QEvent::ChildRemoved, An object loses a child (QChildEvent).";
-        break;
-        
-        case 40:
-            qDebug() << "QEvent::Clipboard, The clipboard contents have changed (QClipboardEvent).";
-        break;
-        
-        case 19:
-            qDebug() << "QEvent::Close, Widget was closed (QCloseEvent).";
-        break;
-        
-        case 200:
-            qDebug() << "QEvent::CloseSoftwareInputPanel, A widget wants to close the software input panel (SIP).";
-        break;
-    
-        case 178:
-            qDebug() << "QEvent::ContentsRectChange, The margins of the widget's content rect changed.";
-        break;
-        
-        case 82:
-            qDebug() << "QEvent::ContextMenu, Context popup menu (QContextMenuEvent).";
-        break;
-        
-        case 183:
-            qDebug() << "QEvent::CursorChange, The widget's cursor has changed.";
-        break;
-        
-        case 52:
-            qDebug() << "QEvent::DeferredDelete, The object will be deleted after it has cleaned up.";
-        break;
-        
-        case 60:
-            qDebug() << "QEvent::DragEnter, The cursor enters a widget during a drag and drop operation (QDragEnterEvent).";
-        break;
-        
-        case 62:
-            qDebug() << "QEvent::DragLeave, The cursor leaves a widget during a drag and drop operation (QDragLeaveEvent).";
-        break;
-        
-        case 61:
-            qDebug() << "QEvent::DragMove, A drag and drop operation is in progress (QDragMoveEvent).";
-        break;
-        
-        case 63:
-            qDebug() << "QEvent::Drop, A drag and drop operation is completed (QDropEvent).";
-        break;
-    
-        case 98:
-            qDebug() << "QEvent::EnabledChange, Widget's enabled state has changed.";
-        break;
-        
-        case 10:
-            qDebug() << "QEvent::Enter, Mouse enters widget's boundaries.";
-        break;
-        
-        case 150:
-            qDebug() << "QEvent::EnterEditFocus, An editor widget gains focus for editing.";
-        break;
-        
-        case 124:
-            qDebug() << "QEvent::EnterWhatsThisMode, Send to toplevel widgets when the application enters What's This? mode.";
-        break;
-        
-        case 116:
-            qDebug() << "QEvent::FileOpen, File open request (QFileOpenEvent).";
-        break;
-        
-        case 8:
-            qDebug() << "QEvent::FocusIn, Widget gains keyboard focus (QFocusEvent).";
-        break;
-        
-        case 9:
-            qDebug() << "QEvent::FocusOut, Widget loses keyboard focus (QFocusEvent).";
-        break;
-        
-        case 97:
-            qDebug() << "QEvent::FontChange, Widget's font has changed.";
-        break;
-    
-        case 188:
-            qDebug() << "QEvent::GrabKeyboard, Item gains keyboard grab (QGraphicsItem only).";
-        break;
-        
-        case 186:
-            qDebug() << "QEvent::GrabMouse, Item gains mouse grab (QGraphicsItem only).";
-        break;
-        
-        case 159:
-            qDebug() << "QEvent::GraphicsSceneContextMenu, Context popup menu over a graphics scene (QGraphicsSceneContextMenuEvent).";
-        break;
-        
-        case 164:
-            qDebug() << "QEvent::GraphicsSceneDragEnter, The cursor enters a graphics scene during a drag and drop operation (QGraphicsSceneDragDropEvent).";
-        break;
-        
-        case 166:
-            qDebug() << "QEvent::GraphicsSceneDragLeave, The cursor leaves a graphics scene during a drag and drop operation (QGraphicsSceneDragDropEvent).";
-        break;
-        
-        case 165:
-            qDebug() << "QEvent::GraphicsSceneDragMove, A drag and drop operation is in progress over a scene (QGraphicsSceneDragDropEvent).";
-        break;
-        
-        case 167:
-            qDebug() << "QEvent::GraphicsSceneDrop, A drag and drop operation is completed over a scene (QGraphicsSceneDragDropEvent).";
-        break;
-        
-        case 163:
-            qDebug() << "QEvent::GraphicsSceneHelp, The user requests help for a graphics scene (QHelpEvent).";
-        break;
-        
-        case 160:
-            qDebug() << "QEvent::GraphicsSceneHoverEnter, The mouse cursor enters a hover item in a graphics scene (QGraphicsSceneHoverEvent).";
-        break;
-        
-        case 162:
-            qDebug() << "QEvent::GraphicsSceneHoverLeave, The mouse cursor leaves a hover item in a graphics scene (QGraphicsSceneHoverEvent).";
-        break;
-    
-        case 161:
-            qDebug() << "QEvent::GraphicsSceneHoverMove, The mouse cursor moves inside a hover item in a graphics scene (QGraphicsSceneHoverEvent).";
-        break;
-        
-        case 158:
-            qDebug() << "QEvent::GraphicsSceneMouseDoubleClick, Mouse press again (double click) in a graphics scene (QGraphicsSceneMouseEvent).";
-        break;
-        
-        case 155:
-            qDebug() << "QEvent::GraphicsSceneMouseMove, Move mouse in a graphics scene (QGraphicsSceneMouseEvent).";
-        break;
-        
-        case 156:
-            qDebug() << "QEvent::GraphicsSceneMousePress, Mouse press in a graphics scene (QGraphicsSceneMouseEvent).";
-        break;
-        
-        case 157:
-            qDebug() << "QEvent::GraphicsSceneMouseRelease, Mouse release in a graphics scene (QGraphicsSceneMouseEvent).";
-        break;
-            
-        case 182:
-            qDebug() << "QEvent::GraphicsSceneMove, Widget was moved (QGraphicsSceneMoveEvent).";
-        break;
-        
-        case 181:
-            qDebug() << "QEvent::GraphicsSceneResize, Widget was resized (QGraphicsSceneResizeEvent).";
-        break;
-    
-        case 168:
-            qDebug() << "QEvent::GraphicsSceneWheel, Mouse wheel rolled in a graphics scene (QGraphicsSceneWheelEvent).";
-        break;
-        
-        case 18:
-            qDebug() << "QEvent::Hide, Widget was hidden (QHideEvent).";
-        break;
-        
-        case 27:
-            qDebug() << "QEvent::HideToParent, A child widget has been hidden.";
-        break;
-        
-        case 127:
-            qDebug() << "QEvent::HoverEnter, The mouse cursor enters a hover widget (QHoverEvent).";
-        break;
-        
-        case 128:
-            qDebug() << "QEvent::HoverLeave, The mouse cursor leaves a hover widget (QHoverEvent).";
-        break;
-        
-        case 129:
-            qDebug() << "QEvent::HoverMove, The mouse cursor moves inside a hover widget (QHoverEvent).";
-        break;
-        
-        case 96:
-            qDebug() << "QEvent::IconDrag, The main icon of a window has been dragged away (QIconDragEvent).";
-        break;
-        
-        case 101:
-            qDebug() << "QEvent::IconTextChange, Widget's icon text has been changed.";
-        break;
-        
-        case 83:
-            qDebug() << "QEvent::InputMethod, An input method is being used (QInputMethodEvent).";
-        break;
-        
-        case 6:
-            qDebug() << "QEvent::KeyPress, Key press (QKeyEvent).";
-        break;
-        
-        case 7:
-            qDebug() << "QEvent::KeyRelease, Key release (QKeyEvent).";
-        break;
-        
-        case 89:
-            qDebug() << "QEvent::LanguageChange, The application translation changed.";
-        break;
-        
-        case 90:
-            qDebug() << "QEvent::LayoutDirectionChange, The direction of layouts changed.";
-        break;
-        
-        case 76:
-            qDebug() << "QEvent::LayoutRequest, Widget layout needs to be redone.";
-        break;
-        
-        case 11:
-            qDebug() << "QEvent::Leave, Mouse leaves widget's boundaries.";
-        break;
-        
-        case 151:
-            qDebug() << "QEvent::LeaveEditFocus, An editor widget loses focus for editing.";
-        break;
-        
-        case 125:
-            qDebug() << "QEvent::LeaveWhatsThisMode, Send to toplevel widgets when the application leaves What's This? mode.";
-        break;
-        
-        case 88:
-            qDebug() << "QEvent::LocaleChange, The system locale has changed.";
-        break;
-            
-        case 176:
-            qDebug() << "QEvent::NonClientAreaMouseButtonDblClick, A mouse double click occurred outside the client area.";
-        break;
-    
-        case 174:
-            qDebug() << "QEvent::NonClientAreaMouseButtonPress, A mouse button press occurred outside the client area.";
-        break;
-    
-        case 175:
-            qDebug() << "QEvent::NonClientAreaMouseButtonRelease, A mouse button release occurred outside the client area.";
-        break;
-    
-        case 173:
-            qDebug() << "QEvent::NonClientAreaMouseMove, A mouse move occurred outside the client area.";
-        break;
-    
-        case 177:
-            qDebug() << "QEvent::MacSizeChange, The user changed his widget sizes (Mac OS X only).";
-        break;
-    
-        case 153:
-            qDebug() << "QEvent::MenubarUpdated, The window's menu bar has been updated.";
-        break;
-    
-        case 43:
-            qDebug() << "QEvent::MetaCall, An asynchronous method invocation via QMetaObject::invokeMethod().";
-        break;
-    
-        case 102:
-            qDebug() << "QEvent::ModifiedChange, Widgets modification state has been changed.";
-        break;
-    
-        case 4:
-            qDebug() << "QEvent::MouseButtonDblClick, Mouse press again (QMouseEvent).";
-        break;
-    
-        case 2:
-            qDebug() << "QEvent::MouseButtonPress, Mouse press (QMouseEvent).";
-        break;
-    
-        case 3:
-            qDebug() << "QEvent::MouseButtonRelease, Mouse release (QMouseEvent).";
-        break;
-    
-        case 5:
-            qDebug() << "QEvent::MouseMove, Mouse move (QMouseEvent).";
-        break;
-    
-        case 109:
-            qDebug() << "QEvent::MouseTrackingChange, The mouse tracking state has changed.";
-        break;
-    
-        case 13:
-            qDebug() << "QEvent::Move, Widget's position changed (QMoveEvent).";
-        break;
-    
-        case 12:
-            qDebug() << "QEvent::Paint, Screen update necessary (QPaintEvent).";
-        break;
-    
-        case 39:
-            qDebug() << "QEvent::PaletteChange, Palette of the widget changed.";
-        break;
-    
-        case 131:
-            qDebug() << "QEvent::ParentAboutToChange, The widget parent is about to change.";
-        break;
-    
-        case 21:
-            qDebug() << "QEvent::ParentChange, The widget parent has changed.";
-        break;
-    
-        case 75:
-            qDebug() << "QEvent::Polish, The widget is polished.";
-        break;
-    
-        case 74:
-            qDebug() << "QEvent::PolishRequest, The widget should be polished.";
-        break;
-    
-        case 123:
-            qDebug() << "QEvent::QueryWhatsThis, The widget should accept the event if it has What's This? help.";
-        break;
-    
-        case 199:
-            qDebug() << "QEvent::RequestSoftwareInputPanel, A widget wants to open a software input panel (SIP).";
-        break;
-    
-        case 14:
-            qDebug() << "QEvent::Resize, Widget's size changed (QResizeEvent).";
-        break;
-    
-        case 117:
-            qDebug() << "QEvent::Shortcut, Key press in child for shortcut key handling (QShortcutEvent).";
-        break;
-    
-        case 51:
-            qDebug() << "QEvent::ShortcutOverride, Key press in child, for overriding shortcut key handling (QKeyEvent).";
-        break;
-    
-        case 17:
-            qDebug() << "QEvent::Show, Widget was shown on screen (QShowEvent).";
-        break;
-    
-        case 26:
-            qDebug() << "QEvent::ShowToParent, A child widget has been shown.";
-        break;
-    
-        case 50:
-            qDebug() << "QEvent::SockAct, Socket activated, used to implement QSocketNotifier.";
-        break;
-    
-        case 192:
-            qDebug() << "QEvent::StateMachineSignal, A signal delivered to a state machine (QStateMachine::SignalEvent).";
-        break;
-    
-        case 193:
-            qDebug() << "QEvent::StateMachineWrapped, The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent).";
-        break;
-    
-        case 112:
-            qDebug() << "QEvent::StatusTip, A status tip is requested (QStatusTipEvent).";
-        break;
-    
-        case 100:
-            qDebug() << "QEvent::StyleChange, Widget's style has been changed.";
-        break;
-    
-        case 87:
-            qDebug() << "QEvent::TabletMove, Wacom tablet move (QTabletEvent).";
-        break;
-    
-        case 92:
-            qDebug() << "QEvent::TabletPress, Wacom tablet press (QTabletEvent).";
-        break;
-    
-        case 93:
-            qDebug() << "QEvent::TabletRelease, Wacom tablet release (QTabletEvent).";
-        break;
-    
-        case 94:
-            qDebug() << "QEvent::OkRequest, Ok button in decoration pressed. Supported only for Windows CE.";
-        break;
-    
-        case 171:
-            qDebug() << "QEvent::TabletEnterProximity, Wacom tablet enter proximity event (QTabletEvent), sent to QApplication.";
-        break;
-    
-        case 172:
-            qDebug() << "QEvent::TabletLeaveProximity, Wacom tablet leave proximity event (QTabletEvent), sent to QApplication.";
-        break;
-    
-        case 1:
-            qDebug() << "QEvent::Timer, Regular timer events (QTimerEvent).";
-        break;
-    
-        case 120:
-            qDebug() << "QEvent::ToolBarChange, The toolbar button is toggled on Mac OS X.";
-        break;
-    
-        case 110:
-            qDebug() << "QEvent::ToolTip, A tooltip was requested (QHelpEvent).";
-        break;
-    
-        case 184:
-            qDebug() << "QEvent::ToolTipChange, The widget's tooltip has changed.";
-        break;
-    
-        case 189:
-            qDebug() << "QEvent::UngrabKeyboard, Item loses keyboard grab (QGraphicsItem only).";
-        break;
-    
-        case 187:
-            qDebug() << "QEvent::UngrabMouse, Item loses mouse grab (QGraphicsItem only).";
-        break;
-    
-        case 78:
-            qDebug() << "QEvent::UpdateLater, The widget should be queued to be repainted at a later time.";
-        break;
-    
-        case 77:
-            qDebug() << "QEvent::UpdateRequest, The widget should be repainted.";
-        break;
-    
-        case 111:
-            qDebug() << "QEvent::WhatsThis, The widget should reveal What's This? help (QHelpEvent).";
-        break;
-    
-        case 118:
-            qDebug() << "QEvent::WhatsThisClicked, A link in a widget's What's This? help was clicked.";
-        break;
-    
-        case 31:
-            qDebug() << "QEvent::Wheel, Mouse wheel rolled (QWheelEvent).";
-        break;
-    
-        case 132:
-            qDebug() << "QEvent::WinEventAct, A Windows-specific activation event has occurred.";
-        break;
-    
-        case 24:
-            qDebug() << "QEvent::WindowActivate, Window was activated.";
-        break;
-    
-        case 103:
-            qDebug() << "QEvent::WindowBlocked, The window is blocked by a modal dialog.";
-        break;
-    
-        case 25:
-            qDebug() << "QEvent::WindowDeactivate, Window was deactivated.";
-        break;
-    
-        case 34:
-            qDebug() << "QEvent::WindowIconChange, The window's icon has changed.";
-        break;
-    
-        case 105:
-            qDebug() << "QEvent::WindowStateChange, The window's state (minimized, maximized or full-screen) has changed (QWindowStateChangeEvent).";
-        break;
-    
-        case 33:
-            qDebug() << "QEvent::WindowTitleChange, The window title has changed.";
-        break;
-    
-        case 104:
-            qDebug() << "QEvent::WindowUnblocked, The window is unblocked after a modal dialog exited.";
-        break;
-    
-        case 126:
-            qDebug() << "QEvent::ZOrderChange, The widget's z-order has changed. This event is never sent to top level windows.";
-        break;
-    
-        case 169:
-            qDebug() << "QEvent::KeyboardLayoutChange, The keyboard layout has changed.";
-        break;
-    
-        case 170:
-            qDebug() << "QEvent::DynamicPropertyChange, A dynamic property was added, changed or removed from the object.";
-        break;
-    
-        case 194:
-            qDebug() << "QEvent::TouchBegin, Beginning of a sequence of touch-screen and/or track-pad events (QTouchEvent)";
-        break;
-    
-        case 195:
-            qDebug() << "QEvent::TouchUpdate, Touch-screen event (QTouchEvent)";
-        break;
-    
-        case 196:
-            qDebug() << "QEvent::TouchEnd, End of touch-event sequence (QTouchEvent)";
-        break;
-    
-        case 203:
-            qDebug() << "QEvent::WinIdChange, The window system identifer for this native widget has changed";
-        break;
-    
-        case 198:
-            qDebug() << "QEvent::Gesture, A gesture was triggered (QGestureEvent)";
-        break;
-    
-        case 202:
-            qDebug() << "QEvent::GestureOverride, A gesture override was triggered (QGestureEvent)";
-        break;
-        
-        default:
-        break;
-        }
-}
-
-// End of file
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/QtSyncStatusSpy/qtsyncstatusview.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#ifndef QTSYNCSTATUSVIEW_H
-#define QTSYNCSTATUSVIEW_H
-
-#include <QObject>
-#include <hbview.h>
-
-class QGraphicsItem;
-class HbDataForm;
-class HbAction;
-class QtSyncStatusModel;
-class HbMainWindow;
-class QtSyncStatusLog;
-
-class QtSyncStatusView : public HbView
-{
-    Q_OBJECT
-
-public:
-    QtSyncStatusView(QtSyncStatusLog& log, QGraphicsItem *parent = 0);
-    ~QtSyncStatusView();
-    
-signals:
-    void showLog();
-    
-public slots:    
-    void publish();
-    void viewLog();
-    void hideView();
-    void deleteLog();
-    void activateView();    
-    
-private:
-    void createMenu();
-    
-    virtual bool event(QEvent *event);
-    
-    void debugEvent(QEvent *event);
-    
-private:
-    HbDataForm *mSyncStatusForm;
-    QtSyncStatusModel *mSyncStatusModel;
-};
-
-#endif // QTSYNCSTATUSVIEW_H
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/SyncStatusSpySettingItemList.uidesign	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<designerData version="1.1.0">
+  <componentManifest>
+    <manifestEntry id="com.nokia.sdt.series60.DefaultAppUi" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.DesignTimeContainer" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CommonBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknSettingItemList" version="1.1.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.ContainerBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknIntegerEdwin" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CEikEdwinBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.EditorBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CCoeControlBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.ControlBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknEnumeratedTextPopupSettingItem" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.EnumeratedTextPopupBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuBar" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuPane" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuItem" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuItemBase" version="1.0.0"/>
+  </componentManifest>
+  <property id="com.nokia.sdt.symbian.dm.RESOURCE_DIRECTORY_ID">data</property>
+  <property id="com.nokia.sdt.component.symbian.version">5.0.0</property>
+  <property id="com.nokia.sdt.component.symbian.vendor">com.nokia.series60</property>
+  <property id="com.nokia.sdt.symbian.dm.COMPONENT_PROVIDER">com.nokia.sdt.component.symbian.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.INCLUDE_DIRECTORY_ID">inc</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCE_DIRECTORY_ID">src</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCEGEN_PROVIDER">com.nokia.sdt.sourcegen.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.BUILD_DIRECTORY_ID">group</property>
+  <component id="com.nokia.sdt.series60.DefaultAppUi">
+    <property id="className">CSyncStatusSpyAppUi</property>
+    <compoundProperty id="location">
+      <property id="x">51</property>
+      <property id="y">44</property>
+    </compoundProperty>
+    <property id="name">SyncStatusSpyAppUi</property>
+    <compoundProperty id="size">
+      <property id="width">240</property>
+      <property id="height">320</property>
+    </compoundProperty>
+    <component id="com.nokia.sdt.series60.CAknSettingItemList">
+      <property id="title" type="i18n">STR_SyncStatusSpyAppUi_1</property>
+      <compoundProperty id="location">
+        <property id="y">66</property>
+      </compoundProperty>
+      <property id="className">CSyncStatusSpySettingItemList</property>
+      <property id="name">SyncStatusSpySettingItemList</property>
+      <compoundProperty id="size">
+        <property id="width">240</property>
+        <property id="height">222</property>
+      </compoundProperty>
+      <component id="com.nokia.sdt.series60.CAknIntegerEdwin">
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">0</property>
+        </compoundProperty>
+        <property id="name">integerEditor1</property>
+        <property id="itemTitle" type="i18n">STR_SyncStatusSpyAppUi_2</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CAknIntegerEdwin">
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">54</property>
+        </compoundProperty>
+        <property id="name">integerEditor2</property>
+        <property id="itemTitle" type="i18n">STR_SyncStatusSpyAppUi_4</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CAknEnumeratedTextPopupSettingItem">
+        <sequenceProperty id="items">
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_55</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_56</property>
+            <property id="value">0</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_57</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_58</property>
+            <property id="value">1</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_59</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_60</property>
+            <property id="value">2</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_61</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_62</property>
+            <property id="value">3</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_63</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_64</property>
+            <property id="value">4</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_65</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_66</property>
+            <property id="value">5</property>
+          </compoundElement>
+        </sequenceProperty>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">108</property>
+        </compoundProperty>
+        <property id="name">enumeratedTextPopup2</property>
+        <property id="itemTitle" type="i18n">STR_SyncStatusSpyAppUi_8</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.CAknEnumeratedTextPopupSettingItem">
+        <sequenceProperty id="items">
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_12</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_13</property>
+            <property id="value">0</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_14</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_15</property>
+            <property id="value">1</property>
+          </compoundElement>
+          <compoundElement>
+            <property id="settingText" type="i18n">STR_SyncStatusSpyAppUi_33</property>
+            <property id="popupText" type="i18n">STR_SyncStatusSpyAppUi_34</property>
+            <property id="value">2</property>
+          </compoundElement>
+        </sequenceProperty>
+        <compoundProperty id="location">
+          <property id="x">0</property>
+          <property id="y">162</property>
+        </compoundProperty>
+        <property id="name">enumeratedTextPopup1</property>
+        <property id="itemTitle" type="i18n">STR_SyncStatusSpyAppUi_6</property>
+        <compoundProperty id="size">
+          <property id="height">54</property>
+          <property id="width">240</property>
+        </compoundProperty>
+      </component>
+      <component id="com.nokia.sdt.series60.MenuBar">
+        <compoundProperty id="location">
+          <property id="x">6</property>
+          <property id="y">101</property>
+        </compoundProperty>
+        <property id="name">menubar</property>
+        <compoundProperty id="size">
+          <property id="height">187</property>
+          <property id="width">228</property>
+        </compoundProperty>
+        <component id="com.nokia.sdt.series60.MenuPane">
+          <compoundProperty id="location"/>
+          <property id="name">menuPane1</property>
+          <compoundProperty id="size">
+            <property id="height">187</property>
+            <property id="width">228</property>
+          </compoundProperty>
+          <component id="com.nokia.sdt.series60.MenuItem">
+            <compoundProperty id="location">
+              <property id="x">5</property>
+              <property id="y">2</property>
+            </compoundProperty>
+            <property id="name">saveMenuItem</property>
+            <property id="text" type="i18n">STR_SyncStatusSpyAppUi_69</property>
+            <compoundProperty id="size">
+              <property id="width">213</property>
+              <property id="height">28</property>
+            </compoundProperty>
+          </component>
+          <component id="com.nokia.sdt.series60.MenuItem">
+            <compoundProperty id="location">
+              <property id="x">5</property>
+              <property id="y">32</property>
+            </compoundProperty>
+            <property id="name">publishMenuItem</property>
+            <property id="text" type="i18n">STR_SyncStatusSpyAppUi_68</property>
+            <compoundProperty id="size">
+              <property id="width">213</property>
+              <property id="height">28</property>
+            </compoundProperty>
+          </component>
+          <component id="com.nokia.sdt.series60.MenuItem">
+            <compoundProperty id="location">
+              <property id="x">5</property>
+              <property id="y">62</property>
+            </compoundProperty>
+            <property id="name">view_logMenuItem</property>
+            <property id="text" type="i18n">STR_SyncStatusSpyAppUi_70</property>
+            <compoundProperty id="size">
+              <property id="width">213</property>
+              <property id="height">28</property>
+            </compoundProperty>
+          </component>
+          <component id="com.nokia.sdt.series60.MenuItem">
+            <compoundProperty id="location">
+              <property id="x">5</property>
+              <property id="y">92</property>
+            </compoundProperty>
+            <property id="name">hideMenuItem</property>
+            <property id="text" type="i18n">STR_SyncStatusSpyAppUi_67</property>
+            <compoundProperty id="size">
+              <property id="width">213</property>
+              <property id="height">28</property>
+            </compoundProperty>
+          </component>
+          <component id="com.nokia.sdt.series60.MenuItem">
+            <compoundProperty id="location">
+              <property id="x">5</property>
+              <property id="y">122</property>
+            </compoundProperty>
+            <property id="name">delete_logMenuItem</property>
+            <property id="text" type="i18n">STR_SyncStatusSpyAppUi_71</property>
+            <compoundProperty id="size">
+              <property id="width">213</property>
+              <property id="height">28</property>
+            </compoundProperty>
+          </component>
+        </component>
+      </component>
+    </component>
+  </component>
+  <stringBundle>
+    <stringTable language="LANG_English">
+      <string id="STR_SyncStatusSpyAppUi_1">Settings</string>
+      <string id="STR_SyncStatusSpyAppUi_2">Error code</string>
+      <string id="STR_SyncStatusSpyAppUi_4">Sync profile ID</string>
+      <string id="STR_SyncStatusSpyAppUi_6">Sync initiation</string>
+      <string id="STR_SyncStatusSpyAppUi_8">Sync type</string>
+      <string id="STR_SyncStatusSpyAppUi_12">No sync ongoing</string>
+      <string id="STR_SyncStatusSpyAppUi_13"/>
+      <string id="STR_SyncStatusSpyAppUi_14">Server initiated</string>
+      <string id="STR_SyncStatusSpyAppUi_15"/>
+      <string id="STR_SyncStatusSpyAppUi_33">Client initiated</string>
+      <string id="STR_SyncStatusSpyAppUi_34"/>
+      <string id="STR_SyncStatusSpyAppUi_55">ESmlTwoWay</string>
+      <string id="STR_SyncStatusSpyAppUi_56"/>
+      <string id="STR_SyncStatusSpyAppUi_57">ESmlOneWayFromServer</string>
+      <string id="STR_SyncStatusSpyAppUi_58"/>
+      <string id="STR_SyncStatusSpyAppUi_59">ESmlOneWayFromClient</string>
+      <string id="STR_SyncStatusSpyAppUi_60"/>
+      <string id="STR_SyncStatusSpyAppUi_61">ESmlSlowSync</string>
+      <string id="STR_SyncStatusSpyAppUi_62"/>
+      <string id="STR_SyncStatusSpyAppUi_63">ESmlRefreshFromServer</string>
+      <string id="STR_SyncStatusSpyAppUi_64"/>
+      <string id="STR_SyncStatusSpyAppUi_65">ESmlRefreshFromClient</string>
+      <string id="STR_SyncStatusSpyAppUi_66"/>
+      <string id="STR_SyncStatusSpyAppUi_67">Hide</string>
+      <string id="STR_SyncStatusSpyAppUi_68">Publish</string>
+      <string id="STR_SyncStatusSpyAppUi_69">Save</string>
+      <string id="STR_SyncStatusSpyAppUi_70">View log</string>
+      <string id="STR_SyncStatusSpyAppUi_71">Delete log</string>
+    </stringTable>
+  </stringBundle>
+  <macroTable/>
+  <sourceMappingState>
+    <resourceMappings>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="associated">r_sync_status_spy_setting_item_list_enumerated_text_popup1</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup2" rsrcId="associated">r_sync_status_spy_setting_item_list_enumerated_text_popup2</resourceMapping>
+      <resourceMapping instanceName="menuPane1">r_sync_status_spy_setting_item_list_menu_pane1_menu_pane</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="popup">r_sync_status_spy_setting_item_list_enumerated_text_popup1_popped_up_texts_resource</resourceMapping>
+      <resourceMapping instanceName="SyncStatusSpySettingItemList">r_sync_status_spy_setting_item_list_sync_status_spy_setting_item_list</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup2" rsrcId="popup">r_sync_status_spy_setting_item_list_enumerated_text_popup2_popped_up_texts_resource</resourceMapping>
+      <resourceMapping instanceName="integerEditor1" rsrcId="member$setting_page_resource">r_sync_status_spy_setting_item_list_integer_editor1_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="integerEditor2" rsrcId="member$setting_page_resource">r_sync_status_spy_setting_item_list_integer_editor2_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup2">r_sync_status_spy_setting_item_list_enumerated_text_popup2_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1">r_sync_status_spy_setting_item_list_enumerated_text_popup1_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="menubar">r_sync_status_spy_setting_item_list_menubar</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup2" rsrcId="setting">r_sync_status_spy_setting_item_list_enumerated_text_popup2_setting_texts_resource</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="setting">r_sync_status_spy_setting_item_list_enumerated_text_popup1_setting_texts_resource</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup2" rsrcId="member$setting_page_resource">r_sync_status_spy_setting_item_list_enumerated_text_popup2_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="enumeratedTextPopup1" rsrcId="member$setting_page_resource">r_sync_status_spy_setting_item_list_enumerated_text_popup1_setting_page_resource</resourceMapping>
+      <resourceMapping instanceName="integerEditor1">r_sync_status_spy_setting_item_list_integer_editor1_editor_resource_id</resourceMapping>
+      <resourceMapping instanceName="integerEditor2">r_sync_status_spy_setting_item_list_integer_editor2_editor_resource_id</resourceMapping>
+    </resourceMappings>
+    <enumMappings>
+      <enumMapping instanceName="enumeratedTextPopup1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncStatusSpyAppUiEnumeratedTextPopup1</enumMapping>
+      <enumMapping instanceName="enumeratedTextPopup2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncStatusSpyAppUiEnumeratedTextPopup2</enumMapping>
+      <enumMapping instanceName="integerEditor2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncStatusSpyAppUiIntegerEditor2</enumMapping>
+      <enumMapping instanceName="hideMenuItem" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncStatusSpyAppUiHideMenuItemCommand</enumMapping>
+      <enumMapping instanceName="integerEditor1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_SETTING_ITEM_ID">ESyncStatusSpyAppUiIntegerEditor1</enumMapping>
+      <enumMapping instanceName="enumeratedTextPopup2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtPopupSettingList</enumMapping>
+      <enumMapping instanceName="enumeratedTextPopup1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtPopupSettingList</enumMapping>
+      <enumMapping instanceName="integerEditor1" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtIntegerEdwin</enumMapping>
+      <enumMapping instanceName="view_logMenuItem" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncStatusSpyAppUiView_logMenuItemCommand</enumMapping>
+      <enumMapping instanceName="integerEditor2" propertyId="" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE">EAknCtIntegerEdwin</enumMapping>
+      <enumMapping instanceName="delete_logMenuItem" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncStatusSpyAppUiDelete_logMenuItemCommand</enumMapping>
+      <enumMapping instanceName="saveMenuItem" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncStatusSpyAppUiSaveMenuItemCommand</enumMapping>
+      <enumMapping instanceName="publishMenuItem" propertyId="command" nameAlgorithm="com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS">ESyncStatusSpyAppUiPublishMenuItemCommand</enumMapping>
+    </enumMappings>
+    <arrayMappings/>
+  </sourceMappingState>
+  <generatedFiles>
+    <file>inc/syncstatusspysettingitemlist.h</file>
+    <file>src/syncstatusspysettingitemlist.cpp</file>
+    <file>src/syncstatusspysettingitemlistsettings.cpp</file>
+    <file>inc/syncstatusspysettingitemlistsettings.h</file>
+    <file>data/syncstatusspy.rss</file>
+    <file>data/syncstatusspysettingitemlist.rssi</file>
+    <file>data/syncstatusspy.loc</file>
+    <file>data/syncstatusspy.l01</file>
+    <file>data/syncstatusspysettingitemlist.loc</file>
+    <file>data/syncstatusspysettingitemlist.l01</file>
+    <file>inc/syncstatusspysettingitemlist.hrh</file>
+  </generatedFiles>
+</designerData>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/application.uidesign	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<designerData version="1.1.0">
+  <componentManifest>
+    <manifestEntry id="com.nokia.sdt.series60.CAknApplication" version="1.1.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.NonLayoutBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CommonBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknDocument" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknAppUi" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CAknAppUiBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.DesignTimeContainer" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPane" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.ControlBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPaneCaption" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.StatusPaneTitleBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CBA" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.CBABase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuBar" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.MenuBase" version="1.0.0"/>
+    <manifestEntry id="com.nokia.sdt.series60.DesignReference" version="1.0.0"/>
+  </componentManifest>
+  <property id="com.nokia.sdt.component.symbian.version">5.0.0</property>
+  <property id="com.nokia.sdt.component.symbian.vendor">com.nokia.series60</property>
+  <property id="com.nokia.sdt.symbian.dm.RESOURCE_DIRECTORY_ID">data</property>
+  <property id="com.nokia.sdt.symbian.dm.COMPONENT_PROVIDER">com.nokia.sdt.component.symbian.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.INCLUDE_DIRECTORY_ID">inc</property>
+  <property id="com.nokia.sdt.symbian.dm.ROOT_CONTAINER">SyncStatusSpyAppUi</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCE_DIRECTORY_ID">src</property>
+  <property id="com.nokia.sdt.symbian.dm.ROOT_APPLICATION_NAME">SyncStatusSpy</property>
+  <property id="com.nokia.sdt.symbian.dm.SOURCEGEN_PROVIDER">com.nokia.sdt.sourcegen.Symbian-Provider</property>
+  <property id="com.nokia.sdt.symbian.dm.BUILD_DIRECTORY_ID">group</property>
+  <component id="com.nokia.sdt.series60.CAknApplication">
+    <property id="className">CSyncStatusSpyApplication</property>
+    <property id="documentBase">SyncStatusSpy</property>
+    <property id="name">SyncStatusSpyApplication</property>
+    <property id="uid">0x2001FDF3</property>
+    <component id="com.nokia.sdt.series60.CAknDocument">
+      <property id="className">CSyncStatusSpyDocument</property>
+      <property id="name">SyncStatusSpyDocument</property>
+      <component id="com.nokia.sdt.series60.CAknAppUi">
+        <property id="initialDesign" type="componentRef">designReference1</property>
+        <property id="className">CSyncStatusSpyAppUi</property>
+        <compoundProperty id="location"/>
+        <property id="optionsMenu" type="componentRef">optionsMenu</property>
+        <property id="name">SyncStatusSpyAppUi</property>
+        <compoundProperty id="size">
+          <property id="width">176</property>
+          <property id="height">208</property>
+        </compoundProperty>
+        <component id="com.nokia.sdt.series60.StatusPane">
+          <compoundProperty id="location">
+            <property id="x">20</property>
+          </compoundProperty>
+          <property id="name">statusPane</property>
+          <compoundProperty id="size">
+            <property id="width">204</property>
+            <property id="height">63</property>
+          </compoundProperty>
+          <component id="com.nokia.sdt.series60.StatusPaneCaption">
+            <property id="shortCaption" type="i18n">STR_SyncStatusSpyApplication_5</property>
+            <compoundProperty id="location">
+              <property id="x">56</property>
+            </compoundProperty>
+            <property id="longCaption" type="i18n">STR_SyncStatusSpyApplication_4</property>
+            <property id="name">caption</property>
+            <compoundProperty id="size">
+              <property id="width">148</property>
+              <property id="height">43</property>
+            </compoundProperty>
+          </component>
+        </component>
+        <component id="com.nokia.sdt.series60.CBA">
+          <compoundProperty id="location">
+            <property id="y">288</property>
+          </compoundProperty>
+          <compoundProperty id="info">
+            <property id="leftText" type="i18n">STR_SyncStatusSpyApplication_1</property>
+            <property id="rightText" type="i18n">STR_SyncStatusSpyApplication_2</property>
+            <property id="middleText" type="i18n">STR_SyncStatusSpyApplication_3</property>
+          </compoundProperty>
+          <property id="name">controlPane</property>
+          <compoundProperty id="size">
+            <property id="width">240</property>
+            <property id="height">32</property>
+          </compoundProperty>
+        </component>
+        <component id="com.nokia.sdt.series60.MenuBar">
+          <compoundProperty id="location">
+            <property id="x">120</property>
+            <property id="y">288</property>
+          </compoundProperty>
+          <property id="name">optionsMenu</property>
+          <compoundProperty id="size"/>
+        </component>
+        <component id="com.nokia.sdt.series60.DesignReference">
+          <property id="filePath">SyncStatusSpySettingItemList.uidesign</property>
+          <property id="baseName">SyncStatusSpySettingItemList</property>
+          <property id="name">designReference1</property>
+        </component>
+      </component>
+    </component>
+  </component>
+  <stringBundle>
+    <stringTable language="LANG_English">
+      <string id="STR_SyncStatusSpyApplication_1"/>
+      <string id="STR_SyncStatusSpyApplication_2"/>
+      <string id="STR_SyncStatusSpyApplication_3"/>
+      <string id="STR_SyncStatusSpyApplication_4">SyncStatusSpy</string>
+      <string id="STR_SyncStatusSpyApplication_5">SyncStatusSpy</string>
+    </stringTable>
+  </stringBundle>
+  <macroTable/>
+  <sourceMappingState>
+    <resourceMappings>
+      <resourceMapping instanceName="statusPane">r_application_status_pane</resourceMapping>
+      <resourceMapping instanceName="SyncStatusSpyAppUi" rsrcId="localisable_app_info">r_localisable_app_info</resourceMapping>
+      <resourceMapping instanceName="SyncStatusSpyAppUi">r_application_sync_status_spy_app_ui</resourceMapping>
+      <resourceMapping instanceName="optionsMenu">r_application_options_menu</resourceMapping>
+    </resourceMappings>
+    <enumMappings/>
+    <arrayMappings/>
+  </sourceMappingState>
+  <generatedFiles>
+    <file>inc/syncstatusspysettingitemlist.h</file>
+    <file>inc/syncstatusspyappui.h</file>
+    <file>src/syncstatusspysettingitemlist.cpp</file>
+    <file>src/syncstatusspysettingitemlistsettings.cpp</file>
+    <file>inc/syncstatusspysettingitemlistsettings.h</file>
+    <file>src/syncstatusspyapplication.cpp</file>
+    <file>src/syncstatusspydocument.cpp</file>
+    <file>src/syncstatusspyappui.cpp</file>
+    <file>inc/syncstatusspyapplication.h</file>
+    <file>inc/syncstatusspydocument.h</file>
+    <file>data/syncstatusspy.rss</file>
+    <file>data/syncstatusspysettingitemlist.rssi</file>
+    <file>data/syncstatusspysettingitemlist.l01</file>
+    <file>data/syncstatusspysettingitemlist.loc</file>
+    <file>data/syncstatusspy.l01</file>
+    <file>data/syncstatusspy.loc</file>
+  </generatedFiles>
+</designerData>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy.l01	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,7 @@
+
+// localized strings for language: UK English (01)
+#define STR_SyncStatusSpyApplication_1 ""
+#define STR_SyncStatusSpyApplication_2 ""
+#define STR_SyncStatusSpyApplication_3 ""
+#define STR_SyncStatusSpyApplication_4 "SyncStatusSpy"
+#define STR_SyncStatusSpyApplication_5 "SyncStatusSpy"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifdef LANGUAGE_01
+#include "SyncStatusSpy.l01"
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+NAME SYNC
+
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <eikon.rh>
+#include <appinfo.rh>
+#include "SyncStatusSpy.loc"
+
+RESOURCE RSS_SIGNATURE
+	{
+	}
+
+RESOURCE TBUF
+	{
+	buf = "SyncStatusSpy";
+	}
+
+RESOURCE EIK_APP_INFO r_application_sync_status_spy_app_ui
+	{
+	cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+	status_pane = r_application_status_pane;
+    menubar = r_sync_status_spy_setting_item_list_menubar;
+	}
+
+RESOURCE STATUS_PANE_APP_MODEL r_application_status_pane
+	{
+	}
+
+RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
+	{
+	short_caption = STR_SyncStatusSpyApplication_5;
+	caption_and_icon = CAPTION_AND_ICON_INFO
+		{
+		caption = STR_SyncStatusSpyApplication_4;
+		number_of_icons = 0;
+		};
+	}
+
+#include "SyncStatusSpySettingItemList.rssi"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpySettingItemList.l01	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+
+// localized strings for language: UK English (01)
+#define STR_SyncStatusSpyAppUi_1 "Settings"
+#define STR_SyncStatusSpyAppUi_60 ""
+#define STR_SyncStatusSpyAppUi_61 "ESmlSlowSync"
+#define STR_SyncStatusSpyAppUi_62 ""
+#define STR_SyncStatusSpyAppUi_63 "ESmlRefreshFromServer"
+#define STR_SyncStatusSpyAppUi_64 ""
+#define STR_SyncStatusSpyAppUi_65 "ESmlRefreshFromClient"
+#define STR_SyncStatusSpyAppUi_66 ""
+#define STR_SyncStatusSpyAppUi_67 "Hide"
+#define STR_SyncStatusSpyAppUi_68 "Publish"
+#define STR_SyncStatusSpyAppUi_69 "Save"
+#define STR_SyncStatusSpyAppUi_33 "Client initiated"
+#define STR_SyncStatusSpyAppUi_34 ""
+#define STR_SyncStatusSpyAppUi_2 "Error code"
+#define STR_SyncStatusSpyAppUi_4 "Sync profile ID"
+#define STR_SyncStatusSpyAppUi_6 "Sync initiation"
+#define STR_SyncStatusSpyAppUi_70 "View log"
+#define STR_SyncStatusSpyAppUi_8 "Sync type"
+#define STR_SyncStatusSpyAppUi_71 "Delete log"
+#define STR_SyncStatusSpyAppUi_12 "No sync ongoing"
+#define STR_SyncStatusSpyAppUi_13 ""
+#define STR_SyncStatusSpyAppUi_14 "Server alerted"
+#define STR_SyncStatusSpyAppUi_15 ""
+#define STR_SyncStatusSpyAppUi_55 "ESmlTwoWay"
+#define STR_SyncStatusSpyAppUi_56 ""
+#define STR_SyncStatusSpyAppUi_57 "ESmlOneWayFromServer"
+#define STR_SyncStatusSpyAppUi_58 ""
+#define STR_SyncStatusSpyAppUi_59 "ESmlOneWayFromClient"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpySettingItemList.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifdef LANGUAGE_01
+#include "SyncStatusSpySettingItemList.l01"
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpySettingItemList.rssi	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "SyncStatusSpySettingItemList.hrh"
+#include "SyncStatusSpySettingItemList.loc"
+
+RESOURCE AVKON_SETTING_ITEM_LIST r_sync_status_spy_setting_item_list_sync_status_spy_setting_item_list
+	{
+	flags = EAknSettingItemNumberedStyle;
+	items =
+		{
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncStatusSpyAppUi_2;
+			identifier = ESyncStatusSpyAppUiIntegerEditor1;
+			setting_page_resource = r_sync_status_spy_setting_item_list_integer_editor1_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncStatusSpyAppUi_4;
+			identifier = ESyncStatusSpyAppUiIntegerEditor2;
+			setting_page_resource = r_sync_status_spy_setting_item_list_integer_editor2_setting_page_resource;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncStatusSpyAppUi_8;
+			identifier = ESyncStatusSpyAppUiEnumeratedTextPopup2;
+			setting_page_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup2_setting_page_resource;
+			associated_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup2;
+			},
+		AVKON_SETTING_ITEM
+			{
+			name = STR_SyncStatusSpyAppUi_6;
+			identifier = ESyncStatusSpyAppUiEnumeratedTextPopup1;
+			setting_page_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup1_setting_page_resource;
+			associated_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup1;
+			}
+		};
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_status_spy_setting_item_list_integer_editor1_setting_page_resource
+	{
+	label = STR_SyncStatusSpyAppUi_2;
+	type = EAknCtIntegerEdwin;
+	editor_resource_id = r_sync_status_spy_setting_item_list_integer_editor1_editor_resource_id;
+	}
+RESOURCE AVKON_INTEGER_EDWIN r_sync_status_spy_setting_item_list_integer_editor1_editor_resource_id
+	{
+	unset_value = 0;
+	min = -2147483647;
+	max = 2147483647;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_status_spy_setting_item_list_integer_editor2_setting_page_resource
+	{
+	label = STR_SyncStatusSpyAppUi_4;
+	type = EAknCtIntegerEdwin;
+	editor_resource_id = r_sync_status_spy_setting_item_list_integer_editor2_editor_resource_id;
+	}
+RESOURCE AVKON_INTEGER_EDWIN r_sync_status_spy_setting_item_list_integer_editor2_editor_resource_id
+	{
+	unset_value = 0;
+	min = -2147483647;
+	max = 2147483647;
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_status_spy_setting_item_list_enumerated_text_popup2_setting_page_resource
+	{
+	label = STR_SyncStatusSpyAppUi_8;
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_sync_status_spy_setting_item_list_enumerated_text_popup2_editor_resource_id;
+	}
+RESOURCE POPUP_SETTING_LIST r_sync_status_spy_setting_item_list_enumerated_text_popup2_editor_resource_id
+	{
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_sync_status_spy_setting_item_list_enumerated_text_popup2
+	{
+	setting_texts_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup2_setting_texts_resource;
+	popped_up_texts_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup2_popped_up_texts_resource;
+	}
+RESOURCE ARRAY r_sync_status_spy_setting_item_list_enumerated_text_popup2_setting_texts_resource
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_55;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_57;
+			value = 1;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_59;
+			value = 2;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_61;
+			value = 3;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_63;
+			value = 4;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_65;
+			value = 5;
+			}
+		};
+	}
+RESOURCE ARRAY r_sync_status_spy_setting_item_list_enumerated_text_popup2_popped_up_texts_resource
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_56;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_58;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_60;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_62;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_64;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_66;
+			}
+		};
+	}
+RESOURCE AVKON_SETTING_PAGE r_sync_status_spy_setting_item_list_enumerated_text_popup1_setting_page_resource
+	{
+	label = STR_SyncStatusSpyAppUi_6;
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_sync_status_spy_setting_item_list_enumerated_text_popup1_editor_resource_id;
+	}
+RESOURCE POPUP_SETTING_LIST r_sync_status_spy_setting_item_list_enumerated_text_popup1_editor_resource_id
+	{
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_sync_status_spy_setting_item_list_enumerated_text_popup1
+	{
+	setting_texts_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup1_setting_texts_resource;
+	popped_up_texts_resource = r_sync_status_spy_setting_item_list_enumerated_text_popup1_popped_up_texts_resource;
+	}
+RESOURCE ARRAY r_sync_status_spy_setting_item_list_enumerated_text_popup1_setting_texts_resource
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_12;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_33;
+			value = 1;
+			},
+		AVKON_ENUMERATED_TEXT
+			{
+			text = STR_SyncStatusSpyAppUi_14;
+			value = 2;
+			}
+		};
+	}
+RESOURCE ARRAY r_sync_status_spy_setting_item_list_enumerated_text_popup1_popped_up_texts_resource
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_13;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_34;
+			},
+		LBUF
+			{
+			txt = STR_SyncStatusSpyAppUi_15;
+			}
+		};
+	}
+RESOURCE MENU_PANE r_sync_status_spy_setting_item_list_menu_pane1_menu_pane
+	{
+	items =
+		{
+		/*MENU_ITEM
+			{
+			command = ESyncStatusSpyAppUiSaveMenuItemCommand;
+			txt = STR_SyncStatusSpyAppUi_69;
+			},*/
+		MENU_ITEM
+			{
+			command = ESyncStatusSpyAppUiPublishMenuItemCommand;
+			txt = STR_SyncStatusSpyAppUi_68;
+			},
+		MENU_ITEM
+			{
+			command = ESyncStatusSpyAppUiView_logMenuItemCommand;
+			txt = STR_SyncStatusSpyAppUi_70;
+			},
+		MENU_ITEM
+			{
+			command = ESyncStatusSpyAppUiHideMenuItemCommand;
+			txt = STR_SyncStatusSpyAppUi_67;
+			},
+		MENU_ITEM
+			{
+			command = ESyncStatusSpyAppUiDelete_logMenuItemCommand;
+			txt = STR_SyncStatusSpyAppUi_71;
+			}
+		};
+	}
+RESOURCE MENU_BAR r_sync_status_spy_setting_item_list_menubar
+	{
+	titles =
+		{
+		MENU_TITLE
+			{
+			menu_pane = r_sync_status_spy_setting_item_list_menu_pane1_menu_pane;
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy_reg.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+//  LOCALISATION STRINGS
+
+// Caption string for app.
+#define qtn_caption_string "SyncStatusSpy"
+
+// Short caption string for app.
+#define qtn_short_caption_string "SyncSpy"
+
+#define qtn_loc_resource_file_1 "\\resource\\apps\\SyncStatusSpy"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/data/SyncStatusSpy_reg.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include "SyncStatusSpy_reg.loc"
+#include <SyncStatusSpy.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2001FDF3
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="SyncStatusSpy";
+	localisable_resource_file =  qtn_loc_resource_file_1;
+	localisable_resource_id = R_LOCALISABLE_APP_INFO;
+
+	embeddability=KAppNotEmbeddable;
+	newfile=KAppDoesNotSupportNewFile;
+	}
+
Binary file remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/list_icon.bmp has changed
Binary file remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/list_icon_mask.bmp has changed
Binary file remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/mark_icon.bmp has changed
Binary file remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/mark_icon_mask.bmp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/gfx/qgn_menu_SyncStatusSpy.svg	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 88 87.999">
+<g>
+<g>
+<g>
+<g>
+<rect fill="none" width="88" height="87.999"/>
+</g>
+</g>
+<g>
+<linearGradient id="XMLID_7_" gradientUnits="userSpaceOnUse" x1="12.3042" y1="18.3799" x2="63.4113" y2="79.287">
+<stop offset="0" style="stop-color:#B3DDFF"/>
+<stop offset="0.8146" style="stop-color:#084296"/>
+<stop offset="1" style="stop-color:#084296"/>
+</linearGradient>
+<path fill="url(#XMLID_7_)" d="M32.135,7.415L14.363,17.432v23.167c0,0,8.926,15.351,10.468,18.001       c-2.386,1.704-15.44,11.03-15.44,11.03l21.613,12.652c0,0,12.907-9.85,14.71-11.226c1.979,1.109,16.231,9.101,16.231,9.101       l16.664-15.132c0,0-14.066-6.929-16.888-8.318c1.467-3.01,10.531-21.604,10.531-21.604l-22.298-9.59       c0,0-1.486,3.173-2.093,4.467c-2.046-0.88-6.573-2.826-6.573-2.826s-3.713,2.463-5.696,3.778       c-0.327-0.744-0.542-1.233-0.657-1.495c0.007-0.824,0.213-23.72,0.213-23.72L32.135,7.415z"/>
+<linearGradient id="XMLID_8_" gradientUnits="userSpaceOnUse" x1="40.8276" y1="52.1914" x2="16.1997" y2="21.1353">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_8_)" points="59.051,57.621 69.536,36.111 50.944,28.115 48.852,32.581 41.493,29.418 34.719,33.911        32.932,29.849 33.117,9.157 16.363,18.601 16.363,40.06 27.476,59.169 13.064,69.463 30.856,79.879 45.546,68.669        61.667,77.708 75.089,65.521 "/>
+<linearGradient id="XMLID_9_" gradientUnits="userSpaceOnUse" x1="60.585" y1="31.876" x2="53.8582" y2="45.1125">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_9_)" points="41.26,48.783 50.944,28.115 69.536,36.111 59.051,57.621 "/>
+<polygon fill="#0046B7" points="16.363,40.06 27.476,59.169 41.26,48.783 32.932,29.849 "/>
+<polygon fill="#3366CC" points="16.363,40.06 16.363,18.601 33.117,9.157 32.932,29.849 "/>
+<polygon fill="#CFECFF" points="26.696,39.23 41.493,29.418 59.523,37.168 45.546,47.954 "/>
+<path fill="#5AA7E0" d="M41.954,55.286"/>
+<polygon fill="#3366CC" points="26.696,39.23 27.476,59.169 45.546,68.669 45.546,47.954 "/>
+<polygon fill="#5AA7E0" points="13.064,69.463 27.476,59.169 45.546,68.669 30.856,79.879 "/>
+<linearGradient id="XMLID_10_" gradientUnits="userSpaceOnUse" x1="29.2085" y1="63.6836" x2="48.7102" y2="56.1976">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="0.0056" style="stop-color:#5AA7E0"/>
+<stop offset="0.85" style="stop-color:#3366CC"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_10_)" points="43.423,46.971 27.476,59.169 45.546,68.669 45.546,47.954 "/>
+<polygon fill="#0046B7" points="45.546,47.954 45.546,68.669 59.051,57.621 59.523,37.168 "/>
+<linearGradient id="XMLID_11_" gradientUnits="userSpaceOnUse" x1="45.3936" y1="59.5186" x2="59.0508" y2="59.5186">
+<stop offset="0" style="stop-color:#0046B7"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_11_)" points="45.394,50.368 45.546,68.669 59.051,57.621 "/>
+<linearGradient id="XMLID_12_" gradientUnits="userSpaceOnUse" x1="60.8945" y1="68.6807" x2="57.2953" y2="58.792">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="0.4101" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#XMLID_12_)" points="61.667,77.708 45.546,68.669 59.051,57.621 75.089,65.521 "/>
+</g>
+</g>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/Icons_aif_scalable_dc.mk	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,90 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+# ============================================================================
+#  Name	 : Icons_aif_scalable_dc.mk
+#  Part of  : SyncStatusSpy
+#
+#  Description:
+# 
+# ============================================================================
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=$(EPOCROOT)epoc32\data\z
+endif
+
+
+# ----------------------------------------------------------------------------
+# TODO: Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\SyncStatusSpy_aif.mif
+HEADERDIR=$(EPOCROOT)epoc32\include
+HEADERFILENAME=$(HEADERDIR)\SyncStatusSpy_aif.mbg
+
+ICONDIR=..\gfx
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN :
+	@echo ...Deleting $(ICONTARGETFILENAME)
+	del /q /f $(ICONTARGETFILENAME)
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# TODO: Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+# NOTE: if you have JUSTINTIME enabled for your S60 3rd FP1 or newer SDK
+# and this command crashes, consider adding "/X" to the command line.
+# See <http://forum.nokia.com/document/Forum_Nokia_Technical_Library_v1_35/contents/FNTL/Build_process_fails_at_mif_file_creation_in_S60_3rd_Ed_FP1_SDK.htm>
+# ----------------------------------------------------------------------------
+
+RESOURCE : $(ICONTARGETFILENAME)
+
+$(ICONTARGETFILENAME) : $(ICONDIR)\qgn_menu_SyncStatusSpy.svg
+	mifconv $(ICONTARGETFILENAME) \
+		/H$(HEADERFILENAME) \
+		/c32,8 $(ICONDIR)\qgn_menu_SyncStatusSpy.svg
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/SyncStatusSpy.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <data_caging_paths.hrh>
+
+VENDORID VID_DEFAULT
+CAPABILITY CAP_GENERAL_DLL
+APP_LAYER_SYSTEMINCLUDE
+
+
+TARGET			SyncStatusSpy.exe
+UID			   0x100039CE 0x2001FDF3
+//VENDORID	  	  0
+TARGETTYPE		exe
+EPOCSTACKSIZE	 0x5000
+
+USERINCLUDE	   ..\inc ..\data
+
+SOURCEPATH		..\data
+START RESOURCE	SyncStatusSpy.rss
+HEADER
+TARGETPATH resource\apps
+END //RESOURCE
+
+START RESOURCE	SyncStatusSpy_reg.rss
+TARGETPATH 	  \private\10003a3f\apps
+END //RESOURCE
+
+LIBRARY	euser.lib 
+LIBRARY apparc.lib 
+LIBRARY cone.lib 
+LIBRARY eikcore.lib 
+LIBRARY avkon.lib
+LIBRARY	commonengine.lib 
+LIBRARY efsrv.lib 
+LIBRARY estor.lib 
+LIBRARY eikcoctl.lib 
+LIBRARY eikdlg.lib 
+LIBRARY	eikctl.lib 
+LIBRARY bafl.lib 
+LIBRARY fbscli.lib 
+LIBRARY aknnotify.lib 
+LIBRARY aknicon.lib
+LIBRARY	etext.lib 
+LIBRARY gdi.lib 
+LIBRARY egul.lib 
+LIBRARY insock.lib 
+LIBRARY apmime.lib
+LIBRARY	ecom.lib 
+LIBRARY InetProtUtil.lib 
+LIBRARY http.lib 
+LIBRARY esock.lib 
+LIBRARY commonui.lib
+LIBRARY	centralrepository.lib 
+LIBRARY charconv.lib 
+LIBRARY apgrfx.lib 
+LIBRARY ws32.lib
+
+LANG 				01
+
+START BITMAP	SyncStatusSpy.mbm
+HEADER
+TARGETPATH		\resource\apps
+SOURCEPATH		..\gfx
+SOURCE	c12,1	list_icon.bmp list_icon_mask.bmp
+END
+
+SOURCEPATH		..\src
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
+
+SOURCE SyncStatusSpySettingItemList.cpp 
+SOURCE SyncStatusSpySettingItemListSettings.cpp 
+SOURCE SyncStatusSpyApplication.cpp 
+SOURCE SyncStatusSpyDocument.cpp 
+SOURCE SyncStatusSpyAppUi.cpp 
+SOURCE CenrepUtils.cpp 
+SOURCE ErrorCodeNotifier.cpp 
+SOURCE SyncTypeNotifier.cpp 
+SOURCE ProfileIdNotifier.cpp 
+SOURCE SyncInitiationNotifier.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+PRJ_PLATFORMS
+WINSCW ARMV5 GCCE
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+gnumakefile icons_aif_scalable_dc.mk
+
+
+SyncStatusSpy.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/cenreputils.d	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,72 @@
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \test\SyncStatusSpy\src\cenreputils.cpp
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/rvct/rvct.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/feature_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/defaultcaps.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/Symbian.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/variant/Symbian_OS.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/variant/platform_paths.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/privateruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/publicruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/ncp_feature_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/ncp_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: /epoc32/include/symbian_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldcodeline.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldnokia.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldprivate.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldpublic.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldregional.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldservicessoftware.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\adaptation_features.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\ncp_feature_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\hw_logical_pins.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\hw_rapu_init_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\nloader_features.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\ProductVariant.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bldcustomsw.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\customswconsts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\customswruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\customswstaticfeatures.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\symcpp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bautils.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32cmn.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32const.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32err.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32def.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32lang.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32reg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32capability.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32des8.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32des16.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32cmn.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32std.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32base.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32base.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32svr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32hal.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32cmn_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32const_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32des8_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32des16_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\d32locd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\partitions.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\d32locd.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32notif.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32ldr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32ldr_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32event.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32event_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32ktran.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32keys.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32debug.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\e32lmsg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\f32file64.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\f32file.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\f32file64.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\barsread.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\utf.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\CenrepUtils.o: \epoc32\include\centralrepository.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/syncstatusspyappui.d	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,321 @@
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \test\SyncStatusSpy\src\syncstatusspyappui.cpp
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/rvct/rvct.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/feature_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/defaultcaps.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/Symbian.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/variant/Symbian_OS.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/variant/platform_paths.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/privateruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/publicruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/ncp_feature_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/ncp_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: /epoc32/include/symbian_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldcodeline.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldnokia.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldprivate.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldpublic.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldregional.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldservicessoftware.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\adaptation_features.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ncp_feature_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\hw_logical_pins.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\hw_rapu_init_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\nloader_features.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ProductVariant.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bldcustomsw.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\customswconsts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\customswruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\customswstaticfeatures.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\symcpp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikmenub.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikdef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32cmn.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32const.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32err.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32def.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32lang.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32reg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32capability.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32des8.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32des16.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32cmn.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32std.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coedef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\guldef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikbctrl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gdi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32base.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32base.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32svr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32hal.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32cmn_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32const_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32des8_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32des16_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\d32locd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\partitions.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\d32locd.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32notif.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32ldr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32ldr_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32event.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32event_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32ktran.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32keys.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32debug.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32lmsg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file64.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file64.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32strm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32strm.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32std.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\displaymode.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gdi.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coecntrl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\w32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\fntstore.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\openfont.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ecom/ecom.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ecom/ecomerrorcodes.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ecom/ecomresolverparams.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ecom/ecomresolverparams.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ecom/implementationinformation.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\ecom/implementationinformation.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\linkedfonts.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bitdev.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\fbs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bitmap.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\graphics/fbsdefs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bitbase.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bitstd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\graphicsaccelerator.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bitdev.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\textcursor.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\pointerevent.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\advancedpointerevent.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\sizemode.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulalign.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\biditext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bidi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtfrmat.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtfrmat.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coecobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coemop.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coehelp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coeinput.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coemain.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\barsc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\basched.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coetextdrawer.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulftflg.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coemain.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coefont.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coecontrolarray.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coecoloruse.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknControl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikmenup.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiksbobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikbtgpc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikbtgrp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikcmobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\lafpublc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\uiklaf/private/pluginuid.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknintermediate.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\akncontext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\akntitle.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coeccntx.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\SyncStatusSpy.rsg
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bautils.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\barsread.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\APGWGNAM.H
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\DataSyncInternalPSKeys.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\NSmlConstants.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\NSmlConstantDefs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\e32property.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \test\SyncStatusSpy\inc\SyncStatusSpyAppUi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknappui.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikappui.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coeaui.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\coeview.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\vwsdef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikmobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apadef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\baerrhan.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikaufty.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikspane.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikspmod.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eiksrvc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eiksrvs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikenv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apaflrec.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apaid.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apmstd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apacmdln.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32strm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\baerrhan.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulcolor.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikamnt.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\lafmain.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulcolor.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\frmtlay.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtetext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtetext.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\frmlaydt.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\frmparam.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\frmvis.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\tagma.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtstyle.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtfmlyr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtfmstm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtfmlyr.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\txtstyle.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\linebreak.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikvcurs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\babitflags.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikpicturefactory.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikfctry.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikenv.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eiksrv.pan
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apgtask.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eiksrv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\vwsappst.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikunder.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikcycledef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikcba.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikctgrp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiksbobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknscrlb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikscrlb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknscbut.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikimage.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikalign.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsItemData.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsItemID.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsItemID.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsRlEffect.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsRlEffectContext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsRlParameter.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\avkon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\lafpublc.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\eikcolor.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknFontCategory.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknFontIdOffsets.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknDef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknDef.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\akntouchpaneobserver.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikmenub.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \test\SyncStatusSpy\inc\SyncStatusSpySettingItemListSettings.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\DocumentHandler.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \test\SyncStatusSpy\inc\SyncStatusSpySettingItemList.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknsettingitemlist.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\in_sock.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\es_sock.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\nifvar.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\comms-infras/metacontainer.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/metacontainer.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/metadata.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/cftransportmacro.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/h_tdeallocator.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/metadata.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/metacontainer.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/sd_errors.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\comms-infras/es_parameterset.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\comms-infras/metadata.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/metadata.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\comms-infras/es_event.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\comms-infras/metadata.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\elements/metadata.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\es_sock.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulicon.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikfrlb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiktxlbm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiktxlbx.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbx.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbo.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiklbed.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknsettingpage.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikmenub.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikmenup.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknUtils.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiktxlbm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\avkon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\avkon.rsg
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknsConstants.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknsconstants.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknenv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikmenub.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknLayout2Id.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\AknLayout.lag
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\aknlayout.cdl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\CdlEngine.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\CdlEngDef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\CdlDef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\CdlTypes.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\AknLayout.cdl.common.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\AknLayout2Def.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\avkon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\aknlayout.cdl.common.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\aknapaclayout.cdl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\CdlEngine.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\AknApacLayout.cdl.common.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\platform\mw\aknapaclayout.cdl.common.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\aknnavi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\Aknvolumecontrol.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknNaviDecoratorObserver.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknQueryValueText.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikdialg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikdpobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\gulftflg.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikbutb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\eikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknPopupFader.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\mw\AknQueryValue.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \test\SyncStatusSpy\inc\SyncStatusSpySettingItemList.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \test\SyncStatusSpy\inc\CenrepUtils.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpyAppUi.o: \epoc32\include\apmstd.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/group/syncstatusspysettingitemlist.d	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,277 @@
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \test\SyncStatusSpy\src\syncstatusspysettingitemlist.cpp
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/rvct/rvct.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/feature_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/defaultcaps.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/Symbian.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/variant/Symbian_OS.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/variant/platform_paths.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/privateruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/publicruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/ncp_feature_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/ncp_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: /epoc32/include/symbian_consts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldcodeline.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldnokia.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldprivate.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldpublic.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldregional.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldservicessoftware.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\adaptation_features.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ncp_feature_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\hw_logical_pins.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\hw_rapu_init_settings.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\nloader_features.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ProductVariant.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bldcustomsw.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\customswconsts.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\customswruntimeids.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\customswstaticfeatures.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\symcpp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\avkon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\uiklaf/private/pluginuid.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\lafpublc.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikcolor.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknFontCategory.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknFontIdOffsets.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\avkon.rsg
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikmenup.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikbctrl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32def.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\guldef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gdi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32base.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32cmn.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32const.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32err.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32lang.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32reg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32capability.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32des8.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32des16.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32cmn.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32std.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32base.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32svr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32hal.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32cmn_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32const_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32des8_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32des16_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\d32locd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\partitions.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\d32locd.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32notif.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32ldr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32ldr_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32event.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32event_private.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32ktran.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32keys.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32debug.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\e32lmsg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file64.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file64.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32strm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32strm.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32std.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\displaymode.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gdi.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coecntrl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\w32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\fntstore.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\openfont.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ecom/ecom.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ecom/ecomerrorcodes.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ecom/ecomresolverparams.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ecom/ecomresolverparams.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ecom/implementationinformation.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\ecom/implementationinformation.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\linkedfonts.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bitdev.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\fbs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bitmap.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\graphics/fbsdefs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bitbase.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bitstd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\graphicsaccelerator.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bitdev.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\textcursor.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\pointerevent.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\advancedpointerevent.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\sizemode.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulalign.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\biditext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bidi.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtfrmat.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtfrmat.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coedef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\guldef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coecobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coemop.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coehelp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coeinput.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coemain.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\barsc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\basched.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coetextdrawer.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulftflg.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coemain.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coefont.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coecontrolarray.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coecoloruse.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknControl.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikdef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiksbobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknappui.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikappui.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coeaui.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coeview.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\vwsdef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikmobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikcmobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\apadef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\baerrhan.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikaufty.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikspane.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikspmod.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eiksrvc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eiksrvs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikenv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\apaflrec.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\apaid.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\apmstd.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\apacmdln.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32strm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\baerrhan.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulcolor.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikamnt.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\lafmain.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulcolor.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\frmtlay.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtetext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtetext.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\frmlaydt.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\frmparam.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\frmvis.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\tagma.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtstyle.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtfmlyr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtfmstm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtfmlyr.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\txtstyle.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\linebreak.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikvcurs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\babitflags.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikpicturefactory.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikfctry.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikenv.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eiksrv.pan
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\apgtask.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eiksrv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\vwsappst.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikunder.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\eikcycledef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikcba.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikctgrp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\lafpublc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikbtgrp.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiksbobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknscrlb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikscrlb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknscbut.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikimage.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikalign.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknsItemData.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknsItemID.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknsItemID.inl
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknsRlEffect.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknsRlEffectContext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknsRlParameter.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\avkon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknDef.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknDef.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\akntouchpaneobserver.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\barsread.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\badesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\stringloader.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknnumedwin.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikedwin.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\s32std.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\medobsrv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\fepbase.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\f32file.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\fepbutils.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\fepbconfig.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\frmtview.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\frmframe.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikedwob.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikccpu.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiklay.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknPictographDrawerInterface.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\centralrepository.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\cenrepnotifyhandler.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknnumed.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikedwin.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknpopupfieldtext.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknPopupField.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiklbx.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiklbo.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiksbfrm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiklbm.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiklbv.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulbordr.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eiklbed.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulutil.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikcmbut.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikbutb.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\coeccntx.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknDesCArrayDecorator.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknListBoxLayoutDecorator.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\aknnotedialog.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikdialg.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikdpobs.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\gulftflg.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\eikbtgpc.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\uikon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknPopupFader.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\avkon.hrh
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknQueryValueText.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\bamdesca.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\mw\AknQueryValue.h
+\EPOC32\BUILD\test\SyncStatusSpy\group\SYNCSTATUSSPY\ARMV5\urel\SyncStatusSpySettingItemList.o: \epoc32\include\SyncStatusSpy.rsg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/CenrepUtils.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef CCENREPUTILS_H
+#define CCENREPUTILS_H
+
+// INCLUDES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+enum TLogKey
+    {
+	EErrorCode = 1,
+	EProfileId,
+	ESyncType,
+	ESyncInitiation
+    };
+
+/**
+* CCenrepUtils utils class to write logs.
+*/
+class CCenrepUtils : public CBase
+    {
+	public: //Constructors and destructors
+
+		static void WriteLogL( TUint32 aKey, TLogKey aValue );
+
+		static void GetDateAndTimeL( TDes8& aDateBuffer, TDes8& aTimeBuffer );
+
+		static void CreateSyncLogDirL();
+
+		static void ClearSyncLogL();
+
+	private:
+
+    };
+
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/ErrorCodeNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef ERRORCODENOTIFIER_H_
+#define ERRORCODENOTIFIER_H_
+
+// INCLUDES
+
+
+// FORWARD DECLARATIONS
+class CRepository;
+// CLASS DECLARATION
+
+/**
+* CErrorCodeNotifier Central repository notifier.
+*/
+class CErrorCodeNotifier : public CActive
+    {
+	public: //Constructors and destructors
+
+		static CErrorCodeNotifier* NewL();
+ 
+		static CErrorCodeNotifier* NewLC();
+
+		~CErrorCodeNotifier();
+
+	protected:	//Constructors and destructors
+
+		/**
+		* C++ constructor.
+		*/
+		CErrorCodeNotifier();
+	
+		/**
+		* 2nd phase constructor.
+		*/
+		void ConstructL();
+
+
+    public:
+
+	
+    private:
+    	 void ListenForKeyNotifications();
+    	
+    	 void DoCancel();
+    	        
+    	 void RunL();
+    	 
+    private:
+    	RFs iFs;
+    	CRepository* iRep;
+    };
+
+#endif /* ERRORCODENOTIFIER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/ProfileIdNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* ProfileIdNotifier.h
+*/
+
+
+#ifndef PROFILEIDNOTIFIER_H_
+#define PROFILEIDNOTIFIER_H_
+
+
+
+// FORWARD DECLARATIONS
+class CRepository;
+// CLASS DECLARATION
+
+/**
+* CProfileIdNotifier Central repository notifier.
+*/
+class CProfileIdNotifier : public CActive
+    {
+	public: //Constructors and destructors
+
+		static CProfileIdNotifier* NewL();
+ 
+		static CProfileIdNotifier* NewLC();
+
+		~CProfileIdNotifier();
+
+	protected:	//Constructors and destructors
+
+		/**
+		* C++ constructor.
+		*/
+		CProfileIdNotifier();
+	
+		/**
+		* 2nd phase constructor.
+		*/
+		void ConstructL();
+
+
+    public:
+
+	
+    private:
+    	 void ListenForKeyNotifications();
+    	
+    	 void DoCancel();
+    	        
+    	 void RunL();
+    	 
+    private:
+    	RFs iFs;
+    	CRepository* iRep;
+    };
+
+#endif /* PROFILEIDNOTIFIER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncInitiationNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* SyncInitiationNotifier.h
+*/
+
+
+#ifndef SYNCINITIATIONNOTIFIER_H_
+#define SYNCINITIATIONNOTIFIER_H_
+
+
+// FORWARD DECLARATIONS
+class CRepository;
+// CLASS DECLARATION
+
+/**
+* CSyncInitiationNotifier Central repository notifier.
+*/
+class CSyncInitiationNotifier : public CActive
+    {
+	public: //Constructors and destructors
+
+		static CSyncInitiationNotifier* NewL();
+ 
+		static CSyncInitiationNotifier* NewLC();
+
+		~CSyncInitiationNotifier();
+
+	protected:	//Constructors and destructors
+
+		/**
+		* C++ constructor.
+		*/
+		CSyncInitiationNotifier();
+	
+		/**
+		* 2nd phase constructor.
+		*/
+		void ConstructL();
+
+
+    public:
+
+	
+    private:
+    	 void ListenForKeyNotifications();
+    	
+    	 void DoCancel();
+    	        
+    	 void RunL();
+    	 
+    private:
+    	RFs iFs;
+    	CRepository* iRep;
+    };
+
+#endif /* SYNCINITIATIONNOTIFIER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpy.pan	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCSTATUSSPY_PAN_H
+#define SYNCSTATUSSPY_PAN_H
+
+/** SyncStatusSpy application panic codes */
+enum TSyncStatusSpyPanics
+	{
+	ESyncStatusSpyUi = 1
+	// add further panics here
+	};
+
+inline void Panic(TSyncStatusSpyPanics aReason)
+	{
+	_LIT(applicationName,"SyncStatusSpy");
+	User::Panic(applicationName, aReason);
+	}
+
+#endif // SYNCSTATUSSPY_PAN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpyAppUi.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCSTATUSSPYAPPUI_H
+#define SYNCSTATUSSPYAPPUI_H
+
+#include <aknappui.h>
+#include <eikmenub.h>
+#include "SyncStatusSpySettingItemListSettings.h"
+#include <DocumentHandler.h>
+
+
+class CSyncStatusSpySettingItemList;
+
+/**
+ * @class	CSyncStatusSpyAppUi SyncStatusSpyAppUi.h
+ * @brief The AppUi class handles application-wide aspects of the user interface, including
+ *        container management and the default menu, control pane, and status pane.
+ */
+
+class CSyncStatusSpyAppUi : public CAknAppUi
+	{
+public: 
+	// constructor and destructor
+	CSyncStatusSpyAppUi();
+	void ConstructL();
+	virtual ~CSyncStatusSpyAppUi();
+
+public: 
+	// from CEikAppUi
+	void HandleCommandL( TInt aCommand );
+	void HandleResourceChangeL( TInt aType );	
+	void HandleForegroundEventL(TBool aForeground);
+	
+private:
+	void InitializeContainersL();
+	
+
+private: 
+	CSyncStatusSpySettingItemList* iSyncStatusSpySettingItemList;
+	CSyncStatusSpySettingItemListSettings* iSettings;
+	CDocumentHandler* iDocHandler;
+		
+	};
+
+#endif // SYNCSTATUSSPYAPPUI_H			
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpyApplication.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCSTATUSSPYAPPLICATION_H
+#define SYNCSTATUSSPYAPPLICATION_H
+
+
+#include <aknapp.h>
+
+
+
+const TUid KUidSyncStatusSpyApplication = { 0x2001FDF3 };
+
+/**
+ *
+ * @class	CSyncStatusSpyApplication SyncStatusSpyApplication.h
+ * @brief	A CAknApplication-derived class is required by the S60 application 
+ *          framework. It is subclassed to create the application's document 
+ *          object.
+ */
+class CSyncStatusSpyApplication : public CAknApplication
+	{
+private:
+	TUid AppDllUid() const;
+	CApaDocument* CreateDocumentL();
+	
+	};
+			
+#endif // SYNCSTATUSSPYAPPLICATION_H		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpyDocument.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCSTATUSSPYDOCUMENT_H
+#define SYNCSTATUSSPYDOCUMENT_H
+
+#include <akndoc.h>
+		
+class CEikAppUi;
+
+/**
+* @class	CSyncStatusSpyDocument SyncStatusSpyDocument.h
+* @brief	A CAknDocument-derived class is required by the S60 application 
+*           framework. It is responsible for creating the AppUi object. 
+*/
+class CSyncStatusSpyDocument : public CAknDocument
+	{
+public: 
+	// constructor
+	static CSyncStatusSpyDocument* NewL( CEikApplication& aApp );
+
+private: 
+	// constructors
+	CSyncStatusSpyDocument( CEikApplication& aApp );
+	void ConstructL();
+	
+public: 
+	// from base class CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+#endif // SYNCSTATUSSPYDOCUMENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpySettingItemList.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCSTATUSSPYSETTINGITEMLIST_H
+#define SYNCSTATUSSPYSETTINGITEMLIST_H
+
+
+#include <aknsettingitemlist.h>
+
+
+class MEikCommandObserver;
+class CSyncStatusSpySettingItemListSettings;
+
+
+/**
+ * @class	CSyncStatusSpySettingItemList SyncStatusSpySettingItemList.h
+ */
+class CSyncStatusSpySettingItemList : public CAknSettingItemList
+	{
+public: // constructors and destructor
+
+	CSyncStatusSpySettingItemList( 
+			CSyncStatusSpySettingItemListSettings& settings, 
+			MEikCommandObserver* aCommandObserver );
+	virtual ~CSyncStatusSpySettingItemList();
+
+public:
+
+	// from CCoeControl
+	void HandleResourceChange( TInt aType );
+
+	// overrides of CAknSettingItemList
+	CAknSettingItem* CreateSettingItemL( TInt id );
+	void EditItemL( TInt aIndex, TBool aCalledFromMenu );
+	TKeyResponse OfferKeyEventL( 
+			const TKeyEvent& aKeyEvent, 
+			TEventCode aType );
+
+public:
+	// utility function for menu
+	void ChangeSelectedItemL();
+
+	void LoadSettingValuesL();
+	void SaveSettingValuesL();
+		
+private:
+	// override of CAknSettingItemList
+	void SizeChanged();
+
+private:
+	// current settings values
+	CSyncStatusSpySettingItemListSettings& iSettings;
+	MEikCommandObserver* iCommandObserver;
+
+	};
+#endif // SYNCSTATUSSPYSETTINGITEMLIST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpySettingItemList.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+enum TSyncStatusSpyAppUiItems
+	{
+	ESyncStatusSpyAppUiIntegerEditor1 = 1,
+	ESyncStatusSpyAppUiIntegerEditor2,
+	ESyncStatusSpyAppUiEnumeratedTextPopup2,
+	ESyncStatusSpyAppUiEnumeratedTextPopup1
+	};
+enum TSyncStatusSpyAppUiCommands
+	{
+	ESyncStatusSpyAppUiSaveMenuItemCommand = 0x6000,
+	ESyncStatusSpyAppUiPublishMenuItemCommand,
+	ESyncStatusSpyAppUiView_logMenuItemCommand,
+	ESyncStatusSpyAppUiHideMenuItemCommand,
+	ESyncStatusSpyAppUiDelete_logMenuItemCommand
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncStatusSpySettingItemListSettings.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef SYNCSTATUSSPYSETTINGITEMLISTSETTINGS_H
+#define SYNCSTATUSSPYSETTINGITEMLISTSETTINGS_H
+			
+
+#include <e32std.h>
+
+
+
+// FORWARD DECLARATIONS
+class CErrorCodeNotifier;
+class CProfileIdNotifier;
+class CSyncTypeNotifier;
+class CSyncInitiationNotifier;
+
+/**
+ * @class	TSyncStatusSpySettingItemListSettings SyncStatusSpySettingItemListSettings.h
+ */
+class CSyncStatusSpySettingItemListSettings : public CBase 
+	{
+public:
+	// construct and destroy
+	static CSyncStatusSpySettingItemListSettings* NewL();
+	void ConstructL();
+	~CSyncStatusSpySettingItemListSettings();
+		
+private:
+	// constructor
+	CSyncStatusSpySettingItemListSettings();
+
+public:
+	TInt& IntegerEditor1();
+	void SetIntegerEditor1(const TInt& aValue);
+	TInt& IntegerEditor2();
+	void SetIntegerEditor2(const TInt& aValue);
+	TInt& EnumeratedTextPopup2();
+	void SetEnumeratedTextPopup2(const TInt& aValue);
+	TInt& EnumeratedTextPopup1();
+	void SetEnumeratedTextPopup1(const TInt& aValue);
+
+protected:
+	TInt iIntegerEditor1;
+	TInt iIntegerEditor2;
+	TInt iEnumeratedTextPopup2;
+	TInt iEnumeratedTextPopup1;
+	
+	CErrorCodeNotifier* iErrorCodeNotifier;
+	CProfileIdNotifier* iProfileIdNotifier;
+	CSyncTypeNotifier* iSyncTypeNotifier;
+	CSyncInitiationNotifier* iSyncInitiationNotifier;
+	
+	};
+#endif // SYNCSTATUSSPYSETTINGITEMLISTSETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/inc/SyncTypeNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* SyncTypeNotifier.h
+*/
+
+
+#ifndef SYNCTYPENOTIFIER_H_
+#define SYNCTYPENOTIFIER_H_
+
+
+
+// FORWARD DECLARATIONS
+class CRepository;
+// CLASS DECLARATION
+
+/**
+* CSyncTypeNotifier Central repository notifier.
+*/
+class CSyncTypeNotifier : public CActive
+    {
+	public: //Constructors and destructors
+
+		static CSyncTypeNotifier* NewL();
+ 
+		static CSyncTypeNotifier* NewLC();
+
+		~CSyncTypeNotifier();
+
+	protected:	//Constructors and destructors
+
+		/**
+		* C++ constructor.
+		*/
+		CSyncTypeNotifier();
+	
+		/**
+		* 2nd phase constructor.
+		*/
+		void ConstructL();
+
+
+    public:
+
+	
+    private:
+    	 void ListenForKeyNotifications();
+    	
+    	 void DoCancel();
+    	        
+    	 void RunL();
+    	 
+    private:
+    	RFs iFs;
+    	CRepository* iRep;
+    };
+
+#endif /* SYNCTYPENOTIFIER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/sis/SyncStatusSpy.pkg	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,51 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 
+;
+; SyncStatusSpy.pkg
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+; Also, the resource file entries should be changed to match the language
+; used in the build. For example, if building for LANGUAGE_01, change the file
+; extensions .rsc to .r01.
+;
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"SyncStatusSpy"},(0x2001FDF3),1,0,0
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+;Supports Series 60 v 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+;Files to install
+;You should change the source paths to match that of your environment
+;<source> <destination>
+"\Epoc32\release\ARMV5\urel\SyncStatusSpy.exe"		-"!:\sys\bin\SyncStatusSpy.exe"
+"\Epoc32\data\z\resource\apps\SyncStatusSpy.r01"		-"!:\resource\apps\SyncStatusSpy.r01"
+"\Epoc32\data\z\private\10003a3f\apps\SyncStatusSpy_reg.r01"	-"!:\private\10003a3f\import\apps\SyncStatusSpy_reg.r01"
+"\epoc32\data\z\resource\apps\SyncStatusSpy_aif.mif" -"!:\resource\apps\SyncStatusSpy_aif.mif"
+"\epoc32\data\z\resource\apps\SyncStatusSpy.mbm" -"!:\resource\apps\SyncStatusSpy.mbm"
+; Add any installation notes if applicable
+;"SyncStatusSpy.txt"					  -"!:\private\0x2001FDF3\SyncStatusSpy.txt"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/sis/backup_registration.xml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+  <system_backup/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/CenrepUtils.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+// INCLUDE FILES
+
+#include <bautils.h>				// BaflUtils
+#include <utf.h>
+#include <centralrepository.h>
+#include <NsmlOperatorErrorCRKeys.h>
+
+#include "CenrepUtils.h"
+
+_LIT( KPrivateFile, "C:\\logs\\Sync\\SyncStatus.txt" );
+
+// ================= MEMBER FUNCTIONS =========================================
+
+
+void CCenrepUtils::WriteLogL( TUint32 aKey, TLogKey aValue  )
+	{
+	RFs fs;
+	User::LeaveIfError( fs.Connect() );  // create connect to fileserver
+	
+	CleanupClosePushL( fs );
+	RFile privateFile;
+	CleanupClosePushL( privateFile );
+
+	TInt ret = privateFile.Open( fs, KPrivateFile, EFileShareExclusive|EFileWrite ); // open file
+	if( ret == KErrNotFound )  // if file does not exist, create it
+		{
+		privateFile.Create( fs, KPrivateFile, EFileShareExclusive|EFileWrite );
+		}
+
+	TInt value = 0;
+    CRepository* rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
+    rep->Get( aKey, value );
+    delete rep;
+	HBufC8* dateBuf8 = HBufC8::NewLC( 64 );
+	TPtr8 ptrDateBuf8 = dateBuf8->Des();
+	HBufC8* timeBuf8 = HBufC8::NewLC( 64 );
+	TPtr8 ptrTimeBuf8 = timeBuf8->Des();
+
+	GetDateAndTimeL( ptrDateBuf8, ptrTimeBuf8 );
+	HBufC8* buf8 = HBufC8::NewLC( 512 );
+	TPtr8 ptrBuf8 = buf8->Des();
+
+	if( aValue == EErrorCode )
+		{
+		ptrBuf8.Format( _L8("[%S ] [ErrorCode: %d]\r\n"), &ptrTimeBuf8, value );
+		}
+	else if( aValue == EProfileId )
+		{
+		ptrBuf8.Format( _L8("[%S ] [SyncProfileId: %d]\r\n"), &ptrTimeBuf8, value );
+		}
+	else if( aValue == ESyncType )
+        {
+        ptrBuf8.Format( _L8("[%S ] [SyncType: %d]\r\n"), &ptrTimeBuf8, value );
+        }
+	else if( aValue == ESyncInitiation )
+		{
+		ptrBuf8.Format( _L8("[%S ] [SyncInitiation: %d]\r\n"), &ptrTimeBuf8, value );
+		}
+
+	TInt size = 0;
+	privateFile.Size( size );
+	privateFile.Write( size, ptrBuf8 );
+
+	CleanupStack::PopAndDestroy( 5, &fs );//privateFile, dateBuf8, timeBuf8, buf8
+    }
+
+void CCenrepUtils::GetDateAndTimeL( TDes8& aDateBuffer, TDes8& aTimeBuffer )
+	{
+	TTime time;
+	time.HomeTime();
+	HBufC* dateBuffer = HBufC::NewLC( 64 );
+	TPtr ptrDateBuffer = dateBuffer->Des();
+	HBufC* timeBuffer = HBufC::NewLC( 64 );
+	TPtr ptrTimeBuffer = timeBuffer->Des();
+	time.FormatL( ptrDateBuffer, _L( "%D%M%Y%/0%1%/1%2%/2%3%/3" ) );
+	time.FormatL( ptrTimeBuffer, _L( "%-B%:0%J%:1%T%:2%S%.%*C4%:3%+B" ) );
+	CnvUtfConverter::ConvertFromUnicodeToUtf8( aDateBuffer, ptrDateBuffer );
+	CnvUtfConverter::ConvertFromUnicodeToUtf8( aTimeBuffer, ptrTimeBuffer );
+	CleanupStack::PopAndDestroy( 2 ); // dateBuffer, timeBuffer
+	}
+
+void CCenrepUtils::CreateSyncLogDirL()
+	{
+	RFs fs;
+	User::LeaveIfError( fs.Connect() );  // create connect to fileserver
+	CleanupClosePushL( fs );
+	if( !BaflUtils::FolderExists( fs, _L( "C:\\logs\\Sync\\" ) ) )
+        {
+        fs.MkDirAll( _L( "C:\\logs\\Sync\\" ) );
+        }
+	CleanupStack::PopAndDestroy();
+	}
+
+void CCenrepUtils::ClearSyncLogL()
+	{
+	RFs fs;
+	User::LeaveIfError( fs.Connect() );  // create connect to fileserver
+	CleanupClosePushL( fs );
+	RFile privateFile;
+	CleanupClosePushL( privateFile );
+	privateFile.Replace( fs, KPrivateFile, EFileShareExclusive|EFileWrite );
+	CleanupStack::PopAndDestroy( 2 );
+	}
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/ErrorCodeNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* ErrorCodeNotifier.cpp
+*/
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikappui.h>
+#include <centralrepository.h>
+#include <NsmlOperatorErrorCRKeys.h>
+#include <bautils.h>				// BaflUtils
+#include <utf.h>
+#include <APGWGNAM.H> //CApaWindowGroupName
+#include <APGTASK.H>
+
+#include "ErrorCodeNotifier.h"
+#include "CenrepUtils.h"
+
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+CErrorCodeNotifier* CErrorCodeNotifier::NewL()
+    {
+    CErrorCodeNotifier* self = CErrorCodeNotifier::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CErrorCodeNotifier* CErrorCodeNotifier::NewLC()
+    {
+    CErrorCodeNotifier* self = new ( ELeave ) CErrorCodeNotifier;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CErrorCodeNotifier::~CErrorCodeNotifier()
+	{
+	if( IsActive() )
+		{
+        Cancel();
+        if( iRep )
+            {
+        	iRep->NotifyCancelAll();
+            }
+		}
+	delete iRep;
+	iFs.Close();
+	}
+
+CErrorCodeNotifier::CErrorCodeNotifier(): 
+    CActive( CActive::EPriorityStandard )
+	{
+    CActiveScheduler::Add( this );
+	}
+
+void CErrorCodeNotifier::ConstructL( )
+    {
+    iRep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
+    ListenForKeyNotifications();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CErrorCodeNotifier::ListenForKeyNotifications
+// ----------------------------------------------------------------------------
+void CErrorCodeNotifier::ListenForKeyNotifications()
+    {
+	iRep->NotifyRequest( KNsmlOpDsErrorCode, iStatus );
+    SetActive();
+    }
+
+void CErrorCodeNotifier::DoCancel()
+	{
+	iRep->NotifyCancelAll();
+	}
+
+void CErrorCodeNotifier::RunL()
+	{
+	if( iStatus > 0 )
+		{
+		CCenrepUtils::WriteLogL( KNsmlOpDsErrorCode, EErrorCode );
+
+		TApaTask task(CEikonEnv::Static()->WsSession( ));
+		task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
+		task.BringToForeground();
+
+		ListenForKeyNotifications();
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/ProfileIdNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* ProfileIdNotifier.cpp
+*/
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikappui.h>
+#include <centralrepository.h>
+#include <NsmlOperatorErrorCRKeys.h>
+#include <bautils.h>				// BaflUtils
+#include <utf.h>
+#include <APGWGNAM.H> //CApaWindowGroupName
+#include <APGTASK.H>
+
+#include "ProfileIdNotifier.h"
+#include "CenrepUtils.h"
+ 
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+CProfileIdNotifier* CProfileIdNotifier::NewL()
+    {
+    CProfileIdNotifier* self = CProfileIdNotifier::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CProfileIdNotifier* CProfileIdNotifier::NewLC()
+    {
+    CProfileIdNotifier* self = new ( ELeave ) CProfileIdNotifier;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CProfileIdNotifier::~CProfileIdNotifier()
+	{
+	if( IsActive() )
+		{
+        Cancel();
+        if( iRep )
+            {
+            iRep->NotifyCancelAll();
+            }
+		}
+	delete iRep;
+	iFs.Close();
+	}
+
+CProfileIdNotifier::CProfileIdNotifier(): 
+    CActive( CActive::EPriorityStandard )
+	{
+    CActiveScheduler::Add( this );  
+	}
+
+void CProfileIdNotifier::ConstructL( )
+    {
+    iRep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
+    ListenForKeyNotifications();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CProfileIdNotifier::ListenForKeyNotifications
+// ----------------------------------------------------------------------------
+void CProfileIdNotifier::ListenForKeyNotifications()
+    {      
+	iRep->NotifyRequest( KNsmlOpDsSyncProfUid, iStatus );
+    SetActive();
+    }
+
+void CProfileIdNotifier::DoCancel()
+	{
+	iRep->NotifyCancelAll(); 
+	}
+
+void CProfileIdNotifier::RunL()
+	{
+	if( iStatus > 0 )
+		{
+		CCenrepUtils::WriteLogL( KNsmlOpDsSyncProfUid, EProfileId );
+
+		TApaTask task(CEikonEnv::Static()->WsSession( ));
+		task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
+		task.BringToForeground(); 
+
+		ListenForKeyNotifications();
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncInitiationNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* SyncInitiationNotifier.cpp
+*/
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikappui.h>
+#include <centralrepository.h>
+#include <NsmlOperatorErrorCRKeys.h>
+#include <bautils.h>				// BaflUtils
+#include <utf.h>
+#include <APGWGNAM.H> //CApaWindowGroupName
+#include <APGTASK.H>
+
+#include "SyncInitiationNotifier.h"
+#include "CenrepUtils.h"
+ 
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+CSyncInitiationNotifier* CSyncInitiationNotifier::NewL()
+    {
+    CSyncInitiationNotifier* self = CSyncInitiationNotifier::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CSyncInitiationNotifier* CSyncInitiationNotifier::NewLC()
+    {
+    CSyncInitiationNotifier* self = new ( ELeave ) CSyncInitiationNotifier;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CSyncInitiationNotifier::~CSyncInitiationNotifier()
+	{
+	if( IsActive() )
+		{
+        Cancel();
+        if( iRep )
+            {
+            iRep->NotifyCancelAll();
+            }
+		}
+	delete iRep;
+	iFs.Close();
+	}
+
+CSyncInitiationNotifier::CSyncInitiationNotifier(): 
+    CActive( CActive::EPriorityStandard )
+	{
+    CActiveScheduler::Add( this );  
+	}
+
+void CSyncInitiationNotifier::ConstructL( )
+    {
+    iRep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
+    ListenForKeyNotifications();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CSyncInitiationNotifier::ListenForKeyNotifications
+// ----------------------------------------------------------------------------
+void CSyncInitiationNotifier::ListenForKeyNotifications()
+    {      
+	iRep->NotifyRequest( KNsmlOpDsSyncInitiation, iStatus );
+    SetActive();
+    }
+
+void CSyncInitiationNotifier::DoCancel()
+	{
+	iRep->NotifyCancelAll(); 
+	}
+
+void CSyncInitiationNotifier::RunL()
+	{
+	if( iStatus > 0 )
+		{
+		CCenrepUtils::WriteLogL( KNsmlOpDsSyncInitiation, ESyncInitiation );
+
+		TApaTask task(CEikonEnv::Static()->WsSession( ));
+		task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
+		task.BringToForeground(); 
+
+		ListenForKeyNotifications();
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpyAppUi.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <eikmenub.h>
+#include <akncontext.h>
+#include <akntitle.h>
+#include <SyncStatusSpy.rsg>
+
+#include <bautils.h>				// BaflUtils
+#include <APGWGNAM.H> //CApaWindowGroupName
+#include <DataSyncInternalPSKeys.h>
+#include <NSmlConstants.h>
+#include <e32property.h>
+
+
+#include "SyncStatusSpyAppUi.h"
+#include "SyncStatusSpySettingItemList.h"
+#include "SyncStatusSpySettingItemList.hrh"
+
+#include "CenrepUtils.h"
+#include <apmstd.h> // TDataType
+
+/**
+ * Construct the CSyncStatusSpyAppUi instance
+ */ 
+CSyncStatusSpyAppUi::CSyncStatusSpyAppUi()
+	{
+	
+	}
+
+/** 
+ * The appui's destructor removes the container from the control
+ * stack and destroys it.
+ */
+CSyncStatusSpyAppUi::~CSyncStatusSpyAppUi()
+	{
+	if ( iSyncStatusSpySettingItemList != NULL )
+		{
+		RemoveFromStack( iSyncStatusSpySettingItemList );
+		delete iSyncStatusSpySettingItemList;
+		iSyncStatusSpySettingItemList = NULL;
+		delete iSettings;
+		iSettings = NULL;
+		}
+	delete iDocHandler;
+	}
+
+/**
+ * @brief Completes the second phase of Symbian object construction. 
+ * Put initialization code that could leave here. 
+ */ 
+void CSyncStatusSpyAppUi::ConstructL()
+	{
+	
+	BaseConstructL( EAknEnableSkin  | 
+					 EAknEnableMSK ); 
+	InitializeContainersL();
+
+	CCenrepUtils::CreateSyncLogDirL();
+	iDocHandler = CDocumentHandler::NewL();
+	
+	// security policies for P&S reading and writing
+	_LIT_SECURITY_POLICY_PASS( KNSmlPSWritePolicy ); // no checks done when writing
+	_LIT_SECURITY_POLICY_PASS( KNSmlPSReadPolicy ); // no checks done when reading
+		
+	// Define P&S data field for sync ON/OFF flag (may fail e.g. if exists already)
+	RProperty::Define( KPSUidDataSynchronizationInternalKeys, // category
+                       KDataSyncStatus, // field
+                       RProperty::EInt, // type
+                       KNSmlPSReadPolicy, // read policy
+                       KNSmlPSWritePolicy ); // write policy
+	}
+
+
+void CSyncStatusSpyAppUi::InitializeContainersL()
+	{
+	iSettings = CSyncStatusSpySettingItemListSettings::NewL();
+	iSyncStatusSpySettingItemList = new ( ELeave ) CSyncStatusSpySettingItemList( *iSettings, this );
+	iSyncStatusSpySettingItemList->SetMopParent( this );
+	iSyncStatusSpySettingItemList->ConstructFromResourceL( R_SYNC_STATUS_SPY_SETTING_ITEM_LIST_SYNC_STATUS_SPY_SETTING_ITEM_LIST );
+	iSyncStatusSpySettingItemList->ActivateL();
+	AddToStackL( iSyncStatusSpySettingItemList );
+	}
+
+
+/**
+ * Handle a command for this appui (override)
+ * @param aCommand command id to be handled
+ */
+void CSyncStatusSpyAppUi::HandleCommandL( TInt aCommand )
+	{
+	_LIT( KPrivateFile,"C:\\logs\\Sync\\SyncStatus.txt" );
+	TBool commandHandled = EFalse;
+	
+	switch ( aCommand )
+		{ // code to dispatch to the AppUi's menu and CBA commands is generated here
+		case ESyncStatusSpyAppUiPublishMenuItemCommand:
+	        RProperty::Set( KPSUidDataSynchronizationInternalKeys,
+							KDataSyncStatus,
+							EDataSyncRunning12 );	
+	        
+	        // Set sync stopped to P&S
+	        RProperty::Set( KPSUidDataSynchronizationInternalKeys, KDataSyncStatus, EDataSyncNotRunning );
+	        commandHandled = ETrue;
+			break;
+		
+		case ESyncStatusSpyAppUiView_logMenuItemCommand:
+		    {
+		    TDataType  empty;
+			iDocHandler->OpenFileEmbeddedL( KPrivateFile, empty );
+			commandHandled = ETrue;
+		    }
+			break;
+			
+		case ESyncStatusSpyAppUiHideMenuItemCommand:
+		    { 
+		    TApaTask task(iEikonEnv->WsSession( ));
+			 task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
+			 task.SendToBackground(); 
+			 commandHandled = ETrue;
+		    }
+			break;
+			
+		case ESyncStatusSpyAppUiDelete_logMenuItemCommand:
+			CCenrepUtils::ClearSyncLogL();
+			commandHandled = ETrue;
+			break;
+			
+		default:
+			break;
+		}
+	
+		
+	if ( !commandHandled ) 
+		{
+		if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
+			{
+			Exit();
+			}
+		}
+	}
+
+/** 
+ * Override of the HandleResourceChangeL virtual function
+ */
+void CSyncStatusSpyAppUi::HandleResourceChangeL( TInt aType )
+	{
+	CAknAppUi::HandleResourceChangeL( aType );
+
+	}
+
+/** 
+ * Override of the HandleForegroundEventL virtual function
+ */
+void CSyncStatusSpyAppUi::HandleForegroundEventL(TBool aForeground)
+	{
+	// Call Base class method
+	CAknAppUi::HandleForegroundEventL(aForeground);
+
+	if(aForeground)
+		{
+		iSyncStatusSpySettingItemList->LoadSettingValuesL();
+		iSyncStatusSpySettingItemList->LoadSettingsL();
+		iSyncStatusSpySettingItemList->DrawDeferred();
+        }
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpyApplication.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "SyncStatusSpyApplication.h"
+#include "SyncStatusSpyDocument.h"
+#ifdef EKA2
+#include <eikstart.h>
+#endif
+
+/**
+ * @brief Returns the application's UID (override from CApaApplication::AppDllUid())
+ * @return UID for this application (KUidSyncStatusSpyApplication)
+ */
+TUid CSyncStatusSpyApplication::AppDllUid() const
+	{
+	return KUidSyncStatusSpyApplication;
+	}
+
+/**
+ * @brief Creates the application's document (override from CApaApplication::CreateDocumentL())
+ * @return Pointer to the created document object (CSyncStatusSpyDocument)
+ */
+CApaDocument* CSyncStatusSpyApplication::CreateDocumentL()
+	{
+	return CSyncStatusSpyDocument::NewL( *this );
+	}
+
+#ifdef EKA2
+
+/**
+ *	@brief Called by the application framework to construct the application object
+ *  @return The application (CSyncStatusSpyApplication)
+ */	
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CSyncStatusSpyApplication;
+	}
+
+/**
+* @brief This standard export is the entry point for all Series 60 applications
+* @return error code
+ */	
+GLDEF_C TInt E32Main()
+	{
+	return EikStart::RunApplication( NewApplication );
+	}
+	
+#else 	// Series 60 2.x main DLL program code
+
+/**
+* @brief This standard export constructs the application object.
+* @return The application (CSyncStatusSpyApplication)
+*/
+EXPORT_C CApaApplication* NewApplication()
+	{
+	return new CSyncStatusSpyApplication;
+	}
+
+/**
+* @brief This standard export is the entry point for all Series 60 applications
+* @return error code
+*/
+GLDEF_C TInt E32Dll(TDllReason /*reason*/)
+	{
+	return KErrNone;
+	}
+
+#endif // EKA2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpyDocument.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "SyncStatusSpyDocument.h"
+#include "SyncStatusSpyAppUi.h"
+
+/**
+ * @brief Constructs the document class for the application.
+ * @param anApplication the application instance
+ */
+CSyncStatusSpyDocument::CSyncStatusSpyDocument( CEikApplication& anApplication )
+	: CAknDocument( anApplication )
+	{
+	}
+
+/**
+ * @brief Completes the second phase of Symbian object construction. 
+ * Put initialization code that could leave here.  
+ */ 
+void CSyncStatusSpyDocument::ConstructL()
+	{
+	}
+	
+/**
+ * Symbian OS two-phase constructor.
+ *
+ * Creates an instance of CSyncStatusSpyDocument, constructs it, and
+ * returns it.
+ *
+ * @param aApp the application instance
+ * @return the new CSyncStatusSpyDocument
+ */
+CSyncStatusSpyDocument* CSyncStatusSpyDocument::NewL( CEikApplication& aApp )
+	{
+	CSyncStatusSpyDocument* self = new ( ELeave ) CSyncStatusSpyDocument( aApp );
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/**
+ * @brief Creates the application UI object for this document.
+ * @return the new instance
+ */	
+CEikAppUi* CSyncStatusSpyDocument::CreateAppUiL()
+	{
+	return new ( ELeave ) CSyncStatusSpyAppUi;
+	}
+				
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpySettingItemList.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <eikmenup.h>
+#include <aknappui.h>
+#include <eikcmobs.h>
+#include <eikappui.h>
+#include <barsread.h>
+#include <stringloader.h>
+#include <aknnumedwin.h>
+#include <eikenv.h>
+#include <aknpopupfieldtext.h>
+#include <SyncStatusSpy.rsg>
+#include <centralrepository.h>
+#include <NsmlOperatorErrorCRKeys.h>
+
+#include "SyncStatusSpySettingItemList.h"
+#include "SyncStatusSpySettingItemListSettings.h"
+#include "SyncStatusSpySettingItemList.hrh"
+#include "SyncStatusSpyAppUi.h"
+
+/**
+ * Construct the CSyncStatusSpySettingItemList instance
+ * @param aCommandObserver command observer
+ */ 
+CSyncStatusSpySettingItemList::CSyncStatusSpySettingItemList( 
+		CSyncStatusSpySettingItemListSettings& aSettings, 
+		MEikCommandObserver* aCommandObserver )
+	: iSettings( aSettings ), iCommandObserver( aCommandObserver )
+	{
+
+	}
+/** 
+ * Destroy any instance variables
+ */
+CSyncStatusSpySettingItemList::~CSyncStatusSpySettingItemList()
+	{
+
+	}
+
+/**
+ * Handle system notification that the container's size has changed.
+ */
+void CSyncStatusSpySettingItemList::SizeChanged()
+	{
+	if ( ListBox() ) 
+		{
+		ListBox()->SetRect( Rect() );
+		}
+	}
+
+/**
+ * Create one setting item at a time, identified by id.
+ * CAknSettingItemList calls this method and takes ownership
+ * of the returned value.  The CAknSettingItem object owns
+ * a reference to the underlying data, which EditItemL() uses
+ * to edit and store the value.
+ */
+CAknSettingItem* CSyncStatusSpySettingItemList::CreateSettingItemL( TInt aId )
+	{
+	switch ( aId )
+		{
+		case ESyncStatusSpyAppUiIntegerEditor1:
+			{			
+			CAknIntegerEdwinSettingItem* item = new ( ELeave ) 
+				CAknIntegerEdwinSettingItem( 
+					aId,
+					iSettings.IntegerEditor1() );
+			return item;
+			}
+		case ESyncStatusSpyAppUiIntegerEditor2:
+			{			
+			CAknIntegerEdwinSettingItem* item = new ( ELeave ) 
+				CAknIntegerEdwinSettingItem( 
+					aId,
+					iSettings.IntegerEditor2() );
+			return item;
+			}
+		case ESyncStatusSpyAppUiEnumeratedTextPopup2:
+			{			
+			CAknEnumeratedTextPopupSettingItem* item = new ( ELeave ) 
+				CAknEnumeratedTextPopupSettingItem( 
+					aId,
+					iSettings.EnumeratedTextPopup2() );
+			return item;
+			}
+		case ESyncStatusSpyAppUiEnumeratedTextPopup1:
+			{			
+			CAknEnumeratedTextPopupSettingItem* item = new ( ELeave ) 
+				CAknEnumeratedTextPopupSettingItem( 
+					aId,
+					iSettings.EnumeratedTextPopup1() );
+			return item;
+			}
+
+		}
+		
+	return NULL;
+	}
+	
+/**
+ * Edit the setting item identified by the given id and store
+ * the changes into the store.
+ * @param aIndex the index of the setting item in SettingItemArray()
+ * @param aCalledFromMenu true: a menu item invoked editing, thus
+ *	always show the edit page and interactively edit the item;
+ *	false: change the item in place if possible, else show the edit page
+ */
+void CSyncStatusSpySettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
+	{
+	CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
+	switch ( item->Identifier() )
+		{
+
+	
+		}
+	
+	CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
+	
+	TBool storeValue = ETrue;
+	switch ( item->Identifier() )
+		{
+	
+		}
+		
+	if ( storeValue )
+		{
+		item->StoreL();
+		SaveSettingValuesL();
+		}	
+	}
+/**
+ *	Handle the "Change" option on the Options menu.  This is an
+ *	alternative to the Selection key that forces the settings page
+ *	to come up rather than changing the value in place (if possible).
+ */
+void CSyncStatusSpySettingItemList::ChangeSelectedItemL()
+	{
+	if ( ListBox()->CurrentItemIndex() >= 0 )
+		{
+		EditItemL( ListBox()->CurrentItemIndex(), ETrue );
+		}
+	}
+
+/**
+ *	Load the initial contents of the setting items.  By default,
+ *	the setting items are populated with the default values from
+ * 	the design.  You can override those values here.
+ *	<p>
+ *	Note: this call alone does not update the UI.  
+ *	LoadSettingsL() must be called afterwards.
+ */
+void CSyncStatusSpySettingItemList::LoadSettingValuesL()
+	{
+	// load values into iSettings
+	TInt value;
+	CRepository* rep = NULL;
+	TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) );
+	if ( err == KErrNone )
+	    {	
+	    rep->Get( KNsmlOpDsErrorCode, value );
+	    iSettings.SetIntegerEditor1( value );
+	
+	    rep->Get( KNsmlOpDsSyncProfUid, value );
+	    iSettings.SetIntegerEditor2( value );
+	
+	    rep->Get( KNsmlOpDsSyncType, value );
+	    iSettings.SetEnumeratedTextPopup2( value );
+	
+	    rep->Get( KNsmlOpDsSyncInitiation, value );
+	    iSettings.SetEnumeratedTextPopup1( value );
+	    
+	    delete rep;
+	    }
+	}
+	
+/**
+ *	Save the contents of the setting items.  Note, this is called
+ *	whenever an item is changed and stored to the model, so it
+ *	may be called multiple times or not at all.
+ */
+void CSyncStatusSpySettingItemList::SaveSettingValuesL()
+	{
+	// store values from iSettings
+	CRepository* rep = NULL;
+	TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) );
+	if ( err == KErrNone )
+	    {		
+	    rep->Set( KNsmlOpDsErrorCode, iSettings.IntegerEditor1() );
+	    rep->Set( KNsmlOpDsSyncProfUid, iSettings.IntegerEditor2() );
+	    rep->Set( KNsmlOpDsSyncType, iSettings.EnumeratedTextPopup2() );
+	    rep->Set( KNsmlOpDsSyncInitiation, iSettings.EnumeratedTextPopup1() );
+	    
+	    delete rep;
+	    }
+	}
+
+
+/** 
+ * Handle global resource changes, such as scalable UI or skin events (override)
+ */
+void CSyncStatusSpySettingItemList::HandleResourceChange( TInt aType )
+	{
+	CAknSettingItemList::HandleResourceChange( aType );
+	SetRect( static_cast< CEikAppUi* >( iCoeEnv->AppUi() )->ClientRect() );
+	}
+				
+/** 
+ * Handle key event (override)
+ * @param aKeyEvent key event
+ * @param aType event code
+ * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed
+ */
+TKeyResponse CSyncStatusSpySettingItemList::OfferKeyEventL( 
+		const TKeyEvent& aKeyEvent, 
+		TEventCode aType )
+	{
+	return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType );
+	}
+				
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncStatusSpySettingItemListSettings.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+/**
+ *	Generated helper class which manages the settings contained 
+ *	in 'SyncStatusSpySettingItemList'.  Each CAknSettingItem maintains
+ *	a reference to data in this class so that changes in the setting
+ *	item list can be synchronized with this storage.
+ */
+ 
+
+#include <e32base.h>
+#include <stringloader.h>
+#include <barsread.h>
+#include <SyncStatusSpy.rsg>
+#include "SyncStatusSpySettingItemListSettings.h"
+
+
+#include "ErrorCodeNotifier.h"
+#include "SyncTypeNotifier.h"
+#include "ProfileIdNotifier.h"
+#include "SyncInitiationNotifier.h"
+
+/**
+ * C/C++ constructor for settings data, cannot throw
+ */
+CSyncStatusSpySettingItemListSettings::CSyncStatusSpySettingItemListSettings()
+	{
+	}
+
+/**
+ * Two-phase constructor for settings data
+ */
+CSyncStatusSpySettingItemListSettings* CSyncStatusSpySettingItemListSettings::NewL()
+	{
+	CSyncStatusSpySettingItemListSettings* data = new( ELeave ) CSyncStatusSpySettingItemListSettings;
+	CleanupStack::PushL( data );
+	data->ConstructL();
+	CleanupStack::Pop( data );
+	return data;
+	}
+
+CSyncStatusSpySettingItemListSettings::~CSyncStatusSpySettingItemListSettings()
+	{
+	delete iErrorCodeNotifier;
+	delete iProfileIdNotifier;
+	delete iSyncTypeNotifier;
+	delete iSyncInitiationNotifier;
+	}
+
+/**
+ *	Second phase for initializing settings data
+ */
+void CSyncStatusSpySettingItemListSettings::ConstructL()
+	{
+
+	SetIntegerEditor1( 0 );
+	SetIntegerEditor2( 0 );
+	SetEnumeratedTextPopup2( 0 );
+	SetEnumeratedTextPopup1( 0 );
+
+
+	TRAP_IGNORE( iErrorCodeNotifier = CErrorCodeNotifier::NewL() );
+	TRAP_IGNORE( iProfileIdNotifier = CProfileIdNotifier::NewL() );
+	TRAP_IGNORE( iSyncTypeNotifier = CSyncTypeNotifier::NewL() );
+	TRAP_IGNORE( iSyncInitiationNotifier = CSyncInitiationNotifier::NewL() );
+	
+	}
+	
+
+TInt& CSyncStatusSpySettingItemListSettings::IntegerEditor1()
+	{
+	return iIntegerEditor1;
+	}
+
+void CSyncStatusSpySettingItemListSettings::SetIntegerEditor1(const TInt& aValue)
+	{
+	iIntegerEditor1 = aValue;
+	}
+
+TInt& CSyncStatusSpySettingItemListSettings::IntegerEditor2()
+	{
+	return iIntegerEditor2;
+	}
+
+void CSyncStatusSpySettingItemListSettings::SetIntegerEditor2(const TInt& aValue)
+	{
+	iIntegerEditor2 = aValue;
+	}
+
+TInt& CSyncStatusSpySettingItemListSettings::EnumeratedTextPopup2()
+	{
+	return iEnumeratedTextPopup2;
+	}
+
+void CSyncStatusSpySettingItemListSettings::SetEnumeratedTextPopup2(const TInt& aValue)
+	{
+	iEnumeratedTextPopup2 = aValue;
+	}
+
+TInt& CSyncStatusSpySettingItemListSettings::EnumeratedTextPopup1()
+	{
+	return iEnumeratedTextPopup1;
+	}
+
+void CSyncStatusSpySettingItemListSettings::SetEnumeratedTextPopup1(const TInt& aValue)
+	{
+	iEnumeratedTextPopup1 = aValue;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/tsrc/SyncStatusSpy/src/SyncTypeNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* SyncTypeNotifier.cpp
+*/
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikappui.h>
+#include <centralrepository.h>
+#include <NsmlOperatorErrorCRKeys.h>
+#include <bautils.h>				// BaflUtils
+#include <utf.h>
+#include <APGWGNAM.H> //CApaWindowGroupName
+#include <APGTASK.H>
+
+#include "SyncTypeNotifier.h"
+#include "CenrepUtils.h"
+ 
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+CSyncTypeNotifier* CSyncTypeNotifier::NewL()
+    {
+    CSyncTypeNotifier* self = CSyncTypeNotifier::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CSyncTypeNotifier* CSyncTypeNotifier::NewLC()
+    {
+    CSyncTypeNotifier* self = new ( ELeave ) CSyncTypeNotifier;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CSyncTypeNotifier::~CSyncTypeNotifier()
+	{
+	if( IsActive() )
+		{
+        Cancel();
+        if( iRep )
+            {
+            iRep->NotifyCancelAll();
+            }
+		}
+	delete iRep;
+	iFs.Close();
+	}
+
+CSyncTypeNotifier::CSyncTypeNotifier(): 
+    CActive( CActive::EPriorityStandard )
+	{
+    CActiveScheduler::Add( this );  
+	}
+
+void CSyncTypeNotifier::ConstructL( )
+    {
+    iRep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
+    ListenForKeyNotifications();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CSyncTypeNotifier::ListenForKeyNotifications
+// ----------------------------------------------------------------------------
+void CSyncTypeNotifier::ListenForKeyNotifications()
+    {      
+	iRep->NotifyRequest( KNsmlOpDsSyncType, iStatus );
+    SetActive();
+    }
+
+void CSyncTypeNotifier::DoCancel()
+	{
+	iRep->NotifyCancelAll(); 
+	}
+
+void CSyncTypeNotifier::RunL()
+	{
+	if( iStatus > 0 )
+		{
+		CCenrepUtils::WriteLogL( KNsmlOpDsSyncType, ESyncType );
+
+		TApaTask task(CEikonEnv::Static()->WsSession( ));
+		task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
+		task.BringToForeground(); 
+
+		ListenForKeyNotifications();
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                SyncML Notifier API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SyncMLNotifierParams.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncMLNotifierParams.h)
+../inc/SyncMLNotifier.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncMLNotifier.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* 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:  Partial declaration of the notifier API.
+*
+*/
+
+
+
+#ifndef SYNCMLNOTIFIER_H
+#define SYNCMLNOTIFIER_H
+
+//  INCLUDES
+#include <eiknotapi.h>
+
+// CONSTANTS
+// Notifier id for app starter notifier
+const TUid KSyncMLAppLaunchNotifierUid = {0x101F8769};
+
+// Notifier id for server dialog notifier
+const TUid KSyncMLDlgNotifierUid =       {0x101F876A};
+const TUid KSyncMLFwUpdNotifierUid =     {0x102072BF}; // Notifier id for firmware update notifier
+
+// FUNCTION PROTOTYPES
+// Notifier array (entry point)
+IMPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray();
+
+#endif      // SYNCMLNOTIFIER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifierParams.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* 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:  Partial declaration of the notifier API.
+*
+*/
+
+
+
+#ifndef SYNCMLNOTIFIERPARAMS_H
+#define SYNCMLNOTIFIERPARAMS_H
+
+#include <centralrepository.h>
+#include <schinfo.h>
+
+//  INCLUDES
+
+// CONSTANTS
+const TUint KSyncMLMaxServerMsgLength = 200;
+const TUint KSyncMLMaxProfileNameLength = 50;
+const TUint KSyncMLMaxDefaultResponseMsgLength = 300;
+const TUint KSyncMLMaxAlertResultLength = 150;
+const TUint KSyncMLChoiceItemsLengthBuffer = 400;
+const TUint KSyncMLMaxChoiceItemLength = 100;
+const TUint KSyncMLChunknameLength = 25;
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class TSyncMLAppLaunchNotifParams;
+class TSyncMLDlgNotifParams;
+class TSyncMLAppLaunchNotifRetVal;
+class TSyncMLDlgNotifRetVal;
+class TSyncMLFwUpdNotifParams;
+class TSyncMLFwUpdNotifRetVal;
+class TSyncMLDlgNotifReturnParams;
+
+
+// DATA TYPES
+typedef TPckgBuf<TSyncMLAppLaunchNotifParams> TSyncMLAppLaunchNotifParamsPckg;
+typedef TPckgBuf<TSyncMLDlgNotifParams>       TSyncMLDlgNotifParamsPckg;
+typedef TPckgBuf<TSyncMLFwUpdNotifParams>     TSyncMLFwUpdNotifParamsPckg;
+typedef TPckgBuf<TSyncMLAppLaunchNotifRetVal> TSyncMLAppLaunchNotifRetValPckg;
+typedef TPckgBuf<TSyncMLDlgNotifRetVal>       TSyncMLDlgNotifRetValPckg;
+typedef TPckgBuf<TSyncMLFwUpdNotifRetVal>     TSyncMLFwUpdNotifRetValPckg;
+typedef TPckgBuf<TSyncMLDlgNotifReturnParams>    TSyncMLDlgNotifReturnParamsPckg;
+
+
+enum TSyncMLSessionTypes
+    {
+    ESyncMLUnknownSession,
+    ESyncMLSyncSession,
+    ESyncMLMgmtSession,
+    };
+
+enum TSyncMLDlgNoteTypes
+    {
+    ESyncMLInfoNote,
+    ESyncMLErrorNote,
+    ESyncMLOkQuery,
+    ESyncMLYesNoQuery,
+    ESyncMLQueryNote,  // Deprecated. Use ESyncMLOkQuery or ESyncMLYesNoQuery instead
+    ESyncMLInputQuery, //For 1102 User Input alert 	
+	ESyncMLSingleChoiceQuery, //1103
+    ESyncMLMultiChoiceQuery  //1104
+    };
+
+enum TSyncMLFwUpdNoteTypes
+    {
+    ESyncMLFwUpdUnknown,
+    ESyncMLFwUpdErrorNote,
+    ESyncMLFwUpdResultNote,
+    ESyncMLFwUpdStartQuery,
+    ESyncMLFwUpdRebootNote,
+    ESyncMLFwUpdNoReminder,       //Enum for No Reminder & Install Later note
+    ESyncMLFwUpdLargeNotEnoughMemory,  //Enum for large object No Enough memory situation
+    ESyncMLFwUpdOmaDLNotEnoughMemory, //Enum for Oma Download No Enough memory situation
+    ESyncMLFwUpdOmaDLUserCancel,	//Enum for Oma Download User cancel situation
+    ESyncMLFwUpdOmaDLPostponed,	//Enum for Oma Download postponed
+    ESyncMLFwUpdOmaDLCancelled, //Enum for Oma Download cancelled
+    ESyncMLFwUpdOmaDLResume,        //Enum for Oma Download Resume
+    ESyncMLFwUpdStartQueryEnc,      //Enum for starting installation on encrypted memory
+	ESyncMLFwUpdForceQuery,         // Forcing the update when the retry count for postponing the update expires.
+    ESyncMLFwUpdPostponeNote,        // The note that is to be shown when user postpones the udpate
+    ESyncMLFwUpdPostponeLimitQuery
+
+    };
+
+
+enum TSyncMLFwUpdNoteInfo
+    {
+    KErrCommsLineFail2, //Enum for Oma Download connection failure with resume supported
+    KErrGeneralResume, //Enum for Oma Download general error with resume supported
+    KErrGeneralNoResume, //Enum for Oma Download general error without resume supported
+    KErrBadUsbPower,      //Enum for low battery error when USB charging is supported 
+    KErrBadPowerForEnc,     //Enum for low battery error during encryption
+    KErrDeviceMemoryBusy    //Enum to show drive busy error when encryption or decryption is in progress
+    };
+
+
+enum TSyncMLSANSupport
+    {
+    ESANNotSpecified,
+    ESANSilent,
+    ESANUserInformative,
+    ESANUserInteractive
+    };
+    
+enum TSyncMLUserInputTypes
+    {
+    ESyncMLInputTypeAlphaNumeric,
+    ESyncMLInputTypeNumeric,
+    ESyncMLInputTypeDate,
+    ESyncMLInputTypeTime,
+    ESyncMLInputTypePhoneNumber,
+    ESyncMLInputTypeIPAddress	
+    };
+    
+ enum TSyncMLUserInputEchoTypes
+    {
+    ESyncMLEchoTypeText,
+    ESyncMLEchoTypePassword
+    };   
+
+    
+// CLASS DECLARATION
+
+/**
+* Struct to allow the sending of parameters to SyncML application
+* starter notifier plugin.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+class TSyncMLAppLaunchNotifParams
+	{
+    public:
+        // Type of the SyncML session to be initiated. 
+	    TSyncMLSessionTypes iSessionType;
+        // Identifier of the job requested.
+	    TInt iJobId;
+	    // Identifier of the profile used
+	    TInt iProfileId;
+       // Server alert Ui mode
+	    TInt iUimode;
+	};
+
+/**
+* Struct to allow the delivery of return values from SyncML application
+* starter notifier plugin.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+class TSyncMLAppLaunchNotifRetVal
+	{
+    public:
+        // Identifier of the session requested.
+	    TUid iSecureId;
+	};
+
+
+/**
+* Struct to allow the sending of parameters to SyncML server
+* dialog notifier plugin.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+class TSyncMLDlgNotifParams
+	{
+    public:
+        // Type of the query or note to be shown.
+	    TSyncMLDlgNoteTypes iNoteType;
+        // Message to be shown on the screen.
+	    TBufC<KSyncMLMaxServerMsgLength> iServerMsg;
+        // Timeout of the note (in seconds). 0 = No timeout.
+	    TInt iMaxTime;
+	    //Response message in case of 1102 alert
+	    TBuf<KSyncMLMaxDefaultResponseMsgLength> iDR;		
+	    //Input type
+	    TInt iIT;
+	    //Echo type
+	    TInt iET;
+	    //Max length
+	    TInt iMaxLength;	    
+	    //For choice alerts	 
+	    TBufC<KSyncMLChoiceItemsLengthBuffer> iItemLength;
+		TBufC<KSyncMLChunknameLength> iChunkName;
+		//Number of choice items
+	    TInt iNumberOfItems;			   
+	};
+	
+
+
+//For 1102 server alert
+class TSyncMLDlgNotifReturnParams
+   {
+   public:
+   TInt iretval; //which stores the yes/no/end key pressed
+   TBuf<KSyncMLMaxAlertResultLength> irettext;	
+   };
+
+
+/**
+* Struct to allow the delivery of return values from SyncML server
+* dialog notifier plugin.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+class TSyncMLDlgNotifRetVal
+	{
+	// Included for future use.
+	};
+
+/**
+* Struct to allow the sending of parameters to SyncML firmware
+* update notifier plugin.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.1
+*/
+class TSyncMLFwUpdNotifParams
+	{
+    public:
+        // Type of the SyncML session to be initiated. 
+	    TSyncMLFwUpdNoteTypes iNoteType;
+	    
+        // Generic integer parameter.
+        // Usage:
+        // ESyncMLFwUpdErrorNote:  Symbian error code.
+        // ESyncMLFwUpdResultNote: Symbian error code.
+        // ESyncMLFwUpdStartQuery: Firmware update profile identifier.
+	    TInt iIntParam;
+	    TInt iMemoryNeeded;// Parameter to hold how much memory is to be
+	                       // freed for downloading the package.
+	    TBool iEncryptReq; //To tell if encrypt query should be shown to user.
+		TInt iFotaUserPostponeCount; // To determine the number of times user has postponed the update.
+	    TInt iFotaMaxPostponeCount; // The maximum number of times the update can be postponed.
+	    TBuf<KSyncMLMaxServerMsgLength> iSelectedReminder; // The option selected by the user to postpone the update.
+	    TIntervalType iIntervalType;
+	    TInt iInterval;
+	    
+	};
+
+/**
+* Struct to allow the delivery of return values from SyncML firmware
+* update notifier plugin.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.1
+*/
+class TSyncMLFwUpdNotifRetVal
+	{
+	// Included for future use.
+	};
+
+#endif      // SYNCMLNOTIFIERPARAMS_H   
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_api/syncml_notifier_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="f25e77cadb2479c192323433f30932d7" dataversion="1.0">
+  <name>SyncML Notifier API</name>
+  <description>SyncML Notifier API which indicates the UIDs and the message formats that should be used/understood by the notifier side implementation for the notifications sent by the SyncMLFW subsystem.</description>
+  <type>c++</type>
+  <subsystem>syncmlfw</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_roaming_api/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 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:  File that exports the files belonging to 
+:                SyncML Notifier Roaming API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SyncMLNotifierDomainCRKeys.h     MW_LAYER_PLATFORM_EXPORT_PATH(SyncMLNotifierDomainCRKeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_roaming_api/inc/SyncMLNotifierDomainCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2007 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:  SyncMLNotifier Domain CenRep key definitions
+*
+*/
+
+
+#ifndef SYNCMLNOTIFIER_DOMAIN_CR_KEYS_H
+#define SYNCMLNOTIFIER_DOMAIN_CR_KEYS_H
+
+// CONSTANTS
+
+// SyncMLNotifier key UID
+const TUid KCRUidNSmlNotifierDomainKeys = {0x101F8769};
+
+// CenRep key used in variation of the aspects of
+// the roaming feature. The flag values are
+// commented below.
+const TUint32 KNSmlDMBlockedInRoaming = 0x00000001;
+
+
+// CenRep key for variable DM UI UID
+const TUint32 KNSmlDMAppName = 0x00000002;
+
+// CenRep key for variable DM UI UID
+const TUint32 KNSmlDMChargingNote = 0x00000003;
+
+#endif // NSMLDMSYNCAPP_PRIVATE_CR_KEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/syncml_notifier_roaming_api/syncml_notifier_roaming_api.metaxml	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="1f3b78795aee98556f1a041add416186" dataversion="1.0">
+  <name>SyncML Notifier Roaming API</name>
+  <description>Notifier variation settings</description>
+  <type>c++</type>
+  <subsystem>omads</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/remotemgmt_plat/terminal_security_device_lock_api/inc/TerminalControl3rdPartyAPI.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/terminal_security_device_lock_api/inc/TerminalControl3rdPartyAPI.h	Wed Sep 01 12:27:42 2010 +0100
@@ -148,6 +148,22 @@
 
 		IMPORT_C TInt GetDeviceLockParameter(TInt aType, TDes8& aData);
 
+		/**
+		ResetDeviceLockParameters
+
+		The function resets the Terminal Security parameters that were set by the calling application
+		(by earlier calls to SetDeviceLockParameter())
+
+		NOTE:
+		 > 	The function resets only those parameters that the calling function had set. Parameters
+			not set by the calling application are not affected.
+
+		 >	Calls to this function will not reset value of EPasscode. Device Lock Code will not be reset
+
+		@param none
+		@return KErrNone Symbian error code
+		*/
+		IMPORT_C TInt ResetDeviceLockParameters();
 	};
 
 #endif //__TERMINALCONTROL3RDPARTYAPI_H__
\ No newline at end of file
--- a/remotemgmt_plat/terminal_security_device_lock_api/inc/dmencryptionutil.inl	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/terminal_security_device_lock_api/inc/dmencryptionutil.inl	Wed Sep 01 12:27:42 2010 +0100
@@ -68,7 +68,7 @@
        {
            User::Leave(terr);
        }
-       if(infoArray.Count() > 1 || (0 == infoArray.Count()))
+       if(infoArray.Count() != 1)
        {
            User::Leave(KErrBadName);
        }
--- a/remotemgmt_plat/terminal_security_device_lock_api/tsrc/group/TestTerminalControl.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/remotemgmt_plat/terminal_security_device_lock_api/tsrc/group/TestTerminalControl.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -49,6 +49,12 @@
 USERINCLUDE     ../../../terminalsecurity/tarmterminalcontrol/inc    // domain private headers
 MW_LAYER_SYSTEMINCLUDE
 
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
+
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
 LIBRARY         stiftestengine.lib
@@ -80,4 +86,6 @@
 // DEFFILE ?filename
 // AIF ?filename
 
+SMPSAFE
+
 // End of File
--- a/syncmlfw/common/alertqueue/bld/NSmlAlertQueue.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/alertqueue/bld/NSmlAlertQueue.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -65,7 +65,7 @@
 
 LIBRARY         euser.lib estor.lib bafl.lib efsrv.lib nsmlwbxml.lib
 LIBRARY		nsmlhistorylog.lib
-LIBRARY		NSmlDSSettings.lib
+LIBRARY		nsmldssettings.lib
 LIBRARY		nsmldmsettings.lib
 LIBRARY		nsmldshostclient.lib
 LIBRARY         nsmlagentcommon.lib
--- a/syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -18,10 +18,10 @@
 
 #include <centralrepository.h>
 #include <DevManInternalCRKeys.h>
+#include <e32property.h>
+#include <nsmldmconst.h>
 #include "NSmlAlertQueue.h"
 #include "nsmldebug.h" 
-#include <nsmldmconst.h>
-#include <e32property.h>
 // ---------------------------------------------------------
 // CNSmlDSAlertParser11(CSmlAlertInfo& aAlertInfo, CSyncMLHistoryPushMsg& aHistoryInfo )
 // Returns pointer to the buffer
@@ -74,16 +74,14 @@
     delete centrep;
 	if( SanSupport == 1 )
    	{
-	    static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-	    static _LIT_SECURITY_POLICY_C1(KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
-		RProperty::Define(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,RProperty::EInt,KAllowAllPolicy,KAllowWriteDeviceDataPolicy);
-		RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,KErrNone);  
-		
-	    if(uiMode == ESilent) //silent
-	        {
-	        TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);
-	        DBG_FILE_CODE( r2, _S8("CNSmlDMAlertParser11::ParseMessageL() KNSmlDMSilentJob set error code") );
-	        }
+	if(uiMode == ESilent) //silent
+	    {
+        static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+        static _LIT_SECURITY_POLICY_C1(KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
+        RProperty::Define(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,RProperty::EInt,KAllowAllPolicy,KAllowWriteDeviceDataPolicy);
+        TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);
+        DBG_FILE_CODE( r2, _S8("CNSmlDMAlertParser11::ParseMessageL() KNSmlDMSilentJob set error code") );
+	    }
     iAlertInfo.SetUimode(uiMode);
    	}	
 	if (uiMode == 0)
--- a/syncmlfw/common/alertqueue/src/NSmlDSAlertParser11.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/alertqueue/src/NSmlDSAlertParser11.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -24,7 +24,7 @@
 #include <barsc.h>
 #include <s32mem.h>
 #include <data_caging_path_literals.hrh>
-#include <nsmldstypesres.rsg>
+#include <NSmlDSTypesRes.rsg>
 
 #include <nsmlconstants.h>
 #include <nsmlunicodeconverter.h>
@@ -217,26 +217,27 @@
 
 	SmlMetInfMetInf_t* metInf = NULL;
 	TPtr8 mediaType( NULL, 0, 0 );
-
+	
+	if ( aAlert->itemList->item->meta )
+		{
+		if ( aAlert->itemList->item->meta->content && 
+			aAlert->itemList->item->meta->contentType == SML_PCDATA_EXTENSION && 
+			aAlert->itemList->item->meta->extension == SML_EXT_METINF )
+			{
+			metInf = (SmlMetInfMetInf_t*) aAlert->itemList->item->meta->content;
+			
+			if ( metInf->type )
+				{
+				mediaType.Set( static_cast<TUint8*>( metInf->type->content ), metInf->type->length, metInf->type->length );
+				TrimRightSpaceAndNull( mediaType );
+				}
+			}
+		}
+		
 	if ( aAlert->itemList )
 		{
 		if (aAlert->itemList->item)
-			{	
-			if ( aAlert->itemList->item->meta )
-				{
-				if ( aAlert->itemList->item->meta->content && 
-				aAlert->itemList->item->meta->contentType == SML_PCDATA_EXTENSION && 
-				aAlert->itemList->item->meta->extension == SML_EXT_METINF )
-				{
-				metInf = (SmlMetInfMetInf_t*) aAlert->itemList->item->meta->content;
-			
-				if ( metInf->type )
-					{
-					mediaType.Set( static_cast<TUint8*>( metInf->type->content ), metInf->type->length, metInf->type->length );
-					TrimRightSpaceAndNull( mediaType );
-					}
-				}
-				}
+			{
 			if ( aAlert->itemList->item->source )
 				{
 				HBufC8* remotePath = NULL;
@@ -252,7 +253,7 @@
 					}
 							
 				CleanupStack::PopAndDestroy(); // remotePath	
-    		}
+    			}
 			}
 		}
 	
--- a/syncmlfw/common/alertqueue/src/NSmlDSAlertParser12.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/alertqueue/src/NSmlDSAlertParser12.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -20,7 +20,7 @@
 #include <barsread.h>
 #include <barsc.h>
 #include <s32mem.h>
-#include <nsmldstypesres.rsg>
+#include <NSmlDSTypesRes.rsg>
 #include <data_caging_path_literals.hrh> 
 
 #include <nsmlconstants.h>
--- a/syncmlfw/common/http/bld/nsmlhttp.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/bld/nsmlhttp.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -45,7 +45,7 @@
 
 
 MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE			/epoc32/include/libc /epoc32/include/ecom
+SYSTEMINCLUDE			/epoc32/include/libc /epoc32/include/ecom	/epoc32/include/http
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE			/epoc32/include/mw/http
 #endif
@@ -72,5 +72,8 @@
 LIBRARY			ezlib.lib
 LIBRARY			connmon.lib
 LIBRARY         	connmonext.lib
-
+LIBRARY  		extendedconnpref.lib 
+LIBRARY  		netmeta.lib 
+LIBRARY 		etel.lib
+LIBRARY 		etelmm.lib
 SMPSAFE
--- a/syncmlfw/common/http/inc/nsmldialiap.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/inc/nsmldialiap.h	Wed Sep 01 12:27:42 2010 +0100
@@ -23,7 +23,7 @@
 #include <commdb.h>
 #include <cdbstore.h>
 #include <in_iface.h>
-
+#include <extendedconnpref.h>
 #include <nifman.h>
 #include <connectprog.h>
 #include <commdbconnpref.h>
@@ -40,7 +40,7 @@
 
 	public:
 		CNSmlDialUpAgent();
-		void ConstructL();
+		void ConstructL(TBool aDmJob);
 		void ConnectL( CArrayFixFlat<TUint32>* aIAPIdArray, TRequestStatus &aStatus );
 		~CNSmlDialUpAgent();
 	
@@ -55,13 +55,12 @@
 		void StartDatacallL();
 		void AttachToConnectionL();
 		TBool IsInOfflineModeL();
+		void IsRoamingL(TBool& aRoaming);
 	private:
 		TRequestStatus* iEngineStatus;
 		RConnection iConnection;
 		RSocketServ iSocketServer;
-
-		TUint iIAPid;
-		TCommDbConnPref iPref;
+		TUint iIAPid;		
 		TBool iCancelCalled;
 		TBool iSocketConnection;
         CArrayFixFlat<TUint32>* iIAPArray;
@@ -70,6 +69,9 @@
         TBool iTimerReturn;
         TInt iRetryCounter;
         RTimer iTimer;
+        TConnPrefList iPrefList;
+        TExtendedConnPref iExtPrefs;
+		TBool iDmjob;
 
 	private:
 		friend class CNSmlHTTP;
--- a/syncmlfw/common/http/inc/nsmlhttp.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/inc/nsmlhttp.h	Wed Sep 01 12:27:42 2010 +0100
@@ -41,6 +41,10 @@
 #include "nsmldialiap.h"
 
 #include <rconnmon.h>
+#include <centralrepository.h>
+
+//Central repository key for varying deflate feature
+const TInt KNsmlDsDeflateSupport = 0xA ;
 
 // FORWARD DECLARATION
 class CNSmlXptShutdownTimer;
@@ -170,6 +174,7 @@
 		TServerContentEncoding iServerContentEncoding;
 		TServerContentEncoding iServerAcceptEncoding;
 		TInt iMaxMsgSize;
+		TBool iDeflateFlag;
 
 	private:
 		// methods inherited from MHTTPDataSupplier
--- a/syncmlfw/common/http/inc/nsmlhttpclient.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/inc/nsmlhttpclient.h	Wed Sep 01 12:27:42 2010 +0100
@@ -40,8 +40,6 @@
 		KCouldNotNotifyBodyDataPart
 	};
 
-// FORWARD DECLARATIONS
-class CRepository;
 
 //============================================================
 // Class CHttpEventHandler declaration
@@ -66,9 +64,6 @@
 private:
 	CNSmlHTTP* iAgent;
 	MHTTPDataSupplier* iRespBody;
-	//For storing Server Status Code
-	CRepository* iRepositorySSC;
-	TBool iErrorReportingEnabled;
 
 private:
 	friend class CNSmlHTTP;
--- a/syncmlfw/common/http/src/nsmldialiap.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/src/nsmldialiap.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -20,8 +20,13 @@
 #include <featmgr.h>   // FeatureManager
 #include <cmdefconnvalues.h>
 #include <cmmanager.h>
-#include <cmpluginwlandef.h>
+#include <cmmanagerkeys.h>
+#include <rconnmon.h>
+#include <nsmldmconst.h>
+#include <nsmlconstants.h>
 #include <etelpckt.h>
+#include <etel.h> //for telephone mode
+#include <etelmm.h> //for telephone mode
 #include "nsmldialiap.h"
 #include <nsmlconstants.h>
 #include "nsmlerror.h"
@@ -53,12 +58,13 @@
 // CNSmlDialUpAgent::ConstructL()
 // 2-phase
 // --------------------------------------------------------------------
-void CNSmlDialUpAgent::ConstructL()
+void CNSmlDialUpAgent::ConstructL(TBool aDmJob)
     {
 	DBG_FILE( _S8("CNSmlDialUpAgent::ConstructL") );
 	CActiveScheduler::Add( this );
 	iCancelCalled = EFalse;    
-	iSocketConnection = EFalse;    
+	iSocketConnection = EFalse;  
+	iDmjob = aDmJob;
 	FeatureManager::InitializeLibL();  
 	}
 //------------------------------------------------------------
@@ -176,6 +182,7 @@
 	    User::RequestComplete( status, iStatus.Int() );			
         }
 	}
+
 // ----------------------------------------------------------------------------
 // CNSmlDialUpAgent::RunError
 // ----------------------------------------------------------------------------
@@ -272,20 +279,7 @@
     User::LeaveIfError( iSocketServer.Connect() );		
     User::LeaveIfError( iConnection.Open( iSocketServer ) );
     iSocketConnection = ETrue;
-    if ( static_cast<TInt32>(iIAPid) == -1 )
-        {
-        iConnection.Start( iPref, iStatus );
-        }
-    else if( static_cast<TInt32>(iIAPid) == -2 ) // default connection 
-        {
-
-        iConnection.Start( iStatus );	
-
-        }
-    else
-        {
-        iConnection.Start( iPref, iStatus );
-        }
+    iConnection.Start( iPrefList, iStatus );
     }
 	
 // ---------------------------------------------------------
@@ -386,33 +380,110 @@
 void CNSmlDialUpAgent::DoSettingsL()
     {
     DBG_FILE( _S8("CNSmlDialUpAgent::DoSettingsL") );
-    iOffline=IsInOfflineModeL();
-    if( static_cast<TInt32>(iIAPid) == -1 )
-        {		
-        if(iOffline)
-            {		
-            iPref.SetDialogPreference( ECommDbDialogPrefPrompt );
-            iPref.SetBearerSet(KUidWlanBearerType);	
+    iOffline=IsInOfflineModeL();            
+    iExtPrefs.SetForcedRoaming(EFalse);
+    if(  ( static_cast<TInt32>(iIAPid) == -2 ) || 
+            static_cast<TInt32>(iIAPid) == -1 ) // default connection
+        {
+        TBool Snap = EFalse;
+        RCmManager cmmgr;
+        cmmgr.OpenL();
+        TCmDefConnValue defConnValue;
+        cmmgr.ReadDefConnL(defConnValue);
+        cmmgr.Close();
+        if(defConnValue.iType == ECmDefConnDestination)
+            {
+            iExtPrefs.SetSnapId(defConnValue.iId);
+            Snap = ETrue;
+            }
+        else if(defConnValue.iType == ECmDefConnConnectionMethod)
+            {
+            iExtPrefs.SetIapId(defConnValue.iId);   
             }
-        else
-            {		
-            iPref.SetDialogPreference( ECommDbDialogPrefPrompt );		
-            //iPref.SetBearerSet(EApBearerTypeAllBearers);
-            }				
-        }
-    else if( iOffline &&  ( static_cast<TInt32>(iIAPid) == -2 ) ) // default connection
-        {
-        iPref.SetDialogPreference( ECommDbDialogPrefPrompt );
-        iPref.SetBearerSet(KUidWlanBearerType);	
+            iExtPrefs.SetConnSelectionDialog(EFalse);
+        if(iDmjob)
+            {            
+            TInt val = KErrNotFound;
+            TInt r2=RProperty::Get(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,val);
+			DBG_FILE_CODE( r2, _S8("CNSmlDialUpAgent::DoSettingsL dc KNSmlDMSilentJob set error code") );
+            if(val == ESilent) //silent session
+                {
+                //Check the cenrep key
+                TInt currentmode = KErrNone;
+                CRepository* rep = CRepository::NewLC( KCRUidCmManager );
+                rep->Get(KCurrentCellularDataUsage, currentmode );
+                CleanupStack::PopAndDestroy(); //rep
+                //if "Always ask", check the roam or home
+                // if snap dont allow silent connections at all in"always ask"
+                if(Snap)//Check also for roaming n/w IAP as d.c case
+                    {
+                    //Check the general settings                
+                    if(ECmCellularDataUsageConfirm ==  currentmode)
+                        {
+                        //As silent session fails in roam or home with snap, then dont go for silent sessions .
+                        iExtPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourDefault  );
+                        }
+                    else
+                        {
+                        iExtPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent );
+                        }
+                    }
+                else //IAP as d.c
+                    {
+
+                    //dont set any preference, as this leads to fail  
+                    //else //home n/w or roam n/w with automatic or WLAN only
+                    TBool roaming = EFalse;
+                    IsRoamingL(roaming);
+                    if(ECmCellularDataUsageConfirm ==  currentmode && roaming)
+                        {
+                        //No silent connection preference, as this leads to failure of connection
+                        iExtPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourDefault  );
+                        }
+                    else
+                        iExtPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent );
+                    }
+                RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,KErrNone);
+                }
+            }
         }
     else
         {
-        iPref.SetIapId( iIAPid );
-        iPref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
+        iExtPrefs.SetIapId(iIAPid);
+        iExtPrefs.SetConnSelectionDialog(EFalse);
+        if(iDmjob)
+            {
+            TInt val = KErrNotFound;
+            TInt r2=RProperty::Get(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,val);
+			DBG_FILE_CODE( r2, _S8("CNSmlDialUpAgent::DoSettingsL IAP KNSmlDMSilentJob set error code") );
+            if(val == ESilent) //silent session
+               {
+                //Check the cenrep key
+                TInt currentmode = KErrNone;
+                CRepository* rep = CRepository::NewLC( KCRUidCmManager );
+                rep->Get(KCurrentCellularDataUsage, currentmode );
+                CleanupStack::PopAndDestroy(); //rep          
+                TBool roaming = EFalse;
+                IsRoamingL(roaming);  
+                if(ECmCellularDataUsageConfirm ==  currentmode && roaming )
+                    {
+                    //As silent session fails in roam or home with snap, then dont go for silent sessions .
+                    iExtPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourDefault  );
+                    }
+                else
+                    {
+                    iExtPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent );
+                    }
+               }
+            }
+        RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,KErrNone);
         }
+    iPrefList.AppendL(&iExtPrefs);
+
     }
 //----------------------------------------------------------
 //CNsmlDialUpAgent::IsOfflineModeL()
+//------------------------------------------------------------	
 TBool CNSmlDialUpAgent::IsInOfflineModeL()
     {
     TInt operationsAllowed( ECoreAppUIsNetworkConnectionAllowed );
@@ -422,3 +493,67 @@
 	
     return ( operationsAllowed == ECoreAppUIsNetworkConnectionNotAllowed ) ? ETrue : EFalse;
     }
+
+//------------------------------------------------------------
+// CNSmlDialUpAgent::IsRoamingL()
+//  Returns roaming network or not
+//------------------------------------------------------------	
+void CNSmlDialUpAgent::IsRoamingL( TBool& aRoaming)
+    {
+     	RTelServer telServer;
+	User::LeaveIfError( telServer.Connect());
+	
+	RTelServer::TPhoneInfo teleinfo;
+	User::LeaveIfError( telServer.GetPhoneInfo( 0, teleinfo ) );
+	
+	RMobilePhone phone;
+	User::LeaveIfError( phone.Open( telServer, teleinfo.iName ) );
+	
+	User::LeaveIfError(phone.Initialise());	
+	
+	RMobilePhone::TMobilePhoneNetworkMode mode;        	        	
+	TInt err = phone.GetCurrentMode( mode );
+	phone.Close();
+	telServer.Close();
+	TInt Bearer = EBearerIdGSM ;
+	if( KErrNone == err )
+		{
+		switch(mode)
+		{
+		case RMobilePhone::ENetworkModeGsm:		
+			{
+			Bearer = EBearerIdGSM; 			
+			break;		
+			}
+		case RMobilePhone::ENetworkModeWcdma:
+			{                		     		
+			Bearer = EBearerIdWCDMA  ;			
+			}	
+		default: 
+			{       			
+			break;
+			}        				
+		}
+	}	
+    RConnectionMonitor monitor;
+    TRequestStatus status;
+    // open RConnectionMonitor object
+    monitor.ConnectL();
+    CleanupClosePushL( monitor );
+    TInt netwStatus(0);
+    monitor.GetIntAttribute( Bearer, 
+            0, 
+            KNetworkRegistration,
+            netwStatus, 
+            status );
+    User::WaitForRequest( status );
+    CleanupStack::PopAndDestroy(); // Destroying monitor
+    if ( status.Int() == KErrNone && netwStatus == ENetworkRegistrationRoaming )
+        {
+        aRoaming = ETrue;
+        }
+    else //home n/w or some other state in n/w
+        {
+        aRoaming = EFalse;
+        }
+}
--- a/syncmlfw/common/http/src/nsmlhttp.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/src/nsmlhttp.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -22,6 +22,7 @@
 #include <DevManInternalCRKeys.h>
 #include <centralrepository.h>
 #include "nsmlprivatepskeys.h"
+#include <nsmlconstants.h>
 
 
 #include "nsmlerror.h"
@@ -81,6 +82,7 @@
 	{
 	// construct shutdown timer
 	DBG_FILE(_S8("CNSmlHTTP::ConstructL BEGIN"));
+	TBool dmjob = EFalse;
 	FeatureManager::InitializeLibL();
 	iShutdown = new (ELeave) CNSmlXptShutdownTimer( this );
 	iShutdown->ConstructL();
@@ -91,6 +93,7 @@
     DBG_FILE_CODE(session, _S8("CNSmlHTTP::ConstructL Current Session is (DM = 2, DS = 1) "));
     if( session == ESyncMLDMSession )//for dm session
        {
+       dmjob = ETrue;
 		TInt dmsessionTimeout = -1;
 		CRepository *rep = NULL;
 		TRAPD( err1, rep = CRepository::NewL( KCRUidDeviceManagementInternalKeys ))
@@ -122,7 +125,7 @@
     RProperty::Get( KPSUidNSmlSOSServerKey, KNSmlSyncJobOngoing, iSession);                       
 	// construct dialup agent
 	iDialUpAgent = new (ELeave) CNSmlDialUpAgent();
-	iDialUpAgent->ConstructL();
+	iDialUpAgent->ConstructL(dmjob);
 
 	iEngineState = ExptIdle;
 	iTimeOut = EFalse;
@@ -143,6 +146,16 @@
             iMaxMsgSize = value;
             }
         }
+    
+    CRepository* rep = CRepository::NewLC(KCRUidNSmlDSEngine);
+    TInt flag(0);
+    TRAPD(err, rep->Get(KNsmlDsDeflateSupport, flag));
+    DBG_FILE_CODE(flag, _S8("Flag value"));
+    if ( err == KErrNone )
+        {
+        iDeflateFlag = flag;
+        }
+    CleanupStack::PopAndDestroy(rep);
 	}
 
 // ---------------------------------------------------------
@@ -565,7 +578,7 @@
 	delete iReqBodySubmitBuffer;
     iReqBodySubmitBuffer = NULL;
 	
-	if( (iSession == ESyncMLDSSession) && (iServerAcceptEncoding == ExptDeflate) )
+	if( (iSession == ESyncMLDSSession) && (iServerAcceptEncoding == ExptDeflate) && iDeflateFlag )
 		{
 		TRAPD( err, CompressL(aStartPtr) );
 		User::LeaveIfError( err );
@@ -1070,13 +1083,13 @@
 	SetHeaderL( hdr, HTTP::EAcceptCharset, KSmlAcceptCharSet );
 	SetHeaderL( hdr, HTTP::EAcceptLanguage , KSmlAcceptLanguage );
 		
-	if( iSession == ESyncMLDSSession )//for ds session
-	  { 
+	if( iSession == ESyncMLDSSession && iDeflateFlag )//for ds session
+	  {
 	  if(iServerAcceptEncoding == ExptDeflate)
-	      {
-	      SetHeaderL( hdr, HTTP::EContentEncoding , KSmlContentDeflate );
-	      }
-	      SetHeaderL( hdr, HTTP::EAcceptEncoding , KSmlContentDeflate );
+          {
+          SetHeaderL( hdr, HTTP::EContentEncoding , KSmlContentDeflate );
+          }
+          SetHeaderL( hdr, HTTP::EAcceptEncoding , KSmlContentDeflate );
 	  }
 
 	// Add headers and body data for methods that use request bodies
@@ -1135,7 +1148,7 @@
 		}
 		else
 		{
-		    if ( (iSession == ESyncMLDSSession) && (iServerContentEncoding == ExptDeflate) )
+		    if ( (iSession == ESyncMLDSSession) && (iServerContentEncoding == ExptDeflate) && iDeflateFlag )
 		        {		    
 		        TRAPD( err, DecompressL( aStartPtr ) );		    
 				User::LeaveIfError( err );
--- a/syncmlfw/common/http/src/nsmlhttpclient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/http/src/nsmlhttpclient.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -19,13 +19,9 @@
 #include "nsmlhttpclient.h"
 #include "nsmlerror.h"
 #include <featmgr.h>
-#include <nsmloperatorerrorcrkeys.h>
-#include <nsmloperatordatacrkeys.h> // KCRUidOperatorDatasyncInternalKeys
+#include "NsmlOperatorErrorCRKeys.h"
 #include <centralrepository.h> 
 
-//CONSTANTS
-const TInt KErrorCodeRangeFirst = 400;
-const TInt KErrorCodeRangeLast = 516;
 
 //Fix to Remove the Bad Compiler Warnings
 #ifndef __WINS__
@@ -55,14 +51,6 @@
 	{
 	FeatureManager::InitializeLibL();
 	iAgent = aAgent;
- 
-    CRepository* rep = NULL;
-    rep = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys );
-    CleanupStack::PushL( rep );
-    rep->Get( KNsmlOpDsHttpErrorReporting, iErrorReportingEnabled );
-    CleanupStack::PopAndDestroy( rep );
- 
-    iRepositorySSC = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
 	}
 //------------------------------------------------------------
 // CHttpEventHandler::~CHttpEventHandler()
@@ -70,8 +58,7 @@
 //------------------------------------------------------------
 CHttpEventHandler::~CHttpEventHandler()
 	{
-    FeatureManager::UnInitializeLib();		
-    delete iRepositorySSC;
+		FeatureManager::UnInitializeLib();
 	}
 //------------------------------------------------------------
 // CHttpEventHandler::NewLC()
@@ -139,25 +126,27 @@
 			if ( contentTypeStr != KSmlContentTypeDS 
 				&& contentTypeStr != KSmlContentTypeDM )
 				{
-                if( this->iAgent->iSession == ESyncMLDSSession )
-                    {
-                    if( iErrorReportingEnabled && ( ( status >= KErrorCodeRangeFirst ) 
-                            && ( status <= KErrorCodeRangeLast ) ) )
-                        {
-                        iRepositorySSC->Set( KNsmlOpDsSyncErrorCode, status );
-                        }
-                    }  
-
 				//Error fix for BPSS-7H7H5S				
 				DBG_FILE( _S8("CHttpEventHandler::MHFRunL() There is a mismatch in the Content Type") );
 				
 				status = CNSmlHTTP::SetErrorStatus( status );
 				
 				if (status == resp.StatusCode() )
-				{
-					DBG_FILE( _S8("Error in Communication string is set"));
-					status = TNSmlError::ESmlCommunicationInterrupted;
-				}
+				    {
+                    if( this->iAgent->iSession == ESyncMLDSSession )
+                        {
+                        CRepository* rep = NULL;
+                        TRAPD ( err, rep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) );
+                        if ( err == KErrNone )
+                            {
+                            rep->Set( KNsmlOpDsErrorCode, status );
+                            delete rep;
+                            }
+                        }  
+
+                    DBG_FILE( _S8("Error in Communication string is set"));
+                    status = TNSmlError::ESmlCommunicationInterrupted;
+				    }
 					
 				// content mismatch
 				aTransaction.Close();
@@ -166,32 +155,31 @@
 				break;
 				}
 
-			if(this->iAgent->iSession == ESyncMLDSSession)
+			if(this->iAgent->iSession == ESyncMLDSSession && this->iAgent->iDeflateFlag )
 			    {
-    	         RStringF serverContentEncoding = strPool.OpenFStringL( KSmlContentEncodingType );
-    	         THTTPHdrVal serverContentEncodingValue;
-    	         if(hdr.GetField( serverContentEncoding, 0, serverContentEncodingValue ) != KErrNotFound)	         
-    	             {
-        	         RStringF fieldServerContentEncodingValStr = strPool.StringF( serverContentEncodingValue.StrF() ); 
-        	         const TDesC8& serverContentEncodingStr = fieldServerContentEncodingValStr.DesC();
-        	         if( serverContentEncodingStr == KSmlContentDeflate)
-        	             {
-        	             this->iAgent->iServerContentEncoding = CNSmlHTTP::ExptDeflate;
-        	             }
-    	             }
-    
-    			 RStringF serverAcceptEncoding = strPool.OpenFStringL( KSmlAcceptEncodingType );
-    	         THTTPHdrVal serverAcceptEncodingValue;
-    	         if(hdr.GetField( serverAcceptEncoding, 0, serverAcceptEncodingValue )  != KErrNotFound )	         
-    	             {
-        	         RStringF fieldServerAcceptEncodingValStr = strPool.StringF( serverAcceptEncodingValue.StrF() ); 
-        	         const TDesC8& serverAcceptEncodingStr = fieldServerAcceptEncodingValStr.DesC();
-        	         if( serverAcceptEncodingStr.Find(KSmlContentDeflate) != KErrNotFound)
-        	             {
-        	             this->iAgent->iServerAcceptEncoding = CNSmlHTTP::ExptDeflate;
-        	             }
-    	             }
-			    }
+			    RStringF serverContentEncoding = strPool.OpenFStringL( KSmlContentEncodingType );
+                THTTPHdrVal serverContentEncodingValue;
+                if(hdr.GetField( serverContentEncoding, 0, serverContentEncodingValue ) != KErrNotFound)	         
+                    {
+                    RStringF fieldServerContentEncodingValStr = strPool.StringF( serverContentEncodingValue.StrF() ); 
+                    const TDesC8& serverContentEncodingStr = fieldServerContentEncodingValStr.DesC();
+                    if( serverContentEncodingStr == KSmlContentDeflate)
+                        {
+                        this->iAgent->iServerContentEncoding = CNSmlHTTP::ExptDeflate;
+                        }
+                    }
+                RStringF serverAcceptEncoding = strPool.OpenFStringL( KSmlAcceptEncodingType );
+                THTTPHdrVal serverAcceptEncodingValue;
+                if(hdr.GetField( serverAcceptEncoding, 0, serverAcceptEncodingValue )  != KErrNotFound )	         
+                    {
+                    RStringF fieldServerAcceptEncodingValStr = strPool.StringF( serverAcceptEncodingValue.StrF() ); 
+                    const TDesC8& serverAcceptEncodingStr = fieldServerAcceptEncodingValStr.DesC();
+                    if( serverAcceptEncodingStr.Find(KSmlContentDeflate) != KErrNotFound)
+                        {
+                        this->iAgent->iServerAcceptEncoding = CNSmlHTTP::ExptDeflate;
+                        }
+                    }
+    		    }
 			
 			if ( status == 200 )
 				{
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/common/inc/nsmloperatordefines.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2007 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:  Operator specific defenitions
+*
+*/
+
+#ifndef NSMLOPERATORDEFINES_H_
+#define NSMLOPERATORDEFINES_H_
+
+//CONSTANTS
+#define KBufferLength 256
+
+_LIT(KSpace," ");
+
+const TUid KNsmlOperatorCenrepUID = {0x2002682E};
+
+const TInt KNsmlOperatorProfileServerId = 0x01;
+const TInt KNsmlExtendedServerStatusCodeList = 0x02;
+const TInt KNsmlExtendedServerStatusCode = 0x03;
+const TInt KNsmlOperatorDevInfExtXNam = 0x04;
+const TInt KNsmlOperatorDevInfExtXVal = 0x05;
+
+#endif //NSMLOPERATORDEFINES_H_ 
+
+// End of File
--- a/syncmlfw/common/obex/obexclient/bld/nsmlobexclient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/bld/nsmlobexclient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -49,7 +49,7 @@
 
 MW_LAYER_SYSTEMINCLUDE
 
-SYSTEMINCLUDE   /epoc32/include/libc /epoc32/include/ecom 
+SYSTEMINCLUDE   /epoc32/include/libc /epoc32/include/ecom ../inc ../../../transport/inc
 
 USERINCLUDE     ../inc ../../../inc ../../../transport/inc ../../../wbxml/inc ../../../wbxml/inc/syncml ../../../syncagent/inc  ../../../xml/inc
 USERINCLUDE     ../../../debug/inc
--- a/syncmlfw/common/obex/obexclient/inc/Btobexsearcher.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/inc/Btobexsearcher.h	Wed Sep 01 12:27:42 2010 +0100
@@ -68,6 +68,7 @@
 		CObexClient* CreateObexClientL();
 
         void RunL();
+        
         TInt RunError(TInt aError);
 
         void DoCancel();
@@ -123,7 +124,7 @@
 
         TPckgBuf<TBool> iOffline;
 
- //       RNotifier iNotifier;
+        RNotifier iNotifier;
 
         CBTEngSettings* iSettings;
     };
--- a/syncmlfw/common/obex/obexclient/inc/Irdaobexsearcher.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/inc/Irdaobexsearcher.h	Wed Sep 01 12:27:42 2010 +0100
@@ -62,6 +62,7 @@
     protected: // Functions from base classes
 
         void RunL();
+        
         TInt RunError(TInt aError);
 
         void DoCancel();
--- a/syncmlfw/common/obex/obexclient/inc/NSmlBTServiceSearcher.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/inc/NSmlBTServiceSearcher.h	Wed Sep 01 12:27:42 2010 +0100
@@ -82,7 +82,7 @@
 private:
     TRequestStatus* iStatusObserver;    
     TBool iIsDeviceSelectorConnected;
-//    RNotifier iDeviceSelector;
+    RNotifier iDeviceSelector;
     TBTDeviceResponseParamsPckg iResponse;
     CSdpAgent* iAgent;
     CSdpSearchPattern* iSdpSearchPattern;
--- a/syncmlfw/common/obex/obexclient/src/Btobexsearcher.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/src/Btobexsearcher.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -80,11 +80,10 @@
 	Cancel();
     delete iServiceSearcher;
     delete iSettings;   
-/*    if ( iNotifier.Handle() )
+    if ( iNotifier.Handle() )
         {
         iNotifier.Close();
         }
-*/        
     }
 
 //----------------------------------------------------------------------------
@@ -138,11 +137,10 @@
                 {
                 if( iWaitingForBTPower && iOffline() != EFalse )
                     {
- /*                   if ( iNotifier.Handle() )
+                    if ( iNotifier.Handle() )
 				        {
 				        iNotifier.Close();
 				        }
- */
                     TInt err = iSettings->ChangePowerStateTemporarily( );
                     if( err )
                         {
@@ -180,13 +178,14 @@
 			}
 		}
 	}
+
 // ----------------------------------------------------------------------------
 // CBTObexSearcher::RunError
 // ----------------------------------------------------------------------------
 TInt CBTObexSearcher::RunError ( TInt /*aError*/ )
     {
         return KErrNone;
-	}
+    }	
 
 //----------------------------------------------------------------------------
 // CBTObexSearcher::DoCancel()
@@ -302,14 +301,13 @@
     if( offline == ECoreAppUIsNetworkConnectionNotAllowed && 
          offlineAllowed == EBTEnabledInOfflineMode )
         {
-/*        User::LeaveIfError( iNotifier.Connect() );
+        User::LeaveIfError( iNotifier.Connect() );
         TBTGenericQueryNotiferParamsPckg pckg;
         pckg().iMessageType = EBTActivateOffLineQuery;
         pckg().iNameExists = EFalse;
         iNotifier.StartNotifierAndGetResponse( iStatus, KBTGenericQueryNotifierUid, 
                                                 pckg, iOffline );
         SetActive();
-*/        
         }
     else if( offline == ECoreAppUIsNetworkConnectionNotAllowed && 
             offlineAllowed == EBTDisabledInOfflineMode )
--- a/syncmlfw/common/obex/obexclient/src/Irdaobexsearcher.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/src/Irdaobexsearcher.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -189,10 +189,15 @@
 		}
 	}
 
+// ----------------------------------------------------------------------------
+// CIrDAObexSearcher::RunError
+// ----------------------------------------------------------------------------
 TInt CIrDAObexSearcher::RunError ( TInt /*aError*/ )
     {
         return KErrNone;
     }	
+
+
 //----------------------------------------------------------------------------
 // CIrDAObexSearcher::DoCancel()
 //----------------------------------------------------------------------------
--- a/syncmlfw/common/obex/obexclient/src/NSmlBTServiceSearcher.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/src/NSmlBTServiceSearcher.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -38,9 +38,8 @@
     {
     if( iIsDeviceSelectorConnected )
         {
-/*        iDeviceSelector.CancelNotifier( KDeviceSelectionNotifierUid );
+        iDeviceSelector.CancelNotifier( KDeviceSelectionNotifierUid );
         iDeviceSelector.Close();
- */       
         }
 	Finished();
     delete iSdpSearchPattern;
@@ -56,10 +55,8 @@
     {
      if( !iIsDeviceSelectorConnected )
         {
- /*       	
         User::LeaveIfError( iDeviceSelector.Connect() );
         iIsDeviceSelectorConnected = ETrue;
-*/        
         }
 
     //  Request a device selection 
@@ -72,11 +69,11 @@
 
 	pckg().SetUUID( iBTConnInfo.iServiceClass );
 
-//    iDeviceSelector.StartNotifierAndGetResponse(
-//         aObserverRequestStatus, 
-//         KDeviceSelectionNotifierUid, 
-//         /*selectionFilter*/pckg, 
-//         iResponse);
+    iDeviceSelector.StartNotifierAndGetResponse(
+         aObserverRequestStatus, 
+         KDeviceSelectionNotifierUid, 
+         /*selectionFilter*/pckg, 
+         iResponse);
 
 
     }
--- a/syncmlfw/common/obex/obexclient/src/NSmlObexClient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/obex/obexclient/src/NSmlObexClient.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -180,11 +180,15 @@
         }
     }
 
+// ----------------------------------------------------------------------------
+// CNsmlObexClient::RunError
+// ----------------------------------------------------------------------------
 TInt CNsmlObexClient::RunError ( TInt aError )
     {
     DBG_FILE_CODE(aError, _S8("CNsmlObexClient::RunError() The Error occurred is "));
     return KErrNone;
     }	
+    
 //------------------------------------------------------------
 // CNsmlObexClient::ConnectL( TNSmlObexTransport aTransport, TBool /*aServerAlerted*/, TDesC8& aMimeType, TRequestStatus &aStatus )
 //------------------------------------------------------------
--- a/syncmlfw/common/sosserver/bld/nsmlsosserver.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/bld/nsmlsosserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -31,11 +31,6 @@
 SYSTEMINCLUDE   /epoc32/include/ecom 
 SYSTEMINCLUDE   /epoc32/include/syncml
 SYSTEMINCLUDE   /epoc32/include/connect
-
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbcore
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbwidgets
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbtools
-   
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE		/epoc32/include/platform/mw/connect
 #endif
@@ -79,7 +74,7 @@
 SOURCE      	NSmlJobObject.cpp
 
 LIBRARY     	euser.lib estor.lib ecom.lib bafl.lib efsrv.lib nsmldebug.lib edbms.lib
-LIBRARY     	NSmlDSSettings.lib 
+LIBRARY     	nsmldssettings.lib 
 LIBRARY     	nsmldmsettings.lib 
 LIBRARY			nsmltransport.lib
 LIBRARY     	nsmltransporthandler.lib
@@ -89,8 +84,8 @@
 LIBRARY		syncmldatafilter.lib
 LIBRARY		nsmlagentlog.lib
 LIBRARY		policyengine.lib
-LIBRARY		abclient.lib dmdevdialogclient.lib
+LIBRARY		abclient.lib
 LIBRARY     centralrepository.lib //tarm
-LIBRARY                 featmgr.lib flogger.lib 
+LIBRARY                 featmgr.lib
 
 SMPSAFE
--- a/syncmlfw/common/sosserver/inc/PnpLogger.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
-* ==============================================================================
-*  Name        : PnpLogger.h
-*  Part of     : PnpProvisioningApp
-*  Description : This file defines logging interface macros
-*  Version     :
-*
-*  Copyright (c) 2004 Nokia Corporation.
-*  This material, including documentation and any related 
-*  computer programs, is protected by copyright controlled by 
-*  Nokia Corporation. All rights are reserved. Copying, 
-*  including reproducing, storing, adapting or translating, any 
-*  or all of this material requires the prior written consent of 
-*  Nokia Corporation. This material also contains confidential 
-*  information which may not be disclosed to others without the 
-*  prior written consent of Nokia Corporation.
-* ==============================================================================
-*/
-
-#ifndef __LOGGER_H__
-#define __LOGGER_H__
-
-#ifdef _DEBUG
-    #define LOGGING_ENABLED
-#endif
-#ifdef LOGGING_ENABLED          // This must be enabled to use logging system
-
-#define LOGGER_LOGGING          // Log to Logger
-
-
-
-#ifdef LOGGER_LOGGING
-
-//  INCLUDES
-#include <flogger.h>
-
-// LOG SETTINGS 
-_LIT( KPnpLogFolder, "syncml" );
-_LIT( KPnpLogFile, "syncml.TXT" );
-
-#endif
-
-// CONSTANTS  
-// None.
-
-// MACROS
-/*
------------------------------------------------------------------------------
-
-    INTERNAL MACROs. 
-
-    DO NOT USE THESE DIRECTLY !!! 
-    SEE EXTERNAL MACROS
-
------------------------------------------------------------------------------
-*/
-
-#ifdef LOGGER_LOGGING
-
-#define INTRLOGTEXT( AAA )                                                                        \
-    {                                                                                            \
-    RFileLogger::Write( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, AAA );            \
-    }
-#define INTRLOGSTRING( AAA )                                                                    \
-    {                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                    \
-    RFileLogger::Write( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, tempLogDes() ); \
-    }
-#define INTRLOGSTRING2( AAA, BBB )                                                                \
-    {                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                    \
-    RFileLogger::WriteFormat( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB ); \
-    }
-#define INTRLOGSTRING3( AAA, BBB, CCC )                                                            \
-    {                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                    \
-    RFileLogger::WriteFormat( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB, CCC ); \
-    }
-#else
-#define INTRLOGTEXT( AAA )
-#define INTRLOGSTRING( AAA )
-#define INTRLOGSTRING2( AAA, BBB )
-#define INTRLOGSTRING3( AAA, BBB, CCC )
-#endif
-
-/*
------------------------------------------------------------------------------
-
-    EXTERNAL MACROs
-
-    USE THESE MACROS IN YOUR CODE !
-
------------------------------------------------------------------------------
-*/
-
-
-#define LOGTEXT( AAA )                { \
-                                    INTRLOGTEXT( AAA ); \
-                                    }   // Example: LOGTEXT( own_desc );
-
-#define LOGSTRING( AAA )            { \
-                                    INTRLOGSTRING( AAA ); \
-                                    }   // Example: LOGSTRING( "Test" );
-
-#define LOGSTRING2( AAA, BBB )        { \
-                                    INTRLOGSTRING2( AAA, BBB ); \
-                                    }  // Example: LOGSTRING( "Test %i", aValue );
-
-#define LOGSTRING3( AAA, BBB, CCC )    { \
-                                    INTRLOGSTRING3( AAA, BBB, CCC ); \
-                                    } // Example: LOGSTRING( "Test %i %i", aValue1, aValue2 );
-
-
-#else   // LOGGING_ENABLED
-
-#define LOGTEXT( AAA ) 
-#define LOGSTRING( AAA ) 
-#define LOGSTRING2( AAA, BBB )    
-#define LOGSTRING3( AAA, BBB, CCC )    
-
-#endif  // LOGGING_ENABLED
-
-// DATA TYPES
-// None.
-
-// FUNCTION PROTOTYPES
-// None.
-
-// FORWARD DECLARATIONS
-// None.
-
-// CLASS DECLARATION
-// None.
-
-#endif  // __LOGGER_H__
\ No newline at end of file
--- a/syncmlfw/common/sosserver/inc/nsmlsosthread.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/inc/nsmlsosthread.h	Wed Sep 01 12:27:42 2010 +0100
@@ -19,13 +19,10 @@
 #ifndef __NSMLTHREADSTART_H__
 #define __NSMLTHREADSTART_H__
 
-#include <devicedialogsymbian.h>
-#include <dmdevdialogclient.h>
-#include <hbdevicedialogsymbian.h>
-#include <hbsymbianvariant.h>
+#include <SyncMLNotifierParams.h>
+#include <SyncMLNotifier.h>
 #include "nsmlsosserver.h"
 
-
 class CNSmlJob;
 class CNSmlNotifierObserver;
 class CNSmlNotifierTimeOut;
@@ -92,7 +89,7 @@
 		
 		void StartJobSessionL();
 		void CancelJob();
-		TInt VerifyJobFromNotifierL(TBool aServerInitiated);
+		TInt VerifyJobFromNotifierL();
 		
 		TInt FinishedStatus() 
 			{
@@ -125,12 +122,14 @@
 		
 		//used for server alert initiated job
 		RTimer iTimeout;
-//    	RNotifier iNotifier;
+    	RNotifier iNotifier;
     	CNSmlNotifierObserver* iNotifierObserver;
     	RLibrary iSessionLib;
     	CNSmlDMAgent* iDMAgent;		
 		CNSmlDSAgent* iDSAgent;	
 		CNSmlCancelTimeOut* iCancelTimeout;
+		// Fix for cancel not happening when cancel key is pressed 
+		TBool iSyncCancelled;
 	};
 
 
@@ -185,26 +184,18 @@
 		~CNSmlNotifierObserver();
 		void ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam );
 		void NotifierTimeOut();
-		TBool IsHbSyncmlNotifierEnabledL();
-		void HbNotifierObserverL(const TSyncMLAppLaunchNotifParams& aParam);
 	protected:
 		void DoCancel();
 		void RunL();
 	private:
 		TRequestStatus& iCallerStatus;
 		
-//		RNotifier iNotifier;
-		TPckgBuf<TInt> iResBuf;
+		RNotifier iNotifier;
+		TSyncMLAppLaunchNotifRetValPckg iResBuf;
 	
 		CNSmlThreadParams& iThreadParams;
 		CNSmlNotifierTimeOut iNotifierTimeOut;
 		TBool iTimeOut;
-
-		CHbDeviceDialogSymbian* iDevDialog;
-            RProperty iProperty;
-            TBool iHbSyncmlNotifierEnabled;
-           RDmDevDialog iDmDevdialog;
-
 	};
 	
 
--- a/syncmlfw/common/sosserver/src/NSmlSOSBackup.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/src/NSmlSOSBackup.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -126,11 +126,15 @@
     _DBG_FILE("CNSmlSOSBackup::RunL() : End");
     }
 
+// ----------------------------------------------------------------------------
+// CNSmlSOSBackup::RunError
+// ----------------------------------------------------------------------------
 TInt CNSmlSOSBackup::RunError ( TInt aError )
     {
     DBG_FILE_CODE(aError, _S8("CNSmlSOSBackup::RunError() The Error occurred is "));
     return KErrNone;
     }	
+    
 // --------------------------------------------------------------------------
 // void CNSmlSOSBackup::DoCancel()
 // --------------------------------------------------------------------------
--- a/syncmlfw/common/sosserver/src/NSmlTask.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/src/NSmlTask.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -378,7 +378,8 @@
 			RReadStream filterStream = ctype->FilterReadStreamL();
 			CleanupClosePushL( filterStream );
 			RPointerArray<CSyncMLFilter>* filterArray = new ( ELeave ) RPointerArray<CSyncMLFilter>();
-			CleanupStack::PushL( filterArray );
+			CleanupRPtrArrayPushL(filterArray);
+
 			TInt count(0);
 			TRAPD(error, count = filterStream.ReadInt32L() );
 			if ( error == KErrNone )
@@ -391,11 +392,9 @@
 				}
 			else if ( prof->IntValue( EDSProfileProtocolVersion ) == ESmlVersion1_2 )
 				{
-				CleanupStack::Pop(); // filterArray;
-				filterArray->ResetAndDestroy();
-				delete filterArray;
+                CleanupStack::PopAndDestroy(filterArray); 
 				filterArray = iSession.HostClient().SupportedServerFiltersL( iTaskUID, matchType, changeInfo, resultCode );				
-				CleanupStack::PushL( filterArray );
+				CleanupRPtrArrayPushL(filterArray);
 				}
 		    
 			iSession.HostClient().CheckServerFiltersL( iTaskUID, *filterArray, changeInfo, resultCode );
@@ -435,8 +434,7 @@
 				
             CleanupStack::PopAndDestroy(agentLog);
             
-            filterArray->ResetAndDestroy();            
-			CleanupStack::PopAndDestroy(filterArray);            	
+            CleanupStack::PopAndDestroy(filterArray);            	
             CleanupStack::PopAndDestroy(&filterStream);            
             }
         else
--- a/syncmlfw/common/sosserver/src/nsmlsoshandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/src/nsmlsoshandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -813,19 +813,26 @@
     CNSmlDMSettings* settings = CNSmlDMSettings::NewLC();
     CNSmlDMProfile* prof = settings->ProfileL( iCurrentJob->ProfileId() );
     if(prof)
-    	{
-      	CleanupStack::PushL( prof );    
-    		if ( iCurrentJob->iPending || prof->IntValue( EDMProfileHidden ))
         {
-        	syncInit = EServerAlerted;
+        CleanupStack::PushL( prof );
+	    }
+    
+    if ( iCurrentJob->iPending || prof->IntValue( EDMProfileHidden ))
+        {
+        syncInit = EServerAlerted;
         }
 
-    		if ( !iCurrentJob->TransportId() )
-        {        
-           iCurrentJob->SetTransportId( prof->IntValue( EDMProfileTransportId ) );
+    if ( !iCurrentJob->TransportId() )
+        {
+        if ( prof )
+            {
+            iCurrentJob->SetTransportId( prof->IntValue( EDMProfileTransportId ) );
+            }
         }
+    if(prof)
+        {
         CleanupStack::PopAndDestroy( prof );
-      }
+        }
     CleanupStack::PopAndDestroy( settings );
  
 
--- a/syncmlfw/common/sosserver/src/nsmlsossession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/src/nsmlsossession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -461,7 +461,6 @@
     if ( !iDMAuthInfo )
         {
         aMessage.Complete( KErrNotFound );
-         _DBG_FILE("CNSmlSOSSession::GetDMAuthInfoL(): iDMAuthInfo is NULL");
         return;
         }
     aMessage.WriteL( 0, iDMAuthInfo->Ptr(0), 0 );
@@ -2236,16 +2235,16 @@
             break;               
             };
         
-	   	        
-        if ( iHandler->CompleteBufProgressMsg( *buf, this )) // if owner not found do not remove from buffer
-            {
-            iProgressEventBuffer.Remove(0);        
-            }  
-            
-        delete buf;
-        buf = NULL;   
-        
-        
+	   	if ( buf )  
+	   	    { 
+                if ( iHandler->CompleteBufProgressMsg( *buf, this )) // if owner not found do not remove from buffer
+                    {
+                    iProgressEventBuffer.Remove(0);        
+                    }  
+                    
+                delete buf;
+                buf = NULL; 
+	   	    }   
         }
     
     if ( !mutexError )
@@ -2310,14 +2309,16 @@
             iProgressEventBuffer.Remove(0);        
             }  
         */
-		if ( iHandler->CompleteBufContactSuiteProgressMsg( *buf, this )) // if owner not found do not remove from buffer
-            {
-            iContactSuiteProgressEventBuffer.Remove(0);        
-            }  
+        if ( buf ) 
+          {     
+            if ( iHandler->CompleteBufContactSuiteProgressMsg( *buf, this )) // if owner not found do not remove from buffer
+                {
+                    iContactSuiteProgressEventBuffer.Remove(0);        
+                }  
 
-        delete buf;
-        buf = NULL;   
-        
+            delete buf;
+            buf = NULL;   
+          } 
         
         }
     
--- a/syncmlfw/common/sosserver/src/nsmlsosthread.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver/src/nsmlsosthread.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -19,7 +19,7 @@
 #include <DevManInternalCRKeys.h>
 #include <centralrepository.h>
 #include <nsmldebug.h>
-#include "PnpLogger.h"
+
 #include "nsmlsosthread.h"
 #include <DataSyncInternalPSKeys.h>
 
@@ -27,27 +27,6 @@
 #include <centralrepository.h>
 #include "PMUtilInternalCRKeys.h"
 #include <featmgr.h>
-#include <e32property.h>
-#include <DevManInternalCRKeys.h>
-#include <nsmldmconst.h>
-
-
-enum TSyncmlHbNotifierKeys 
-		{
-
-     EHbSOSNotifierKeyStatus = 11, // status set will complete the client subscribe
-     EHbSOSNotifierKeyStatusReturn = 12, // Return the content of actual status value accepted from UI
-     
-     EHbDMSyncNotifierKeyStatus = 13,
-     EHbDMSyncNotifierKeyStatusReturn = 14
-		};
-		
- TUid sosserverpsuid =
-           {
-           0x101F99FB
-           };
-    	  
-  
 // --------------------------------------------------------------------------
 // EXPORT_C TInt ThreadFunction( TAny* )
 // --------------------------------------------------------------------------
@@ -91,7 +70,7 @@
 			{
 			//if not a silent mode behave as in a normal DM session
 			threadEngine->ForcedCertificateCheckL( EFalse );
-			threadEngine->VerifyJobFromNotifierL(ETrue);		
+			threadEngine->VerifyJobFromNotifierL();		
 			}
 		}
 	else
@@ -121,8 +100,7 @@
 	        CActiveScheduler::Start();                
 	        }	    
 	    }	
-	LOGSTRING("P&S is deleted");  
-	RProperty::Delete(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob);
+	
 	delete scheduler;
 	
 	if ( endStatus == KErrNone )
@@ -169,7 +147,9 @@
 		FeatureManager::InitializeLibL();
 	iThreadParams.iThreadEngine = this;
 	iContentArray = new(ELeave) CArrayFixFlat<TNSmlContentSpecificSyncType>(1);
-	
+	// Fix for cancel not happening when cancel key is
+	// pressed .
+	iSyncCancelled = EFalse;
 	if ( iThreadParams.iCSArray )
 		{
 		for (TInt i = 0; i < iThreadParams.iCSArray->Count(); i++)
@@ -359,11 +339,63 @@
 	TInt status( KErrNone );			
 	if ( iThreadParams.iCurrentJob.UsageType() == ESmlDevMan )
 		{
+		CRepository* centrep = NULL;
+		TRAPD( err, centrep = CRepository::NewL(KCRUidDeviceManagementInternalKeys));  
+		TInt phoneLock(0);
+		TInt factoryProfileID(0);
+		if (err==KErrNone ) 
+		{
+			TInt err = centrep->Get( KLAWMOPhoneLock , phoneLock );
+			err = centrep->Get( KLAWMOfactoryDmProfileID , factoryProfileID );
+			delete centrep;
+			centrep = NULL;
+		}
+		if(phoneLock != 30)
+		{
+			_DBG_FILE("CNSmlThreadEngine phonelock != 30");
+			if(factoryProfileID>0)   
+			{   
+
+				TInt profileId = iThreadParams.iCurrentJob.ProfileId();    
+	
+				if(profileId!= factoryProfileID) 
+					{
+					   _DBG_FILE("CNSmlThreadEngine profid doesnt match with factory");
+					   TRequestStatus* stat = &iStatus;
+					   User::RequestComplete( stat, KErrNone );
+					   return;
+					}   
+			
+			}
+			else
+				{
+				    _DBG_FILE("CNSmlThreadEngine factoryprofileid<0");
+				    TRequestStatus* stat = &iStatus;
+					User::RequestComplete( stat, KErrNone );
+					return;	
+				}
+		}
+		_DBG_FILE("CNSmlThreadEngine startDMSessionL");
 		TRAP( status, StartDMSessionL() );
 		}
 	else
 		{
-		TRAP( status, StartDSSessionL() );	
+		// Scenario 1:
+		// Fix for cancel not happening when cancel key is
+		// pressed .
+        if(!iSyncCancelled)
+            {
+            TRAP( status, StartDSSessionL() );	
+            }
+        else
+            {
+			// Sync is cancelled from the UI before the
+			// the job session has started.
+			// Fix for cancel not happening when cancel key is
+			// pressed .
+            status = KErrCancel;
+            iSyncCancelled = EFalse;
+            }
 		}
 	
 	if ( status != KErrNone )
@@ -381,6 +413,11 @@
 //
 void CNSmlThreadEngine::CancelJob()
 	{
+	// Fix for cancel not happening when cancel key is
+	// pressed .
+    // job has been created but it is not running and from ui
+    // Cancel has been called
+    iSyncCancelled = ETrue;
 	if ( iCancelTimeout )
 	    {
 		iCancelTimeout->SetJobCancelled( iThreadParams.iCurrentJob.UsageType() );
@@ -431,7 +468,15 @@
 	
 	// Select correct sync method and start sync
 	TNSmlSyncInitiation syncInit = (TNSmlSyncInitiation)iThreadParams.iSyncInit;
-	
+	// Scenario 2:
+	// Fix for cancel not happening when cancel key is
+	// pressed .
+	if(iSyncCancelled)
+	    {
+	    iSyncCancelled = EFalse;
+        User::Leave( KErrCancel );
+	    }
+
     switch ( iThreadParams.iCurrentJob.JobType() )
         {
         case EDSJobProfile:
@@ -468,24 +513,19 @@
 // Launches notifier and waits for 
 // --------------------------------------------------------------------------
 //
-TInt CNSmlThreadEngine::VerifyJobFromNotifierL(TBool aServerInitiated)
-    {
-    LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL()");
-    LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL() : Begin");
-    LOGSTRING2("VerifyJobFromNotifierL before iCallerStatus == iStatus in Threadengine %d", iStatus.Int());
-    iNotifierObserver = new (ELeave) CNSmlNotifierObserver(iStatus,
-            iThreadParams);
-    SetActive();
-    LOGSTRING2("VerifyJobFromNotifierL before iCallerStatus == iStatus in Threadengine %d after setactive", iStatus.Int());
-    TSyncMLAppLaunchNotifParams params;
-    params.iSessionType = (iThreadParams.iCurrentJob.UsageType()
-            == ESmlDataSync) ? ESyncMLSyncSession : ESyncMLMgmtSession;
-    params.iJobId = iThreadParams.iCurrentJob.JobId();
-    params.iProfileId = iThreadParams.iCurrentJob.ProfileId();
-    params.iUimode = iThreadParams.iCurrentJob.iUimode;
-    iNotifierObserver->ConnectToNotifierL(params);
-    LOGSTRING2("iCallerStatus in iNotifierObserver->ConnectToNotifierL( params ); %d", iStatus.Int());
-    LOGSTRING("CNSmlThreadEngine::VerifyJobFromNotifierL() : End");
+TInt CNSmlThreadEngine::VerifyJobFromNotifierL()
+	{
+	_DBG_FILE("CNSmlThreadEngine::VerifyJobFromNotifierL() : Begin");
+	iNotifierObserver = new (ELeave) CNSmlNotifierObserver(iStatus, iThreadParams);
+	SetActive();
+	
+	TSyncMLAppLaunchNotifParams params;
+	params.iSessionType = ( iThreadParams.iCurrentJob.UsageType() == ESmlDataSync ) ? ESyncMLSyncSession : ESyncMLMgmtSession;
+	params.iJobId = iThreadParams.iCurrentJob.JobId();
+	params.iProfileId = iThreadParams.iCurrentJob.ProfileId();
+    params.iUimode = iThreadParams.iCurrentJob.iUimode;	
+	iNotifierObserver->ConnectToNotifierL( params );
+	_DBG_FILE("CNSmlThreadEngine::VerifyJobFromNotifierL() : End");
     return KErrNone;
 	}
 
@@ -784,20 +824,11 @@
 // Constructor
 // --------------------------------------------------------------------------
 //	
-CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus,
-        CNSmlThreadParams& aParams) :
-    CActive(0), iCallerStatus(aStatus), iThreadParams(aParams)
-    {
-    LOGSTRING2("iCallerStatus in RunL %d", iCallerStatus.Int());
-    // If the current job is DM job then proceed to use Hb Notifiers
-    
-    if(aParams.iCurrentJob.UsageType() == ESmlDevMan)
-        {    
-        TRAP_IGNORE(iHbSyncmlNotifierEnabled = IsHbSyncmlNotifierEnabledL());
-        }
-    
-    CActiveScheduler::Add(this);
-    }
+CNSmlNotifierObserver::CNSmlNotifierObserver(TRequestStatus& aStatus, CNSmlThreadParams& aParams)
+: CActive(0), iCallerStatus(aStatus), iThreadParams(aParams)
+	{
+	CActiveScheduler::Add(this);
+	}
 
 // --------------------------------------------------------------------------
 // CNSmlNotifierObserver::~CNSmlNotifierObserver()
@@ -805,27 +836,17 @@
 // --------------------------------------------------------------------------
 //	
 CNSmlNotifierObserver::~CNSmlNotifierObserver()
-    {
-    LOGSTRING("~CNSmlNotifierObserver");
-    // StartNotifier called to avoid Notifier server panic, if 
-    // notifier does not exist anymore.
-    TBuf8<1> dummy;
-
-    if (!iHbSyncmlNotifierEnabled)
-        {
-//        iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
-
-//        iNotifier.CancelNotifier(KUidNotifier);
-//        iNotifier.Close();
-        }
-    else
-        {
-        if(iDmDevdialog.Handle() )
-             iDmDevdialog.Close();
-        }
-
-    Cancel();
-    }
+	{
+	
+	// StartNotifier called to avoid Notifier server panic, if 
+	// notifier does not exist anymore.
+	TBuf8<1> dummy;	
+	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
+	
+	iNotifier.CancelNotifier( KUidNotifier );
+	iNotifier.Close();
+	Cancel();
+	}
 
 // --------------------------------------------------------------------------
 // CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
@@ -834,74 +855,35 @@
 //		
 void CNSmlNotifierObserver::ConnectToNotifierL( const TSyncMLAppLaunchNotifParams& aParam )
 	{
-		_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
-		iTimeOut = EFalse;
+	_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
+	iTimeOut = EFalse;
+	
+	if ( !IsActive() )
+		{
+		SetActive();
+		}
+		
+	   
+    TSyncMLAppLaunchNotifParamsPckg data( aParam );
     
     if ( !KNSmlWaitNotifierForEver )
         {
         iNotifierTimeOut.LaunchNotifierTimer( this );
         }
-
-    if (!iHbSyncmlNotifierEnabled)
-    {
-    	LOGSTRING2( "CNSmlNotifierObserver::ConnectToNotifierL %d after connect, StartNotifierAndGetResponse and after setactive" , iStatus.Int());
-    }
-    else
-    {
-       iStatus = KRequestPending;
-       HbNotifierObserverL(aParam);
-    }
-    if ( !IsActive() )
-    {
-    	SetActive();
-    }      
-     _DBG_FILE("CNSmlNotifierObserver::ConnectToNotifierL:End");   
-	}
-
-// --------------------------------------------------------------------------
-// CNSmlNotifierObserver::IsHbNotifierEnabled()
-// Launch Hb Notifier Process
-// --------------------------------------------------------------------------
-//
-TBool CNSmlNotifierObserver::IsHbSyncmlNotifierEnabledL()
-    {
-    CRepository * rep =
-            CRepository::NewLC(KCRUidDeviceManagementInternalKeys);
-
-    TInt notifierenabled = KErrNone;
-
-    TInt err = rep->Get(KDevManEnableHbNotifier, notifierenabled);
-
-    CleanupStack::PopAndDestroy(rep);
-
-    if (err == KErrNone && notifierenabled)
+        
+    TInt err = iNotifier.Connect();
+    if ( err == KErrNone )
         {
-        return ETrue;
+        iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf );                
         }
     else
         {
-        return EFalse;
+        // Stop job. Error connecting to notifier.
+        TRequestStatus* sStatus = &iStatus;
+		User::RequestComplete( sStatus, err );            
         }
-
-    }
-
-// --------------------------------------------------------------------------
-// CNSmlNotifierObserver::HbNotifierObserverL()
-// Launch Hb Notifier Process
-// --------------------------------------------------------------------------
-//
-void CNSmlNotifierObserver::HbNotifierObserverL(const TSyncMLAppLaunchNotifParams& aParam)
-    {
-
-    LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int());
-   TInt err = iDmDevdialog.OpenL();
-   User::LeaveIfError(err);
-  iDmDevdialog.LaunchPkgZero(aParam.iProfileId,aParam.iJobId,aParam.iUimode,iResBuf,iStatus);
-     
-    LOGSTRING2("CNSmlNotifierObserver hb notifier %d after subscribe", iStatus.Int());
-
-    LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int());
-    }
+     _DBG_FILE("CNSmlNotifierObserver::ConnectToNotifierL:End");   
+	}
 
 // --------------------------------------------------------------------------
 // CNSmlNotifierObserver::NotifierTimeOut()
@@ -909,23 +891,15 @@
 // --------------------------------------------------------------------------
 //
 void CNSmlNotifierObserver::NotifierTimeOut()
-    {
-    LOGSTRING("CNSmlNotifierObserver NotifierTimeOut ");
-    iTimeOut = ETrue;
-
-    // StartNotifier called to avoid Notifier server panic, if 
-    // notifier does not exist anymore.
-    if(!iHbSyncmlNotifierEnabled)
-        {
-        TBuf8<1> dummy;
-//        iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
-//        iNotifier.CancelNotifier( KUidNotifier );
-        }
-    else
-        {
-        iProperty.Close();
-        }
-    }
+	{
+	iTimeOut = ETrue;
+	
+	// StartNotifier called to avoid Notifier server panic, if 
+	// notifier does not exist anymore.
+	TBuf8<1> dummy;
+	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
+	iNotifier.CancelNotifier( KUidNotifier );
+	}
 
 // --------------------------------------------------------------------------
 // CNSmlNotifierObserver::DoCancel()
@@ -942,12 +916,8 @@
 // --------------------------------------------------------------------------
 //	
 void CNSmlNotifierObserver::RunL()
-    {
-
-
-
-    LOGSTRING("CNSmlNotifierObserver RunL start");
-
+	{
+	    
     TInt ret = iStatus.Int();
     if ( ret == KErrCancel && iTimeOut )
     	{
@@ -957,7 +927,7 @@
     if ( ret == KErrNone )
     	{	   
         
-	  	TInt sid = iResBuf(); // read secure id from notifier.
+	  	TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier.
 	   	
 	    // Check the response and error code. If there is a fail, dump the job.        
 	    // Also compare sid to creator id saved for current job to secure that listener owns the job.
--- a/syncmlfw/common/sosserver_clientapi/bld/NSmlClientAPI.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver_clientapi/bld/NSmlClientAPI.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -65,9 +65,10 @@
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	/epoc32/include/ecom
+SYSTEMINCLUDE	/epoc32/include/http
 SYSTEMINCLUDE	/epoc32/include/libc
 
-LIBRARY         euser.lib estor.lib featmgr.lib bafl.lib
+LIBRARY         euser.lib estor.lib FeatMgr.lib bafl.lib
 LIBRARY		eikcore.lib efsrv.lib ecom.lib
 LIBRARY		nsmltransporthandler.lib
 LIBRARY		nsmldebug.lib
--- a/syncmlfw/common/sosserver_clientapi/src/NSmlClientAPIActiveCallback.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver_clientapi/src/NSmlClientAPIActiveCallback.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -267,10 +267,14 @@
 #endif
 	}
 
+// ----------------------------------------------------------------------------
+// CSmlActiveEventCallback::RunError
+// ----------------------------------------------------------------------------
 TInt CSmlActiveEventCallback::RunError ( TInt /*aError*/ )
     {
     	return KErrNone;
     }	
+    
 // -----------------------------------------------------------------------------
 // CSmlActiveEventCallback::Request()
 // Makes an event request to server.
@@ -441,10 +445,15 @@
 		}
 #endif
 	}
+
+// ----------------------------------------------------------------------------
+// CSmlActiveProgressCallback::RunError
+// ----------------------------------------------------------------------------
 TInt CSmlActiveProgressCallback::RunError ( TInt /*aError*/ )
     {
     	return KErrNone;
     }	
+    	
 // -----------------------------------------------------------------------------
 // CSmlActiveProgressCallback::Request()
 // Sends asynchronous progress event request to server.
--- a/syncmlfw/common/sosserver_clientapi/src/NSmlClientContactSuiteAPIActiveCallback.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver_clientapi/src/NSmlClientContactSuiteAPIActiveCallback.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -154,11 +154,15 @@
         }
 #endif
     }
-    
+   
+// ----------------------------------------------------------------------------
+// CSmlActiveContactSuiteProgressCallback::RunError
+// ----------------------------------------------------------------------------
 TInt CSmlActiveContactSuiteProgressCallback::RunError ( TInt /*aError*/ )
     {
     	return KErrNone;
     }	
+        
 // -----------------------------------------------------------------------------
 // CSmlActiveContactSuiteProgressCallback::Request()
 // Sends asynchronous progress event request to server.
--- a/syncmlfw/common/sosserver_transporthandler/src/NSmlTransportHandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/sosserver_transporthandler/src/NSmlTransportHandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -24,7 +24,7 @@
 #include <f32file.h>
 #include <SyncMLTransportProperties.h>
 #include <data_caging_path_literals.hrh> 
-#include <nsmltransport.rsg>
+#include <NSmlTransport.rsg>
 
 #include <nsmlconstants.h>
 #include "NSmlTransportHandler.h"
--- a/syncmlfw/common/syncagent/bld/DEF/bwinscwu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/bld/DEF/bwinscwu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -23,171 +23,174 @@
 	?AddTargetRefL@CNSmlStatusContainer@@QAEXHPBUsml_target_s@@@Z @ 22 NONAME ; void CNSmlStatusContainer::AddTargetRefL(int, struct sml_target_s const *)
 	?ClientInitialisationStateL@CNSmlAgentBase@@IAEXXZ @ 23 NONAME ; void CNSmlAgentBase::ClientInitialisationStateL(void)
 	?LaunchAutoRestartL@CNSmlAgentBase@@UAEXH@Z @ 24 NONAME ; void CNSmlAgentBase::LaunchAutoRestartL(int)
-	?SetCmdRefL@CNSmlStatusContainer@@QAEXHPBUsml_pcdata_s@@@Z @ 25 NONAME ; void CNSmlStatusContainer::SetCmdRefL(int, struct sml_pcdata_s const *)
-	?ServerPassword@CNSmlAgentBase@@MBE?AVTPtrC16@@XZ @ 26 NONAME ; class TPtrC16 CNSmlAgentBase::ServerPassword(void) const
-	?SetStatusCodesInAtomicL@CNSmlStatusContainer@@QAEXHHH@Z @ 27 NONAME ; void CNSmlStatusContainer::SetStatusCodesInAtomicL(int, int, int)
-	?CreateAndInitResponseItemL@CNSmlCmdsBase@@IAEHABVTDesC8@@@Z @ 28 NONAME ; int CNSmlCmdsBase::CreateAndInitResponseItemL(class TDesC8 const &)
-	?MoreDataL@CNSmlCmdsBase@@IAE?AW4TNSmlSyncMLStatusCode@TNSmlError@@PBVHBufC8@@PBUsml_item_s@@PBUsml_pcdata_s@@AAPAVCBufBase@@@Z @ 29 NONAME ; enum TNSmlError::TNSmlSyncMLStatusCode CNSmlCmdsBase::MoreDataL(class HBufC8 const *, struct sml_item_s const *, struct sml_pcdata_s const *, class CBufBase * &)
-	?ServerModStatusCmdStateL@CNSmlAgentBase@@IAEXPAUsml_status_s@@@Z @ 30 NONAME ; void CNSmlAgentBase::ServerModStatusCmdStateL(struct sml_status_s *)
-	?StatusToUnsupportedCommandL@CNSmlCmdsBase@@QAEXHABVTDesC8@@PBUsml_pcdata_s@@I@Z @ 31 NONAME ; void CNSmlCmdsBase::StatusToUnsupportedCommandL(int, class TDesC8 const &, struct sml_pcdata_s const *, unsigned int)
-	?DoStatusL@CNSmlCmdsBase@@QAE?AW4TReturnValue@1@PAUsml_status_s@@@Z @ 32 NONAME ; enum CNSmlCmdsBase::TReturnValue CNSmlCmdsBase::DoStatusL(struct sml_status_s *)
-	?PCDATAToUnicodeLC@CNSmlCmdsBase@@QBEXABUsml_pcdata_s@@AAPAVHBufC16@@@Z @ 33 NONAME ; void CNSmlCmdsBase::PCDATAToUnicodeLC(struct sml_pcdata_s const &, class HBufC16 * &) const
-	??1CNSmlAgentBase@@UAE@XZ @ 34 NONAME ; CNSmlAgentBase::~CNSmlAgentBase(void)
-	??0TNSmlError@@QAE@XZ @ 35 NONAME ; TNSmlError::TNSmlError(void)
-	?SetNoResponse@CNSmlStatusContainer@@QAEXHH@Z @ 36 NONAME ; void CNSmlStatusContainer::SetNoResponse(int, int)
-	?AnyResults@CNSmlResultsContainer@@QBEHXZ @ 37 NONAME ; int CNSmlResultsContainer::AnyResults(void) const
-	?WriteMappingInfoToDbL@CNSmlCmdsBase@@UBEHXZ @ 38 NONAME ; int CNSmlCmdsBase::WriteMappingInfoToDbL(void) const
-	?StatusContainer@CNSmlCmdsBase@@QBEPAVCNSmlStatusContainer@@XZ @ 39 NONAME ; class CNSmlStatusContainer * CNSmlCmdsBase::StatusContainer(void) const
-	?smlMoveCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_generic_s@@@Z @ 40 NONAME ; int CNSmlAgentBase::smlMoveCmdFuncL(struct sml_generic_s *)
-	?ServerModAlertCmdStateL@CNSmlAgentBase@@IAEXPAUsml_alert_s@@@Z @ 41 NONAME ; void CNSmlAgentBase::ServerModAlertCmdStateL(struct sml_alert_s *)
-	?SetOffCallbackCalled@CNSmlAgentBase@@QAEXXZ @ 42 NONAME ; void CNSmlAgentBase::SetOffCallbackCalled(void)
-	?InitAskingDeviceInfoStateL@CNSmlAgentBase@@MAEXXZ @ 43 NONAME ; void CNSmlAgentBase::InitAskingDeviceInfoStateL(void)
-	?DoSyncHdrL@CNSmlCmdsBase@@UAEXXZ @ 44 NONAME ; void CNSmlCmdsBase::DoSyncHdrL(void)
-	??1TNSmlError@@UAE@XZ @ 45 NONAME ; TNSmlError::~TNSmlError(void)
-	?SetAuthRequiredL@CNSmlAuth@@QAEXXZ @ 46 NONAME ; void CNSmlAuth::SetAuthRequiredL(void)
-	?SubtractConsumedFromPcData@CNSmlCmdsBase@@IAEXAAPAUsml_item_s@@H@Z @ 47 NONAME ; void CNSmlCmdsBase::SubtractConsumedFromPcData(struct sml_item_s * &, int)
-	?ChalType@CNSmlResponseController@@QBE?AVTPtrC8@@H@Z @ 48 NONAME ; class TPtrC8 CNSmlResponseController::ChalType(int) const
-	?SwVersionL@CNSmlPhoneInfo@@QAE?AVTPtrC8@@XZ @ 49 NONAME ; class TPtrC8 CNSmlPhoneInfo::SwVersionL(void)
-	?RespURI@CNSmlCmdsBase@@QBEPAVCNSmlURI@@XZ @ 50 NONAME ; class CNSmlURI * CNSmlCmdsBase::RespURI(void) const
-	?HostNameInUTF8AllocLC@CNSmlURI@@QAEPAVHBufC8@@XZ @ 51 NONAME ; class HBufC8 * CNSmlURI::HostNameInUTF8AllocLC(void)
-	?SetAtomicOrSequenceId@CNSmlStatusContainer@@QAEXHH@Z @ 52 NONAME ; void CNSmlStatusContainer::SetAtomicOrSequenceId(int, int)
-	?Begin@CNSmlStatusContainer@@QAEXXZ @ 53 NONAME ; void CNSmlStatusContainer::Begin(void)
-	?ServerAlertNextEndMessageStateL@CNSmlAgentBase@@IAEXH@Z @ 54 NONAME ; void CNSmlAgentBase::ServerAlertNextEndMessageStateL(int)
-	?DoMetaL@CNSmlCmdsBase@@QBEXAAPAUsml_pcdata_s@@PBUsml_metinf_metinf_s@@@Z @ 55 NONAME ; void CNSmlCmdsBase::DoMetaL(struct sml_pcdata_s * &, struct sml_metinf_metinf_s const *) const
-	?SetHostNameL@CNSmlURI@@QAEXABVTDesC16@@H@Z @ 56 NONAME ; void CNSmlURI::SetHostNameL(class TDesC16 const &, int)
-	?PhoneDataL@CNSmlPhoneInfo@@QBEXW4TPhoneIdType@1@AAVTDes16@@@Z @ 57 NONAME ; void CNSmlPhoneInfo::PhoneDataL(enum CNSmlPhoneInfo::TPhoneIdType, class TDes16 &) const
-	?DataUpdateStatusStateL@CNSmlAgentBase@@IAEXXZ @ 58 NONAME ; void CNSmlAgentBase::DataUpdateStatusStateL(void)
-	?MarkGenAlertsSentL@CNSmlCmdsBase@@UAEXABVTDesC8@@@Z @ 59 NONAME ; void CNSmlCmdsBase::MarkGenAlertsSentL(class TDesC8 const &)
-	?Cmd@CNSmlResponseController@@QBEAAVTDesC8@@H@Z @ 60 NONAME ; class TDesC8 & CNSmlResponseController::Cmd(int) const
-	?AddSourceRefL@CNSmlStatusContainer@@QAEXHPBUsml_source_s@@@Z @ 61 NONAME ; void CNSmlStatusContainer::AddSourceRefL(int, struct sml_source_s const *)
-	?SetStatusCodeL@CNSmlStatusContainer@@QAEXHHH@Z @ 62 NONAME ; void CNSmlStatusContainer::SetStatusCodeL(int, int, int)
-	?SetPort@CNSmlURI@@QAEXH@Z @ 63 NONAME ; void CNSmlURI::SetPort(int)
-	?SetErrorCode@TNSmlError@@QAEXH@Z @ 64 NONAME ; void TNSmlError::SetErrorCode(int)
-	?SendingStateL@CNSmlAgentBase@@IAEXXZ @ 65 NONAME ; void CNSmlAgentBase::SendingStateL(void)
-	?NewL@CNSmlPhoneInfo@@SAPAV1@XZ @ 66 NONAME ; class CNSmlPhoneInfo * CNSmlPhoneInfo::NewL(void)
-	?SetDatabaseL@CNSmlURI@@QAEXABVTDesC16@@H@Z @ 67 NONAME ; void CNSmlURI::SetDatabaseL(class TDesC16 const &, int)
-	?ResetLargeObjectBuffer@CNSmlCmdsBase@@QAEXXZ @ 68 NONAME ; void CNSmlCmdsBase::ResetLargeObjectBuffer(void)
-	?CloseIDMappingTableL@CNSmlCmdsBase@@UAEXXZ @ 69 NONAME ; void CNSmlCmdsBase::CloseIDMappingTableL(void)
-	?EndOfServerMessageL@CNSmlCmdsBase@@UBEXXZ @ 70 NONAME ; void CNSmlCmdsBase::EndOfServerMessageL(void) const
-	?ResetGenericUserAlertL@CNSmlCmdsBase@@UAEXXZ @ 71 NONAME ; void CNSmlCmdsBase::ResetGenericUserAlertL(void)
-	?DoGenericAlertL@CNSmlCmdsBase@@UAEXABVTDesC8@@ABV?$RArray@UCNSmlDMAlertItem@@@@@Z @ 72 NONAME ; void CNSmlCmdsBase::DoGenericAlertL(class TDesC8 const &, class RArray<struct CNSmlDMAlertItem> const &)
-	?DoTargetL@CNSmlCmdsBase@@QBEXAAPAUsml_target_s@@ABVTDesC16@@@Z @ 73 NONAME ; void CNSmlCmdsBase::DoTargetL(struct sml_target_s * &, class TDesC16 const &) const
-	?CurrentEntryID@CNSmlResultsContainer@@QBEHXZ @ 74 NONAME ; int CNSmlResultsContainer::CurrentEntryID(void) const
-	?SetStatusCodeToAtomicOrSequenceCmdL@CNSmlStatusContainer@@QAEXHHABVTDesC8@@@Z @ 75 NONAME ; void CNSmlStatusContainer::SetStatusCodeToAtomicOrSequenceCmdL(int, int, class TDesC8 const &)
-	?HBufC16InUnicodeLC@NSmlUnicodeConverter@@SAHABVTDesC8@@AAPAVHBufC16@@@Z @ 76 NONAME ; int NSmlUnicodeConverter::HBufC16InUnicodeLC(class TDesC8 const &, class HBufC16 * &)
-	?Challenged@CNSmlAuth@@QBEHXZ @ 77 NONAME ; int CNSmlAuth::Challenged(void) const
-	?IsEqualL@CNSmlURI@@QAEHABV1@H@Z @ 78 NONAME ; int CNSmlURI::IsEqualL(class CNSmlURI const &, int)
-	?SetHostNameL@CNSmlURI@@QAEXABVTDesC8@@H@Z @ 79 NONAME ; void CNSmlURI::SetHostNameL(class TDesC8 const &, int)
-	?ServerObjectSize@CNSmlCmdsBase@@IBEHPBUsml_pcdata_s@@@Z @ 80 NONAME ; int CNSmlCmdsBase::ServerObjectSize(struct sml_pcdata_s const *) const
-	??0CNSmlCmdsBase@@QAE@XZ @ 81 NONAME ; CNSmlCmdsBase::CNSmlCmdsBase(void)
-	?DoSourceL@CNSmlCmdsBase@@QBEXAAPAUsml_source_s@@ABVTDesC16@@@Z @ 82 NONAME ; void CNSmlCmdsBase::DoSourceL(struct sml_source_s * &, class TDesC16 const &) const
-	?smlMapCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_map_s@@@Z @ 83 NONAME ; int CNSmlAgentBase::smlMapCmdFuncL(struct sml_map_s *)
-	?ResetL@CNSmlResponseController@@QAEXXZ @ 84 NONAME ; void CNSmlResponseController::ResetL(void)
-	?ProcessStatusCmdL@CNSmlCmdsBase@@UAEXPAUsml_status_s@@@Z @ 85 NONAME ; void CNSmlCmdsBase::ProcessStatusCmdL(struct sml_status_s *)
-	?SetCmdIDL@CNSmlResultsContainer@@QAEXHPBUsml_pcdata_s@@@Z @ 86 NONAME ; void CNSmlResultsContainer::SetCmdIDL(int, struct sml_pcdata_s const *)
-	?ServerAlertNextStatusCmdStateL@CNSmlAgentBase@@IAEXPAUsml_status_s@@@Z @ 87 NONAME ; void CNSmlAgentBase::ServerAlertNextStatusCmdStateL(struct sml_status_s *)
-	?ProcessExecCmdL@CNSmlCmdsBase@@UAEXPAUsml_exec_s@@@Z @ 88 NONAME ; void CNSmlCmdsBase::ProcessExecCmdL(struct sml_exec_s *)
-	?HostName@CNSmlURI@@QAE?AVTPtrC16@@XZ @ 89 NONAME ; class TPtrC16 CNSmlURI::HostName(void)
-	?DoCancel@CNSmlAgentBase@@UAEXXZ @ 90 NONAME ; void CNSmlAgentBase::DoCancel(void)
-	?SyncLog@CNSmlAgentBase@@QAEPAVCSyncMLHistoryJob@@XZ @ 91 NONAME ; class CSyncMLHistoryJob * CNSmlAgentBase::SyncLog(void)
-	?StatusDataToGenericCommandL@CNSmlCmdsBase@@IAEHABVTDesC8@@PBUsml_generic_s@@PBUsml_item_s@@W4TNSmlSyncMLStatusCode@TNSmlError@@PBV2@@Z @ 92 NONAME ; int CNSmlCmdsBase::StatusDataToGenericCommandL(class TDesC8 const &, struct sml_generic_s const *, struct sml_item_s const *, enum TNSmlError::TNSmlSyncMLStatusCode, class TDesC8 const *)
-	?ServerAlertNextAlertCmdStateL@CNSmlAgentBase@@IAEXPAUsml_alert_s@@@Z @ 93 NONAME ; void CNSmlAgentBase::ServerAlertNextAlertCmdStateL(struct sml_alert_s *)
-	?SaveIfNonceL@CNSmlAgentBase@@IBEXABVCNSmlResponseController@@H@Z @ 94 NONAME ; void CNSmlAgentBase::SaveIfNonceL(class CNSmlResponseController const &, int) const
-	?FetchIDMappingTableL@CNSmlCmdsBase@@UAEXH@Z @ 95 NONAME ; void CNSmlCmdsBase::FetchIDMappingTableL(int)
-	?ServerAuth@CNSmlCmdsBase@@QBEPAVCNSmlAuth@@XZ @ 96 NONAME ; class CNSmlAuth * CNSmlCmdsBase::ServerAuth(void) const
-	?NewLC@CNSmlPhoneInfo@@SAPAV1@XZ @ 97 NONAME ; class CNSmlPhoneInfo * CNSmlPhoneInfo::NewLC(void)
-	?smlDeleteCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_generic_s@@@Z @ 98 NONAME ; int CNSmlAgentBase::smlDeleteCmdFuncL(struct sml_generic_s *)
-	?InitStartingMessageStateBaseL@CNSmlAgentBase@@IAEXXZ @ 99 NONAME ; void CNSmlAgentBase::InitStartingMessageStateBaseL(void)
-	?DeleteIDMappingTableL@CNSmlCmdsBase@@UAEHABVTDesC16@@0@Z @ 100 NONAME ; int CNSmlCmdsBase::DeleteIDMappingTableL(class TDesC16 const &, class TDesC16 const &)
-	?StatusReference@CNSmlAgentBase@@QAEAAVTRequestStatus@@XZ @ 101 NONAME ; class TRequestStatus & CNSmlAgentBase::StatusReference(void)
-	?SetCredentialL@CNSmlAuth@@QAEXABVTDesC8@@@Z @ 102 NONAME ; void CNSmlAuth::SetCredentialL(class TDesC8 const &)
-	?DoAnchorsL@CNSmlCmdsBase@@IBEXAAUsml_metinf_metinf_s@@PBVTDesC8@@1@Z @ 103 NONAME ; void CNSmlCmdsBase::DoAnchorsL(struct sml_metinf_metinf_s &, class TDesC8 const *, class TDesC8 const *) const
-	?DoSourceL@CNSmlCmdsBase@@QBEXAAPAUsml_source_s@@ABVTDesC8@@@Z @ 104 NONAME ; void CNSmlCmdsBase::DoSourceL(struct sml_source_s * &, class TDesC8 const &) const
-	?DoTargetL@CNSmlCmdsBase@@QBEXAAPAUsml_target_s@@ABVTDesC16@@1@Z @ 105 NONAME ; void CNSmlCmdsBase::DoTargetL(struct sml_target_s * &, class TDesC16 const &, class TDesC16 const &) const
-	?DoGenericAlertL@CNSmlCmdsBase@@UAEXABVTDesC8@@00H0@Z @ 106 NONAME ; void CNSmlCmdsBase::DoGenericAlertL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, int, class TDesC8 const &)
-	?ProcessMapCmdL@CNSmlCmdsBase@@UAEXPAUsml_map_s@@@Z @ 107 NONAME ; void CNSmlCmdsBase::ProcessMapCmdL(struct sml_map_s *)
-	?ReceivingStateL@CNSmlAgentBase@@IAEXXZ @ 108 NONAME ; void CNSmlAgentBase::ReceivingStateL(void)
-	??4CNSmlURI@@QAEAAV0@ABV0@@Z @ 109 NONAME ; class CNSmlURI & CNSmlURI::operator=(class CNSmlURI const &)
-	?ProcessReceivedDataL@CNSmlCmdsBase@@QAEHXZ @ 110 NONAME ; int CNSmlCmdsBase::ProcessReceivedDataL(void)
-	?SetPerformedInAtomic@CNSmlStatusContainer@@QAEXH@Z @ 111 NONAME ; void CNSmlStatusContainer::SetPerformedInAtomic(int)
-	?SetMoreData@CNSmlResponseController@@QAEXH@Z @ 112 NONAME ; void CNSmlResponseController::SetMoreData(int)
-	?DatabaseMatchesL@CNSmlURI@@QAEHABVTDesC16@@@Z @ 113 NONAME ; int CNSmlURI::DatabaseMatchesL(class TDesC16 const &)
-	?LastEntryID@CNSmlStatusContainer@@QBEHXZ @ 114 NONAME ; int CNSmlStatusContainer::LastEntryID(void) const
-	?ResponseController@CNSmlCmdsBase@@QBEPAVCNSmlResponseController@@XZ @ 115 NONAME ; class CNSmlResponseController * CNSmlCmdsBase::ResponseController(void) const
-	?SetResponseDetail@CNSmlResponseController@@QAEXHW4TResponseDetail@1@@Z @ 116 NONAME ; void CNSmlResponseController::SetResponseDetail(int, enum CNSmlResponseController::TResponseDetail)
-	?ResultAlertStateL@CNSmlAgentBase@@IAEXXZ @ 117 NONAME ; void CNSmlAgentBase::ResultAlertStateL(void)
-	?ConstructL@CNSmlCmdsBase@@IAEXPAVCNSmlAgentBase@@ABVTDesC8@@1HABVHBufC16@@PAVCNSmlURI@@H@Z @ 118 NONAME ; void CNSmlCmdsBase::ConstructL(class CNSmlAgentBase *, class TDesC8 const &, class TDesC8 const &, int, class HBufC16 const &, class CNSmlURI *, int)
-	?DoCmdIdL@CNSmlCmdsBase@@IAEXAAPAUsml_pcdata_s@@@Z @ 119 NONAME ; void CNSmlCmdsBase::DoCmdIdL(struct sml_pcdata_s * &)
-	?smlSearchCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_search_s@@@Z @ 120 NONAME ; int CNSmlAgentBase::smlSearchCmdFuncL(struct sml_search_s *)
-	?IsFlagSet@CNSmlCmdsBase@@IBEHABI0@Z @ 121 NONAME ; int CNSmlCmdsBase::IsFlagSet(unsigned int const &, unsigned int const &) const
-	?SetServerNonceL@CNSmlAgentBase@@UBEXABVTDesC16@@@Z @ 122 NONAME ; void CNSmlAgentBase::SetServerNonceL(class TDesC16 const &) const
-	?DoTargetL@CNSmlCmdsBase@@QBEXAAPAUsml_target_s@@ABVTDesC8@@@Z @ 123 NONAME ; void CNSmlCmdsBase::DoTargetL(struct sml_target_s * &, class TDesC8 const &) const
-	?SetEndOfDataAlertRequest@CNSmlAgentBase@@QAEXXZ @ 124 NONAME ; void CNSmlAgentBase::SetEndOfDataAlertRequest(void)
-	?ServerUserName@CNSmlAgentBase@@MBE?AVTPtrC16@@XZ @ 125 NONAME ; class TPtrC16 CNSmlAgentBase::ServerUserName(void) const
-	?ClientAlertNextStateL@CNSmlAgentBase@@IAEXXZ @ 126 NONAME ; void CNSmlAgentBase::ClientAlertNextStateL(void)
-	?NewLC@CNSmlURI@@SAPAV1@XZ @ 127 NONAME ; class CNSmlURI * CNSmlURI::NewLC(void)
-	?DisconnectFromOtherServers@CNSmlCmdsBase@@UAEXXZ @ 128 NONAME ; void CNSmlCmdsBase::DisconnectFromOtherServers(void)
-	?SyncLogMessageCode@TNSmlError@@UAEHXZ @ 129 NONAME ; int TNSmlError::SyncLogMessageCode(void)
-	?ServerModEndMessageStateL@CNSmlAgentBase@@IAEXH@Z @ 130 NONAME ; void CNSmlAgentBase::ServerModEndMessageStateL(int)
-	?HBufC8InUTF8LC@NSmlUnicodeConverter@@SAHABVTDesC16@@AAPAVHBufC8@@@Z @ 131 NONAME ; int NSmlUnicodeConverter::HBufC8InUTF8LC(class TDesC16 const &, class HBufC8 * &)
-	?ProcessSearchCmdL@CNSmlCmdsBase@@UAEXPAUsml_search_s@@@Z @ 132 NONAME ; void CNSmlCmdsBase::ProcessSearchCmdL(struct sml_search_s *)
-	?ProfileId@CNSmlAgentBase@@QBEHXZ @ 133 NONAME ; int CNSmlAgentBase::ProfileId(void) const
-	?smlCopyCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_generic_s@@@Z @ 134 NONAME ; int CNSmlAgentBase::smlCopyCmdFuncL(struct sml_generic_s *)
-	?NewL@CNSmlURI@@SAPAV1@XZ @ 135 NONAME ; class CNSmlURI * CNSmlURI::NewL(void)
-	?DoGenericUserAlertL@CNSmlCmdsBase@@UAEHH@Z @ 136 NONAME ; int CNSmlCmdsBase::DoGenericUserAlertL(int)
-	?HBufC16InUnicodeL@NSmlUnicodeConverter@@SAHABVTDesC8@@AAPAVHBufC16@@@Z @ 137 NONAME ; int NSmlUnicodeConverter::HBufC16InUnicodeL(class TDesC8 const &, class HBufC16 * &)
-	?MoreData@CNSmlResponseController@@QBEHH@Z @ 138 NONAME ; int CNSmlResponseController::MoreData(int) const
-	?RemoveWritten@CNSmlResultsContainer@@QAEXH@Z @ 139 NONAME ; void CNSmlResultsContainer::RemoveWritten(int)
-	?MetaTypeInUtf8LC@CNSmlCmdsBase@@IBEPAVHBufC8@@PBUsml_pcdata_s@@@Z @ 140 NONAME ; class HBufC8 * CNSmlCmdsBase::MetaTypeInUtf8LC(struct sml_pcdata_s const *) const
-	?StatusDataToGetCommandL@CNSmlCmdsBase@@IAEHPBUsml_get_put_s@@PBUsml_item_s@@W4TNSmlSyncMLStatusCode@TNSmlError@@PBVTDesC8@@@Z @ 141 NONAME ; int CNSmlCmdsBase::StatusDataToGetCommandL(struct sml_get_put_s const *, struct sml_item_s const *, enum TNSmlError::TNSmlSyncMLStatusCode, class TDesC8 const *)
-	?AppIndex@CNSmlResponseController@@QBEHH@Z @ 142 NONAME ; int CNSmlResponseController::AppIndex(int) const
-	?WaitingLargeObjectChunk@CNSmlCmdsBase@@QBEHXZ @ 143 NONAME ; int CNSmlCmdsBase::WaitingLargeObjectChunk(void) const
-	?SetMaximumWorkspaceSize@CNSmlCmdsBase@@QAEXH@Z @ 144 NONAME ; void CNSmlCmdsBase::SetMaximumWorkspaceSize(int)
-	?StatusCode@CNSmlResponseController@@QBEHH@Z @ 145 NONAME ; int CNSmlResponseController::StatusCode(int) const
-	?smlExecCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_exec_s@@@Z @ 146 NONAME ; int CNSmlAgentBase::smlExecCmdFuncL(struct sml_exec_s *)
-	?EntryID@CNSmlResponseController@@QBEHHH@Z @ 147 NONAME ; int CNSmlResponseController::EntryID(int, int) const
-	?ProcessSyncHdrL@CNSmlCmdsBase@@UAEXPAUsml_sync_hdr_s@@@Z @ 148 NONAME ; void CNSmlCmdsBase::ProcessSyncHdrL(struct sml_sync_hdr_s *)
-	?ProcessCopyCmdL@CNSmlCmdsBase@@UAEXPAUsml_generic_s@@@Z @ 149 NONAME ; void CNSmlCmdsBase::ProcessCopyCmdL(struct sml_generic_s *)
-	?ServerNonceAllocL@CNSmlAgentBase@@UBEPAVHBufC16@@XZ @ 150 NONAME ; class HBufC16 * CNSmlAgentBase::ServerNonceAllocL(void) const
-	?ResultsContainer@CNSmlCmdsBase@@QBEPAVCNSmlResultsContainer@@XZ @ 151 NONAME ; class CNSmlResultsContainer * CNSmlCmdsBase::ResultsContainer(void) const
-	?DataUpdateStatusMakingMapStateL@CNSmlAgentBase@@MAEXXZ @ 152 NONAME ; void CNSmlAgentBase::DataUpdateStatusMakingMapStateL(void)
-	?SetSyncAgent@CNSmlAuth@@QAEXPAVCNSmlAgentBase@@@Z @ 153 NONAME ; void CNSmlAuth::SetSyncAgent(class CNSmlAgentBase *)
-	?MetaFormatInUtf8LC@CNSmlCmdsBase@@IBEPAVHBufC8@@PBUsml_pcdata_s@@@Z @ 154 NONAME ; class HBufC8 * CNSmlCmdsBase::MetaFormatInUtf8LC(struct sml_pcdata_s const *) const
-	?ResponseDetail@CNSmlResponseController@@QBE?AW4TResponseDetail@1@H@Z @ 155 NONAME ; enum CNSmlResponseController::TResponseDetail CNSmlResponseController::ResponseDetail(int) const
-	?StatusID@CNSmlResultsContainer@@QBEHH@Z @ 156 NONAME ; int CNSmlResultsContainer::StatusID(int) const
-	?ErrorCodeConversion@TNSmlError@@MAEXXZ @ 157 NONAME ; void TNSmlError::ErrorCodeConversion(void)
-	?ServerMaxObjSize@CNSmlCmdsBase@@IBEHPBUsml_pcdata_s@@@Z @ 158 NONAME ; int CNSmlCmdsBase::ServerMaxObjSize(struct sml_pcdata_s const *) const
-	?ServerModStartMessageStateL@CNSmlAgentBase@@IAEXPAUsml_sync_hdr_s@@@Z @ 159 NONAME ; void CNSmlAgentBase::ServerModStartMessageStateL(struct sml_sync_hdr_s *)
-	?CallbackCalled@CNSmlAgentBase@@QBEHXZ @ 160 NONAME ; int CNSmlAgentBase::CallbackCalled(void) const
-	?PcdataNewL@CNSmlCmdsBase@@QBEXAAPAUsml_pcdata_s@@ABVTDesC8@@@Z @ 161 NONAME ; void CNSmlCmdsBase::PcdataNewL(struct sml_pcdata_s * &, class TDesC8 const &) const
-	?NextResultsElement@CNSmlResultsContainer@@QAEHAAPAUsml_results_s@@@Z @ 162 NONAME ; int CNSmlResultsContainer::NextResultsElement(struct sml_results_s * &)
-	?SetAppIndex@CNSmlResponseController@@QAEXHH@Z @ 163 NONAME ; void CNSmlResponseController::SetAppIndex(int, int)
-	?Begin@CNSmlResultsContainer@@QAEXXZ @ 164 NONAME ; void CNSmlResultsContainer::Begin(void)
-	?SetDatabaseL@CNSmlURI@@QAEXABVTDesC8@@H@Z @ 165 NONAME ; void CNSmlURI::SetDatabaseL(class TDesC8 const &, int)
-	?CreateNewResultsL@CNSmlResultsContainer@@QAEHABVTDesC8@@0PBUsml_target_s@@PBUsml_source_s@@@Z @ 166 NONAME ; int CNSmlResultsContainer::CreateNewResultsL(class TDesC8 const &, class TDesC8 const &, struct sml_target_s const *, struct sml_source_s const *)
-	?SyncMLDatabaseAllocLC@CNSmlURI@@QAEPAVHBufC16@@XZ @ 167 NONAME ; class HBufC16 * CNSmlURI::SyncMLDatabaseAllocLC(void)
-	?DataUpdateStatusStartingMessageStateBaseL@CNSmlAgentBase@@IAEXXZ @ 168 NONAME ; void CNSmlAgentBase::DataUpdateStatusStartingMessageStateBaseL(void)
-	?DataUpdateStatusMakingResultsStateL@CNSmlAgentBase@@MAEXXZ @ 169 NONAME ; void CNSmlAgentBase::DataUpdateStatusMakingResultsStateL(void)
-	??0CNSmlAgentBase@@QAE@XZ @ 170 NONAME ; CNSmlAgentBase::CNSmlAgentBase(void)
-	?NewLC@CNSmlURI@@SAPAV1@ABVTDesC8@@H@Z @ 171 NONAME ; class CNSmlURI * CNSmlURI::NewLC(class TDesC8 const &, int)
-	?ServerAlertNextStateL@CNSmlAgentBase@@IAEXXZ @ 172 NONAME ; void CNSmlAgentBase::ServerAlertNextStateL(void)
-	?LUID@CNSmlResponseController@@QBE?AVTPtrC8@@H@Z @ 173 NONAME ; class TPtrC8 CNSmlResponseController::LUID(int) const
-	?NextStatusElement@CNSmlStatusContainer@@QAEHAAPAUsml_status_s@@H@Z @ 174 NONAME ; int CNSmlStatusContainer::NextStatusElement(struct sml_status_s * &, int)
-	?AuthenticationRequirementL@CNSmlAgentBase@@IAEHABVCNSmlResponseController@@H@Z @ 175 NONAME ; int CNSmlAgentBase::AuthenticationRequirementL(class CNSmlResponseController const &, int)
-	?StatusDataToCommandL@CNSmlCmdsBase@@IAEHABVTDesC8@@PBUsml_pcdata_s@@IPBUsml_item_s@@W4TNSmlSyncMLStatusCode@TNSmlError@@PBV2@@Z @ 176 NONAME ; int CNSmlCmdsBase::StatusDataToCommandL(class TDesC8 const &, struct sml_pcdata_s const *, unsigned int, struct sml_item_s const *, enum TNSmlError::TNSmlSyncMLStatusCode, class TDesC8 const *)
-	?SourceIsUnderItem@CNSmlCmdsBase@@IBEHPBUsml_item_list_s@@@Z @ 177 NONAME ; int CNSmlCmdsBase::SourceIsUnderItem(struct sml_item_list_s const *) const
-	?SetStatusID@CNSmlResultsContainer@@QAEXHH@Z @ 178 NONAME ; void CNSmlResultsContainer::SetStatusID(int, int)
-	?CreateNewStatusElementL@CNSmlStatusContainer@@QAEHXZ @ 179 NONAME ; int CNSmlStatusContainer::CreateNewStatusElementL(void)
-	?FreeBaseResources@CNSmlAgentBase@@IAEXXZ @ 180 NONAME ; void CNSmlAgentBase::FreeBaseResources(void)
-	??1CNSmlCmdsBase@@UAE@XZ @ 181 NONAME ; CNSmlCmdsBase::~CNSmlCmdsBase(void)
-	?NewL@CNSmlURI@@SAPAV1@ABVTDesC16@@H@Z @ 182 NONAME ; class CNSmlURI * CNSmlURI::NewL(class TDesC16 const &, int)
-	?NewL@CNSmlAuth@@SAPAV1@XZ @ 183 NONAME ; class CNSmlAuth * CNSmlAuth::NewL(void)
-	?DataBaseWithoutRelativePrefix@CNSmlURI@@QAE?AVTPtrC16@@XZ @ 184 NONAME ; class TPtrC16 CNSmlURI::DataBaseWithoutRelativePrefix(void)
-	?Database@CNSmlURI@@QAE?AVTPtrC16@@XZ @ 185 NONAME ; class TPtrC16 CNSmlURI::Database(void)
-	?DoMaxObjSizeL@CNSmlCmdsBase@@IBEXAAUsml_metinf_metinf_s@@H@Z @ 186 NONAME ; void CNSmlCmdsBase::DoMaxObjSizeL(struct sml_metinf_metinf_s &, int) const
-	?SyncLogErrorCode@TNSmlError@@QAEHXZ @ 187 NONAME ; int TNSmlError::SyncLogErrorCode(void)
-	?ClientAlertNextMakingMapStateL@CNSmlAgentBase@@MAEXXZ @ 188 NONAME ; void CNSmlAgentBase::ClientAlertNextMakingMapStateL(void)
-	?TargetIsUnderItem@CNSmlCmdsBase@@IBEHPBUsml_item_list_s@@@Z @ 189 NONAME ; int CNSmlCmdsBase::TargetIsUnderItem(struct sml_item_list_s const *) const
-	?ServerAlertNextStartMessageStateL@CNSmlAgentBase@@IAEXPAUsml_sync_hdr_s@@@Z @ 190 NONAME ; void CNSmlAgentBase::ServerAlertNextStartMessageStateL(struct sml_sync_hdr_s *)
-	?BeginningStateL@CNSmlAgentBase@@IAEXXZ @ 191 NONAME ; void CNSmlAgentBase::BeginningStateL(void)
+	?CheckAPBearerTypeL@CNSmlAgentBase@@QAE?AW4TApBearerType@@K@Z @ 25 NONAME ; enum TApBearerType CNSmlAgentBase::CheckAPBearerTypeL(unsigned long)
+	?SetCmdRefL@CNSmlStatusContainer@@QAEXHPBUsml_pcdata_s@@@Z @ 26 NONAME ; void CNSmlStatusContainer::SetCmdRefL(int, struct sml_pcdata_s const *)
+	?ServerPassword@CNSmlAgentBase@@MBE?AVTPtrC16@@XZ @ 27 NONAME ; class TPtrC16 CNSmlAgentBase::ServerPassword(void) const
+	?SetStatusCodesInAtomicL@CNSmlStatusContainer@@QAEXHHH@Z @ 28 NONAME ; void CNSmlStatusContainer::SetStatusCodesInAtomicL(int, int, int)
+	?CreateAndInitResponseItemL@CNSmlCmdsBase@@IAEHABVTDesC8@@@Z @ 29 NONAME ; int CNSmlCmdsBase::CreateAndInitResponseItemL(class TDesC8 const &)
+	?MoreDataL@CNSmlCmdsBase@@IAE?AW4TNSmlSyncMLStatusCode@TNSmlError@@PBVHBufC8@@PBUsml_item_s@@PBUsml_pcdata_s@@AAPAVCBufBase@@@Z @ 30 NONAME ; enum TNSmlError::TNSmlSyncMLStatusCode CNSmlCmdsBase::MoreDataL(class HBufC8 const *, struct sml_item_s const *, struct sml_pcdata_s const *, class CBufBase * &)
+	?ServerModStatusCmdStateL@CNSmlAgentBase@@IAEXPAUsml_status_s@@@Z @ 31 NONAME ; void CNSmlAgentBase::ServerModStatusCmdStateL(struct sml_status_s *)
+	?StatusToUnsupportedCommandL@CNSmlCmdsBase@@QAEXHABVTDesC8@@PBUsml_pcdata_s@@I@Z @ 32 NONAME ; void CNSmlCmdsBase::StatusToUnsupportedCommandL(int, class TDesC8 const &, struct sml_pcdata_s const *, unsigned int)
+	?DoStatusL@CNSmlCmdsBase@@QAE?AW4TReturnValue@1@PAUsml_status_s@@@Z @ 33 NONAME ; enum CNSmlCmdsBase::TReturnValue CNSmlCmdsBase::DoStatusL(struct sml_status_s *)
+	?PCDATAToUnicodeLC@CNSmlCmdsBase@@QBEXABUsml_pcdata_s@@AAPAVHBufC16@@@Z @ 34 NONAME ; void CNSmlCmdsBase::PCDATAToUnicodeLC(struct sml_pcdata_s const &, class HBufC16 * &) const
+	??1CNSmlAgentBase@@UAE@XZ @ 35 NONAME ; CNSmlAgentBase::~CNSmlAgentBase(void)
+	??0TNSmlError@@QAE@XZ @ 36 NONAME ; TNSmlError::TNSmlError(void)
+	?SetNoResponse@CNSmlStatusContainer@@QAEXHH@Z @ 37 NONAME ; void CNSmlStatusContainer::SetNoResponse(int, int)
+	?AnyResults@CNSmlResultsContainer@@QBEHXZ @ 38 NONAME ; int CNSmlResultsContainer::AnyResults(void) const
+	?WriteMappingInfoToDbL@CNSmlCmdsBase@@UBEHXZ @ 39 NONAME ; int CNSmlCmdsBase::WriteMappingInfoToDbL(void) const
+	?StatusContainer@CNSmlCmdsBase@@QBEPAVCNSmlStatusContainer@@XZ @ 40 NONAME ; class CNSmlStatusContainer * CNSmlCmdsBase::StatusContainer(void) const
+	?smlMoveCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_generic_s@@@Z @ 41 NONAME ; int CNSmlAgentBase::smlMoveCmdFuncL(struct sml_generic_s *)
+	?ServerModAlertCmdStateL@CNSmlAgentBase@@IAEXPAUsml_alert_s@@@Z @ 42 NONAME ; void CNSmlAgentBase::ServerModAlertCmdStateL(struct sml_alert_s *)
+	?SetOffCallbackCalled@CNSmlAgentBase@@QAEXXZ @ 43 NONAME ; void CNSmlAgentBase::SetOffCallbackCalled(void)
+	?InitAskingDeviceInfoStateL@CNSmlAgentBase@@MAEXXZ @ 44 NONAME ; void CNSmlAgentBase::InitAskingDeviceInfoStateL(void)
+	?DoSyncHdrL@CNSmlCmdsBase@@UAEXXZ @ 45 NONAME ; void CNSmlCmdsBase::DoSyncHdrL(void)
+	??1TNSmlError@@UAE@XZ @ 46 NONAME ; TNSmlError::~TNSmlError(void)
+	?SetAuthRequiredL@CNSmlAuth@@QAEXXZ @ 47 NONAME ; void CNSmlAuth::SetAuthRequiredL(void)
+	?SubtractConsumedFromPcData@CNSmlCmdsBase@@IAEXAAPAUsml_item_s@@H@Z @ 48 NONAME ; void CNSmlCmdsBase::SubtractConsumedFromPcData(struct sml_item_s * &, int)
+	?StatusItem@CNSmlStatusContainer@@QAEPAUsml_status_s@@H@Z @ 49 NONAME ; struct sml_status_s * CNSmlStatusContainer::StatusItem(int)
+	?ChalType@CNSmlResponseController@@QBE?AVTPtrC8@@H@Z @ 50 NONAME ; class TPtrC8 CNSmlResponseController::ChalType(int) const
+	?SwVersionL@CNSmlPhoneInfo@@QAE?AVTPtrC8@@XZ @ 51 NONAME ; class TPtrC8 CNSmlPhoneInfo::SwVersionL(void)
+	?RespURI@CNSmlCmdsBase@@QBEPAVCNSmlURI@@XZ @ 52 NONAME ; class CNSmlURI * CNSmlCmdsBase::RespURI(void) const
+	?HostNameInUTF8AllocLC@CNSmlURI@@QAEPAVHBufC8@@XZ @ 53 NONAME ; class HBufC8 * CNSmlURI::HostNameInUTF8AllocLC(void)
+	?SetAtomicOrSequenceId@CNSmlStatusContainer@@QAEXHH@Z @ 54 NONAME ; void CNSmlStatusContainer::SetAtomicOrSequenceId(int, int)
+	?Begin@CNSmlStatusContainer@@QAEXXZ @ 55 NONAME ; void CNSmlStatusContainer::Begin(void)
+	?ServerAlertNextEndMessageStateL@CNSmlAgentBase@@IAEXH@Z @ 56 NONAME ; void CNSmlAgentBase::ServerAlertNextEndMessageStateL(int)
+	?DoMetaL@CNSmlCmdsBase@@QBEXAAPAUsml_pcdata_s@@PBUsml_metinf_metinf_s@@@Z @ 57 NONAME ; void CNSmlCmdsBase::DoMetaL(struct sml_pcdata_s * &, struct sml_metinf_metinf_s const *) const
+	?SetHostNameL@CNSmlURI@@QAEXABVTDesC16@@H@Z @ 58 NONAME ; void CNSmlURI::SetHostNameL(class TDesC16 const &, int)
+	?PhoneDataL@CNSmlPhoneInfo@@QBEXW4TPhoneIdType@1@AAVTDes16@@@Z @ 59 NONAME ; void CNSmlPhoneInfo::PhoneDataL(enum CNSmlPhoneInfo::TPhoneIdType, class TDes16 &) const
+	?DataUpdateStatusStateL@CNSmlAgentBase@@IAEXXZ @ 60 NONAME ; void CNSmlAgentBase::DataUpdateStatusStateL(void)
+	?MarkGenAlertsSentL@CNSmlCmdsBase@@UAEXABVTDesC8@@@Z @ 61 NONAME ; void CNSmlCmdsBase::MarkGenAlertsSentL(class TDesC8 const &)
+	?Cmd@CNSmlResponseController@@QBEAAVTDesC8@@H@Z @ 62 NONAME ; class TDesC8 & CNSmlResponseController::Cmd(int) const
+	?AddSourceRefL@CNSmlStatusContainer@@QAEXHPBUsml_source_s@@@Z @ 63 NONAME ; void CNSmlStatusContainer::AddSourceRefL(int, struct sml_source_s const *)
+	?SetStatusCodeL@CNSmlStatusContainer@@QAEXHHH@Z @ 64 NONAME ; void CNSmlStatusContainer::SetStatusCodeL(int, int, int)
+	?SetPort@CNSmlURI@@QAEXH@Z @ 65 NONAME ; void CNSmlURI::SetPort(int)
+	?SetErrorCode@TNSmlError@@QAEXH@Z @ 66 NONAME ; void TNSmlError::SetErrorCode(int)
+	?SendingStateL@CNSmlAgentBase@@IAEXXZ @ 67 NONAME ; void CNSmlAgentBase::SendingStateL(void)
+	?NewL@CNSmlPhoneInfo@@SAPAV1@XZ @ 68 NONAME ; class CNSmlPhoneInfo * CNSmlPhoneInfo::NewL(void)
+	?SetDatabaseL@CNSmlURI@@QAEXABVTDesC16@@H@Z @ 69 NONAME ; void CNSmlURI::SetDatabaseL(class TDesC16 const &, int)
+	?ResetLargeObjectBuffer@CNSmlCmdsBase@@QAEXXZ @ 70 NONAME ; void CNSmlCmdsBase::ResetLargeObjectBuffer(void)
+	?CloseIDMappingTableL@CNSmlCmdsBase@@UAEXXZ @ 71 NONAME ; void CNSmlCmdsBase::CloseIDMappingTableL(void)
+	?EndOfServerMessageL@CNSmlCmdsBase@@UBEXXZ @ 72 NONAME ; void CNSmlCmdsBase::EndOfServerMessageL(void) const
+	?ResetGenericUserAlertL@CNSmlCmdsBase@@UAEXXZ @ 73 NONAME ; void CNSmlCmdsBase::ResetGenericUserAlertL(void)
+	?DoGenericAlertL@CNSmlCmdsBase@@UAEXABVTDesC8@@ABV?$RArray@UCNSmlDMAlertItem@@@@@Z @ 74 NONAME ; void CNSmlCmdsBase::DoGenericAlertL(class TDesC8 const &, class RArray<struct CNSmlDMAlertItem> const &)
+	?DoTargetL@CNSmlCmdsBase@@QBEXAAPAUsml_target_s@@ABVTDesC16@@@Z @ 75 NONAME ; void CNSmlCmdsBase::DoTargetL(struct sml_target_s * &, class TDesC16 const &) const
+	?CurrentEntryID@CNSmlResultsContainer@@QBEHXZ @ 76 NONAME ; int CNSmlResultsContainer::CurrentEntryID(void) const
+	?SetStatusCodeToAtomicOrSequenceCmdL@CNSmlStatusContainer@@QAEXHHABVTDesC8@@@Z @ 77 NONAME ; void CNSmlStatusContainer::SetStatusCodeToAtomicOrSequenceCmdL(int, int, class TDesC8 const &)
+	?HBufC16InUnicodeLC@NSmlUnicodeConverter@@SAHABVTDesC8@@AAPAVHBufC16@@@Z @ 78 NONAME ; int NSmlUnicodeConverter::HBufC16InUnicodeLC(class TDesC8 const &, class HBufC16 * &)
+	?Challenged@CNSmlAuth@@QBEHXZ @ 79 NONAME ; int CNSmlAuth::Challenged(void) const
+	?IsEqualL@CNSmlURI@@QAEHABV1@H@Z @ 80 NONAME ; int CNSmlURI::IsEqualL(class CNSmlURI const &, int)
+	?SetHostNameL@CNSmlURI@@QAEXABVTDesC8@@H@Z @ 81 NONAME ; void CNSmlURI::SetHostNameL(class TDesC8 const &, int)
+	?ServerObjectSize@CNSmlCmdsBase@@IBEHPBUsml_pcdata_s@@@Z @ 82 NONAME ; int CNSmlCmdsBase::ServerObjectSize(struct sml_pcdata_s const *) const
+	??0CNSmlCmdsBase@@QAE@XZ @ 83 NONAME ; CNSmlCmdsBase::CNSmlCmdsBase(void)
+	?DoSourceL@CNSmlCmdsBase@@QBEXAAPAUsml_source_s@@ABVTDesC16@@@Z @ 84 NONAME ; void CNSmlCmdsBase::DoSourceL(struct sml_source_s * &, class TDesC16 const &) const
+	?smlMapCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_map_s@@@Z @ 85 NONAME ; int CNSmlAgentBase::smlMapCmdFuncL(struct sml_map_s *)
+	?ResetL@CNSmlResponseController@@QAEXXZ @ 86 NONAME ; void CNSmlResponseController::ResetL(void)
+	?FillItemDataL@CNSmlStatusContainer@@QAEXAAPAUsml_item_s@@@Z @ 87 NONAME ; void CNSmlStatusContainer::FillItemDataL(struct sml_item_s * &)
+	?ProcessStatusCmdL@CNSmlCmdsBase@@UAEXPAUsml_status_s@@@Z @ 88 NONAME ; void CNSmlCmdsBase::ProcessStatusCmdL(struct sml_status_s *)
+	?SetCmdIDL@CNSmlResultsContainer@@QAEXHPBUsml_pcdata_s@@@Z @ 89 NONAME ; void CNSmlResultsContainer::SetCmdIDL(int, struct sml_pcdata_s const *)
+	?ServerAlertNextStatusCmdStateL@CNSmlAgentBase@@IAEXPAUsml_status_s@@@Z @ 90 NONAME ; void CNSmlAgentBase::ServerAlertNextStatusCmdStateL(struct sml_status_s *)
+	?ProcessExecCmdL@CNSmlCmdsBase@@UAEXPAUsml_exec_s@@@Z @ 91 NONAME ; void CNSmlCmdsBase::ProcessExecCmdL(struct sml_exec_s *)
+	?HostName@CNSmlURI@@QAE?AVTPtrC16@@XZ @ 92 NONAME ; class TPtrC16 CNSmlURI::HostName(void)
+	?DoCancel@CNSmlAgentBase@@UAEXXZ @ 93 NONAME ; void CNSmlAgentBase::DoCancel(void)
+	?SyncLog@CNSmlAgentBase@@QAEPAVCSyncMLHistoryJob@@XZ @ 94 NONAME ; class CSyncMLHistoryJob * CNSmlAgentBase::SyncLog(void)
+	?StatusDataToGenericCommandL@CNSmlCmdsBase@@IAEHABVTDesC8@@PBUsml_generic_s@@PBUsml_item_s@@W4TNSmlSyncMLStatusCode@TNSmlError@@PBV2@@Z @ 95 NONAME ; int CNSmlCmdsBase::StatusDataToGenericCommandL(class TDesC8 const &, struct sml_generic_s const *, struct sml_item_s const *, enum TNSmlError::TNSmlSyncMLStatusCode, class TDesC8 const *)
+	?ServerAlertNextAlertCmdStateL@CNSmlAgentBase@@IAEXPAUsml_alert_s@@@Z @ 96 NONAME ; void CNSmlAgentBase::ServerAlertNextAlertCmdStateL(struct sml_alert_s *)
+	?SaveIfNonceL@CNSmlAgentBase@@IBEXABVCNSmlResponseController@@H@Z @ 97 NONAME ; void CNSmlAgentBase::SaveIfNonceL(class CNSmlResponseController const &, int) const
+	?FetchIDMappingTableL@CNSmlCmdsBase@@UAEXH@Z @ 98 NONAME ; void CNSmlCmdsBase::FetchIDMappingTableL(int)
+	?ServerAuth@CNSmlCmdsBase@@QBEPAVCNSmlAuth@@XZ @ 99 NONAME ; class CNSmlAuth * CNSmlCmdsBase::ServerAuth(void) const
+	?NewLC@CNSmlPhoneInfo@@SAPAV1@XZ @ 100 NONAME ; class CNSmlPhoneInfo * CNSmlPhoneInfo::NewLC(void)
+	?smlDeleteCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_generic_s@@@Z @ 101 NONAME ; int CNSmlAgentBase::smlDeleteCmdFuncL(struct sml_generic_s *)
+	?InitStartingMessageStateBaseL@CNSmlAgentBase@@IAEXXZ @ 102 NONAME ; void CNSmlAgentBase::InitStartingMessageStateBaseL(void)
+	?DeleteIDMappingTableL@CNSmlCmdsBase@@UAEHABVTDesC16@@0@Z @ 103 NONAME ; int CNSmlCmdsBase::DeleteIDMappingTableL(class TDesC16 const &, class TDesC16 const &)
+	?StatusReference@CNSmlAgentBase@@QAEAAVTRequestStatus@@XZ @ 104 NONAME ; class TRequestStatus & CNSmlAgentBase::StatusReference(void)
+	?SetCredentialL@CNSmlAuth@@QAEXABVTDesC8@@@Z @ 105 NONAME ; void CNSmlAuth::SetCredentialL(class TDesC8 const &)
+	?DoAnchorsL@CNSmlCmdsBase@@IBEXAAUsml_metinf_metinf_s@@PBVTDesC8@@1@Z @ 106 NONAME ; void CNSmlCmdsBase::DoAnchorsL(struct sml_metinf_metinf_s &, class TDesC8 const *, class TDesC8 const *) const
+	?DoSourceL@CNSmlCmdsBase@@QBEXAAPAUsml_source_s@@ABVTDesC8@@@Z @ 107 NONAME ; void CNSmlCmdsBase::DoSourceL(struct sml_source_s * &, class TDesC8 const &) const
+	?DoTargetL@CNSmlCmdsBase@@QBEXAAPAUsml_target_s@@ABVTDesC16@@1@Z @ 108 NONAME ; void CNSmlCmdsBase::DoTargetL(struct sml_target_s * &, class TDesC16 const &, class TDesC16 const &) const
+	?DoGenericAlertL@CNSmlCmdsBase@@UAEXABVTDesC8@@00H0@Z @ 109 NONAME ; void CNSmlCmdsBase::DoGenericAlertL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, int, class TDesC8 const &)
+	?ProcessMapCmdL@CNSmlCmdsBase@@UAEXPAUsml_map_s@@@Z @ 110 NONAME ; void CNSmlCmdsBase::ProcessMapCmdL(struct sml_map_s *)
+	?ReceivingStateL@CNSmlAgentBase@@IAEXXZ @ 111 NONAME ; void CNSmlAgentBase::ReceivingStateL(void)
+	??4CNSmlURI@@QAEAAV0@ABV0@@Z @ 112 NONAME ; class CNSmlURI & CNSmlURI::operator=(class CNSmlURI const &)
+	?ProcessReceivedDataL@CNSmlCmdsBase@@QAEHXZ @ 113 NONAME ; int CNSmlCmdsBase::ProcessReceivedDataL(void)
+	?SetPerformedInAtomic@CNSmlStatusContainer@@QAEXH@Z @ 114 NONAME ; void CNSmlStatusContainer::SetPerformedInAtomic(int)
+	?SetMoreData@CNSmlResponseController@@QAEXH@Z @ 115 NONAME ; void CNSmlResponseController::SetMoreData(int)
+	?DatabaseMatchesL@CNSmlURI@@QAEHABVTDesC16@@@Z @ 116 NONAME ; int CNSmlURI::DatabaseMatchesL(class TDesC16 const &)
+	?LastEntryID@CNSmlStatusContainer@@QBEHXZ @ 117 NONAME ; int CNSmlStatusContainer::LastEntryID(void) const
+	?ResponseController@CNSmlCmdsBase@@QBEPAVCNSmlResponseController@@XZ @ 118 NONAME ; class CNSmlResponseController * CNSmlCmdsBase::ResponseController(void) const
+	?SetResponseDetail@CNSmlResponseController@@QAEXHW4TResponseDetail@1@@Z @ 119 NONAME ; void CNSmlResponseController::SetResponseDetail(int, enum CNSmlResponseController::TResponseDetail)
+	?ResultAlertStateL@CNSmlAgentBase@@IAEXXZ @ 120 NONAME ; void CNSmlAgentBase::ResultAlertStateL(void)
+	?ConstructL@CNSmlCmdsBase@@IAEXPAVCNSmlAgentBase@@ABVTDesC8@@1HABVHBufC16@@PAVCNSmlURI@@H@Z @ 121 NONAME ; void CNSmlCmdsBase::ConstructL(class CNSmlAgentBase *, class TDesC8 const &, class TDesC8 const &, int, class HBufC16 const &, class CNSmlURI *, int)
+	?DoCmdIdL@CNSmlCmdsBase@@IAEXAAPAUsml_pcdata_s@@@Z @ 122 NONAME ; void CNSmlCmdsBase::DoCmdIdL(struct sml_pcdata_s * &)
+	?smlSearchCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_search_s@@@Z @ 123 NONAME ; int CNSmlAgentBase::smlSearchCmdFuncL(struct sml_search_s *)
+	?IsFlagSet@CNSmlCmdsBase@@IBEHABI0@Z @ 124 NONAME ; int CNSmlCmdsBase::IsFlagSet(unsigned int const &, unsigned int const &) const
+	?SetServerNonceL@CNSmlAgentBase@@UBEXABVTDesC16@@@Z @ 125 NONAME ; void CNSmlAgentBase::SetServerNonceL(class TDesC16 const &) const
+	?DoTargetL@CNSmlCmdsBase@@QBEXAAPAUsml_target_s@@ABVTDesC8@@@Z @ 126 NONAME ; void CNSmlCmdsBase::DoTargetL(struct sml_target_s * &, class TDesC8 const &) const
+	?SetEndOfDataAlertRequest@CNSmlAgentBase@@QAEXXZ @ 127 NONAME ; void CNSmlAgentBase::SetEndOfDataAlertRequest(void)
+	?ServerUserName@CNSmlAgentBase@@MBE?AVTPtrC16@@XZ @ 128 NONAME ; class TPtrC16 CNSmlAgentBase::ServerUserName(void) const
+	?ClientAlertNextStateL@CNSmlAgentBase@@IAEXXZ @ 129 NONAME ; void CNSmlAgentBase::ClientAlertNextStateL(void)
+	?NewLC@CNSmlURI@@SAPAV1@XZ @ 130 NONAME ; class CNSmlURI * CNSmlURI::NewLC(void)
+	?DisconnectFromOtherServers@CNSmlCmdsBase@@UAEXXZ @ 131 NONAME ; void CNSmlCmdsBase::DisconnectFromOtherServers(void)
+	?SyncLogMessageCode@TNSmlError@@UAEHXZ @ 132 NONAME ; int TNSmlError::SyncLogMessageCode(void)
+	?ServerModEndMessageStateL@CNSmlAgentBase@@IAEXH@Z @ 133 NONAME ; void CNSmlAgentBase::ServerModEndMessageStateL(int)
+	?HBufC8InUTF8LC@NSmlUnicodeConverter@@SAHABVTDesC16@@AAPAVHBufC8@@@Z @ 134 NONAME ; int NSmlUnicodeConverter::HBufC8InUTF8LC(class TDesC16 const &, class HBufC8 * &)
+	?ProcessSearchCmdL@CNSmlCmdsBase@@UAEXPAUsml_search_s@@@Z @ 135 NONAME ; void CNSmlCmdsBase::ProcessSearchCmdL(struct sml_search_s *)
+	?ProfileId@CNSmlAgentBase@@QBEHXZ @ 136 NONAME ; int CNSmlAgentBase::ProfileId(void) const
+	?smlCopyCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_generic_s@@@Z @ 137 NONAME ; int CNSmlAgentBase::smlCopyCmdFuncL(struct sml_generic_s *)
+	?NewL@CNSmlURI@@SAPAV1@XZ @ 138 NONAME ; class CNSmlURI * CNSmlURI::NewL(void)
+	?DoGenericUserAlertL@CNSmlCmdsBase@@UAEHH@Z @ 139 NONAME ; int CNSmlCmdsBase::DoGenericUserAlertL(int)
+	?HBufC16InUnicodeL@NSmlUnicodeConverter@@SAHABVTDesC8@@AAPAVHBufC16@@@Z @ 140 NONAME ; int NSmlUnicodeConverter::HBufC16InUnicodeL(class TDesC8 const &, class HBufC16 * &)
+	?MoreData@CNSmlResponseController@@QBEHH@Z @ 141 NONAME ; int CNSmlResponseController::MoreData(int) const
+	?RemoveWritten@CNSmlResultsContainer@@QAEXH@Z @ 142 NONAME ; void CNSmlResultsContainer::RemoveWritten(int)
+	?MetaTypeInUtf8LC@CNSmlCmdsBase@@IBEPAVHBufC8@@PBUsml_pcdata_s@@@Z @ 143 NONAME ; class HBufC8 * CNSmlCmdsBase::MetaTypeInUtf8LC(struct sml_pcdata_s const *) const
+	?StatusDataToGetCommandL@CNSmlCmdsBase@@IAEHPBUsml_get_put_s@@PBUsml_item_s@@W4TNSmlSyncMLStatusCode@TNSmlError@@PBVTDesC8@@@Z @ 144 NONAME ; int CNSmlCmdsBase::StatusDataToGetCommandL(struct sml_get_put_s const *, struct sml_item_s const *, enum TNSmlError::TNSmlSyncMLStatusCode, class TDesC8 const *)
+	?AppIndex@CNSmlResponseController@@QBEHH@Z @ 145 NONAME ; int CNSmlResponseController::AppIndex(int) const
+	?WaitingLargeObjectChunk@CNSmlCmdsBase@@QBEHXZ @ 146 NONAME ; int CNSmlCmdsBase::WaitingLargeObjectChunk(void) const
+	?SetMaximumWorkspaceSize@CNSmlCmdsBase@@QAEXH@Z @ 147 NONAME ; void CNSmlCmdsBase::SetMaximumWorkspaceSize(int)
+	?StatusCode@CNSmlResponseController@@QBEHH@Z @ 148 NONAME ; int CNSmlResponseController::StatusCode(int) const
+	?smlExecCmdFuncL@CNSmlAgentBase@@UAEHPAUsml_exec_s@@@Z @ 149 NONAME ; int CNSmlAgentBase::smlExecCmdFuncL(struct sml_exec_s *)
+	?EntryID@CNSmlResponseController@@QBEHHH@Z @ 150 NONAME ; int CNSmlResponseController::EntryID(int, int) const
+	?ProcessSyncHdrL@CNSmlCmdsBase@@UAEXPAUsml_sync_hdr_s@@@Z @ 151 NONAME ; void CNSmlCmdsBase::ProcessSyncHdrL(struct sml_sync_hdr_s *)
+	?ProcessCopyCmdL@CNSmlCmdsBase@@UAEXPAUsml_generic_s@@@Z @ 152 NONAME ; void CNSmlCmdsBase::ProcessCopyCmdL(struct sml_generic_s *)
+	?ServerNonceAllocL@CNSmlAgentBase@@UBEPAVHBufC16@@XZ @ 153 NONAME ; class HBufC16 * CNSmlAgentBase::ServerNonceAllocL(void) const
+	?ResultsContainer@CNSmlCmdsBase@@QBEPAVCNSmlResultsContainer@@XZ @ 154 NONAME ; class CNSmlResultsContainer * CNSmlCmdsBase::ResultsContainer(void) const
+	?DataUpdateStatusMakingMapStateL@CNSmlAgentBase@@MAEXXZ @ 155 NONAME ; void CNSmlAgentBase::DataUpdateStatusMakingMapStateL(void)
+	?SetSyncAgent@CNSmlAuth@@QAEXPAVCNSmlAgentBase@@@Z @ 156 NONAME ; void CNSmlAuth::SetSyncAgent(class CNSmlAgentBase *)
+	?MetaFormatInUtf8LC@CNSmlCmdsBase@@IBEPAVHBufC8@@PBUsml_pcdata_s@@@Z @ 157 NONAME ; class HBufC8 * CNSmlCmdsBase::MetaFormatInUtf8LC(struct sml_pcdata_s const *) const
+	?ResponseDetail@CNSmlResponseController@@QBE?AW4TResponseDetail@1@H@Z @ 158 NONAME ; enum CNSmlResponseController::TResponseDetail CNSmlResponseController::ResponseDetail(int) const
+	?StatusID@CNSmlResultsContainer@@QBEHH@Z @ 159 NONAME ; int CNSmlResultsContainer::StatusID(int) const
+	?ErrorCodeConversion@TNSmlError@@MAEXXZ @ 160 NONAME ; void TNSmlError::ErrorCodeConversion(void)
+	?ServerMaxObjSize@CNSmlCmdsBase@@IBEHPBUsml_pcdata_s@@@Z @ 161 NONAME ; int CNSmlCmdsBase::ServerMaxObjSize(struct sml_pcdata_s const *) const
+	?ServerModStartMessageStateL@CNSmlAgentBase@@IAEXPAUsml_sync_hdr_s@@@Z @ 162 NONAME ; void CNSmlAgentBase::ServerModStartMessageStateL(struct sml_sync_hdr_s *)
+	?CallbackCalled@CNSmlAgentBase@@QBEHXZ @ 163 NONAME ; int CNSmlAgentBase::CallbackCalled(void) const
+	?PcdataNewL@CNSmlCmdsBase@@QBEXAAPAUsml_pcdata_s@@ABVTDesC8@@@Z @ 164 NONAME ; void CNSmlCmdsBase::PcdataNewL(struct sml_pcdata_s * &, class TDesC8 const &) const
+	?NextResultsElement@CNSmlResultsContainer@@QAEHAAPAUsml_results_s@@@Z @ 165 NONAME ; int CNSmlResultsContainer::NextResultsElement(struct sml_results_s * &)
+	?SetAppIndex@CNSmlResponseController@@QAEXHH@Z @ 166 NONAME ; void CNSmlResponseController::SetAppIndex(int, int)
+	?Begin@CNSmlResultsContainer@@QAEXXZ @ 167 NONAME ; void CNSmlResultsContainer::Begin(void)
+	?SetDatabaseL@CNSmlURI@@QAEXABVTDesC8@@H@Z @ 168 NONAME ; void CNSmlURI::SetDatabaseL(class TDesC8 const &, int)
+	?CreateNewResultsL@CNSmlResultsContainer@@QAEHABVTDesC8@@0PBUsml_target_s@@PBUsml_source_s@@@Z @ 169 NONAME ; int CNSmlResultsContainer::CreateNewResultsL(class TDesC8 const &, class TDesC8 const &, struct sml_target_s const *, struct sml_source_s const *)
+	?SyncMLDatabaseAllocLC@CNSmlURI@@QAEPAVHBufC16@@XZ @ 170 NONAME ; class HBufC16 * CNSmlURI::SyncMLDatabaseAllocLC(void)
+	?DataUpdateStatusStartingMessageStateBaseL@CNSmlAgentBase@@IAEXXZ @ 171 NONAME ; void CNSmlAgentBase::DataUpdateStatusStartingMessageStateBaseL(void)
+	?DataUpdateStatusMakingResultsStateL@CNSmlAgentBase@@MAEXXZ @ 172 NONAME ; void CNSmlAgentBase::DataUpdateStatusMakingResultsStateL(void)
+	??0CNSmlAgentBase@@QAE@XZ @ 173 NONAME ; CNSmlAgentBase::CNSmlAgentBase(void)
+	?NewLC@CNSmlURI@@SAPAV1@ABVTDesC8@@H@Z @ 174 NONAME ; class CNSmlURI * CNSmlURI::NewLC(class TDesC8 const &, int)
+	?ServerAlertNextStateL@CNSmlAgentBase@@IAEXXZ @ 175 NONAME ; void CNSmlAgentBase::ServerAlertNextStateL(void)
+	?LUID@CNSmlResponseController@@QBE?AVTPtrC8@@H@Z @ 176 NONAME ; class TPtrC8 CNSmlResponseController::LUID(int) const
+	?NextStatusElement@CNSmlStatusContainer@@QAEHAAPAUsml_status_s@@H@Z @ 177 NONAME ; int CNSmlStatusContainer::NextStatusElement(struct sml_status_s * &, int)
+	?AuthenticationRequirementL@CNSmlAgentBase@@IAEHABVCNSmlResponseController@@H@Z @ 178 NONAME ; int CNSmlAgentBase::AuthenticationRequirementL(class CNSmlResponseController const &, int)
+	?StatusDataToCommandL@CNSmlCmdsBase@@IAEHABVTDesC8@@PBUsml_pcdata_s@@IPBUsml_item_s@@W4TNSmlSyncMLStatusCode@TNSmlError@@PBV2@@Z @ 179 NONAME ; int CNSmlCmdsBase::StatusDataToCommandL(class TDesC8 const &, struct sml_pcdata_s const *, unsigned int, struct sml_item_s const *, enum TNSmlError::TNSmlSyncMLStatusCode, class TDesC8 const *)
+	?SourceIsUnderItem@CNSmlCmdsBase@@IBEHPBUsml_item_list_s@@@Z @ 180 NONAME ; int CNSmlCmdsBase::SourceIsUnderItem(struct sml_item_list_s const *) const
+	?SetStatusID@CNSmlResultsContainer@@QAEXHH@Z @ 181 NONAME ; void CNSmlResultsContainer::SetStatusID(int, int)
+	?CreateNewStatusElementL@CNSmlStatusContainer@@QAEHXZ @ 182 NONAME ; int CNSmlStatusContainer::CreateNewStatusElementL(void)
+	?FreeBaseResources@CNSmlAgentBase@@IAEXXZ @ 183 NONAME ; void CNSmlAgentBase::FreeBaseResources(void)
+	??1CNSmlCmdsBase@@UAE@XZ @ 184 NONAME ; CNSmlCmdsBase::~CNSmlCmdsBase(void)
+	?NewL@CNSmlURI@@SAPAV1@ABVTDesC16@@H@Z @ 185 NONAME ; class CNSmlURI * CNSmlURI::NewL(class TDesC16 const &, int)
+	?NewL@CNSmlAuth@@SAPAV1@XZ @ 186 NONAME ; class CNSmlAuth * CNSmlAuth::NewL(void)
+	?DataBaseWithoutRelativePrefix@CNSmlURI@@QAE?AVTPtrC16@@XZ @ 187 NONAME ; class TPtrC16 CNSmlURI::DataBaseWithoutRelativePrefix(void)
+	?Database@CNSmlURI@@QAE?AVTPtrC16@@XZ @ 188 NONAME ; class TPtrC16 CNSmlURI::Database(void)
+	?DoMaxObjSizeL@CNSmlCmdsBase@@IBEXAAUsml_metinf_metinf_s@@H@Z @ 189 NONAME ; void CNSmlCmdsBase::DoMaxObjSizeL(struct sml_metinf_metinf_s &, int) const
+	?SyncLogErrorCode@TNSmlError@@QAEHXZ @ 190 NONAME ; int TNSmlError::SyncLogErrorCode(void)
+	?ClientAlertNextMakingMapStateL@CNSmlAgentBase@@MAEXXZ @ 191 NONAME ; void CNSmlAgentBase::ClientAlertNextMakingMapStateL(void)
+	?TargetIsUnderItem@CNSmlCmdsBase@@IBEHPBUsml_item_list_s@@@Z @ 192 NONAME ; int CNSmlCmdsBase::TargetIsUnderItem(struct sml_item_list_s const *) const
+	?ServerAlertNextStartMessageStateL@CNSmlAgentBase@@IAEXPAUsml_sync_hdr_s@@@Z @ 193 NONAME ; void CNSmlAgentBase::ServerAlertNextStartMessageStateL(struct sml_sync_hdr_s *)
+	?BeginningStateL@CNSmlAgentBase@@IAEXXZ @ 194 NONAME ; void CNSmlAgentBase::BeginningStateL(void)
 
--- a/syncmlfw/common/syncagent/bld/DEF/eabiu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/bld/DEF/eabiu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -58,169 +58,172 @@
 	_ZN14CNSmlAgentBase17ResultAlertStateLEv @ 57 NONAME
 	_ZN14CNSmlAgentBase17smlDeleteCmdFuncLEP13sml_generic_s @ 58 NONAME
 	_ZN14CNSmlAgentBase17smlSearchCmdFuncLEP12sml_search_s @ 59 NONAME
-	_ZN14CNSmlAgentBase18LaunchAutoRestartLEi @ 60 NONAME
-	_ZN14CNSmlAgentBase18smlReplaceCmdFuncLEP13sml_generic_s @ 61 NONAME
-	_ZN14CNSmlAgentBase20SetOffCallbackCalledEv @ 62 NONAME
-	_ZN14CNSmlAgentBase21ClientAlertNextStateLEv @ 63 NONAME
-	_ZN14CNSmlAgentBase21ServerAlertNextStateLEv @ 64 NONAME
-	_ZN14CNSmlAgentBase22DataUpdateStatusStateLEv @ 65 NONAME
-	_ZN14CNSmlAgentBase23ServerModAlertCmdStateLEP11sml_alert_s @ 66 NONAME
-	_ZN14CNSmlAgentBase24ServerModStatusCmdStateLEP12sml_status_s @ 67 NONAME
-	_ZN14CNSmlAgentBase24SetEndOfDataAlertRequestEv @ 68 NONAME
-	_ZN14CNSmlAgentBase25ServerModEndMessageStateLEi @ 69 NONAME
-	_ZN14CNSmlAgentBase26AuthenticationRequirementLERK23CNSmlResponseControlleri @ 70 NONAME
-	_ZN14CNSmlAgentBase26ClientInitialisationStateLEv @ 71 NONAME
-	_ZN14CNSmlAgentBase26InitAskingDeviceInfoStateLEv @ 72 NONAME
-	_ZN14CNSmlAgentBase27ServerModStartMessageStateLEP14sml_sync_hdr_s @ 73 NONAME
-	_ZN14CNSmlAgentBase28CheckStatusCodesAreReceivedLEi @ 74 NONAME
-	_ZN14CNSmlAgentBase29InitStartingMessageStateBaseLEv @ 75 NONAME
-	_ZN14CNSmlAgentBase29ServerAlertNextAlertCmdStateLEP11sml_alert_s @ 76 NONAME
-	_ZN14CNSmlAgentBase30ClientAlertNextMakingMapStateLEv @ 77 NONAME
-	_ZN14CNSmlAgentBase30ServerAlertNextStatusCmdStateLEP12sml_status_s @ 78 NONAME
-	_ZN14CNSmlAgentBase31DataUpdateStatusMakingMapStateLEv @ 79 NONAME
-	_ZN14CNSmlAgentBase31ServerAlertNextEndMessageStateLEi @ 80 NONAME
-	_ZN14CNSmlAgentBase33ServerAlertNextStartMessageStateLEP14sml_sync_hdr_s @ 81 NONAME
-	_ZN14CNSmlAgentBase35DataUpdateStatusMakingResultsStateLEv @ 82 NONAME
-	_ZN14CNSmlAgentBase41DataUpdateStatusStartingMessageStateBaseLEv @ 83 NONAME
-	_ZN14CNSmlAgentBase4RunLEv @ 84 NONAME
-	_ZN14CNSmlAgentBase7SyncLogEv @ 85 NONAME
-	_ZN14CNSmlAgentBase8DoCancelEv @ 86 NONAME
-	_ZN14CNSmlAgentBaseC2Ev @ 87 NONAME
-	_ZN14CNSmlAgentBaseD0Ev @ 88 NONAME
-	_ZN14CNSmlAgentBaseD1Ev @ 89 NONAME
-	_ZN14CNSmlAgentBaseD2Ev @ 90 NONAME
-	_ZN14CNSmlPhoneInfo10SwVersionLEv @ 91 NONAME
-	_ZN14CNSmlPhoneInfo4NewLEv @ 92 NONAME
-	_ZN14CNSmlPhoneInfo5NewLCEv @ 93 NONAME
-	_ZN20CNSmlStatusContainer10SetCmdRefLEiPK12sml_pcdata_s @ 94 NONAME
-	_ZN20CNSmlStatusContainer12AddItemDataLEiPK12sml_pcdata_s @ 95 NONAME
-	_ZN20CNSmlStatusContainer13AddSourceRefLEiPK12sml_source_s @ 96 NONAME
-	_ZN20CNSmlStatusContainer13AddTargetRefLEiPK12sml_target_s @ 97 NONAME
-	_ZN20CNSmlStatusContainer13SetNoResponseEii @ 98 NONAME
-	_ZN20CNSmlStatusContainer14SetStatusCodeLEiii @ 99 NONAME
-	_ZN20CNSmlStatusContainer17NextStatusElementERP12sml_status_si @ 100 NONAME
-	_ZN20CNSmlStatusContainer20SetPerformedInAtomicEi @ 101 NONAME
-	_ZN20CNSmlStatusContainer21SetAtomicOrSequenceIdEii @ 102 NONAME
-	_ZN20CNSmlStatusContainer23CreateNewStatusElementLEv @ 103 NONAME
-	_ZN20CNSmlStatusContainer23SetStatusCodesInAtomicLEiii @ 104 NONAME
-	_ZN20CNSmlStatusContainer35SetStatusCodeToAtomicOrSequenceCmdLEiiRK6TDesC8 @ 105 NONAME
-	_ZN20CNSmlStatusContainer5BeginEv @ 106 NONAME
-	_ZN20CNSmlStatusContainer7SetCmdLEiRK6TDesC8 @ 107 NONAME
-	_ZN20NSmlUnicodeConverter14HBufC8InUTF8LCERK7TDesC16RP6HBufC8 @ 108 NONAME
-	_ZN20NSmlUnicodeConverter17HBufC16InUnicodeLERK6TDesC8RP7HBufC16 @ 109 NONAME
-	_ZN20NSmlUnicodeConverter18HBufC16InUnicodeLCERK6TDesC8RP7HBufC16 @ 110 NONAME
-	_ZN21CNSmlResultsContainer11SetStatusIDEii @ 111 NONAME
-	_ZN21CNSmlResultsContainer13RemoveWrittenEi @ 112 NONAME
-	_ZN21CNSmlResultsContainer17CreateNewResultsLERK6TDesC8S2_PK12sml_target_sPK12sml_source_s @ 113 NONAME
-	_ZN21CNSmlResultsContainer18NextResultsElementERP13sml_results_s @ 114 NONAME
-	_ZN21CNSmlResultsContainer5BeginEv @ 115 NONAME
-	_ZN21CNSmlResultsContainer8AddItemLEiRK8CBufBaseRK6TDesC8S5_ @ 116 NONAME
-	_ZN21CNSmlResultsContainer9SetCmdIDLEiPK12sml_pcdata_s @ 117 NONAME
-	_ZN23CNSmlResponseController11SetAppIndexEii @ 118 NONAME
-	_ZN23CNSmlResponseController11SetMoreDataEi @ 119 NONAME
-	_ZN23CNSmlResponseController17SetResponseDetailEiNS_15TResponseDetailE @ 120 NONAME
-	_ZN23CNSmlResponseController6ResetLEv @ 121 NONAME
-	_ZN23CNSmlResponseController8SetLUIDLEiRK6TDesC8 @ 122 NONAME
-	_ZN8CNSmlURI12SetDatabaseLERK6TDesC8i @ 123 NONAME
-	_ZN8CNSmlURI12SetDatabaseLERK7TDesC16i @ 124 NONAME
-	_ZN8CNSmlURI12SetHostNameLERK6TDesC8i @ 125 NONAME
-	_ZN8CNSmlURI12SetHostNameLERK7TDesC16i @ 126 NONAME
-	_ZN8CNSmlURI16DatabaseMatchesLERK7TDesC16 @ 127 NONAME
-	_ZN8CNSmlURI17HostNameWithPortLEi @ 128 NONAME
-	_ZN8CNSmlURI21HostNameInUTF8AllocLCEv @ 129 NONAME
-	_ZN8CNSmlURI21SyncMLDatabaseAllocLCEv @ 130 NONAME
-	_ZN8CNSmlURI29DataBaseWithoutRelativePrefixEv @ 131 NONAME
-	_ZN8CNSmlURI4NewLERK6TDesC8i @ 132 NONAME
-	_ZN8CNSmlURI4NewLERK7TDesC16i @ 133 NONAME
-	_ZN8CNSmlURI4NewLEv @ 134 NONAME
-	_ZN8CNSmlURI5NewLCERK6TDesC8i @ 135 NONAME
-	_ZN8CNSmlURI5NewLCERK7TDesC16i @ 136 NONAME
-	_ZN8CNSmlURI5NewLCEv @ 137 NONAME
-	_ZN8CNSmlURI7SetPortEi @ 138 NONAME
-	_ZN8CNSmlURI8DatabaseEv @ 139 NONAME
-	_ZN8CNSmlURI8HostNameEv @ 140 NONAME
-	_ZN8CNSmlURI8IsEqualLERKS_i @ 141 NONAME
-	_ZN8CNSmlURIaSERKS_ @ 142 NONAME
-	_ZN9CNSmlAuth12SetSyncAgentEP14CNSmlAgentBase @ 143 NONAME
-	_ZN9CNSmlAuth14SetCredentialLERK6TDesC8 @ 144 NONAME
-	_ZN9CNSmlAuth16SetAuthRequiredLEv @ 145 NONAME
-	_ZN9CNSmlAuth4NewLEv @ 146 NONAME
-	_ZNK13CNSmlCmdsBase10BusyStatusEv @ 147 NONAME
-	_ZNK13CNSmlCmdsBase10DoAnchorsLER19sml_metinf_metinf_sPK6TDesC8S4_ @ 148 NONAME
-	_ZNK13CNSmlCmdsBase10DoMetInfLCERP19sml_metinf_metinf_s @ 149 NONAME
-	_ZNK13CNSmlCmdsBase10MetaTypeLCEPK12sml_pcdata_s @ 150 NONAME
-	_ZNK13CNSmlCmdsBase10PcdataNewLERP12sml_pcdata_sRK6TDesC8 @ 151 NONAME
-	_ZNK13CNSmlCmdsBase10ServerAuthEv @ 152 NONAME
-	_ZNK13CNSmlCmdsBase13DoMaxObjSizeLER19sml_metinf_metinf_si @ 153 NONAME
-	_ZNK13CNSmlCmdsBase15StatusContainerEv @ 154 NONAME
-	_ZNK13CNSmlCmdsBase16MetaTypeInUtf8LCEPK12sml_pcdata_s @ 155 NONAME
-	_ZNK13CNSmlCmdsBase16ResultsContainerEv @ 156 NONAME
-	_ZNK13CNSmlCmdsBase16ServerMaxObjSizeEPK12sml_pcdata_s @ 157 NONAME
-	_ZNK13CNSmlCmdsBase16ServerObjectSizeEPK12sml_pcdata_s @ 158 NONAME
-	_ZNK13CNSmlCmdsBase17PCDATAToUnicodeLCERK12sml_pcdata_sRP7HBufC16 @ 159 NONAME
-	_ZNK13CNSmlCmdsBase17SourceIsUnderItemEPK15sml_item_list_s @ 160 NONAME
-	_ZNK13CNSmlCmdsBase17TargetIsUnderItemEPK15sml_item_list_s @ 161 NONAME
-	_ZNK13CNSmlCmdsBase18MetaFormatInUtf8LCEPK12sml_pcdata_s @ 162 NONAME
-	_ZNK13CNSmlCmdsBase18ResponseControllerEv @ 163 NONAME
-	_ZNK13CNSmlCmdsBase19EndOfServerMessageLEv @ 164 NONAME
-	_ZNK13CNSmlCmdsBase21TrimRightSpaceAndNullER5TDes8 @ 165 NONAME
-	_ZNK13CNSmlCmdsBase21WriteMappingInfoToDbLEv @ 166 NONAME
-	_ZNK13CNSmlCmdsBase23WaitingLargeObjectChunkEv @ 167 NONAME
-	_ZNK13CNSmlCmdsBase7DoMetaLERP12sml_pcdata_sPK19sml_metinf_metinf_s @ 168 NONAME
-	_ZNK13CNSmlCmdsBase7RespURIEv @ 169 NONAME
-	_ZNK13CNSmlCmdsBase9AlertCodeEP11sml_alert_s @ 170 NONAME
-	_ZNK13CNSmlCmdsBase9DoSourceLERP12sml_source_sRK6TDesC8 @ 171 NONAME
-	_ZNK13CNSmlCmdsBase9DoSourceLERP12sml_source_sRK7TDesC16 @ 172 NONAME
-	_ZNK13CNSmlCmdsBase9DoSourceLERP12sml_source_sRK7TDesC16S5_ @ 173 NONAME
-	_ZNK13CNSmlCmdsBase9DoTargetLERP12sml_target_sRK6TDesC8 @ 174 NONAME
-	_ZNK13CNSmlCmdsBase9DoTargetLERP12sml_target_sRK7TDesC16 @ 175 NONAME
-	_ZNK13CNSmlCmdsBase9DoTargetLERP12sml_target_sRK7TDesC16S5_ @ 176 NONAME
-	_ZNK13CNSmlCmdsBase9IsFlagSetERKjS1_ @ 177 NONAME
-	_ZNK14CNSmlAgentBase12SaveIfNonceLERK23CNSmlResponseControlleri @ 178 NONAME
-	_ZNK14CNSmlAgentBase14CallbackCalledEv @ 179 NONAME
-	_ZNK14CNSmlAgentBase14ServerPasswordEv @ 180 NONAME
-	_ZNK14CNSmlAgentBase14ServerUserNameEv @ 181 NONAME
-	_ZNK14CNSmlAgentBase15SetServerNonceLERK7TDesC16 @ 182 NONAME
-	_ZNK14CNSmlAgentBase17ServerNonceAllocLEv @ 183 NONAME
-	_ZNK14CNSmlAgentBase9ProfileIdEv @ 184 NONAME
-	_ZNK14CNSmlPhoneInfo10PhoneDataLENS_12TPhoneIdTypeER6TDes16 @ 185 NONAME
-	_ZNK20CNSmlStatusContainer11LastEntryIDEv @ 186 NONAME
-	_ZNK21CNSmlResultsContainer10AnyResultsEv @ 187 NONAME
-	_ZNK21CNSmlResultsContainer14CurrentEntryIDEv @ 188 NONAME
-	_ZNK21CNSmlResultsContainer8StatusIDEi @ 189 NONAME
-	_ZNK23CNSmlResponseController10StatusCodeEi @ 190 NONAME
-	_ZNK23CNSmlResponseController14ResponseDetailEi @ 191 NONAME
-	_ZNK23CNSmlResponseController3CmdEi @ 192 NONAME
-	_ZNK23CNSmlResponseController4LUIDEi @ 193 NONAME
-	_ZNK23CNSmlResponseController7EntryIDEii @ 194 NONAME
-	_ZNK23CNSmlResponseController8AppIndexEi @ 195 NONAME
-	_ZNK23CNSmlResponseController8ChalTypeEi @ 196 NONAME
-	_ZNK23CNSmlResponseController8MoreDataEi @ 197 NONAME
-	_ZNK9CNSmlAuth10ChallengedEv @ 198 NONAME
-	_ZTI10TNSmlError @ 199 NONAME
-	_ZTI13CNSmlCmdsBase @ 200 NONAME
-	_ZTI14CNSmlAgentBase @ 201 NONAME
-	_ZTI14CNSmlPhoneInfo @ 202 NONAME
-	_ZTI20CNSmlStatusContainer @ 203 NONAME
-	_ZTI21CNSmlResultsContainer @ 204 NONAME
-	_ZTI23CNSmlResponseController @ 205 NONAME
-	_ZTI8CNSmlURI @ 206 NONAME
-	_ZTI9CNSmlAuth @ 207 NONAME
-	_ZTV10TNSmlError @ 208 NONAME
-	_ZTV13CNSmlCmdsBase @ 209 NONAME
-	_ZTV14CNSmlAgentBase @ 210 NONAME
-	_ZTV14CNSmlPhoneInfo @ 211 NONAME
-	_ZTV20CNSmlStatusContainer @ 212 NONAME
-	_ZTV21CNSmlResultsContainer @ 213 NONAME
-	_ZTV23CNSmlResponseController @ 214 NONAME
-	_ZTV8CNSmlURI @ 215 NONAME
-	_ZTV9CNSmlAuth @ 216 NONAME
-	_ZThn28_N14CNSmlAgentBase14smlAddCmdFuncLEP13sml_generic_s @ 217 NONAME
-	_ZThn28_N14CNSmlAgentBase14smlMapCmdFuncLEP9sml_map_s @ 218 NONAME
-	_ZThn28_N14CNSmlAgentBase15smlCopyCmdFuncLEP13sml_generic_s @ 219 NONAME
-	_ZThn28_N14CNSmlAgentBase15smlExecCmdFuncLEP10sml_exec_s @ 220 NONAME
-	_ZThn28_N14CNSmlAgentBase15smlMoveCmdFuncLEP13sml_generic_s @ 221 NONAME
-	_ZThn28_N14CNSmlAgentBase17smlDeleteCmdFuncLEP13sml_generic_s @ 222 NONAME
-	_ZThn28_N14CNSmlAgentBase17smlSearchCmdFuncLEP12sml_search_s @ 223 NONAME
-	_ZThn28_N14CNSmlAgentBase18smlReplaceCmdFuncLEP13sml_generic_s @ 224 NONAME
+	_ZN14CNSmlAgentBase18CheckAPBearerTypeLEm @ 60 NONAME
+	_ZN14CNSmlAgentBase18LaunchAutoRestartLEi @ 61 NONAME
+	_ZN14CNSmlAgentBase18smlReplaceCmdFuncLEP13sml_generic_s @ 62 NONAME
+	_ZN14CNSmlAgentBase20SetOffCallbackCalledEv @ 63 NONAME
+	_ZN14CNSmlAgentBase21ClientAlertNextStateLEv @ 64 NONAME
+	_ZN14CNSmlAgentBase21ServerAlertNextStateLEv @ 65 NONAME
+	_ZN14CNSmlAgentBase22DataUpdateStatusStateLEv @ 66 NONAME
+	_ZN14CNSmlAgentBase23ServerModAlertCmdStateLEP11sml_alert_s @ 67 NONAME
+	_ZN14CNSmlAgentBase24ServerModStatusCmdStateLEP12sml_status_s @ 68 NONAME
+	_ZN14CNSmlAgentBase24SetEndOfDataAlertRequestEv @ 69 NONAME
+	_ZN14CNSmlAgentBase25ServerModEndMessageStateLEi @ 70 NONAME
+	_ZN14CNSmlAgentBase26AuthenticationRequirementLERK23CNSmlResponseControlleri @ 71 NONAME
+	_ZN14CNSmlAgentBase26ClientInitialisationStateLEv @ 72 NONAME
+	_ZN14CNSmlAgentBase26InitAskingDeviceInfoStateLEv @ 73 NONAME
+	_ZN14CNSmlAgentBase27ServerModStartMessageStateLEP14sml_sync_hdr_s @ 74 NONAME
+	_ZN14CNSmlAgentBase28CheckStatusCodesAreReceivedLEi @ 75 NONAME
+	_ZN14CNSmlAgentBase29InitStartingMessageStateBaseLEv @ 76 NONAME
+	_ZN14CNSmlAgentBase29ServerAlertNextAlertCmdStateLEP11sml_alert_s @ 77 NONAME
+	_ZN14CNSmlAgentBase30ClientAlertNextMakingMapStateLEv @ 78 NONAME
+	_ZN14CNSmlAgentBase30ServerAlertNextStatusCmdStateLEP12sml_status_s @ 79 NONAME
+	_ZN14CNSmlAgentBase31DataUpdateStatusMakingMapStateLEv @ 80 NONAME
+	_ZN14CNSmlAgentBase31ServerAlertNextEndMessageStateLEi @ 81 NONAME
+	_ZN14CNSmlAgentBase33ServerAlertNextStartMessageStateLEP14sml_sync_hdr_s @ 82 NONAME
+	_ZN14CNSmlAgentBase35DataUpdateStatusMakingResultsStateLEv @ 83 NONAME
+	_ZN14CNSmlAgentBase41DataUpdateStatusStartingMessageStateBaseLEv @ 84 NONAME
+	_ZN14CNSmlAgentBase4RunLEv @ 85 NONAME
+	_ZN14CNSmlAgentBase7SyncLogEv @ 86 NONAME
+	_ZN14CNSmlAgentBase8DoCancelEv @ 87 NONAME
+	_ZN14CNSmlAgentBaseC2Ev @ 88 NONAME
+	_ZN14CNSmlAgentBaseD0Ev @ 89 NONAME
+	_ZN14CNSmlAgentBaseD1Ev @ 90 NONAME
+	_ZN14CNSmlAgentBaseD2Ev @ 91 NONAME
+	_ZN14CNSmlPhoneInfo10SwVersionLEv @ 92 NONAME
+	_ZN14CNSmlPhoneInfo4NewLEv @ 93 NONAME
+	_ZN14CNSmlPhoneInfo5NewLCEv @ 94 NONAME
+	_ZN20CNSmlStatusContainer10SetCmdRefLEiPK12sml_pcdata_s @ 95 NONAME
+	_ZN20CNSmlStatusContainer10StatusItemEi @ 96 NONAME
+	_ZN20CNSmlStatusContainer12AddItemDataLEiPK12sml_pcdata_s @ 97 NONAME
+	_ZN20CNSmlStatusContainer13AddSourceRefLEiPK12sml_source_s @ 98 NONAME
+	_ZN20CNSmlStatusContainer13AddTargetRefLEiPK12sml_target_s @ 99 NONAME
+	_ZN20CNSmlStatusContainer13FillItemDataLERP10sml_item_s @ 100 NONAME
+	_ZN20CNSmlStatusContainer13SetNoResponseEii @ 101 NONAME
+	_ZN20CNSmlStatusContainer14SetStatusCodeLEiii @ 102 NONAME
+	_ZN20CNSmlStatusContainer17NextStatusElementERP12sml_status_si @ 103 NONAME
+	_ZN20CNSmlStatusContainer20SetPerformedInAtomicEi @ 104 NONAME
+	_ZN20CNSmlStatusContainer21SetAtomicOrSequenceIdEii @ 105 NONAME
+	_ZN20CNSmlStatusContainer23CreateNewStatusElementLEv @ 106 NONAME
+	_ZN20CNSmlStatusContainer23SetStatusCodesInAtomicLEiii @ 107 NONAME
+	_ZN20CNSmlStatusContainer35SetStatusCodeToAtomicOrSequenceCmdLEiiRK6TDesC8 @ 108 NONAME
+	_ZN20CNSmlStatusContainer5BeginEv @ 109 NONAME
+	_ZN20CNSmlStatusContainer7SetCmdLEiRK6TDesC8 @ 110 NONAME
+	_ZN20NSmlUnicodeConverter14HBufC8InUTF8LCERK7TDesC16RP6HBufC8 @ 111 NONAME
+	_ZN20NSmlUnicodeConverter17HBufC16InUnicodeLERK6TDesC8RP7HBufC16 @ 112 NONAME
+	_ZN20NSmlUnicodeConverter18HBufC16InUnicodeLCERK6TDesC8RP7HBufC16 @ 113 NONAME
+	_ZN21CNSmlResultsContainer11SetStatusIDEii @ 114 NONAME
+	_ZN21CNSmlResultsContainer13RemoveWrittenEi @ 115 NONAME
+	_ZN21CNSmlResultsContainer17CreateNewResultsLERK6TDesC8S2_PK12sml_target_sPK12sml_source_s @ 116 NONAME
+	_ZN21CNSmlResultsContainer18NextResultsElementERP13sml_results_s @ 117 NONAME
+	_ZN21CNSmlResultsContainer5BeginEv @ 118 NONAME
+	_ZN21CNSmlResultsContainer8AddItemLEiRK8CBufBaseRK6TDesC8S5_ @ 119 NONAME
+	_ZN21CNSmlResultsContainer9SetCmdIDLEiPK12sml_pcdata_s @ 120 NONAME
+	_ZN23CNSmlResponseController11SetAppIndexEii @ 121 NONAME
+	_ZN23CNSmlResponseController11SetMoreDataEi @ 122 NONAME
+	_ZN23CNSmlResponseController17SetResponseDetailEiNS_15TResponseDetailE @ 123 NONAME
+	_ZN23CNSmlResponseController6ResetLEv @ 124 NONAME
+	_ZN23CNSmlResponseController8SetLUIDLEiRK6TDesC8 @ 125 NONAME
+	_ZN8CNSmlURI12SetDatabaseLERK6TDesC8i @ 126 NONAME
+	_ZN8CNSmlURI12SetDatabaseLERK7TDesC16i @ 127 NONAME
+	_ZN8CNSmlURI12SetHostNameLERK6TDesC8i @ 128 NONAME
+	_ZN8CNSmlURI12SetHostNameLERK7TDesC16i @ 129 NONAME
+	_ZN8CNSmlURI16DatabaseMatchesLERK7TDesC16 @ 130 NONAME
+	_ZN8CNSmlURI17HostNameWithPortLEi @ 131 NONAME
+	_ZN8CNSmlURI21HostNameInUTF8AllocLCEv @ 132 NONAME
+	_ZN8CNSmlURI21SyncMLDatabaseAllocLCEv @ 133 NONAME
+	_ZN8CNSmlURI29DataBaseWithoutRelativePrefixEv @ 134 NONAME
+	_ZN8CNSmlURI4NewLERK6TDesC8i @ 135 NONAME
+	_ZN8CNSmlURI4NewLERK7TDesC16i @ 136 NONAME
+	_ZN8CNSmlURI4NewLEv @ 137 NONAME
+	_ZN8CNSmlURI5NewLCERK6TDesC8i @ 138 NONAME
+	_ZN8CNSmlURI5NewLCERK7TDesC16i @ 139 NONAME
+	_ZN8CNSmlURI5NewLCEv @ 140 NONAME
+	_ZN8CNSmlURI7SetPortEi @ 141 NONAME
+	_ZN8CNSmlURI8DatabaseEv @ 142 NONAME
+	_ZN8CNSmlURI8HostNameEv @ 143 NONAME
+	_ZN8CNSmlURI8IsEqualLERKS_i @ 144 NONAME
+	_ZN8CNSmlURIaSERKS_ @ 145 NONAME
+	_ZN9CNSmlAuth12SetSyncAgentEP14CNSmlAgentBase @ 146 NONAME
+	_ZN9CNSmlAuth14SetCredentialLERK6TDesC8 @ 147 NONAME
+	_ZN9CNSmlAuth16SetAuthRequiredLEv @ 148 NONAME
+	_ZN9CNSmlAuth4NewLEv @ 149 NONAME
+	_ZNK13CNSmlCmdsBase10BusyStatusEv @ 150 NONAME
+	_ZNK13CNSmlCmdsBase10DoAnchorsLER19sml_metinf_metinf_sPK6TDesC8S4_ @ 151 NONAME
+	_ZNK13CNSmlCmdsBase10DoMetInfLCERP19sml_metinf_metinf_s @ 152 NONAME
+	_ZNK13CNSmlCmdsBase10MetaTypeLCEPK12sml_pcdata_s @ 153 NONAME
+	_ZNK13CNSmlCmdsBase10PcdataNewLERP12sml_pcdata_sRK6TDesC8 @ 154 NONAME
+	_ZNK13CNSmlCmdsBase10ServerAuthEv @ 155 NONAME
+	_ZNK13CNSmlCmdsBase13DoMaxObjSizeLER19sml_metinf_metinf_si @ 156 NONAME
+	_ZNK13CNSmlCmdsBase15StatusContainerEv @ 157 NONAME
+	_ZNK13CNSmlCmdsBase16MetaTypeInUtf8LCEPK12sml_pcdata_s @ 158 NONAME
+	_ZNK13CNSmlCmdsBase16ResultsContainerEv @ 159 NONAME
+	_ZNK13CNSmlCmdsBase16ServerMaxObjSizeEPK12sml_pcdata_s @ 160 NONAME
+	_ZNK13CNSmlCmdsBase16ServerObjectSizeEPK12sml_pcdata_s @ 161 NONAME
+	_ZNK13CNSmlCmdsBase17PCDATAToUnicodeLCERK12sml_pcdata_sRP7HBufC16 @ 162 NONAME
+	_ZNK13CNSmlCmdsBase17SourceIsUnderItemEPK15sml_item_list_s @ 163 NONAME
+	_ZNK13CNSmlCmdsBase17TargetIsUnderItemEPK15sml_item_list_s @ 164 NONAME
+	_ZNK13CNSmlCmdsBase18MetaFormatInUtf8LCEPK12sml_pcdata_s @ 165 NONAME
+	_ZNK13CNSmlCmdsBase18ResponseControllerEv @ 166 NONAME
+	_ZNK13CNSmlCmdsBase19EndOfServerMessageLEv @ 167 NONAME
+	_ZNK13CNSmlCmdsBase21TrimRightSpaceAndNullER5TDes8 @ 168 NONAME
+	_ZNK13CNSmlCmdsBase21WriteMappingInfoToDbLEv @ 169 NONAME
+	_ZNK13CNSmlCmdsBase23WaitingLargeObjectChunkEv @ 170 NONAME
+	_ZNK13CNSmlCmdsBase7DoMetaLERP12sml_pcdata_sPK19sml_metinf_metinf_s @ 171 NONAME
+	_ZNK13CNSmlCmdsBase7RespURIEv @ 172 NONAME
+	_ZNK13CNSmlCmdsBase9AlertCodeEP11sml_alert_s @ 173 NONAME
+	_ZNK13CNSmlCmdsBase9DoSourceLERP12sml_source_sRK6TDesC8 @ 174 NONAME
+	_ZNK13CNSmlCmdsBase9DoSourceLERP12sml_source_sRK7TDesC16 @ 175 NONAME
+	_ZNK13CNSmlCmdsBase9DoSourceLERP12sml_source_sRK7TDesC16S5_ @ 176 NONAME
+	_ZNK13CNSmlCmdsBase9DoTargetLERP12sml_target_sRK6TDesC8 @ 177 NONAME
+	_ZNK13CNSmlCmdsBase9DoTargetLERP12sml_target_sRK7TDesC16 @ 178 NONAME
+	_ZNK13CNSmlCmdsBase9DoTargetLERP12sml_target_sRK7TDesC16S5_ @ 179 NONAME
+	_ZNK13CNSmlCmdsBase9IsFlagSetERKjS1_ @ 180 NONAME
+	_ZNK14CNSmlAgentBase12SaveIfNonceLERK23CNSmlResponseControlleri @ 181 NONAME
+	_ZNK14CNSmlAgentBase14CallbackCalledEv @ 182 NONAME
+	_ZNK14CNSmlAgentBase14ServerPasswordEv @ 183 NONAME
+	_ZNK14CNSmlAgentBase14ServerUserNameEv @ 184 NONAME
+	_ZNK14CNSmlAgentBase15SetServerNonceLERK7TDesC16 @ 185 NONAME
+	_ZNK14CNSmlAgentBase17ServerNonceAllocLEv @ 186 NONAME
+	_ZNK14CNSmlAgentBase9ProfileIdEv @ 187 NONAME
+	_ZNK14CNSmlPhoneInfo10PhoneDataLENS_12TPhoneIdTypeER6TDes16 @ 188 NONAME
+	_ZNK20CNSmlStatusContainer11LastEntryIDEv @ 189 NONAME
+	_ZNK21CNSmlResultsContainer10AnyResultsEv @ 190 NONAME
+	_ZNK21CNSmlResultsContainer14CurrentEntryIDEv @ 191 NONAME
+	_ZNK21CNSmlResultsContainer8StatusIDEi @ 192 NONAME
+	_ZNK23CNSmlResponseController10StatusCodeEi @ 193 NONAME
+	_ZNK23CNSmlResponseController14ResponseDetailEi @ 194 NONAME
+	_ZNK23CNSmlResponseController3CmdEi @ 195 NONAME
+	_ZNK23CNSmlResponseController4LUIDEi @ 196 NONAME
+	_ZNK23CNSmlResponseController7EntryIDEii @ 197 NONAME
+	_ZNK23CNSmlResponseController8AppIndexEi @ 198 NONAME
+	_ZNK23CNSmlResponseController8ChalTypeEi @ 199 NONAME
+	_ZNK23CNSmlResponseController8MoreDataEi @ 200 NONAME
+	_ZNK9CNSmlAuth10ChallengedEv @ 201 NONAME
+	_ZTI10TNSmlError @ 202 NONAME
+	_ZTI13CNSmlCmdsBase @ 203 NONAME
+	_ZTI14CNSmlAgentBase @ 204 NONAME
+	_ZTI14CNSmlPhoneInfo @ 205 NONAME
+	_ZTI20CNSmlStatusContainer @ 206 NONAME
+	_ZTI21CNSmlResultsContainer @ 207 NONAME
+	_ZTI23CNSmlResponseController @ 208 NONAME
+	_ZTI8CNSmlURI @ 209 NONAME
+	_ZTI9CNSmlAuth @ 210 NONAME
+	_ZTV10TNSmlError @ 211 NONAME
+	_ZTV13CNSmlCmdsBase @ 212 NONAME
+	_ZTV14CNSmlAgentBase @ 213 NONAME
+	_ZTV14CNSmlPhoneInfo @ 214 NONAME
+	_ZTV20CNSmlStatusContainer @ 215 NONAME
+	_ZTV21CNSmlResultsContainer @ 216 NONAME
+	_ZTV23CNSmlResponseController @ 217 NONAME
+	_ZTV8CNSmlURI @ 218 NONAME
+	_ZTV9CNSmlAuth @ 219 NONAME
+	_ZThn28_N14CNSmlAgentBase14smlAddCmdFuncLEP13sml_generic_s @ 220 NONAME
+	_ZThn28_N14CNSmlAgentBase14smlMapCmdFuncLEP9sml_map_s @ 221 NONAME
+	_ZThn28_N14CNSmlAgentBase15smlCopyCmdFuncLEP13sml_generic_s @ 222 NONAME
+	_ZThn28_N14CNSmlAgentBase15smlExecCmdFuncLEP10sml_exec_s @ 223 NONAME
+	_ZThn28_N14CNSmlAgentBase15smlMoveCmdFuncLEP13sml_generic_s @ 224 NONAME
+	_ZThn28_N14CNSmlAgentBase17smlDeleteCmdFuncLEP13sml_generic_s @ 225 NONAME
+	_ZThn28_N14CNSmlAgentBase17smlSearchCmdFuncLEP12sml_search_s @ 226 NONAME
+	_ZThn28_N14CNSmlAgentBase18smlReplaceCmdFuncLEP13sml_generic_s @ 227 NONAME
 
--- a/syncmlfw/common/syncagent/bld/NSmlAgentCommon.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/bld/NSmlAgentCommon.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -59,6 +59,7 @@
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	/epoc32/include/libc
 SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/http 
 
 LIBRARY         euser.lib     
 LIBRARY         charconv.lib
@@ -74,16 +75,16 @@
 LIBRARY         nsmlwbxml.lib
 LIBRARY         nsmlxml.lib
 LIBRARY		centralrepository.lib
+LIBRARY         bafl.lib
 LIBRARY         inetprotutil.lib
-LIBRARY         bafl.lib
 
 #ifdef ARMCC
-LIBRARY ecom.lib
+LIBRARY ECOM.LIB
 #endif
 //RD_AUTO_RESTART
 LIBRARY         commdb.lib 
 LIBRARY         esock.lib 
-LIBRARY         cmmanager.lib
+LIBRARY         apengine.lib
 //RD_AUTO_RESTART
 
 SMPSAFE
--- a/syncmlfw/common/syncagent/inc/NSmlAgentBase.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/inc/NSmlAgentBase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -25,6 +25,9 @@
 #include "nsmlerror.h"
 #include "nsmlagenttestdefines.h"
 
+//Rnd_AutoRestart
+#include <ApEngineConsts.h>
+//Rnd_AutoRestart
 //DATA TYPES
 enum TNSmlSyncInitiation    
 	{		
@@ -83,6 +86,7 @@
 	IMPORT_C virtual void DoOutsideCancel();
 	//Rnd_AutoRestart
 	IMPORT_C virtual void LaunchAutoRestartL(TInt aError);
+	IMPORT_C TApBearerType CheckAPBearerTypeL( const TUint32 aIAPId );
 	void ReadAcessPointL();
 	//Rnd_AutoRestart
 	
@@ -356,7 +360,7 @@
 	//Rnd_AutoRestart
 	TBool iPacketDataUnAvailable;
 	TUint32 iNetmonAPId;
-	TBool iAllowAutoRestart;
+	TApBearerType iNetmonAPBearerType;
 	//Rnd_AutoRestart
 	
     protected:    // Data	
--- a/syncmlfw/common/syncagent/inc/NSmlStatusContainer.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/inc/NSmlStatusContainer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -70,6 +70,11 @@
 	//  
 	TBool AnyOtherThanOkSyncHdrStatus() const;
 	
+	// Populates the Item structure
+	IMPORT_C void FillItemDataL( SmlItem_t*& aItem );
+	// Retrieve the Status element bearing the ID provided
+	IMPORT_C SmlStatus_t* StatusItem( TInt aStatusID );
+	
 	private:
 	void ConstructL( TBool aClearText);
 	CNSmlStatusContainer();
--- a/syncmlfw/common/syncagent/src/NSmlAgentBase.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/src/NSmlAgentBase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -50,10 +50,10 @@
 #include <es_sock.h> // RConnection RSocket
 #include <es_enum.h> // TConnectionInfo
 #include <commdb.h>
-#include <cmconnectionmethoddef.h>
-#include <cmconnectionmethod.h>
-#include <cmmanager.h>
-#include <cmpluginwlandef.h>
+#include <ApListItemList.h>
+#include <ApListItem.h>
+#include <ApSelect.h>
+#include <ApUtils.h>
 #include "nsmlhttp.h"
 
 //Fix to Remove the Bad Compiler Warnings
@@ -451,7 +451,7 @@
 	//Auto_Restart
     iPacketDataUnAvailable = EFalse;    
     iNetmonAPId = 0;
-    iAllowAutoRestart = EFalse;
+    iNetmonAPBearerType = TApBearerType(-1);
 	}
 
 
@@ -958,6 +958,7 @@
     				if(error == KErrNone && val == 1)
 					{
 		       		
+			       		DBG_FILE_CODE(iNetmonAPBearerType, _S8("CNSmlAgentBase::SendingStateL The Network Bearer Type is"));
 			       		DBG_FILE_CODE(err, _S8("CNSmlAgentBase::SendingStateL The Network Error is"));
 			       		
 			       		if(err == TNSmlHTTPErrCode::ENSmlHTTPErr_RequestTimeout)
@@ -970,7 +971,8 @@
 			       			LaunchAutoRestartL(err);
 			       		}
 		       		
-			       		else if( iAllowAutoRestart )
+			       		else if(iNetmonAPBearerType == EApBearerTypeGPRS ||
+		    				   iNetmonAPBearerType == EApBearerTypeCDMA )
 			       		{
 			       			DBG_FILE(_S8("CNSmlAgentBase::SendingStateL Waiting for 30 sec"));
 			       			User::After(TTimeIntervalMicroSeconds32(30000000));
@@ -1603,29 +1605,74 @@
 				connectionInfo );	
 		iNetmonAPId = connectionInfo().iIapId;
 		DBG_FILE_CODE(iNetmonAPId, _S8("CNSmlAgentBase::ReadAcessPointL(), The IAPId is:"));
-		RCmManager  cmmanager;
-		cmmanager.OpenL();
-		CleanupClosePushL(cmmanager);
-		RCmConnectionMethod cm;
-		cm = cmmanager.ConnectionMethodL( iNetmonAPId );
-		CleanupClosePushL( cm );
-		TUint32 bearer = 0;
-		//TRAP_IGNORE( accesspointId = cm.GetIntAttributeL(CMManager::ECmIapId) );?
-		bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );
-		CleanupStack::PopAndDestroy( 2 ); //cmmanager,cm
-		if ( bearer == KUidWlanBearerType )
-		{
-			 iAllowAutoRestart = EFalse;
-		}
-		else
-		{
-			iAllowAutoRestart = ETrue;
-		}
-	}
+		iNetmonAPBearerType = CheckAPBearerTypeL( iNetmonAPId );
+		DBG_FILE_CODE(TInt(iNetmonAPBearerType), _S8("CNSmlAgentBase::ReadAcessPointL(), The Enumerated IAPId is:"));
+    	
+    }
 
     myConnection.Close();
     socketServer.Close();
 }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgentBase::CheckAPBearerTypeL
+// Returns bearer type of the selected Access Point.
+// -----------------------------------------------------------------------------
+EXPORT_C TApBearerType CNSmlAgentBase::CheckAPBearerTypeL( const TUint32 aIAPId )
+{
+    // Create connection to the Access Points setting data.
+    CCommsDatabase* cAPCommsDatabase = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    
+    TApBearerType bearerType(TApBearerType(-1));
+    
+    // Attach to the Access Point Engine.
+    CApSelect* apSelect = CApSelect::NewLC( 
+                                        *cAPCommsDatabase,
+                                        KEApIspTypeAll,
+                                            EApBearerTypeWLAN |
+                                            EApBearerTypeCDMA |
+                                            EApBearerTypeGPRS,
+                                        KEApSortUidAscending,
+                                        EIPv4 | EIPv6
+                                        );
+    
+    // Create ApUtils for some utilities functions.
+    CApUtils* apUtils = CApUtils::NewLC( *cAPCommsDatabase );
+    
+    // Get supported Access Points from Access Point Engine..
+    CApListItemList* apItems = new (ELeave) CApListItemList;
+    CleanupStack::PushL( apItems );
+    apSelect->AllListItemDataL( *apItems );
+    
+    for ( TInt i = 0; i < apItems->Count(); i++ )
+        {
+        // Get id from APEngine and convert it to the CommsDB id.
+        TUint32 iapId = apUtils->IapIdFromWapIdL( apItems->At( i )->Uid() );
+        
+        // Change bearer type according to id match.
+        if ( aIAPId == iapId )
+            {
+            bearerType = apItems->At( i )->BearerType(); 
+            
+            //Getting the IAP name
+            const TDesC& name = apItems->At( i )->Name();
+		
+			DBG_ARGS(_S("CNSmlAgentBase::CheckAPBearerTypeL(), The IAP Name is: %S"), &name);         
+                   
+            i = apItems->Count();
+            }
+        }
+    
+    // PopAndDestroy some items.
+    CleanupStack::PopAndDestroy( apItems );
+    CleanupStack::PopAndDestroy( apUtils );
+    CleanupStack::PopAndDestroy( apSelect );
+    
+    delete cAPCommsDatabase;
+    
+    // Return bearer type.
+    return bearerType;    
+}
 //RD_AUTO_RESTART
 
 // ---------------------------------------------------------
@@ -1918,7 +1965,10 @@
 	if(iPacketDataUnAvailable)
 	{
 		DBG_FILE(_S8("CNSmlAgentBase::FinaliseWhenErrorL Prompting for a Dialog"));
-		iError->SetErrorCode( TNSmlError::ESmlCommunicationError);		
+		if (iError)
+			{
+			iError->SetErrorCode( TNSmlError::ESmlCommunicationError);		
+			}
 		User::RequestComplete( iCallerStatus, TNSmlError::ESmlCommunicationError );
 	}
 	//RD_AUTO_RESTART
--- a/syncmlfw/common/syncagent/src/nsmlstatuscontainer.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/syncagent/src/nsmlstatuscontainer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -16,13 +16,18 @@
 */
 
 
-
+#include <utf.h>
+#include <DevManInternalCRKeys.h>
+#include <centralrepository.h>
 //#include "nsmlcliagdefines.h"
 #include "NSmlStatusContainer.h"
 #include "nsmlcliagconstants.h"
 #include "nsmlerror.h"
 #include "smlmetinfdtd.h"
 
+// CONSTANTS
+_LIT8(KDbPersonal, "100000" );
+
 // ---------------------------------------------------------
 // CNSmlStatusContainer::CNSmlStatusContainer
 // Constructor, nothing special in here.
@@ -202,9 +207,57 @@
 			{
 			(*iStatusArray)[aEntryID-1].statusIsFixed = ETrue;
 			}
+ // TargertUri Fix
+		
+	TPtrC8 cmd( (TUint8*) (*iStatusArray)[aEntryID-1].status->cmd->content, (*iStatusArray)[aEntryID-1].status->cmd->length );
+	if ( cmd == KNSmlAgentExec )
+	{ 
+		CRepository* cenrep = NULL;
+  	TInt err(KErrNone);
+	  TRAP(err, cenrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys ));
+	  if(err == KErrNone)
+	  {
+	  	TBuf8<256> targetPath;	
+    	TInt result = cenrep->Get( KNSmlDMSCOMOTargetRef, targetPath );    	
+    	if((targetPath.Length()) && (result == KErrNone))
+			{					
+				TPtrC8 sourcePath( (TUint8*) (*iStatusArray)[aEntryID-1].status->targetRefList->targetRef->content, (*iStatusArray)[aEntryID-1].status->targetRefList->targetRef->length );
+			
+				(*iStatusArray)[aEntryID-1].status->itemList = new ( ELeave ) SmlItemList_t;
+				(*iStatusArray)[aEntryID-1].status->itemList->item = new( ELeave ) SmlItem_t;
+			
+				(*iStatusArray)[aEntryID-1].status->itemList->item->source = new( ELeave ) SmlSource_t; 
+    		(*iStatusArray)[aEntryID-1].status->itemList->item->source->locURI = new( ELeave ) SmlPcdata_t;
+	   		(*iStatusArray)[aEntryID-1].status->itemList->item->source->locURI->SetDataL( sourcePath );
+    		(*iStatusArray)[aEntryID-1].status->itemList->item->source->locURI->contentType = SML_PCDATA_OPAQUE;   
+    		(*iStatusArray)[aEntryID-1].status->itemList->item->source->locURI->extension = SML_EXT_UNDEFINED;
+    		(*iStatusArray)[aEntryID-1].status->itemList->item->source->locName = NULL;
+    		
+    		_LIT8( KNSmlNull,	"null" );
+    		if(targetPath.Compare( KNSmlNull )!= 0)
+    		{
+    			(*iStatusArray)[aEntryID-1].status->itemList->item->target = new( ELeave ) SmlTarget_t; 
+    			(*iStatusArray)[aEntryID-1].status->itemList->item->target->locURI = new( ELeave ) SmlPcdata_t;
+	   			(*iStatusArray)[aEntryID-1].status->itemList->item->target->locURI->SetDataL( targetPath );
+    			(*iStatusArray)[aEntryID-1].status->itemList->item->target->locURI->contentType = SML_PCDATA_OPAQUE;   
+    			(*iStatusArray)[aEntryID-1].status->itemList->item->target->locURI->extension = SML_EXT_UNDEFINED;
+    			(*iStatusArray)[aEntryID-1].status->itemList->item->target->locName = NULL;
+    		}
+ 				(*iStatusArray)[aEntryID-1].status->targetRefList = NULL;
+
+ 				_LIT8(KNullString, "");
+    		result = cenrep->Set( KNSmlDMSCOMOTargetRef, KNullString ); 
+    	}
+    	delete cenrep;
+    	cenrep = NULL;
 		}
+	}
+	
+	 // TargertUri Fix Ends
+	 
 	CleanupStack::PopAndDestroy(); //statusCode
 	}
+	}
 // ---------------------------------------------------------
 // CNSmlStatusContainer::SetChalL()
 // Creates Chal element 
@@ -484,6 +537,44 @@
 	return statusPresents;
 	}
 // ---------------------------------------------------------
+// CNSmlStatusContainer::FillItemDataL()
+// Populates the Item structure
+// ---------------------------------------------------------
+EXPORT_C void CNSmlStatusContainer::FillItemDataL( SmlItem_t*& aItem )
+    {
+    //Source
+    aItem->source = new( ELeave ) SmlSource_t;
+    SmlPcdata_t* srcdata = new( ELeave ) SmlPcdata_t;
+    srcdata->SetDataL( KDbPersonal );
+    srcdata->contentType = SML_PCDATA_OPAQUE;   
+    srcdata->extension = SML_EXT_UNDEFINED; 
+    CopyPcdataL( srcdata, aItem->source->locURI );
+    
+    // Source Parent
+    aItem->sourceParent = new( ELeave ) SmlSourceParent_t;
+    SmlPcdata_t* srcprntdata = new( ELeave ) SmlPcdata_t;
+    srcprntdata->SetDataL( _L8("/") );
+    srcprntdata->contentType = SML_PCDATA_OPAQUE;   
+    srcprntdata->extension = SML_EXT_UNDEFINED; 
+    CopyPcdataL( srcprntdata, aItem->sourceParent->locURI );   
+    }
+// ---------------------------------------------------------
+// CNSmlStatusContainer::StatusItem()
+// Retrieve the Status element bearing the ID provided
+// ---------------------------------------------------------
+EXPORT_C SmlStatus_t* CNSmlStatusContainer::StatusItem( TInt aStatusID )
+    {
+    
+    if( ( iStatusArray ) && 
+        ( iStatusArray->Count() <= aStatusID ) )
+        {
+        
+        return (*iStatusArray)[aStatusID-1].status;
+        }
+    
+    return NULL;
+    }
+// ---------------------------------------------------------
 // CNSmlStatusContainer::CreatePcdataL()
 // Creates Pcdata 
 // Created element is not pushed to Cleanup stack
--- a/syncmlfw/common/transport/bld/nsmltransport.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/transport/bld/nsmltransport.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -42,22 +42,22 @@
 
 MW_LAYER_SYSTEMINCLUDE
 
-SYSTEMINCLUDE		/epoc32/include/libc /epoc32/include/ecom
+SYSTEMINCLUDE		/epoc32/include/libc /epoc32/include/ecom	/epoc32/include/http
 
 USERINCLUDE     ../inc ../../http/inc ../../inc ../../wbxml/inc ../../wbxml/inc/syncml ../../syncagent/inc ../../debug/inc
 USERINCLUDE      ../../obex/obexcommserver/inc ../../obex/obexserverbinding/inc ../../obex/obexclient/inc
 
-LIBRARY     euser.lib
+LIBRARY         euser.lib
 LIBRARY			bluetooth.lib
 LIBRARY			nsmldebug.lib
-LIBRARY 		CommonEngine.lib // 1.2 CHANGES: Offline mode
-LIBRARY     commdb.lib
-LIBRARY     cmmanager.lib
-LIBRARY	    centralrepository.lib
-LIBRARY			featmgr.lib
+LIBRARY 	commonengine.lib // 1.2 CHANGES: Offline mode
+LIBRARY         commdb.lib
+LIBRARY         apengine.lib
+LIBRARY	    CENTRALREPOSITORY.LIB
+LIBRARY			FeatMgr.lib
 
 #ifdef ARMCC
-LIBRARY ecom.lib
+LIBRARY ECOM.LIB
 #endif
 
 SMPSAFE
--- a/syncmlfw/common/transport/src/nsmltransport.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/transport/src/nsmltransport.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -21,16 +21,13 @@
 #include <CoreApplicationUIsSDKCRKeys.h>
 #include <btengdomaincrkeys.h>
 #include <centralrepository.h>
+#include <ApUtils.h>
 #include "nsmltransport.h"
 #include "nsmlhttp.h"
 #include "NSmlObexClient.h"
 #include "nsmlobexserverbinding.h"
 #include "nsmlerror.h"  
 #include <featmgr.h>
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
-#include <cmpluginwlandef.h>
-
 
 //============================================================
 // CNSmlTransport definition
@@ -251,19 +248,14 @@
 			// 0xffffffff is same as -1 (KErrNotFound) and -2 for Default connection
                 {
                 TUint32 accesspointId = aIAPIdArray->At(0);
-                RCmManagerExt  cmmanagerExt;
-                cmmanagerExt.OpenL();
-                CleanupClosePushL(cmmanagerExt);
-                RCmConnectionMethodExt cm;
-                cm = cmmanagerExt.ConnectionMethodL( accesspointId );
-                CleanupClosePushL( cm );
-                TUint32 bearer = 0;
-                                
-                TRAP_IGNORE( accesspointId = cm.GetIntAttributeL(CMManager::ECmIapId) );
-                bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );
-                CleanupStack::PopAndDestroy( 2 ); //cmmanagerext,cm
+                CCommsDatabase* commDb = CCommsDatabase::NewL();
+                CleanupStack::PushL(commDb);
+                CApUtils* aputils = CApUtils::NewLC( *commDb );
+                TRAP_IGNORE( accesspointId = aputils->WapIdFromIapIdL( accesspointId ) );
+                TApBearerType bearerType = aputils->BearerTypeL( accesspointId );
+                CleanupStack::PopAndDestroy( 2 ); //commdb,aputils
                             
-                if ( bearer != KUidWlanBearerType )
+                if ( bearerType != EApBearerTypeWLAN )
                     {
                     	errormsg = ETrue;
                     }
--- a/syncmlfw/common/wbxml/bld/nsmlwbxml.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/wbxml/bld/nsmlwbxml.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -70,7 +70,7 @@
 LIBRARY         euser.lib estor.lib
 
 #ifdef ARMCC
-LIBRARY ecom.lib
+LIBRARY ECOM.LIB
 #endif
 
 SMPSAFE
--- a/syncmlfw/common/wbxml/src/syncml/smldtd.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/wbxml/src/syncml/smldtd.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -193,7 +193,7 @@
 		}
 	else
 		{
-		User::Free(content);
+		delete content;
 		}
 	content = 0;
 	}
--- a/syncmlfw/common/xml/bld/nsmlxml.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/common/xml/bld/nsmlxml.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -64,7 +64,7 @@
 LIBRARY         nsmlwbxml.lib euser.lib estor.lib
 
 #ifdef ARMCC
-LIBRARY ecom.lib
+LIBRARY ECOM.LIB
 #endif
 
 SMPSAFE
Binary file syncmlfw/conf/CI_devman.confml has changed
Binary file syncmlfw/conf/datasync.confml has changed
Binary file syncmlfw/conf/datasync_2000CF7E.crml has changed
Binary file syncmlfw/conf/devman.confml has changed
Binary file syncmlfw/conf/devman_101F9A0A.crml has changed
Binary file syncmlfw/conf/nsmloperatorsettings.confml has changed
Binary file syncmlfw/conf/nsmloperatorsettings_2002682E.crml has changed
Binary file syncmlfw/conf/operatordatasync.confml has changed
Binary file syncmlfw/conf/operatordatasync_2001E2E1.crml has changed
Binary file syncmlfw/conf/operatordatasyncerror.confml has changed
Binary file syncmlfw/conf/operatordatasyncerror_2001FDF1.crml has changed
--- a/syncmlfw/dm/adapters/inc/nsmldmimpluids.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/adapters/inc/nsmldmimpluids.h	Wed Sep 01 12:27:42 2010 +0100
@@ -39,4 +39,5 @@
 const TUint KNSmlDMFotaAdapterImplUid = 0x101F9A09;
 const TUint KNSmlDMAMAdapterImplUid = 0x20021336;
 const TUint KNSmlDMConnMOAdapterImplUid = 0x2001FE5F; 
+const TUint KNSmlDMLawMoAdapterImplUid = 0x2002EA23;
 #endif // __CNSMLDMIMPLUIDS_H__
--- a/syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -17,7 +17,8 @@
 
 // USER INCLUDES
 #include "DMNetworkMon.h"
-
+#include <e32property.h>
+#include <nsmldmconst.h>
 #include <SyncMLClient.h>
 #include <SyncMLClientDM.h>
 #include <nsmldmauthinfo.h>
@@ -480,20 +481,25 @@
 
         RSyncMLDevManJob dmJob;
 
-        TInt IAPID = -2;
+        TInt IAPID = -1;
         TBuf<10> genalertap,temp;
         genalertap.Zero();
         temp.Zero();	  
         genalertap.Append(KNSmlDMJobIapPrefix);
         temp.Num(iapid);//Decimal Iap
         if( temp.Length() <= KNSmlHalfTransportIdLength && 
-                iapid >= -2)
+                iapid > KErrNotFound)
             {
             genalertap.AppendFill('0',KNSmlHalfTransportIdLength-temp.Length());
             genalertap.Append(temp);
             TLex gavalue(genalertap);
             gavalue.Val(IAPID);
             LOGSTRING("DM JOB CREATED");
+            static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+            static _LIT_SECURITY_POLICY_C1(KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
+            RProperty::Define(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,RProperty::EInt,KAllowAllPolicy,KAllowWriteDeviceDataPolicy);
+           TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);           
+		    LOGSTRING2( "CDMNetworkMon::RunError() KNSmlDMSilentJob get error code = %i", r2);
             TRAPD(err, dmJob.CreateL( iSyncSession, ProfileId, IAPID));
             LOGSTRING("DM JOB CREATED END");
             if(err!=KErrNone)
--- a/syncmlfw/dm/provisioningadapter/bld/NSmlDmProvisioningAdapter.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/bld/NSmlDmProvisioningAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -49,8 +49,8 @@
 USERINCLUDE		../../../common/sosserver_transporthandler/inc
 
 
-LIBRARY         euser.lib commdb.lib charconv.lib bafl.lib efsrv.lib cmmanager.lib
-LIBRARY         nsmldebug.lib syncmlclientapi.lib NSmlPrivateAPI.lib
+LIBRARY         euser.lib commdb.lib charconv.lib bafl.lib efsrv.lib apengine.lib
+LIBRARY         nsmldebug.lib syncmlclientapi.lib nsmlprivateapi.lib
 LIBRARY         provisioningengine.lib featmgr.lib centralrepository.lib
 
 #ifdef ARMCC
--- a/syncmlfw/dm/provisioningadapter/inc/NSmlDmProvisioningAdapter.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/inc/NSmlDmProvisioningAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -164,6 +164,7 @@
 		RSyncMLSession iSession;
 		TUint iInitSession;
 		TUint iAuthSecretLimitIndicator;
+		TBool iLock;
 	};
 
 #endif	// NSMLDMPROVISIONINGADAPTER_H
--- a/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -23,14 +23,14 @@
 #include <cdbcols.h>			 // CommsDB columname defs
 #include <stringresourcereader.h>
 #include <barsread.h>
-#include <nsmldmprovisioningadapter.rsg>
+#include <NSmlDMProvisioningAdapter.rsg>
 #include <f32file.h>
 #include <bautils.h>
+#include <ApUtils.h>
 #include <utf.h>
 #include <featmgr.h>
 #include <barsc.h> 
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
+
 #include <nsmldebug.h>
 #include <CWPCharacteristic.h>
 #include <CWPParameter.h>
@@ -40,8 +40,6 @@
 #include "NSmlTransportHandler.h"
 
 #include <data_caging_path_literals.hrh>
-#define KMINPORT 0
-#define KMAXPORT 65536
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -61,6 +59,7 @@
 // -----------------------------------------------------------------------------
 void CNSmlDmProvisioningAdapter::ConstructL()
 	{
+    iLock = EFalse;
 	iSession.OpenL();
 	FeatureManager::InitializeLibL();
 	}
@@ -186,35 +185,7 @@
 		iAuthSecretLimitIndicator = 0;
 		User::Leave(KErrOverflow);
 	}
-	
-	//check for incorrect port
-	//Only port address between 1 to 65536 is allowed. 
-	if( iProfiles[aItem]->iPort )
-		{
-			const TDesC& port = iProfiles[aItem]->iPort->Des();
-			TInt len = port.Length();
-			if(len > 0)
-			{
-        HBufC* bufPort = port.AllocL();
-        TLex aLex(*bufPort);
-        TInt portNum ;
-        TInt err = aLex.Val(portNum);
-        if(bufPort)
-        {
-          delete bufPort;
-          bufPort = NULL;
-        }
-	    if(err != KErrNone)
-	    {
-          User::Leave(KErrGeneral);
-	    }
-	    if(!((portNum > KMINPORT) && (portNum < KMAXPORT)))
-	    {
-	      User::Leave(KErrGeneral);       
-	    }
-		}
-	}
-	
+
 	TPckgBuf<TUint32> uid;
 	
 	RSyncMLDevManProfile profile,ProfileToSearch;
@@ -247,9 +218,8 @@
 		TInt isprofilelocked=profile.ProfileLocked(EFalse, EFalse);
 		if (isprofilelocked == 1)
 		 {
-		  
-      profile.Close(); 
-      User::Leave(KErrAccessDenied); 	 	
+            profile.ProfileLocked(ETrue, EFalse);
+            iLock = ETrue;	 	
 		 }
 		
 		}
@@ -289,6 +259,14 @@
 	    }
 		    
 	// creates profile -> must be done before opening the connection
+
+	
+	if(iLock)
+	    {
+      profile.ProfileLocked(ETrue, ETrue);
+      iLock = EFalse;
+	    }
+	    
 	profile.UpdateL();
 	
 	RSyncMLConnection connection;
@@ -298,16 +276,13 @@
 	if( iProfiles[aItem]->iVisitParameter && iProfiles[aItem]->iVisitParameter->Data().Length() == uid.MaxLength() )
 		{
 		uid.Copy( iProfiles[aItem]->iVisitParameter->Data() );
-		
-		RCmManagerExt  cmmanagerExt;
-		cmmanagerExt.OpenL();
-		CleanupClosePushL(cmmanagerExt);
-		RCmConnectionMethodExt cm;
-		cm = cmmanagerExt.ConnectionMethodL( uid());
-		CleanupClosePushL( cm );
+
+		CCommsDatabase* commDb = CCommsDatabase::NewL();
+		CleanupStack::PushL( commDb );
+		CApUtils* aputils = CApUtils::NewLC( *commDb );
 
 		TUint apId = 0;
-		TRAPD( ERROR, apId = cm.GetIntAttributeL(CMManager::ECmIapId) );
+		TRAPD( ERROR, apId = aputils->IapIdFromWapIdL( uid() ) );
 		if( ERROR != KErrNone )
 			{
 			apId = GetDefaultIAPL();
@@ -319,7 +294,7 @@
 
 		connection.SetPropertyL( KNSmlIAPId, *iapBuf );
 		
-		CleanupStack::PopAndDestroy( 3 ); //cmmanager,cm, iapBuf
+		CleanupStack::PopAndDestroy( 3 ); //commdb, aputils, iapBuf		
 		}
 		
 	if( iProfiles[aItem]->iHostAddress )
@@ -459,7 +434,7 @@
 	    
 	    CleanupStack::PopAndDestroy(alertMessage);	    
 	    }
-
+	    
 	CleanupStack::PopAndDestroy( &profile );
 
 	_DBG_FILE("CNSmlDmProvisioningAdapter::SaveL(): end");
--- a/syncmlfw/dm/settings/bld/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/settings/bld/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -20,7 +20,7 @@
 PRJ_EXPORTS 
 
 ../conf/factorydmprofiles.gcfml				MW_LAYER_GCFML(factorydmprofiles.gcfml)
-../conf/CI_factorydmprofiles.confml  		MW_LAYER_CONFML(CI_factorydmprofiles.confml)
+../conf/factorydmprofiles.confml  		MW_LAYER_CONFML(factorydmprofiles.confml)
 
 PRJ_MMPFILES
 nsmldmsettings.mmp
Binary file syncmlfw/dm/settings/conf/CI_factorydmprofiles.confml has changed
Binary file syncmlfw/dm/settings/conf/factorydmprofiles.confml has changed
--- a/syncmlfw/dm/settings/inc/DMprofileContentHandler.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/settings/inc/DMprofileContentHandler.h	Wed Sep 01 12:27:42 2010 +0100
@@ -22,8 +22,8 @@
 //  INCLUDES
 #include <e32std.h>
 #include <f32file.h>
-#include <xml/MXMLAttributes.h>
-#include <xml/MXMLContentHandler.h>
+#include "mxmlattributes.h"
+#include "mxmlcontenthandler.h"
 #include "NSmlDMResourceProfile.h"
 
 const TInt KNSmlDmFileNameLength=255;
--- a/syncmlfw/dm/settings/src/DMProfileContentHandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/settings/src/DMProfileContentHandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -22,8 +22,10 @@
 #include <commdb.h>
 #include <nsmldebug.h>
 #include <featmgr.h>
+#include <centralrepository.h>
 #include "DMprofileContentHandler.h"
 #include "nsmldmsettings.h"
+#include "DevManInternalCRKeys.h"
 
 
 #define DES_AS_8_BIT(str) (TPtrC8((TText8*)((str).Ptr()), (str).Size()))
@@ -178,7 +180,8 @@
 	RemoveRSCEntryL();
 	TInt iapId = 0;
 	
-	for ( TInt i = 0; i < iProfileArray->Count(); i++ )
+	TInt count = iProfileArray->Count();
+	for ( TInt i = 0; i < count; i++ )
 	{
 		if(iProfileArray->At(i)->iAccessPoint)
 		{
@@ -210,6 +213,19 @@
 		CleanupStack::PopAndDestroy(); // profile
 							
 	}
+  CRepository* centrep = NULL;
+  TRAPD( err, centrep = CRepository::NewL(KCRUidDeviceManagementInternalKeys));  
+  if (err==KErrNone ) 
+  {
+  	TInt num(-1);
+  	TInt err = centrep->Get( KMaxFactoryDMProfileId , num );
+  	if( num >= 0 )
+  		err = centrep->Set( KMaxFactoryDMProfileId , (count + num ) );
+  	else
+  		err = centrep->Set( KMaxFactoryDMProfileId , count - 1);	
+    delete centrep;
+    centrep = NULL;
+	}
 	_DBG_FILE("CDMProfileContentHandler::SaveProfilesL(): end");
 }
 // -----------------------------------------------------------------------------
--- a/syncmlfw/dm/settings/src/NSmlDMResourceProfiles.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/settings/src/NSmlDMResourceProfiles.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -18,9 +18,11 @@
 
 
 // INCLUDE FILES
+#include <featmgr.h>
+#include <centralrepository.h>
 #include "nsmldmsettings.h"
 #include "NSmlDMResourceProfile.h"
-#include <featmgr.h>
+#include "DevManInternalCRKeys.h"
 const TInt KNSmlDmBluetoothType = 0x101F99F1;
 // ----------------------------------------------------------
 // CNSmlDMResourceProfiles implementation 
@@ -77,7 +79,8 @@
 	{
 	RemoveDuplicateEntry();
 	RemoveObexEntryL();
-	for ( TInt i = 0; i < iProfileArray->Count(); i++ )
+	TInt count = iProfileArray->Count();
+	for ( TInt i = 0; i < count ; i++ )
 		{
 		CNSmlDMProfile* profile = iSettings->CreateProfileL();
 		CleanupStack::PushL( profile );
@@ -85,6 +88,14 @@
 		profile->SaveL();
 		CleanupStack::PopAndDestroy(); // profile
 		}
+    CRepository* centrep = NULL;
+    TRAPD( err, centrep = CRepository::NewL(KCRUidDeviceManagementInternalKeys));  
+    if (err==KErrNone ) 
+    {
+        TInt err = centrep->Set( KMaxFactoryDMProfileId , count-1 );
+        delete centrep;
+        centrep = NULL;
+		}
 	}
 
 // ----------------------------------------------------------
--- a/syncmlfw/dm/settings/src/NSmlDMSettings.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/settings/src/NSmlDMSettings.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -16,20 +16,21 @@
 */
 
 
-#include <nsmldmprofileres.rsg>
+#include <NSmlDMProfileRes.rsg>
 #include <SyncMLDef.h>
 #include <utf.h>
+
 #include <nsmlconstants.h>
 #include <nsmldebug.h>
 #include <nsmldmconstants.h>
 #include <nsmldmtreedbclient.h>
-#include <xml/RXMLReader.h>
-#include <centralrepository.h>
 #include "nsmldmsettings.h"
 #include "barsc.h"
 #include "bautils.h"
 #include "NSmlDMResourceProfile.h"
 #include "DMprofileContentHandler.h"
+#include "rxmlreader.h"
+#include <centralrepository.h>
 #include "DevManInternalCRKeys.h"
 
 //------------------------------------------------------------------------------
--- a/syncmlfw/dm/syncagent/bld/nsmldmagent.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/syncagent/bld/nsmldmagent.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -56,10 +56,6 @@
 USERINCLUDE     ../../../common/historylog/inc
 SYSTEMINCLUDE   /epoc32/include/ecom
 
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbcore
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbwidgets
-SYSTEMINCLUDE		/epoc32/include/mw/hb/hbtools
-
 LIBRARY         euser.lib
 LIBRARY         estor.lib
 LIBRARY         nsmlagentcommon.lib
@@ -71,12 +67,12 @@
 LIBRARY         nsmldmmodule.lib 
 // FOTA
 LIBRARY			featmgr.lib
-LIBRARY			centralrepository.lib dmdevdialogclient.lib
+LIBRARY			centralrepository.lib
 // FOTA end
 
 //LIBRARY       nsmldmtestmodule.lib
 
-LIBRARY 		policyengine.lib HbWidgets.lib HbCore.lib flogger.lib
+LIBRARY 		policyengine.lib
 
 
 
--- a/syncmlfw/dm/syncagent/inc/NSmlDMAgent.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/syncagent/inc/NSmlDMAgent.h	Wed Sep 01 12:27:42 2010 +0100
@@ -22,10 +22,11 @@
 
 // INCLUDES
 #include <e32base.h>
-#include <devicedialogsymbian.h>
+#include "NSmlAgentBase.h"
+
+#include "SyncMLNotifierParams.h"
+#include "NSmlPrivateAPI.h"
 #include <DevManInternalCRKeys.h>
-#include "NSmlAgentBase.h"
-#include "NSmlPrivateAPI.h"
 
 // FORWARD DECLARATIONS
 class MSyncMLProgressObserver;
@@ -270,7 +271,8 @@
 	private:
 		TRequestStatus& iCallerStatus;
 		
-
+		RNotifier iNotifier;
+		TSyncMLAppLaunchNotifRetValPckg iResBuf;
 	
 		TInt& iCreatorId;
 		CNSmlAgentNotifierTimeOut iNotifierTimeOut;
--- a/syncmlfw/dm/syncagent/inc/NSmlDMCmds.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/syncagent/inc/NSmlDMCmds.h	Wed Sep 01 12:27:42 2010 +0100
@@ -70,12 +70,21 @@
 	void FreeDMDevinfo();
 	TInt AlertParameter ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const;
 //#ifdef RD_DM_TEXT_INPUT_ALERT //For User Input Server alert
+	TInt AlertInputTypeParameter ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const;
+	TInt AlertEchoTypeParameter ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const;
+	TBool CheckDRPresence( const SmlPcdata_t* aData, const TDesC8& aParamID ) const;
+	TPtrC8 AlertDefaultResponseParam ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const;
 //#endif
 	//singlechoice
+	HBufC8* AlertChoiceItemsLC( SmlItemList_t* aItemList, HBufC8*& aLengthBuf,TInt& aNumItems  ) const;
 	void HandleAlertsL( SmlAlert_t* aAlert, TInt& aStatusId);
 	void HandleAlertErrorL();
+	void HandleChoiceAlertsL( SmlAlert_t* aAlert, TInt& aStatusId);
+	void SendMultiChoiceDataToServerL(TDes8& aData,TInt& aStatusId);
 	void HandleConfirmationAlertL( SmlAlert_t* aAlert, TInt& aStatusId);
 	void HandleDisplayAlertL( SmlAlert_t* aAlert, TInt& aStatusId);
+	void HandleUserInputalertL( SmlAlert_t* aAlert, TInt& aStatusId);
+	TInt FindMaxLength(TInt aSourceLength, TInt aDestLength);
 	//singlechoice
 	HBufC8* AlertDataLC( const SmlItemList_t* aItemList ) const;
 	TInt InitStatusToAtomicOrSequenceL( const TDesC8& aCmd, const SmlAtomic_t* aAtomic ) const;
@@ -162,10 +171,6 @@
 	*/
 	void UpdateErrorStatusCode(SmlItem_t* aItem,TNSmlError::TNSmlSyncMLStatusCode& aStatusCode);
 	
-	
-	TBool IsHbSyncmlNotifierEnabledL();
-	void ServerHbNotifierL(TSyncMLDlgNoteTypes& aNotetype, TDesC& aServerMsg);
-	
 	//
 	private:     // Data
 	struct TDMDevInfo
--- a/syncmlfw/dm/syncagent/inc/OnlineSupportLogger.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
-* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  This file defines logging interface macros
-*
-*/
-
-
-#ifndef __LOGGER_H__
-#define __LOGGER_H__
-
-#ifdef _DEBUG
-    #define LOGGING_ENABLED
-#endif
-#ifdef LOGGING_ENABLED          // This must be enabled to use logging system
-
-#define LOGGER_LOGGING          // Log to Logger
-
-
-
-#ifdef LOGGER_LOGGING
-
-//  INCLUDES
-#include <flogger.h>
-
-// LOG SETTINGS 
-_LIT( KConfManagerLogFolder, "sync" );
-_LIT( KConfManagerLogFile, "Test1.TXT" );
-
-#endif
-
-// CONSTANTS  
-// None.
-
-// MACROS
-/*
------------------------------------------------------------------------------
-
-    INTERNAL MACROs. 
-
-    DO NOT USE THESE DIRECTLY !!! 
-    SEE EXTERNAL MACROS
-
------------------------------------------------------------------------------
-*/
-
-#ifdef LOGGER_LOGGING
-
-
-#define INTRLOGTEXT( AAA )                                                                                        \
-    {                                                                                                            \
-    RFileLogger::Write( KConfManagerLogFolder(), KConfManagerLogFile(), EFileLoggingModeAppend, AAA );            \
-    }
-#define INTRLOGSTRING( AAA )                                                                                    \
-    {                                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                                    \
-    RFileLogger::Write( KConfManagerLogFolder(), KConfManagerLogFile(), EFileLoggingModeAppend, tempLogDes() );    \
-    }
-#define INTRLOGSTRING2( AAA, BBB )                                                                                \
-    {                                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                                    \
-    RFileLogger::WriteFormat( KConfManagerLogFolder(), KConfManagerLogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB ); \
-    }
-#define INTRLOGSTRING3( AAA, BBB, CCC )                                                                            \
-    {                                                                                                            \
-    _LIT( tempLogDes, AAA );                                                                                    \
-    RFileLogger::WriteFormat( KConfManagerLogFolder(), KConfManagerLogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB, CCC ); \
-    }
-#else
-#define INTRLOGTEXT( AAA )
-#define INTRLOGSTRING( AAA )
-#define INTRLOGSTRING2( AAA, BBB )
-#define INTRLOGSTRING3( AAA, BBB, CCC )
-#endif
-
-/*
------------------------------------------------------------------------------
-
-    EXTERNAL MACROs
-
-    USE THESE MACROS IN YOUR CODE !
-
------------------------------------------------------------------------------
-*/
-
-
-#define LOGTEXT( AAA )                { \
-                                    INTRLOGTEXT( AAA ); \
-                                    }   // Example: LOGTEXT( own_desc );
-
-#define LOGSTRING( AAA )            { \
-                                    INTRLOGSTRING( AAA ); \
-                                    }   // Example: LOGSTRING( "Test" );
-
-#define LOGSTRING2( AAA, BBB )        { \
-                                    INTRLOGSTRING2( AAA, BBB ); \
-                                    }  // Example: LOGSTRING( "Test %i", aValue );
-
-#define LOGSTRING3( AAA, BBB, CCC )    { \
-                                    INTRLOGSTRING3( AAA, BBB, CCC ); \
-                                    } // Example: LOGSTRING( "Test %i %i", aValue1, aValue2 );
-
-
-#else   // LOGGING_ENABLED
-
-#define LOGTEXT( AAA ) 
-#define LOGSTRING( AAA ) 
-#define LOGSTRING2( AAA, BBB )    
-#define LOGSTRING3( AAA, BBB, CCC )    
-
-#endif  // LOGGING_ENABLED
-
-// DATA TYPES
-// None.
-
-// FUNCTION PROTOTYPES
-// None.
-
-// FORWARD DECLARATIONS
-// None.
-
-// CLASS DECLARATION
-// None.
-
-#endif  // __LOGGER_H__
\ No newline at end of file
--- a/syncmlfw/dm/syncagent/inc/nsmldmagconstants.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/syncagent/inc/nsmldmagconstants.h	Wed Sep 01 12:27:42 2010 +0100
@@ -33,7 +33,9 @@
 _LIT8( KNSmlDMAgentDisplayAlert, "1100" );
 _LIT8( KNSmlDMAgentContinueOrAbortAlert, "1101" );
 //#ifdef RD_DM_TEXT_INPUT_ALERT //for User Input Server alert
-
+_LIT8( KNSmlDMAgentUserInputAlert, "1102" );
+_LIT8( KNSmlDMAgentSingleChoiceAlert, "1103" );
+_LIT8( KNSmlDMAgentMultipleChoiceAlert, "1104" );
 //#endif
 // DM protocol version
 _LIT8( KNSmlDMAgentVerProto, "DM/1.1" );
--- a/syncmlfw/dm/syncagent/src/nsmldmagent.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/syncagent/src/nsmldmagent.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -50,6 +50,7 @@
 #include "NSmlPrivateAPI.h"
 // FOTA end
 #include <featmgr.h>
+const TUid KUidNotifier = { 0x101F8769 };
 const TInt KNotifierTimeout = 300000000; // 5 min timeout
 _LIT8 ( KNSmlDMFotaNode, "FUMO" );
 
@@ -207,7 +208,10 @@
         aAlertCode == KNSmlDMAgentNextMessage ||
         aAlertCode == KNSmlDMAgentSessionAbortAlert ||
         aAlertCode == KNSmlDMAgentDisplayAlert ||
-        aAlertCode == KNSmlDMAgentContinueOrAbortAlert )
+        aAlertCode == KNSmlDMAgentContinueOrAbortAlert 
+		 || aAlertCode == KNSmlDMAgentUserInputAlert 
+		 || aAlertCode == KNSmlDMAgentSingleChoiceAlert
+		 || aAlertCode == KNSmlDMAgentMultipleChoiceAlert )
 		{
 		return ETrue;
 		}
@@ -1873,9 +1877,9 @@
 	// StartNotifier called to avoid Notifier server panic, if 
 	// notifier does not exist anymore.
 	TBuf8<1> dummy;	
-//	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
-//	iNotifier.CancelNotifier( KUidNotifier );
-//	iNotifier.Close();
+	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
+	iNotifier.CancelNotifier( KUidNotifier );
+	iNotifier.Close();
 	iNotifierTimeOut.Cancel();
 	Cancel();
 	}
@@ -1895,9 +1899,19 @@
 		SetActive();
 		}
 
+	//connect to repository		
+	CRepository* rep = CRepository::NewLC( KCRUidPolicyManagementUtilInternalKeys );
+		
+	//get parameters 	
+	TSyncMLAppLaunchNotifParams params;
+    TPckg<TSyncMLAppLaunchNotifParams> data( params );
+	User::LeaveIfError( rep->Get( KSyncMLSessionParamsKey, data)); 
+
+	CleanupStack::PopAndDestroy( rep);
+
     iNotifierTimeOut.LaunchNotifierTimer( this );
-//    User::LeaveIfError( iNotifier.Connect() );
-//   iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf );
+    User::LeaveIfError( iNotifier.Connect() );
+    iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf );
 	}
 
 // --------------------------------------------------------------------------
@@ -1911,9 +1925,9 @@
 	// StartNotifier called to avoid Notifier server panic, if 
 	// notifier does not exist anymore.
 	TBuf8<1> dummy;	
-//	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
+	iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also..
 	
-//	iNotifier.CancelNotifier( KUidNotifier );
+	iNotifier.CancelNotifier( KUidNotifier );
 	}
 
 // --------------------------------------------------------------------------
@@ -1943,6 +1957,7 @@
 	    if ( ret == KErrNone )
     	{	   
         
+	  		TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier.
 	   	
 	    	// Check the response and error code. If there is a fail, dump the job.        
 	    	// Also compare sid to creator id saved for current job to secure that listener owns the job.
--- a/syncmlfw/dm/syncagent/src/nsmldmcmds.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/syncagent/src/nsmldmcmds.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -25,7 +25,7 @@
 #include <DevManInternalCRKeys.h>
 #include <featmgr.h>
 // FOTA end
-#include <devicedialogsymbian.h>
+#include <SyncMLNotifierParams.h>
 
 #include <nsmlconstants.h>
 #include <nsmldebug.h>
@@ -54,14 +54,10 @@
 #include "smldtd.h"
 #include "smldef.h"
 #include "nsmlagenttestdefines.h"
-#include <hbdevicedialogsymbian.h>
-#include <hbsymbianvariant.h>
 // DM specific includes
 #include "nsmldmagconstants.h"
 #include "NSmlDMCmds.h"
 #include "nsmldmerror.h"
-#include <dmdevdialogclient.h>
-#include "OnlineSupportLogger.h"
 #ifdef __TEST_TREEMODULE
 #include "nsmldmtestmodule.h"
 #else
@@ -77,30 +73,17 @@
 #endif
 
 
-//const TUid KNSmlSyncDialogUid = { 0x101F876A };
+const TUid KNSmlSyncDialogUid = { 0x101F876A };
 // FOTA
 const TInt KNSmlDmNoRequest = -1;
 // FOTA end
+const TInt KNSmlDmChoiceChunkMinSize = 32;
+const TInt KNSmlDmChoiceChunkMaxSize = 10000;
 
 _LIT8 ( KNSmlDMMetaTypeUserRequest, "org.openmobilealliance.dm.firmwareupdate.userrequest" );
 _LIT8 ( KNSmlDMMetaFormatUserRequest, "chr" );
-
-const TUid dmagentuid =
-            {
-            0x101F6DE5
-            };
-
-
+_LIT(KChunkName,"AlertItems");
 
-enum TSyncmlHbNotifierKeys 
-		{
-
-     EHbSOSNotifierKeyStatus = 11, // status set will complete the client subscribe
-     EHbSOSNotifierKeyStatusReturn = 12, // Return the content of actual status value accepted from UI
-     
-     EHbDMSyncNotifierKeyStatus = 13,
-     EHbDMSyncNotifierKeyStatusReturn = 14
-		};
 
 // ---------------------------------------------------------
 // CNSmlDMCmds::NewL()
@@ -323,6 +306,169 @@
 	return valueNum; 
 	}
 
+//#ifdef RD_DM_TEXT_INPUT_ALERT
+// ---------------------------------------------------------
+// CNSmlDMCmds::AlertInputTypeParameter()
+// For 1102-User Input server alert
+// For Input Type optional parameter
+// ---------------------------------------------------------
+TInt CNSmlDMCmds::AlertInputTypeParameter( const SmlPcdata_t* aData, const TDesC8& aParamID ) const
+	{
+	_DBG_FILE("CNSmlDMCmds::AlertInputTypeParameter: begin");
+	TInt valueNum = 0;//alphanumeric by default
+	if ( aData )
+		{
+		if ( aData->content )
+			{
+			TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length );
+			TrimRightSpaceAndNull( parameters );
+			TInt startPos = parameters.Find( aParamID );
+			if ( startPos >= 0 )
+				{
+				if ( parameters.Length() > startPos + aParamID.Length() )
+					{
+					TPtrC8 strPart = parameters.Right( parameters.Length() - ( startPos + aParamID.Length() ) );
+					TInt length = 0;
+					TChar character = strPart[length];
+						
+						switch( character )
+						{
+							case 'A': //Alphanumeric
+							 valueNum = ESyncMLInputTypeAlphaNumeric;
+							 break;
+							case 'N': //Numeric
+							 valueNum = ESyncMLInputTypeNumeric;
+							 break;
+							case 'D': //Date
+							 valueNum = ESyncMLInputTypeDate;
+							 break;
+							case 'T': //Time
+							 valueNum = ESyncMLInputTypeTime;
+							 break;
+							case 'P': //Phone number
+							 valueNum = ESyncMLInputTypePhoneNumber;
+							 break;
+							case 'I': //Ip address
+							 valueNum = ESyncMLInputTypeIPAddress;
+							 break;
+						}
+					}
+				}
+			}
+		}
+		_DBG_FILE("CNSmlDMCmds::AlertInputTypeParameter: end");
+	return valueNum; 
+	}	
+	
+// ---------------------------------------------------------
+// CNSmlDMCmds::AlertEchoTypeParameter()
+// For 1102-User Input server alert
+// For Echo Type optional parameter
+// ---------------------------------------------------------	
+TInt CNSmlDMCmds::AlertEchoTypeParameter( const SmlPcdata_t* aData, const TDesC8& aParamID ) const
+	{
+	_DBG_FILE("CNSmlDMCmds::AlertEchoTypeParameter: begin");
+	TInt valueNum = 0;//Text by default
+	if ( aData )
+		{
+		if ( aData->content )
+			{
+			TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length );
+			TrimRightSpaceAndNull( parameters );
+			TInt startPos = parameters.Find( aParamID );
+			if ( startPos >= 0 )
+				{
+				if ( parameters.Length() > startPos + aParamID.Length() )
+					{
+					TPtrC8 strPart = parameters.Right( parameters.Length() - ( startPos + aParamID.Length() ) );
+					TInt length = 0;
+					TChar character = strPart[length];
+						switch( character )
+						{
+							 
+							case 'T': valueNum = ESyncMLEchoTypeText;
+							 break;
+							case 'P': valueNum = ESyncMLEchoTypePassword;
+							 break;
+							 default: 
+							 break;
+						}
+					}
+				}
+			}
+		}
+		_DBG_FILE("CNSmlDMCmds::AlertEchoTypeParameter: end");
+	return valueNum; 
+	}
+// ---------------------------------------------------------
+// CNSmlDMCmds::CheckDRPresence()
+// For 1102-User Input server alert
+// For Default Response item existence verification
+// ---------------------------------------------------------		
+TBool CNSmlDMCmds::CheckDRPresence( const SmlPcdata_t* aData, const TDesC8& aParamID ) const
+   {
+   	if ( aData )
+		{
+		if ( aData->content )
+			{
+			TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length );
+			TrimRightSpaceAndNull( parameters );
+			TInt startPos = parameters.Find( aParamID );
+			if ( startPos >= 0 )
+				{
+				 return ETrue;
+				}
+			}
+		}
+		return EFalse;
+   }
+	
+// ---------------------------------------------------------
+// CNSmlDMCmds::AlertDefaultResponseParam()
+// For 1102-User Input server alert
+// For Default Response optional parameter
+// ---------------------------------------------------------
+TPtrC8 CNSmlDMCmds::AlertDefaultResponseParam( const SmlPcdata_t* aData, const TDesC8& aParamID ) const
+	{
+	_DBG_FILE("CNSmlDMCmds::AlertDefaultResponseParam: begin");
+	TLex8 value;
+	if ( aData )
+		{
+		if ( aData->content )
+			{
+			TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length );
+			TrimRightSpaceAndNull( parameters );
+			TInt startPos = parameters.Find( aParamID );
+			if ( startPos >= 0 )
+				{
+				if ( parameters.Length() > startPos + aParamID.Length() )
+					{
+					 TPtrC8 strPart = parameters.Right( parameters.Length() - ( startPos + aParamID.Length() ) );
+					TInt length = 0;
+					while ( length < strPart.Length() )
+						{
+						TChar character = strPart[length];
+						if ( character != '&' )
+							{
+							++length;
+							}
+						else
+							{
+							break;
+							}
+						}
+					TPtrC8 valueStr = strPart.Left(	length );
+					value.Assign( valueStr );
+										
+					}
+				}
+			}
+		}
+		_DBG_FILE("CNSmlDMCmds::AlertDefaultResponseParam: end");
+	 return value.Remainder();
+	}	
+//#endif
+
 // ---------------------------------------------------------
 // CNSmlDMCmds::AlertDataLC()
 // 
@@ -510,6 +656,7 @@
 
 	TPtr8 targeturi = HBufC8::NewLC ( (*aItemList[i].iTarget).Length())->Des();
 	targeturi.Append ( *aItemList[i].iTarget);	
+	if(targeturi.Compare(KNullDesC8)!=0)
 	DoTargetL ( itemPtr->item->target, targeturi  );
 	CleanupStack::PopAndDestroy();  // targeturi   
 	
@@ -969,7 +1116,10 @@
 		 alertCode == KNSmlDMAgentNextMessage ||
 		 alertCode == KNSmlDMAgentSessionAbortAlert ||
 		 alertCode == KNSmlDMAgentServerInitAlert ||
-		 alertCode == KNSmlDMAgentClientInitAlert )
+		 alertCode == KNSmlDMAgentClientInitAlert 
+		 || alertCode == KNSmlDMAgentUserInputAlert 
+		 || alertCode == KNSmlDMAgentSingleChoiceAlert 
+		 || alertCode == KNSmlDMAgentMultipleChoiceAlert)
 		{
 		HandleAlertsL(aAlert,statusID);
 		}
@@ -1010,7 +1160,10 @@
 void CNSmlDMCmds::HandleAlertsL( SmlAlert_t* aAlert, TInt& aStatusId)
 	    {
 	    TPtr8 alertCode = AlertCode( aAlert );
-	    if ( alertCode == KNSmlDMAgentDisplayAlert ||  alertCode == KNSmlDMAgentContinueOrAbortAlert )
+	    if ( alertCode == KNSmlDMAgentDisplayAlert ||  alertCode == KNSmlDMAgentContinueOrAbortAlert 
+	            || alertCode == KNSmlDMAgentUserInputAlert
+	            || alertCode == KNSmlDMAgentSingleChoiceAlert
+	            || alertCode == KNSmlDMAgentMultipleChoiceAlert )
 	        {
 	        if ( !aAlert->itemList )
 	            {
@@ -1033,7 +1186,15 @@
 	            {
 	            HandleConfirmationAlertL(aAlert,aStatusId);
 	            }
-
+	        else if(alertCode == KNSmlDMAgentUserInputAlert)
+	            {
+	            HandleUserInputalertL(aAlert,aStatusId);
+	            }
+	        else if(alertCode == KNSmlDMAgentSingleChoiceAlert
+	                || alertCode == KNSmlDMAgentMultipleChoiceAlert)
+	            {	            	            
+	            HandleChoiceAlertsL(aAlert,aStatusId);
+	            }
 	        else //
 	            {
 
@@ -1041,6 +1202,260 @@
 	        }
 	    }
 
+// ---------------------------------------------------------
+// CNSmlDMCmds::HandleChoiceAlertsL
+// Handles Choice Alert commands from a server.  
+// ---------------------------------------------------------
+void CNSmlDMCmds::HandleChoiceAlertsL( SmlAlert_t* aAlert, TInt& aStatusId)
+    {    
+    const TChar KDRSeparator('-');
+    const TChar KChoiceItemSeparator(',');
+    TPtr8 alertCode = AlertCode( aAlert );
+    // MINDT 
+    TInt mindt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMINDT );
+    // MAXDT 
+    TInt maxdt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXDT );
+    if ( mindt > maxdt )
+        {
+        maxdt = mindt;
+        }   
+    TSyncMLDlgNotifParams notifyParams;
+    TInt maxlen = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXLEN );
+
+    //check if iDR, Default response parameter is there or not
+    //DRPresent is used for destroying how many items in the pop up stack 
+    TBool DRPresent = CheckDRPresence( aAlert->itemList->item->data, KNSmlDMAgentDR );
+    if( DRPresent )
+        {
+        TPtrC8 DrPtr = AlertDefaultResponseParam( aAlert->itemList->item->data, KNSmlDMAgentDR );       
+        HBufC8* hptr = HBufC8::NewLC( DrPtr.Length()+ 4 ); //cs 1dr
+        TPtr8 DrBuf(hptr->Des());                           
+        if(alertCode == KNSmlDMAgentMultipleChoiceAlert)
+            {       
+            _DBG_FILE("drbuf multichoice");                     
+            DrBuf.Append(KDRSeparator);         
+            DrBuf.Append(DrPtr);
+            DrBuf.Append(KDRSeparator);         
+            }
+        else
+            {           
+            DrBuf.Append(DrPtr);
+            }
+        HBufC* DrBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( DrBuf  );
+        CleanupStack::PushL( DrBuf16 ); //cs 2dr
+        notifyParams.iDR = *DrBuf16;
+        }
+    HBufC8* alertData = AlertDataLC( aAlert->itemList ); //cs 1
+    if ( alertData->Length() == 0)
+        {
+        if( DRPresent )
+            {
+            CleanupStack::PopAndDestroy(2);//alertData,hptr,DrBuf16
+            }	        
+        CleanupStack::PopAndDestroy();//alertData	        
+        iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusIncompleteCommand );
+        HandleAlertErrorL();
+        return;   
+        }
+		
+    HBufC8* alertDataWithMDT = HBufC8::NewLC(alertData->Length()+KNSmlDMAgentMINDT().Length()+KNSmlDMAgentMAXDT().Length()+6); //cs 2
+    TPtr8 dataBuf = alertDataWithMDT->Des();
+    dataBuf.Append(*alertData);
+    HBufC* dataBuf16 = NULL;
+    TRAPD(errC,  dataBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(dataBuf));
+    if( errC == KErrCorrupt )
+        {
+        if( DRPresent )
+            {
+            CleanupStack::PopAndDestroy(2); //alertData hptr,DrBuf16,alertDataWithMDT
+            }	        
+        CleanupStack::PopAndDestroy(2); //alertData alertDataWithMDT	        
+        iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusCommandFailed );
+        return;
+        }
+    CleanupStack::PushL(dataBuf16);   //cs    3
+    //RNotifier notifier;
+    //User::LeaveIfError( notifier.Connect() );
+    //CleanupClosePushL(notifier); //cs
+    TPckgBuf<TBool> resBuf;    
+    /* 
+	//TO reduce cyclomatic complexity
+	if( dataBuf16->Length() > KSyncMLMaxServerMsgLength )
+        {
+        notifyParams.iServerMsg = (*dataBuf16).Left(KSyncMLMaxServerMsgLength) ;    
+        }
+    else
+        {
+        notifyParams.iServerMsg = *dataBuf16;   
+        }     */
+	TInt datalength = FindMaxLength(dataBuf16->Length(),KSyncMLMaxServerMsgLength);	
+	notifyParams.iServerMsg = (*dataBuf16).Left(datalength);  
+    notifyParams.iMaxTime = maxdt;
+    notifyParams.iMaxLength = maxlen;	                   
+    TRequestStatus status;      
+    _DBG_FILE("starting of choice alerts"); 
+    //Retrieve items list 
+    HBufC8* lengthbuf = HBufC8::NewLC(100); //cs 4
+    TInt NumItems = 0 ;
+    HBufC8* listitems = AlertChoiceItemsLC(aAlert->itemList,lengthbuf,NumItems);      //cs 5                  
+	if(!NumItems)
+	{
+	if( DRPresent )
+            {
+            CleanupStack::PopAndDestroy(2); 
+            }	        
+        CleanupStack::PopAndDestroy(5); 	       
+        iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusIncompleteCommand );
+        return;
+	}
+    notifyParams.iNumberOfItems = NumItems;         
+    HBufC* choiceitemslength = NULL;    
+    TRAPD(errL,  choiceitemslength = CnvUtfConverter::ConvertToUnicodeFromUtf8L(lengthbuf->Des()));
+    if( errL/* == KErrCorrupt*/ )//useful for low memory and other cases
+        {
+        if( DRPresent )
+            {
+            CleanupStack::PopAndDestroy(2); 
+            }	        
+        CleanupStack::PopAndDestroy(5); 	       
+        iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusCommandFailed );
+        return;
+        }
+    CleanupStack::PushL(choiceitemslength); //cs 6
+
+   /* if( choiceitemslength->Length() > KSyncMLChoiceItemsLengthBuffer )
+        {
+        notifyParams.iItemLength = (*choiceitemslength).Left(KSyncMLChoiceItemsLengthBuffer) ;    
+        }
+    else
+        {
+        notifyParams.iItemLength = *choiceitemslength;
+        }   */
+   datalength = FindMaxLength(choiceitemslength->Length(),KSyncMLChoiceItemsLengthBuffer);			
+   notifyParams.iItemLength = (*choiceitemslength).Left(datalength);  
+    if( alertCode == KNSmlDMAgentMultipleChoiceAlert)
+        {
+        _DBG_FILE("multiple choice alerts");    
+        notifyParams.iNoteType = ESyncMLMultiChoiceQuery;
+        }
+    else
+        {
+        _DBG_FILE("single choice alerts");  
+        notifyParams.iNoteType = ESyncMLSingleChoiceQuery;
+        }             
+    if(iChunk.Handle())
+        iChunk.Close();
+    else
+        {
+        TTime now;
+        now.HomeTime();
+        TInt64 rand = now.Int64();
+        // Use timestamp to get a unique seed
+        TInt randnum = Math::Rand( rand );
+        TBuf<KSyncMLMaxProfileNameLength> chunkname;
+        chunkname.AppendNum(randnum);
+        chunkname.Append(KChunkName);
+        notifyParams.iChunkName = chunkname;
+        TInt err1 = iChunk.CreateGlobal( chunkname,
+                KNSmlDmChoiceChunkMinSize, KNSmlDmChoiceChunkMaxSize );
+        DBG_FILE_CODE(err1,_S8("chunk creating error is "));
+        if( err1 < 0 && err1 != KErrAlreadyExists )
+            User::LeaveIfError(err1);
+        if( err1 == KErrAlreadyExists )
+            {    err1 = iChunk.OpenGlobal(chunkname,EFalse);
+            DBG_FILE_CODE(err1,_S8("chunk opening error is "));
+            User::LeaveIfError(err1);
+            }
+        }
+    TInt size1 = iChunk.Size();
+    DBG_FILE_CODE(size1,_S8("chunk size is "));
+
+    RMemWriteStream chunkStream ( iChunk.Base(), iChunk.Size() );
+    CleanupClosePushL ( chunkStream ); //cs
+    chunkStream.WriteL ( listitems->Des() );
+    CleanupStack::PopAndDestroy(1);//chunkstream 
+    TPckgBuf<TSyncMLDlgNotifParams> pkgBuf( notifyParams );                            
+    TSyncMLDlgNotifReturnParams emptybuf;
+    TSyncMLDlgNotifReturnParamsPckg resultBuf( emptybuf );
+    RNotifier notifier;
+    User::LeaveIfError( notifier.Connect() );
+    CleanupClosePushL(notifier); //cs  7
+    _DBG_FILE("starting choice notifier");  
+    notifier.StartNotifierAndGetResponse( status, KNSmlSyncDialogUid, pkgBuf, resultBuf );
+    _DBG_FILE("notifier returned"); 
+    User::WaitForRequest( status );
+    CleanupStack::PopAndDestroy(4);//notifier,lengthbuf,listitems,choiceitemslength
+    iChunk.Close();
+    TBuf8<KSyncMLMaxAlertResultLength> rettext;
+    rettext.Copy( resultBuf().irettext.Left( KSyncMLMaxAlertResultLength ) );
+    if ( status != KErrNone )
+        {
+        TInt error = TNSmlError::ESmlStatusOperationCancelled ;
+        iStatusToServer->SetStatusCodeL( aStatusId, error );
+        HandleAlertErrorL();
+        }
+    else
+        {
+        //For sending data to server
+        if( alertCode == KNSmlDMAgentMultipleChoiceAlert)
+            {
+            SendMultiChoiceDataToServerL(rettext,aStatusId);                   
+            }
+        else
+            {
+            SmlPcdata_t* data = NULL;
+            PcdataNewL( data, rettext);
+            CleanupStack::PushL( data );
+            iStatusToServer->AddItemDataL( aStatusId, data );
+            CleanupStack::PopAndDestroy(); //data           
+            }           
+        }    
+    if( DRPresent ) 
+        CleanupStack::PopAndDestroy(2); //hptr,DrBuf16
+
+    CleanupStack::PopAndDestroy(3); //notifier,alertData,alertDataWithMDT,dataBuf16     
+    }
+
+// ---------------------------------------------------------
+// CNSmlDMCmds::SendMultiChoiceDataToServerL
+// Sends Multiple Choice Alert status to server.  
+// ---------------------------------------------------------
+void CNSmlDMCmds::SendMultiChoiceDataToServerL(TDes8& aData,TInt& aStatusId)
+    {
+    const TChar KDRSeparator('-');
+    TPtrC8 temp1,temp2;
+    TInt prevcommapos = 0;
+    SmlPcdata_t* data = NULL;      
+    for(TInt i=0;i<aData.Length();i++)
+        {
+        //find a slash  
+
+        if(aData[i]== KDRSeparator)
+            {
+            if(prevcommapos)
+                {
+
+                temp1.Set(aData.Left(i));
+                temp2.Set(temp1.Right(i-(prevcommapos+1)));
+                prevcommapos=  i;
+                }
+            else //firsttime finding comma
+                {
+                prevcommapos=  i;
+                temp1.Set(aData.Left(i));
+                temp2.Set(temp1.Right(i));
+                }
+            //convert temp2 to number
+            PcdataNewL( data, temp2);
+            CleanupStack::PushL( data );
+            iStatusToServer->AddItemDataL( aStatusId, data );
+            CleanupStack::PopAndDestroy(); //data
+            data = NULL;
+
+            }
+        }                           
+
+    }
 
 // ---------------------------------------------------------
 // CNSmlDMCmds::HandleConfirmationAlertL
@@ -1078,7 +1493,9 @@
         return;
         }
     CleanupStack::PushL(dataBuf16);    
-   
+    RNotifier notifier;
+    User::LeaveIfError( notifier.Connect() );
+    CleanupClosePushL(notifier);
     TPckgBuf<TBool> resBuf;
     if( dataBuf16->Length() > KSyncMLMaxServerMsgLength )
         {
@@ -1093,38 +1510,131 @@
     TRequestStatus status;      
     //Note type to Query note
     notifyParams.iNoteType = ESyncMLYesNoQuery;
-    TPckgBuf<TSyncMLDlgNotifParams> pkgBuf(notifyParams);
-    
-    
-    if(!IsHbSyncmlNotifierEnabledL())
-    {
-    	_DBG_FILE("starting notifier");  
-
-    }
-    else
-    {
- 
-    TInt statusval;
-    ServerHbNotifierL(notifyParams.iNoteType, notifyParams.iServerMsg);
-    TInt err = RProperty::Get(dmagentuid, EHbDMSyncNotifierKeyStatusReturn, statusval);
-    	LOGSTRING2("get error status = %d", err);
-    	if(err == KErrNone)
-    		{
-    			status = statusval;
-    			LOGSTRING2("get statusval = %d", status.Int());
-    		}
- 
-    }
-    
-    if (status == KErrCancel || status == KErrTimedOut)
+    TPckgBuf<TSyncMLDlgNotifParams> pkgBuf( notifyParams );
+    notifier.StartNotifierAndGetResponse(status,KNSmlSyncDialogUid,pkgBuf,resBuf);
+    User::WaitForRequest(status);
+    TBool ret = resBuf();
+    if ( status == KErrCancel || status == KErrTimedOut )
         {
         TInt error = status == KErrCancel ? TNSmlError::ESmlStatusNotModified : TNSmlError::ESmlStatusRequestTimeout;
         iStatusToServer->SetStatusCodeL( aStatusId, error );
         HandleAlertErrorL();
         }
-    CleanupStack::PopAndDestroy(3); //alertData alertDataWithMDT,databuf16 
+    CleanupStack::PopAndDestroy(4); //alertData alertDataWithMDT,databuf16,notifier   
     }
 
+// ---------------------------------------------------------
+// CNSmlDMCmds::HandleUserInputalertL
+// Handles user Text Input Alert command from a server.  
+// ---------------------------------------------------------    
+ void CNSmlDMCmds::HandleUserInputalertL( SmlAlert_t* aAlert, TInt& aStatusId)
+     {     
+     // MINDT 
+     TInt mindt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMINDT );
+     // MAXDT 
+     TInt maxdt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXDT );
+     if ( mindt > maxdt )
+         {
+         maxdt = mindt;
+         }   
+     TSyncMLDlgNotifParams notifyParams;
+     TInt maxlen = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXLEN );
+     TInt InputType = AlertInputTypeParameter( aAlert->itemList->item->data, KNSmlDMAgentIT );
+     TInt EchoType = AlertEchoTypeParameter( aAlert->itemList->item->data, KNSmlDMAgentET );
+     //check if iDR, Default response parameter is there or not
+     //DRPresent is used for destroying how many items in the pop up stack 
+     TBool DRPresent = CheckDRPresence( aAlert->itemList->item->data, KNSmlDMAgentDR );
+     if( DRPresent )
+         {
+         TPtrC8 DrPtr = AlertDefaultResponseParam( aAlert->itemList->item->data, KNSmlDMAgentDR );       
+         HBufC8* hptr = HBufC8::NewLC( DrPtr.Length()+ 4 ); //cs
+         TPtr8 DrBuf(hptr->Des());                           
+
+         DrBuf.Append(DrPtr);
+
+         HBufC* DrBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( DrBuf  );
+         CleanupStack::PushL( DrBuf16 );//cs
+         notifyParams.iDR = *DrBuf16;
+         }
+     HBufC8* alertData = AlertDataLC( aAlert->itemList );//cs
+     if ( alertData->Length() == 0)
+         {
+         if( DRPresent )
+             {
+             CleanupStack::PopAndDestroy(3);//alertData,hptr,DrBuf16
+             }
+         else
+             {
+             CleanupStack::PopAndDestroy();//alertData
+             }
+         iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusIncompleteCommand );
+         HandleAlertErrorL();
+         return;   
+         }
+     HBufC8* alertDataWithMDT = HBufC8::NewLC(alertData->Length()+KNSmlDMAgentMINDT().Length()+KNSmlDMAgentMAXDT().Length()+6);//cs
+     TPtr8 dataBuf = alertDataWithMDT->Des();
+     dataBuf.Append(*alertData);
+     HBufC* dataBuf16 = NULL;
+     TRAPD(errC,  dataBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(dataBuf));
+     if( errC == KErrCorrupt )
+         {
+         if( DRPresent )
+             {
+             CleanupStack::PopAndDestroy(4); //alertData hptr,DrBuf16,alertDataWithMDT
+             }
+         else
+             {
+             CleanupStack::PopAndDestroy(2); //alertData alertDataWithMDT
+             }
+         iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusCommandFailed );
+         return;
+         }
+     CleanupStack::PushL(dataBuf16);    //cs
+     RNotifier notifier;
+     User::LeaveIfError( notifier.Connect() );
+     CleanupClosePushL(notifier); //cs
+     TPckgBuf<TBool> resBuf;     
+     if( dataBuf16->Length() > KSyncMLMaxServerMsgLength )
+         {
+         notifyParams.iServerMsg = (*dataBuf16).Left(KSyncMLMaxServerMsgLength) ;    
+         }
+     else
+         {
+         notifyParams.iServerMsg = *dataBuf16;   
+         }     
+     notifyParams.iMaxTime = maxdt;
+     notifyParams.iMaxLength = maxlen;
+     notifyParams.iET = EchoType;
+     notifyParams.iIT = InputType;       
+     TRequestStatus status;      
+     //Note type to Text input note
+     notifyParams.iNoteType = ESyncMLInputQuery;
+     TPckgBuf<TSyncMLDlgNotifParams> pkgBuf( notifyParams );
+     TSyncMLDlgNotifReturnParams emptybuf;
+     TSyncMLDlgNotifReturnParamsPckg resultBuf( emptybuf );
+     notifier.StartNotifierAndGetResponse( status, KNSmlSyncDialogUid, pkgBuf, resultBuf );
+     User::WaitForRequest( status );
+     TBuf8<KSyncMLMaxDefaultResponseMsgLength> rettext;
+     rettext.Copy( resultBuf().irettext.Left( KSyncMLMaxDefaultResponseMsgLength ) );
+     if ( status == KErrCancel || status == KErrTimedOut || status ==  KErrAbort )
+         {
+         TInt error = TNSmlError::ESmlStatusOperationCancelled ;
+         iStatusToServer->SetStatusCodeL( aStatusId, error );
+         HandleAlertErrorL();
+         }
+     //For sending data to server    
+     SmlPcdata_t* data = NULL;
+     PcdataNewL( data, rettext);
+     CleanupStack::PushL( data );
+     iStatusToServer->AddItemDataL( aStatusId, data );
+     CleanupStack::PopAndDestroy(); //data
+     if( DRPresent ) 
+         CleanupStack::PopAndDestroy(6); //notifier,alertData,alertDataWithMDT,dataBuf16,hptr,DrBuf16
+     else
+         //#endif
+         CleanupStack::PopAndDestroy(4); //notifier,alertData,alertDataWithMDT,dataBuf16     
+     }
+
  // ---------------------------------------------------------
  // CNSmlDMCmds::HandleDisplayAlertL
  // Handles Display Alert command from a server.  
@@ -1161,7 +1671,9 @@
          return;
          }
      CleanupStack::PushL(dataBuf16);    
-    
+     RNotifier notifier;
+     User::LeaveIfError( notifier.Connect() );
+     CleanupClosePushL(notifier);
      TPckgBuf<TBool> resBuf;
      if( dataBuf16->Length() > KSyncMLMaxServerMsgLength )
          {
@@ -1176,70 +1688,11 @@
      TRequestStatus status;              
      notifyParams.iNoteType = ESyncMLInfoNote;
      TPckgBuf<TSyncMLDlgNotifParams> pkgBuf( notifyParams );
-    if(!IsHbSyncmlNotifierEnabledL())
-        {
-     
-        }
-    else
-        {
-        LOGSTRING("HandleDisplayAlertL Start test 1 start");  
-        ServerHbNotifierL(notifyParams.iNoteType, notifyParams.iServerMsg);
-        LOGSTRING("HandleDisplayAlertL Start test 2 end");
-        }
-    
-    CleanupStack::PopAndDestroy(3); //alertData alertDataWithMDT,databuf16   
-
-
-    }
-
-void CNSmlDMCmds::ServerHbNotifierL(TSyncMLDlgNoteTypes& aNotetype, TDesC& aServerMsg)
-    
-    {
-				LOGSTRING("HandleDisplayAlertL ServerHbNotifier start");                
-        RDmDevDialog DmDevdialog;
-        TInt err = DmDevdialog.OpenL();
-        User::LeaveIfError(err);
-        TRequestStatus status = KRequestPending;
-        if(aNotetype == ESyncMLInfoNote)
-            {
-        DmDevdialog.ShowDisplayAlert(aServerMsg,status);
-            }
-            
-        else 
-            {
-        TInt timeout = 30; // dummy
-        TBuf<30> header; // dummy
-        DmDevdialog.ShowConfirmationAlert(timeout,header,aServerMsg,status);
-            }
-       
-        User::WaitForRequest(status);
-
-DmDevdialog.Close();
-        LOGSTRING("HandleDisplayAlertL ServerHbNotifier end");
-
-}
-TBool CNSmlDMCmds::IsHbSyncmlNotifierEnabledL()
-    {
-    CRepository * rep =
-            CRepository::NewLC(KCRUidDeviceManagementInternalKeys);
-
-    TInt notifierenabled = KErrNone;
-
-    TInt err = rep->Get(KDevManEnableHbNotifier, notifierenabled);
-
-    CleanupStack::PopAndDestroy(rep);
-
-    if (err == KErrNone && notifierenabled)
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-
-    }
-
+     notifier.StartNotifierAndGetResponse(status,KNSmlSyncDialogUid,pkgBuf,resBuf);
+     User::WaitForRequest(status);
+     CleanupStack::PopAndDestroy(4); //alertData alertDataWithMDT,databuf16,notifier     
+     }
+	
 // ---------------------------------------------------------
 // CNSmlDMCmds::ProcessSyncL()
 // Process received Add, Replace and Delete commands
@@ -1836,3 +2289,131 @@
 		aStatusCode = TNSmlError::ESmlStatusIncompleteCommand;
 		}
 	}
+
+// ---------------------------------------------------------------------------------------------------------------
+// CNSmlDMCmds::AlertChoiceItemsLC()
+//  Retrieves the choice alerts information 
+// ---------------------------------------------------------------------------------------------------------------
+HBufC8* CNSmlDMCmds::AlertChoiceItemsLC(SmlItemList_t* aItemList,HBufC8*& aLengthBuf ,TInt& aNumItems ) const
+    {
+    /*cleanupstack contains
+     * top : tempdata
+     *      : unicodeData
+     * bottom: aLengthBuf
+     */
+	 const TChar KDRSeparator('-');
+const TChar KChoiceItemSeparator(',');
+    HBufC8* unicodeData = HBufC8::NewLC(200);
+    HBufC8* tempdata = NULL;
+    HBufC8* lengthbuf = aLengthBuf;
+    TBuf<20> lennum; 
+    SmlItemList_t* temp;
+    if (  aItemList )//Not null
+        {
+        if(aItemList->next)//removing header of dialog
+            {
+            temp = aItemList->next;
+            while(temp->next)
+                {
+                if (  temp->next->item )
+                    {
+                    if (  temp->next->item->data )
+                        {
+                        if (  temp->next->item->data->content )
+                            {
+                            TPtr8 data( (TUint8*)  temp->next->item->data->content,  temp->next->item->data->length, temp->next->item->data->length );
+                            TrimRightSpaceAndNull( data );
+                            tempdata = data.AllocLC();
+                            TInt length = data.Length();//item length
+                            //add length to buffer and add comma 
+                            if(lengthbuf->Des().MaxLength() > (lengthbuf->Des().Length() + 5/*bytes*/) )
+                                {
+                                if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200
+                                    {
+                                    lennum.Num(KSyncMLMaxChoiceItemLength);
+                                    lengthbuf->Des().Append(lennum);
+                                    lengthbuf->Des().Append(KChoiceItemSeparator);                                    
+                                    }
+                                else
+                                    {
+                                    lennum.Num(length);                            
+                                    lengthbuf->Des().Append(lennum);
+                                    lengthbuf->Des().Append(KChoiceItemSeparator);
+                                    }
+                                }
+                            else
+                                {
+                                //Pop the aLengthBuf from cleanupstack and realloc
+                                CleanupStack::Pop(3); //tempdata,unicodeData,aLengthBuf
+                                lengthbuf = lengthbuf->ReAllocL(lengthbuf->Des().Length() + 100);
+                                CleanupStack::PushL(lengthbuf);
+                                CleanupStack::PushL(unicodeData);
+                                CleanupStack::PushL(tempdata);
+                                if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200
+                                    {
+                                    lengthbuf->Des().AppendNum(KSyncMLMaxChoiceItemLength);
+                                    lengthbuf->Des().Append(KChoiceItemSeparator);  
+                                    }
+                                else
+                                    {
+                                    lengthbuf->Des().AppendNum(length); //Append(length);
+                                    lengthbuf->Des().Append(KChoiceItemSeparator);
+                                    }
+                                }
+                            if(unicodeData->Des().MaxLength()> (unicodeData->Des().Length() + length))
+                                {
+                                if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200
+                                    {
+                                    unicodeData->Des().Append(tempdata->Des().Left(KSyncMLMaxChoiceItemLength)); 
+                                    }
+                                else
+                                    {
+                                    unicodeData->Des().Append(tempdata->Des());
+                                    }
+                                }
+                            else
+                                {
+                                CleanupStack::Pop(2);//tempdata,unicodeData
+                                unicodeData = unicodeData->ReAllocL(unicodeData->Des().Length() + length + 200);
+                                CleanupStack::PushL(unicodeData);
+                                CleanupStack::PushL(tempdata);
+                                if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200
+                                    {
+                                    unicodeData->Des().Append(tempdata->Des().Left(KSyncMLMaxChoiceItemLength)); 
+                                    }
+                                else
+                                    {
+                                    unicodeData->Des().Append(tempdata->Des());
+                                    }
+                                }
+                            CleanupStack::PopAndDestroy(tempdata);
+                            aNumItems++;
+                            data.Zero();
+                            }
+                        }
+                    }
+                temp = temp->next;
+                }
+            }
+        }  
+        _DBG_FILE("CNSmlDMCmds::AlertDataLC: end"); 
+        aLengthBuf = lengthbuf;
+        return unicodeData;          
+    }
+	
+// ---------------------------------------------------------------------------------------------------------------
+// CNSmlDMCmds::FindMaxLength()
+// ---------------------------------------------------------------------------------------------------------------	
+TInt CNSmlDMCmds::FindMaxLength(TInt aSourceLength, TInt aDestLength)
+	{
+	TInt length = 0;
+	if(aSourceLength > aDestLength )
+	 {
+	  length = aDestLength;
+	 }
+	else
+	 {
+	  length = aSourceLength;	  
+	 }
+	return length;
+	}
--- a/syncmlfw/dm/treemodule/src/nsmldmddf.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/treemodule/src/nsmldmddf.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -225,7 +225,7 @@
 			     {
 			     TBool returnstatus = ETrue; 
 			     TPtrC8 Uri1 = NSmlDmURI::URISeg(aURI,1);
-			     if( iAddRootNodesList )
+			     if( iAddRootNodesList )//dm case
 			     {
 			     TPtrC8 FindUri = NSmlDmURI::URISeg(aURI,2);
 			     HBufC8* puri = HBufC8::NewLC(Uri1.Length()+FindUri.Length()+2);
@@ -634,7 +634,8 @@
 		// FOTA 
 		// For the FOTA adapter put the correlator to aObject instead of
 		// data.
-		if ( iAdapterId == KNSmlDMFotaAdapterImplUid || iAdapterId == KNSmlDMAMAdapterImplUid)
+		if ( iAdapterId == KNSmlDMFotaAdapterImplUid || iAdapterId == KNSmlDMAMAdapterImplUid
+				|| iAdapterId == KNSmlDMLawMoAdapterImplUid)
 			{
 			iSessionArray[iSessionId-1].ExecuteCommandL(iAdapterId,*luid,
 				aStatusRef,aURI,aCorrelator,aType,aLargeItem);
--- a/syncmlfw/dm/treemodule/src/nsmldmmodule.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/treemodule/src/nsmldmmodule.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -41,7 +41,7 @@
 // ----------------------------------------------------------------------------
 // CNSmlDmModule::~CNSmlDmModule()
 // ----------------------------------------------------------------------------
-EXPORT_C CNSmlDmModule::~CNSmlDmModule()
+CNSmlDmModule::~CNSmlDmModule()
 	{
 	delete iDDF;
 	delete iCommandBuffer;
--- a/syncmlfw/dm/wappushalert/bld/nsmldmwappushalert.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/dm/wappushalert/bld/nsmldmwappushalert.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -30,6 +30,7 @@
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/push
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE		/epoc32/include/platform/mw/push
 #endif
@@ -49,5 +50,5 @@
 LIBRARY         ecom.lib 
 LIBRARY         wappushutils.lib 
 LIBRARY         nsmldebug.lib
-LIBRARy					NSmlPrivateAPI.lib
+LIBRARy		nsmlprivateapi.lib
 SMPSAFE
--- a/syncmlfw/ds/agentlog/src/nsmlagentlog.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/agentlog/src/nsmlagentlog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -1457,37 +1457,57 @@
 						break;
 
 						case ESourceRef:
-							dbCaps->SetSourceRefL(ptrStringPart);
-								
+						    if (dbCaps)
+						        {
+							    dbCaps->SetSourceRefL(ptrStringPart);
+						        }							
 						break;
 
 						case EDisplayName:
-							dbCaps->SetDisplayNameL(ptrStringPart);
+						    if (dbCaps)
+						        {
+							    dbCaps->SetDisplayNameL(ptrStringPart);
+						        }
 						break;
 
 						case EMaxGUIDSize:
-							dbCaps->SetMaxGuidSizeL(ptrStringPart);
+						    if (dbCaps)
+						        {
+							    dbCaps->SetMaxGuidSizeL(ptrStringPart);
+						        }
 						break;
 
 						case ERxPref:
 							separator = ptrStringPart.Locate(KTabSeparator()[0]);
-							dbCaps->SetRxPrefL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							if (dbCaps)
+							   {
+							   dbCaps->SetRxPrefL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							   }
 						break;
 
 						case ERx:
 							separator = ptrStringPart.Locate(KTabSeparator()[0]);
-							dbCaps->AddRxL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							if (dbCaps)
+							   {
+							   dbCaps->AddRxL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							   }
 						break;
 
 						case ETxPref:
 							separator = ptrStringPart.Locate(KTabSeparator()[0]);
-							dbCaps->SetTxPrefL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							if (dbCaps)
+							   {
+							   dbCaps->SetTxPrefL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							   }
 						break;
 
 
 						case ETx:
 							separator = ptrStringPart.Locate(KTabSeparator()[0]);
-							dbCaps->AddTxL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							if (dbCaps)
+							    {
+							    dbCaps->AddTxL(ptrStringPart.Left(separator),ptrStringPart.Right(ptrStringPart.Length()-separator-1));
+							    }
 						break;
 
 
@@ -1495,7 +1515,10 @@
 						break;
 
 						case ESupportHierarchicalSync:
-							dbCaps->SetSupportHierarchicalSyncL();
+						    if (dbCaps)
+						       {
+							    dbCaps->SetSupportHierarchicalSyncL();
+						       }
 						break;
 
 						case ESyncCap:
--- a/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/inc/testprofileutil.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/inc/testprofileutil.h	Wed Sep 01 12:27:42 2010 +0100
@@ -25,8 +25,7 @@
 #include <TestScripterInternal.h>
 #include <StifTestModule.h>
 #include <TestclassAssert.h>
-#include <centralrepository.h>
-#include <CoreApplicationUIsSDKCRKeys.h>
+
 
 //SyncML Includes
 
@@ -35,6 +34,7 @@
 #include <SyncMLClientDM.h>
 #include <SyncMLObservers.h>
 #include <SyncMLErr.h>
+#include <MProfileEngineExtended.h>
 
 
 // CONSTANTS
@@ -229,7 +229,8 @@
           TSmlTransportId			iConnectionId;
           TSmlDataProviderId		iDataProviderId;
           
-          // Reserved pointer for future extension
+          MProfileEngineExtended* iProfileEngine;
+         // Reserved pointer for future extension
         //TAny* iReserved;
 
     public:     // Friend classes
@@ -333,9 +334,7 @@
 		
 		void CloseSyncSession();
 		
-		void OfflineModeL();
-				
- private:
+  private:
         
         TInt iInterruptStage;
          
@@ -348,6 +347,9 @@
         TStatus iPrgPrevStatus;
 		
 		TStatus iPrgCurStatus;
+        
+        MProfileEngineExtended* iProfileEngine;
+         
             
 };
 
--- a/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testprofileutilBlocks.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testprofileutilBlocks.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -690,14 +690,11 @@
 
 TInt Ctestprofileutil::OffLineL( CStifItemParser& /*aItem*/ )
 {
-    CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
-    TInt err = repository->Set(KCoreAppUIsNetworkConnectionAllowed, 
-                                        ECoreAppUIsNetworkConnectionNotAllowed);
-    
-    if(repository)
-       delete repository;
-    
-    User::LeaveIfError(err);
+  iProfileEngine = CreateProfileEngineExtendedL();
+  iProfileEngine->SetActiveProfileL( 5);	
+  iProfileEngine->Release();
+ 
+   	
    	return KErrNone;
 
 }
@@ -711,14 +708,11 @@
 
 TInt Ctestprofileutil::GeneralL( CStifItemParser& /*aItem*/ )
 {
-    CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
-    TInt err = repository->Set(KCoreAppUIsNetworkConnectionAllowed, 
-                                            ECoreAppUIsNetworkConnectionAllowed);
-    if(repository)
-         delete repository;
-    User::LeaveIfError(err);
-    
-    
+  iProfileEngine = CreateProfileEngineExtendedL();
+  iProfileEngine->SetActiveProfileL(0);	
+  iProfileEngine->Release();
+ 
+   	
    	return KErrNone;
 
 }
--- a/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testsync.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testsync.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -267,25 +267,55 @@
 	switch(iInterruptStage)
 	{
 		case 1:if(aStatus==ESmlConnecting)
-	              OfflineModeL();
-	           break;
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }		  
+		      break;
 		case 2:if(aStatus==ESmlConnected)
-                  OfflineModeL();
-		       break;
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }
+		
+		      break;
 		case 3:if(aStatus==ESmlLoggingOn)
-		          OfflineModeL();
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }
 		      break;
 		case 4:if(aStatus==ESmlLoggedOn)
-		          OfflineModeL();
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }
 		      break;
 		case 5:if(aStatus==ESmlSendingModificationsToServer)
-		          OfflineModeL();
-		      break;		      
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }
+		      break;
+		      
 	    case 6:if(aStatus==ESmlReceivingModificationsFromServer)
-                  OfflineModeL();
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }
 		      break;
 	   case 7:if(aStatus==ESmlSendingMappingsToServer)
-	             OfflineModeL();
+	           {
+  				iProfileEngine = CreateProfileEngineExtendedL();
+  				iProfileEngine->SetActiveProfileL( 5);	
+  				iProfileEngine->Release();
+	           }
 		      break;
 		default:
 		      break;
@@ -302,15 +332,5 @@
 	//Do Nothing
 }
 
-void CSync::OfflineModeL()
-{
-    CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
-    TInt err = repository->Set(KCoreAppUIsNetworkConnectionAllowed, 
-            ECoreAppUIsNetworkConnectionNotAllowed);
-    if(repository)
-           delete repository;
-    User::LeaveIfError(err);    
-  
-}
 
 
--- a/syncmlfw/ds/dsutils/dbcaps/src/NSmlPropParam.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/dsutils/dbcaps/src/NSmlPropParam.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -32,7 +32,7 @@
 // CNSmlPropParam::CNSmlPropParam
 // -----------------------------------------------------------------------------
 //
-EXPORT_C CNSmlPropParam::CNSmlPropParam( SmlDevInfPropParamPtr_t aParamPtr )
+CNSmlPropParam::CNSmlPropParam( SmlDevInfPropParamPtr_t aParamPtr )
  : iParamPtr(aParamPtr)
 	{
 	//_DBG_FILE("CNSmlPropParam::CNSmlPropParam(): begin");
--- a/syncmlfw/ds/dsutils/dbcaps/src/NSmldbcapsSerializer.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/dsutils/dbcaps/src/NSmldbcapsSerializer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -344,9 +344,12 @@
 	const sml_devinf_datastore_s* dds = aDbCaps.Datastore();
 	
 	//display name
-	NSmlUnicodeConverter::HBufC16InUnicodeLC( 
-		TNSmlDbCapsSerializer::SafePtr( dds->displayname ), self->iDisplayName );
-	CleanupStack::Pop( self->iDisplayName ); // self->iDisplayName
+	if(dds)
+	    {
+        NSmlUnicodeConverter::HBufC16InUnicodeLC( 
+                TNSmlDbCapsSerializer::SafePtr( dds->displayname ), self->iDisplayName );
+        CleanupStack::Pop( self->iDisplayName ); // self->iDisplayName
+	    }
 	
 	//sync types
 	TSmlSyncTypeMask& synctype( self->iSyncTypeMask );
@@ -404,31 +407,34 @@
 		{
 		synctype.SetNotSupported( ESmlRefreshFromClient );
 		}
-	
-	if ( dds->dsmem )
-		{
-		//max size
-		if ( dds->dsmem->maxmem )
-			{
-			TLex8 lex( dds->dsmem->maxmem->Data() );
-			User::LeaveIfError( lex.Val( self->iMaxSize, EDecimal ) );
-			self->iFlags |= KSmlDataStore_HasMaxSize;
-			}
-		
-		//max items
-		if ( dds->dsmem->maxid )
-			{
-			TLex8 lex( dds->dsmem->maxid->Data() );
-			User::LeaveIfError( lex.Val( self->iMaxItems, EDecimal ) );
-			self->iFlags |= KSmlDataStore_HasMaxItems;
-			}
-		}
-	
-	//options
-	if ( dds->supportHierarchicalSync )
-		{
-		self->iFlags |= KSmlDataStore_Hierarchical;
-		}
+	if (dds)
+        {
+        if ( dds->dsmem )
+            {
+            //max size
+            if ( dds->dsmem->maxmem )
+                {
+                TLex8 lex( dds->dsmem->maxmem->Data() );
+                User::LeaveIfError( lex.Val( self->iMaxSize, EDecimal ) );
+                self->iFlags |= KSmlDataStore_HasMaxSize;
+                }
+            
+            //max items
+            if ( dds->dsmem->maxid )
+                {
+                TLex8 lex( dds->dsmem->maxid->Data() );
+                User::LeaveIfError( lex.Val( self->iMaxItems, EDecimal ) );
+                self->iFlags |= KSmlDataStore_HasMaxItems;
+                }
+            }
+        
+        
+        //options
+        if ( dds->supportHierarchicalSync )
+            {
+            self->iFlags |= KSmlDataStore_Hierarchical;
+            }
+        }
 	
 	//filter caps
 	const sml_devinf_filtercaplist_s* filterList = aDbCaps.FilterCapsList();
@@ -450,90 +456,93 @@
 	// First search all mime types that server supports at receiving
 	// RX-pref
 	CSmlMimeFormat* tempFormatRX = CSmlMimeFormat::NewLC();
-	const TPtrC8& ctTypeRX = TNSmlDbCapsSerializer::SafePtr( dds->rxpref->cttype );
-	const TPtrC8& verCtRX = TNSmlDbCapsSerializer::SafePtr( dds->rxpref->verct );
-	if ( ctTypeRX.Compare( KNullDesC8 ) != 0 && verCtRX.Compare( KNullDesC8 ) != 0 )
-		{
-		RStringF mimeFormatRX = aStringPool.OpenFStringL( ctTypeRX );
-		RStringF mimeVersionRX = aStringPool.OpenFStringL( verCtRX );
-		tempFormatRX->SetMimeTypeL( mimeFormatRX );
-		tempFormatRX->SetMimeVersionL( mimeVersionRX );
-		mimeFormatArray.AppendL( tempFormatRX );
-		CleanupStack::Pop(); // tempFormatRX
-		}
-	else
-		{
-		CleanupStack::PopAndDestroy(); // tempFormatRX
-		}
-	// RXs
-	if ( dds )
-		{
-		SmlDevInfXmitListPtr_t rx = dds->rx;
-		for ( ; rx ; rx = rx->next )
-			{
-			CSmlMimeFormat* tempFormat = CSmlMimeFormat::NewLC();
-			const TPtrC8& ctType = TNSmlDbCapsSerializer::SafePtr( rx->data->cttype );
-			const TPtrC8& verCt = TNSmlDbCapsSerializer::SafePtr( rx->data->verct );
-			if ( ctType.Compare( KNullDesC8 ) != 0 && verCt.Compare( KNullDesC8 ) != 0 )
-				{
-				RStringF mimeFormat = aStringPool.OpenFStringL( ctType );
-				RStringF mimeVersion = aStringPool.OpenFStringL( verCt );
-				tempFormat->SetMimeTypeL( mimeFormat );
-				tempFormat->SetMimeVersionL( mimeVersion );
-				mimeFormatArray.AppendL( tempFormat );
-				CleanupStack::Pop(); // tempFormat
-				}
-			else
-				{
-				CleanupStack::PopAndDestroy(); // tempFormat
-				}
-			}
-		}
-	
-	const sml_devinf_ctcaplist_s*  ctCapList = dds->ctcap;
-	if ( ctCapList == 0 )
-		{
-		ctCapList = aDbCaps.CtCaps();
-		}
-	// Then add CTCaps to correct mime types
-	if ( ctCapList != 0 )
-	    {    
-        for (; ctCapList; ctCapList = ctCapList->next )
-    		{
-    		const SmlDevInfCtCapPtr_t ctCap = ctCapList->data;
-    		if ( ctCap->cttype->Data() == KNSmlFolderType )
-    			{
-    			SmlDevInfPropertyListPtr_t dipl = ctCap->property;
-    			for ( ; dipl; dipl = dipl->next )
-    				{
-    				const SmlDevInfPropertyPtr_t dip = dipl->data;
-    				if ( dip )
-    					{
-    					CSmlDataProperty *temppoint = CNSmlDataPropertyFromDbCaps::NewLC( aStringPool, dip );
-    					self->iFolderProperties.AppendL( temppoint );
-    					CleanupStack::Pop(); //  temppoint
-    					}
-    				}
-    			}
-    		else
-    			{
-    			for ( TInt j(0); j < mimeFormatArray.Count(); j++ )
-    			    {
-    			    if ( mimeFormatArray[j]->MimeType().DesC().Compare( ctCap->cttype->Data() ) == 0 )
-    			        {
-    			        // Mime version is only in rx-pref or in rx so it must be copied to new mime format
-    			        CSmlMimeFormat* temppoint = CNSmlMimeFormatFromDbCaps::NewLC( aStringPool, *ctCap );
-    			        RStringF newMimeVersion = aStringPool.OpenFStringL( mimeFormatArray[j]->MimeVersion().DesC() );
-    			        temppoint->SetMimeVersionL( newMimeVersion );
-    			        delete mimeFormatArray[j];
-    			        mimeFormatArray[j] = NULL;
-    			        mimeFormatArray[j] = temppoint;
-    			        CleanupStack::Pop(); //  temppoint
-    			        }
-    			    }
-    			}
-    		}
-	    }
+    if( dds )
+        {
+        const TPtrC8& ctTypeRX = TNSmlDbCapsSerializer::SafePtr( dds->rxpref->cttype );
+        const TPtrC8& verCtRX = TNSmlDbCapsSerializer::SafePtr( dds->rxpref->verct );
+                    
+        if ( ctTypeRX.Compare( KNullDesC8 ) != 0 && verCtRX.Compare( KNullDesC8 ) != 0 )
+            {
+            RStringF mimeFormatRX = aStringPool.OpenFStringL( ctTypeRX );
+            RStringF mimeVersionRX = aStringPool.OpenFStringL( verCtRX );
+            tempFormatRX->SetMimeTypeL( mimeFormatRX );
+            tempFormatRX->SetMimeVersionL( mimeVersionRX );
+            mimeFormatArray.AppendL( tempFormatRX );
+            CleanupStack::Pop(); // tempFormatRX
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(); // tempFormatRX
+            }
+        // RXs
+        
+            SmlDevInfXmitListPtr_t rx = dds->rx;
+            for ( ; rx ; rx = rx->next )
+                {
+                CSmlMimeFormat* tempFormat = CSmlMimeFormat::NewLC();
+                const TPtrC8& ctType = TNSmlDbCapsSerializer::SafePtr( rx->data->cttype );
+                const TPtrC8& verCt = TNSmlDbCapsSerializer::SafePtr( rx->data->verct );
+                if ( ctType.Compare( KNullDesC8 ) != 0 && verCt.Compare( KNullDesC8 ) != 0 )
+                    {
+                    RStringF mimeFormat = aStringPool.OpenFStringL( ctType );
+                    RStringF mimeVersion = aStringPool.OpenFStringL( verCt );
+                    tempFormat->SetMimeTypeL( mimeFormat );
+                    tempFormat->SetMimeVersionL( mimeVersion );
+                    mimeFormatArray.AppendL( tempFormat );
+                    CleanupStack::Pop(); // tempFormat
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy(); // tempFormat
+                    }
+                }
+            
+        
+        const sml_devinf_ctcaplist_s*  ctCapList = dds->ctcap;
+        if ( ctCapList == 0 )
+            {
+            ctCapList = aDbCaps.CtCaps();
+            }
+        // Then add CTCaps to correct mime types
+        if ( ctCapList != 0 )
+            {    
+            for (; ctCapList; ctCapList = ctCapList->next )
+                {
+                const SmlDevInfCtCapPtr_t ctCap = ctCapList->data;
+                if ( ctCap->cttype->Data() == KNSmlFolderType )
+                    {
+                    SmlDevInfPropertyListPtr_t dipl = ctCap->property;
+                    for ( ; dipl; dipl = dipl->next )
+                        {
+                        const SmlDevInfPropertyPtr_t dip = dipl->data;
+                        if ( dip )
+                            {
+                            CSmlDataProperty *temppoint = CNSmlDataPropertyFromDbCaps::NewLC( aStringPool, dip );
+                            self->iFolderProperties.AppendL( temppoint );
+                            CleanupStack::Pop(); //  temppoint
+                            }
+                        }
+                    }
+                else
+                    {
+                    for ( TInt j(0); j < mimeFormatArray.Count(); j++ )
+                        {
+                        if ( mimeFormatArray[j]->MimeType().DesC().Compare( ctCap->cttype->Data() ) == 0 )
+                            {
+                            // Mime version is only in rx-pref or in rx so it must be copied to new mime format
+                            CSmlMimeFormat* temppoint = CNSmlMimeFormatFromDbCaps::NewLC( aStringPool, *ctCap );
+                            RStringF newMimeVersion = aStringPool.OpenFStringL( mimeFormatArray[j]->MimeVersion().DesC() );
+                            temppoint->SetMimeVersionL( newMimeVersion );
+                            delete mimeFormatArray[j];
+                            mimeFormatArray[j] = NULL;
+                            mimeFormatArray[j] = temppoint;
+                            CleanupStack::Pop(); //  temppoint
+                            }
+                        }
+                    }
+                }
+            }
+        }
 	self->SetMimeFormatsL( mimeFormatArray );
 	mimeFormatArray.ResetAndDestroy();
 	CleanupStack::PopAndDestroy(); // mimeFormatArray
--- a/syncmlfw/ds/hostserver/dshostserverbase/bld/nsmldshostserver.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/hostserver/dshostserverbase/bld/nsmldshostserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -27,7 +27,6 @@
 
 TARGET          nsmldshostserver.dll
 TARGETTYPE      dll
-UID             0x1000008d 0x2002DCFF
 
 #if defined(ARMCC)
 DEFFILE		./def/eabidshostserver
@@ -53,6 +52,7 @@
 SOURCE		Nsmldsasyncrequesthandler.cpp
 SOURCE		Nsmldsasynccallback.cpp
 SOURCE		NsmldschangedItemsFetcher.cpp
+SOURCE		Nsmldshostsessioncancel.cpp
 
 LIBRARY     euser.lib ecom.lib efsrv.lib edbms.lib estor.lib bafl.lib smlstoreformat.lib
 LIBRARY		nsmldebug.lib smldataprovider.lib nsmldshostclient.lib NSmlAdapterLog.lib
--- a/syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsession.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -32,7 +32,8 @@
 #include "nsmldsitemmodificationset.h"
 #include "Nsmldsasyncrequesthandler.h"
 #include "Nsmldsdataproviderarray.h"
-
+#include "Nsmldshostsessioncanceleventhandler.h"
+#include "Nsmldshostsessioncancel.h"
 // ------------------------------------------------------------------------------------------------
 // Class forwards
 // ------------------------------------------------------------------------------------------------
@@ -48,7 +49,8 @@
 //
 // @lib nsmldshostserver.lib
 // ------------------------------------------------------------------------------------------------
-class CNSmlDSHostSession : public CSession2
+class CNSmlDSHostSession : public CSession2,
+                           public MNSmlDsHostSessionCancelEventHandler
 	{
 private:	//DATA TYPES and INNER CLASSES
 	typedef CNSmlDSAsyncCallBack::TCallBackOperation TCallBackOperation;
@@ -252,7 +254,11 @@
 public:	//Functions from base classes.
 
 	void ServiceL( const RMessage2 &aMessage );
-	
+    /**
+    * Called when user canceled the operation
+    * @none.
+    */
+	void HandleCancelEventL();
 private:	// New methods
 	
     /**
@@ -689,12 +695,22 @@
 	*/
     void StreamBufferToChunkL( TMemPtr& aMemPtr, TStreamBuffers* aSb );
     
+    /**
+    * Called when DeleteAll request is finished
+    * @param aDSAO. pointer to asynchronous request handler
+    * @param aOperation. callback operation.
+    */
+    TInt DeleteAllFinishedL( CNSmlDSAsyncCallBack* aDSAO, TCallBackOperation aOperation );
+       
 private:	//Data
 
 	TMemPtr iMemPtr;
 	CNSmlDSHostServer& iServer;
     RNSmlDSDataProviderArray iDataProviders;
     RStringPool iStringPool;
+    CNSmlHostSessionCancel* iCancelEventHandler;
+    CNSmlDSAsyncCallBack* iDsoDeleteAll;
+
 	};
 	
 #include "Nsmldshostsession.inl"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsessioncancel.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* ==============================================================================
+*  Name        : nsmldshostsessioncancel.h
+*  Part of     : Nokia SyncML / Host Server
+*  Interface   : None
+*  Description : 
+*  Version     : $Revision: 54 $ $Modtime: 2.11.05 8:53 $
+*
+*  Copyright © 2002-2005 Nokia. All rights reserved.
+*  This material, including documentation and any related 
+*  computer programs, is protected by copyright controlled by 
+*  Nokia Corporation. All rights are reserved. Copying, 
+*  including reproducing, storing, adapting or translating, any 
+*  or all of this material requires the prior written consent of 
+*  Nokia Corporation. This material also contains confidential 
+*  information which may not be disclosed to others without the 
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+
+#ifndef __NSMLDSHOSTSESSIONCANCEL_H__
+#define __NSMLDSHOSTSESSIONCANCEL_H__
+
+
+// --------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------
+#include <e32base.h>
+#include <s32mem.h> 
+#include <badesca.h>
+#include <e32property.h>
+
+
+// ------------------------------------------------------------------------------------------------
+// Class forwards
+// ------------------------------------------------------------------------------------------------
+class MNSmlDsHostSessionCancelEventHandler;
+
+/**
+* An active class to handle user initiated cancel.
+*  This class informs session to cancel the outgoing session.
+*
+*  @since 
+*/
+class CNSmlHostSessionCancel : public CActive
+	{
+public:
+    static CNSmlHostSessionCancel* NewL( MNSmlDsHostSessionCancelEventHandler* aHandler );
+    //Destructure
+	~CNSmlHostSessionCancel();
+	//Subscribe for the property "Cancel Operation".
+    void Subscribe();
+
+private:    
+    //Contructure
+    CNSmlHostSessionCancel( MNSmlDsHostSessionCancelEventHandler* aHandler );
+    //Second phase construction.
+    void ConstructL();
+    //From CActive class
+    void RunL();
+    void DoCancel();
+    TInt RunError ( TInt aError );
+
+private:
+    MNSmlDsHostSessionCancelEventHandler* iHandler;
+    RProperty iProperty;
+	};
+
+
+#endif // __NSMLDSHOSTSESSIONCANCEL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/ds/hostserver/dshostserverbase/inc/Nsmldshostsessioncanceleventhandler.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* ==============================================================================
+*  Name        : Nsmldshostsessioncanceleventhandler.h
+*  Part of     : Nokia SyncML / Host Server
+*  Description : Header file for MNSmlDsHostSessionCancelEventHandler
+*  Version     : 
+*
+*  Copyright © 2002-2005 Nokia Corporation.
+*  This material, including documentation and any related 
+*  computer programs, is protected by copyright controlled by 
+*  Nokia Corporation. All rights are reserved. Copying, 
+*  including reproducing, storing, adapting or translating, any 
+*  or all of this material requires the prior written consent of 
+*  Nokia Corporation. This material also contains confidential 
+*  information which may not be disclosed to others without the 
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+
+#ifndef NSMLDSHOSTSESSIONCANCELEVENTHANDLER_H
+#define NSMLDSHOSTSESSIONCANCELEVENTHANDLER_H
+
+#include <e32std.h>
+#
+// CLASS DECLARATION
+
+
+/**
+* Interface class to handle database events
+* 
+*/
+class MNSmlDsHostSessionCancelEventHandler
+	{
+
+	public:
+		/**
+        * CNSmlHostSessionCancel calls this to inform that host session that user has
+        * canceled the opeartion.
+        * @return None. 
+        */
+		virtual void HandleCancelEventL() = 0;
+	};
+	
+
+
+#endif // NSMLDSHOSTSESSIONCANCELEVENTHANDLER_H
+
+// End of File
--- a/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldsasynccallback.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldsasynccallback.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -88,6 +88,7 @@
     if ( iReqFinishedFunc != NULL )
     	{
     	( *iSession.*iReqFinishedFunc )( this, ECanceled );
+    	iMessage.Complete( KErrCancel);
     	}
     }
 
--- a/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -30,6 +30,8 @@
 #include "NSmlAdapterLog.h"
 #include "nsmldshostconstants.h"
 #include "Nsmldshostserver.h"
+#include "Nsmldshostsessioncanceleventhandler.h"
+#include "Nsmldshostsessioncancel.h"
 #include "Nsmldshostsession.h"
 #include "nsmldsdpinformation.h"
 #include "Nsmldsdataproviderarray.h"
@@ -174,6 +176,16 @@
     iMemPtr.iChunk.Close();
     iDataProviders.ResetAndDestroy();
     iStringPool.Close();
+    if(iDsoDeleteAll)
+      {
+      delete iDsoDeleteAll;
+      iDsoDeleteAll = NULL;
+      }   
+    if(iCancelEventHandler)
+        {
+        delete iCancelEventHandler;
+        iCancelEventHandler = NULL;
+        }
     REComSession::FinalClose();
     iServer.DecSessionCount();
 	_DBG_FILE( "CNSmlDSHostSession::~CNSmlDSHostSession(): end" );
@@ -410,6 +422,8 @@
 	{
 	_DBG_FILE( "CNSmlDSHostSession::ConstructL(): begin" );
     iStringPool.OpenL();
+	iDsoDeleteAll = NULL;
+	iCancelEventHandler = NULL;
 	_DBG_FILE( "CNSmlDSHostSession::ConstructL(): end" );
 	}
 	
@@ -855,7 +869,7 @@
     	}
     
     CNSmlDSAsyncCallBackForOpen* p = new ( ELeave ) CNSmlDSAsyncCallBackForOpen( 
-    	this, aMessage, &CNSmlDSHostSession::OpenFinishedL );
+    	this, aMessage, OpenFinishedL );
     CleanupStack::PushL( p );
     
     p->iDpi = DataProviderItemL( aMessage.Int0() );
@@ -1024,7 +1038,7 @@
     RArray<TInt>* resultArray = new ( ELeave ) RArray<TInt>;
     CleanupStack::PushL( resultArray );
     CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( 
-    	this, dsi, aMessage, &CNSmlDSHostSession::CommitBatchRequestFinishedL, resultArray );
+    	this, dsi, aMessage, CommitBatchRequestFinishedL, resultArray );
     CleanupStack::Pop( resultArray ); //dsao takes ownership
     
     CleanupStack::PushL( dsao );
@@ -1162,7 +1176,7 @@
     CNSmlServerDSHostItem* dshi = DataStoreItemParamsLC();
     
     CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( 
-    	this, dsi, aMessage, &CNSmlDSHostSession::OpenItemRequestFinishedL, dshi );
+    	this, dsi, aMessage, OpenItemRequestFinishedL, dshi );
     CleanupStack::Pop( dshi ); //dsao takes ownership
     CleanupStack::PushL( dsao );
     
@@ -1244,7 +1258,7 @@
     TNSmlDSDataStoreElement* dsi = DataStoreItemL( aMessage );
     CNSmlServerDSHostItem* dshi = DataStoreItemParamsLC();
     CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( 
-    	this, dsi, aMessage, &CNSmlDSHostSession::CreateItemRequestFinishedL, dshi );
+    	this, dsi, aMessage, CreateItemRequestFinishedL, dshi );
     CleanupStack::Pop( dshi ); //dsao takes ownership
     CleanupStack::PushL( dsao );
     
@@ -1381,7 +1395,7 @@
     TNSmlDSDataStoreElement* dsi = DataStoreItemL( aMessage );
 
     CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( 
-    	this, dsi, aMessage, &CNSmlDSHostSession::CommitItemRequestFinishedL );
+    	this, dsi, aMessage, CommitItemRequestFinishedL );
     CleanupStack::PushL( dsao );
     dsao->CallDSAsyncLC().CommitItemL( dsao->iStatus );
     CleanupStack::Pop(2); //CallDSAsyncLC, dsao
@@ -1486,11 +1500,14 @@
 // ------------------------------------------------------------------------------------------------	
 void CNSmlDSHostSession::DeleteAllItemsL( const RMessage2& aMessage )
 	{
+    //Create cancel event handler
+    iCancelEventHandler = CNSmlHostSessionCancel::NewL(this);
     TNSmlDSDataStoreElement* dsi = DataStoreItemL( aMessage );
-    CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( this, dsi, aMessage );
+    CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( this, dsi, aMessage, DeleteAllFinishedL );
     CleanupStack::PushL( dsao );
-    dsao->CallDSAsyncLC().DeleteAllItemsL( dsao->iStatus );
+    dsao->CallDSAsyncLC().DeleteAllItemsL( dsao->iStatus );   
     CleanupStack::Pop(2); //CallDSAsyncLC(), dsao
+    iDsoDeleteAll = dsao;
 	}
 
 // ------------------------------------------------------------------------------------------------
@@ -1622,7 +1639,7 @@
 	TNSmlDSDataStoreElement* dsi = DataStoreItemL( aMessage );
 	
     CNSmlDSChangedItemsFetcher* dsao = CNSmlDSChangedItemsFetcher::NewLC( 
-    	this, dsi, aMessage, &CNSmlDSHostSession::AllItemsRequestFinishedL );
+    	this, dsi, aMessage, AllItemsRequestFinishedL );
     dsao->FetchAllChangedItemsL();
     CleanupStack::Pop(); //dsao
 	}
@@ -1673,7 +1690,7 @@
     CleanupStack::PopAndDestroy(); //readStream
     
     CNSmlDSAsyncCallBack* dsao = new ( ELeave ) CNSmlDSAsyncCallBack( 
-    	this, dsi, aMessage, &CNSmlDSHostSession::CommitChangesRequestFinishedL, dius );
+    	this, dsi, aMessage, CommitChangesRequestFinishedL, dius );
     CleanupStack::Pop( dius ); //dsao takes the ownership.
     CleanupStack::PushL( dsao );
     dsao->CallDSAsyncLC().CommitChangeInfoL( dsao->iStatus, *dius );
@@ -1891,4 +1908,46 @@
 	CleanupStack::PopAndDestroy(); //wStream
 	}
 
+// ------------------------------------------------------------------------------------------------
+// CNSmlDSHostSession::HandleCancelEventL
+// called when user canceled the operation
+// ------------------------------------------------------------------------------------------------ 
+void CNSmlDSHostSession::HandleCancelEventL()
+    {
+    if(iCancelEventHandler)
+        {
+        iDsoDeleteAll->Cancel();
+        }
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDSHostSession::DeleteAllFinishedL
+// called when DeleteAll request is finished.
+// Note! when aOperation is CNSmlDSAsyncCallBack::ECanceled or CNSmlDSAsyncCallBack::EFree, 
+// aDSAO->iDSItem might be NULL.
+// ------------------------------------------------------------------------------------------------ 
+TInt CNSmlDSHostSession::DeleteAllFinishedL( CNSmlDSAsyncCallBack* aDSAO, TCallBackOperation aOperation )
+    {
+    TInt err( aDSAO->iStatus.Int() );
+
+    switch( aOperation )
+        {
+        case CNSmlDSAsyncCallBack::EFinished:
+        case CNSmlDSAsyncCallBack::ECanceled:
+        case CNSmlDSAsyncCallBack::EFree:
+            {
+            if(iCancelEventHandler)
+                {
+                delete iCancelEventHandler;
+                iCancelEventHandler = NULL;
+                iDsoDeleteAll = NULL;
+                }
+            break;
+            }
+        default:
+            User::Leave( KErrUnknown );
+        };
+
+    return err;
+    }
 // End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsessioncancel.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* ==============================================================================
+*  Name        : Nsmldshostsessioncancel.cpp
+*  Part of     : Nokia SyncML / DS Loader Framework
+*  Description : Handling Session cancel for DS host server.
+*  Version     : $Revision: 41 $ $Modtime: 09.02.10 8:05 $
+*
+*  Copyright © 2005 Nokia Corporation.
+*  This material, including documentation and any related 
+*  computer programs, is protected by copyright controlled by 
+*  Nokia Corporation. All rights are reserved. Copying, 
+*  including reproducing, storing, adapting or translating, any 
+*  or all of this material requires the prior written consent of 
+*  Nokia Corporation. This material also contains confidential 
+*  information which may not be disclosed to others without the 
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+//#include <sbdefs.h>
+#include <d32dbms.h>
+#include <nsmldebug.h>
+#include <DataSyncInternalPSKeys.h>
+#include "Nsmldshostsessioncanceleventhandler.h"
+#include "Nsmldshostsessioncancel.h"
+// --------------------------------------------------------------------------
+// CNSmlHostSessionCancel* CNSmlHostSessionCancel::NewL( MNSmlDsHostSessionCancelEventHandler* aHandler )
+// --------------------------------------------------------------------------
+//
+CNSmlHostSessionCancel* CNSmlHostSessionCancel::NewL( MNSmlDsHostSessionCancelEventHandler* aHandler )
+	{
+	CNSmlHostSessionCancel* self = new (ELeave) CNSmlHostSessionCancel( aHandler );
+	CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(); // self
+	return self;
+	}
+
+// --------------------------------------------------------------------------
+// CNSmlHostSessionCancel::CNSmlHostSessionCancel( MNSmlDsHostSessionCancelEventHandler* aHandler )
+// --------------------------------------------------------------------------
+//
+CNSmlHostSessionCancel::CNSmlHostSessionCancel( MNSmlDsHostSessionCancelEventHandler* aHandler ) :
+    CActive( EPriorityNormal ),
+    iHandler( aHandler )
+	{
+    CActiveScheduler::Add(this);
+	}
+
+// --------------------------------------------------------------------------
+// void CNSmlHostSessionCancel::Subscribe()
+// --------------------------------------------------------------------------
+//
+void CNSmlHostSessionCancel::Subscribe()
+    {
+    if ( !IsActive() )
+        {
+        iProperty.Subscribe( iStatus );    
+        SetActive();
+        }
+    }
+
+// --------------------------------------------------------------------------
+// void CNSmlHostSessionCancel::ConstructL()
+// --------------------------------------------------------------------------
+//
+void CNSmlHostSessionCancel::ConstructL()
+    {
+    iProperty.Attach( KPSUidNSmlDSSyncApp, KDsJobCancel );
+    Subscribe();    
+    }
+
+// --------------------------------------------------------------------------
+// CNSmlHostSessionCancel::~CNSmlHostSessionCancel()
+// --------------------------------------------------------------------------
+//
+CNSmlHostSessionCancel::~CNSmlHostSessionCancel()
+	{
+    Cancel();
+    iProperty.Close();
+    }
+
+// --------------------------------------------------------------------------
+// void CNSmlHostSessionCancel::RunL()
+// --------------------------------------------------------------------------
+//
+void CNSmlHostSessionCancel::RunL()
+    {
+    _DBG_FILE("CNSmlHostSessionCancel::RunL() : Begin");
+    
+    TInt value(0);
+    iProperty.Get( value );
+    
+    if( value == KErrCancel)
+        {
+        _DBG_FILE("CNSmlHostSessionCancel::RunL() :: user has canceled the operation");
+
+        //user has canceled the opeartion inform session
+        iHandler->HandleCancelEventL();
+        }
+    else
+        {
+        Subscribe();
+        }
+
+    _DBG_FILE("CNSmlHostSessionCancel::RunL() : End");
+    }
+
+// ----------------------------------------------------------------------------
+// CNSmlHostSessionCancel::RunError
+// ----------------------------------------------------------------------------
+TInt CNSmlHostSessionCancel::RunError ( TInt aError )
+{
+    return KErrNone;
+}
+
+// --------------------------------------------------------------------------
+// void CNSmlHostSessionCancel::DoCancel()
+// --------------------------------------------------------------------------
+//
+void CNSmlHostSessionCancel::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+//  End of File
--- a/syncmlfw/ds/hostserver/dshostservers/bld/nsmldshostserver1.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/hostserver/dshostservers/bld/nsmldshostserver1.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -20,8 +20,7 @@
 #include <platform_paths.hrh>
 
 CAPABILITY		ReadUserData WriteUserData // This server has Read / Write capabilities for user data.
-EPOCSTACKSIZE		0x14000
-EPOCHEAPSIZE	0x020000 0x800000 	// minimum and maximum heap sizes 
+EPOCHEAPSIZE	0x500 0x400000 	// minimum and maximum heap sizes 
 VENDORID		VID_DEFAULT
 UID				0 0x101F99FD
 TARGET			nsmldshostserver1.exe
--- a/syncmlfw/ds/hostserver/dshostservers/bld/nsmldshostserver2.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/hostserver/dshostservers/bld/nsmldshostserver2.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -21,8 +21,7 @@
 
 // This server has read and write capabilities for device and user data
 CAPABILITY		ReadUserData WriteUserData ReadDeviceData WriteDeviceData NetworkServices
-EPOCSTACKSIZE		0x14000
-EPOCHEAPSIZE	0x020000 0x800000	// minimum and maximum heap sizes
+EPOCHEAPSIZE	0x500 0x400000	// minimum and maximum heap sizes
 VENDORID		VID_DEFAULT
 UID				0 0x101F99FE
 TARGET			nsmldshostserver2.exe
--- a/syncmlfw/ds/provisioningadapter/bld/NSmlDsProvisioningAdapter.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/provisioningadapter/bld/NSmlDsProvisioningAdapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -49,8 +49,8 @@
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	/epoc32/include/ecom
 
-LIBRARY     euser.lib ECom.lib commdb.lib charconv.lib cmmanager.lib
+LIBRARY     euser.lib ECom.lib commdb.lib charconv.lib apengine.lib
 LIBRARY     nsmldbcaps.lib bafl.lib efsrv.lib nsmldebug.lib syncmlclientapi.lib
-LIBRARY     ProvisioningEngine.lib centralrepository.lib
+LIBRARY     ProvisioningEngine.lib  centralrepository.lib
 
 SMPSAFE
--- a/syncmlfw/ds/provisioningadapter/inc/NSmlDsProvisioningAdapter.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/provisioningadapter/inc/NSmlDsProvisioningAdapter.h	Wed Sep 01 12:27:42 2010 +0100
@@ -54,6 +54,7 @@
 _LIT( KNSmlDsPovisioningDirAndResource,	"z:NSmlDsProvisioningAdapter.rsc" );
 
 _LIT( KNSmlDsDefaultPort, "80");
+_LIT( KNSmlDsHTTPSDefaultPort, "443");
 _LIT(KNSmlVersion12, "1.2");
 _LIT(KNSmlVersion112, "1.1.2");
 _LIT(KNSmlVersion11, "1.1");
--- a/syncmlfw/ds/provisioningadapter/src/NSmlDsProvisioningAdapter.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/provisioningadapter/src/NSmlDsProvisioningAdapter.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -26,11 +26,11 @@
 #include <barsread.h>
 #include <NSmlDSProvisioningAdapter.rsg>
 #include <bautils.h>
+#include <ApUtils.h>
 #include <barsc.h>
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
 #include <centralrepository.h> //For central Repository
-#include <nsmloperatordatacrkeys.h> // KCRUidOperatorDatasyncInternalKeys
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
+
 #include <nsmlconstants.h>
 #include <nsmldebug.h>
 #include <nsmldsconstants.h>
@@ -267,15 +267,12 @@
             {
             uid.Copy(iProfiles[aItem]->iVisitParameter->Data() );
 
-            RCmManagerExt  cmmanagerExt;
-		    cmmanagerExt.OpenL();
-		    CleanupClosePushL(cmmanagerExt);
-		    RCmConnectionMethodExt cm;
-		    cm = cmmanagerExt.ConnectionMethodL( uid());
-		    CleanupClosePushL( cm );
+            CCommsDatabase* commDb = CCommsDatabase::NewL();
+            CleanupStack::PushL(commDb);
+            CApUtils* aputils = CApUtils::NewLC( *commDb);
 
-            TRAP( ERROR, apId = cm.GetIntAttributeL(CMManager::ECmIapId) );
-            CleanupStack::PopAndDestroy(2); //cmmanager,cm
+            TRAP( ERROR, apId = aputils->IapIdFromWapIdL( uid() ) );
+            CleanupStack::PopAndDestroy(2); //commdb, aputils
             }
 
         //Get default access point in failure of getting AP
@@ -298,13 +295,15 @@
 		// see if address contains also port
 		TBool portFound = EFalse;
 		TInt startPos(0);
+		TBool isHTTPS = EFalse;
 		if(iProfiles[aItem]->iHostAddress->Find(KNSmlDsProvisioningHTTP)==0)
 		    {
 		    startPos=KNSmlDsProvisioningHTTP().Length();		    		    
 		    }
 		else if(iProfiles[aItem]->iHostAddress->Find(KNSmlDsProvisioningHTTPS)==0)
 		    {
-		    startPos=KNSmlDsProvisioningHTTPS().Length();		    		    
+		    startPos=KNSmlDsProvisioningHTTPS().Length();	
+		    isHTTPS = ETrue;
 		    }
 		TPtrC uriPtr = iProfiles[aItem]->iHostAddress->Mid(startPos);
 		
@@ -335,9 +334,18 @@
 				}
 			else
 				{
+				TBuf<16> portNum;
+				if (isHTTPS)
+				    {
+				    portNum.Copy(KNSmlDsHTTPSDefaultPort());
+				    }
+				else
+				    {
+				    portNum.Copy(KNSmlDsDefaultPort());
+				    }
 				// use default port
 				if( CombineURILC( iProfiles[aItem]->iHostAddress->Des(),
-							  KNSmlDsDefaultPort(), uri ) == KErrNone )
+				        portNum, uri ) == KErrNone )
 					{
 					if(iProfiles[aItem]->iHostAddress)
 					{
--- a/syncmlfw/ds/settings/bld/DEF/bwinscwdssettingsu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/bld/DEF/bwinscwdssettingsu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -53,14 +53,7 @@
 	?Visibility@CNSmlDSProfile@@QBE?AW4TNSmlDSFieldVisibility@@W4TNSmlDSProfileData@@@Z @ 52 NONAME ; enum TNSmlDSFieldVisibility CNSmlDSProfile::Visibility(enum TNSmlDSProfileData) const
 	?WriteStreamCommitL@CNSmlDSContentType@@QAEXXZ @ 53 NONAME ; void CNSmlDSContentType::WriteStreamCommitL(void)
 	?WriteStreamCommitL@CNSmlDSProfile@@QAEXXZ @ 54 NONAME ; void CNSmlDSProfile::WriteStreamCommitL(void)
-	?IsOperatorProfileL@CNSmlDSOperatorSettings@@QAEHABVTDesC16@@@Z @ 55 NONAME ; int CNSmlDSOperatorSettings::IsOperatorProfileL(class TDesC16 const &)
-	?CustomSwvValueLC@CNSmlDSOperatorSettings@@QAEPAVHBufC8@@XZ @ 56 NONAME ; class HBufC8 * CNSmlDSOperatorSettings::CustomSwvValueLC(void)
-	??1CNSmlDSOperatorSettings@@UAE@XZ @ 57 NONAME ; CNSmlDSOperatorSettings::~CNSmlDSOperatorSettings(void)
-	?CustomManValueLC@CNSmlDSOperatorSettings@@QAEPAVHBufC8@@XZ @ 58 NONAME ; class HBufC8 * CNSmlDSOperatorSettings::CustomManValueLC(void)
-	?PopulateStatusCodeListL@CNSmlDSOperatorSettings@@QAEXAAV?$RArray@H@@@Z @ 59 NONAME ; void CNSmlDSOperatorSettings::PopulateStatusCodeListL(class RArray<int> &)
-	?CustomModValueLC@CNSmlDSOperatorSettings@@QAEPAVHBufC8@@XZ @ 60 NONAME ; class HBufC8 * CNSmlDSOperatorSettings::CustomModValueLC(void)
-	?NewL@CNSmlDSOperatorSettings@@SAPAV1@XZ @ 61 NONAME ; class CNSmlDSOperatorSettings * CNSmlDSOperatorSettings::NewL(void)
-	?NewLC@CNSmlDSOperatorSettings@@SAPAV1@XZ @ 62 NONAME ; class CNSmlDSOperatorSettings * CNSmlDSOperatorSettings::NewLC(void)
-	?HttpErrorReportingEnabled@CNSmlDSOperatorSettings@@QAEHXZ @ 63 NONAME ; int CNSmlDSOperatorSettings::HttpErrorReportingEnabled(void)
-	?SyncErrorReportingEnabled@CNSmlDSOperatorSettings@@QAEHXZ @ 64 NONAME ; int CNSmlDSOperatorSettings::SyncErrorReportingEnabled(void)
+	?IsOperatorProfileL@CNSmlDSSettings@@QAEHABVTDesC16@@@Z @ 55 NONAME ; int CNSmlDSSettings::IsOperatorProfileL(class TDesC16 const &)
+	?OperatorProfileModValueLC@CNSmlDSSettings@@QAEPAVHBufC8@@XZ @ 56 NONAME ; class HBufC8 * CNSmlDSSettings::OperatorProfileModValueLC(void)
+	?OperatorProfileSWVValueLC@CNSmlDSSettings@@QAEPAVHBufC8@@XZ @ 57 NONAME ; class HBufC8 * CNSmlDSSettings::OperatorProfileSWVValueLC(void)
 
--- a/syncmlfw/ds/settings/bld/DEF/eabidssettingsu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/bld/DEF/eabidssettingsu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -83,21 +83,7 @@
 	_ZTV26CNSmlDSResourceContentType @ 82 NONAME ; #<VT>#
 	_ZTI26CNSmlProfileContentHandler @ 83 NONAME ; #<TI>#
 	_ZTV26CNSmlProfileContentHandler @ 84 NONAME ; #<VT>#
-	_ZN15CNSmlDSSettingsD0Ev @ 85 NONAME
-	_ZN15CNSmlDSSettingsD1Ev @ 86 NONAME
-	_ZN15CNSmlDSSettingsD2Ev @ 87 NONAME
-	_ZN23CNSmlDSOperatorSettings16CustomManValueLCEv @ 88 NONAME
-	_ZN23CNSmlDSOperatorSettings16CustomModValueLCEv @ 89 NONAME
-	_ZN23CNSmlDSOperatorSettings16CustomSwvValueLCEv @ 90 NONAME
-	_ZN23CNSmlDSOperatorSettings18IsOperatorProfileLERK7TDesC16 @ 91 NONAME
-	_ZN23CNSmlDSOperatorSettings23PopulateStatusCodeListLER6RArrayIiE @ 92 NONAME
-	_ZN23CNSmlDSOperatorSettings4NewLEv @ 93 NONAME
-	_ZN23CNSmlDSOperatorSettings5NewLCEv @ 94 NONAME
-	_ZN23CNSmlDSOperatorSettingsD0Ev @ 95 NONAME
-	_ZN23CNSmlDSOperatorSettingsD1Ev @ 96 NONAME
-	_ZN23CNSmlDSOperatorSettingsD2Ev @ 97 NONAME
-	_ZTI23CNSmlDSOperatorSettings @ 98 NONAME
-	_ZTV23CNSmlDSOperatorSettings @ 99 NONAME
-	_ZN23CNSmlDSOperatorSettings25HttpErrorReportingEnabledEv @ 100 NONAME
-	_ZN23CNSmlDSOperatorSettings25SyncErrorReportingEnabledEv @ 101 NONAME
+	_ZN15CNSmlDSSettings18IsOperatorProfileLERK7TDesC16 @ 85 NONAME
+	_ZN15CNSmlDSSettings25OperatorProfileModValueLCEv @ 86 NONAME
+	_ZN15CNSmlDSSettings25OperatorProfileSWVValueLCEv @ 87 NONAME
 
--- a/syncmlfw/ds/settings/bld/nsmldssettings.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/bld/nsmldssettings.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -44,18 +44,16 @@
 SOURCE          NSmlDSCrypt.cpp
 SOURCE		nsmlroam.cpp
 SOURCE          NSmlRoamTable.cpp
-SOURCE		NSmlProfileContentHandler.cpp
-SOURCE		nsmldsoperatorsettings.cpp
+SOURCE			NSmlProfileContentHandler.cpp
 
 USERINCLUDE     ../inc 
 USERINCLUDE	../../inc 
 USERINCLUDE	../../../common/inc 
-
+USERINCLUDE	../../../ds/syncagent/inc
 
 SYSTEMINCLUDE	/epoc32/include/libc
 SYSTEMINCLUDE	/epoc32/include/ecom 
 MW_LAYER_SYSTEMINCLUDE
-OS_LAYER_SYSTEMINCLUDE
 
 LIBRARY         bafl.lib ecom.lib efsrv.lib edbms.lib estor.lib euser.lib sysutil.lib
 
--- a/syncmlfw/ds/settings/inc/NSmlProfileContentHandler.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/inc/NSmlProfileContentHandler.h	Wed Sep 01 12:27:42 2010 +0100
@@ -24,8 +24,8 @@
 #include <e32std.h>
 #include <f32file.h>
 #include <eikenv.h> //JIM is this needed ??
-#include "xml/MXMLAttributes.h"
-#include "xml/MXMLContentHandler.h"
+#include "mxmlattributes.h"
+#include "mxmlcontenthandler.h"
 
 #include "nsmldssettings.h"
 //#include "nsmldsresourceprofiledefs.h"
--- a/syncmlfw/ds/settings/inc/nsmldsoperatorsettings.h	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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:  DS Operator Settings
-*
-*/
-
-#ifndef __NSMLDSOPERATORSETTINGS_H
-#define __NSMLDSOPERATORSETTINGS_H
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class CRepository;
-
-// ----------------------------------------------------------------------------
-//  CNSmlDSOperatorSettings provides an interface to 
-//  DS Operator Settings repository
-//
-//*  @lib nsmldssettings.lib
-// ----------------------------------------------------------------------------
-class CNSmlDSOperatorSettings : public CBase
-    {
-    public:
-        /**
-        * Two-phased constructor.
-        */
-        IMPORT_C static CNSmlDSOperatorSettings* NewL();
-
-        /**
-        * Two-phased constructor.
-        */
-        IMPORT_C static CNSmlDSOperatorSettings* NewLC();
-
-        /**
-        * Destructor.
-        */
-        IMPORT_C virtual ~CNSmlDSOperatorSettings();
-
-        /**
-        * Is current profile Operator specific profile.
-        * @param aServerId Server Id to compare in Repository value.
-        * @return Boolean ETrue if profile is Operator specific profile.
-        */
-        IMPORT_C TBool IsOperatorProfileL( const TDesC& aServerId  );
-
-        /**
-        * SW version of Operator specific profile.
-        * @return Software version.
-        */
-        IMPORT_C HBufC8* CustomSwvValueLC();
-
-        /**
-        * Model value of Operator specific profile.
-        * @return Mod value.
-        */
-        IMPORT_C HBufC8* CustomModValueLC();
-
-        /**
-        * Manufacturer value of Operator specific profile.
-        * @return Manufacturer value.
-        */
-        IMPORT_C HBufC8* CustomManValueLC();
-
-        /**
-        * Populates server status code list
-        * @param RArray to contains status codes
-        */
-        IMPORT_C void PopulateStatusCodeListL( RArray< TInt >& aArray );
-
-        /**
-        * SyncML Error Reporting
-        * @return Boolean ETrue if SyncML Error Reporting is enabled.
-        */
-        IMPORT_C TBool SyncErrorReportingEnabled(); 
-                
-        /**
-        * HTTP Error Reporting
-        * @return Boolean ETrue if HTTP Error Reporting is enabled.
-        */
-        IMPORT_C TBool HttpErrorReportingEnabled(); 
-                
-    private:
-
-        /**
-         * Reads list of status codes from cenrep
-        * @param RArray to contains status codes
-        */
-        void InitializeServerStatusCodeListL( RArray< TInt >& aArray );
-
-        /**
-        * C++ constructor.
-        */
-        CNSmlDSOperatorSettings();
-        
-        /**
-        * 2nd phase constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Get Repository key value of Operator specific profile.
-        * @param aKey Repository key which value method returns.
-        * @return Repository key value.
-        */
-        HBufC8* GetValueLC( const TUint32 aKey );
-
-    private: // data
-        CRepository* iRepository;
-
-    };
-
-#endif // __NSMLDSOPERATORSETTINGS_H
-
-// End of File  
--- a/syncmlfw/ds/settings/inc/nsmldssettings.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/inc/nsmldssettings.h	Wed Sep 01 12:27:42 2010 +0100
@@ -369,7 +369,26 @@
 		* @param -
 		* @return -
 		*/
-        IMPORT_C void UpdateHiddenProfilesL();
+		IMPORT_C void UpdateHiddenProfilesL();
+		
+		/**
+		 * Is current profile Operator specific profile.
+		 * @param aServerId Server Id to compare in Repository value.
+		 * @return Boolean ETrue if profile is Operator specific profile.
+		 */
+		IMPORT_C TBool IsOperatorProfileL( const TDesC& aServerId  );
+        
+		/**
+		 * SW version of Operator specific profile.
+		 * @return Software version.
+		 */
+		IMPORT_C HBufC8* OperatorProfileSWVValueLC();
+
+		/**
+		 * Mod value of Operator specific profile.
+		 * @return Mod value.
+		 */
+		IMPORT_C HBufC8* OperatorProfileModValueLC();
         
         /**
 		* Parse xml 
--- a/syncmlfw/ds/settings/src/NSmlDSSettings.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/src/NSmlDSSettings.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -26,13 +26,14 @@
 #include "bautils.h"
 #include "nsmlroam.h"
 //XML profiles
-#include "xml/RXMLReader.h"
+#include "rxmlreader.h"
 #include "NSmlProfileContentHandler.h"
+#include "nsmldsagconstants.h"
 #include <centralrepository.h> //CRepository
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
 
-//CONSTANTS
 _LIT(Kinfile,"z:\\Private\\101F99FB\\VariantData.xml");
-
+const TInt KUrlLength = 256;
 
 //=============================================
 //
@@ -120,7 +121,7 @@
 //		Destructor.
 //=============================================
 
-EXPORT_C CNSmlDSSettings::~CNSmlDSSettings()
+CNSmlDSSettings::~CNSmlDSSettings()
 	{
 	if(iResourceProfileArray)
 		{
@@ -881,5 +882,104 @@
 	return iView.ColUint( iColSet->ColNo( aFieldName ) );
 	}
 
+//-----------------------------------------------------------------------------
+// CNSmlDSSettings::IsOperatorProfileL
+// Is current profile Operator specific profile.
+//-----------------------------------------------------------------------------
+//
+EXPORT_C TBool CNSmlDSSettings::IsOperatorProfileL( const TDesC& aServerId )
+    {
+    if( aServerId.Length() != 0 )
+        {
+        TBuf8<KUrlLength> value;
+        TBuf<KUrlLength> valueUtf16;
+        
+        CRepository* rep = NULL;
+        
+        // don't leave in case of missing or corrupted cenrep.
+        TRAPD( err, rep = CRepository::NewL( 
+                KCRUidOperatorDatasyncInternalKeys ) );
 
+        if ( err == KErrNone )
+        	{
+            rep->Get( KNsmlOpDsOperatorSyncServerId, value );
+            delete rep;
+            valueUtf16.Copy( value );
+            if ( aServerId.Compare( valueUtf16 ) == 0 )
+                {
+                return ETrue;
+                }
+        	}
+        }
+    return EFalse;
+    }
+
+//-----------------------------------------------------------------------------
+// CNSmlDSSettings::OperatorProfileSWVValueLC
+// SW version of Operator specific profile.
+//-----------------------------------------------------------------------------
+//
+EXPORT_C HBufC8* CNSmlDSSettings::OperatorProfileSWVValueLC()
+    {
+    const TInt KSwvLength = 30;
+    HBufC8* buf = HBufC8::NewLC( KSwvLength );
+    TPtr8 ptr = buf->Des();
+    CRepository* rep = NULL;
+    TRAPD( err, rep = CRepository::NewL( 
+            KCRUidOperatorDatasyncInternalKeys ) );
+    // in case of missing or corrupted cenrep don't leave, just
+    // return 0-length desc
+    if( err == KErrNone )
+        {
+        CleanupStack::PushL( rep );
+        TInt actualLength;
+        err = rep->Get( KNsmlOpDsDevInfoSwVValue, ptr, actualLength );
+        if( err == KErrOverflow )
+            {
+            CleanupStack::Pop( buf );
+            buf = buf->ReAllocL( actualLength );
+            CleanupStack::PushL( buf );
+            ptr.Set( buf->Des() );
+            // ignore return error
+            rep->Get( KNsmlOpDsDevInfoSwVValue, ptr );
+            }
+        CleanupStack::PopAndDestroy( rep );
+        }
+    return buf;
+    }
+
+//-----------------------------------------------------------------------------
+// CNSmlDSSettings:::OperatorProfileModValueLC
+// Mod value of Operator specific profile.
+//-----------------------------------------------------------------------------
+//
+EXPORT_C HBufC8* CNSmlDSSettings::OperatorProfileModValueLC()
+    {
+    const TInt KModelLength = 20;
+    HBufC8* buf = HBufC8::NewLC( KModelLength );
+    TPtr8 ptr = buf->Des();
+    CRepository* rep = NULL;
+    TRAPD( err, rep = CRepository::NewL( 
+            KCRUidOperatorDatasyncInternalKeys ) );
+    // in case of missing or corrupted cenrep don't leave, just
+    // return 0-length desc
+    if( err == KErrNone )
+        {
+        CleanupStack::PushL( rep );
+        TInt actualLength;
+        err = rep->Get( KNsmlOpDsDevInfoModValue, ptr, actualLength );
+        if( err == KErrOverflow )
+            {
+            CleanupStack::Pop( buf );
+            buf = buf->ReAllocL( actualLength );
+            CleanupStack::PushL( buf );
+            ptr.Set( buf->Des() );
+            // ignore return error
+            rep->Get( KNsmlOpDsDevInfoModValue, ptr );
+            }
+        CleanupStack::PopAndDestroy( rep );
+        }
+    return buf;
+    }
+    
 //  End of File
--- a/syncmlfw/ds/settings/src/nsmldsoperatorsettings.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-/*
-* 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:  DS Operator Settings
-*
-*/
-
-// INTERNAL INCLUDES
-#include "nsmldsoperatorsettings.h"
-
-// EXTERNAL INCLUDES
-#include <centralrepository.h>      //CRepository
-#include <nsmloperatordatacrkeys.h> // KCRUidOperatorDatasyncInternalKeys
-
-// CONSTANTS
-const TInt KMaxLength = 256;
-const TInt KBufferLength = 256;
-const TInt KValueLength = 50;
-_LIT( KSpace, " " );
-
-//-----------------------------------------------------------------------------
-//      CNSmlDSOperatorSettings::NewL
-//-----------------------------------------------------------------------------
-EXPORT_C CNSmlDSOperatorSettings* CNSmlDSOperatorSettings::NewL()
-    {
-    CNSmlDSOperatorSettings* self = CNSmlDSOperatorSettings::NewLC();
-    CleanupStack::Pop();
-    return self;
-    }
-
-//-----------------------------------------------------------------------------
-//      CNSmlDSOperatorSettings::NewLC
-//-----------------------------------------------------------------------------
-EXPORT_C CNSmlDSOperatorSettings* CNSmlDSOperatorSettings::NewLC()
-    {
-    CNSmlDSOperatorSettings* self = new( ELeave ) CNSmlDSOperatorSettings;
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-//-----------------------------------------------------------------------------
-//      CNSmlDSOperatorSettings::ConstructL
-//-----------------------------------------------------------------------------
-void CNSmlDSOperatorSettings::ConstructL()
-    {
-    iRepository = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys );
-    }
-
-//-----------------------------------------------------------------------------
-//      CNSmlDSOperatorSettings::~CNSmlDSOperatorSettings
-//-----------------------------------------------------------------------------
-EXPORT_C CNSmlDSOperatorSettings::~CNSmlDSOperatorSettings()
-    {
-    delete iRepository;
-    }
-
-//-----------------------------------------------------------------------------
-//      CNSmlDSOperatorSettings::CNSmlDSOperatorSettings
-//-----------------------------------------------------------------------------
-CNSmlDSOperatorSettings::CNSmlDSOperatorSettings()
-    {
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings::IsOperatorProfileL
-// Is current profile Operator specific profile.
-//-----------------------------------------------------------------------------
-EXPORT_C TBool CNSmlDSOperatorSettings::IsOperatorProfileL( 
-    const TDesC& aServerId )
-    {
-    if( aServerId.Length() != 0 )
-        {
-        TBuf8< KMaxLength > value;
-        TBuf< KMaxLength > valueUtf16;
-        
-        iRepository->Get( KNsmlOpDsOperatorSyncServerId, value );
-        valueUtf16.Copy( value );
-        if ( aServerId.Compare( valueUtf16 ) == 0 )
-            {
-            return ETrue;
-            }
-        }
-    return EFalse;
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings::CustomSwvValueLC
-// SW version of Operator specific profile.
-//-----------------------------------------------------------------------------
-EXPORT_C HBufC8* CNSmlDSOperatorSettings::CustomSwvValueLC()
-    {
-    return GetValueLC( KNsmlOpDsDevInfoSwVValue );
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings:::CustomModValueLC
-// Mod value of Operator specific profile.
-//-----------------------------------------------------------------------------
-EXPORT_C HBufC8* CNSmlDSOperatorSettings::CustomModValueLC()
-    {
-    return GetValueLC( KNsmlOpDsDevInfoModValue );
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings:::CustomManValueLC
-// Man value of Operator specific profile.
-//-----------------------------------------------------------------------------
-EXPORT_C HBufC8* CNSmlDSOperatorSettings::CustomManValueLC()
-    {
-    return GetValueLC( KNsmlOpDsDevInfoManValue );
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings:::PopulateStatusCodeListL
-// Populates server status code list
-//----------------------------------------------------------------------------
-EXPORT_C void CNSmlDSOperatorSettings::PopulateStatusCodeListL( 
-    RArray< TInt >& aArray )
-    {
-    InitializeServerStatusCodeListL( aArray );
-    }
-
-// ----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings::InitializeServerStatusCodeListL
-// This function reads list of configured server status codes from cenrep
-// ----------------------------------------------------------------------------
-void CNSmlDSOperatorSettings::InitializeServerStatusCodeListL( 
-    RArray< TInt >& aArray )
-    {    
-    TBuf< KBufferLength > tempStr;
-    iRepository->Get( KNsmlOpDsSyncMLStatusCodeList, tempStr );
-    TInt commaPos = KErrNotFound;
-
-    while ( ( commaPos = tempStr.Locate( ',' ) ) > KErrNotFound )
-        {
-        tempStr.Replace( commaPos, 1, KSpace );
-        }
-
-    TLex lex( tempStr );
-    while( !lex.Eos() )
-        {
-        TPtrC token = lex.NextToken();
-        TLex temp( token );
-        TInt val;
-        temp.Val( val );      
-        aArray.Append( val );
-        }
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings:::SyncErrorReportingEnabled
-// Returns ETrue if SyncML Error Reporting is enabled
-//----------------------------------------------------------------------------
-EXPORT_C TBool CNSmlDSOperatorSettings::SyncErrorReportingEnabled() 
-    {
-    TBool errorReportingEnabled = EFalse;
-    iRepository->Get( KNsmlOpDsSyncMLErrorReporting, errorReportingEnabled );
-    return errorReportingEnabled;
-    }
-
-//-----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings:::HttpErrorReportingEnabled
-// Returns ETrue if HTTP Error Reporting is enabled
-//----------------------------------------------------------------------------
-EXPORT_C TBool CNSmlDSOperatorSettings::HttpErrorReportingEnabled() 
-    {
-    TBool errorReportingEnabled = EFalse;
-    iRepository->Get( KNsmlOpDsHttpErrorReporting, errorReportingEnabled );
-    return errorReportingEnabled;
-    }
-
-// ----------------------------------------------------------------------------
-// CNSmlDSOperatorSettings::GetValueLC
-// This function Get Repository key value of Operator specific profile.
-// ----------------------------------------------------------------------------
-HBufC8* CNSmlDSOperatorSettings::GetValueLC( const TUint32 aKey )
-    {
-    HBufC8* buf = HBufC8::NewLC( KValueLength );
-    TPtr8 ptr = buf->Des();
-
-    TInt actualLength;
-    TInt err = iRepository->Get( aKey, ptr, actualLength );
-    if( err == KErrOverflow )
-        {
-        CleanupStack::Pop( buf );
-        buf = buf->ReAllocL( actualLength );
-        CleanupStack::PushL( buf );
-        ptr.Set( buf->Des() );
-        // ignore return error
-        iRepository->Get( aKey, ptr );
-        }
-    return buf;
-    }
-//  End of File
--- a/syncmlfw/ds/settings/src/pcsuite/NSmlDSProfileRes.rss	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/settings/src/pcsuite/NSmlDSProfileRes.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -117,60 +117,6 @@
 			},
 		PROFILE
 			{
-			profiledisplayname="Intellisync";
-			//username="";
-			//password="";
-		//	serverurl="http://82.77.123.71:8080/services/syncml";
-			serverurl="https://sync.ovi.com:443/services/syncml";
-			serverid="Ovi.com";
-			profilehidden=0;
-			transportid=0x101F99F0;
-			deleteallowed=1;
-			visibility="nrhrnnrrhnrnnrnrnn";
-			protocolversion=ESmlVersion1_2;
-			serveralertedaction = ESmlEnableSync;		
-			//httpauthused = 1;
-			//httpauthusername = "UName";
-			//httpauthpassword = "PWord";		
-			contenttypes=
-				{
-				CONTENTTYPE
-					{
-					adapter_implementation_uid = 0x101F6DDD; // Contacts
-					clientdatasource = "symbian";
-					serverdatasource = "./Contact/Unfiled";
-					synctype = ESmlTwoWay;
-					filtervisibility = "h";
-					synctypevisibility = "r";
-					creatorid = 0x101FF968;
-					
-					},
-				CONTENTTYPE
-					{
-					adapter_implementation_uid = 0x101F6DDE; // Calendar
-					clientdatasource = "C:Calendar";
-					serverdatasource = "./EventTask/Tasks";
-					synctype = ESmlTwoWay;
-					filtervisibility = "h";
-					synctypevisibility = "r";
-					creatorid = 0x101FF968;
-					
-					},
-				CONTENTTYPE
-					{
-					adapter_implementation_uid = 0x101F8612; // Notes
-					clientdatasource = "C:Note";
-					serverdatasource = "./Note/Unfiled";
-					synctype = ESmlTwoWay;
-					filtervisibility = "h";
-					synctypevisibility = "r";
-					creatorid = 0x101FF968;
-					
-					}
-				};
-			},
-		PROFILE
-			{
 			profiledisplayname="PC Suite Data Sync";
 			//username="xxx";
 			//password="xxx";
--- a/syncmlfw/ds/syncagent/bld/nsmldsagent.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/bld/nsmldsagent.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -82,13 +82,12 @@
 LIBRARY         nsmlfilter.lib
 LIBRARY			nsmldshostclient.lib
 LIBRARY			nsmlhistorylog.lib
-LIBRARY			ecom.lib
+LIBRARY			featmgr.lib
 //RD_AUTO_RESTART
 LIBRARY 		ConnMon.lib
 LIBRARY        	connmonext.lib
 LIBRARY         NsmlProfileUtil.lib
 LIBRARY         syncmlclientapi.lib
 LIBRARY			centralrepository.lib
-LIBRARY         cmmanager.lib
 //RD_AUTO_RESTART
 
--- a/syncmlfw/ds/syncagent/inc/NSmlDSAgent.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/inc/NSmlDSAgent.h	Wed Sep 01 12:27:42 2010 +0100
@@ -37,9 +37,7 @@
 //RD_AUTO_RESTART
 class CNsmlDSNetmon;
 class CNSmlDSProfile;
-class CNSmlDSSettings;
 class CRepository;
-class CNSmlDSOperatorSettings;
 // CLASS DECLARATION
 
 /**
@@ -503,7 +501,8 @@
 	TNSmlSyncSuspendedState CurrentStateInServerAlertNext();
 	
 	TBool SyncFailure();
-	void StoreServerStatusCode( TInt aServerStatusCode ) const;
+	void StoreServerStatusCode(TInt aServerStatusCode) const;
+	void InitializeServerStatusCodeList();
 	public:
 	/**
 	* Mapping of the Alert code is done
@@ -578,9 +577,10 @@
 	//RD_SUSPEND_RESUME
 	TBool iUpdateLastAnchor;
 	//For storing Server Status Code
-	TBool iErrorReportingEnabled;
 	CRepository* iRepositorySSC;
-	RArray< TInt > iServerStatusCodeArray;
+	CRepository* iErrorReportingRep;
+	RArray<TInt>* iServerStatusCodeArray;
+	TBool iIsExtendedServerErrorCodesSupported;
 	};
 	
 typedef CNSmlDSAgent* (*TNSmlCreateDSAgentFunc) ( MSyncMLProgressObserver* aObserver );
--- a/syncmlfw/ds/syncagent/inc/NSmlDSCmds.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/inc/NSmlDSCmds.h	Wed Sep 01 12:27:42 2010 +0100
@@ -35,7 +35,6 @@
 class CNSmlDbCaps;
 class CNSmlDbMetaHandler;
 class CNSmlDSBatchBuffer;
-class CNSmlDSOperatorSettings;
 
 inline void DeleteRPointerArray( TAny* aPtr )
 	{
@@ -217,14 +216,14 @@
 		* @param aFinal ETrue if this is the last message from the client.
 		*/
 		void DoEndMessageL( TBool aFinal );
-		
-        /**
-         * Checks if received Alert Code is a sync type and tries to convert
-         * it to Sync Type (TSmlSyncType). If conversion is succesful, the
-         * value is stored into Cenrep file (KCRUidOperatorDatasyncErrorKeys).
-         * @param aAlertCode received alert code.
-         */
-        void StoreSyncType( const TDes8& aAlertCode );
+
+		/**
+	    * Checks if received Alert Code is a sync type and tries to convert
+	    * it to Sync Type (TSmlSyncType). If conversion is succesful, the
+	    * value is stored into Cenrep file (KCRUidOperatorDatasyncInternalKeys).
+	    * @param aAlertCode received alert code.
+	    */
+	    void StoreSyncType( const TDes8& aAlertCode );
 
 		        
     private: // constructors and operators
@@ -325,39 +324,15 @@
 		* @result KErrNone if the conversion succeeded.
 		*/
 		TInt ConvertUid( const TDesC8& aLiteralUid, TSmlDbItemUid& aNumericUid );
-
-		/**
-		 * Adds operator specific extensions (XNam, XVal) to device info.
-		 * The XNam and XVal to be included in the device info are read from
-		 * an ECom plugin, which implements Device Info Extension Data Container 
-		 * plugin interface (UID: 0x2002DC7C).
-		 * 
-		 * @param aDevInf Device info object, to which the operator extensions
-		 *  are added.
+		
+		/*
+		 * Adds operator specific extension devInf fields XNam and XVal
+		 * Currently only one XNam and one corresponding XVal value are supported
+		 * These two values are read from central repository 0x2002682E (defined in nsmloperatordefines.h)
+		 * from keys KNsmlOperatorDevInfExtXNam (0x04) and KNsmlOperatorDevInfExtXVal (0x05)
 		 */
 		void InsertOperatorExtensionDevInfFieldsL( SmlDevInfDevInfPtr_t& aDevInf );
 
-		/**
-		 * Appends the given dev info extension item to the extension list.
-		 * 
-		 * @param aExtList Extension list, to which the new item is to be added.
-		 *  On return, the list includes the given new item.
-		 * @param aExtItem Extension item to be added to the extension list.
-		 */
-		void AppendToExtensionListL( SmlDevInfExtListPtr_t aExtList, 
-			SmlDevInfExtPtr_t aExtItem );
-
-		/**
-		 * Appends a new XVal (i.e. extension value) item with the given XVal 
-		 * string to the XVal list.
-		 * 
-		 * @param aXValList XVal list, to which the the new XVal item is to be added.
-		 *  On return, the list includes the given new item.
-		 * @param aXVal A string, which is added to the XVal list as a new item.
-		 */
-		void AppendToXValListL( SmlPcdataListPtr_t aXValList,
-			const TDesC8& aXVal );
-
 	private: // data	
 		// batched items buffer
 		CNSmlDSBatchBuffer* iBatchBuffer;
--- a/syncmlfw/ds/syncagent/src/nsmldsagent.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/src/nsmldsagent.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -22,9 +22,6 @@
 #include <DataSyncInternalPSKeys.h>
 #include <nsmlconstants.h>
 #include <nsmldebug.h>
-#include <cmpluginwlandef.h>
-#include <cmmanager.h>
-#include <cmconnectionmethod.h>
 
 // common includes with DM
 #include "nsmlagenttestdefines.h"
@@ -43,15 +40,16 @@
 #include "nsmldscontent.h"
 #include "nsmldserror.h"
 #include "nsmldssettings.h"
-#include "nsmldsoperatorsettings.h"
 #include "nsmlagentlog.h"
 #include "nsmlroam.h"
-#include "nsmloperatorerrorcrkeys.h"
+#include "NsmlOperatorErrorCRKeys.h"
 //RD_AUTO_RESTART
 #include <e32base.h>
 #include <centralrepository.h> 
 #include "SyncMLErr.h"
 #include "nsmldsconstants.h"
+#include <featmgr.h>
+#include "nsmloperatordefines.h"
 //RD_AUTO_RESTART
 _LIT( KNetMon,"\\netmon.exe" );
 _LIT( KAutoRestart,"netmon" );
@@ -64,9 +62,9 @@
 #endif
 
 // CONSTANTS
-const TInt KGranularity = 12;
-const TInt KErrorCodeRangeFirst = 400;
-const TInt KErrorCodeRangeLast = 516;
+const TInt KNSmlDsHTTPErrCodeBase = 1400;
+const TInt KNSmlDsErrCodeFirst = 400;
+const TInt KNSmlDsErrCodeLast = 516;
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -75,8 +73,7 @@
 // C++ constructor.
 // -----------------------------------------------------------------------------
 //
-CNSmlDSAgent::CNSmlDSAgent(): 
-        iServerStatusCodeArray ( RArray< TInt >( KGranularity ) )
+CNSmlDSAgent::CNSmlDSAgent()
     {
 	}
 
@@ -120,15 +117,6 @@
 	}
 	//RD_AUTO_RESTART
 	
-    iRepositorySSC = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys );
-    CNSmlDSOperatorSettings* settings = CNSmlDSOperatorSettings::NewLC();
-    iErrorReportingEnabled = settings->SyncErrorReportingEnabled();
-    if ( iErrorReportingEnabled )
-        {
-        settings->PopulateStatusCodeListL( iServerStatusCodeArray );
-        }
-    CleanupStack::PopAndDestroy( settings );
-	
 	// security policies for P&S reading and writing
 	_LIT_SECURITY_POLICY_S0( KNSmlPSWritePolicy, KNSmlSOSServerPolicyUID.iUid ); // SID check (sosserver) when writing
 	_LIT_SECURITY_POLICY_PASS( KNSmlPSReadPolicy ); // no checks done when reading
@@ -139,8 +127,16 @@
                        RProperty::EInt, // type
                        KNSmlPSReadPolicy, // read policy
                        KNSmlPSWritePolicy ); // write policy
-	DBG_FILE(_S8("CNSmlDSAgent::ConstructL ends"));                        
-	
+
+	//For Syncml Status Extended Error Codes
+	FeatureManager::InitializeLibL();
+	iIsExtendedServerErrorCodesSupported = EFalse;
+	if(FeatureManager::FeatureSupported(KFeatureIdFfSyncmlStatusExtendedErrorCodes))
+	  {
+      InitializeServerStatusCodeList();
+	  }
+	TRAP_IGNORE( iErrorReportingRep = CRepository::NewL( KCRUidOperatorDatasyncErrorKeys ) );
+	DBG_FILE(_S8("CNSmlDSAgent::ConstructL ends"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -181,9 +177,20 @@
 		iDSNetmon = NULL;
 	}
     //RD_AUTO_RESTART
+	if(iServerStatusCodeArray)
+	    {
+	    delete iServerStatusCodeArray;
+	    }
+	if(iRepositorySSC)
+	    {
+	    delete iRepositorySSC;
+	    }
 	
-    iServerStatusCodeArray.Close();
-    delete iRepositorySSC;
+	if(iErrorReportingRep)
+	    {
+	    delete iErrorReportingRep;
+	    }
+	FeatureManager::UnInitializeLib();
 	}
 
 // -----------------------------------------------------------------------------
@@ -992,7 +999,7 @@
 				if ( !iDSContent->ClientItemCountAsked() )
 					{
 					iDSContent->SetClientItemCountAsked();
-					iDSObserver->OnSyncMLSyncProgress( MSyncMLProgressObserver::ESmlSendingModificationsToServer, iDSContent->ClientItemCount(), iDSContent->TaskId() );
+					iDSObserver->OnSyncMLSyncProgress( MSyncMLProgressObserver::ESmlSendingModificationsToServer, iDSContent->ClientItemCount(), 0 );
 					}
 				break;
 			case CNSmlCmdsBase::EReturnBufferFull:
@@ -1564,7 +1571,10 @@
 			iSyncMLCmds = CNSmlDSCmds::NewL( this, sessionIdString, KNSmlDSAgentVerProto12, KNSmlSyncMLPublicId12, *iSyncMLUserName, iSyncServer, *iDSContent, *iDSObserver, versionCheck );		
 			}
 			
-	    TInt value(0);
+	    TInt value(0); 
+		if ( !iSyncMLCmds ) 
+		   User::Leave( KErrGeneral );
+		
 	    TRAPD (err , ReadRepositoryL(KNSmlMaxMsgSizeKey, value));	    
 	    if ( ( iMediumType == KUidNSmlMediumTypeInternet ) && ( err == KErrNone ) )
 	        {
@@ -1650,7 +1660,22 @@
 	iSyncHTTPAuthPassword = profile->StrValue( EDSProfileHttpAuthPassword ).AllocL();	
 	iSyncHTTPAuthUsed = profile->IntValue( EDSProfileHttpAuthUsed );						
 	iProtocolVer = static_cast<TSmlProtocolVersion>( profile->IntValue( EDSProfileProtocolVersion ) );
-	
+
+	//For extended error code logging
+    if(iRepositorySSC)
+        {
+        TBuf<KBufferLength> tempStr;
+        //Get the Operator server ID configured in cenrep
+        TInt error = iRepositorySSC->Get(KNsmlOperatorProfileServerId, tempStr);
+        if(error == KErrNone)
+            {
+            if(tempStr.Compare(*iDSServerId)== KErrNone)
+                {
+                //Extended Server Error logging supported, set the the flag
+                iIsExtendedServerErrorCodesSupported = ETrue;
+                }
+            }
+        }
 	// set sync started to P&S (if fails -> sync not interrupted)
 	if ( iProtocolVer == ESmlVersion1_1_2 )
 	    {
@@ -1665,12 +1690,12 @@
                         EDataSyncRunning12 );	    
         }
     
-    if ( iRepositorySSC )
-        {
-        iRepositorySSC->Set( KNsmlOpDsSyncErrorCode, KErrNone );
-        iRepositorySSC->Set( KNsmlOpDsSyncProfId, profile->IntValue( EDSProfileId ) );
-        iRepositorySSC->Set( KNsmlOpDsSyncInitiation, iSyncInitiation );
-        }
+	if ( iErrorReportingRep )
+	    {
+        iErrorReportingRep->Set( KNsmlOpDsErrorCode, KErrNone );
+        iErrorReportingRep->Set( KNsmlOpDsSyncProfUid, profile->IntValue( EDSProfileId ) );
+        iErrorReportingRep->Set( KNsmlOpDsSyncInitiation, iSyncInitiation );
+	    }
 
 	TBool ifInternet = ETrue ; // CR: 403-1188
 	if ( iMediumType == KUidNSmlMediumTypeInternet )
@@ -1917,39 +1942,23 @@
 			profileUtil->AccessPointIdL(LastUsedIAPId);
 			if(LastUsedIAPId > 0)
 			{
-                //Check Whether the IAPID still exists
-                RCmManager  cmmanager;
-                cmmanager.OpenL();
-                CleanupClosePushL(cmmanager);
-                RCmConnectionMethod cm;
-                TRAPD(err, cm = cmmanager.ConnectionMethodL( LastUsedIAPId ));
-                CleanupClosePushL( cm );
-                TUint32 bearer = 0;
-                if( err == KErrNone )
-                {
-                    bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );        
-                    DBG_FILE_CODE( bearer ,_S8("CNSmlDSAgent::ReadSettingsL, BearerType"));
-                    if ( bearer == KUidWlanBearerType )
-                    {
-                        DBG_FILE(_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid WLAN"));
-                        iPacketDataUnAvailable = ETrue;
-                        StopDSSession();
-                    }
-                    else
-                    {
-                        iIAPId = LastUsedIAPId;      
-                        DBG_FILE_CODE(iIAPId , _S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID Replaced from the CenRep:"));
-                    }
-                }
-                else
-                {
-                    DBG_FILE_CODE( err ,_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid"));
-                    iPacketDataUnAvailable = ETrue;
-                    StopDSSession();
-                }              
-                CleanupStack::PopAndDestroy( 2 ); //cmmanagerext,cm			
+				//Check Whether the IAPID still exists
+		    	TApBearerType bearertype = CheckAPBearerTypeL(LastUsedIAPId);
+		    	if(bearertype != TApBearerType(-1))
+		    	{
+		    		iIAPId = LastUsedIAPId;    	
+		    		DBG_FILE_CODE(iIAPId , _S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID Replaced from the CenRep:"));                
+		    	}
+		    	else
+		    	{
+		    		//Stop the DS Sync Session
+		    		DBG_FILE(_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid so stopping the session"));
+		    		iPacketDataUnAvailable = ETrue;
+		    		StopDSSession();
+		    	}	
 			}
-		}		
+		}
+		
 		CleanupStack::PopAndDestroy(profileUtil);
 	}
 }
@@ -2895,7 +2904,10 @@
 	
 		TTime time;
 		time.UniversalTime();
+		if (iError)  
 		iSyncLog->SetResult( time, iError->SyncLogErrorCode() );
+		else
+		iSyncLog->SetResult( time, KErrGeneral );    
 	
 		CNSmlDSSettings* settings = CNSmlDSSettings::NewLC();
 		CNSmlDSProfile* profile = settings->ProfileL( iProfileID );
@@ -2929,9 +2941,9 @@
     // Set sync stopped to P&S
     RProperty::Set( KPSUidDataSynchronizationInternalKeys, KDataSyncStatus, EDataSyncNotRunning );
   
-    if ( iRepositorySSC )
+    if ( iErrorReportingRep )
         {
-        iRepositorySSC->Set( KNsmlOpDsSyncInitiation, EDataSyncNotRunning );
+        iErrorReportingRep->Set( KNsmlOpDsSyncInitiation, EDataSyncNotRunning );
         }
 	
 	ResetDSSessionInfoL();
@@ -2987,13 +2999,10 @@
 	TDesC8& cmd = iSyncMLCmds->ResponseController()->Cmd( aEntryID );
 	TNSmlError::TNSmlSyncMLStatusCode status = STATIC_CAST( TNSmlError::TNSmlSyncMLStatusCode, iSyncMLCmds->ResponseController()->StatusCode( aEntryID ) );
 	TBool error( EFalse );
-			
-    // Store status code to cenrep if it is on the list
-    if ( iErrorReportingEnabled )
-        {
-        StoreServerStatusCode( status );
-        }
-        
+	if(iIsExtendedServerErrorCodesSupported)
+	    {
+	    StoreServerStatusCode(status);
+	    }
 	switch ( status )
 		{
 		case TNSmlError::ESmlStatusInProgress:
@@ -3095,11 +3104,29 @@
 			}	
 			//RD_SUSPEND_RESUME	
 			break;
+
+		/* Implementation of CMCC PIM v3 begins*/
+		case TNSmlError::ESmlStatusDeviceFull: // 420
+		    if ( FeatureManager::FeatureSupported(KFeatureIdFfTdCmccpimpromptserverfullwhenreceive420statuscodefromserver) )
+		        {
+                // CMCC server full error enabled
+                iDSObserver->OnSyncMLSyncError( MSyncMLProgressObserver::ESmlFatalError, SyncMLError::KErrServerFull, 0, 0, 0);
+                error = ETrue;
+		        }
+			break;
+		/* Implementation of CMCC PIM v3 ends*/
 			
 		default:
 			error = ETrue;
 		}
 		
+    // Store status code to cenrep in case of error
+    if ( error && iErrorReportingRep
+         && (  status >= KNSmlDsErrCodeFirst && status <= KNSmlDsErrCodeLast ) )
+        {
+        iErrorReportingRep->Set( KNsmlOpDsErrorCode, status );
+        }
+        
 	if ( cmd == KNSmlAgentSyncHdr )
 		{
 		SaveIfNonceL( *iSyncMLCmds->ResponseController(), aEntryID );
@@ -3436,6 +3463,23 @@
 	{
 	DBG_FILE(_S8("CNSmlDSAgent::FinaliseWhenErrorL begins"));
 	
+	// Store error code to cenrep
+	if ( iErrorReportingRep )
+	    {
+        TInt errCode = iError->SyncLogErrorCode();
+
+        if ( errCode >= ( KNSmlDsHTTPErrCodeBase + KNSmlDsErrCodeFirst ) && 
+                errCode <= ( KNSmlDsHTTPErrCodeBase + KNSmlDsErrCodeLast ) )
+            {
+            errCode -= KNSmlDsHTTPErrCodeBase;
+            }
+
+        if ( errCode >= KNSmlDsErrCodeFirst && errCode <= KNSmlDsErrCodeLast )
+            {
+            iErrorReportingRep->Set( KNsmlOpDsErrorCode, errCode );    	    
+            }
+	    }
+
 // <MAPINFO_RESEND_MOD_BEGIN>
 	if( iDSContent->ResendUsed() )
 		{
@@ -4302,28 +4346,90 @@
     }
 
 // ------------------------------------------------------------------------------------------------------------------
+// CNSmlDSAgent::InitializeServerStatusCodeList()
+// @description This function reads list of configured server status codes
+//              from cenrep and stores them locally in an array for later comparision during sync
+// ------------------------------------------------------------------------------------------------------------------
+void CNSmlDSAgent::InitializeServerStatusCodeList()
+    {
+    DBG_FILE(_S8("CNSmlDSAgent::InitializeServerStatusCodeList() begins"));
+    TRAPD(error, iRepositorySSC = CRepository::NewL(KNsmlOperatorCenrepUID));
+    if(error == KErrNone && iRepositorySSC!= NULL)
+        {
+        TBuf<KBufferLength> tempStr;
+        error = iRepositorySSC->Get(KNsmlExtendedServerStatusCodeList, tempStr);
+        if(error == KErrNone)
+            {
+            TInt commaPos = -1;
+            TInt codesCount = 0;
+            while ((commaPos = tempStr.Locate(',')) > KErrNotFound)
+                {
+                ++codesCount;
+                tempStr.Replace(commaPos,1,KSpace);
+                }
+            TRAPD(error, iServerStatusCodeArray = new (ELeave) RArray<TInt>(codesCount));
+            if(error == KErrNone && iServerStatusCodeArray!= NULL)
+                {
+				TLex lex(tempStr);
+				while(!lex.Eos())
+					{
+					TPtrC token=lex.NextToken();
+					TLex temp(token);
+					TInt val;
+					temp.Val(val);
+					TRAP(error, iServerStatusCodeArray->AppendL(val));
+					if(error !=KErrNone)
+						{
+						DBG_FILE(_S8("Item Could not be appended to array"));
+						}
+					}
+                }
+            else
+                {
+                iServerStatusCodeArray = NULL;
+                DBG_FILE(_S8("Error creating iServerStatusCodeArray"));
+                }
+            }
+        else
+            {
+	        DBG_FILE(_S8("Could not find ServerStatusCodeList Key in cenrep"));
+            }
+        }
+    else
+        {
+        iRepositorySSC = NULL;
+        DBG_FILE(_S8("Error opening cenrep to store Server Status Codes"));
+        }
+    DBG_FILE(_S8("CNSmlDSAgent::InitializeServerStatusCodeList() ends"));
+    }
+// ------------------------------------------------------------------------------------------------------------------
 // CNSmlDSAgent::StoreServerStatusCode(TInt aServerStatusCode)
 // @description This function stores Sync ML Server Status code to cenrep for Operator profile sync if matched with configured list of codes,
 //              and the same code can be used by any client for error logging.
 //              If there are multiple status codes during sync, the last server status code is stored.
 // @param aServerStatusCode Sync ML server status code while sync ongoing.
 // ------------------------------------------------------------------------------------------------------------------
-void CNSmlDSAgent::StoreServerStatusCode( TInt aServerStatusCode ) const
+void CNSmlDSAgent::StoreServerStatusCode(TInt aServerStatusCode) const
     {
     DBG_FILE(_S8("CNSmlDSAgent::StoreServerStatusCode() begins"));
-
-    if( ( iServerStatusCodeArray.Count() == 0 && 
-      ( aServerStatusCode >=  KErrorCodeRangeFirst ) && 
-      ( aServerStatusCode <=  KErrorCodeRangeLast ) ) ||
-      ( iServerStatusCodeArray.Find( aServerStatusCode ) != KErrNotFound ) )
-        {
-        TInt error = iRepositorySSC->Set( KNsmlOpDsSyncErrorCode, aServerStatusCode );
-        if ( error != KErrNone )
-            {
-            DBG_FILE(_S8("Error in storing the server status code in cenrep"));
-            }
-        }
-
+	if(iServerStatusCodeArray)
+	    {
+	    if(iServerStatusCodeArray->Find(aServerStatusCode) != KErrNotFound)
+	        {
+	        if(iRepositorySSC)
+	            {
+	            TInt error = iRepositorySSC->Set(KNsmlExtendedServerStatusCode, aServerStatusCode);
+	            if (error != KErrNone)
+	                {
+	                DBG_FILE(_S8("Error in storing the server status code in cenrep"));
+	                }
+	            }
+	        else
+	            {
+	            DBG_FILE(_S8("Repository for SSC could not be found"));
+	            }
+	        }
+	    }
     DBG_FILE(_S8("CNSmlDSAgent::StoreServerStatusCode() ends"));
     }
 // End of file  
--- a/syncmlfw/ds/syncagent/src/nsmldscmds.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/src/nsmldscmds.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -18,10 +18,13 @@
 #define SYNCML_V3
 // INCLUDE FILES
 #include <SyncMLObservers.h>
+#include <SyncMLNotifierParams.h>
+#include <SyncMLNotifier.h>
 #include <nsmlconstants.h>
 #include <nsmldebug.h>
 #include <nsmlphoneinfo.h>
 #include <nsmlunicodeconverter.h>
+#include <centralrepository.h>
 // common includes with DM
 #include "nsmlcliagconstants.h"
 #include "NSmlCmdsBase.h"
@@ -46,11 +49,10 @@
 #include "nsmldserror.h"
 #include "nsmlfilter.h"
 #include "nsmldssettings.h"
-#include "nsmldsoperatorsettings.h"
 #include "nsmldsbatchbuffer.h"
 #include "nsmldshostclient.h"
-#include <nsmloperatorerrorcrkeys.h> // KCRUidOperatorDatasyncErrorKeys
-#include <nsmldevinfextdatacontainerplugin.h>
+#include "nsmloperatordefines.h"
+#include "NsmlOperatorErrorCRKeys.h"
 
 #ifndef __WINS__
 // This lowers the unnecessary compiler warning (armv5) to remark.
@@ -62,6 +64,9 @@
 
 // CONSTANTS
 _LIT8( KNSmlRoot, "/" );
+static const TInt KMaxLength = 255;
+const TUid KRepositoryId =  { 0x2000CF7E };   
+const TInt KNsmlDsOrphanEvent = 0xB ;
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -1539,8 +1544,38 @@
 			iAgent->Interrupt( TNSmlError::ESmlAlertInvalid, EFalse, EFalse );
 			return;
 			}
+		
+		//Read min and max times
+		// MINDT 
+		TInt mindt = AlertParameter( aAlert->itemList->item->data, KNSmlDSAgentMINDT );
+		// MAXDT 
+		TInt maxdt = AlertParameter( aAlert->itemList->item->data, KNSmlDSAgentMAXDT );
+		
+		HBufC* alertData = AlertDataLC( aAlert->itemList );
+		
+		//Fill notifier params
+		TSyncMLDlgNotifParams params;
+		params.iNoteType = ESyncMLInfoNote;
+		params.iServerMsg = TBufC<KSyncMLMaxServerMsgLength>(alertData->Des());
+		
+		CleanupStack::PopAndDestroy(); //alertData
+	
+		//Pack data and start notifier	
+		RNotifier notifier;
+		User::LeaveIfError( notifier.Connect() );
+		CleanupClosePushL(notifier);
+		
+		TPckgBuf<TBool> resBuf;
 
-		// SyncmlNotifier Dependency is removed
+		TRequestStatus status;
+			
+		TSyncMLDlgNotifParamsPckg data(params);
+   					
+		notifier.StartNotifierAndGetResponse( status, KSyncMLDlgNotifierUid, data, resBuf );
+		User::WaitForRequest(status);
+		
+		CleanupStack::PopAndDestroy(); //notifier, 
+		
 		return;
 		}
 
@@ -1684,7 +1719,7 @@
 		}
 		
 	// status 406 is returned if <Filter> is present BUT the session continues
-	if ( aAlert->itemList->item )
+	if (  aAlert->itemList && aAlert->itemList->item )
 	    {
 	    if ( aAlert->itemList->item->target )
 	        {
@@ -1925,7 +1960,7 @@
 	            }
 			iDSObserver.OnSyncMLSyncProgress(
             	MSyncMLProgressObserver::ESmlReceivingModificationsFromServer,
-	        	iDSContent.ServerItemCount(), iDSContent.TaskId() );
+	        	iDSContent.ServerItemCount(), 0 );
 			}
 
         // If number of changes is more than batch limit then batch is used if
@@ -2455,52 +2490,37 @@
 	// VerDTD element
 	PcdataNewL ( devInf->verdtd, KNSmlAgentVerDTD12 );
 
-    TBool isOperator = EFalse;
-    TInt profileId( iAgent->ProfileId() );
-    CNSmlDSOperatorSettings* settings = CNSmlDSOperatorSettings::NewLC();
-
-    CNSmlDSSettings* dsSettings = CNSmlDSSettings::NewLC();
-    CNSmlDSProfile* profile = dsSettings->ProfileL( profileId );
-
-    if( profile )
-        {
-        CleanupStack::PushL( profile );
-        isOperator = settings->IsOperatorProfileL( 
-            profile->StrValue( EDSProfileServerId ) );
-        CleanupStack::PopAndDestroy( profile );
-        }
-    
 	// Man element (manufacturer)
 	HBufC* manufacturer = HBufC::NewLC( 50 );
 	TPtr manufacturerPtr( manufacturer->Des() );
+	iPhoneInfo->PhoneDataL( CNSmlPhoneInfo::EPhoneManufacturer, manufacturerPtr );
 	HBufC8* manufacturerInUTF8( NULL );
-    if ( isOperator )
-        {
-        manufacturerInUTF8 = settings->CustomManValueLC();
-        if ( manufacturerInUTF8->Length() == 0 )
-            {
-            CleanupStack::PopAndDestroy();// manufacturerInUTF8
-            iPhoneInfo->PhoneDataL( CNSmlPhoneInfo::EPhoneManufacturer, manufacturerPtr );
-            NSmlUnicodeConverter::HBufC8InUTF8LC( *manufacturer, manufacturerInUTF8 );
-            }
-        }
-    else
-        {
-        iPhoneInfo->PhoneDataL( CNSmlPhoneInfo::EPhoneManufacturer, manufacturerPtr );
-        NSmlUnicodeConverter::HBufC8InUTF8LC( *manufacturer, manufacturerInUTF8 );
-        }
+	NSmlUnicodeConverter::HBufC8InUTF8LC( *manufacturer, manufacturerInUTF8 );
 	PcdataNewL ( devInf->man, *manufacturerInUTF8 );
 	CleanupStack::PopAndDestroy( 2 ); // manufacturerInUTF8, manufacturer
 	
 	PcdataNewL ( devInf->fwv, KNullDesC8() );
 	
 	// Mod element (model name)
+	TBool isOperator = EFalse;
+	TInt profileId( iAgent->ProfileId() );
+	CNSmlDSSettings* settings = CNSmlDSSettings::NewLC();
+	CNSmlDSProfile* profile = settings->ProfileL( profileId );
+	
+	if( profile )
+	    {
+	    CleanupStack::PushL( profile );
+	    isOperator = settings->IsOperatorProfileL( 
+	        profile->StrValue( EDSProfileServerId ) );
+	    CleanupStack::PopAndDestroy( profile );
+	    }
+
 	HBufC* model = HBufC::NewLC( 50 );
 	TPtr modelPtr = model->Des();
 	HBufC8* modelInUTF8 = NULL;
 	if ( isOperator )
 	    {
-	    modelInUTF8 = settings->CustomModValueLC();
+	    modelInUTF8 = settings->OperatorProfileModValueLC();
 	    if ( modelInUTF8->Length() == 0 )
 	        {
 	        CleanupStack::PopAndDestroy();// modelInUTF8
@@ -2518,7 +2538,7 @@
 	// SwV element (software version)
 	if ( isOperator )
 	    {
-	    HBufC8* swv = settings->CustomSwvValueLC();
+	    HBufC8* swv = settings->OperatorProfileSWVValueLC();
 	    if ( swv->Length() > 0 )
 	        {
 	        PcdataNewL ( devInf->swv, *swv );
@@ -2534,7 +2554,7 @@
 	    PcdataNewL ( devInf->swv, iPhoneInfo->SwVersionL() );
 	    }
 
-	CleanupStack::PopAndDestroy( 2, settings );
+	CleanupStack::PopAndDestroy( settings );
 
 	PcdataNewL ( devInf->hwv, KNullDesC8() );
 
@@ -2563,17 +2583,10 @@
 	// DataStore elements
 	SmlDevInfDatastoreList_t** currDatastorePtr = &devInf->datastore;
 
-	// Operator specific Device info extensions (XNam, XVal)
-	if( isOperator )
-		{
-		TRAPD( err, InsertOperatorExtensionDevInfFieldsL( devInf ) );
-		if( err != KErrNone )
-			{
-			DBG_FILE( _S8( "CNSmlDSCmds::DoDeviceInfoL(): Leave in InsertOperatorExtensionDevInfFieldsL()" ) );
-			DBG_FILE_CODE( err, _S8("Error code") );
-			}
-		}
-
+    // Operator DevInf ext fields enabler : START
+    InsertOperatorExtensionDevInfFieldsL( devInf );
+    // Operator DevInf ext fields enabler : END
+	
     iDSContent.SetToFirst();
 
 	do
@@ -3607,7 +3620,9 @@
 						}
 						
 					iItemOpened = EFalse;
-					
+					SmlStatus_t* status = NULL;
+					SmlItemList_t** itemList;
+					CRepository* rep = NULL;
 					switch ( returnCode )
 						{
 						case KErrNone:
@@ -3643,6 +3658,57 @@
 							statusId = StatusDataToGenericCommandL( aCmd, aContent, aItem, TNSmlError::ESmlStatusUnsupportedMediaTypeOrFormat );
 							break;
 							
+						case KErrPathNotFound:			
+						    // Read the Orphan Event ID from the cenrep
+						    rep = CRepository::NewLC(KRepositoryId);
+                            TRAPD( err, rep->Get(KNsmlDsOrphanEvent, iNewUid) );
+                            DBG_ARGS(_S("read the cenrep %d %d"), err, iNewUid);
+                            User::LeaveIfError(err);
+                            CleanupStack::PopAndDestroy(rep);
+							
+						    _DBG_FILE(_S8("CNSmlDSCmds::ADD UpdateL : Invalid Parent"));
+						    statusId = StatusDataToGenericCommandL( aCmd, aContent, aItem, TNSmlError::ESmlStatusMovedPermanently );
+						    DBG_ARGS(_S("Invalid parent: statusid %d"), statusId);
+						    status = iStatusToServer->StatusItem( statusId );
+						    DBG_ARGS(_S("Invalid parent: status %d"), status);
+						    if( status )
+                                {
+                                SmlItemList_t* newItemList = new( ELeave ) SmlItemList_t;
+                                _DBG_FILE(_S8("CNSmlDSCmds::ADD UpdateL : creating a new item"));
+                                newItemList->item = new( ELeave ) SmlItem_t;
+                                _DBG_FILE(_S8("CNSmlDSCmds::ADD UpdateL : creating a new data"));
+                                iStatusToServer->FillItemDataL( newItemList->item );
+                                _DBG_FILE(_S8("CNSmlDSCmds::ADD UpdateL : updating"));
+                                
+                                itemList = &(status->itemList);
+                                while ( *itemList )
+                                    {
+                                    itemList = &(*itemList)->next;
+                                    }
+                                *itemList = newItemList;
+                                _DBG_FILE(_S8("CNSmlDSCmds::ADD UpdateL : updated"));
+                                }
+						    if ( !iBatchModeOn )
+                                {
+                                iDSContent.IncreaseServerItemsAdded();
+                                clientModifications.iNumAdded = 1;
+                                
+                                if ( !iAtomicModeOn )
+                                    {
+                                    iDSContent.CreateNewMapItemL( iNewUid, aUID, 0 );
+                                    }
+                                else
+                                    {
+                                    iDSContent.CreateNewMapItemL( iNewUid, aUID, iAtomicId );
+                                    }
+                                }
+                            else
+                                {
+                                clientModifications.iNumAdded = 1;
+                                iBatchBuffer->SetStatusEntryId( statusId );
+                                }
+						    break;
+							
 						default:
 							statusId = StatusDataToGenericCommandL( aCmd, aContent, aItem, TNSmlError::ESmlStatusCommandFailed );
 							break;
@@ -3800,6 +3866,11 @@
 							statusId = StatusDataToGenericCommandL( aCmd, aContent, aItem, TNSmlError::ESmlStatusUnsupportedMediaTypeOrFormat );
 							break;
 							
+						case KErrPathNotFound:
+						    _DBG_FILE(_S8("CNSmlDSCmds:: REPLACE UpdateL : Invalid Parent"));
+						    statusId = StatusDataToGenericCommandL( aCmd, aContent, aItem, TNSmlError::ESmlStatusMovedPermanently );
+						    break;
+							
 						default:
 							statusId = StatusDataToGenericCommandL( aCmd, aContent, aItem, TNSmlError::ESmlStatusCommandFailed );
 							break;
@@ -4691,6 +4762,115 @@
 	return lexer.Val( aNumericUid );
 	}
 
+// -----------------------------------------------------------------------------
+// CNSmlDSCmds::InsertOperatorExtensionDevInfFieldsL
+// Adds operator specific extension DevInf fields <XNam> and <XVal>
+// Currently only one <XNam> and one corresponding <XVal> field is supported
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSCmds::InsertOperatorExtensionDevInfFieldsL(SmlDevInfDevInfPtr_t& aDevInf)
+    {
+    TInt error = KErrNotFound;
+    CRepository *operatorSettingsCenrep = NULL;
+    
+    // TRAP the creation of operator cenrep handle, because we don't want to 
+    // leave if the cenrep is not present
+    TRAP( error, operatorSettingsCenrep = CRepository::NewL( KNsmlOperatorCenrepUID ));
+    if( error != KErrNone )
+        {
+        // operator cenrep not found
+        return;
+        }
+    else
+        {
+        CleanupStack::PushL( operatorSettingsCenrep );
+
+        // get the server id from the current profile
+        TInt profileId( iAgent->ProfileId() );
+        CNSmlDSSettings* dsSettings = CNSmlDSSettings::NewLC();
+        CNSmlDSProfile* profile = NULL;
+        TRAP( error, profile = dsSettings->ProfileL( profileId ) );
+        
+        if( error != KErrNone || !profile )
+            {
+            // if there was an error in reading profile from the profile ID
+            // return do not proceed to change the DevInf
+            CleanupStack::PopAndDestroy( dsSettings );
+            CleanupStack::PopAndDestroy( operatorSettingsCenrep );
+            return; 
+            }
+        
+        HBufC* buffSerVerId = HBufC::NewLC( KMaxLength );
+        TPtr ptrCurrentServerId = buffSerVerId->Des();
+        ptrCurrentServerId.Copy( profile->StrValue( EDSProfileServerId ) );
+        
+        // get the server id from operator cenrep
+        HBufC* buffCenrepServerId = HBufC::NewLC( KMaxLength );
+        TPtr ptrCenrepServerId = buffCenrepServerId->Des();        
+        error = operatorSettingsCenrep->Get( KNsmlOperatorProfileServerId, ptrCenrepServerId);
+        
+        // if serverID read from operator cenrep and current profile match only then attempt to
+        // add devInf extension fields
+        if( error == KErrNone && ptrCenrepServerId.Compare( ptrCurrentServerId ) == 0 )
+            {
+            // create 16-bit buffers to read XNam and XVal field values from cenrep
+            HBufC* buffXNamField = HBufC::NewLC( KMaxLength );
+            HBufC* buffXValField = HBufC::NewLC( KMaxLength );
+            TPtr xNamField = buffXNamField->Des();
+            TPtr xValField = buffXValField->Des();            
+        
+            TInt keyErrorXNam = operatorSettingsCenrep->Get( KNsmlOperatorDevInfExtXNam, xNamField );
+            TInt keyErrorXVal = operatorSettingsCenrep->Get( KNsmlOperatorDevInfExtXVal, xValField );
+                
+            if( keyErrorXNam == KErrNone && keyErrorXVal == KErrNone &&
+                xNamField.Length() > 0 && xValField.Length() > 0 )
+                {
+                // create 8-bit buffers of exact necessary length
+                // to write extn. fields in dev-inf
+                HBufC8* buffXNam = HBufC8::NewLC( xNamField.Length() );
+                HBufC8* buffXVal = HBufC8::NewLC( xValField.Length() );
+
+                TPtr8 xnam = buffXNam->Des();
+                TPtr8 xval = buffXVal->Des();
+
+                // copy extn fields from 16-bit desc. to 8-bit desc.
+                xnam.Copy( xNamField );
+                xval.Copy( xValField );
+    
+                SmlPcdataPtr_t XNamData;
+                PcdataNewL( XNamData, xnam );
+    
+                SmlPcdataPtr_t XValData;
+                PcdataNewL( XValData, xval );
+    
+                SmlPcdataListPtr_t listPtr = new (ELeave) SmlPcdataList_t;
+                listPtr->data = XValData;
+                listPtr->next = NULL;
+    
+                SmlDevInfExtPtr_t extElementPtr = new (ELeave) SmlDevInfExt_t;
+                extElementPtr->xnam = XNamData;
+                extElementPtr->xval = listPtr; 
+    
+                SmlDevInfExtListPtr_t extListPtr = new (ELeave) SmlDevInfExtList_t;
+                extListPtr->data = extElementPtr;
+                extListPtr->next = NULL;
+    
+                aDevInf->ext = extListPtr;
+    
+                CleanupStack::PopAndDestroy( buffXVal );
+                CleanupStack::PopAndDestroy( buffXNam );
+                }
+            CleanupStack::PopAndDestroy( buffXValField );
+            CleanupStack::PopAndDestroy( buffXNamField );     
+            }
+
+        CleanupStack::PopAndDestroy( buffCenrepServerId );   
+        CleanupStack::PopAndDestroy( buffSerVerId );
+        CleanupStack::PopAndDestroy( dsSettings );
+        CleanupStack::PopAndDestroy( operatorSettingsCenrep );
+        }
+    }
+
 //-----------------------------------------------------------------------------
 // CNSmlDSCmds::StoreSyncType
 // Checks if received Alert Code is a sync type and tries to convert
@@ -4737,134 +4917,4 @@
             }
         }
     }
-
-// ----------------------------------------------------------------------------
-// CNSmlDSCmds::InsertOperatorExtensionDevInfFieldsL
-// Adds operator specific extension fields <XNam> and <XVal> to Device info
-// ----------------------------------------------------------------------------
-//
-void CNSmlDSCmds::InsertOperatorExtensionDevInfFieldsL( 
-    SmlDevInfDevInfPtr_t& aDevInf )
-    {
-    // Instantiate Extension Data container ECom plugin 
-    CNSmlDevInfExtDataContainerPlugin* extensionPlugin = NULL;
-    TRAPD( err, extensionPlugin = CNSmlDevInfExtDataContainerPlugin::NewL() );
-    if( err == KErrNone )
-        {
-        CleanupStack::PushL( extensionPlugin );
-
-        if( extensionPlugin->GetExtensionCountL() > 0 )
-            {
-            // Create a list for extensions
-            SmlDevInfExtListPtr_t extList = new ( ELeave ) SmlDevInfExtList_t;
-            CleanupStack::PushL( extList );
-            extList->data = NULL;
-            extList->next = NULL;
-
-            for( TInt i = 0; i < extensionPlugin->GetExtensionCountL(); i++ )
-                {
-                // Create new <Ext> element and insert it to extension list
-                SmlDevInfExtPtr_t extElement = new ( ELeave ) SmlDevInfExt_t;
-                CleanupStack::PushL( extElement );
-
-                // Handle <XNam>
-                PcdataNewL( extElement->xnam, extensionPlugin->GetExtNameL( i ) );
-
-                // Handle <XVal>
-                if( extensionPlugin->GetExtValueCountL( i ) > 0 )
-                    {
-                    SmlPcdataListPtr_t xValList = new ( ELeave ) SmlPcdataList_t;
-                    CleanupStack::PushL( xValList );
-                    xValList->data = NULL;
-                    xValList->next = NULL;
-
-                    for( TInt j = 0; j < extensionPlugin->GetExtValueCountL( i ); j++ )
-                        {
-                        AppendToXValListL( xValList, 
-                            extensionPlugin->GetExtValueL( i, j ) );
-                        }
-                    extElement->xval = xValList;
-                    CleanupStack::Pop( xValList );
-                    }
-                else
-                    {
-                    extElement->xval = NULL;
-                    }
-                AppendToExtensionListL( extList, extElement );
-                CleanupStack::Pop( extElement );
-                }
-
-            // Add extensions as a part of DevInfo structure
-            aDevInf->ext = extList;
-            CleanupStack::Pop( extList );
-            }
-
-        // Do the cleanup
-        CleanupStack::PopAndDestroy( extensionPlugin );
-        REComSession::FinalClose();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNSmlDSCmds::AppendToExtensionListL
-// ----------------------------------------------------------------------------
-//
-void CNSmlDSCmds::AppendToExtensionListL( SmlDevInfExtListPtr_t aExtList, 
-    SmlDevInfExtPtr_t aExtItem )
-    {
-    if( !aExtList->data )
-        {
-        // This is the first item to be added to the list
-        aExtList->data = aExtItem;
-        aExtList->next = NULL;
-        }
-    else
-        {
-        // List is not empty
-        SmlDevInfExtListPtr_t newExtListItem = new ( ELeave ) SmlDevInfExtList_t;
-        newExtListItem->data = aExtItem;
-        newExtListItem->next = NULL;
-    
-        // Search the end of the extension list & add new item
-        SmlDevInfExtListPtr_t tmp = aExtList;
-        while( tmp->next )
-            {
-            tmp = tmp->next;
-            }
-        tmp->next = newExtListItem;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNSmlDSCmds::AppendToXValListL
-// ----------------------------------------------------------------------------
-//
-void CNSmlDSCmds::AppendToXValListL( SmlPcdataListPtr_t aXValList,
-    const TDesC8& aXVal )
-    {
-    if( !aXValList->data )
-        {
-        // This is the first item to be added to the list
-        PcdataNewL( aXValList->data, aXVal );
-        aXValList->next = NULL;
-        }
-    else
-        {
-        // List is not empty
-        SmlPcdataListPtr_t newXValItem = new ( ELeave ) SmlPcdataList_t;
-        CleanupStack::PushL( newXValItem );
-        PcdataNewL( newXValItem->data, aXVal );
-        CleanupStack::Pop( newXValItem );
-        newXValItem->next = NULL;
-    
-        // Search the end of the extension list & add new item
-        SmlPcdataListPtr_t tmp = aXValList;
-        while( tmp->next )
-            {
-            tmp = tmp->next;
-            }
-        tmp->next = newXValItem;
-        }
-    }
-
 // End of File
--- a/syncmlfw/ds/syncagent/src/nsmldscontent.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/src/nsmldscontent.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -120,7 +120,7 @@
 //
 TBool CNSmlDSContent::ContentIndexIsSet() const
 	{
-	if ( iIndex == -1 )
+	if ( ( iIndex < 0 ) || ( iIndex >= iStores.Count() ) )
 		{
 		return EFalse;
 		}
@@ -2476,7 +2476,13 @@
 	DBG_FILE(_S8("CNSmlDSContent::PackupRequestL begins"));
 	RMutex mutex;
 	if(mutex.OpenGlobal( KNSmlDSContentAtomicOperationName ) != KErrNone )
-		mutex.CreateGlobal( KNSmlDSContentAtomicOperationName );
+	    {
+		TRAPD(err, mutex.CreateGlobal( KNSmlDSContentAtomicOperationName ));
+		if(err != KErrNone)
+		    {
+            return;
+		    }
+	    }
 	mutex.Wait();
 	SaveMapInfoL( aAnchor );
 	mutex.Signal();
--- a/syncmlfw/ds/syncagent/src/nsmldsnetmon.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/syncagent/src/nsmldsnetmon.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -221,7 +221,8 @@
 
     //Fix for BPSS-7GBGV7
     if( iDSAgent->IsSyncClientInitiated() && 
-        (iDSAgent->iAllowAutoRestart ) )
+        (iDSAgent->iNetmonAPBearerType == EApBearerTypeGPRS ||
+	              iDSAgent->iNetmonAPBearerType == EApBearerTypeCDMA) )
 	    
 	{
 		switch(aEvent.ConnectionId())
--- a/syncmlfw/ds/wappushalert/bld/nsmldswappushalert.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/ds/wappushalert/bld/nsmldswappushalert.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -26,6 +26,7 @@
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/push
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE	/epoc32/include/platform/mw/push
 #endif
--- a/syncmlfw/group/bld.inf	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -25,7 +25,6 @@
 ../conf/datasync.confml				MW_LAYER_CONFML(datasync.confml)
 ../conf/datasync_2000CF7E.crml		MW_LAYER_CRML(datasync_2000CF7E.crml)
 ../conf/devman.confml				MW_LAYER_CONFML(devman.confml)
-../conf/CI_devman.confml				MW_LAYER_CONFML(CI_devman.confml)
 ../conf/devman_101F9A0A.crml		MW_LAYER_CRML(devman_101F9A0A.crml)
 ../conf/nsmlemailadapter.confml		MW_LAYER_CONFML(nsmlemailadapter.confml)
 ../conf/nsmlemailadapter_101F99DF.crml	MW_LAYER_CRML(nsmlemailadapter_101F99DF.crml)
@@ -40,10 +39,15 @@
 ../conf/datasyncsessioninfo.confml				MW_LAYER_CONFML(datasyncsessioninfo.confml)
 ../conf/datasyncsessioninfo_20029F15.crml     MW_LAYER_CRML(datasyncsessioninfo_20029F15.crml)
 
+//For extended server status code 
+../conf/nsmloperatorsettings.confml				MW_LAYER_CONFML(nsmloperatorsettings.confml)
+../conf/nsmloperatorsettings_2002682E.crml		MW_LAYER_CRML(nsmloperatorsettings_2002682E.crml)
+
 ../conf/operatordatasync.confml			MW_LAYER_CONFML(operatordatasync.confml)
 ../conf/operatordatasync_2001E2E1.crml		MW_LAYER_CRML(operatordatasync_2001E2E1.crml)
-../conf/operatordatasyncerror.confml			MW_LAYER_CONFML(operatordatasyncerror.confml)
-../conf/operatordatasyncerror_2001FDF1.crml		MW_LAYER_CRML(operatordatasyncerror_2001FDF1.crml)
+../conf/operatordatasyncerror.confml		MW_LAYER_CONFML(operatordatasyncerror.confml)
+../conf/operatordatasyncerror_2001FDF1.crml	MW_LAYER_CRML(operatordatasyncerror_2001FDF1.crml)
+
 
 //for IAD support
 syncmlfw_stub.sis  /epoc32/data/z/system/install/syncmlfw_stub.sis 
@@ -155,3 +159,6 @@
 // Disabling OTA configuration
 //#include "../ds/ota/bld/bld.inf"
 
+#include "../syncmlnotifier/group/bld.inf"
+#include "../syncservice/group/bld.inf"
+
--- a/syncmlfw/rom/NSmlDMSync.iby	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/rom/NSmlDMSync.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -25,41 +25,41 @@
 
 
 REM  SyncML Device Management plug-in adapters
-REM ECOM_PLUGIN(nsmldmdevdetailadapter.dll,nsmldmdevdetailadapter.rsc)
-REM ECOM_PLUGIN(nsmldmdevinfoadapter.dll,nsmldmdevinfoadapter.rsc)
-REM ECOM_PLUGIN(nsmlinternetadapter.dll,nsmlinternetadapter.rsc)
+ECOM_PLUGIN(nsmldmdevdetailadapter.dll,nsmldmdevdetailadapter.rsc)
+ECOM_PLUGIN(nsmldmdevinfoadapter.dll,nsmldmdevinfoadapter.rsc)
+//ECOM_PLUGIN(nsmlinternetadapter.dll,nsmlinternetadapter.rsc)
 #ifdef __SYNCML_DM_1_1_2
-REM ECOM_PLUGIN(nsmldmsettingsadapter.dll,nsmldmsettingsadapter.rsc)
+ECOM_PLUGIN(nsmldmsettingsadapter.dll,nsmldmsettingsadapter.rsc)
 #else
-REM ECOM_PLUGIN(nsmldmsettingsadapter12.dll,nsmldmsettingsadapter12.rsc)
+ECOM_PLUGIN(nsmldmsettingsadapter12.dll,nsmldmsettingsadapter12.rsc)
 #endif
 
 #ifdef FF_DM_STREAMING_ADAPTER
-REM ECOM_PLUGIN(nsmldmstreamingadapter.dll,nsmldmstreamingadapter.rsc)
+ECOM_PLUGIN(nsmldmstreamingadapter.dll,nsmldmstreamingadapter.rsc)
+#endif
+
+#ifdef FF_DM_BROWSER_ADAPTER
+ECOM_PLUGIN(nsmldmbrowseradapter.dll,nsmldmbrowseradapter.rsc)
 #endif
 
-REM #ifdef FF_DM_BROWSER_ADAPTER
-REM ECOM_PLUGIN(nsmldmbrowseradapter.dll,nsmldmbrowseradapter.rsc)
-REM #endif
-
-REM #ifdef __SYNCML_DS //  SyncML data synchronization
-REM #ifdef __SYNCML_DM_DS //  SyncML device management data sync settings plug-in
-REM ECOM_PLUGIN(nsmldssettingsadapter.dll,nsmldssettingsadapter.rsc)
-REM #endif // __SYNCML_DM_DS
-REM #endif // __SYNCML_DS
+#ifdef __SYNCML_DS //  SyncML data synchronization
+#ifdef __SYNCML_DM_DS //  SyncML device management data sync settings plug-in
+ECOM_PLUGIN(nsmldssettingsadapter.dll,nsmldssettingsadapter.rsc)
+#endif // __SYNCML_DM_DS
+#endif // __SYNCML_DS
 
-REM #ifdef __SYNCML_DM_EMAIL //  SyncML device management email settings plug-in
-REM ECOM_PLUGIN(nsmldmemailadapter.dll,nsmldmemailadapter.rsc)
-REM #endif // __SYNCML_DM_EMAIL
+#ifdef __SYNCML_DM_EMAIL //  SyncML device management email settings plug-in
+ECOM_PLUGIN(nsmldmemailadapter.dll,nsmldmemailadapter.rsc)
+#endif // __SYNCML_DM_EMAIL
 
-REM #ifdef __SYNCML_DM_MMS //  SyncML device management MMS settings plug-in
-REM ECOM_PLUGIN(nsmldmmmsadapter.dll,nsmldmmmsadapter.rsc)
-REM #endif // __SYNCML_DM_MMS
+#ifdef __SYNCML_DM_MMS //  SyncML device management MMS settings plug-in
+ECOM_PLUGIN(nsmldmmmsadapter.dll,nsmldmmmsadapter.rsc)
+#endif // __SYNCML_DM_MMS
 
-REM #ifdef __SYNCML_DM_FOTA // SyncML device management Firmware update plug-in
-REM ECOM_PLUGIN(nsmldmfotaadapter.dll,nsmldmfotaadapter.rsc)
-REM data=ABI_DIR\BUILD_DIR\z\private\100012a5\policy\101F9A02.SPD		private\100012a5\policy\101F9A02.SPD
-REM #endif // __SYNCML_DM_FOTA
+#ifdef __SYNCML_DM_FOTA // SyncML device management Firmware update plug-in
+ECOM_PLUGIN(nsmldmfotaadapter.dll,nsmldmfotaadapter.rsc)
+data=ABI_DIR\BUILD_DIR\z\private\100012a5\policy\101F9A02.SPD		private\100012a5\policy\101F9A02.SPD
+#endif // __SYNCML_DM_FOTA
 
 
 REM DM utils
@@ -97,6 +97,24 @@
 REM wappushalert
 ECOM_PLUGIN(nsmldmwappushalert.dll,101F6DE3.rsc)
 
+#ifdef FF_DM_CONNMO_ADAPTER 
+// old internet adapter is not used in that case for access point provisioning.
+ECOM_PLUGIN(connmoadapter.dll,connmoadapter.rsc)
+#else
+ECOM_PLUGIN(nsmlinternetadapter.dll,nsmlinternetadapter.rsc)
+#endif FF_DM_CONNMO_ADAPTER
+
+#ifdef __SYNCML_DM_WLAN 
+ECOM_PLUGIN(globalwlanadapter.dll,globalwlanadapter.rsc)
+#endif // __SYNCML_DM_WLAN
+
+#ifdef __ALWAYS_ONLINE_PDPCONTEXT2
+ECOM_PLUGIN( nsmldmalwaysonadapter.dll, nsmldmalwaysonadapter.rsc )
+#endif // __ALWAYS_ONLINE_PDPCONTEXT2
+
+ECOM_PLUGIN( nsmldmbmadapter.dll, nsmldmbmadapter.rsc )
+ECOM_PLUGIN(wlanctrldcmoadapter.dll,wlanctrldcmoadapter.rsc)
+
 #ifdef __SYNCML_DM_OTA
 REM DM OMA provisioning 
 ECOM_PLUGIN(wpdm.dll,wpdm.rsc)
--- a/syncmlfw/rom/NSmlDSSync.iby	Tue Aug 31 16:04:06 2010 +0300
+++ b/syncmlfw/rom/NSmlDSSync.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -32,16 +32,16 @@
 
 REM SyncML  Data Synchronisation plug-in adapters
 
-REM #ifdef  __SYNCML_DS_CAL // SyncML data synchronization calendar plug-in
-REM ECOM_PLUGIN(nsmlagendadataprovider.dll,nsmlagendadataprovider.rsc)
-REM data=DATAZ_\RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_1_2.rsc		RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_1_2.rsc
-REM #endif // __SYNCML_DS_CAL
+#ifdef  __SYNCML_DS_CAL // SyncML data synchronization calendar plug-in
+ECOM_PLUGIN(nsmlagendadataprovider.dll,nsmlagendadataprovider.rsc)
+data=DATAZ_\RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_1_2.rsc		RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_1_2.rsc
+#endif // __SYNCML_DS_CAL
 
-REM #ifdef __SYNCML_DS_CON //  SyncML data synchronization contacts plug-in
-REM ECOM_PLUGIN(nsmlcontactsdataprovider.dll,nsmlcontactsdataprovider.rsc)
-REM data=DATAZ_\RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_1_2.rsc	RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_1_2.rsc
-REM data=DATAZ_\RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_2.rsc	RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_2.rsc
-REM #endif // __SYNCML_DS_CON
+#ifdef __SYNCML_DS_CON //  SyncML data synchronization contacts plug-in
+ECOM_PLUGIN(nsmlcontactsdataprovider.dll,nsmlcontactsdataprovider.rsc)
+data=DATAZ_\RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_1_2.rsc	RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_1_2.rsc
+data=DATAZ_\RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_2.rsc	RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_2.rsc
+#endif // __SYNCML_DS_CON
 
 data=DATAZ_\RESOURCE_FILES_DIR\NSmlDSProfileRes.rsc             RESOURCE_FILES_DIR\NSmlDSProfileRes.rsc
 REM \ds\adapters\dataproviderbase
@@ -51,7 +51,7 @@
 file=ABI_DIR\BUILD_DIR\NSmlAdapterLog.dll		SHARED_LIB_DIR\NSmlAdapterLog.dll
 
 REM \ds\datamod
-REM file=ABI_DIR\BUILD_DIR\nsmldatamod.dll                  SHARED_LIB_DIR\nsmldatamod.dll
+file=ABI_DIR\BUILD_DIR\nsmldatamod.dll                  SHARED_LIB_DIR\nsmldatamod.dll
 
 REM \ds\dshostclient
 file=ABI_DIR\BUILD_DIR\NSmldshostclient.dll		SHARED_LIB_DIR\NSmldshostclient.dll
@@ -86,7 +86,7 @@
 REM \ds\dsutils
 file=ABI_DIR\BUILD_DIR\nsmlchangefinder.dll          	SHARED_LIB_DIR\nsmlchangefinder.dll
 file=ABI_DIR\BUILD_DIR\nsmldbcaps.dll                	SHARED_LIB_DIR\nsmldbcaps.dll
-REM file=ABI_DIR\BUILD_DIR\nsmlCGIScriptParser.dll       	SHARED_LIB_DIR\nsmlCGIScriptParser.dll
+file=ABI_DIR\BUILD_DIR\nsmlCGIScriptParser.dll       	SHARED_LIB_DIR\nsmlCGIScriptParser.dll
 file=ABI_DIR\BUILD_DIR\nsmlfilter.dll			SHARED_LIB_DIR\nsmlfilter.dll
 file=ABI_DIR\BUILD_DIR\syncmldatafilter.dll			SHARED_LIB_DIR\syncmldatafilter.dll
 file=ABI_DIR\BUILD_DIR\smlstoreformat.dll		SHARED_LIB_DIR\smlstoreformat.dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/BWINS/SyncMLNotifieru.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase2> * NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierAppserver.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* 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 project specification file for appserver for 
+*                 the BTNotif Ecom Plugins.
+*
+*/
+
+#include  <platform_paths.hrh>
+
+TARGET          SyncMLNotifierAppServer.exe
+
+EPOCSTACKSIZE   0x5000
+TARGETTYPE      exe
+UID             0x100039ce 0x102072bf
+
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_APPLICATION // define cap needed by your notifier here
+
+SOURCEPATH      .
+SOURCE          SyncMLNotifierServerApplication.cpp
+
+START RESOURCE ./syncmlnotifierappserver_reg.rss
+// Do not change the UID below.
+TARGETPATH /private/10003a3f/apps
+LANGUAGE_IDS
+END
+
+USERINCLUDE     . ../inc
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib 
+LIBRARY         apparc.lib 
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib
+LIBRARY         avkon.lib 
+LIBRARY         aknnotifierwrapper.lib
+
+DEBUGLIBRARY    flogger.lib
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierAppserver.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* 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: Implementation of syncmlnotifier component
+* 	This is part of syncmlnotifier.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    SNAS
+
+//  INCLUDES
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rsg>
+#include <avkon.hrh>
+
+//  RESOURCE DEFINITIONS 
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf = "SyncMLNotifierAppServer"; }
+
+RESOURCE EIK_APP_INFO
+	{
+	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierServerApplication.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* 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:  Declares SyncML notifiers server application class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "SyncMLNotifierServerApplication.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+_LIT( KSmlNotifierLibraryFileName,  "SyncMLNotifier.dll" );
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// NewApplication Creates a new notifier server application.
+// -----------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+	{
+	FLOG(_L("[SmlNotif]\t NewApplication()"));
+	return new CSyncMLNotifierServerApplication();
+	}	
+	
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierServerApplication::CSyncMLNotifierServerApplication
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLNotifierServerApplication::CSyncMLNotifierServerApplication()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierServerApplication::CreateDocumentL()"));
+	}
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierServerApplication::NewAppServerL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierServerApplication::NewAppServerL( CApaAppServer*& aAppServer )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLNotifierServerApplication::NewAppServerL()"));
+    CAknNotifierAppServer* server = new (ELeave) CAknNotifierAppServer();
+    CleanupStack::PushL(server);
+
+    server->AppendNotifierLibNameL( KSmlNotifierLibraryFileName );
+    server->LoadNotifiersL();
+    CleanupStack::Pop( server );
+    aAppServer = &*server;
+    FLOG(_L("[SmlNotif]\t CSyncMLNotifierServerApplication::NewAppServerL() completed"));
+    }
+        
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierServerApplication::CreateDocumentL
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CSyncMLNotifierServerApplication::CreateDocumentL()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierServerApplication::CreateDocumentL()"));
+	return new (ELeave) CSyncMLNotifierAppServerDocument( *this );
+	}
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierAppServerDocument::CreateAppUiL
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CSyncMLNotifierAppServerDocument::CreateAppUiL()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierAppServerDocument::CreateAppUiL()"));
+	return new (ELeave) CSyncMLNotifierAppServerAppUi();
+	}
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierAppServerAppUi::CSyncMLNotifierAppServerAppUi
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLNotifierAppServerAppUi::CSyncMLNotifierAppServerAppUi()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierAppServerAppUi::CSyncMLNotifierAppServerAppUi()"));
+	}
+
+// Destructor
+CSyncMLNotifierAppServerAppUi::~CSyncMLNotifierAppServerAppUi()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierAppServerAppUi::~CSyncMLNotifierAppServerAppUi()"));
+	}
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierAppServerAppUi::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierAppServerAppUi::ConstructL()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierAppServerAppUi::ConstructL()"));
+	// base call
+	CAknNotifierAppServerAppUi::ConstructL();
+	FLOG(_L("[SmlNotif]\t CSyncMLNotifierAppServerAppUi::ConstructL() completed"));
+	}
+	
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// E32Main
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierServerApplication.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* 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:  Declares SyncML notifiers server application class.
+*
+*/
+
+
+
+#ifndef SYNCMLNOTIFIERSERVERAPPLICATION_H
+#define SYNCMLNOTIFIERSERVERAPPLICATION_H
+
+//  INCLUDES
+#include <AknNotiferAppServerApplication.h> 
+#include <AknNotifierAppServer.h>
+#include <eikstart.h>
+
+// CONSTANTS
+const TUid KSyncMLNotifierAppServerUid = { 0x102072bf };
+
+// CLASS DECLARATION
+
+/**
+*  Server application, in which the notifiers are executed.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+class CSyncMLNotifierServerApplication: public CAknNotifierAppServerApplication
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLNotifierServerApplication();
+ 
+    public: // New functions
+        
+        /**
+        * Returns the resource file name of the object. Returns
+        * an empty string, since component has no resource file.
+        * @since Series 60 3.0
+        * @param None
+        * @return Resource file name.
+        */
+        TFileName ResourceFileName() const { TBuf<1> buf; return buf; }
+
+    public: // Functions from base classes
+ 
+        /**
+        * From CAknApplication
+        * @since Series 60 3.0
+        * @param aAppaServer 
+        * @return None.
+        */
+        void NewAppServerL( CApaAppServer*& aAppServer );
+ 
+        /**
+        * From CAknApplication Creates the application server document
+        * instance.
+        * @since Series 60 3.0
+        * @param None
+        * @return Pointer to the created document instance.
+        */
+        CApaDocument* CreateDocumentL();
+ 
+        /**
+        * From CApaApplication Returns the application server uid.
+        * @since Series 60 3.0
+        * @param None
+        * @return Application server uid.
+        */
+        TUid AppDllUid() const { return KSyncMLNotifierAppServerUid; } 
+    };
+
+/**
+*  Document instance for notifier server application.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+class CSyncMLNotifierAppServerDocument: public CAknDocument
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLNotifierAppServerDocument( CEikApplication& aApp )
+            : CAknDocument( aApp ) {};
+        
+    protected:  // Functions from base classes
+ 
+        /**
+        * From CAknDocument Creates the application server UI
+        * instance.
+        * @since Series 60 3.0
+        * @param None
+        * @return Pointer to the created UI instance.
+        */
+        CEikAppUi* CreateAppUiL();
+    };
+
+/**
+*  Application UI instance of the notifier server application.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+ class CSyncMLNotifierAppServerAppUi: public CAknNotifierAppServerAppUi
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLNotifierAppServerAppUi();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLNotifierAppServerAppUi();
+ 
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+    };
+
+#endif      // SYNCMLNOTIFIERSERVERAPPLICATION_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierappserver_reg.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* 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: Implementation of syncmlnotifier component
+* 	This is part of syncmlnotifier.
+*
+*/
+
+
+//  INCLUDES
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x102072bf  //  UID
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "SyncMLNotifierAppServer";
+    hidden = KAppIsHidden;
+    }
Binary file syncmlfw/syncmlnotifier/cenrep/keys_syncmlnotifier.xls has changed
Binary file syncmlfw/syncmlnotifier/conf/syncmlnotifier.confml has changed
Binary file syncmlfw/syncmlnotifier/conf/syncmlnotifier_101F8769.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/data/SyncMLNotifier.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,909 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for SyncML notifier component.
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    SMLN
+
+//  INCLUDES
+#include <bldvariant.hrh>
+#include <eikon.rsg>
+#include <eikon.rh>
+
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+
+#include "SyncMLNotifier.hrh"
+#include <syncmlnotifier.loc>
+#include <syncmlnotifierfota.loc>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+
+//  CONSTANTS  
+
+//  MACROS  
+
+//  RESOURCE DEFINITIONS 
+
+// =============================================================================
+// POP-UP QUERY TEXTS
+//
+// -----------------------------------------------------------------------------
+//   
+// r_sml_init_ds_server_prompt
+// Text for the server initiated synchronisation session acception
+// pop-up query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_sml_init_ds_server_prompt    { buf = qtn_ds_query_accept_configuration; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_sml_init_dm_server_prompt
+// Text for the server initiated management session acception
+// pop-up query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_sml_init_dm_server_prompt    { buf = qtn_dm_query_accept_configuration; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_sml_init_dm_server_prompt   
+// Text for the server initiated management session acception for chinese variant
+// pop-up query.
+//
+// -----------------------------------------------------------------------------
+RESOURCE TBUF r_qtn_dm_query_accept_postsale    { buf = qtn_dm_query_accept_postsale ; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_sml_server_msg_prompt
+// Text for the server initiated management session acception
+// pop-up query.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_sml_server_msg_prompt    { buf = qtn_sml_server_message_heading; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_notif_complete
+// Text indicating that the firmware update was successful.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_notif_complete    { buf = qtn_fota_notif_complete; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_notif_complete
+// Text indicating that the firmware update was not successful.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_msg_query_not_updated  { buf = qtn_fota_msg_query_not_updated; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_battery_low
+// Text indicating that there is not enough battery power to perform
+// firmware update.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_battery_low            { buf = qtn_fota_battery_low; }
+//
+//----------------------------------------------------------------------------
+// r_fota_battery_low
+// Text indicating that there is not enough battery power to perform
+// firmware update.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_usb_battery_low            { buf = qtn_fota_msg_query_update_usb_charger; }
+//
+// -----------------------------------------------------------------------------
+//   
+// r_fota_lost_connection
+// Text indicating that the connection was lost during management
+// or FOTA package download.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_lost_connection        { buf = qtn_fota_err_lost_connection; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_server_error
+// Text indicating that the server returned an internal error when
+// the phone tried to connect to it.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_server_error           { buf = qtn_fota_server_error; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_not_permitted
+// Text indicating that firmware updating is not permitted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_not_permitted          { buf = qtn_fota_not_permitted; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_query_install_now
+// Text indicating that firmware updating is not permitted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_query_install_now      { buf = qtn_fota_conf_query_install_now; }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_query_install_force_now
+// Text indicating that firmware updating is not permitted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_query_install_force_now      { buf = qtn_att_fota_conf_query_install_forced; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_post_limit_fota_query_install_now
+// Text indicating that firmware updating, is to be done now or later.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_post_limit_fota_query_install_now      { buf = qtn_att_fota_conf_query_install_now; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_update_1_warning
+// First confirmation query describing the effect of firmware update.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_update_1_warning         { buf = qtn_fota_msg_query_update_1_warning; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_update_2_warning
+// Second confirmation query describing the effect of firmware update.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_update_2_warning         { buf = qtn_fota_msg_query_update_2_warning; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_custom_warning
+// confirmation query describing the effect of firmware update(chinese variant).
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_fota_msg_query_update_custom_warning  {buf = qtn_fota_msg_query_update_custom_warning;}
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_reboot_note
+// Text indicating that firmware updating is not permitted.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_reboot_note            { buf = qtn_fota_restarting_for_update; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_update_reminder
+// Text informing the user that he may installe the update from
+// device manager application.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_update_reminder        { buf = qtn_fota_msg_query_update_reminder; }
+
+// -----------------------------------------------------------------------------
+//   
+// r_fota_title_phone_updates
+// Header text for firmware update specific queries.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_fota_title_phone_updates    { buf = qtn_fota_query_title_phone_updates; }
+//#ifdef RD_FOTA_FLEXIBLE_MEMORY_USAGE
+RESOURCE TBUF r_fota_large_no_flexible_memory    { buf = qtn_fota_note_not_enough_disk_space; }
+RESOURCE TBUF r_fota_omadl_no_flexible_memory    { buf = qtn_fota_querry_not_enough_disk_space; }
+//#endif
+//#ifdef RD_DM_TEXT_INPUT_ALERT
+RESOURCE TBUF r_default_alert_heading  { buf = qtn_sml_server_message_heading; }
+//#endif
+RESOURCE TBUF r_fota_user_cancel    			{ buf = qtn_fota_query_download_continue; }
+RESOURCE TBUF r_fota_download_postponed   { buf = qtn_fota_query_download_postponed; }
+RESOURCE TBUF r_fota_download_cancelled   { buf = qtn_fota_query_download_cancelled; }
+RESOURCE TBUF r_fota_connection_fail2   	{ buf = qtn_fota_query_download_conn_lost; }
+RESOURCE TBUF r_fota_download_general_resume   { buf = qtn_fota_query_download_error_continue; }
+RESOURCE TBUF r_fota_download_no_resume   { buf = qtn_fota_query_download_error_restart; }
+RESOURCE TBUF r_fota_download_resume   		{ buf = qtn_fota_query_download_resume; }
+
+// Update Postpone Limit
+
+RESOURCE TBUF r_fota_postpone_update_one_minute   { buf = qtn_att_fota_info_installation_postponed_one_minute; }
+RESOURCE TBUF r_fota_postpone_update_minutes   { buf = qtn_att_fota_info_installation_postponed_minutes; }
+RESOURCE TBUF r_fota_postpone_update_one_hour   { buf = qtn_att_fota_info_installation_postponed_one_hour; }
+RESOURCE TBUF r_fota_postpone_update_hours   { buf = qtn_att_fota_info_installation_postponed_hours; }
+RESOURCE TBUF r_fota_postpone_update_one_day   { buf = qtn_att_fota_info_installation_postponed_one_day; }
+RESOURCE TBUF r_fota_postpone_update_days   { buf = qtn_att_fota_info_installation_postponed_days; }
+
+
+// Header text for encryption related queries
+RESOURCE TBUF r_fota_update_dec_warning        { buf = qtn_fota_msg_query_update_dec_warning; }
+RESOURCE TBUF r_fota_update_enc                { buf = qtn_fota_msg_query_update_encrypt; }
+RESOURCE TBUF r_fota_update_enc_battery_low    { buf = qtn_fota_battery_encryption_low; }
+RESOURCE TBUF r_fota_device_memory_busy        { buf = qtn_fota_device_busy; }
+
+// =============================================================================
+// SOFTKEYS
+//
+// -----------------------------------------------------------------------------
+//   
+// r_sml_softkeys_accept_cancel
+// Query for the server initiated session acception.
+//
+// -----------------------------------------------------------------------------
+//        
+RESOURCE CBA r_sml_softkeys_accept_cancel__accept
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EAknSoftkeyOk;     txt = text_softkey_accept; },
+        CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; },
+        CBA_BUTTON { id = EAknSoftkeyOk;     txt = text_softkey_accept; }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_sml_softkeys_force_accept
+// Query for the server initiated session acception.
+//
+// -----------------------------------------------------------------------------
+//        
+RESOURCE CBA r_sml_softkeys_force_accept__accept
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EAknSoftkeyOk;     txt = text_softkey_accept; },
+        CBA_BUTTON { txt=text_softkey_empty;},
+        CBA_BUTTON { id = EAknSoftkeyOk;     txt = text_softkey_accept; }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+//softkeys for the query to install downloaded package
+//------------------------------------------------------------------------------
+
+RESOURCE CBA r_fota_install_query_softkeys_now_later__now
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EAknSoftkeyYes; txt = text_softkey_now;   },
+        CBA_BUTTON { id = EAknSoftkeyNo;  txt = text_softkey_later; },
+        CBA_BUTTON { id = EAknSoftkeyYes; txt = text_softkey_now;   }
+        };
+    }
+    
+    
+//------------------------------------------------------------------------------
+//softkeys for the query to install downloaded package, customized for AT&T.
+//------------------------------------------------------------------------------
+
+RESOURCE CBA r_fota_install_query_softkeys_force__now
+    {
+    buttons =
+        {
+        CBA_BUTTON { id = EAknSoftkeyYes; txt = text_softkey_ok;   },
+        CBA_BUTTON { txt=text_softkey_empty;},
+        CBA_BUTTON { id = EAknSoftkeyYes; txt = text_softkey_ok;   }
+        };
+    }
+
+// =============================================================================
+// QUERIES
+//
+// -----------------------------------------------------------------------------
+//   
+// r_sml_confirmation_query
+// Query for the server initiated session acception.
+//
+// -----------------------------------------------------------------------------
+//        
+RESOURCE DIALOG r_sml_confirmation_query
+    {
+    flags   = EGeneralQueryFlags;
+    	buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
+    items   =
+        {
+        DLG_LINE
+            {
+            type    = EAknCtQuery;
+            id      = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout    = EConfirmationQueryLayout;
+                animation = R_QGN_NOTE_QUERY_ANIM;
+                };
+            }
+        };
+    }
+// -----------------------------------------------------------------------------
+//   
+// r_sml_confirmation_query
+// Query for the downloaded package installation.
+//
+// -----------------------------------------------------------------------------
+
+ RESOURCE DIALOG r_fota_install_confirmation_query
+    {
+    flags   = EGeneralQueryFlags;
+    buttons = r_fota_install_query_softkeys_now_later__now;
+    items   =
+        {
+        DLG_LINE
+            {
+            type    = EAknCtQuery;
+            id      = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout    = EConfirmationQueryLayout;
+                animation = R_QGN_NOTE_QUERY_ANIM;
+                };
+            }
+        };
+    }
+
+/*
+
+RESOURCE DIALOG r_fota_install_confirmation_query
+     {
+     flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+     buttons = r_fota_install_query_softkeys_now_later__now;
+     items   =
+         {
+                 DLG_LINE
+                     {
+                     type    = EAknCtPopupHeadingPane;
+                     id      = EAknMessageQueryHeaderId;
+                     control = AVKON_HEADING
+                         {
+                         label   = qtn_sml_server_message_heading;
+                         headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                         };
+                     },
+                     DLG_LINE
+                         {
+                         type    = EAknCtMessageQuery;
+                         id      = EAknMessageQueryContentId;
+                         control = AVKON_MESSAGE_QUERY
+                             {
+                             //layout    = EConfirmationQueryLayout;
+                             //animation = R_QGN_NOTE_QUERY_ANIM;
+                             message = "%U";
+                             };
+                         }
+         };
+     }
+     
+     */
+
+ 
+ // -----------------------------------------------------------------------------
+ //   
+ // r_sml_confirmation_query
+ // Query for forcing the downloaded package installation.
+ //
+ // -----------------------------------------------------------------------------
+
+  
+  RESOURCE DIALOG r_fota_force_install_confirmation_query
+     {
+     flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+     buttons = r_fota_install_query_softkeys_force__now;
+     items   =
+         {
+                 DLG_LINE
+                     {
+                     type    = EAknCtPopupHeadingPane;
+                     id      = EAknMessageQueryHeaderId;
+                     control = AVKON_HEADING
+                         {
+                         label   = qtn_sml_server_message_heading;
+                         headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                         };
+                     },
+                     DLG_LINE
+                         {
+                         type    = EAknCtMessageQuery;
+                         id      = EAknMessageQueryContentId;
+                         control = AVKON_MESSAGE_QUERY
+                             {
+                             //layout    = EConfirmationQueryLayout;
+                             //animation = R_QGN_NOTE_QUERY_ANIM;
+                             message = "%U";
+                             };
+                         }
+         };
+     }
+
+  
+  // -----------------------------------------------------------------------------
+   //   
+   // r_sml_confirmation_query
+   // Query for forcing the downloaded package installation.
+   //
+   // -----------------------------------------------------------------------------
+
+    
+    RESOURCE DIALOG r_fota_install_message_query
+       {
+       flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+       buttons = r_fota_install_query_softkeys_now_later__now;
+       items   =
+           {
+                   DLG_LINE
+                       {
+                       type    = EAknCtPopupHeadingPane;
+                       id      = EAknMessageQueryHeaderId;
+                       control = AVKON_HEADING
+                           {
+                           label   = qtn_sml_server_message_heading;
+                           headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                           };
+                       },
+                       DLG_LINE
+                           {
+                           type    = EAknCtMessageQuery;
+                           id      = EAknMessageQueryContentId;
+                           control = AVKON_MESSAGE_QUERY
+                               {
+                               //layout    = EConfirmationQueryLayout;
+                               //animation = R_QGN_NOTE_QUERY_ANIM;
+                               message = "%U";
+                               };
+                           }
+           };
+       }
+
+  
+  
+// -----------------------------------------------------------------------------
+//   
+// r_sml_server_msg_infonote
+// Info note for showing the information received from the server.
+//
+// -----------------------------------------------------------------------------
+//        
+RESOURCE DIALOG r_sml_server_msg_infonote
+    {
+    flags   = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items   =
+        {
+        DLG_LINE
+            {
+            type    = EAknCtPopupHeadingPane;
+            id      = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label   = qtn_sml_server_message_heading;
+                };
+            },
+        DLG_LINE
+            {
+            type    = EAknCtMultilineQuery;
+            id      = EGeneralQuery;
+            control = AVKON_MESSAGE_QUERY
+                {
+                message    = "%U";
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//   
+// r_sml_message_query
+// Query for showing the information received from the server.
+//
+// -----------------------------------------------------------------------------
+//        
+RESOURCE DIALOG r_sml_message_query
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    items =
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = qtn_sml_server_message_heading;
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                message = "%U";
+                };
+            }
+        };
+
+    }
+
+// -----------------------------------------------------------------------------
+//   
+// r_sml_fota_restart_note
+// Query for showing the information received from the server.
+//
+// -----------------------------------------------------------------------------
+//        
+RESOURCE DIALOG r_sml_fota_restart_note
+    {
+    flags   = EAknPermanentNoteFlags | EEikDialogFlagNoUserExit;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items   =
+        {
+        DLG_LINE
+            {
+            type    = EAknCtNote;
+            id      = EGeneralQuery;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// r_qtn_dm_info_note_updating  
+// Text indicating that server alert session is informative
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_dm_info_note_updating  { buf = qtn_dm_info_note_updating; }
+// r_sml_init_dm_server_prompt
+// Text for the server initiated management session acception for chinese variant
+// pop-up query.
+// -----------------------------------------------------------------------------
+RESOURCE TBUF r_qtn_dm_info_note_postsale    { buf = qtn_dm_info_note_postsale ; }
+
+//#ifdef RD_DM_TEXT_INPUT_ALERT
+// -----------------------------------------------------------------------------
+//   
+// r_inputtext_data_query
+// Data Query for Alphanumeric Text Input type
+//
+// -----------------------------------------------------------------------------
+//   
+RESOURCE DIALOG r_inputtext_data_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EDataLayout;
+                control =  EDWIN 
+               		{
+                		
+                		flags = EEikEdwinNoHorizScrolling;
+                		max_view_height_in_lines = 1;
+                		lines = 1;
+                		                		
+                	};
+                };
+            }
+        };
+    } 
+
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_date_query
+// Data Query for Date Input type.
+//
+// -----------------------------------------------------------------------------
+//   
+RESOURCE DIALOG r_newalert_date_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EDateLayout;
+                
+               	 	control =  DATE_EDITOR
+               		{
+                		minDate = DATE
+										{
+										year = 0001;
+											};
+										maxDate = DATE
+										{
+										year = 9999;
+										};
+										flags = 0;
+                		
+                		
+                	};
+                };
+            }
+        };
+    } 
+    
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_time_query
+// Data Query for Date Input type.
+//
+// -----------------------------------------------------------------------------
+//   
+    RESOURCE DIALOG r_newalert_time_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = ETimeLayout;
+                
+               	 	control =  TIME_EDITOR
+               		{
+                		
+                		minTime = TIME
+						{
+						second = 0;
+						minute = 0;
+						hour = 0;
+						};
+						maxTime = TIME
+						{
+						second = 59;
+						minute = 59;
+						hour = 23;
+						};
+					flags = EEikTimeForce24HourFormat/*|EEikTimeWithoutSecondsField*/; //remove this flag to get seconds
+					
+                		
+                	};
+                };
+            }
+        };
+    } 
+    
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_data_pwd_query
+// Data Query for Alphanumeric Password Input type.
+//
+// -----------------------------------------------------------------------------
+//      
+RESOURCE DIALOG r_newalert_data_pwd_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                
+                layout = ECodeLayout;
+                 control = SECRETED
+               		{
+                		num_letters = 200;
+                		                		
+                	};
+                };
+            }
+        };
+    } 
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_numeric_pwd_query
+// Data Query for Numeric Password Input type.
+//
+// -----------------------------------------------------------------------------
+//   
+ RESOURCE DIALOG r_newalert_numeric_pwd_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                
+                layout = EPinLayout;
+                 control = SECRETED
+               		{
+                		num_letters = 20;
+                		                		
+                	};
+                };
+            }
+        };
+    } 
+ 
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_phone_query
+// Data Query for Phone number Input type.
+//
+// -----------------------------------------------------------------------------
+//   
+ RESOURCE DIALOG r_newalert_phone_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY 
+                { 
+                layout = EPhoneLayout;
+               	 control = EDWIN
+               		{
+                		
+                		flags = EEikEdwinNoHorizScrolling;
+                		lines = 1;
+                		maxlength = 200;
+                		allowed_input_modes =  EAknEditorNumericInputMode; 
+                		max_view_height_in_lines = 1;
+                		
+                	};
+                };
+            }
+        };
+    }    
+    
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_number_query
+// Data Query for Number Text Input type.
+//
+// -----------------------------------------------------------------------------
+//       
+RESOURCE DIALOG r_newalert_number_query
+{
+	flags = EGeneralQueryFlags;
+	buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+	items =
+		{
+		DLG_LINE
+		{
+		type = EAknCtQuery;
+		id = EGeneralQuery;
+		control = AVKON_DATA_QUERY
+			{
+			layout = EFloatingPointLayout;
+			control = FLPTED
+				{
+				maxlength = 12;				
+				default = 0;
+				};
+			};
+		}
+		};
+}
+
+// -----------------------------------------------------------------------------
+//   
+// r_newalert_ip_query
+// Data Query for Ip Address Input type.
+//
+// -----------------------------------------------------------------------------
+//   
+RESOURCE DIALOG r_newalert_ip_query 
+{
+	flags = EGeneralQueryFlags; 
+	buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; 
+		items = 
+		{
+		DLG_LINE 
+			{
+			type = EAknExtCtQuery; 
+			id = EGeneralQuery; 
+			control = AVKON_DATA_QUERY 
+				{
+				layout = EIpLayout; 
+				control = IP_FIELD_EDITOR 
+					{
+						min_field_values=IP_FIELD
+						{
+						first_field=0;
+						second_field=0;
+						third_field=0;
+						fourth_field=0;
+						};
+						max_field_values=IP_FIELD
+						{
+						first_field=255;
+						second_field=255;
+						third_field=255;
+						fourth_field=255;
+						}; 
+					}; 
+				} ;
+			}
+		};
+}
+
+//#endif
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/eabi/SyncMLNotifieru.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,7 @@
+EXPORTS
+	_Z13NotifierArrayv @ 1 NONAME
+	_ZTI23CPreSyncPluginInterface @ 2 NONAME ; #<TI>#
+	_ZTV23CPreSyncPluginInterface @ 3 NONAME ; #<VT>#
+	_ZTI17CSyncmlmmcwatcher @ 4 NONAME ; #<TI>#
+	_ZTV17CSyncmlmmcwatcher @ 5 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/ecom/101F876A.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* 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 file specifies the interface and implementation information
+*                 for SyncMLNotifier Ecom Plugins.
+*
+*/
+
+
+//  INCLUDES
+#include <registryinfo.rh>
+#include <uikon.hrh>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <uiklaf/private/pluginuid.hrh>
+#endif
+
+
+//  RESOURCE DEFINITIONS 
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x101F876A;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KUikonUidPluginInterfaceNotifiers;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F876A;
+                    version_no = 1;
+                    display_name = "TTNOTIFY2V2 Plugin 1";
+                    default_data = "TTNOTIFY2V2";
+                    opaque_data	 = "0";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/ecom/SyncMLNotifierWrapper.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* 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:  Methods for SyncML notifier Ecom Plugins entry point
+*
+*/
+
+
+// INCLUDE FILES
+#include <implementationproxy.h>
+#include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
+
+#include "SyncMLNotifierBase.h"
+#include "SyncMLNotifDebug.h"
+
+
+// CONSTANTS
+const TInt KMaxSynchReplyBufLength = 256;
+
+const TInt KSmlNAppLaunchPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh;
+const TInt KSmlNDlgPriority       = MEikSrvNotifierBase2::ENotifierPriorityHigh;
+const TInt KSmlNFwUpdPriority     = MEikSrvNotifierBase2::ENotifierPriorityHigh;
+
+#ifdef __SERIES60_30__
+    const TUid KSmlNAppServerUid = { 0x102072bf }; 
+#else // __SERIES60_30__
+    _LIT( KSmlSyncMLNotifierDll, "syncmlnotifier.dll" );
+#endif // __SERIES60_30__
+
+
+// Provides pointer to the notifier creation function.
+const TImplementationProxy ImplementationTable[] =
+	{
+#ifdef __EABI__
+	{{0x101F876A},(TFuncPtr)NotifierArray}
+#else
+	{{0x101F876A},NotifierArray}
+#endif
+	};
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CleanupArray
+// Deletes notifiers
+// -----------------------------------------------------------------------------
+void CleanupArray( TAny* aArray )
+    {
+    FLOG(_L("[SmlNotif]\t CleanupArray()"));
+    
+    CArrayPtrFlat<MEikSrvNotifierBase2>*     
+        subjects = static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray);
+    TInt lastInd = subjects->Count() - 1;
+    for ( TInt i = lastInd; i >= 0; i-- )
+        {
+        subjects->At(i)->Release();	    	    
+        }
+    delete subjects;
+    
+    FLOG(_L("[SmlNotif]\t CleanupArray() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// DoCreateNotifierArrayL
+// -----------------------------------------------------------------------------
+CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
+    {
+    FLOG(_L("[SmlNotif]\t DoCreateNotifierArrayL()"));
+    CArrayPtrFlat<MEikSrvNotifierBase2>* subjects =
+        new ( ELeave ) CArrayPtrFlat<MEikSrvNotifierBase2>( KSmlNotifierArrayIncrement );
+    
+    CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) );
+
+    // Create Wrappers
+
+    // Session owning notifier
+#ifdef __SERIES60_30__
+
+
+    CAknNotifierWrapper* master = 
+        CAknNotifierWrapper::NewL( KSyncMLAppLaunchNotifierUid,
+                                   KSmlAppLaunchChannel,
+                                   KSmlNAppLaunchPriority,
+                                   KSmlNAppServerUid,
+                                   KMaxSynchReplyBufLength);
+
+#else // __SERIES60_30__
+
+    CAknCommonNotifierWrapper* master = 
+        CAknCommonNotifierWrapper::NewL( KSyncMLAppLaunchNotifierUid,
+                                         KSmlAppLaunchChannel,
+                                         KSmlNAppLaunchPriority,
+                                         KSmlSyncMLNotifierDll(),
+                                         KMaxSynchReplyBufLength);
+
+#endif // __SERIES60_30__
+		
+    subjects->AppendL( master );
+    
+   // Notifiers using masters session 
+    subjects->AppendL(new (ELeave) CAknNotifierWrapperLight(*master, 
+                                                            KSyncMLDlgNotifierUid,
+                                   			 				KSmlDlgChannel,
+                                   			 				KSmlNDlgPriority));
+                                   			 				
+   // Notifiers using masters session 
+    subjects->AppendL(new (ELeave) CAknNotifierWrapperLight(*master, 
+                                                            KSyncMLFwUpdNotifierUid,
+                                   			 				KSmlFwUpdChannel,
+                                   			 				KSmlNFwUpdPriority));
+                                   			 				
+    CleanupStack::Pop();	// array cleanup
+    FLOG(_L("[SmlNotif]\t DoCreateNotifierArrayL() completed"));
+    return( subjects );
+    }
+
+
+// -----------------------------------------------------------------------------
+// NotifierArray
+// Lib main entry point: Creates a notifiers array.
+// -----------------------------------------------------------------------------
+CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+    {
+    FLOG(_L("[SmlNotif]\t NotifierArray()"));
+    CArrayPtr<MEikSrvNotifierBase2>* array = 0;
+    TRAPD( ignore, array = DoCreateNotifierArrayL() );
+    if (ignore != KErrNone) 
+    	{
+    	ignore = KErrNone;
+    	}
+    FLOG(_L("[SmlNotif]\t NotifierArray() completed"));
+    return array;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// DLL entry point
+// -----------------------------------------------------------------------------
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+	{
+	FLOG(_L("[SmlNotif]\t ImplementationGroupProxy()"));
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+	FTRACE( FPrint(
+	    _L("[SmlNotif]\t ImplementationGroupProxy completed, Table count = %d"),
+	    aTableCount ) );
+	return ImplementationTable;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/ecom/SyncMLNotifierWrapper.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* 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 project specification file for the SyncMLNotifier
+*                 Ecom Plugins.
+*
+*/
+
+#include  <platform_paths.hrh>
+
+TARGET          syncmlnotifierwrapper.dll
+CAPABILITY      CAP_ECOM_PLUGIN
+TARGETTYPE      PLUGIN 
+
+VENDORID        VID_DEFAULT
+
+UID             0x10009D8D 0x101F876A
+
+SOURCEPATH      .
+USERINCLUDE     .
+USERINCLUDE     ../inc
+
+// Default system include paths for app layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+
+SOURCE          SyncMLNotifierWrapper.cpp 
+
+START RESOURCE  101F876A.rss 
+    TARGET syncmlnotifierwrapper.rsc
+    LANGUAGE_IDS
+END
+
+LIBRARY         ecom.lib
+LIBRARY         aknnotifierwrapper.lib
+LIBRARY         euser.lib
+
+DEBUGLIBRARY    flogger.lib
+SMPSAFE
Binary file syncmlfw/syncmlnotifier/group/101F8769.txt has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/group/SyncMLNotifier.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* 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:  Notifier framework for SyncML DS and DM engine
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include  <platform_paths.hrh>
+
+TARGET          syncmlnotifier.dll
+TARGETTYPE      DLL
+UID             0x101fdfae 0x101F8769
+
+TARGETPATH      /system/libs
+
+VENDORID        VID_DEFAULT
+CAPABILITY		CAP_GENERAL_DLL
+
+SOURCEPATH      ../src
+SOURCE          SyncMLNotifierMain.cpp
+SOURCE          SyncMLNotifierBase.cpp
+SOURCE          SyncMLAppLaunchNotifier.cpp
+SOURCE          SyncMLDlgNotifier.cpp
+SOURCE          SyncMLFwUpdNotifier.cpp
+SOURCE          SyncMLTimedMessageQuery.cpp
+SOURCE          SyncMLTimedQueryDialog.cpp
+SOURCE          SyncMLQueryTimer.cpp
+SOURCE          SyncMLQueryDialog.cpp
+SOURCE			SyncMLMessageQueryDialog.cpp SyncMLPreSyncPluginInterface.cpp
+SOURCE          SyncMLTimedDateQuery.cpp
+SOURCE          SyncMLTimedInputTextQuery.cpp
+SOURCE          SyncMLTimedNumberQueryDialog.cpp SyncMLAknPopUpList.cpp syncmlmmcwatcher.cpp
+
+START RESOURCE ../data/SyncMLNotifier.rss
+    HEADER
+    TARGETPATH  RESOURCE_FILES_DIR
+    LANGUAGE_IDS
+END 
+
+USERINCLUDE     ../inc
+
+// Default system include paths for app layer modules.
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/uikon
+
+LIBRARY euser.lib cone.lib                  // Symbian OS framework libraries
+LIBRARY avkon.lib                           // UI library
+LIBRARY bafl.lib                            // Basic Application Framework Library
+LIBRARY commonengine.lib                    // Series 60 common components library
+LIBRARY charconv.lib                        // Character conversion library
+LIBRARY eikcoctl.lib eiksrv.lib             // Eikon libraries
+LIBRARY eikdlg.lib                          // Eikon libraries
+LIBRARY eikcore.lib                         // Library for eikonEnv static functions (BringForwards)
+LIBRARY eiksrvui.lib                        // Eikon server ui (for suppressing app -key)
+LIBRARY esock.lib                           // Sockects library for host resolver
+LIBRARY aknskins.lib                        // Skinned icons
+LIBRARY syncservice.lib
+LIBRARY syncmlclientapi.lib
+LIBRARY aknnotifierwrapper.lib
+LIBRARY centralrepository.lib               // Central Repository
+LIBRARY connmon.lib
+LIBRARY ecom.lib estor.lib  eikctl.lib egul.lib aknicon.lib aknskinsrv.lib efsrv.lib
+LIBRARY disknotifyhandler.lib 
+
+//#ifdef RD_DM_TEXT_INPUT_ALERT
+LIBRARY insock.lib  //For IP address dialog
+//#endif
+DEBUGLIBRARY flogger.lib                    // File logging services
+
+
+SMPSAFE
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* 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 file provides building information for SyncMLNotifier.
+*
+*/
+
+
+#include <platform_paths.hrh>
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+// Generic configuration interface for component cenrep settings 
+../conf/syncmlnotifier.confml                       MW_LAYER_CONFML(syncmlnotifier.confml)
+../conf/syncmlnotifier_101F8769.crml 	        	MW_LAYER_CRML(syncmlnotifier_101F8769.crml)
+
+../rom/SyncMLNotifier.iby							CORE_MW_LAYER_IBY_EXPORT_PATH(SyncMLNotifier.iby)
+../rom/SyncMLNotifierResources.iby		LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(SyncMLNotifierResources.iby)
+../loc/SyncMLNotifier.loc							MW_LAYER_LOC_EXPORT_PATH(syncmlnotifier.loc)
+../loc/SyncMLNotifierFota.loc					MW_LAYER_LOC_EXPORT_PATH(syncmlnotifierfota.loc)
+
+PRJ_MMPFILES
+../group/SyncMLNotifier.mmp
+
+#ifdef __SERIES60_30__
+../appserver/SyncMLNotifierAppserver.mmp
+#endif // __SERIES60_30__
+
+../ecom/SyncMLNotifierWrapper.mmp
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
+
+//  End of File  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLAknPopUplist.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Synchronisation server alert notifier.
+*
+*/
+
+#ifndef CSYNCMLAKNPOPUPLIST_H
+#define CSYNCMLAKNPOPUPLIST_H
+
+//  INCLUDES
+#include <aknPopup.h>   // CAknPopupList
+#include <aknlists.h>
+#include <SyncMLNotifierParams.h>
+#include "SyncMLQueryTimer.h"
+#include "syncmlmmcwatcher.h"
+#include "SyncMLNotifDebug.h"
+// CONSTANTS
+const TInt  KSyncMLNNoListTimeout  = 0; // The query does not time out
+
+// CLASS DECLARATION
+
+/**
+*  List query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 5.2
+*/
+NONSHARABLE_CLASS ( CSyncMLAknPopUpList ) : public CAknPopupList,
+                                                 public MSyncMLQueryTimerObserver,
+                                                 public MSyncMLQueryMmcObserver
+    {
+    public:  
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLAknPopUpList* NewL(CAknSingleHeadingPopupMenuStyleListBox* listBox,
+                TInt aResId,AknPopupLayouts::TAknPopupLayouts aPopuplayout,
+                TInt   aTimeout = KSyncMLNNoListTimeout);		           
+        
+        /**
+         * Constructor.
+         */
+        CSyncMLAknPopUpList(TInt aTimeout = KSyncMLNNoListTimeout);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLAknPopUpList();
+        
+        /**
+         * From CEikDialog.
+         *
+         * Loads, displays, and destroys the dialog.
+         */
+        TBool ExecuteLD();
+
+    public: // Functions from base classes
+
+        /**
+        * From MSyncMLQueryTimerObserver Is called when the timer
+        * runs out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void TimerExpired();
+        
+        /**
+         * From MSyncMLQueryMmcObserver is called when mmc removed
+         * @since Series 60 5.2
+         * @param None
+         * @return None 
+         */
+        void MmcRemoved();
+        
+        /**
+         * returns the status of mmc removal
+         * @since Series 60 5.2
+         * @param None
+         * @return ETrue/EFalse
+         */
+		TBool IsMmcRemoved();
+        
+    protected:                               
+        /**
+         * Constructs a pop up list box 
+         * @since Series 60 5.2
+         * @param aListBox, reference to CAknSingleHeadingPopupMenuStyleListBox
+         * @param aCbaResource, resource id of CBA
+         * @param aType, popup layout of the list
+         * @return None
+         */
+        void ConstructL(CAknSingleHeadingPopupMenuStyleListBox* aListBox, 
+                                     TInt aCbaResource,
+                                     AknPopupLayouts::TAknPopupLayouts aType );
+        
+    private:    
+        // Number of seconds before the query is timed out. 0 = no timeout.
+        TInt               iTimeout;
+        
+        //Current state of MMC removal
+        TBool immcremoved;
+        
+        // Pointer to the timer instance
+        CSyncMLQueryTimer*  iTimer;
+        
+        //Pointer to MMC watcher
+        CSyncmlmmcwatcher*  iMmcwatcher;       
+    };
+
+#endif      // CSYNCMLTIMEDMESSAGEQUERY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLAppLaunchNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,252 @@
+/*
+* 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:  Server alerts for Data Sync and Device Management engines. 
+*                
+*
+*/
+
+
+
+#ifndef CSYNCMLAPPLAUNCHNOTIFIER_H
+#define CSYNCMLAPPLAUNCHNOTIFIER_H
+
+//  INCLUDES
+#include <SyncMLClient.h>
+
+#include <SyncMLNotifierParams.h>
+#include "SyncMLNotifierBase.h"    // Base class
+#include <SyncService.h>
+#include <centralrepository.h>
+#include <e32property.h>
+// CONSTANTS
+// From S60\SyncMLFota
+const TUid KUidNSmlMediumTypeInternet = { 0x101F99F0 };
+_LIT8( KNSmlIAPId, "NSmlIapId" );
+_LIT8( KNSmlAlwaysAsk, "-1" );
+const TInt  KDefaultTimeoutforNotes ( 30 );
+const TUid KDisclaimerProperty = {0x101F8769};
+const TUint32 KDisclaimerInteger = 0x00000001;
+    
+const TUid KCRUidNSmlDSApp       = { 0x101F9A1D };
+// CLASS DECLARATION
+
+class CDMDisclaimerObserver;
+/**
+*  Notifier for launching SyncML applications
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS( CSyncMLAppLaunchNotifier ) : public CSyncMLNotifierBase
+    {
+    public:  // Constructors and destructor
+        enum TSanSupport
+        {
+        	EOff,EON
+        };
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLAppLaunchNotifier* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLAppLaunchNotifier();
+        
+    public:
+        /**
+        * Returns correct SyncService depending on the Service Id
+        * @param aServiceId
+        * @return CSyncService* 
+        */
+        CSyncService* SyncServiceL( TUint aServiceId );
+        
+        /**
+        * Called to complete the message
+        * @param aDisclaimerAccepted 
+        */        
+        void CompleteMessageL(TInt aDisclaimerAccepted);
+
+    private: // New functions
+
+        /**
+        * Retrieves required parameters for the note and launching of the
+        * synchronization application.
+        * @param aParam Parameter structure that is forwarded to syncservice
+        * @param aServerName Returns the clear-text name of the corresponding server.
+        * @param aUserInteraction Returns the profile setting of whether the user
+        *                         acceptance should be queried.
+        * @return None
+        */
+        void RetrieveSyncParamsL( TSyncServiceParam& aParam,
+                                  TDes& aServerName,
+                                  TSmlServerAlertedAction& aUserInteraction );
+
+        /**
+        * Retrieves required parameters for the note and launching of the
+        * device management application.
+        * @param aParam Parameter structure that is forwarded to syncservice
+        * @param aServerName Returns the clear-text name of the corresponding server.
+        * @param aUserInteraction Returns the profile setting of whether the user
+        *                         acceptance should be queried.
+        * @return None
+        */
+        void RetrieveMgmtParamsL( TSyncServiceParam& aParam,
+                                  TDes& aServerName,
+                                  TSmlServerAlertedAction& aUserInteraction );
+
+        /**
+        * Checks if the user and/or parameters have defined that the session
+        * should be accepted without querying the user.
+        * @param aUserInteraction Sync profile interaction enumeration.
+        * @return True, if the session is accepted automatically.
+        */
+        TBool IsSilent( TSmlServerAlertedAction& aUserInteraction );
+
+    private: // Functions from base classes
+
+        /**
+        * From CSyncMLNotifierBase Called when a notifier is first loaded.        
+        * @param None.
+        * @return A structure containing priority and channel info.
+        */
+        TNotifierInfo RegisterL();
+
+        /**
+        * From CSyncMLNotifierBase The notifier has been deactivated 
+        * so resources can be freed and outstanding messages completed.
+        * @param None.
+        * @return None.
+        */
+        void Cancel();
+
+        /**
+        * From CSyncMLNotifierBase Used in asynchronous notifier launch to 
+        * store received parameters into members variables and 
+        * make needed initializations.
+        * @param aBuffer A buffer containing received parameters
+        * @param aReturnVal The return value to be passed back.
+        * @param aMessage Should be completed when the notifier is deactivated.
+        * @return None.
+        */
+        void GetParamsL( const TDesC8& aBuffer,
+                               TInt aReplySlot,
+                         const RMessagePtr2& aMessage );
+
+        /**
+        * From CSyncMLNotifierBase Gets called when a request completes.
+        * @param None.
+        * @return None.
+        */
+        void RunL();        
+        /**
+        * From CSyncMLNotifierBase Gets called when RunL leaves.
+        * @param aError.
+        * @return TInt.
+        */
+        TInt RunError(TInt aError);
+        /**
+        * From RConnectionMonitor gets the staus of roaming .
+        * If roaming returns true else returns false
+        * @param ret
+        * @return None.
+        */
+        void IsRoamingL(TBool& ret);
+        /**
+        * HandleDMSession
+        * @param ret
+        * @return TBool 
+        */
+				TBool HandleDMSessionL();
+				/**
+        * HandleCompleteMessage
+        * @param TInt &keypress, TBool &silent, TInt &SanSupport, TInt &Timeout, TInt &CustomNotes
+        * @return None.
+        */
+				void HandleCompleteMessageL(TInt &keypress, TBool &silent, TInt &SanSupport, TInt &Timeout, TInt &CustomNotes);
+				/**
+        * IsLanguageSupported
+        * @param ret
+        * @return True if the language is supported.
+        */
+				TBool IsLanguageSupportedL();
+        
+        void ReadRepositoryL(TInt aKey, TInt& aValue);
+        
+        void ShowRoamingMessageL(TInt keypress, TUint profileId);
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLAppLaunchNotifier();
+
+    private: // Data
+        // Type of session queried
+        TSyncMLSessionTypes iSmlProtocol;
+        CDMDisclaimerObserver* iObserver;
+        
+        // Job identifier from the parameters
+        TInt                iJobId;
+        
+        // Identifier of the used SyncML profile from the parameters
+        TInt                iProfileId;
+        
+        // Sync Service for Data Sync
+        CSyncService*       iDSSyncService;
+        // Sync Service for Device Management
+        CSyncService*       iDMSyncService;
+        // Is always ask selected as accesspoint for current profile
+        TBool               iAlwaysAsk;
+       // Alert mode
+        TInt iUimode;        
+        // DM Sync Server        
+        TBuf<KSyncMLMaxProfileNameLength> DMSyncServerName;
+        // UI behaviour 
+    		TSmlServerAlertedAction uiAction;
+    		// Sync Service param 
+   			TSyncServiceParam param;
+   			// Stringholder
+    		HBufC* stringholder;  
+    		// Central Respository   
+    		CRepository* centrep; 
+        // To store the bearer type
+        TInt iBearerType;
+    };
+
+/**
+* CDMDisclaimerObserver class
+* 
+*/
+class CDMDisclaimerObserver : public CActive
+    {
+    public:
+        CDMDisclaimerObserver();
+        ~CDMDisclaimerObserver();
+        void WaitOnDisclaimerL(CSyncMLAppLaunchNotifier* aPtr);
+    protected:
+        void DoCancel();
+        void RunL();
+        TInt RunError(TInt aError);
+    private:
+        TInt iPropertyVal;
+        RProperty iDisclaimerProperty;
+        CSyncMLAppLaunchNotifier* iNot;    
+    };
+
+#endif      // CSYNCMLAPPLAUNCHNOTIFIER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLDlgNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,182 @@
+/*
+* 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:  Synchronisation server alert notifier.
+*
+*/
+
+
+
+#ifndef CSYNCMLDLGNOTIFIER_H
+#define CSYNCMLDLGNOTIFIER_H
+
+//  INCLUDES
+#include <SyncMLNotifierParams.h>
+#include "SyncMLNotifierBase.h"    // Base class
+#include <aknselectionlist.h> 
+#include <aknlists.h>
+#include <AknIconArray.h> 
+// FORWARD DECLARATIONS
+class CSyncMLAppLaunchNotifier;
+
+// CLASS DECLARATION
+
+/**
+*  Notifier for information received from synchronisation server.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS( CSyncMLDlgNotifier ) : public CSyncMLNotifierBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLDlgNotifier* NewL(
+            CSyncMLAppLaunchNotifier* aAppLaunchNotif );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLDlgNotifier();
+
+    protected:  // New functions
+        
+        /**
+        * Tries to enable or disable the sync progress notes.
+        * @since Series 60 3.0
+        * @param aEnable Should the progress notes be enabled.
+        * @return None
+        */
+        void EnableSyncProgressNoteL( TBool aEnable );
+
+    private: // Functions from base classes
+
+        /**
+        * From CSyncMLNotifierBase Called when a notifier is first loaded.        
+        * @param None.
+        * @return A structure containing priority and channel info.
+        */
+        TNotifierInfo   RegisterL();
+
+        /**
+        * From CSyncMLNotifierBase Used in asynchronous notifier launch to 
+        * store received parameters into members variables and 
+        * make needed initializations.
+        * @param aBuffer A buffer containing received parameters
+        * @param aReturnVal The return value to be passed back.
+        * @param aMessage Should be completed when the notifier is deactivated.
+        * @return None.
+        */
+        void GetParamsL( const TDesC8&       aBuffer,
+                               TInt          aReplySlot,
+                         const RMessagePtr2& aMessage );
+
+        /**
+        * From CSyncMLNotifierBase The notifier has been deactivated 
+        * so resources can be freed and outstanding messages completed.
+        * @param None.
+        * @return None.
+        */
+        void Cancel();
+
+        /**
+        * From CSyncMLNotifierBase Gets called when a request completes.
+        * @param None.
+        * @return None.
+        */
+        void RunL();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLDlgNotifier( CSyncMLAppLaunchNotifier* aAppLaunchNotif );
+        /**
+        * Action for the Alphanumeric input.
+        * @param result.
+        * @return None.
+        */
+				void InputTypeAlphaNumericL(TInt & result);
+				/**
+        * Action for the Numeric input.
+        * @param result.
+        * @return None.
+        */
+				void InputTypeNumericL(TInt & result);
+				/**
+        * Action for the Date input.
+        * @param result.
+        * @return None.
+        */
+				void InputTypeDateL(TInt & result);
+				/**
+        * Action for the Time input.
+        * @param result.
+        * @return None.
+        */
+				void InputTypeTimeL(TInt & result);
+				/**
+        * Action for the Phone number input.
+        * @param result.
+        * @return None.
+        */
+				void InputTypePhoneNumberL(TInt & result);
+				
+        /**
+         * Set icons on markable list
+         * @param aListBox, pointer to listbox.
+         * @return None.
+         */
+        void SetIconsL(CEikFormattedCellListBox* aListBox);
+		
+    private: // Data
+        // The type of the note requested.
+        TSyncMLDlgNoteTypes             iNoteType;
+        
+        // Server message from the parameters
+        TBuf<KSyncMLMaxServerMsgLength> iServerMsg;
+        
+        // Maximum time the query is shown. (In seconds)
+        TInt                            iMaxTime;
+        //Maximum length of the server message
+        TInt iMaxlen;
+		//Default response of the alert
+        TBuf<KSyncMLMaxDefaultResponseMsgLength> iDR;
+        //Input type of user input alert
+        TInt iIT;
+		//Echo type of user input alert
+        TInt iET;
+        //Number of choice items in user choice alerts
+        TInt iNumberOfItems;
+        // Pointer to the application launcher notifier instance.
+        CSyncMLAppLaunchNotifier*       iAppLaunchNotif;
+		//array of user choice alert items
+        CDesCArrayFlat* iListItems;
+		//Default selection item in user choice alerts
+        TInt iDefindex;
+		//reply buffer
+        TSyncMLDlgNotifReturnParams reply;
+		//Member variable to identify end key press
+        TBool EndKeyPress;
+		//Chunk to retrieve the user choice alert items
+        RChunk iChunk;
+    };
+
+
+#endif      // CSYNCMLDLGNOTIFIER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLFwUpdNotifier.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,267 @@
+/*
+* 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:  Synchronisation server alert and application launcher notifier.
+*
+*/
+
+
+
+#ifndef CSYNCMLFWUPDNOTIFIER_H
+#define CSYNCMLFWUPDNOTIFIER_H
+
+//  INCLUDES
+#include <SyncMLNotifierParams.h>
+#include "SyncMLNotifierBase.h"    // Base class
+#include "SyncMLMessageQueryDialog.h"
+#include <SyncService.h>
+
+// CONSTANTS
+// Taken from S60\OmaDSAppUi\inc\NSmlDMSyncPrivateCRKeys.h
+const TUid KCRUidNSmlDMSyncApp = {0x101f6de5};
+const TUint32 KNSmlDMFotaConfigurationKey = 0x00000001;
+const TUint KNSmlDMFotaEnableFotaViewFlag = 0x0004;
+
+//Constants required to indicate key presses in dialogs
+enum 
+	{
+    ESyncMLDlgRespKeyNone = -3,
+    ESyncMLDlgRespKeyOk = -2,
+    ESyncMLDlgRespKeyOthers = -1,
+    ESyncMLDlgRespKeyCancel = 0
+    };
+
+
+//Constants used when update happen NSC/DM 
+enum {
+		EFotaUpdateNSC=1,
+		EFotaUpdateNSCBg,
+		EFotaUpdateDM
+};
+
+// CLASS DECLARATION
+/**
+*  Notifier for showing the rsult of the firmware
+*  update to the user.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.1
+*/
+NONSHARABLE_CLASS( CSyncMLFwUpdNotifier ) : public CSyncMLNotifierBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLFwUpdNotifier* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLFwUpdNotifier();
+
+    private: // New functions
+
+        /**
+        * Shows a note describing the error situation that has been encountered
+        * when checking the prerequisites for firmware update.
+        * @param None
+        * @return Result to the query
+        */
+        TInt ShowUpdateErrorNoteL();
+
+        /**
+        * Shows a note describing the result of firmware update.
+        * @param None
+        * @return Result to the query
+        */
+        TInt ShowUpdateResultNoteL();
+
+        /**
+        * Informs the user about the firmware update and its consequences.
+        * Queries if the user wants to continue with the update.
+        * @param None
+        * @return Result to the query
+        */
+        TInt ShowUpdateStartQueryL();
+		
+        /**
+        * Informs the user about the firmware update while encrypted phone memory.
+        * Queries if the user wants to continue with the update.
+        * @param None
+        * @return Result to the query
+        */
+        TInt ShowUpdateStartQueryEncryptionL();
+        
+        /**
+        * Shows a note describing the result of firmware update. Also queries
+        * user to encrypt memory 
+        * @param None
+        * @return Result to the query
+        */
+        TInt ShowUpdateResultWithEncryptionNoteL();
+		
+		
+		/**
+        * Informs the user about the firmware update and its consequences.
+        * Queries if the user wants to continue with the update.
+        * It also makes sure that the number of postpones the user does
+        * does not exceed the maximum allowed postpones.
+        * @param queryType - Which tells the type of query to be shown.
+        * @return Result to the query
+        */
+        TInt ShowPostLimitUpdateStartQueryL(TInt queryType);
+
+        /**
+        * Retrieves the profile name using the profile identifier stored
+        * in iNoteInfo.
+        * @param aServerName Returns the clear-text name of the corresponding server.
+        * @return None
+        */
+        void RetrieveProfileNameL( TDes& aServerName );
+        /*Information note shown  to the user after selecting No reminder case in
+	    * the reminder dialog. This note informs the user that downloaded package 
+ 	    * can be installed manually. 
+ 	    */
+
+        TInt ShowNoReminderQueryL();
+        
+        /*Message query note shown  to the user when ever there is no enough memory
+        * space to download the update package
+ 	    */
+        TInt ShowNotEnoughMemoryL( TInt &aMemoryNeeded ,TBool aOmaDL );
+
+				/*Message query note shown to the user when ever the user cancels the download
+				 * and whether the user wants to resume the download at a later point of time. 
+				 * @param None
+         * @return Result to the query
+ 	       */
+				TInt ShowDownloadUserCancelL();
+		
+				/*Message note shown to the user when ever 
+				 * the user postponds the download 
+		     * @param None
+         * @return Result to the query
+ 	       */
+				TInt ShowDownloadPostponedL();
+		
+				/*Message note shown to the user when ever 
+				 * the user cancels the download 
+		     * @param None
+         * @return Result to the query
+ 	       */
+				TInt ShowDownloadCancelledL();
+		
+				/*Message note shown to the user when ever 
+				 * the user postpones the update 
+				 * @param None
+				 * @return Result to the query
+				 */
+				TInt ShowPostponeLimitNoteL();
+
+				/*Message note shown to the user when ever 
+				 * the user wants to resume the download.
+		     * @param None
+         * @return Result to the query
+ 	       */
+				TInt ShowDownloadResumeL();
+    private: // Functions from base classes
+
+        /**
+        * From CSyncMLNotifierBase Called when a notifier is first loaded.        
+        * @param None.
+        * @return A structure containing priority and channel info.
+        */
+        TNotifierInfo RegisterL();
+
+        /**
+        * From CSyncMLNotifierBase The notifier has been deactivated 
+        * so resources can be freed and outstanding messages completed.
+        * @param None.
+        * @return None.
+        */
+        void Cancel();
+
+        /**
+        * From CSyncMLNotifierBase Gets called when a request completes.
+        * @param None.
+        * @return None.
+        */
+        void RunL();
+
+        /**
+        * From CSyncMLNotifierBase Used in asynchronous notifier launch to 
+        * store received parameters into members variables and 
+        * make needed initializations.
+        * @param aBuffer A buffer containing received parameters
+        * @param aReturnVal The return value to be passed back.
+        * @param aMessage Should be completed when the notifier is deactivated.
+        * @return None.
+        */
+        void GetParamsL( const TDesC8&       aBuffer,
+                               TInt          aReplySlot,
+                         const RMessagePtr2& aMessage );
+        /**
+        * IsLanguageSupported
+        * @param ret
+        * @return True if the language is supported.
+        */                 
+				TBool IsLanguageSupportedL();
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLFwUpdNotifier();
+
+    private: // Data
+        // Type of note to be shown
+        TSyncMLFwUpdNoteTypes   iNoteType;
+        
+        // Possible additional information required by the note
+        TInt                    iNoteInfo;
+        
+        //Memory needed for the for the fota update package to be downloaded
+//        #ifdef RD_FOTA_FLEXIBLE_MEMORY_USAGE
+        TInt        iFotaMemoryNeeded;
+//        #endif
+        // The Number of times user has postponed the update.
+        TInt iUserPostponeCount;
+        
+        // The Maximum number of times update can be postponed.
+        TInt iMaxPostponeCount;
+        
+        // The option Selected by the user to postpone the update.
+        TBuf<KSyncMLMaxServerMsgLength>    iSelectedReminder;
+        //Checks whether dialog from RUNL popped and waiting for user input
+        TBool iRunLhang;
+        
+        //Reference to the Dialog launched from RunL
+        CSyncMLMessageQueryDialog* iDlg;
+        
+		//To decide on encryption note or default note.
+        TBool iFotaEncryptReq;
+        
+      // The time interval chosen by the user to postpone the update.
+      TInt iInterval;
+      
+      // The time interval type(in hours or minutes)chosen by the user to postpone the update.
+      TIntervalType iIntervalType;
+
+    };
+
+
+#endif      // CSYNCMLFWUPDNOTIFIER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLMessageQueryDialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* 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:  Message Query Dialog
+*
+*/
+
+
+
+#ifndef CSYNCMLMESSAGEQUERYDIALOG_H
+#define CSYNCMLMESSAGEQUERYDIALOG_H
+
+//  INCLUDES
+#include <aknmessagequerydialog.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  Message query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS ( CSyncMLMessageQueryDialog ) : public CAknMessageQueryDialog
+                                                 
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLMessageQueryDialog* NewL(TBool& aKeyPress);        
+                  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLMessageQueryDialog();
+
+    public: // Functions from base classes
+		/**
+        * Calls the exit of the Dialog launched
+        * @param None.
+        * @return None.
+        */
+        void ExitL();
+        
+    protected:  // Functions from base classes
+        
+
+        /**
+        * From CEikDialog: Determines if the dialog can be closed.
+        * @param aButtonId Identifier of the button pressed.
+        * @return whether to close the dialog or not.
+        */
+        TBool OkToExitL( TInt aButtonId );
+
+        /**
+        * Called by OfferkeyEventL(), gives a change to dismiss the query even with
+        * keys different than Enter of Ok.
+        * @param aKeyEvent has the key event details
+        * @return whether to dismiss the dialog or not.
+        */
+        TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+        
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLMessageQueryDialog(TBool& aKeyPress  );
+
+
+    private:    // Data
+        
+         TBool& iKeyPress;
+    };
+
+#endif      // CSYNCMLMESSAGEQUERYDIALOG_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLNotifDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* 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 file defines logging macros for SyncML notifiers
+*
+*/
+
+
+#ifndef SMLNOTIFIER_DEBUG_H
+#define SMLNOTIFIER_DEBUG_H
+
+
+#ifdef _DEBUG
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT( KLogFile,"sml_notiflog.txt" );
+_LIT( KLogDirFullName,"c:\\logs\\SyncML\\" );
+_LIT( KLogDir,"SyncML" );
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+// Declare the FPrint function
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,
+                              KLogFile,
+                              EFileLoggingModeAppend,
+                              aFmt,
+                              list );
+    }
+
+#define FLOG( a )   { FPrint( a ); }
+#define FTRACE( a ) { a; }
+
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+
+// Declare the FPrint function
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    TInt tmpInt = VA_ARG(list, TInt);
+    TInt tmpInt2 = VA_ARG(list, TInt);
+    TInt tmpInt3 = VA_ARG(list, TInt);
+    TInt tmpInt4 = VA_ARG(list, TInt);
+    TInt tmpInt5 = VA_ARG(list, TInt);
+    TInt tmpInt6 = VA_ARG(list, TInt);
+    TInt tmpInt7 = VA_ARG(list, TInt);
+    TInt tmpInt8 = VA_ARG(list, TInt);
+    VA_END(list);
+    RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3, tmpInt4, tmpInt5, tmpInt6, tmpInt7, tmpInt8);
+    }
+
+#define FLOG( a ) { RDebug::Print(a);  }
+#define FTRACE( a ) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG( a )
+#define FTRACE( a )
+
+#endif // _DEBUG
+
+
+#endif // SMLNOTIFIER_DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLNotifPrivateCRKeys.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002-2006 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: 
+*     SyncML Notifier  private CenRep key definitions
+*
+*/
+
+
+#ifndef SYNCML_NOTIF_PRIVATE_CR_KEYS_H
+#define SYNCML_NOTIF_PRIVATE_CR_KEYS_H
+
+
+/**
+* SyncML Notifier Private Keys UID
+*/
+const TUid KCRUidNSmlNotifierPrivateKeys = {0x101F8769};
+
+
+// Device manager key UID
+const TUid KPSUidNSmlDMSyncApp = {0x101f6de5};
+
+
+
+//PubSub key used to mark which application is handling the process of download
+//Sets by DM UI, NSC or NSCBackground
+const TUint32 KNSmlCurrentFotaUpdateAppName = 0x0000000A;
+
+
+//PubSub key used to define should "Install Now?" query be shown or not
+//Sets by DM UI or NSC
+const TUint32 KDevManShowInstallNowQuery = 0x0000000B;
+
+
+/**
+* CenRep key for defining whether DM session blocked in roaming or not.
+* 
+*
+* Possible integer values:
+* 0 or 1
+* 0 means that feature is disabled
+* 1 means feature is enabled
+* Default value: 0 (not enabled)
+*
+* If 1 then if the phone is in roaming server alert message is not 
+* processed hence DM session doesnot get started
+*/
+//const TUint32 KNSmlDMBlockedInRoaming = 0x00000001;
+
+#endif // SYNCML_NOTIF_PRIVATE_CR_KEYS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLNotifier.hrh	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* 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: Implementation of syncmlnotifier component
+* 	This is part of syncmlnotifier.
+*
+*/
+
+
+#ifndef SYNCMLNOTIFIER_HRH
+#define SYNCMLNOTIFIER_HRH
+
+// DATA TYPES
+#define avkon_bitmap_file "Z:\\system\\data\\avkon.mbm"
+
+#endif      // SYNCMLNOTIFIER_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLNotifierBase.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,217 @@
+/*
+* 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:  Declares SyncML notifiers base class.
+*
+*/
+
+
+
+#ifndef CSYNCMLNOTIFIERBASE_H
+#define CSYNCMLNOTIFIERBASE_H
+
+//  INCLUDES
+#include <SyncMLNotifier.h>
+
+// CONSTANTS
+// Channel for app starter notifier
+const TUid KSmlAppLaunchChannel = {0x101F8769};
+
+// Channel for server dialog notifier
+const TUid KSmlDlgChannel       = {0x101F876A};
+const TUid KSmlFwUpdChannel     = {0x102072BF}; // Channel for firmware update notifier
+
+// Number of notifiers
+const TInt KSmlNotifierArrayIncrement = 3;  // Number of notifiers
+
+// FORWARD DECLARATIONS
+class CEikonEnv;
+
+// CLASS DECLARATION
+
+/**
+* The base class for the SyncML notifiers.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS( CSyncMLNotifierBase ) : public CActive,
+                                           public MEikSrvNotifierBase2
+    {
+    public:  // Constructors and destructor
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLNotifierBase();
+
+
+    protected:  // New functions
+        
+        /**
+        * Used in asynchronous notifier launch to store received parameters 
+        * into members variables and make needed initializations.        
+        * @since Series 60 3.0
+        * @param aBuffer A buffer containing received parameters
+        * @param aReturnVal The return value to be passed back.
+        * @param aMessage Should be completed when the notifier is deactivated.
+        * @return None.
+        */
+        virtual void GetParamsL(const TDesC8& aBuffer, 
+                                      TInt aReplySlot, 
+                                const RMessagePtr2& aMessage) = 0;
+
+        /**
+        * A utility function for requesting the activation of lights.
+        * @since Series 60 3.0
+        * @param None.
+        * @return None.
+        */
+        void TurnLightsOn();
+
+        /**
+        * A utility function for checking whether autolock is on.
+        * @since Series 60 3.0
+        * @param None.
+        * @return A boolean according to autolock state.
+        */
+        TBool AutoLockOnL();
+
+		/**
+		* A function for checking the status of Apps key.
+        * @since Series 60 3.0
+		* @param aEnable A Boolean according to Apps key status
+		* @return None.
+		*/
+		void SuppressAppSwitching( TBool aEnable );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        virtual void ConstructL();
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CActive Gets called when a request completes.
+        * @param None.
+        * @return None.
+        */
+        virtual void RunL() = 0;
+
+        /**
+        * From CActive Gets called when a leave occurres in RunL.
+        * @param aError Symbian OS errorcode.
+        * @return None.
+        */
+        virtual TInt RunError( TInt aError );
+
+        /**
+        * From MEikSrvNotifierBase2 Called when a notifier is first loaded 
+        * to allow any initial construction that is required.
+        * @param None.
+        * @return A structure containing priority and channel info.
+        */
+        virtual TNotifierInfo RegisterL() = 0;
+        
+        /**
+        * From MEikSrvNotifierBase2 The notifier has been deactivated 
+        * so resources can be freed and outstanding messages completed.
+        * @param None.
+        * @return None.
+        */
+        virtual void Cancel();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLNotifierBase();
+
+    private: // Functions from base classes        
+        
+        /**
+        * From MEikSrvNotifierBase2 Called when all resources allocated 
+        * by notifiers should be freed.
+        * @param None.
+        * @return None.
+        */
+        virtual void Release();
+
+        /**
+        * From MEikSrvNotifierBase2 Return the priority a notifier takes 
+        * and the channels it acts on.
+        * @param None.
+        * @return A structure containing priority and channel info.
+        */
+        virtual TNotifierInfo Info() const;
+
+        /**
+        * From MEikSrvNotifierBase2 Synchronic notifier launch.        
+        * @param aBuffer Received parameter data.
+        * @return A pointer to return value.
+        */
+        virtual TPtrC8 StartL( const TDesC8& aBuffer );
+        
+        /**
+        * From MEikSrvNotifierBase2 Asynchronic notifier launch.
+        * @param aBuffer A buffer containing received parameters
+        * @param aReturnVal The return value to be passed back.
+        * @param aMessage Should be completed when the notifier is deactivated.
+        * @return A pointer to return value.
+        */
+        virtual void StartL( const TDesC8& aBuffer,
+                                   TInt aReplySlot,
+                             const RMessagePtr2& aMessage );
+        
+        /**
+        * From MEikSrvNotifierBase2 Updates a currently active notifier.
+        * @param aBuffer The updated data.
+        * @return A pointer to return value.
+        */
+        virtual TPtrC8 UpdateL( const TDesC8& aBuffer );       
+
+        /**
+        * From CActive Gets called when a request is cancelled.
+        * @param None.
+        * @return None.
+        */
+        virtual void DoCancel();   
+		
+    protected:  // Data
+        // Received message
+        RMessagePtr2    iMessage;
+        
+        // Reply slot
+        TInt            iReplySlot;
+
+        // Flag for releasing messages
+        TBool           iNeedToCompleteMessage;
+        
+        // Notifier parameters structure
+        TNotifierInfo   iInfo;
+        
+        // Local eikonenv
+        CEikonEnv*      iEikEnv;
+
+        // Apps key status 
+        TBool           iAppsKeyBlocked;
+
+        // Flag for eikon env.
+        TInt            iResourceFileFlag;
+    };
+
+#endif      // CSYNCMLNOTIFIERBASE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLPreSyncPluginInterface.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of syncmlnotifier component
+* 	This is part of syncmlnotifier.
+*
+*/
+
+#ifndef SYNCMLPRESYNCPLUGININTERFACE_H
+#define SYNCMLPRESYNCPLUGININTERFACE_H
+
+// INCLUDE FILES
+#include <s32mem.h>
+#include <coemain.h>
+#include <ecom/ecom.h>
+#include <ecom/implementationinformation.h>
+#include <SyncMLDef.h>
+
+class CPreSyncPlugin;
+
+/**
+* Class is used to instantiate the required plugins when the search has been
+* asked. Acts as interface to all Plugins.
+*/
+
+class CPreSyncPluginInterface: public CBase 
+{
+	public:
+
+		/** 
+		* Symbian OS 2 phased constructor.
+		* @return	A pointer to the created instance of CPreSyncPluginInterface.
+		*/
+		static CPreSyncPluginInterface* NewL();
+
+		/** 
+		* Symbian OS 2 phased constructor.
+		* @return	A pointer to the created instance of CPreSyncPluginInterface.
+		*/
+		static CPreSyncPluginInterface* NewLC();
+
+		/**
+		* Destructor.
+		*/      
+		virtual ~CPreSyncPluginInterface();
+
+		/**
+		* Instantiates the required search plug-ins known by the ecom framework.
+		* basically this function first calls ListAllImplementationsL()
+		* and then checks them one by one to match the algorithm name
+		*/
+		void InstantiatePluginL();
+		
+		CPreSyncPlugin* InstantiateRoamingPluginLC( TSmlProfileId aProfileId );
+
+		/**
+		* Unloads all plugins
+		* This should internally call  REComSession::DestroyedImplementation( iDtor_ID_Key )
+		* and then REComSession::FinalClose()
+		*/
+		void UnloadPlugIns(); 
+
+		/**
+		* Lists all implementations which satisfy this ecom interface
+		*
+		* @param aImplInfoArray On return, contains the list of available implementations
+		* 
+		*/   
+		void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray );
+		
+
+		/**
+		* Forwards the request to check if language is supported
+		* to the algorithm instance
+		*/
+		TBool IsDefault();   
+		              
+		/**
+		* Forwards the request to recover data fields order for a URI
+		* to the algorithm instance
+		*/
+		TBool IsProfileYours(TSmlProfileId aProfileId);
+
+		/**
+		* Forwards the request to recover sort order for a URI
+		* to the algorithm instance
+		*/
+		void Handle(TSmlProfileId aProfileId); 
+
+	private: 
+
+		/** 
+		* Performs the first phase of two phase construction.
+		*/
+		CPreSyncPluginInterface();  
+
+		/** 
+		* Symbian OS 2 phased constructor.
+		*/
+		void ConstructL();
+
+		/**
+		* Instantiates a PCS plug-in, knowing the implementation uid.
+		* @param aImpUid imp uID
+		*/
+		CPreSyncPlugin* InstantiatePlugInFromImpUidL( const TUid& aImpUid );
+
+
+	private: 
+
+	    /** iDtor_ID_Key Instance identifier key. When instance of an
+	         *               implementation is created by ECOM framework, the
+	         *               framework will assign UID for it. The UID is used in
+	         *               destructor to notify framework that this instance is
+	         *               being destroyed and resources can be released.
+	         */
+	    TUid iDtor_ID_Key;
+
+		// List of plugins that this interface will interact with
+		RPointerArray<CPreSyncPlugin>  iPluginInstances; 
+
+		// Uid of the algorithm in use
+		TUid iPluginInUse;
+};
+
+#endif // SYNCMLPRESYNCPLUGININTERFACE_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLQueryDialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* 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:  Query dialog.
+*
+*/
+
+
+
+#ifndef CSYNCMLQUERYDIALOG_H
+#define CSYNCMLQUERYDIALOG_H
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Message query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS ( CSyncMLQueryDialog ) : public CAknQueryDialog
+                                                 
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLQueryDialog* NewL(TBool& aKeyPress);        
+                  
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLQueryDialog();
+
+    public: // Functions from base classes
+
+        
+    protected:  // Functions from base classes
+        
+
+        /**
+        * From CEikDialog: Determines if the dialog can be closed.
+        * @param aButtonId Identifier of the button pressed.
+        * @return whether to close the dialog or not.
+        */
+        TBool OkToExitL( TInt aButtonId );
+
+        /**
+        * Called by OfferkeyEventL(), gives a change to dismiss the query even with
+        * keys different than Enter of Ok.
+        * @param aKeyEvent has the key event details
+        * @return whether to dismiss the dialog or not.
+        */
+        TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+        
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLQueryDialog(TBool& aKeyPress  );
+
+
+    private:    // Data
+        
+         TBool& iKeyPress;
+    };
+
+#endif      // CSYNCMLQUERYDIALOG_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLQueryTimer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* 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:  Message query with timeout.
+*
+*/
+
+
+
+#ifndef CSYNCMLQUERYTIMER_H
+#define CSYNCMLQUERYTIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  Timer observer class for SyncML notifier queries.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS ( MSyncMLQueryTimerObserver )
+    {
+    public: // New functions
+        /**
+        * Is called when the timer expires.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        virtual void TimerExpired() = 0;
+    };
+
+/**
+*  Timer class for SyncML notifier queries.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS ( CSyncMLQueryTimer ) : public CTimer
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLQueryTimer* NewL( MSyncMLQueryTimerObserver* aObserver );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLQueryTimer();
+
+    public: // Functions from base classes
+
+        /**
+        * From CActive Is called when an event is received.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void RunL();
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLQueryTimer( MSyncMLQueryTimerObserver* aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+        // Pointer to the timer observer instance.
+        MSyncMLQueryTimerObserver*  iObserver;
+         
+    };
+
+#endif      // CSYNCMLQUERYTIMER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLTimedDateQuery.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2007 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:  Date query with timeout.
+*
+*/
+
+
+
+#ifndef CSYNCMLTIMEDDATEQUERY_H
+#define CSYNCMLTIMEDDATEQUERY_H
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+
+#include "SyncMLQueryTimer.h"
+
+// CONSTANTS
+const TInt  KSyncMLNNoTimeoutDate  = 0; // The query does not time out
+
+// CLASS DECLARATION
+
+/**
+*  Date query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.2
+*/
+NONSHARABLE_CLASS ( CSyncMLTimedDateQuery ) : public CAknTimeQueryDialog,
+                                                 public MSyncMLQueryTimerObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLTimedDateQuery* NewL(
+            TTime& aDate,const TDesC& aPromptText, TBool& aKeypress,
+                  TInt   aTimeout = KSyncMLNNoTimeoutDate );
+          
+        CSyncMLTimedDateQuery(TTime& aDate, TBool& aKeypress,TInt aTimeout = KSyncMLNNoTimeoutDate );
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLTimedDateQuery();
+
+    public: // Functions from base classes
+
+        /**
+        * From MSyncMLQueryTimerObserver Is called when the timer
+        * runs out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void TimerExpired();
+        
+    protected:  // Functions from base classes
+        
+        /**
+        * From CEikDialog Starts the dialog timer.
+        * Called after the dialog is laid out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * From CEikDialog Determines if the dialog can be closed.
+        * @since Series 60 3.0
+        * @param aButtonId Identifier of the button pressed.
+        * @return None
+        */
+        TBool OkToExitL( TInt aButtonId );
+        
+        /** 
+        * Called by OfferkeyEventL(), gives a change to dismiss the query even with 
+        * keys different than Enter of Ok. 
+        */ 
+        TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+        
+        /**
+        * Called by NeedToDismissQueryL(), gives a change to either accept or reject
+        * the query. Default implementation is to accept the query if the Left soft
+        * key is displayed and reject it otherwise. Left softkey is only displayed if
+        * the query has valid data into it.
+        */
+        void DismissQueryL();
+        
+    private:    // Data
+        // Number of seconds before the query is timed out. 0 = no timeout.
+        TInt               iTimeout;
+
+        // Pointer to the timer instance
+        CSyncMLQueryTimer*  iTimer;
+    public:    
+        //key press detection
+        TBool iKeypress;
+    };
+
+#endif      // CSYNCMLTIMEDMESSAGEQUERY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLTimedInputTextQuery.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2007 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:  InputText query with timeout.
+*
+*/
+
+
+
+#ifndef CSYNCMLTIMEDINPUTTEXTQUERY_H
+#define CSYNCMLTIMEDINPUTTEXTQUERY_H
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+#include <SyncMLNotifierParams.h>
+#include "SyncMLQueryTimer.h"
+
+// CONSTANTS
+const TInt  KSyncMLNNoAlphanumTimeout  = 0; // The query does not time out
+
+// CLASS DECLARATION
+
+/**
+*  InputText query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.2
+*/
+NONSHARABLE_CLASS ( CSyncMLTimedInputTextQuery ) : public CAknTextQueryDialog,
+                                                 public MSyncMLQueryTimerObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLTimedInputTextQuery* NewL(
+            TDes& aInputText,const TDesC& aPromptText,
+            TBool& aKeypress, TInt   aTimeout = KSyncMLNNoAlphanumTimeout );
+          
+        CSyncMLTimedInputTextQuery(TDes& aDataText, TBool& aKeypress, TInt aTimeout = KSyncMLNNoAlphanumTimeout );
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLTimedInputTextQuery();
+        
+       
+
+    public: // Functions from base classes
+
+        /**
+        * From MSyncMLQueryTimerObserver Is called when the timer
+        * runs out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void TimerExpired();
+        
+        /**
+        * From CAknQueryDialog,method called when the Editor content changed
+        * @since Series 60 3.0
+        * @param aQueryControl,aEventType , aStatus
+        * @return None
+        */
+        TBool HandleQueryEditorStateEventL(CAknQueryControl* aQueryControl, 
+                              TQueryControlEvent aEventType, TQueryValidationStatus aStatus);
+        
+    protected:  // Functions from base classes
+        
+        /**
+        * From CEikDialog Starts the dialog timer.
+        * Called after the dialog is laid out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * From CEikDialog Determines if the dialog can be closed.
+        * @since Series 60 3.0
+        * @param aButtonId Identifier of the button pressed.
+        * @return None
+        */
+        TBool OkToExitL( TInt aButtonId );
+        
+        /** 
+        * Called by OfferkeyEventL(), gives a change to dismiss the query even with 
+        * keys different than Enter of Ok. 
+        */ 
+        TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+        
+        /**
+        * Called by NeedToDismissQueryL(), gives a change to either accept or reject
+        * the query. Default implementation is to accept the query if the Left soft
+        * key is displayed and reject it otherwise. Left softkey is only displayed if
+        * the query has valid data into it.
+        */
+        void DismissQueryL();
+        
+    private:    // Data
+        // Number of seconds before the query is timed out. 0 = no timeout.
+        TInt               iTimeout;
+
+        // Pointer to the timer instance
+        CSyncMLQueryTimer*  iTimer;
+    public:    
+        //Detecting key press
+        TBool iKeypress;
+        
+    };
+
+#endif      // CSYNCMLTIMEDMESSAGEQUERY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLTimedMessageQuery.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* 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:  Message query with timeout.
+*
+*/
+
+
+
+#ifndef CSYNCMLTIMEDMESSAGEQUERY_H
+#define CSYNCMLTIMEDMESSAGEQUERY_H
+
+//  INCLUDES
+#include <aknmessagequerydialog.h>
+
+#include "SyncMLQueryTimer.h"
+
+// CONSTANTS
+const TInt  KSyncMLNNoTimeout  = 0; // The query does not time out
+
+// CLASS DECLARATION
+
+/**
+*  Message query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS ( CSyncMLTimedMessageQuery ) : public CAknMessageQueryDialog,
+                                                 public MSyncMLQueryTimerObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLTimedMessageQuery* NewL(
+            const TDesC& aMessage,
+                  TInt   aTimeout = KSyncMLNNoTimeout );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLTimedMessageQuery();
+
+    public: // Functions from base classes
+
+        /**
+        * From MSyncMLQueryTimerObserver Is called when the timer
+        * runs out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void TimerExpired();
+        
+    protected:  // Functions from base classes
+        
+        /**
+        * From CEikDialog Starts the dialog timer.
+        * Called after the dialog is laid out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * From CEikDialog Determines if the dialog can be closed.
+        * @since Series 60 3.0
+        * @param aButtonId Identifier of the button pressed.
+        * @return None
+        */
+        TBool OkToExitL( TInt aButtonId );
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLTimedMessageQuery( TInt aTimeout = KSyncMLNNoTimeout );
+
+    private:    // Data
+        // Number of seconds before the query is timed out. 0 = no timeout.
+        TInt               iTimeout;
+
+        // Pointer to the timer instance
+        CSyncMLQueryTimer*  iTimer;
+    };
+
+#endif      // CSYNCMLTIMEDMESSAGEQUERY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLTimedNumberQueryDialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 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:  Number Query dialog with timeout.
+*
+*/
+
+
+
+#ifndef CSYNCMLTIMEDNUMBERQUERYDIALOG_H
+#define CSYNCMLTIMEDNUMBERQUERYDIALOG_H
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+
+#include "SyncMLQueryTimer.h"
+#include "SyncMLTimedMessageQuery.h"
+
+// CONSTANTS
+const TInt KSyncMLNotifierTimeout = 300; // 5 min timeout
+
+// CLASS DECLARATION
+
+/**
+*  Message query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.2
+*/
+NONSHARABLE_CLASS ( CSyncMLTimedNumberQueryDialog ) : public CAknFloatingPointQueryDialog,
+                                                 public MSyncMLQueryTimerObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLTimedNumberQueryDialog* NewL(
+            TReal& aValue, const TDesC& aIptext,TBool& aKeypress, 
+                  TInt   aTimeout = KSyncMLNNoTimeout );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLTimedNumberQueryDialog();
+       
+
+    public: // Functions from base classes
+
+        /**
+        * From MSyncMLQueryTimerObserver Is called when the timer
+        * runs out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void TimerExpired();
+        
+    protected:  // Functions from base classes
+        
+        /**
+        * From CEikDialog Starts the dialog timer.
+        * Called after the dialog is laid out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * From CEikDialog Determines if the dialog can be closed.
+        * @since Series 60 3.0
+        * @param aButtonId Identifier of the button pressed.
+        * @return None
+        */
+        TBool OkToExitL( TInt aButtonId );
+        
+        /** 
+        * Called by OfferkeyEventL(), gives a change to dismiss the query even with 
+        * keys different than Enter of Ok. 
+        */ 
+        TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+        
+        /**
+        * Called by NeedToDismissQueryL(), gives a change to either accept or reject
+        * the query. Default implementation is to accept the query if the Left soft
+        * key is displayed and reject it otherwise. Left softkey is only displayed if
+        * the query has valid data into it.
+        */
+        void DismissQueryL();
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLTimedNumberQueryDialog( TReal& aValue, TBool& aKeypress, TInt aTimeout = KSyncMLNNoTimeout );
+
+    private:    // Data
+        // Number of seconds before the query is timed out. 0 = no timeout.
+        TInt               iTimeout;
+
+        // Pointer to the timer instance
+        CSyncMLQueryTimer*  iTimer;
+     public:   
+        //Detecting the key press
+         TBool iKeypress;
+    };
+
+#endif      // CSYNCMLTIMEDQUERYDIALOG_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/SyncMLTimedQueryDialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,104 @@
+/*
+* 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:  Query dialog with timeout.
+*
+*/
+
+
+
+#ifndef CSYNCMLTIMEDQUERYDIALOG_H
+#define CSYNCMLTIMEDQUERYDIALOG_H
+
+//  INCLUDES
+#include <AknQueryDialog.h>
+
+#include "SyncMLQueryTimer.h"
+#include "SyncMLTimedMessageQuery.h"
+
+// CONSTANTS
+const TInt KSyncMLNotifierTimeout = 300; // 5 min timeout
+
+// CLASS DECLARATION
+
+/**
+*  Message query with timeout.
+*
+*  @lib SyncMLNotifier
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS ( CSyncMLTimedQueryDialog ) : public CAknQueryDialog,
+                                                 public MSyncMLQueryTimerObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSyncMLTimedQueryDialog* NewL(
+            const TDesC& aMessage,
+                  TInt   aTimeout = KSyncMLNNoTimeout );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSyncMLTimedQueryDialog();
+
+    public: // Functions from base classes
+
+        /**
+        * From MSyncMLQueryTimerObserver Is called when the timer
+        * runs out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void TimerExpired();
+        
+    protected:  // Functions from base classes
+        
+        /**
+        * From CEikDialog Starts the dialog timer.
+        * Called after the dialog is laid out.
+        * @since Series 60 3.0
+        * @param None
+        * @return None
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * From CEikDialog Determines if the dialog can be closed.
+        * @since Series 60 3.0
+        * @param aButtonId Identifier of the button pressed.
+        * @return None
+        */
+        TBool OkToExitL( TInt aButtonId );
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSyncMLTimedQueryDialog( TInt aTimeout = KSyncMLNNoTimeout );
+
+    private:    // Data
+        // Number of seconds before the query is timed out. 0 = no timeout.
+        TInt               iTimeout;
+
+        // Pointer to the timer instance
+        CSyncMLQueryTimer*  iTimer;
+    };
+
+#endif      // CSYNCMLTIMEDQUERYDIALOG_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/inc/syncmlmmcwatcher.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Synchronisation server alert notifier.
+*
+*/
+
+#ifndef SYNCMLMMCWATCHER_H_
+#define SYNCMLMMCWATCHER_H_
+#include <e32base.h>
+#include <e32property.h>
+#include <UikonInternalPSKeys.h>
+#include <f32file.h> 
+#include <disknotifyhandler.h> //if RD_MULTIPLE_DRIVE
+#include "SyncMLNotifDebug.h"
+
+/**
+*  MMC event observer class for SyncML notifier queries.
+*  @lib SyncMLNotifier
+*  @since Series 60 5.2
+*/
+NONSHARABLE_CLASS ( MSyncMLQueryMmcObserver )
+    {
+    public: // New functions
+        /**
+        * Is called when the mmc removes.
+        * @since Series 60 5.2
+        * @param None
+        * @return None
+        */
+        virtual void MmcRemoved() = 0;
+    };
+
+/**
+*  MMC event watcher class for SyncML notifier queries.
+*  @lib SyncMLNotifier
+*  @since Series 60 5.2
+*/
+class CSyncmlmmcwatcher :  public CBase, public MDiskNotifyHandlerCallback /*public CActive,*/
+    {                
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     */
+    static CSyncmlmmcwatcher* NewL( MSyncMLQueryMmcObserver* aObserver );
+
+    /**
+     * Destructor.
+     */     
+    virtual ~CSyncmlmmcwatcher();
+private:   
+    /**
+     * Constructor.
+     */
+    inline CSyncmlmmcwatcher( MSyncMLQueryMmcObserver* aObserver);       
+
+public:
+    /**
+     * Logs a request to notify the disk events
+     * @since Series 60 5.2
+     * @param None
+     * @return None
+     */
+    void StartL();
+    
+    /**
+     * Callback method to notify disk events
+     * @since Series 60 5.2
+     * @param aError,System wide error code from file server
+     * @param aEvent,The disk event data data specified by TDiskEvent
+     * @return None
+     */
+    void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent );
+    
+    /**
+     * Cancels the disk notification
+     * @since Series 60 5.2
+     * @param None     
+     * @return None
+     */
+    void CancelMmcwatch();
+
+private:
+
+    /**
+     * Symbian 2nd phase constructor.
+     */
+    void ConstructL();            
+
+private:            
+    //Instance to RFs
+    RFs iMemoryCard;
+    
+    // Pointer to disk notify handler. Own.
+    CDiskNotifyHandler* iDiskNotifyHandler;
+    
+    // Pointer to MMC observer
+    MSyncMLQueryMmcObserver* immcobserver;
+    }; 
+
+#endif /* SYNCMLMMCWATCHER_H_ */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/loc/SyncMLNotifier.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2005-2007 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:  Localisation file for SyncML framework.
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d:Text of the popup query for the acceptance
+//d:of the server initiated synchronisation session.
+//l:popup_note_window_1
+//w:
+//r:3.0
+//
+#define qtn_ds_query_accept_configuration   "Server %U is about to synchronise. Accept?"
+
+//d:Text of the popup query for the acceptance
+//d:of the server initiated synchronisation session.
+//l:popup_note_window_1
+//w:
+//r:3.0
+//
+#define qtn_sml_server_message_heading      "Server message"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server.
+//l:popup_note_window_1
+//w:
+//r:3.0
+//
+#define qtn_dm_query_accept_configuration   "Recommended update available from server %U. Download?"
+
+//d:Information note to be shown for server started user informative session
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_dm_info_note_updating "Updating device from server %U"
+
+
+//d:Text of the prompt text of popup query for the acceptance
+//d:of the SyncML DM server initiated device management session.
+//l:heading_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_title_phone_management      "Phone management"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_management_without_purpose   "Server %U wants to start phone management session with your phone. Accept?"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML Dm server for the purpose of configuration management 
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_configuration   "New configuration update is available from server %U. Accept?"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML DM server for the purpose of software management.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_software   "New software update is available from server %U. Accept?"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML DM server for the purpose of firmware management.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_firmware   "New phone software update is available from server %U. Accept?"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for the purpose of diagnostics.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_diagnostics   "Server %U wants to run some diagnostic tests on your phone. Accept?"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for the purpose of device control purpose.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_phone_control   "Server %U wants to have control of some features on your phone. Accept?"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for the purpose of Customization.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_customization   "Server %U wants to customize your phone.Accept?"
+
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML DM server for multiple purposes
+//d: After this string line feed should be added while showing
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_management_with_purposes   "Server %U wants to start phone management session with your phone. Session contains:"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML DM server for multiple purposes, with Configuration update
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_mgmt_purpose_configuration   "Configuration updates"
+
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for multiple purposes, with Software update
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_mgmt_purpose_software   "Software updates"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML DM server for multiple purposes, with Phone software updates
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_mgmt_purpose_firmware   "Phone software updates"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for multiple purposes, with Diagnostics
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_mgmt_purpose_diagnostics   "Diagnostics"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for multiple purposes, with Phone Control
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_mgmt_purpose_control   "Phone control"
+
+//d:Text of the popup query showing a note received
+//d:from a SyncML server for multiple purposes, with Phone customization
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_accept_mgmt_purpose_customization   "Phone customization"
+
+//d:Text of the popup query showing a note received
+//d:from a DM SyncML server for multiple purposes.
+//d:Should show accept string at last line after showing any of above 
+//d:multiple purposes string.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_dm_query_management_accept   "Accept?"
+
+
+//d:Text of the popup query for the acceptance
+//d:of the server initiated synchronisation session.
+//d:This message text is requested from operator 
+//d:The chinese text should be as per the one mentioned in Requirement
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_dm_query_accept_postsale   "Accept Enhanced Post-sale Service?"
+
+//d:Information note to be shown for server started user informative session
+//d:This message text is requested from operator
+//d:This is indication that Device management session is started for 
+//d:the reason as text indicates 
+//d:The chinese text should be as per the one mentioned in Requirement
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_dm_info_note_postsale "Enhanced Post-sale Service"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/loc/SyncMLNotifierFota.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2005-2006 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:  FOTA specific localisation file for SyncML framework.
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d:Header text of the firmware update related message
+//d:queries.
+//l:heading_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_query_title_phone_updates  "Phone updates"
+
+//d:Text of the popup query indicating that the
+//d:firmware update was successful. Shown after
+//d:the phone has rebooted back to normal mode.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_notif_complete             "Update successful"
+
+//d:Text of the popup query indicating that the
+//d:firmware update was not successful and the phone
+//d:has not been updated. Shown after the phone
+//d:has rebooted back to normal mode.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_msg_query_not_updated      "The phone was not updated. The update package was not compatible with the phone. Please contact your service provider."
+
+//d:Text of the popup query indicating that there
+//d:is not enough power in the battery to perform
+//d:a firmware update. Shown before the phone reboots
+//d:to the update mode.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_battery_low                "Not enough battery power for update. Connect the charger now or update later."
+
+//d:Text of the popup query indicating that there
+//d:is not enough power in the battery to perform
+//d:a firmware update for USB charging support.
+//d:Shown before the phone reboots
+//d:to the update mode.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.2.3
+//
+#define qtn_fota_msg_query_update_usb_charger               "Connect the charger. You will be notified once the charging level reaches acceptable level."
+
+//d:Text of the popup query indicating that the connection
+//d:to FOTA server was lost during the download and the
+//d:package retrieval could not be finished.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_err_lost_connection        "Connection lost while downloading."
+
+//d:Text of the popup query indicating that the FOTA
+//d:or download server retuned an internal error when
+//d:the phone tried to access it.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_server_error               "Service error. Cannot perform update at this time."
+
+//d:Text of the popup query indicating that the
+//d:firmware update was not permitted. The cause
+//d:is usually the incompatibility of the update
+//d:package.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_not_permitted              "Update not permitted. Please contact your service provider."
+
+//d:Text of the confirmation query requesting if
+//d:the firmware update should be started. Asked
+//d:when the package has been retrieved. %U is the
+//d:name of the device management server, which initiated
+//d:the download.
+//l:popup_note_window_1
+//w:
+//r:3.1
+//
+#define qtn_fota_conf_query_install_now     "New software update downloaded from %U. Install now?"
+
+//d:Text of the first confirmation query describing the effect
+//d:of the firmware update and warning that the phone
+//d:will be unusable for several minutes. The user
+//d:may cancel the update at this stage.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_msg_query_update_1_warning   "Data and content back up is recommended before proceeding with installation."
+
+//d:Text of the second confirmation query describing the effect
+//d:of the firmware update and warning that the phone
+//d:will be unusable for several minutes. The user
+//d:may cancel the update at this stage.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_msg_query_update_2_warning   "Installation will proceed until complete. You will not be able to use your phone during the installation, even for emergencies. During the installation your phone will restart."
+
+//d:Text of the permanent note informing the user that
+//d:the phone is being rebooted because of the software
+//d:update.
+//l:popup_note_window_1
+//w:
+//r:3.1
+//
+#define qtn_fota_restarting_for_update      "Restarting for update..."
+
+//d:Text of the popup query informing user that
+//d:the update installation was canceled. Shown if
+//d:the user rejects the "install now" query and the
+//d:manual installation is not allowed.
+//l:popup_note_window_1
+//w:
+//r:3.1
+//
+#define qtn_fota_conf_note_installing_cancelled "Installing cancelled"
+
+//d:Text of the popup query informing user that
+//d:the update installation can be started from the
+//d:Device Manager application. Shown if the user
+//d:rejects the "install now" query.
+//l:popup_info_list_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_fota_msg_query_update_reminder  "To update your phone later, select Install update in Device Manager."
+
+//d:Text of the popup message query informing user that
+//d:no enough memory for downloading the large object.
+//d:%N displays how much memory in KB needed for downloading Update package 
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_fota_note_not_enough_disk_space "Device was not updated. Not enough memory for update. %N kB free memory needed for update."
+//d:Text of the popup message query informing user that
+//d:no enough memory for downloading using OMA Download.
+//d:%N displays how much memory in KB needed for downloading Update package 
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_fota_querry_not_enough_disk_space "Not enough memory for update.%N kB free memory needed for update. Delete some data now or update later."
+//d:Text for the left soft key of update package 
+//d:install popup query after downloading the package
+//d:Selecting "Now" starts installation
+//l:control_pane_t1/opt3
+//r:3.2
+//
+#define text_softkey_now "Now"
+//d:Text for the right soft key of update package 
+//d:install popup query after downloading the package 
+//d:Selecting "Later" shows remainder dialog
+//l:control_pane_t1/opt3
+//r:3.2
+//
+#define text_softkey_later "Later"
+
+//d:Text of the confirmation query requesting if
+//d:the firmware update should be started. Asked
+//d:when the package has been retrieved. 
+//d:The chinese text should be as per the one mentioned in Requirement
+//l:popup_info_list_pane_t1 
+//r:5.0
+//
+#define qtn_fota_msg_query_update_custom_warning     "New software update downloaded. The software updating might take 10 minutes. During the updating, all the functions will be unavailable, including emergency call.  Update now?"
+
+// new localization for FOTA Suspend&Resume
+
+//d:Text of the popup message query informing user that
+//d:connection was lost downloading using OMA Download.
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_fota_query_download_conn_lost  "Connection was lost during download. You can continue downloading phone software update later when connection is available."
+
+//d:Text of the popup message query asking user 
+//d:if download can be continued now or later
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_fota_query_download_continue 	"Do you want to continue downloading phone software update later?"
+
+//d:Text of the popup message query informing user that
+//d:download is postponed
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_fota_query_download_postponed		"Download postponed."
+
+//d:Text of the popup message query 
+//d:Asking user when he chooses to resume option to continue downloading
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_fota_query_download_resume	"Do you want to continue phone software update?"
+
+//d:Text of the popup query indicating that the
+//d:download is cancelled.
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_fota_query_download_cancelled			  "Download Cancelled."
+
+//d:Text of the information indicating user that  
+//d:there was an error occurred during download
+//d:And downloading can be resumed later 
+//l:popup_info_list_pane_t1 
+//r:5.0
+//
+
+#define qtn_fota_query_download_error_continue "An error occurred during download. You can continue downloading phone software update later."
+
+//d:Text of the information indicating user that  
+//d:there was an error occurred and 
+//d:user has to perform check for updates again. 
+//l:popup_info_list_pane_t1 
+//r:5.0
+//
+
+#define qtn_fota_query_download_error_restart "An error occurred during download. Please restart phone software update."
+
+//d:Text of the confirmation query when phone memory is encrypted.
+//d:Firmware update might take more time as memory has to be decrypted first
+//d:before performing the update. The duration of decryption depends on the memory size and how much data is in.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.2
+//
+
+#define qtn_fota_msg_query_update_dec_warning   "You will not be able to use your phone during the installation, even for emergencies. During the installation your phone will restart. Installation might take few minutes because of the memory decryption and it will proceed until complete."
+
+//d:Text of the confirmation query when phone memory has to be encrypted.
+//d:Once firmware is updated on a phone that had encrypted memory, user is
+//d:prompted to encrypt the memory back. When user denies, the phone memory is not encrypted.
+//d:This query will be combined with the firmware update status note.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.2
+//
+
+#define qtn_fota_msg_query_update_encrypt   "\nDo you want to encrypt your phone memory again? It might take few minutes and you are not able to use your phone during encryption."
+
+//d:Error message shown when battery is low to start encryption.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.2
+//
+
+#define qtn_fota_battery_encryption_low   "Battery  too low.  Connect power adapter and encrypt."
+
+//d:Error message shown when user starts firmware installation while encryption or decryption is ongoing in background.
+//l:popup_info_list_pane_t1
+//w:
+//r:5.2
+//
+
+#define qtn_fota_device_busy   "Device memory is busy. Try installation later."
+
+//d:Text of the confirmation query requesting if
+//d:the firmware update should be started. Asked
+//d:when the package has been retrieved. %U is the
+//d:Operator name.
+//l:popup_note_window_1
+//w:
+//r:5.0,5.2
+//
+
+#define qtn_att_fota_conf_query_install_now "A new software update for your phone is available from %U.\nThe software update process will not delete any personal data on your phone.\nInstall now?"
+
+//d:Text of the popup message query informing user that
+//d:Installation is postponed. It also displays the 
+//d:number of allowed postpone left. %0N is the number of times user has 
+//d:postponed and %1N is the total number of allowed postpone.
+//l:popup_note_window
+//r:5.0,5.2
+//
+
+#define qtn_att_fota_info_installation_postponed_one_minute "Installation postponed for 1 minute. %0N of %1N allowed postpones left."
+
+
+//d:Text of the popup message query informing user that
+//d:Installation is postponed. It also displays the 
+//d:number of allowed postpone left. %0N is the postpone option
+//d:chosen by the user in minutes.%1N is the number of times user has 
+//d:postponed and %2N is the total number of allowed postpone.
+//l:popup_note_window
+//r:5.0,5.2
+//
+
+#define qtn_att_fota_info_installation_postponed_minutes "Installation postponed for %0N minutes. %1N of %2N allowed postpones left."
+
+
+//d:Text of the popup message query informing user that
+//d:Installation is postponed. It also displays the 
+//d:number of allowed postpone left. %0N is the number of times user has 
+//d:postponed and %1N is the total number of allowed postpone.
+//l:popup_note_window
+//r:5.0,5.2
+//
+
+
+#define qtn_att_fota_info_installation_postponed_one_hour "Installation postponed for 1 hour. %0N of %1N allowed postpones left."
+
+
+//d:Text of the popup message query informing user that
+//d:Installation is postponed. It also displays the 
+//d:number of allowed postpone left. %0N is the postpone option
+//d:chosen by the user in hours.%1N is the number of times user has 
+//d:postponed and %2N is the total number of allowed postpone.
+//l:popup_note_window
+//r:5.0,5.2
+//
+
+
+#define qtn_att_fota_info_installation_postponed_hours "Installation postponed for %0N hours. %1N of %2N allowed postpones left."
+
+
+//d:Text of the popup message query informing user that
+//d:Installation is postponed. It also displays the 
+//d:number of allowed postpone left. %0N is the number of times user has 
+//d:postponed and %1N is the total number of allowed postpone.
+//l:popup_note_window
+//r:5.0,5.2
+//
+
+#define qtn_att_fota_info_installation_postponed_one_day "Installation postponed for 1 day. %0N of %1N allowed postpones left."
+
+
+
+//d:Text of the popup message query informing user that
+//d:Installation is postponed. It also displays the 
+//d:number of allowed postpone left. %0N is the postpone option
+//d:chosen by the user in days.%1N is the number of times user has 
+//d:postponed and %2N is the total number of allowed postpone.
+//l:popup_note_window
+//r:5.0,5.2
+//
+
+#define qtn_att_fota_info_installation_postponed_days "Installation postponed for %0N days. %1N of %2N allowed postpones left."
+
+
+//d:Text of the confirmation query requesting if
+//d:the firmware update should be started. Asked
+//d:when the package has been retrieved and the 
+//d:numer of postpone is used. %U is the
+//d:Operator name.
+//l:popup_note_window_1
+//w:
+//r:5.0,5.2
+//
+
+#define qtn_att_fota_conf_query_install_forced "A new software update for your phone is available from %U.\nThe software update process will not delete any personal data on your phone.\nNo more postpones allowed. Installation will begin shortly."
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/rom/SyncMLNotifier.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* 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:  IBY file for the SyncML notifier component.
+*
+*/
+
+
+#ifndef SYNCMLNOTIFIER_IBY
+#define SYNCMLNOTIFIER_IBY
+
+// Should only be included if at least one of the SyncML components is included
+#if defined(__SYNCML_DS) || defined(__SYNCML_DM)
+
+file = ABI_DIR\BUILD_DIR\SyncMLNotifier.dll             SHARED_LIB_DIR\SyncMLNotifier.dll
+ECOM_PLUGIN( SyncMLNotifierWrapper.dll, 101F876A.rsc )
+
+#ifdef __SERIES60_30__
+file = ABI_DIR\BUILD_DIR\SyncMLNotifierAppServer.exe    PROGRAMS_DIR\SyncMLNotifierAppServer.exe
+data = DATAZ_\Private\10003a3f\Apps\SyncMLNotifierAppServer_reg.rsc Private\10003a3f\apps\SyncMLNotifierAppServer_reg.rsc
+#endif // __SERIES60_30__
+
+#endif // defined(__SYNCML_DS) || defined(__SYNCML_DM)
+
+#endif // SYNCMLNOTIFIER_IBY
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/rom/SyncMLNotifierResources.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -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:  IBY file for the SyncML notifier component localisable
+*                resources.
+*
+*/
+
+
+#ifndef SYNCMLNOTIFIERRESOURCES_IBY
+#define SYNCMLNOTIFIERRESOURCES_IBY
+
+// Should only be included if at least one of the SyncML components is included
+#if defined(__SYNCML_DS) || defined(__SYNCML_DM)
+
+data = DATAZ_\RESOURCE_FILES_DIR\SyncMLNotifier.rsc     RESOURCE_FILES_DIR\SyncMLNotifier.rsc
+
+#endif // defined(__SYNCML_DS) || defined(__SYNCML_DM)
+
+#endif // SYNCMLNOTIFIERRESOURCES_IBY
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLAknPopUpList.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Methods to parse the server alert messages for data sync and device
+*                Management frameworks. Launches respective application 
+*                in appropriate conditions
+*
+*/
+
+#include "SyncMLAknPopUplist.h"
+
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::CSyncMLAknPopUpList()
+// Constructor
+// -----------------------------------------------------------------------------
+//
+CSyncMLAknPopUpList::CSyncMLAknPopUpList(TInt aTimeout ):CAknPopupList()
+    {
+    iTimeout = aTimeout;
+    iMmcwatcher = NULL;
+    iTimer = NULL;
+	immcremoved = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::NewL()
+// -----------------------------------------------------------------------------
+//
+CSyncMLAknPopUpList* CSyncMLAknPopUpList::NewL(CAknSingleHeadingPopupMenuStyleListBox* listBox,
+        TInt aResId,AknPopupLayouts::TAknPopupLayouts aPopuplayout,
+        TInt   aTimeout  )
+    {
+    CSyncMLAknPopUpList* self = new( ELeave ) CSyncMLAknPopUpList(aTimeout);
+    CleanupStack::PushL( self );
+    self->ConstructL(listBox,aResId,aPopuplayout );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::ConstructL()
+// Second phase constructor
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAknPopUpList::ConstructL(CAknSingleHeadingPopupMenuStyleListBox* aListBox, 
+                                     TInt aCbaResource,
+                                     AknPopupLayouts::TAknPopupLayouts aType )
+    {
+    CAknPopupList::ConstructL(aListBox,aCbaResource,aType);
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::~CSyncMLAknPopUpList()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLAknPopUpList::~CSyncMLAknPopUpList()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        }
+   
+    if(iMmcwatcher)
+        {
+        iMmcwatcher->CancelMmcwatch();
+        delete iMmcwatcher;
+        iMmcwatcher = NULL;
+        }
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::TimerExpired
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAknPopUpList::TimerExpired()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        iTimeout = KSyncMLNNoListTimeout;
+        }
+    if(iMmcwatcher)
+        {
+        iMmcwatcher->CancelMmcwatch();
+        }
+    CancelPopup();
+       
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::ExecuteLD
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLAknPopUpList::ExecuteLD()
+    {
+    if ( iTimeout > KSyncMLNNoListTimeout )
+        {
+        iTimer = CSyncMLQueryTimer::NewL( this );
+        iTimer->After( iTimeout * KSyncMLuSecsInSec );
+        }
+    iMmcwatcher = CSyncmlmmcwatcher::NewL(this);
+    iMmcwatcher->StartL();
+    return CAknPopupList::ExecuteLD();
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::MmcRemoved
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAknPopUpList::MmcRemoved()
+    {
+    FLOG(_L("CSyncMLAknPopUpList::MmcRemoved- cancelling the pop up"));
+	immcremoved = ETrue;
+    CancelPopup();
+    FLOG(_L("CSyncMLAknPopUpList::MmcRemoved- cancelling the pop up done"));
+    }
+	
+// -----------------------------------------------------------------------------
+// CSyncMLAknPopUpList::IsMmcRemoved
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLAknPopUpList::IsMmcRemoved()
+    {
+    return immcremoved;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLAppLaunchNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,909 @@
+/*
+* 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:  Methods to parse the server alert messages for data sync and device
+*                Management frameworks. Launches respective application 
+*                in appropriate conditions
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <eikenv.h>          // Eikon environment
+#include <AknQueryDialog.h>
+#include <StringLoader.h>    // Localisation stringloader
+#include <SyncMLClientDS.h>
+#include <SyncMLClientDM.h>
+#include <SyncMLClient.h>
+#include <rconnmon.h>
+#include <ecom/ecom.h>
+#include <centralrepository.h>
+#include <SyncMLNotifierDomainCRKeys.h>
+#include <SyncMLNotifier.rsg>           // Own resources
+#include "SyncMLAppLaunchNotifier.h"    // Class declaration
+#include "SyncMLTimedMessageQuery.h"
+#include "SyncMLTimedQueryDialog.h"
+#include "SyncMLNotifDebug.h"
+#include <aknnotewrappers.h>
+#include <DevManInternalCRKeys.h>
+#include "nsmlconstantdefs.h"
+#include "CPreSyncPlugin.h"
+#include "SyncMLPreSyncPluginInterface.h"
+
+// CONSTANTS
+_LIT( KSmlNPanicCategory, "SyncMLNotifier");
+
+// medium type uids
+//const TUid KUidNSmlMediumTypeInternet  = { 0x101F99F0 };
+const TUid KUidNSmlMediumTypeBluetooth = { 0x101F99F1 };
+const TUid KUidNSmlMediumTypeUSB       = { 0x101F99F2 };
+const TUid KUidNSmlMediumTypeIrDA      = { 0x101F99F3 };
+const TUid KUidSmlSyncApp              = { 0x101F6DE5 };
+
+
+enum TASpBearerType
+    {
+    EAspBearerInternet = 0,
+    EAspBearerUsb = 1,
+    EAspBearerBlueTooth = 2,
+    EAspBearerIrda = 3,
+    EAspBearerWsp = 4,
+    EAspBearerSmlUsb = 5,
+    EAspBearerLast = 6
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::CSyncMLAppLaunchNotifier
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLAppLaunchNotifier::CSyncMLAppLaunchNotifier() :
+    iAlwaysAsk( EFalse )
+    {
+    iBearerType = KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDSNotifier::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLAppLaunchNotifier* CSyncMLAppLaunchNotifier::NewL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::NewL()"));
+    CSyncMLAppLaunchNotifier* self = new (ELeave) CSyncMLAppLaunchNotifier();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::NewL() completed"));
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CSyncMLAppLaunchNotifier::~CSyncMLAppLaunchNotifier()
+    {
+	delete iObserver;
+    delete iDMSyncService;
+    delete iDSSyncService;
+    Cancel();   // Free own resources
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::RetrieveSyncParams
+// Leaves if the job identifier is not found.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::RetrieveSyncParamsL(
+    TSyncServiceParam& aParam,
+    TDes& aServerName,
+    TSmlServerAlertedAction& aUserInteraction )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RetrieveSyncParamsL()"));
+    TSmlJobId currentJobId;
+    TSmlUsageType usageType;
+    
+    // sync session
+    RSyncMLSession syncSession;
+    syncSession.OpenL();
+    CleanupClosePushL( syncSession );
+    syncSession.CurrentJobL( currentJobId, usageType );
+
+    if ( currentJobId == iJobId &&
+         usageType == ESmlDataSync )
+        {
+        RSyncMLDataSyncProfile syncProfile;
+        syncProfile.OpenL( syncSession, iProfileId, ESmlOpenRead );
+        CleanupClosePushL( syncProfile );
+        
+        aParam.iProfileId = iProfileId;
+        aParam.iJobId = iJobId;
+        aServerName = syncProfile.DisplayName();
+        aUserInteraction = syncProfile.SanUserInteraction();
+        
+        // Check if always ask is selected as accesspoint
+        RSyncMLConnection connection;
+        TRAPD( iapError, connection.OpenL( syncProfile, KUidNSmlMediumTypeInternet.iUid ) );
+        CleanupClosePushL( connection );
+
+        if ( !iapError )
+            {
+            const TDesC8& iap = connection.GetPropertyL( KNSmlIAPId );
+            if ( iap.Compare( KNSmlAlwaysAsk() ) == 0 )
+                {
+                iAlwaysAsk = ETrue;
+                }            
+            
+            TInt id = connection.Identifier();
+            if (id == KUidNSmlMediumTypeInternet.iUid)
+                {
+                iBearerType = EAspBearerInternet;
+                }
+            else if (id == KUidNSmlMediumTypeBluetooth.iUid)
+                {
+                iBearerType = EAspBearerBlueTooth;
+                }
+            else if (id == KUidNSmlMediumTypeUSB.iUid)
+                {
+                iBearerType = EAspBearerUsb;
+                }
+            else if (id == KUidNSmlMediumTypeIrDA.iUid)
+                {
+                iBearerType = EAspBearerIrda;
+                }
+            else
+                {
+                iBearerType = KErrNotFound;
+                }            
+            }
+
+        connection.Close();
+        CleanupStack::Pop( &connection );
+        
+        syncProfile.Close();
+        CleanupStack::Pop( &syncProfile );
+        }
+    else
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RetrieveSyncParamsL() Could not find job %d"),
+            iJobId ) );
+        User::Leave( KErrNotFound );
+        }
+    
+    syncSession.Close();
+    CleanupStack::Pop( &syncSession );
+
+    FTRACE( FPrint(
+        _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RetrieveSyncParamsL() completed, aServerName = \"%S\""),
+        &aServerName ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::RetrieveMgmtParamsL
+// Leaves if the job identifier is not found.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::RetrieveMgmtParamsL(
+    TSyncServiceParam& aParam,
+    TDes& aServerName,
+    TSmlServerAlertedAction& aUserInteraction )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RetrieveMgmtParamsL()"));
+
+    TSmlJobId currentJobId;
+    TSmlUsageType usageType;
+    
+    RSyncMLSession syncSession;
+    
+    syncSession.OpenL();
+    CleanupClosePushL( syncSession );
+    
+    syncSession.CurrentJobL( currentJobId, usageType );
+    
+    if ( currentJobId == iJobId &&
+         usageType == ESmlDevMan )
+        {
+        RSyncMLDevManProfile syncProfile;
+        syncProfile.OpenL( syncSession, iProfileId, ESmlOpenRead );
+        CleanupClosePushL( syncProfile );
+        
+        aParam.iProfileId = iProfileId;
+        aParam.iJobId = iJobId;
+        aServerName = syncProfile.DisplayName();
+        aUserInteraction = syncProfile.SanUserInteraction();
+        syncProfile.Close();
+        CleanupStack::Pop( &syncProfile );
+        }
+    else
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RetrieveMgmtParamsL() Could not find job %d"),
+            iJobId ) );
+        User::Leave( KErrNotFound );
+        }
+    
+    syncSession.Close();
+    CleanupStack::Pop( &syncSession );
+
+    FTRACE( FPrint(
+        _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RetrieveMgmtParamsL() completed, aServerName = \"%S\""),
+        &aServerName ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::IsSilent
+// Only automatic acception from the profile is checked, since notifier has no
+// information about the preferences included in the server alert.
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLAppLaunchNotifier::IsSilent(
+    TSmlServerAlertedAction& aUserInteraction )
+    {
+    TBool retval = EFalse;
+    if ( aUserInteraction == ESmlEnableSync )
+        {
+        retval = ETrue;
+        }
+    return retval;
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::RegisterL
+// -----------------------------------------------------------------------------
+//
+CSyncMLAppLaunchNotifier::TNotifierInfo CSyncMLAppLaunchNotifier::RegisterL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RegisterL()"));
+    iInfo.iUid = KSyncMLAppLaunchNotifierUid;
+    iInfo.iChannel = KSmlAppLaunchChannel;
+    iInfo.iPriority = ENotifierPriorityVHigh;
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RegisterL() completed"));
+    return iInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::Cancel
+// Release all own resources (member variables)
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::Cancel()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::Cancel()"));
+
+    CSyncMLNotifierBase::Cancel();
+
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::Cancel() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::GetParamsL
+// Initialize parameters and check if device is already
+// in registry. Jump to RunL as soon as possible.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::GetParamsL( const TDesC8& aBuffer,
+                                                 TInt aReplySlot,
+                                           const RMessagePtr2& aMessage )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::GetParamsL()"));
+
+    if( iReplySlot != NULL || iNeedToCompleteMessage )
+        {
+        User::Leave( KErrInUse );
+        }
+    
+    iMessage = aMessage;
+    iNeedToCompleteMessage = ETrue;
+    iReplySlot = aReplySlot;
+    iAlwaysAsk = EFalse;
+
+	TSyncMLAppLaunchNotifParams param;
+ 	TPckgC<TSyncMLAppLaunchNotifParams> pckg( param );
+ 	pckg.Set(aBuffer);
+
+    iSmlProtocol = pckg().iSessionType;
+    iJobId = pckg().iJobId;
+    iProfileId = pckg().iProfileId;
+ TInt SanSupport( KErrNone );
+CRepository* centrep = NULL;
+    TRAPD( err, centrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys) );    
+    User::LeaveIfError( err );
+    centrep->Get( KDevManSANUIBitVariation, SanSupport );
+    delete centrep;
+	if( SanSupport == EON )
+   	{
+     iUimode = pckg().iUimode;
+   	}    
+    // Call SetActive() so RunL() will be called by the active scheduler
+    //
+    SetActive();
+    iStatus = KRequestPending;
+    TRequestStatus* stat = &iStatus;
+    User::RequestComplete( stat, KErrNone );
+
+    FTRACE( FPrint(
+        _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::GetParamsL() completed, iSmlProtocol = %d, iJobId = %d, iProfileId = %d"),
+        iSmlProtocol, iJobId, iProfileId ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::ReadRepositoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::ReadRepositoryL(TInt aKey, TInt& aValue)
+    {
+    CRepository* rep = CRepository::NewLC(KCRUidNSmlDSApp);
+    TInt err = rep->Get(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+    }
+
+void CSyncMLAppLaunchNotifier::ShowRoamingMessageL(TInt keypress, TUint profileId)
+    {
+    TBool roaming = EFalse;
+    
+    if( (keypress == EAknSoftkeyYes || keypress == EAknSoftkeyOk) &&  (iSmlProtocol == ESyncMLSyncSession) )
+       {
+       TBool bCanSync = ETrue;
+       
+       TInt aValue = 0;
+       ReadRepositoryL(KNSmlDSRoamingFeature, aValue);
+       IsRoamingL(roaming);
+       if(( roaming ) && (aValue == EAspRoamingSettingFeatureEnabled))
+           {                
+              if (iBearerType == EAspBearerInternet)           
+               {
+               CPreSyncPluginInterface* syncPluginInterface = CPreSyncPluginInterface::NewL();
+               CPreSyncPlugin* syncPlugin = 
+                   syncPluginInterface->InstantiateRoamingPluginLC(profileId);
+
+               // Turn lights on and deactivate apps -key
+               TurnLightsOn();  
+               SuppressAppSwitching( ETrue );
+
+               if(syncPlugin->IsSupported())
+                   {
+                   bCanSync = syncPlugin->CanSyncL();
+                   }
+
+               SuppressAppSwitching( EFalse );
+               
+               CleanupStack::PopAndDestroy(syncPlugin);
+               //syncPluginInterface->UnloadPlugIns();
+               delete  syncPluginInterface;   
+
+               if(!bCanSync)
+                   {
+                   iNeedToCompleteMessage=EFalse;
+                   iReplySlot = NULL;
+                   iMessage.Complete( KErrCancel );
+                   return;
+                   }
+                   
+               }                       
+           }            
+       }
+    }
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::RunL
+// Ask user response and return it to caller.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::RunL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL()"));
+		stringholder =NULL;
+		
+    TLanguage language = User::Language();  
+    // Load the parameters and set the query text according to the session type.
+    switch( iSmlProtocol )
+        {
+        case ESyncMLSyncSession:
+            {
+            FLOG( _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() Synchronisation session") );
+
+            TBuf<KSyncMLMaxProfileNameLength> serverName;
+            RetrieveSyncParamsL( param, serverName, uiAction );
+            stringholder = StringLoader::LoadL( R_SML_INIT_DS_SERVER_PROMPT,
+                                                serverName );
+            if(!stringholder)
+                return;
+            }
+			break;
+        case ESyncMLMgmtSession:
+            {
+            	TBool status = HandleDMSessionL();
+            	if( !status )
+            		return;
+            }
+            break;
+        default: // Unknown value
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() unknown protocol value"));
+            User::Leave( KErrArgument ); // Leave handling completes the message
+            return;
+            }
+        }
+
+    CleanupStack::PushL( stringholder );
+    	
+   	centrep = NULL;
+    TRAPD( err, centrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys) );    
+    if(err)
+    {
+    	centrep = NULL;
+    }
+
+    TInt keypress( 0 );
+    TBool  silent = EFalse;
+		TInt SanSupport( KErrNone ),Timeout( KErrNone),CustomNotes(KErrNone);;
+    if(centrep)
+    {centrep->Get( KDevManSANUIBitVariation, SanSupport );
+     centrep->Get( KDevManServerAlertTimeout, Timeout );
+     centrep->Get( KDevManUINotesCustomization, CustomNotes);	
+    }
+    else
+    {
+    	  SanSupport = KErrNone;
+        Timeout = KDefaultTimeoutforNotes; 
+        CustomNotes = KErrNone ;
+    }   
+    Timeout = Timeout * 60 ;// converting to mins
+    delete centrep;
+		if(( SanSupport == EON )&& ( iSmlProtocol == ESyncMLMgmtSession))
+   	{
+    if( iUimode > ESANUserInteractive && iUimode < ESANNotSpecified )
+    	{
+    	iUimode = ESANNotSpecified;
+    	}
+    switch( iUimode ) 	
+    	{
+    		case ESANNotSpecified://not specified
+    		case ESANUserInteractive://user interactive session
+    		      silent = EFalse;    		      
+    		      break;
+    		case ESANSilent://Background
+    		case ESANUserInformative://Informative session
+    		      silent =  ETrue;//IsSilent( uiAction );     		      
+    		      break;  
+    	}
+   }
+   else
+       {
+       	silent =  IsSilent( uiAction );
+       }
+    if ( iAlwaysAsk && iSmlProtocol == ESyncMLMgmtSession )	//check with synergy    
+    	{
+    	silent = EFalse;
+    	}
+    if ( !silent || iAlwaysAsk )
+        {
+        // Turn lights on and deactivate apps -key
+        TurnLightsOn();  
+        SuppressAppSwitching( ETrue );
+
+        CSyncMLTimedQueryDialog* dlg =
+                CSyncMLTimedQueryDialog::NewL( *stringholder,
+                                               Timeout );    
+            
+        // Pushed dialog is popped inside RunLD
+        dlg->PrepareLC( R_SML_CONFIRMATION_QUERY );
+        
+        	dlg->ButtonGroupContainer().SetCommandSetL(
+        	        					R_AVKON_SOFTKEYS_YES_NO__YES );
+        keypress = dlg->RunLD();
+        dlg = NULL;
+        // Activate apps -key again
+        //
+        SuppressAppSwitching( EFalse );
+        }
+
+    CleanupStack::PopAndDestroy( stringholder );
+    
+    ShowRoamingMessageL(keypress, param.iProfileId);
+
+    if ( iNeedToCompleteMessage ) // Notifier is not cancelled
+        {
+        	HandleCompleteMessageL(keypress, silent, SanSupport, Timeout, CustomNotes);
+        }
+
+    iNeedToCompleteMessage = EFalse;
+    iReplySlot = NULL;
+
+    iSmlProtocol = ESyncMLUnknownSession;
+    iJobId = 0;
+
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() completed"));
+    }
+
+// ----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::RunError
+// ----------------------------------------------------------------------------
+TInt CSyncMLAppLaunchNotifier::RunError ( TInt aError )
+    {
+    FTRACE( FPrint(
+								_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunError() The Error occurred is   %d"), aError ) );
+    return KErrNone;
+    }	
+    
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::SyncServiceL
+// -----------------------------------------------------------------------------
+//
+CSyncService* CSyncMLAppLaunchNotifier::SyncServiceL( TUint aServiceId )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::SyncService"));
+
+    if ( aServiceId == KDevManServiceStart )
+        {
+        if ( !iDMSyncService )
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::SyncServiceL() DM NewL"));
+            iDMSyncService = CSyncService::NewL( NULL, KDevManServiceStart );
+            }
+        return iDMSyncService;
+        }
+    else
+        {
+        if ( !iDSSyncService )
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::SyncServiceL() DS NewL"));
+            iDSSyncService = CSyncService::NewL( NULL, KDataSyncServiceStart );
+            }
+        return iDSSyncService;
+        }
+    }
+//------------------------------------------------------------------------------
+//CSyncMLAppLaunchNotifier::IsRoaming(TBool& ret)
+//Returns true if roaming otherwise returns false
+ 
+//------------------------------------------------------------------------------
+
+void CSyncMLAppLaunchNotifier::IsRoamingL(TBool &ret)
+	{
+	  FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsRoaming() Begin"));
+		RConnectionMonitor monitor;
+	  TRequestStatus status;
+		// open RConnectionMonitor object
+		monitor.ConnectL();
+		CleanupClosePushL( monitor );
+		TInt netwStatus(0);
+		monitor.GetIntAttribute( EBearerIdGPRS, // See bearer ids from TConnMonBearerId
+	                         0, 
+	                         KNetworkRegistration,
+	                         netwStatus, 
+	                         status );
+	  User::WaitForRequest( status );
+	  if ( status.Int() == KErrNone )
+	 	   {
+				switch(netwStatus)
+				{
+					case ENetworkRegistrationRoaming :
+					{
+						FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsRoaming() ENetworkRegistrationRoaming"));
+						ret=true;
+						break;
+					}
+		   		default:
+			 		{
+			 			FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsRoaming() Roaming status "));
+			 			FTRACE( FPrint(
+					  _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsRoamingL() cell is not in roaming, network status is  %d"), netwStatus ) );
+			 			break;	
+			 		}
+			}
+			CleanupStack::PopAndDestroy();
+		}
+		else
+			{
+				FTRACE( FPrint(
+			  _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsRoamingL() RConnectinMonitor status.Int() returned error %d"), status.Int() ) );
+			}
+	}
+//------------------------------------------------------------------------------
+//CSyncMLAppLaunchNotifier::HandleDMSessionL()
+//Handles the DM Session 
+//------------------------------------------------------------------------------
+
+TBool CSyncMLAppLaunchNotifier::HandleDMSessionL()
+{
+		FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::HandleDMSessionL begins"));
+		TBool ret(ETrue);
+		TInt dmroamingBlock = 0;
+    TBool roaming = EFalse;
+    TLanguage language = User::Language();
+	  FLOG( _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() Management session") );
+		CRepository* cRepository=NULL;
+		TRAPD ( error, cRepository = CRepository::NewL ( KCRUidNSmlNotifierDomainKeys ) );
+		if ( error == KErrNone )
+		{
+			CleanupStack::PushL( cRepository );
+			cRepository->Get ( KNSmlDMBlockedInRoaming, dmroamingBlock );
+			if(dmroamingBlock==1)
+			{
+				FLOG( _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() roaming feature is enabled") );
+				TRAPD(rError,IsRoamingL(roaming));
+				if( (rError==KErrNone) && roaming )
+				{
+					FLOG( _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() phone is in roaming, DM session is blocked ") );
+					CleanupStack::PopAndDestroy( cRepository );//cRepository
+					iNeedToCompleteMessage=EFalse;
+					iReplySlot = NULL;
+					ret = EFalse;
+					return ret;
+				}
+				else
+				{
+					FTRACE( FPrint(
+								_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() error in getting Network status  %d"), rError ) );
+          FTRACE( FPrint(
+          			_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() error in getting Network status  %d"),roaming ) );
+									}
+				}
+				else
+				{
+					FLOG( _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() DM blocking feature disabled ") );
+				}
+				CleanupStack::PopAndDestroy( cRepository );//cRepository
+			}
+			else
+			{
+				FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL() cenrep creation error code  %d"),
+            error ) );
+			}
+      TBuf<KSyncMLMaxProfileNameLength> serverName;
+      RetrieveMgmtParamsL( param, DMSyncServerName, uiAction );            
+      TInt CustomNotes(KErrNone), SanSupport( KErrNone );  
+      CRepository* centrep = NULL;  
+      TRAPD(err1, centrep = CRepository::NewL ( KCRUidDeviceManagementInternalKeys ) );
+      if((centrep) && (err1 == KErrNone))
+      {
+      	centrep->Get( KDevManUINotesCustomization, CustomNotes);
+        centrep->Get( KDevManSANUIBitVariation, SanSupport );
+      }
+      else
+      {
+      	CustomNotes = 0;
+        SanSupport  = 0;	
+      }
+      delete centrep;             
+                                                        
+      if(CustomNotes && SanSupport && IsLanguageSupportedL())
+      {
+      	stringholder = StringLoader::LoadL( R_QTN_DM_QUERY_ACCEPT_POSTSALE);	//This note will be shown in chinese variant itself 
+      }
+      else
+      { 
+      	stringholder = StringLoader::LoadL( R_SML_INIT_DM_SERVER_PROMPT,DMSyncServerName );
+      }      
+      FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::HandleDMSessionL ends"));
+      return ret;
+}
+
+//------------------------------------------------------------------------------
+//CSyncMLAppLaunchNotifier::HandleCompleteMessageL(TInt &keypress, TBool &silent, TInt &SanSupport, TInt &Timeout, TInt &CustomNotes)
+// Handle the complete message
+//------------------------------------------------------------------------------
+	
+void CSyncMLAppLaunchNotifier::HandleCompleteMessageL(TInt &keypress, TBool &silent, TInt &SanSupport, TInt &Timeout, TInt &CustomNotes)
+{
+	TLanguage language = User::Language();
+	TInt err = KErrNone;
+	_LIT_SECURITY_POLICY_S0(KWritePolicy,KUidSmlSyncApp.iUid);
+	_LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData );
+	                  
+	if( keypress == EAknSoftkeyYes || keypress == EAknSoftkeyOk || silent ) // User has accepted the dialog
+  {
+		TInt retval = 1; // Default for ESyncMLSyncSession or silent
+	if( iSmlProtocol == ESyncMLMgmtSession && SanSupport == EON && silent && iUimode == ESANUserInformative )
+	{
+		// Turn lights on and deactivate apps -key
+  	TurnLightsOn(); 	  
+   	if(CustomNotes && IsLanguageSupportedL()) 
+   	{
+   		FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::informative session inside if "));
+  		stringholder = StringLoader::LoadLC(R_QTN_DM_INFO_NOTE_POSTSALE);	 //This note will be shown in chinese variant only
+   	}
+   	else
+   	{
+    	stringholder = StringLoader::LoadLC(R_QTN_DM_INFO_NOTE_UPDATING , DMSyncServerName );
+    }   
+		CAknInformationNote* informationNote = new (ELeave) CAknInformationNote ();
+		informationNote->ExecuteLD ( stringholder->Des() );
+		informationNote = NULL;
+		CleanupStack::PopAndDestroy( stringholder );	
+   }
+
+	if ( retval )
+	{
+		const TUid KUidFakeUID = { 0 };
+	  TSyncMLAppLaunchNotifRetVal pckg;
+	  pckg.iSecureId = KUidFakeUID;
+	           
+	  switch( iSmlProtocol )
+	  {
+	  	case ESyncMLSyncSession:
+	    					param.iServiceId = KDataSyncServiceStart;
+	             	break;
+	    case ESyncMLMgmtSession:
+                
+                  //Define a property for Native Disclaimer 
+                  
+	              err = RProperty::Define(KDisclaimerProperty, KDisclaimerInteger, RProperty::EInt, KReadPolicy, KWritePolicy);
+	              if (err != KErrAlreadyExists)
+	                  {
+                      User::LeaveIfError(err);
+	                  }
+	              param.iServiceId = KDevManServiceStart;
+								if( SanSupport == EON )
+								{													
+	              	param.iSilent = iUimode;	                    	                               
+								}
+				iObserver = new (ELeave) CDMDisclaimerObserver();
+				pckg.iSecureId = SyncServiceL( param.iServiceId )->StartSyncL( param );
+				FLOG(_L("[SmlNotif]\t WaitonDisclaimerL called"));
+				iObserver->WaitOnDisclaimerL(this);
+	              break;
+	    default:
+	              // This branch should never be reached, since the option
+	              // is handled in the previous switch statement.
+	              User::Panic( KSmlNPanicCategory, KErrCorrupt );
+	              break;
+	  }	
+	 iMessage.WriteL( iReplySlot, TPckgBuf<TSyncMLAppLaunchNotifRetVal>(pckg) );
+	 if(iSmlProtocol == ESyncMLSyncSession)
+	     {
+         iMessage.Complete(KErrNone);
+
+	     }
+	 }
+	 else
+	 {
+	  	// Complete the message with result code indicating that
+		  // the user cancelled the query.
+	    iMessage.Complete( KErrCancel );
+	 }
+  }
+  else
+  {
+  	// Complete the message with result code indicating that
+    // the user cancelled the query.
+    iMessage.Complete( KErrCancel );
+  }
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::IsLanguageSupportedL
+// Returns True if the specified language is supported.
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLAppLaunchNotifier::IsLanguageSupportedL()
+{
+	FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsLanguageSupportedL begins"));
+	TBool retVal(EFalse);
+	TLanguage language = User::Language();
+	if(language == ELangEnglish || language == ELangInternationalEnglish ||
+ 		   language == ELangTaiwanChinese ||language == ELangHongKongChinese || language == ELangPrcChinese)
+ 		   retVal = ETrue;
+ 	FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::IsLanguageSupportedL ends"));
+ 	return retVal;
+}
+// -----------------------------------------------------------------------------
+// CSyncMLAppLaunchNotifier::CompleteMessageL
+// Completes the message according to whether Privacy Policy disclaimer is accepted
+// -----------------------------------------------------------------------------
+//
+void CSyncMLAppLaunchNotifier::CompleteMessageL(TInt aDisclaimerAccepted)
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::CompleteMessageL begins"));
+    if(aDisclaimerAccepted == 1)
+        {
+        iMessage.Complete(KErrNone);
+        }
+    else
+        {
+        iMessage.Complete(KErrCancel);
+        }
+    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::CompleteMessageL Ends"));
+    }
+
+//---------------------------------------------------------------------------------
+// CDMDisclaimerObserver::CDMDisclaimerObserver
+// Constructor
+//---------------------------------------------------------------------------------
+CDMDisclaimerObserver::CDMDisclaimerObserver()
+: CActive(0)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+//---------------------------------------------------------------------------------
+// CDMDisclaimerObserver::~CDMDisclaimerObserver
+// Destructor
+//---------------------------------------------------------------------------------
+CDMDisclaimerObserver::~CDMDisclaimerObserver()
+    {
+    Cancel();
+    iDisclaimerProperty.Close();
+    }
+
+//---------------------------------------------------------------------------------
+// CDMDisclaimerObserver::WaitOnDisclaimerL
+// Subscribes to Property set when Privacy policy disclaimer is accepted
+//---------------------------------------------------------------------------------
+void CDMDisclaimerObserver::WaitOnDisclaimerL( CSyncMLAppLaunchNotifier* aPtr)
+    {    
+    FLOG(_L("[SmlNotif]\t CDMDisclaimerObserver::WaitOnDisclaimerL begins"));
+    iNot = aPtr;
+    // subscribe;
+	if(!IsActive())
+		{
+		TInt err= iDisclaimerProperty.Attach(KDisclaimerProperty, KDisclaimerInteger, EOwnerThread);		
+        //User::LeaveIfError(err);
+		iStatus=KRequestPending;
+		iDisclaimerProperty.Subscribe(iStatus);
+        SetActive();
+		}            
+	FLOG(_L("[SmlNotif]\t CDMDisclaimerObserver::WaitOnDisclaimerL ends"));
+    }
+
+// --------------------------------------------------------------------------
+// CDMDisclaimerObserver::DoCancel()
+// From base class
+// --------------------------------------------------------------------------
+//
+void CDMDisclaimerObserver::DoCancel()
+    {
+	 if( iStatus == KRequestPending )
+    	{	    	
+    	TRequestStatus* status = &iStatus;
+    	User::RequestComplete( status, KErrCancel );
+    	}
+    }    
+// --------------------------------------------------------------------------
+// CDMDisclaimerObserver::RunL()
+// Calls CompleteMessageL 
+// --------------------------------------------------------------------------
+//
+void CDMDisclaimerObserver::RunL()
+    {
+    FLOG(_L("[SmlNotif]\t CDMDisclaimerObserver::RunL begins"));
+    iDisclaimerProperty.Get(iPropertyVal);
+     
+    iNot->CompleteMessageL(iPropertyVal);
+        
+    FLOG(_L("[SmlNotif]\t CDMDisclaimerObserver::RunL End"));
+    }
+
+// --------------------------------------------------------------------------
+// CDMDisclaimerObserver::RunError()
+// --------------------------------------------------------------------------
+//
+TInt CDMDisclaimerObserver::RunError(TInt aError)
+    {
+    FTRACE( FPrint( _L("[SmlNotif]\t CDMDisclaimerObserver::RunError() Error = %d"), aError ) );
+    return KErrNone;
+    }
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLDlgNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,992 @@
+/*
+* 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:  Methods for the SyncML Appserver starter notifier
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <eikenv.h>             // Eikon environment
+#include <SyncMLClient.h>
+#include <SyncMLClientDS.h>
+#include <SyncMLClientDM.h>
+#include <SyncService.h>
+#include <aknnotewrappers.h>
+#include <s32mem.h> 
+#include <in_sock.h>
+#include <StringLoader.h>    // Localisation stringloader
+#include <aknlists.h>
+#include <avkon.mbg>
+#include <aknconsts.h>
+#include <utf.h>
+#include <SyncMLNotifier.rsg>   // Own resources
+#include "SyncMLDlgNotifier.h"  // Class definition
+#include "SyncMLTimedMessageQuery.h"
+#include "SyncMLAppLaunchNotifier.h"
+#include "SyncMLNotifDebug.h"
+#include "SyncMLTimedInputTextQuery.h"
+#include "SyncMLTimedDateQuery.h"
+#include "SyncMLTimedNumberQueryDialog.h"
+#include "SyncMLAknPopUplist.h"
+
+// CONSTANTS
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLDlgNotifier* CSyncMLDlgNotifier::NewL(
+    CSyncMLAppLaunchNotifier* aAppLaunchNotif )
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::NewL()") );
+    CSyncMLDlgNotifier* self = new (ELeave) CSyncMLDlgNotifier( aAppLaunchNotif );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::NewL() completed") );
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CSyncMLDlgNotifier::~CSyncMLDlgNotifier()
+    {
+    Cancel();   // Free own resources
+    if(iListItems)
+        {
+        delete iListItems;
+        iListItems = NULL;
+        }
+    if(iChunk.Handle())
+        {
+        iChunk.Close();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::EnableSyncProgressNoteL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLDlgNotifier::EnableSyncProgressNoteL( TBool aEnable )
+    {
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLDlgNotifier::EnableSyncProgressNoteL(), aEnable = %d" ),
+        aEnable ) );
+        
+    TSmlJobId currentJobId( KErrNotFound );
+    TSmlUsageType usageType;
+    TUint serviceId = 0;
+    RSyncMLSession syncSession;
+    CleanupClosePushL( syncSession );
+    
+    syncSession.OpenL();
+    syncSession.CurrentJobL( currentJobId, usageType );
+    syncSession.Close();
+    CleanupStack::Pop( &syncSession );
+
+    if ( currentJobId != KErrNotFound )
+        {
+        switch( usageType )
+            {
+            case ESmlDataSync:
+                serviceId = KDataSyncServiceStart;
+                break;
+            case ESmlDevMan:
+                serviceId = KDevManServiceStart;
+                break;
+            default:
+                User::Leave( KErrArgument );
+                break;
+            }
+
+        // There should be a valid pointer to the application launcher
+        // notifier, but we can survive without it. Therefore we'll just
+        // check for it to prevent a crash.
+        if ( iAppLaunchNotif )
+            {
+            CSyncService* syncService = iAppLaunchNotif->SyncServiceL( serviceId );
+            if ( syncService )
+                {
+                syncService->EnableProgressNoteL( aEnable );
+                }
+            }
+        }
+    else
+        {
+        User::Leave( KErrNotFound );
+        }
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::EnableSyncProgressNoteL() completed") );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::RegisterL
+// -----------------------------------------------------------------------------
+//
+CSyncMLDlgNotifier::TNotifierInfo CSyncMLDlgNotifier::RegisterL()
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RegisterL()") );
+    iInfo.iUid = KSyncMLDlgNotifierUid;
+    iInfo.iChannel = KSmlDlgChannel;
+    iInfo.iPriority = ENotifierPriorityHigh;
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RegisterL() completed") );
+    return iInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::GetParamsL
+// Initialize parameters and check if device is already
+// in registry. Jump to RunL as soon as possible.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLDlgNotifier::GetParamsL( const TDesC8& aBuffer,
+                                           TInt    aReplySlot,
+                                     const RMessagePtr2& aMessage )
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::GetParamsL()") );
+    const TChar KDRSeparator('-');
+    const TChar KChoiceItemSeparator(',');
+    if ( iReplySlot != NULL || iNeedToCompleteMessage )
+        {
+        User::Leave( KErrInUse );
+        }
+    iMessage = aMessage;
+    iNeedToCompleteMessage = ETrue;
+    iReplySlot = aReplySlot;
+
+    TSyncMLDlgNotifParams param;
+    TPckgC<TSyncMLDlgNotifParams> pckg( param );
+    pckg.Set( aBuffer );
+    iNoteType = pckg().iNoteType;
+    iServerMsg.Copy( pckg().iServerMsg.Left( KSyncMLMaxServerMsgLength ) );
+    iMaxTime = pckg().iMaxTime;
+    iMaxlen = pckg().iMaxLength;
+    //check for iDR is there are not
+    iDR.Copy( pckg().iDR.Left( KSyncMLMaxDefaultResponseMsgLength ) );
+    iIT = pckg().iIT;
+    iET = pckg().iET;
+    //verification of other params as like maxtime
+    if ( iMaxlen <= 0 || iMaxlen >KSyncMLMaxDefaultResponseMsgLength )
+        {
+        iMaxlen = KSyncMLMaxDefaultResponseMsgLength;
+        }
+
+    if ( iIT < ESyncMLInputTypeAlphaNumeric || iIT > ESyncMLInputTypeIPAddress )
+        {
+        iIT = ESyncMLInputTypeAlphaNumeric;
+        }
+
+    if ( iET < ESyncMLEchoTypeText || iET > ESyncMLEchoTypePassword )
+        {
+        iET = ESyncMLEchoTypeText;
+        }
+
+    if( iServerMsg.Length() == 0 )
+        {
+        HBufC* stringholder = NULL;
+        stringholder = StringLoader::LoadLC( R_DEFAULT_ALERT_HEADING );
+        iServerMsg.Copy( stringholder->Des() );
+        CleanupStack::PopAndDestroy( stringholder );
+        }
+    if ( iMaxTime < 0 )
+        {
+        iMaxTime = 0;
+        }
+    if (iNoteType == ESyncMLSingleChoiceQuery || iNoteType == ESyncMLMultiChoiceQuery )
+        {
+		iNumberOfItems = pckg().iNumberOfItems;  		
+        if(iNumberOfItems > 0)
+            {            
+            iListItems = new (ELeave) CDesCArrayFlat( iNumberOfItems );
+            }
+		else
+			{
+		    aMessage.Complete( KErrCancel );
+			iNeedToCompleteMessage = EFalse;
+			return;
+			}
+        TPtrC8 listitemsptr;
+        TBuf<KSyncMLChoiceItemsLengthBuffer> listlengtharray;                
+        User::LeaveIfError(iChunk.OpenGlobal(pckg().iChunkName,EFalse));
+        TInt size1 = iChunk.Size();
+        listitemsptr.Set(iChunk.Base(),size1);        
+        HBufC* databuf = NULL;
+        TRAPD(errC, databuf = CnvUtfConverter::ConvertToUnicodeFromUtf8L(listitemsptr));
+        iChunk.Close();
+        if(errC)
+            {
+            aMessage.Complete( errC );
+            iNeedToCompleteMessage = EFalse;
+            return;
+            }
+        CleanupStack::PushL(databuf);
+        TPtr listitems = databuf->Des();                       		
+        listlengtharray=pckg().iItemLength;      
+        TPtrC temp1,temp2,temp3,temp4;        
+        TInt currlen=0,itemlength=0;
+        TInt prevcommapos=0;
+        TBuf<4> checkon(_L("0\t"));
+        TBuf<4> checkoff(_L("1\t"));        
+        for(TInt i=0;i<listlengtharray.Length();i++)
+            {            
+            if(listlengtharray[i]== KChoiceItemSeparator )
+                {
+                if(prevcommapos)
+                    {
+                    temp1.Set(listlengtharray.LeftTPtr(i));
+                    temp2.Set(temp1.Right(i-(prevcommapos+1)));
+                    prevcommapos=  i;
+                    }
+                else //firsttime finding comma
+                    {
+                    prevcommapos=  i;
+                    temp1.Set(listlengtharray.LeftTPtr(i));
+                    temp2.Set(temp1.Right(i));
+                    }                
+                TLex lexval;
+                lexval.Assign(temp2);
+                lexval.Val(itemlength);                
+                temp3.Set(listitems.Left(currlen + itemlength));
+                temp4.Set(temp3.Right(itemlength));
+                currlen += itemlength;                
+                HBufC* item1 = HBufC::NewLC(temp4.Length()+3);
+                if(iNoteType == ESyncMLMultiChoiceQuery)
+                    {
+                    item1->Des().Append(checkoff);//by default dont show check on                                     
+                    }                
+                item1->Des().Append(temp4);
+                iListItems->AppendL(item1->Des());
+                CleanupStack::PopAndDestroy(1);//item,dataBuf16                
+                }
+            }
+        CleanupStack::PopAndDestroy(1);
+        }   
+    SetActive();
+    iStatus = KRequestPending;
+    TRequestStatus* stat = &iStatus;
+    User::RequestComplete( stat, KErrNone );
+
+    FTRACE( FPrint( _L(
+            "[SmlNotif]\t CSyncMLDlgNotifier::GetParamsL() completed, iNoteType = %d, iTimeout = %d, iServerMsg = " ),
+            iNoteType, iMaxTime ) );
+    FTRACE( FPrint( _L(
+            "[SmlNotif]\t \"%S\"" ),
+            &iServerMsg ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::Cancel
+// -----------------------------------------------------------------------------
+//
+void CSyncMLDlgNotifier::Cancel()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::Cancel()"));
+
+    CSyncMLNotifierBase::Cancel();
+
+    FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::Cancel() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::RunL
+// Ask user response and return it to caller.
+// Store device into registry if user has accepted authorisation.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLDlgNotifier::RunL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::RunL()"));
+    const TChar KDRSeparator('-');
+    const TChar KChoiceItemSeparator(',');
+    TInt result( KErrNone );
+ 		EndKeyPress = EFalse;
+    // Turn lights on and deactivate apps -key
+    //
+    TurnLightsOn();  
+
+    switch( iNoteType )
+        {
+        case ESyncMLInfoNote:
+            {
+            CAknInformationNote* infoNote = new (ELeave) CAknInformationNote;
+            TInt maxtime = iMaxTime * KSyncMLuSecsInSec;
+            if ( maxtime < 0  )
+                {
+                maxtime = 0;
+                }
+            infoNote->SetTimeout( (CAknNoteDialog::TTimeout) maxtime );
+            result = infoNote->ExecuteLD( iServerMsg );
+            if ( result == KErrNone )
+                {
+                result = EAknSoftkeyOk;
+                }
+            break;
+            }
+        case ESyncMLErrorNote:
+            {
+            CAknErrorNote* errNote = new (ELeave) CAknErrorNote;
+            TInt maxtime = iMaxTime * KSyncMLuSecsInSec;
+            if ( maxtime < 0  )
+                {
+                maxtime = 0;
+                }
+            errNote->SetTimeout( (CAknNoteDialog::TTimeout) maxtime );
+            result = errNote->ExecuteLD( iServerMsg );
+            if ( result == KErrNone )
+                {
+                result = EAknSoftkeyOk;
+                };
+            break;
+            }
+        case ESyncMLOkQuery:
+            {
+            FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() Ok/Empty query shown") );
+            
+            CSyncMLTimedMessageQuery* dlg =
+                CSyncMLTimedMessageQuery::NewL( iServerMsg, iMaxTime );
+            
+            // Pushed dialog is popped inside RunLD
+            dlg->PrepareLC( R_SML_MESSAGE_QUERY );
+            	dlg->ButtonGroupContainer().SetCommandSetL( 
+                                        R_AVKON_SOFTKEYS_OK_EMPTY__OK );
+            EnableSyncProgressNoteL( EFalse );
+            result = dlg->RunLD();
+            dlg = NULL;
+            EnableSyncProgressNoteL( ETrue );
+            break;
+            }
+            
+        case ESyncMLQueryNote:  // This enumeration will be removed.
+        case ESyncMLYesNoQuery:
+            {
+            FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() Yes/No query shown") );
+            CSyncMLTimedMessageQuery* dlg = 
+            CSyncMLTimedMessageQuery::NewL( iServerMsg, iMaxTime );
+            // Pushed dialog is popped inside RunLD
+            dlg->PrepareLC( R_SML_MESSAGE_QUERY );
+            dlg->ButtonGroupContainer().SetCommandSetL( 
+                    R_AVKON_SOFTKEYS_YES_NO__YES );
+            EnableSyncProgressNoteL( EFalse );
+            result = dlg->RunLD();
+            dlg = NULL;
+            EnableSyncProgressNoteL( ETrue );
+            break;
+            }
+        case ESyncMLSingleChoiceQuery:
+            {
+			FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() single choice list query") );             
+            if ( iNumberOfItems > 0 )
+                {
+                SuppressAppSwitching( ETrue );
+                EnableSyncProgressNoteL( EFalse );
+                CEikFormattedCellListBox* listBox = new ( ELeave )
+                CAknSinglePopupMenuStyleListBox;
+                CleanupStack::PushL( listBox );
+                CSyncMLAknPopUpList* popupList = 
+                CSyncMLAknPopUpList::NewL( (CAknSingleHeadingPopupMenuStyleListBox*)listBox, 
+                            R_AVKON_SOFTKEYS_OK_CANCEL__OK,
+                            AknPopupLayouts::EMenuWindow,iMaxTime );
+                CleanupStack::PushL( popupList );
+                listBox->ConstructL( popupList, ( EAknListBoxSelectionList | EAknListBoxLoopScrolling ) );
+                listBox->Model()->SetItemTextArray( iListItems );
+                listBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+                listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
+                listBox->HandleItemAdditionL();
+                listBox->CreateScrollBarFrameL( ETrue );
+                listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+                        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+                TInt defaultindex = 0;
+                TLex drval(iDR);                    
+                drval.Val(defaultindex);
+                if(defaultindex > 0)
+                    defaultindex--;
+                else
+                    defaultindex = 0;
+                listBox->SetCurrentItemIndex(defaultindex);                                   
+                popupList->SetTitleL( iServerMsg );
+                CleanupStack::Pop( popupList );
+				FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() single choice list query shown") ); 
+                result = popupList->ExecuteLD();
+				FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() single choice list query dismissed") ); 
+                popupList = NULL;
+                if ( result )
+                    {
+                    reply.irettext.Num(listBox->CurrentItemIndex()+1);
+                    }
+                reply.iretval = result;                
+                CleanupStack::PopAndDestroy( listBox );  // Destroys also the icon array
+                EnableSyncProgressNoteL( ETrue );
+                SuppressAppSwitching( EFalse );
+                }
+				else
+				{
+				reply.iretval = result;				
+				}
+				TSyncMLDlgNotifReturnParamsPckg pkg(reply);
+                iMessage.WriteL(iReplySlot,pkg);
+            break;
+            }
+        case ESyncMLMultiChoiceQuery:
+            {           
+            if ( iNumberOfItems > 0 )
+                {
+				SuppressAppSwitching( ETrue );
+                EnableSyncProgressNoteL( EFalse );
+                // create listbox
+                // list item string format: "0\tLabel" where 0 is an index to icon array
+                CEikFormattedCellListBox* listBox =
+                new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox;
+                CleanupStack::PushL( listBox );
+                // create popup
+                CSyncMLAknPopUpList* popup = 
+                CSyncMLAknPopUpList::NewL((CAknSingleHeadingPopupMenuStyleListBox*) listBox,
+                            R_AVKON_SOFTKEYS_OK_CANCEL__MARK ,
+                            AknPopupLayouts::EMenuWindow,iMaxTime);
+                CleanupStack::PushL( popup );
+                popup->SetTitleL(iServerMsg );
+#ifdef RD_SCALABLE_UI_V2
+                if( AknLayoutUtils::PenEnabled() )
+                    {
+                    listBox->ConstructL( popup, EAknListBoxStylusMultiselectionList );
+                    }
+                else
+                    {
+                    listBox->ConstructL( popup, EAknListBoxMultiselectionList );
+                    }
+#else
+                listBox->ConstructL( popup, EAknListBoxMultiselectionList );
+#endif
+                listBox->CreateScrollBarFrameL(ETrue);
+                listBox->ScrollBarFrame()->
+                SetScrollBarVisibilityL(
+                        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );                
+                SetIconsL(listBox);
+                listBox->Model()->SetItemTextArray( iListItems );
+                listBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+                listBox->SetCurrentItemIndex(iDefindex);  
+                listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );                
+                listBox->HandleItemAdditionL();
+                // set all items as selected
+                TInt count( listBox->Model()->NumberOfItems() );                
+                TBuf<20> drcheck;
+                for( TInt index( 0 ); index < count; index++ )
+                    {
+                    drcheck.Zero();
+                    drcheck.Append(KDRSeparator);
+                    drcheck.AppendNum(index+1);
+                    drcheck.Append(KDRSeparator);
+                    if(iDR.Find(drcheck) >= KErrNone)
+                        {
+                        listBox->View()->SelectItemL( index );
+                        }                                                            
+                    }              
+                // launch popup
+                result = popup->ExecuteLD();
+                // No leaving functions allowed between executeLD and CleanupStack::Pop().
+                CleanupStack::Pop( popup );                
+                /// Own: ListBox selection array
+                const CArrayFix<TInt>* iSelectionArray;                
+                if( result )
+                    {
+                    iSelectionArray = listBox->View()->SelectionIndexes();
+                    TBuf<20> temp;
+                    TBuf<KSyncMLMaxAlertResultLength> temp1;
+                    for(TInt i=iSelectionArray->Count()-1;i>=0;i--)
+                        {
+                        temp.Num(iSelectionArray->At(i)+1);
+                        if((temp1.Length() + temp.Length()) < KSyncMLMaxAlertResultLength )
+                            {
+                            temp1.Append(temp);
+                            temp1.Append(KDRSeparator);                            
+                            }
+                        else{
+                            break;
+                            }
+                        } 
+                    reply.irettext.Append(temp1);                    
+                    // delete iSelectionArray; this deletion taken care in ~CEIKLISTBOX (eiklbx.cpp)
+                    }
+                reply.iretval = result;
+                CleanupStack::PopAndDestroy(); // listBox                
+				EnableSyncProgressNoteL( ETrue );
+                SuppressAppSwitching( EFalse );					
+                }
+				else
+				{
+				reply.iretval = result;				
+				}
+				TSyncMLDlgNotifReturnParamsPckg pkg(reply);
+                iMessage.WriteL(iReplySlot,pkg);                                          
+            break;
+            }
+        case ESyncMLInputQuery: //For 1102 alert
+            {   
+            FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() Input query shown") ); 
+            // For input text server alert
+              
+            SuppressAppSwitching( ETrue );
+
+             switch( iIT )   
+             {
+             	case ESyncMLInputTypeAlphaNumeric: //Alphanumeric Input type
+             	    {
+             	     
+          				InputTypeAlphaNumericL(result);
+             	     break;
+             	    }
+             	    	
+             	case ESyncMLInputTypeNumeric: //Numeric Input type
+             		{
+             		InputTypeNumericL(result);
+             		break;
+             		}	
+             		
+             	case ESyncMLInputTypeDate: //Date Input type
+             	    {
+								InputTypeDateL(result);
+             	    break;
+             	    }		
+             			
+             	case ESyncMLInputTypeTime: //Time Input type
+             		{//create TTime from TBuf iDR
+             		//hhmmss
+								InputTypeTimeL(result);
+             		break;	
+             		}
+             		
+             	case ESyncMLInputTypePhoneNumber: //Phone Number Input type
+             		{
+								InputTypePhoneNumberL(result);
+             		break;
+             		}	
+             		
+             	case ESyncMLInputTypeIPAddress: //IP Address Input type
+             	    {			
+             	    	TBuf<KSyncMLMaxDefaultResponseMsgLength> InputText(iDR);
+                	TInetAddr destAddr;
+					destAddr.Input(iDR);					
+					EnableSyncProgressNoteL( EFalse );//coment out when using test app
+					CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL (destAddr); 
+					CleanupStack::PushL(dlg);
+					dlg->SetPromptL(iServerMsg);
+					CleanupStack::Pop(); //dlg
+					result=dlg->ExecuteLD( R_NEWALERT_IP_QUERY );
+					dlg=NULL;
+					destAddr.Output(InputText);				
+					reply.iretval = result;
+					reply.irettext=InputText;					
+             		EnableSyncProgressNoteL( ETrue );//coment out when using test app	
+             	    break;
+             	    }
+             			
+                default: 
+                    {
+                    	User::Leave( KErrArgument );
+                    }			
+             }
+             SuppressAppSwitching( EFalse );
+             TSyncMLDlgNotifReturnParamsPckg pkg(reply);
+             iMessage.WriteL(iReplySlot,pkg);
+             break;
+            }
+//#endif
+            
+        default: // Unhandled note type
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() Note type not handled"));
+            User::Leave( KErrArgument );
+            break;
+            }
+        }
+    // Complete message, if not cancelled
+    if ( iNeedToCompleteMessage )
+        {
+		 FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() completing the message"));
+        switch ( result )
+            {
+            case EAknSoftkeyYes:
+            case EAknSoftkeyOk:
+            case ETrue:    
+                {
+				FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() completing the message with KErrNone"));
+                iMessage.Complete( KErrNone );
+                break;
+                }
+            case EAknSoftkeyCancel:
+            case EAknSoftkeyNo:
+            case KErrNone:  // Pressing "Cancel" or "No" may return zero
+                {
+				FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() completing the message with KErrCancel"));
+                iMessage.Complete( KErrCancel );
+                break;
+                }
+            default:
+                {
+                iMessage.Complete( result );
+                break;
+                }
+            }
+        }
+
+    iNeedToCompleteMessage = EFalse;
+    iReplySlot = NULL;
+
+    iServerMsg = KNullDesC;
+
+    FLOG(_L("[SmlNotif]\t CSyncMLDlgNotifier::RunL() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::CSyncMLDlgNotifier
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLDlgNotifier::CSyncMLDlgNotifier( CSyncMLAppLaunchNotifier* aAppLaunchNotif )
+    : iAppLaunchNotif( aAppLaunchNotif ),iListItems(NULL),iDefindex(0)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::InputTypeAlphaNumericL(TInt & result) 
+// Process if input type is alphanumeric
+// -----------------------------------------------------------------------------
+//    
+void CSyncMLDlgNotifier::InputTypeAlphaNumericL(TInt & result)    
+{
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeAlphaNumericL() startedd") );
+		TBuf<KSyncMLMaxDefaultResponseMsgLength> InputText(iDR);
+		if( iET == ESyncMLEchoTypePassword ) //for pwd ET
+    {
+    		CSyncMLTimedInputTextQuery* dlg = CSyncMLTimedInputTextQuery::NewL( InputText, iServerMsg, EndKeyPress, iMaxTime);
+				dlg->SetMaxLength( iMaxlen );
+				EnableSyncProgressNoteL( EFalse );//coment out when using test app
+				result = dlg->ExecuteLD( R_NEWALERT_DATA_PWD_QUERY );
+				if(EndKeyPress)
+				{
+					 result = KErrAbort;	
+				}
+				reply.iretval = result;
+				reply.irettext=InputText;
+				dlg=NULL;
+				EnableSyncProgressNoteL( ETrue );//coment out when using test app
+    }
+    else
+    {
+        CSyncMLTimedInputTextQuery* dlg = CSyncMLTimedInputTextQuery::NewL( InputText,iServerMsg, EndKeyPress, iMaxTime);
+				dlg->SetMaxLength( iMaxlen );
+				EnableSyncProgressNoteL( EFalse );//coment out when using test app
+				result = dlg->ExecuteLD( R_INPUTTEXT_DATA_QUERY );
+				if(EndKeyPress )
+				{					 					 
+					 result = KErrAbort;
+        }
+				reply.iretval = result;
+				reply.irettext=InputText;
+				dlg=NULL;
+				EnableSyncProgressNoteL( ETrue );//coment out when using test app		
+    }
+    FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeAlphaNumericL() completed") );
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::InputTypeNumericL(TInt & result) 
+// Process if input type is numeric
+// -----------------------------------------------------------------------------
+//    
+void CSyncMLDlgNotifier::InputTypeNumericL(TInt & result)
+{
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeNumericL() started") ); 
+		TBuf<KSyncMLMaxDefaultResponseMsgLength> InputText(iDR);
+	  TReal value = 0;
+    TLex data(iDR);
+    if( iDR.Length() != 0 )
+    {
+    		data.Val(value);
+    }
+    if ( iET == ESyncMLEchoTypePassword )
+    {
+    		TChar ch = '0';
+        for (TInt i=0;i<iDR.Length();i++)
+        {
+        		ch=iDR[i];
+            if( ch!='+' || ch!='-' || ch!='.' )
+            {
+            		if( !ch.IsDigit() )
+             	  {
+             	  		InputText.Zero();
+             	    	break;	
+             	  }
+            }
+        }
+        CSyncMLTimedInputTextQuery* dlg = CSyncMLTimedInputTextQuery::NewL( InputText, iServerMsg, EndKeyPress, iMaxTime);
+				dlg->SetMaxLength( iMaxlen );
+				EnableSyncProgressNoteL( EFalse );//coment out when using test app
+				result = dlg->ExecuteLD( R_NEWALERT_NUMERIC_PWD_QUERY );
+				dlg = NULL;
+				if(EndKeyPress)
+				{
+					 result = KErrAbort;	
+				}
+		}
+    else
+    {
+    		CSyncMLTimedNumberQueryDialog* dlg =
+				CSyncMLTimedNumberQueryDialog::NewL( value, iServerMsg, EndKeyPress,  iMaxTime);
+				    
+				EnableSyncProgressNoteL( EFalse );//coment out when using test app
+				result = dlg->ExecuteLD( R_NEWALERT_NUMBER_QUERY );
+				dlg = NULL;
+				if(EndKeyPress)
+				{
+					result = KErrAbort;	
+				}
+				reply.iretval = result;
+				data.Val( value );
+				_LIT(KSendFormat ,"%10.10f");
+				InputText.Format ( KSendFormat, value );
+		}
+		reply.iretval = result;
+		reply.irettext= InputText;
+								 
+		EnableSyncProgressNoteL( ETrue );//coment out when using test app  
+		
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeNumericL() completed") );    		
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::InputTypeDateL(TInt & result) 
+// Process if input type is Date
+// -----------------------------------------------------------------------------
+//  
+void CSyncMLDlgNotifier::InputTypeDateL(TInt & result)
+{
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeDateL() started") ); 
+		TBuf<KSyncMLMaxDefaultResponseMsgLength> InputText(iDR);
+	  TTime date(_L("00010101:"));
+    TInt BadData = 1;
+    TChar ch = '0';
+    for (TInt i=0;i<iDR.Length();i++)
+    {
+    		ch=iDR[i];
+        if(!ch.IsDigit())
+        {
+        		BadData=0;
+            break;
+        }
+    }
+    if( iDR.Length() != 0 && iDR.Length()==8 && BadData )
+    {
+    		//iDR.Append(':');
+        TBuf <9> revdate;
+				revdate.Append(iDR.Mid(4,4));
+				revdate.Append(iDR.Mid(2,2));
+				revdate.Append(iDR.Left(2));
+				revdate.Append(':');
+        date.Set( revdate );
+    }
+		CSyncMLTimedDateQuery* dlg = CSyncMLTimedDateQuery::NewL( date, iServerMsg,EndKeyPress ,  iMaxTime);
+		EnableSyncProgressNoteL( EFalse );//coment out when using test app
+		result = dlg->ExecuteLD(R_NEWALERT_DATE_QUERY); 
+					
+		if(EndKeyPress)
+		{
+				result = KErrAbort;//0-keypress 1-ok,0-cancel,-1=end key	
+		}
+		reply.iretval = result;
+		_LIT(KDateFormat,"%F%D%M%Y");
+		TBuf <20> StringDate;					
+		date.FormatL(StringDate, KDateFormat);
+		reply.irettext=StringDate;
+		dlg = NULL;
+		EnableSyncProgressNoteL( ETrue );//comented out for emulator testing
+		
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeDateL() completed") );            
+}		
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::InputTypeTimeL(TInt & result) 
+// Process if input type is Time
+// -----------------------------------------------------------------------------
+//             	    
+void CSyncMLDlgNotifier::InputTypeTimeL(TInt & result)
+{            	
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeTimeL() started") );
+		TBuf<KSyncMLMaxDefaultResponseMsgLength> InputText(iDR);
+    //create TTime from TBuf iDR
+    //hhmmss
+    TTime IpTime(_L("120000."));
+    TInt BadData=1;
+    TChar ch= '0';
+    for (TInt i=0;i<iDR.Length();i++)
+    {
+    		ch=iDR[i];
+        if(!ch.IsDigit())
+        {
+        		BadData=0;
+            break;
+        }
+    }
+    if( iDR.Length() != 0 && iDR.Length() == 6 && BadData )
+    {
+    		iDR.Append('.');
+        IpTime.Set( iDR );
+    }	             	
+		CSyncMLTimedDateQuery* dlg =
+		CSyncMLTimedDateQuery::NewL( IpTime, iServerMsg, EndKeyPress, iMaxTime);					
+		EnableSyncProgressNoteL( EFalse );//comented out for emulator testing
+		result = dlg->ExecuteLD(R_NEWALERT_TIME_QUERY);					
+		if(EndKeyPress)
+		{
+				result = KErrAbort;//0-keypress 1-ok,0-cancel,-1=end key	
+		}
+		reply.iretval = result;				
+		_LIT(KTimeFormat,"%F%H%T%S");
+		TBuf <20> StringTime;				
+		IpTime.FormatL(StringTime, KTimeFormat);
+		reply.irettext=StringTime;				
+		dlg = NULL;  
+		EnableSyncProgressNoteL( ETrue );//coment out when using test app
+		
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypeTimeL() completed") );
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::InputTypePhoneNumberL(TInt & result) 
+// Process if input type is Phone number
+// -----------------------------------------------------------------------------
+//  
+void CSyncMLDlgNotifier::InputTypePhoneNumberL(TInt & result)
+{
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypePhoneNumberL() started") );
+		TBuf<KSyncMLMaxDefaultResponseMsgLength> InputText(iDR);
+		EnableSyncProgressNoteL( EFalse );//comented out for emulator testing
+		TInt ret=0;
+		for(TInt i=0;i<iDR.Length();i++)
+		{
+				if(iDR[i] == 'p' || iDR[i] == 'w' || iDR[i] == '+' || iDR[i] == '*' ||iDR[i] == '#')
+				{
+						if( iDR[i] == '+' && i > 0)
+					 	{
+					 			ret = -1;
+					 			break;
+					 	}
+					 	else
+					 {
+							continue;
+					 }
+				}
+				else
+				{
+						TChar ch=iDR[i] ;
+			 			if(!ch.IsDigit())
+			 			{
+			  				ret = -1;
+			 					break;	
+			 			}
+				}
+		}
+				
+		if(ret == -1)
+		InputText.Zero();
+		CSyncMLTimedInputTextQuery* dlg = CSyncMLTimedInputTextQuery::NewL(InputText,iServerMsg, EndKeyPress, iMaxTime);					
+		dlg->SetMaxLength( iMaxlen );					 
+		result = dlg->ExecuteLD( R_NEWALERT_PHONE_QUERY );
+		if(EndKeyPress )
+		{
+					result = KErrAbort;
+		}
+		reply.iretval = result;					
+		reply.irettext=InputText;
+		dlg=NULL;					
+		EnableSyncProgressNoteL( ETrue );//coment out when using test app 
+		FLOG( _L("[SmlNotif]\t CSyncMLDlgNotifier::InputTypePhoneNumberL() completed") );
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLDlgNotifier::SetIconsL() 
+// Sets the icons to multiselection/markable list
+// -----------------------------------------------------------------------------
+void CSyncMLDlgNotifier::SetIconsL(CEikFormattedCellListBox* aListBox)
+    {        
+    CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
+        CleanupStack::PushL( iconArray );
+        CFbsBitmap* checkboxOnBitmap = NULL;
+        CFbsBitmap* checkboxOnBitmapMask = NULL;
+        CFbsBitmap* checkboxOffBitmap = NULL;
+        CFbsBitmap* checkboxOffBitmapMask = NULL;
+
+        //CListItemDrawer is using this logical color as default for its marked icons
+        TRgb defaultColor;
+        defaultColor = iEikEnv->Color( EColorControlText );
+
+        // Create 'ON' checkbox icon
+        AknsUtils::CreateColorIconLC( AknsUtils::SkinInstance(),
+                    KAknsIIDQgnIndiCheckboxOn,
+                    KAknsIIDQsnIconColors,
+                    EAknsCIQsnIconColorsCG13,
+                    checkboxOnBitmap,
+                    checkboxOnBitmapMask,
+                    KAvkonBitmapFile,
+                    EMbmAvkonQgn_indi_checkbox_on,
+                    EMbmAvkonQgn_indi_checkbox_on_mask,
+                    defaultColor
+                    );
+
+        CGulIcon* checkboxOnIcon = CGulIcon::NewL( checkboxOnBitmap, checkboxOnBitmapMask );
+        // cleanup checkboxOnBitmap, checkboxOnBitmapMask
+        CleanupStack::Pop( checkboxOnBitmapMask );
+        CleanupStack::Pop( checkboxOnBitmap ); 
+
+        CleanupStack::PushL( checkboxOnIcon );
+        iconArray->AppendL( checkboxOnIcon );
+
+        // Create 'OFF' checkbox icon
+        AknsUtils::CreateColorIconLC( AknsUtils::SkinInstance(),
+                    KAknsIIDQgnIndiCheckboxOff,
+                    KAknsIIDQsnIconColors,
+                    EAknsCIQsnIconColorsCG13,
+                    checkboxOffBitmap,
+                    checkboxOffBitmapMask,
+                    KAvkonBitmapFile,
+                    EMbmAvkonQgn_indi_checkbox_off,
+                    EMbmAvkonQgn_indi_checkbox_off_mask,
+                    defaultColor
+                    );
+
+        CGulIcon* checkboxOffIcon = CGulIcon::NewL( checkboxOffBitmap, checkboxOffBitmapMask );
+        // cleanup checkboxOffBitmap, checkboxOffBitmapMask
+        CleanupStack::Pop( checkboxOffBitmapMask ); //WILL BE DELETED BY CGUIICON
+        CleanupStack::Pop( checkboxOffBitmap ); //WILL BE DELETED BY CGUIICON
+        
+
+        CleanupStack::PushL( checkboxOffIcon );
+        iconArray->AppendL( checkboxOffIcon );
+        aListBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray ); // changes ownership
+        
+        // cleanup checkboxOnIcon, checkboxOffIcon, iconArray
+        CleanupStack::Pop( checkboxOffIcon ); //WILL BE DELETED BY CGUIICON
+        CleanupStack::Pop( checkboxOnIcon ); //WILL BE DELETED BY CGUIICON
+        CleanupStack::Pop( iconArray );//WILL BE DELETED BY CFormattedCellListBoxData::
+
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLFwUpdNotifier.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,1232 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The firmware update result notifier.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <eikenv.h>          // Eikon environment
+#include <uikon/eiksrvui.h>
+#include <AknQueryDialog.h>
+#include <aknmessagequerydialog.h>
+#include <aknstaticnotedialog.h>
+#include <centralrepository.h>  
+#include <StringLoader.h>    // Localisation stringloader
+#include <SyncMLClient.h>
+#include <SyncMLClientDS.h>
+#include <SyncMLClientDM.h>
+#include <centralrepository.h>
+#include <DevManInternalCRKeys.h>   
+#include <SyncMLNotifierDomainCRKeys.h> 
+#include <SyncMLNotifier.rsg>           // Own resources
+#include <aknnotewrappers.h>
+#include <e32property.h>
+
+#include "SyncMLFwUpdNotifier.h"  // Class declaration
+#include "SyncMLNotifDebug.h"
+
+#include "SyncMLQueryDialog.h"
+#include "SyncMLMessageQueryDialog.h"
+#include "SyncMLNotifPrivateCRKeys.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::CSyncMLFwUpdNotifier
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLFwUpdNotifier::CSyncMLFwUpdNotifier()
+    {
+    iRunLhang = EFalse;
+    iDlg = NULL;
+    iFotaEncryptReq = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLDSNotifier::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLFwUpdNotifier* CSyncMLFwUpdNotifier::NewL()
+    {
+    CSyncMLFwUpdNotifier* self = new (ELeave) CSyncMLFwUpdNotifier();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CSyncMLFwUpdNotifier::~CSyncMLFwUpdNotifier()
+    {
+    Cancel();   // Free own resources
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::RegisterL
+// -----------------------------------------------------------------------------
+//
+CSyncMLFwUpdNotifier::TNotifierInfo CSyncMLFwUpdNotifier::RegisterL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::RegisterL()"));
+    iInfo.iUid = KSyncMLFwUpdNotifierUid;
+    iInfo.iChannel = KSmlFwUpdChannel;
+    iInfo.iPriority = ENotifierPriorityHigh;
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::RegisterL() completed"));
+    return iInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::GetParamsL
+// Initialize parameters and check if device is already
+// in registry. Jump to RunL as soon as possible.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLFwUpdNotifier::GetParamsL( const TDesC8& aBuffer,
+                                             TInt aReplySlot,
+                                       const RMessagePtr2& aMessage )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::GetParamsL()"));
+
+    if( iReplySlot != NULL || iNeedToCompleteMessage )
+        {
+        User::Leave( KErrInUse );
+        }
+    iMessage = aMessage;
+    iNeedToCompleteMessage = ETrue;
+    iReplySlot = aReplySlot;
+
+	TSyncMLFwUpdNotifParams param;
+ 	TPckgC<TSyncMLFwUpdNotifParams> pckg( param );
+ 	pckg.Set( aBuffer );
+
+    iNoteType = pckg().iNoteType;
+    iNoteInfo = pckg().iIntParam;
+    iFotaMemoryNeeded = pckg().iMemoryNeeded;
+    iFotaEncryptReq = pckg().iEncryptReq;
+	
+	iUserPostponeCount = pckg().iFotaUserPostponeCount;
+    iMaxPostponeCount = pckg().iFotaMaxPostponeCount;
+    iIntervalType = pckg().iIntervalType;
+    iInterval = pckg().iInterval;
+    
+    if(pckg().iSelectedReminder.Length() > 0)
+        iSelectedReminder.Copy(pckg().iSelectedReminder);
+
+    // Call SetActive() so RunL() will be called by the active scheduler
+    //
+    SetActive();
+    iStatus = KRequestPending;
+    TRequestStatus* stat = &iStatus;
+    User::RequestComplete( stat, KErrNone );
+
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::GetParamsL() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::RunL
+// Ask user response and return it to caller.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLFwUpdNotifier::RunL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::RunL()"));
+
+    TInt result( KErrNone );
+    const TInt KNormal = 1;
+		const TInt KForce = 0;
+
+    // Turn lights on and deactivate apps -key
+    //
+    TurnLightsOn();
+    SuppressAppSwitching( ETrue );
+
+    switch( iNoteType )
+        {
+        case ESyncMLFwUpdErrorNote:
+            {
+            result = ShowUpdateErrorNoteL();
+            break;
+            }
+
+        case ESyncMLFwUpdResultNote:
+            {
+            if (iFotaEncryptReq)
+                {
+                result = ShowUpdateResultWithEncryptionNoteL();
+                }
+            else
+                {
+                result = ShowUpdateResultNoteL();
+                }
+            break;
+            }
+		case ESyncMLFwUpdPostponeLimitQuery:
+            {
+            result = ShowPostLimitUpdateStartQueryL(KNormal);
+       			break;
+     				}
+        
+        case ESyncMLFwUpdForceQuery:
+            {
+            result = ShowPostLimitUpdateStartQueryL(KForce);
+            break;
+            }
+            
+        case ESyncMLFwUpdStartQuery:
+            {
+            result = ShowUpdateStartQueryL();
+            break;
+            }
+        case ESyncMLFwUpdRebootNote:
+            {
+            CAknStaticNoteDialog* dlg = new ( ELeave ) CAknStaticNoteDialog;
+            dlg->PrepareLC( R_SML_FOTA_RESTART_NOTE );
+
+            HBufC* stringHolder = StringLoader::LoadLC( R_FOTA_REBOOT_NOTE );
+            dlg->SetTextL( *stringHolder );
+            CleanupStack::PopAndDestroy( stringHolder );
+
+            result = dlg->RunLD();
+            if ( result == KErrNone )
+                {
+                result = EAknSoftkeyOk;
+                };
+            
+            break;
+            }
+     	case ESyncMLFwUpdNoReminder:
+     		{
+     		 result =  ShowNoReminderQueryL();
+			 break;
+            }
+        case ESyncMLFwUpdLargeNotEnoughMemory:
+        	{
+        	 result = ShowNotEnoughMemoryL( iFotaMemoryNeeded , EFalse );
+			 break;
+        	}
+        case ESyncMLFwUpdOmaDLNotEnoughMemory:
+        	{
+        	 result = ShowNotEnoughMemoryL( iFotaMemoryNeeded , ETrue );
+			 break;
+        	}	
+        case ESyncMLFwUpdOmaDLUserCancel:
+        	{
+        	 result = ShowDownloadUserCancelL();
+        	 break;	
+        	}
+        case ESyncMLFwUpdOmaDLPostponed:
+        	{
+        	 result = ShowDownloadPostponedL();
+        	 break;	
+        	}
+        case ESyncMLFwUpdOmaDLCancelled:
+        	{
+        	 result = ShowDownloadCancelledL();
+        	 break;	
+        	}
+        case ESyncMLFwUpdOmaDLResume:
+        	{
+        	 result = ShowDownloadResumeL();
+        	 break;	
+        	}
+        case ESyncMLFwUpdStartQueryEnc:
+            {
+            result = ShowUpdateStartQueryEncryptionL();
+            break;
+            }
+		case ESyncMLFwUpdPostponeNote:
+            {
+            result = ShowPostponeLimitNoteL();
+            break; 
+            }
+        default: // Unhandled note type
+            {
+            FLOG(_L("[SMLNOTIF]\t CSyncMLDlgNotifier::RunL() Note type not handled"));
+            User::Leave( KErrArgument );
+            break;
+            }
+        }
+
+    // Activate apps -key again
+    //
+    SuppressAppSwitching( EFalse );
+
+		if ( iNeedToCompleteMessage )
+			{
+			// Translate the user key presses to message completion response
+			FTRACE( FPrint( _L("[SmlNotif]\t User Key-Press for dialog = %d" ), result ) );
+			switch( result ) 
+				{
+					case ESyncMLDlgRespKeyOk://all LSK press will fall here.
+						iMessage.Complete( KErrNone );
+						break;
+					case ESyncMLDlgRespKeyCancel://all RSK press will fall here.
+						iMessage.Complete (KErrCancel);
+						break;
+					case ESyncMLDlgRespKeyOthers: //all call-termination key press fall here.
+						iMessage.Complete (KErrNotFound);
+						break;
+					default://rest of the cases and errors
+						iMessage.Complete (KErrNone);
+						break;
+				}		
+			}
+
+
+    // Complete message and free resources
+    //
+    iNeedToCompleteMessage = EFalse;
+    iReplySlot = NULL;
+
+    iNoteType = ESyncMLFwUpdUnknown;
+
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::RunL() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::Cancel
+// Release all own resources (member variables)
+// -----------------------------------------------------------------------------
+//
+void CSyncMLFwUpdNotifier::Cancel()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::Cancel()"));
+    if(iRunLhang)
+    	{
+    	 FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::Cancel() inside Runlhang"));
+    	if(iDlg)
+    		{
+    		FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::Cancel()before exit"));
+    		TRAP_IGNORE(iDlg->ExitL());
+    		if(iDlg)
+    			{
+        		FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::Cancel()before delete"));
+    			delete iDlg;
+    			iDlg = NULL;
+        		FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::Cancel()after delete"));
+    			}
+    		}
+    	}
+    CSyncMLNotifierBase::Cancel();
+
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::Cancel() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowUpdateErrorNoteL
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowUpdateErrorNoteL()
+    {
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateErrorNoteL() error = %d" ),
+        iNoteInfo ) );
+
+    HBufC* stringHolder( NULL );
+
+    switch ( iNoteInfo )
+        {
+        case KErrDiskFull:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_NOT_PERMITTED );
+            break;
+            }
+        case KErrCommsLineFail:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_LOST_CONNECTION );
+            break;
+            }
+        case KErrCouldNotConnect:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_SERVER_ERROR );
+            break;
+            }
+        case KErrBadPower:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_BATTERY_LOW );
+            break;
+            }
+        case KErrBadUsbPower:
+             {
+             	stringHolder = StringLoader::LoadLC( R_FOTA_USB_BATTERY_LOW ); 
+             	break;
+            }
+        case KErrCommsLineFail2:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_CONNECTION_FAIL2 );
+            break;
+            }
+        case KErrGeneralResume:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_DOWNLOAD_GENERAL_RESUME );
+            break;
+            }
+        case KErrGeneralNoResume:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_DOWNLOAD_NO_RESUME );
+            break;
+            }
+        case KErrBadPowerForEnc:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_UPDATE_ENC_BATTERY_LOW );
+            break;
+            }
+        case KErrDeviceMemoryBusy:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_DEVICE_MEMORY_BUSY );
+            break;
+            }
+        default:
+            {
+            return KErrArgument; // Will be converted to KErrNone when completing
+                                 // message, since this is not actually an error.
+            }
+        }
+
+    
+    TBool keypress(EFalse);
+	CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+    msgDlg->SetMessageTextL(*stringHolder);
+    
+    CleanupStack::PopAndDestroy( stringHolder );
+    
+    msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+
+    stringHolder = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    msgDlg->SetHeaderTextL( stringHolder->Des() );
+    CleanupStack::PopAndDestroy( stringHolder );
+    stringHolder = NULL;
+    
+   	msgDlg->ButtonGroupContainer().SetCommandSetL( 
+    	                                  R_AVKON_SOFTKEYS_OK_EMPTY__OK );
+    
+    TInt retval (ESyncMLDlgRespKeyNone);
+    iRunLhang = ETrue;
+    iDlg = msgDlg; 
+	retval = msgDlg->RunLD();
+	iRunLhang = EFalse;
+    msgDlg = NULL;
+	iDlg = NULL;
+
+	//call-termination key press is handled here.
+	if (keypress)
+    	retval = ESyncMLDlgRespKeyOthers;
+    
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateErrorNoteL() completed: retval = %d" ),
+        retval ) );
+        
+    return retval;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowUpdateResultNoteL
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowUpdateResultNoteL()
+    {
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateResultNoteL() result = %d" ),
+        iNoteInfo ) );
+
+    HBufC* stringHolder( NULL );
+
+    switch ( iNoteInfo )  // It is easier to add cases to switch structure
+        {
+        case KErrNone:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_NOTIF_COMPLETE );
+            break;
+            }
+        default:
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_MSG_QUERY_NOT_UPDATED );
+            break;
+            }
+        }
+        
+    TBool keypress(EFalse);
+	CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+    msgDlg->SetMessageTextL(*stringHolder);
+
+    CleanupStack::PopAndDestroy( stringHolder );
+    
+    msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+
+    stringHolder = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    msgDlg->SetHeaderTextL( stringHolder->Des() );
+    CleanupStack::PopAndDestroy( stringHolder );
+    stringHolder = NULL;
+    
+   	msgDlg->ButtonGroupContainer().SetCommandSetL( 
+        									R_AVKON_SOFTKEYS_OK_EMPTY__OK );
+    TInt retval(ESyncMLDlgRespKeyNone);
+    iRunLhang = ETrue;
+    iDlg = msgDlg; 
+    retval = msgDlg->RunLD();
+    iRunLhang = EFalse;
+    msgDlg = NULL;
+    iDlg = NULL;
+	//call-termination key press has to be suppressed here. so keypress has no significance here!    
+	/*if (keypress)
+    	retval = EKeyOthers;*/
+    	
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateResultNoteL() completed: retval = %d" ),
+        retval ) );
+    
+    return retval;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowPostLimitUpdateStartQueryL
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowPostLimitUpdateStartQueryL(TInt aQueryType)
+{	    
+	    FTRACE( FPrint( _L(
+	        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() profileId = %d" ),
+	        aQueryType ) );
+        
+      HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+      TInt retval (ESyncMLDlgRespKeyNone);  
+      
+      TBool keypress(EFalse);
+//      CSyncMLQueryDialog* dlg = CSyncMLQueryDialog::NewL(keypress);
+      
+      CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+      
+      // Implementation of notes for postpone limit requirement.
+        TBuf< KSyncMLMaxProfileNameLength > operatorName;
+        RetrieveProfileNameL( operatorName );
+        
+        HBufC* stringHolder = NULL;
+        retval = ESyncMLDlgRespKeyOk;       
+        TBool bShowInstallQuery = ETrue;
+        TInt fotaUpdateAppName (EFotaUpdateDM);
+        TInt errAppName = RProperty::Get( KPSUidNSmlDMSyncApp, KNSmlCurrentFotaUpdateAppName, fotaUpdateAppName );
+        TInt errShowInstall = RProperty::Get( KPSUidNSmlDMSyncApp, KDevManShowInstallNowQuery, bShowInstallQuery );
+
+        FTRACE( FPrint(
+                _L("CSyncMLFwUpdNotifier::ShowUpdateStartQueryL found key Show install query = %d"),
+                bShowInstallQuery ) );
+
+
+        if ( !errAppName && !errShowInstall && fotaUpdateAppName == EFotaUpdateNSC && !bShowInstallQuery )
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() do not show install now query "));  
+            bShowInstallQuery = EFalse;
+            }
+
+        if ( !bShowInstallQuery )
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() should not query "));   
+            }
+        else
+            {
+            FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() will query for Install now? "));
+            if(aQueryType)
+                {
+                stringHolder = StringLoader::LoadLC( R_POST_LIMIT_FOTA_QUERY_INSTALL_NOW, operatorName );
+                msgDlg->SetMessageTextL( *stringHolder );
+                //dlg->SetPromptL( *stringHolder );
+                }
+            else
+                {
+                stringHolder = StringLoader::LoadLC( R_FOTA_QUERY_INSTALL_FORCE_NOW, operatorName );
+                msgDlg->SetMessageTextL( *stringHolder );
+                }
+            CleanupStack::PopAndDestroy( stringHolder );
+            stringHolder = NULL;
+            retval = ESyncMLDlgRespKeyNone;
+            if(aQueryType)
+                {
+                //retval = dlg->ExecuteLD( R_FOTA_INSTALL_CONFIRMATION_QUERY );
+                msgDlg->PrepareLC( R_FOTA_INSTALL_MESSAGE_QUERY );
+                msgDlg->SetHeaderTextL( headerText->Des() );
+                retval = msgDlg->RunLD();
+                }
+            else
+                {
+                //retval = dlg->ExecuteLD( R_FOTA_FORCE_INSTALL_CONFIRMATION_QUERY );
+                msgDlg->PrepareLC( R_FOTA_FORCE_INSTALL_CONFIRMATION_QUERY );
+                msgDlg->SetHeaderTextL( headerText->Des() );
+                msgDlg->RunLD();
+                }
+            //dlg = NULL;
+            msgDlg = NULL;
+            }   
+        // set KDevManShowInstallNowQuery key back to value that it should show query
+        TInt err = RProperty::Set(KPSUidNSmlDMSyncApp,KDevManShowInstallNowQuery,1 );
+        FTRACE( FPrint(
+                _L("Install query is set back to be shown, err = %d"),
+                err ) );
+        
+
+        if ( !keypress && retval )
+            {
+            stringHolder = StringLoader::LoadLC( R_FOTA_UPDATE_2_WARNING );
+
+            //keypress is EFalse here
+            msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+            msgDlg->SetMessageTextL( *stringHolder );
+
+            CleanupStack::PopAndDestroy( stringHolder );
+            stringHolder = NULL;
+
+            msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+            msgDlg->SetHeaderTextL( headerText->Des() );
+
+            if(aQueryType)
+                {
+                msgDlg->ButtonGroupContainer().SetCommandSetL( 
+                        R_SML_SOFTKEYS_ACCEPT_CANCEL__ACCEPT );
+                }
+            else
+                {
+                msgDlg->ButtonGroupContainer().SetCommandSetL( 
+                        R_SML_SOFTKEYS_FORCE_ACCEPT__ACCEPT );
+                }
+
+            retval = ESyncMLDlgRespKeyNone;
+            retval = msgDlg->RunLD();
+            msgDlg = NULL;
+            }
+        
+      CleanupStack::PopAndDestroy( headerText );
+    
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() completed: retval = %d, keypress = %d" ),
+        retval,keypress ) );
+
+	//call-termination key press is handled here.
+	if (keypress)
+    	retval = ESyncMLDlgRespKeyOthers;
+	
+    return retval;
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowUpdateStartQueryL
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowUpdateStartQueryL()
+    {
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() profileId = %d" ),
+        iNoteInfo ) );
+
+    HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    TInt retval (ESyncMLDlgRespKeyNone);  
+    TInt CustomNotes(KErrNone);
+    CRepository* centrep = NULL;
+    TRAPD( err, centrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys) );    
+    if(!err && centrep)
+    {
+      TInt err= centrep->Get( KDevManUINotesCustomization, CustomNotes);	
+      if (err)
+       CustomNotes = 0;
+    }
+    else
+    {
+      CustomNotes = 0;	
+    }
+    TBool keypress(EFalse);
+    CSyncMLQueryDialog* dlg = CSyncMLQueryDialog::NewL(keypress);
+    TLanguage language = User::Language();
+    if((CustomNotes) && IsLanguageSupportedL())
+    {       //This note will be shown in chinese and english variant only and localisation is not done
+     CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress); 
+     HBufC* stringHolder = StringLoader::LoadLC (R_QTN_FOTA_MSG_QUERY_UPDATE_CUSTOM_WARNING);     
+     msgDlg->SetMessageTextL(*stringHolder);
+     CleanupStack::PopAndDestroy( stringHolder );
+     stringHolder = NULL;
+     msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+     msgDlg->SetHeaderTextL( headerText->Des() );
+     msgDlg->ButtonGroupContainer().SetCommandSetL( R_FOTA_INSTALL_QUERY_SOFTKEYS_NOW_LATER__NOW );
+     retval = ESyncMLDlgRespKeyNone;
+     retval = msgDlg->RunLD();
+     msgDlg = NULL;
+     FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() after new changes in phone updates"));
+    }
+    else
+    {
+      TBuf< KSyncMLMaxProfileNameLength > profileName;
+      RetrieveProfileNameL( profileName ); 
+      
+  HBufC* stringHolder = NULL;
+	retval = ESyncMLDlgRespKeyOk;    	
+	TBool bShowInstallQuery = ETrue;
+	TInt fotaUpdateAppName (EFotaUpdateDM);
+	TInt errAppName = RProperty::Get( KPSUidNSmlDMSyncApp, KNSmlCurrentFotaUpdateAppName, fotaUpdateAppName );
+	TInt errShowInstall = RProperty::Get( KPSUidNSmlDMSyncApp, KDevManShowInstallNowQuery, bShowInstallQuery );
+
+	FTRACE( FPrint(
+	    _L("CSyncMLFwUpdNotifier::ShowUpdateStartQueryL found key Show install query = %d"),
+	    bShowInstallQuery ) );
+
+
+	if ( !errAppName && !errShowInstall && fotaUpdateAppName == EFotaUpdateNSC && !bShowInstallQuery )
+	{
+			FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() do not show install now query "));	
+			bShowInstallQuery = EFalse;
+	}
+
+	if ( !bShowInstallQuery )
+	{
+		
+		FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() should not query "));	
+										
+	}
+	
+	else
+		
+	{
+		FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() will query for Install now? "));		
+    stringHolder = StringLoader::LoadLC( R_FOTA_QUERY_INSTALL_NOW, profileName );
+    dlg->SetPromptL( *stringHolder );
+    CleanupStack::PopAndDestroy( stringHolder );
+    stringHolder = NULL;
+    retval = ESyncMLDlgRespKeyNone;
+    
+
+    retval = dlg->ExecuteLD( R_FOTA_INSTALL_CONFIRMATION_QUERY );
+	dlg = NULL;
+	}	
+	// set KDevManShowInstallNowQuery key back to value that it should show query
+	TInt err = RProperty::Set(KPSUidNSmlDMSyncApp,KDevManShowInstallNowQuery,1 );
+	FTRACE( FPrint(
+	    _L("Install query is set back to be shown, err = %d"),
+	    err ) );
+	
+    if ( !keypress && retval )
+        {
+        stringHolder = StringLoader::LoadLC( R_FOTA_UPDATE_1_WARNING );
+                
+        //keypress is EFalse here
+        CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+        
+        msgDlg->SetMessageTextL(*stringHolder);
+        CleanupStack::PopAndDestroy( stringHolder );
+        stringHolder = NULL;
+
+        msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+        msgDlg->SetHeaderTextL( headerText->Des() );
+        
+       	msgDlg->ButtonGroupContainer().SetCommandSetL( R_SML_SOFTKEYS_ACCEPT_CANCEL__ACCEPT );
+        
+        retval = ESyncMLDlgRespKeyNone;;
+        retval = msgDlg->RunLD();
+        msgDlg = NULL;
+		
+		
+		if ( !keypress && retval )
+			{
+	        stringHolder = StringLoader::LoadLC( R_FOTA_UPDATE_2_WARNING );
+	        
+	        //keypress is EFalse here
+	        msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+            msgDlg->SetMessageTextL( *stringHolder );
+
+	        CleanupStack::PopAndDestroy( stringHolder );
+	        stringHolder = NULL;
+
+	        msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+	        msgDlg->SetHeaderTextL( headerText->Des() );
+	        
+        	msgDlg->ButtonGroupContainer().SetCommandSetL( 
+	        						R_SML_SOFTKEYS_ACCEPT_CANCEL__ACCEPT );
+        
+	        retval = ESyncMLDlgRespKeyNone;
+	        retval = msgDlg->RunLD();
+	        msgDlg = NULL;
+			}
+        }
+        }
+    
+
+    CleanupStack::PopAndDestroy( headerText );
+    
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() completed: retval = %d, keypress = %d" ),
+        retval,keypress ) );
+
+	//call-termination key press is handled here.
+	if (keypress)
+    	retval = ESyncMLDlgRespKeyOthers;
+	
+    return retval;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowUpdateStartQueryEncryptionL
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowUpdateStartQueryEncryptionL()
+    {
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryEncryptionL() profileId = %d" ),
+        iNoteInfo ) );
+
+    HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    TInt retval (ESyncMLDlgRespKeyNone);  
+    TBool keypress(EFalse);
+
+    CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress); 
+    HBufC* stringHolder = StringLoader::LoadLC (R_FOTA_UPDATE_DEC_WARNING);     
+    msgDlg->SetMessageTextL(*stringHolder);
+    CleanupStack::PopAndDestroy( stringHolder );
+   
+    msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+    msgDlg->SetHeaderTextL( headerText->Des() );
+    msgDlg->ButtonGroupContainer().SetCommandSetL( R_SML_SOFTKEYS_ACCEPT_CANCEL__ACCEPT );
+    retval = ESyncMLDlgRespKeyNone;
+    retval = msgDlg->RunLD();
+    msgDlg = NULL;
+    
+    CleanupStack::PopAndDestroy(headerText);
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateStartQueryL() after new changes in phone updates"));
+    return retval;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowUpdateResultNoteL
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowUpdateResultWithEncryptionNoteL()
+    {
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateResultWithEncryptionNoteL() result = %d" ),
+        iNoteInfo ) );
+
+    HBufC* firstStr( NULL );
+
+    switch ( iNoteInfo )  // It is easier to add cases to switch structure
+        {
+        case KErrNone:
+            {
+            firstStr = StringLoader::LoadLC( R_FOTA_NOTIF_COMPLETE );
+            break;
+            }
+        default:
+            {
+            firstStr = StringLoader::LoadLC( R_FOTA_MSG_QUERY_NOT_UPDATED );
+            break;
+            }
+        }
+    
+    HBufC* secStr  = StringLoader::LoadLC(R_FOTA_UPDATE_ENC);
+    
+    HBufC* stringHolder = HBufC::NewLC(firstStr->Length() + secStr->Length());
+    TPtr ptr (stringHolder->Des());
+    ptr.Append(firstStr->Des());
+    ptr.Append(secStr->Des());
+    
+    TBool keypress(EFalse);
+    CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+    msgDlg->SetMessageTextL(*stringHolder);
+    CleanupStack::PopAndDestroy( stringHolder );
+    CleanupStack::PopAndDestroy(secStr);
+    CleanupStack::PopAndDestroy(firstStr);
+
+    
+    msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+
+    stringHolder = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    msgDlg->SetHeaderTextL( stringHolder->Des() );
+    CleanupStack::PopAndDestroy( stringHolder );
+    stringHolder = NULL;
+    
+    msgDlg->ButtonGroupContainer().SetCommandSetL( R_SML_SOFTKEYS_ACCEPT_CANCEL__ACCEPT );
+    TInt retval(ESyncMLDlgRespKeyNone);
+    iRunLhang = ETrue;
+    iDlg = msgDlg; 
+    retval = msgDlg->RunLD();
+    iRunLhang = EFalse;
+    msgDlg = NULL;
+    iDlg = NULL;
+    //call-termination key press has to be suppressed here. so keypress has no significance here!    
+    /*if (keypress)
+        retval = EKeyOthers;*/
+        
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowUpdateResultWithEncryptionNoteL() completed: retval = %d" ),
+        retval ) );
+    
+    return retval;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::RetrieveProfileNameL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLFwUpdNotifier::RetrieveProfileNameL( TDes& aServerName )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLFwUpdNotifier::RetrieveProfileNameL()"));
+
+    RSyncMLSession syncSession;
+    RSyncMLDevManProfile syncProfile;
+  
+    syncSession.OpenL();
+    CleanupClosePushL( syncSession );
+    
+    syncProfile.OpenL( syncSession, iNoteInfo, ESmlOpenRead );
+    CleanupClosePushL( syncProfile );
+    
+    aServerName = syncProfile.DisplayName();
+
+    CleanupStack::PopAndDestroy( &syncProfile );
+    CleanupStack::PopAndDestroy( &syncSession );
+
+    FTRACE( FPrint( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::RetrieveProfileNameL() completed: aServerName = %S" ),
+        &aServerName ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowNoReminderQuery
+// -----------------------------------------------------------------------------
+//
+
+TInt CSyncMLFwUpdNotifier::ShowNoReminderQueryL()
+	{
+
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowNoReminderQueryL() begin "));
+        
+   	TInt configFlags( 0 );
+    CRepository* cenrep = NULL;
+    cenrep = CRepository::NewL( KCRUidNSmlDMSyncApp );
+    cenrep->Get( KNSmlDMFotaConfigurationKey, configFlags );
+    delete cenrep;
+    cenrep = NULL;
+	TInt retval (KErrNone);
+	
+    // Show note if fota is not hidden
+    if ( configFlags & KNSmlDMFotaEnableFotaViewFlag )
+    	{
+    	HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    	HBufC* stringHolder = StringLoader::LoadLC( R_FOTA_UPDATE_REMINDER );
+        
+    	TBool keypress(EFalse);        
+        CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+        msgDlg->SetMessageTextL(*stringHolder);
+        CleanupStack::PopAndDestroy( stringHolder );
+        stringHolder = NULL;
+
+        msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+        msgDlg->SetHeaderTextL( headerText->Des() );
+            
+        msgDlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY__OK );
+        retval = msgDlg->RunLD();
+        msgDlg = NULL;
+
+		//call-termination key press is handled here.
+		if (keypress)
+    		retval = ESyncMLDlgRespKeyOthers;
+		
+        CleanupStack::PopAndDestroy( headerText );
+    	}
+        
+     FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowNoReminderQueryL() Completed "));   
+     
+     return retval;
+	}
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowNotEnoughMemory
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowNotEnoughMemoryL( TInt &aMemoryNeeded , TBool aOmaDL)
+{
+  	FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowNotEnoughMemoryL() begin "));
+        
+  	HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );  
+  	
+  	HBufC* stringHolder;
+  	
+  	if( aOmaDL )	
+  	stringHolder = StringLoader::LoadLC( R_FOTA_OMADL_NO_FLEXIBLE_MEMORY , aMemoryNeeded );
+  	else
+  	stringHolder = StringLoader::LoadLC( R_FOTA_LARGE_NO_FLEXIBLE_MEMORY , aMemoryNeeded );
+    
+    TBool keypress(EFalse);  	
+    CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(keypress);
+	msgDlg->SetMessageTextL(*stringHolder);
+  	CleanupStack::PopAndDestroy( stringHolder );
+  	stringHolder = NULL;
+  
+  	msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+  	msgDlg->SetHeaderTextL( headerText->Des() );
+           
+  	msgDlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY__OK );
+  	TInt retval (ESyncMLDlgRespKeyNone);
+  	retval = msgDlg->RunLD();
+  	msgDlg = NULL;
+  	CleanupStack::PopAndDestroy( headerText );
+  
+  	FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowNotEnoughMemoryL() Completed "));    	
+	
+	//call-termination key press is handled here.
+	if (keypress)
+    	retval = ESyncMLDlgRespKeyOthers;
+	
+	return retval;
+}
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowDownloadUserCancelL
+// Shows the notification when the user cancels the download.
+// And inform the user the download is suspended.
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowDownloadUserCancelL()
+{
+
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadUserCancelL() begin "));
+        
+  	TInt retval (KErrNone);
+	
+    HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    HBufC* stringHolder = StringLoader::LoadLC( R_FOTA_USER_CANCEL );
+        
+    TBool endKeyPress(EFalse);        
+    CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(endKeyPress);
+    msgDlg->SetMessageTextL(*stringHolder);
+    CleanupStack::PopAndDestroy( stringHolder );
+    stringHolder = NULL;
+
+    msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+    msgDlg->SetHeaderTextL( headerText->Des() );
+            
+    msgDlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_YES_NO__YES );
+    iRunLhang = ETrue;
+    iDlg = msgDlg;
+    retval = msgDlg->RunLD();
+    iRunLhang = EFalse;
+    msgDlg = NULL;    
+    iDlg = NULL;
+	//call-termination key press is handled here.
+	if (endKeyPress)
+    	retval = ESyncMLDlgRespKeyOthers;
+		
+    CleanupStack::PopAndDestroy( headerText );
+        
+     FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadUserCancelL() Completed "));   
+     
+     return retval;
+}
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowDownloadPostponedL
+// Shows the notification that the download is postponed.
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowDownloadPostponedL()
+{
+
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadPostponedL() begin "));
+    
+    TInt retval (KErrNone);
+    
+    HBufC* stringHolder = StringLoader::LoadLC( R_FOTA_DOWNLOAD_POSTPONED );
+    CAknInformationNote* infoNote = new (ELeave) CAknInformationNote;
+
+    infoNote->ExecuteLD( *stringHolder );
+    CleanupStack::PopAndDestroy( stringHolder );
+  	
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadPostponedL() Completed "));   
+     
+    return retval;
+}
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowDownloadCancelledL
+// Shows the notification that the download is cancelled.
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowDownloadCancelledL()
+{
+
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadCancelledL() begin "));
+        
+  	TInt retval (KErrNone);
+	
+    HBufC* stringHolder = StringLoader::LoadLC( R_FOTA_DOWNLOAD_CANCELLED );
+    CAknInformationNote* infoNote = new (ELeave) CAknInformationNote;
+
+    infoNote->ExecuteLD( *stringHolder );
+    CleanupStack::PopAndDestroy( stringHolder );
+        
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadCancelledL() Completed "));   
+     
+    return retval;
+}
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowPostponeLimitNoteL
+// Shows the notification that the download is Postponed.
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowPostponeLimitNoteL()
+{
+
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowPostponeLimitNoteL() begin "));
+
+    TInt retval (KErrNone);
+    const TInt KTmpArraySize = 5;
+		//const TInt KStrArraySize = 20;
+    
+    CDesCArrayFlat* aStrArr = new CDesCArrayFlat(KTmpArraySize); 
+    CleanupStack::PushL(aStrArr);
+    aStrArr->AppendL(iSelectedReminder);
+    CArrayFixFlat<TInt>* aIntparam = new(ELeave) CArrayFixFlat<TInt>(KTmpArraySize);
+    CleanupStack::PushL(aIntparam);
+    TInt leftPostpone =  iMaxPostponeCount - iUserPostponeCount;
+    if(iInterval > 1)
+        aIntparam->AppendL(iInterval);
+    aIntparam->AppendL(leftPostpone);
+    aIntparam->AppendL(iMaxPostponeCount);
+    
+    HBufC* stringHolder( NULL );
+    //stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE, *aStrArr, *aIntparam);
+    if(iIntervalType == EMonthly)
+    {
+    	if(iInterval > 1)
+    	    stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_MINUTES, *aIntparam);
+    	else
+    	    stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_ONE_MINUTE, *aIntparam);
+  	}
+  	else if(iIntervalType == EHourly)
+    {
+    	if(iInterval > 1)
+    	    stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_HOURS, *aIntparam);
+    	else
+    	    stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_ONE_HOUR, *aIntparam);
+    		
+    }
+    else if(iIntervalType == EDaily)
+    {
+    	if(iInterval > 1)
+    	    stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_DAYS, *aIntparam);
+    	else
+    	    stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_ONE_DAY, *aIntparam);
+    		
+  	}
+  	else
+  	{
+  		CleanupStack::PopAndDestroy( aIntparam );
+    	CleanupStack::PopAndDestroy( aStrArr );
+    	return retval;
+  	}
+  		
+    CAknInformationNote* infoNote = new (ELeave) CAknInformationNote;
+
+    infoNote->ExecuteLD( *stringHolder );
+
+    
+    CleanupStack::PopAndDestroy();
+    CleanupStack::PopAndDestroy( aIntparam );
+    CleanupStack::PopAndDestroy(aStrArr);
+        
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowPostponeLimitNoteL() Completed "));   
+     
+    return retval;
+}
+
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowDownloadResumeL
+// Shows the notification to the user for resuming the download.
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLFwUpdNotifier::ShowDownloadResumeL()
+{
+
+    FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadResumeL() begin "));
+        
+  	TInt retval (KErrNone);
+	
+    HBufC* headerText = StringLoader::LoadLC( R_FOTA_TITLE_PHONE_UPDATES );
+    HBufC* stringHolder = StringLoader::LoadLC( R_FOTA_DOWNLOAD_RESUME );
+        
+    TBool endKeyPress(EFalse);        
+    CSyncMLMessageQueryDialog* msgDlg = CSyncMLMessageQueryDialog::NewL(endKeyPress);
+    msgDlg->SetMessageTextL(*stringHolder);
+    CleanupStack::PopAndDestroy( stringHolder );
+    stringHolder = NULL;
+
+    msgDlg->PrepareLC( R_SML_MESSAGE_QUERY );  // Pushed dialog is popped inside RunLD
+    msgDlg->SetHeaderTextL( headerText->Des() );
+            
+    msgDlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_YES_NO__YES );
+    iRunLhang = ETrue;
+    iDlg = msgDlg;
+    retval = msgDlg->RunLD();
+    iRunLhang = EFalse;
+    iDlg = NULL;
+    msgDlg = NULL;
+    
+	//call-termination key press is handled here.
+	if (endKeyPress)
+    	retval = ESyncMLDlgRespKeyOthers;
+		
+    CleanupStack::PopAndDestroy( headerText );
+        
+     FLOG( _L(
+        "[SmlNotif]\t CSyncMLFwUpdNotifier::ShowDownloadResumeL() Completed "));   
+     
+     return retval;
+}
+
+// -----------------------------------------------------------------------------
+// CSyncMLFwUpdNotifier::ShowDownloadResumeL
+// Shows the notification to the user for resuming the download.
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLFwUpdNotifier::IsLanguageSupportedL()
+{
+	TBool retVal(EFalse);
+	TLanguage language = User::Language();
+	if(language == ELangEnglish || language == ELangInternationalEnglish ||
+ 		   language == ELangTaiwanChinese ||language == ELangHongKongChinese || language == ELangPrcChinese)
+ 		   retVal = ETrue;
+ 	return retVal;
+}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLMessageQueryDialog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* 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:  Message Query Dialogue
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLMessageQueryDialog.h"
+#include "SyncMLNotifDebug.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLMessageQueryDialog::CSyncMLMessageQueryDialog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLMessageQueryDialog::CSyncMLMessageQueryDialog(TBool& aKeyPress  ):iKeyPress(aKeyPress)
+    
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLMessageQueryDialog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLMessageQueryDialog* CSyncMLMessageQueryDialog::NewL(TBool& aKeyPress )
+    {
+    CSyncMLMessageQueryDialog* self =
+        new( ELeave ) CSyncMLMessageQueryDialog (aKeyPress  );
+    
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CSyncMLMessageQueryDialog::~CSyncMLMessageQueryDialog
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLMessageQueryDialog::~CSyncMLMessageQueryDialog()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLMessageQueryDialog::OkToExitL
+// Determines if the dialog can be closed..
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLMessageQueryDialog::OkToExitL( TInt aButtonId )
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLMessageQueryDialog::OkToExitL()"));
+    return CAknQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLMessageQueryDialog::NeedToDismissQueryL
+// Called by OfferkeyEventL(), gives a change to dismiss the query even with
+// keys different than Enter of Ok.
+// -----------------------------------------------------------------------------
+//    
+TBool CSyncMLMessageQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLMessageQueryDialog::NeedToDismissQueryL()"));
+    if (aKeyEvent.iCode == EKeyNo)
+        {
+        FLOG(_L("[SmlNotif]\t CSyncMLMessageQueryDialog::NeedToDismissQueryL()--EKeyNo"));
+        iKeyPress=ETrue;
+		DismissQueryL();
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLMessageQueryDialog::ExitL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLMessageQueryDialog::ExitL()
+	{
+	FLOG(_L("[SmlNotif]\t CSyncMLMessageQueryDialog::ExitL()"));
+	OkToExitL( EKeyNo );
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLNotifierBase.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,287 @@
+/*
+* 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:  Implementation of the SyncML Appserver starter notifier
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <centralrepository.h>
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include <settingsinternalcrkeys.h>
+#include <e32property.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <eikenv.h>          // Eikon environment
+#include <uikon/eiksrvui.h>        // Eikon server ui (for suppressing app -key)
+#include <bautils.h>         // BAFL utils (for language file)
+#include <data_caging_path_literals.hrh> 
+#include <AknNotiferAppServerApplication.h>
+
+#include "SyncMLNotifierBase.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+// Literals for resource and bitmap files ( drive, directory, filename(s) )
+_LIT(KFileDrive,"z:");
+_LIT(KResourceFileName, "SyncMLNotifier.rsc");
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::CSyncMLNotifierBase
+// C++ default constructor can NOT contain any code, that
+// might leave. Sets the AOs priority and puts
+// itself to the active scheduler stack.
+// -----------------------------------------------------------------------------
+//
+CSyncMLNotifierBase::CSyncMLNotifierBase() : CActive(EPriorityStandard)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::ConstructL
+// Symbian 2nd phase constructor can leave.
+// Create registry object and open resource file.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::ConstructL()
+    {
+    FLOG(_L("[SmlNotif]\t CSyncMLNotifierBase::ConstructL()"));
+
+    iEikEnv = CEikonEnv::Static();
+
+    TFileName filename;
+    filename += KFileDrive;
+    filename += KDC_RESOURCE_FILES_DIR; 
+    filename += KResourceFileName;
+    BaflUtils::NearestLanguageFile( iEikEnv->FsSession(), filename );
+    iResourceFileFlag = iEikEnv->AddResourceFileL( filename );
+    FLOG(_L("[SmlNotif]\t CSyncMLNotifierBase::ConstructL() completed"));
+    }
+    
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLNotifierBase::~CSyncMLNotifierBase()
+    {
+    Cancel();
+    iEikEnv->DeleteResourceFile( iResourceFileFlag );
+
+    // Complete the RMessage2 if needed
+    //
+    if ( iNeedToCompleteMessage )
+        {
+        iMessage.Complete( KErrDied );
+        }
+
+	// Activate apps -key again (if not previously activated yet)
+	SuppressAppSwitching( EFalse );
+
+    iReplySlot = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::Release
+// Release itself. Call to destructor.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::Release()
+    {
+    delete this;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::Info
+// Return registered information.
+// -----------------------------------------------------------------------------
+//
+CSyncMLNotifierBase::TNotifierInfo CSyncMLNotifierBase::Info() const
+    {
+    return iInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::StartL
+// Synchronic notifier launch. Does nothing here.
+// -----------------------------------------------------------------------------
+//
+TPtrC8 CSyncMLNotifierBase::StartL( const TDesC8& /*aBuffer*/ )
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::StartL(sync)") );
+    TPtrC8 ret( KNullDesC8 );
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::StartL(sync) completed") );
+    return ( ret );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::StartL
+// Asynchronic notifier launch.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::StartL( const TDesC8& aBuffer,
+                                        TInt aReplySlot,
+                                  const RMessagePtr2& aMessage )
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::StartL(async)") );
+    TRAPD( err, GetParamsL( aBuffer, aReplySlot, aMessage ) );
+    if ( err )
+        {
+        aMessage.Complete( err );
+        iNeedToCompleteMessage = EFalse;
+        User::Leave( err );
+        }
+    FLOG(_L("[SmlNotif]\t CSyncMLNotifierBase::StartL(async) completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::Cancel
+// Cancelling method.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::Cancel()
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::Cancel()") );
+    if (iNeedToCompleteMessage)
+    	{
+    	iMessage.Complete(KErrCancel);
+    	iNeedToCompleteMessage = EFalse;
+    	}
+    iNeedToCompleteMessage = EFalse;
+    iReplySlot = NULL;
+
+    // Activate apps -key again (if not previously activated yet)
+	SuppressAppSwitching( EFalse );
+
+    CActive::Cancel();
+
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::Cancel() completed") );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::UpdateL
+// Notifier update. Not supported.
+// -----------------------------------------------------------------------------
+//
+TPtrC8 CSyncMLNotifierBase::UpdateL(const TDesC8& /*aBuffer*/)
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::UpdateL()") );
+    TPtrC8 ret(KNullDesC8);
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::UpdateL() completed") );
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::DoCancel
+// This method will be called by framework (CActive)
+// if active object is still active.
+// Does nothing here.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::DoCancel()
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::DoCancel()") );
+	FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::DoCancel()--End") );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::RunError
+// This method is called if any leaving has been occured
+// during RunL. Optional method for CActive derived objects.
+// -----------------------------------------------------------------------------
+//
+TInt CSyncMLNotifierBase::RunError( TInt aError )
+    {
+    FTRACE( FPrint( _L("[SmlNotif]\t CSyncMLNotifierBase::RunError() Error = %d"), aError ) );
+    // Activate apps -key again (if not previously activated yet)
+	SuppressAppSwitching( EFalse );
+
+    // Complete message if needed and return the error code.
+    if( iNeedToCompleteMessage )
+        {
+        iMessage.Complete( aError );
+        }
+    iNeedToCompleteMessage = EFalse;
+    iReplySlot = NULL;
+
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::RunError() completed") );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::TurnLightsOn
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::TurnLightsOn()
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::TurnLightsOn()") );
+
+    RProperty::Set( KPSUidCoreApplicationUIs, KLightsControl, ELightsOn );
+    RProperty::Set( KPSUidCoreApplicationUIs, KLightsControl, ELightsOff );
+
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::TurnLightsOn() completed") );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::AutoLockOnL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLNotifierBase::AutoLockOnL()
+    {
+    FLOG( _L("[SmlNotif]\t CSyncMLNotifierBase::AutoLockOnL()") );
+
+    TBool result = EFalse;
+    TInt status = 1;
+    
+    // Connecting and initialization:
+    CRepository* repository = CRepository::NewL( KCRUidSecuritySettings );
+
+    repository->Get( KSettingsAutolockStatus, status );
+
+    // Closing connection:
+    delete repository;
+
+    if ( status == 1 )
+        {
+        result = ETrue;
+        }
+
+    FTRACE( FPrint(
+        _L("[SmlNotif]\t CSyncMLNotifierBase::AutoLockOnL() completed with %d"),
+        result ) );
+
+    return result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLNotifierBase::SuppressAppSwitchching
+// -----------------------------------------------------------------------------
+//
+void CSyncMLNotifierBase::SuppressAppSwitching( TBool aEnable )
+    {	   
+    if ( iAppsKeyBlocked != aEnable )
+        {
+        TInt err = ( ( CAknNotifierAppServerAppUi* )
+            ( CEikonEnv::Static() )->EikAppUi() )->
+            SuppressAppSwitching( aEnable );
+        iAppsKeyBlocked = aEnable;
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLNotifierMain.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -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:  Methods for the SyncML Appserver starter notifier
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+
+// All provided notifiers
+#include    "SyncMLAppLaunchNotifier.h"
+#include    "SyncMLDlgNotifier.h"
+#include    "SyncMLFwUpdNotifier.h"
+
+#include    "SyncMLNotifDebug.h"
+
+// CONSTANTS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CleanupArray
+// Deletes notifiers
+// -----------------------------------------------------------------------------
+LOCAL_C void CleanupArray( TAny* aArray )
+    {
+    FLOG(_L("[SmlNotif]\t CleanupArray()"));
+    
+    CArrayPtrFlat<MEikSrvNotifierBase2>*     
+        subjects = static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray);
+    TInt lastInd = subjects->Count() - 1;
+    for ( TInt i = lastInd; i >= 0; i-- )
+        {
+        subjects->At(i)->Release();	    	    
+        }
+    delete subjects;
+    
+    FLOG(_L("[SmlNotif]\t CleanupArray() completed"));
+    }
+
+// -----------------------------------------------------------------------------
+// CreateSmlNotifiersL
+// Instantiate notifiers
+// -----------------------------------------------------------------------------
+LOCAL_C CArrayPtrFlat<MEikSrvNotifierBase2>* CreateSmlNotifiersL()
+    {
+    FLOG(_L("[SmlNotif]\t CreateSmlNotifiersL"));
+
+    CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers =
+        new ( ELeave ) CArrayPtrFlat<MEikSrvNotifierBase2>
+        ( KSmlNotifierArrayIncrement );
+    
+    CleanupStack::PushL( TCleanupItem( CleanupArray, notifiers ) );
+    
+    CSyncMLAppLaunchNotifier* appLaunchNotifier = CSyncMLAppLaunchNotifier::NewL();
+    CleanupStack::PushL( appLaunchNotifier );
+    notifiers->AppendL( appLaunchNotifier );
+    CleanupStack::Pop( appLaunchNotifier );
+
+    CSyncMLDlgNotifier* dlgNotifier = CSyncMLDlgNotifier::NewL( appLaunchNotifier );
+    CleanupStack::PushL( dlgNotifier );
+    notifiers->AppendL( dlgNotifier );
+    CleanupStack::Pop( dlgNotifier );
+
+    CSyncMLFwUpdNotifier* fwUpdNotifier = CSyncMLFwUpdNotifier::NewL();
+    CleanupStack::PushL( fwUpdNotifier );
+    notifiers->AppendL( fwUpdNotifier );
+    CleanupStack::Pop( fwUpdNotifier );
+
+    CleanupStack::Pop( notifiers );
+    
+    FLOG(_L("[SmlNotif]\t CreateSmlNotifiersL completed"));
+    return notifiers;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// NotifierArray
+// Lib main entry point: Creates a notifiers array.
+// -----------------------------------------------------------------------------
+EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+    {
+    FLOG( _L("[SMLNOTIF]\t NotifierArray") );
+
+    CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers = NULL;
+    TRAPD( err, notifiers = CreateSmlNotifiersL() );
+
+    if( err != KErrNone )
+        {
+        FTRACE(FPrint(_L("[SmlNotif]\t Notifier creation failure! Error code: %d"), err));
+        err = KErrNone;
+        }
+
+    FLOG(_L("[SmlNotif]\t NotifierArray completed"));
+
+    return notifiers;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLPreSyncPluginInterface.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2007 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:  Finds the correct plugin
+*
+*/
+
+
+// INCLUDE FILES
+#include <nsmlconstants.h>
+#include "SyncMLPreSyncPluginInterface.h"
+#include "CPreSyncPlugin.h"
+
+_LIT(kDefault,"DEFAULT");
+
+// ============================== MEMBER FUNCTIONS ============================
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::NewL
+// Two Phase Construction
+// ----------------------------------------------------------------------------
+CPreSyncPluginInterface* CPreSyncPluginInterface::NewL()
+{    
+    CPreSyncPluginInterface* self = CPreSyncPluginInterface::NewLC();
+    CleanupStack::Pop( self );
+      
+    return self;
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::NewLC
+// Two Phase Construction
+// ---------------------------------------------------------------------------- 
+CPreSyncPluginInterface* CPreSyncPluginInterface::NewLC()
+{   
+    CPreSyncPluginInterface* self = new( ELeave ) CPreSyncPluginInterface();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    
+    return self;
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::CPreSyncPluginInterface
+// Constructor
+// ----------------------------------------------------------------------------    
+CPreSyncPluginInterface::CPreSyncPluginInterface()
+{
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::ConstructL
+// 2nd phase constructor
+// ---------------------------------------------------------------------------- 
+void CPreSyncPluginInterface::ConstructL()
+{
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::~CPreSyncPluginInterface
+// Constructor
+// ---------------------------------------------------------------------------- 
+CPreSyncPluginInterface::~CPreSyncPluginInterface( ) 
+{
+    UnloadPlugIns();
+    //iPcsPluginInstances.ResetAndDestroy();
+}
+        
+/**
+* Lists all implementations which satisfy this ecom interface
+*
+* @param aImplInfoArray On return, contains the list of available implementations
+* 
+*/   
+inline void CPreSyncPluginInterface::ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray )
+{
+    REComSession::ListImplementationsL( KPreSyncPluginInterfaceUid, aImplInfoArray );
+}
+        
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::InstantiateAllPlugInsL
+// Instantiates all plugins
+// ----------------------------------------------------------------------------     
+CPreSyncPlugin* CPreSyncPluginInterface::InstantiateRoamingPluginLC( TSmlProfileId aProfileId )
+{
+    RImplInfoPtrArray infoArray;
+    TBool bHandleSync = false;
+    CPreSyncPlugin* syncPlugin = NULL;
+    CPreSyncPlugin* defaultSyncPlugin = NULL;
+
+	CleanupRImplInfoPtrArrayPushL( &infoArray );
+
+    // Get list of all implementations
+    TRAPD(error, ListAllImplementationsL( infoArray ));
+    
+    if (error != KErrNone)
+        {
+		CleanupStack::PopAndDestroy( &infoArray );
+		User::Leave( error );
+        }
+
+    // Instantiate plugins for all impUIds by calling 
+    // InstantiatePlugInFromImpUidL
+    for ( TInt i=0; i<infoArray.Count(); i++ )
+    {
+        // Get imp info
+        CImplementationInformation& info( *infoArray[i] );
+
+		TUid impUid ( info.ImplementationUid() );	        
+	    
+
+        if ( info.DisplayName().Compare(kDefault) == 0 )
+        {			
+	        //instantiate plugin for impUid
+	        defaultSyncPlugin = InstantiatePlugInFromImpUidL( impUid );
+			defaultSyncPlugin->SetProfile(aProfileId);
+			break;
+        }
+		else
+		{
+			syncPlugin = InstantiatePlugInFromImpUidL( impUid );
+			syncPlugin->SetProfile(aProfileId);
+			if(syncPlugin->IsSupported() == true)
+			{
+				bHandleSync = true;
+				break;
+			}
+			else
+			{
+				delete syncPlugin;
+			}
+		}
+    }
+
+    CleanupStack::PopAndDestroy( &infoArray );
+	if(bHandleSync == true)
+	{		
+		
+	     delete defaultSyncPlugin;
+		CleanupStack::PushL(syncPlugin);
+		return syncPlugin;
+	}
+	else
+	{      
+        CleanupStack::PushL(defaultSyncPlugin);
+		return defaultSyncPlugin;
+	}    
+ }
+
+// -----------------------------------------------------------------------------
+// CPreSyncPluginInterface::UnloadPlugIns
+// Unloads plugins
+// -----------------------------------------------------------------------------
+void CPreSyncPluginInterface::UnloadPlugIns()
+{    
+    REComSession::FinalClose();
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::InstantiatePlugInFromImpUidL
+// Instantiates plugin
+// ---------------------------------------------------------------------------- 
+CPreSyncPlugin* CPreSyncPluginInterface::InstantiatePlugInFromImpUidL( const TUid& aImpUid )
+{    
+   // REComSession
+    CPreSyncPlugin *preSyncPlugin= NULL;
+    preSyncPlugin = CPreSyncPlugin::NewL(aImpUid);
+    return preSyncPlugin;
+/*
+   TAny* implementation = REComSession::CreateImplementationL ( aImpUid, 
+                _FOFF( CPreSyncPlugin , iDtor_ID_Key) );
+   CPreSyncPlugin* self = REINTERPRET_CAST( CPreSyncPlugin*, implementation );
+   CleanupStack::PushL( self );
+        
+   return self;
+   */
+}
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLQueryDialog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* 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:  Implementation of the query dialog.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLQueryDialog.h"
+#include "SyncMLNotifDebug.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryDialog::CSyncMLQueryDialog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLQueryDialog::CSyncMLQueryDialog(TBool& aKeyPress  ):iKeyPress(aKeyPress)
+    
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryDialog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLQueryDialog* CSyncMLQueryDialog::NewL(TBool& aKeyPress )
+    {
+    CSyncMLQueryDialog* self =
+        new( ELeave ) CSyncMLQueryDialog (aKeyPress  );
+    
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CSyncMLQueryDialog::~CSyncMLQueryDialog
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLQueryDialog::~CSyncMLQueryDialog()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryDialog::OkToExitL
+// Determines if the dialog can be closed.
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLQueryDialog::OkToExitL( TInt aButtonId )
+    {
+    return CAknQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryDialog::NeedToDismissQueryL
+// Called by OfferkeyEventL(), gives a change to dismiss the query even with
+// keys different than Enter of Ok.
+// -----------------------------------------------------------------------------
+// 
+TBool CSyncMLQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
+    {
+    if (aKeyEvent.iCode == EKeyNo)
+        {
+        iKeyPress=ETrue;
+		DismissQueryL();
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLQueryTimer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* 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:  Timer for queries that have timeout.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "SyncMLQueryTimer.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryTimer::CSyncMLQueryTimer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLQueryTimer::CSyncMLQueryTimer( MSyncMLQueryTimerObserver* aObserver )
+    : CTimer( EPriorityStandard ), iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryTimer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSyncMLQueryTimer::ConstructL()
+    {
+	CTimer::ConstructL();
+	CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryTimer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLQueryTimer* CSyncMLQueryTimer::NewL( MSyncMLQueryTimerObserver* aObserver )
+    {
+    CSyncMLQueryTimer* self = new( ELeave ) CSyncMLQueryTimer( aObserver );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+    
+// Destructor
+CSyncMLQueryTimer::~CSyncMLQueryTimer()
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncMLQueryTimer::RunL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLQueryTimer::RunL()
+    {
+    if ( iObserver )
+        {
+        iObserver->TimerExpired();
+        }
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLTimedDateQuery.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the message query with timeout timer.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLTimedDateQuery.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::CSyncMLTimedDateQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedDateQuery::CSyncMLTimedDateQuery( TTime& aDate, TBool& aKeypress,TInt aTimeout )
+    : CAknTimeQueryDialog(aDate, ENoTone),iTimeout( aTimeout ),iKeypress( aKeypress )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedDateQuery* CSyncMLTimedDateQuery::NewL( TTime& aDataText, const TDesC& aPromptText,
+                                                     TBool& aKeypress, TInt  aTimeout )
+    {
+    CSyncMLTimedDateQuery* self =
+        new( ELeave ) CSyncMLTimedDateQuery ( aDataText, aKeypress, aTimeout );
+    
+    CleanupStack::PushL( self );
+    self->SetPromptL( aPromptText );//chenge to set prompt
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::~CSyncMLTimedDateQuery()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedDateQuery::~CSyncMLTimedDateQuery()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedDateQuery::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == KErrTimedOut )
+        {
+        return ETrue;
+        }
+    return CAknTimeQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::TimerExpired
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedDateQuery::TimerExpired()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        iTimeout = KSyncMLNNoTimeoutDate;
+        }
+    TRAPD( err, TryExitL( KErrTimedOut ) );
+    
+    if ( err != KErrNone )
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLTimedDateQuery::TimerExpired() TryExitL returned %d"),
+            err ) );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::PostLayoutDynInitL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedDateQuery::PostLayoutDynInitL()
+    {
+    if ( iTimeout > KSyncMLNNoTimeoutDate )
+        {
+        iTimer = CSyncMLQueryTimer::NewL( this );
+        iTimer->After( iTimeout * KSyncMLuSecsInSec );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::NeedToDismissQueryL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedDateQuery::NeedToDismissQueryL( const TKeyEvent& aKeyEvent )
+    {
+    if (aKeyEvent.iCode == EKeyNo)
+        {
+            iKeypress = ETrue;
+            DismissQueryL();
+            return ETrue;
+            
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedDateQuery::DismissQueryL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedDateQuery::DismissQueryL()
+	{
+	 TryExitL(EEikBidCancel);
+	}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLTimedInputTextQuery.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the text input query with timeout timer.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLTimedInputTextQuery.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::CSyncMLTimedInputTextQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedInputTextQuery::CSyncMLTimedInputTextQuery( TDes& aDataText, TBool& aKeypress, TInt aTimeout )
+    : CAknTextQueryDialog(aDataText, ENoTone),iTimeout( aTimeout ),iKeypress(aKeypress)
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedInputTextQuery* CSyncMLTimedInputTextQuery::NewL( TDes& aDataText, const TDesC& aPromptText,
+                                                              TBool& aKeypress, TInt  aTimeout )
+    {
+    CSyncMLTimedInputTextQuery* self =
+        new( ELeave ) CSyncMLTimedInputTextQuery ( aDataText, aKeypress, aTimeout );
+    
+    CleanupStack::PushL( self );
+    self->SetPromptL( aPromptText );//chenge to set prompt
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::CSyncMLTimedInputTextQuery()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedInputTextQuery::~CSyncMLTimedInputTextQuery()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        }
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedInputTextQuery::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == KErrTimedOut )
+        {
+        return ETrue;
+        }
+    return CAknTextQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::TimerExpired
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedInputTextQuery::TimerExpired()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        iTimeout = KSyncMLNNoAlphanumTimeout;
+        }
+    TRAPD( err, TryExitL( KErrTimedOut ) );
+    
+    if ( err != KErrNone )
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLTimedInputTextQuery::TimerExpired() TryExitL returned %d"),
+            err ) );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::PostLayoutDynInitL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedInputTextQuery::PostLayoutDynInitL()
+    {
+    if ( iTimeout > KSyncMLNNoAlphanumTimeout )
+        {
+        iTimer = CSyncMLQueryTimer::NewL( this );
+        iTimer->After( iTimeout * KSyncMLuSecsInSec );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::NeedToDismissQueryL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedInputTextQuery::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
+    {
+    if (aKeyEvent.iCode == EKeyNo)
+        {
+        //CAknQueryControl* control = QueryControl();
+        //if (control && control->QueryType() == EPinLayout)
+          //  {
+          iKeypress = ETrue;
+            DismissQueryL();
+            return ETrue;
+            //}
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::DismissQueryL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedInputTextQuery::DismissQueryL()
+	{
+	 TryExitL(EEikBidCancel);
+	}
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedInputTextQuery::HandleQueryEditorStateEventL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedInputTextQuery::HandleQueryEditorStateEventL( 
+        CAknQueryControl* aQueryControl, TQueryControlEvent aEventType, 
+        TQueryValidationStatus aStatus )
+	{
+    if (aQueryControl)
+        {
+        if (EPhoneLayout == aQueryControl->QueryType())
+            {
+            if (aEventType == EEmergencyCallAttempted)
+                {
+                TryExitL(EEikBidCancel);
+                }
+            else
+                {
+
+                TBuf<KSyncMLMaxDefaultResponseMsgLength> PhoneNo;
+                aQueryControl->GetText(PhoneNo);
+                TInt posplus = PhoneNo.LocateReverse('+');
+                if (posplus == 0 || posplus == KErrNotFound)
+                    {
+                    CAknQueryDialog::HandleQueryEditorStateEventL(
+                            aQueryControl, aEventType, aStatus);
+                    }
+                else
+                    {
+                    MakeLeftSoftkeyVisible(EFalse);
+                    }
+                }
+            }
+
+        else //For all other layouts 
+            {
+            CAknQueryDialog::HandleQueryEditorStateEventL(aQueryControl,
+                    aEventType, aStatus);
+            }
+        }
+    return EFalse;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLTimedMessageQuery.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,120 @@
+/*
+* 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:  Implementation of the message query with timeout timer.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLTimedMessageQuery.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::CSyncMLTimedMessageQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedMessageQuery::CSyncMLTimedMessageQuery( TInt aTimeout )
+    : iTimeout( aTimeout )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedMessageQuery* CSyncMLTimedMessageQuery::NewL( const TDesC& aMessage,
+                                                                TInt  aTimeout )
+    {
+    CSyncMLTimedMessageQuery* self =
+        new( ELeave ) CSyncMLTimedMessageQuery ( aTimeout );
+    
+    CleanupStack::PushL( self );
+    self->SetMessageTextL( aMessage );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+    
+// Destructor
+CSyncMLTimedMessageQuery::~CSyncMLTimedMessageQuery()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedMessageQuery::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == KErrTimedOut )
+        {
+        return ETrue;
+        }
+    return CAknQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::TimerExpired
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedMessageQuery::TimerExpired()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        iTimeout = KSyncMLNNoTimeout;
+        }
+    TRAPD( err, TryExitL( KErrTimedOut ) );
+    
+    if ( err != KErrNone )
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLTimedMessageQuery::TimerExpired() TryExitL returned %d"),
+            err ) );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::PostLayoutDynInitL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedMessageQuery::PostLayoutDynInitL()
+    {
+    if ( iTimeout > KSyncMLNNoTimeout )
+        {
+        iTimer = CSyncMLQueryTimer::NewL( this );
+        iTimer->After( iTimeout * KSyncMLuSecsInSec );
+        }
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLTimedNumberQueryDialog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the query dialog with timeout timer.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLTimedNumberQueryDialog.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::CSyncMLTimedNumberQueryDialog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedNumberQueryDialog::CSyncMLTimedNumberQueryDialog( TReal& aValue, TBool& aKeypress,TInt aTimeout ):
+CAknFloatingPointQueryDialog( aValue, CAknQueryDialog::EConfirmationTone )
+   
+    {
+     iTimeout = aTimeout ;
+     iKeypress = aKeypress;
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedNumberQueryDialog* CSyncMLTimedNumberQueryDialog::NewL( TReal& aValue,                                                              
+                                const TDesC& aMessage,TBool& aKeypress, TInt  aTimeout )                                                             
+    {
+    CSyncMLTimedNumberQueryDialog* self =
+        new( ELeave ) CSyncMLTimedNumberQueryDialog( aValue, aKeypress, aTimeout ) ;
+    
+    CleanupStack::PushL( self );
+    
+    	self->SetPromptL( aMessage );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+  
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::~CSyncMLTimedNumberQueryDialog
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedNumberQueryDialog::~CSyncMLTimedNumberQueryDialog()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedNumberQueryDialog::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == KErrTimedOut )
+        {
+        return ETrue;
+        }
+    return CAknFloatingPointQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::TimerExpired
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedNumberQueryDialog::TimerExpired()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        iTimeout = KSyncMLNNoTimeout;
+        }
+    TRAPD( err, TryExitL( KErrTimedOut ) );
+    
+    if ( err != KErrNone )
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLTimedNumberQueryDialog::TimerExpired() \
+             TryExitL returned %d"), err ) );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::PostLayoutDynInitL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedNumberQueryDialog::PostLayoutDynInitL()
+    {
+    if ( iTimeout > KSyncMLNNoTimeout )
+        {
+        iTimer = CSyncMLQueryTimer::NewL( this );
+        iTimer->After( iTimeout * KSyncMLuSecsInSec );
+        }
+    CAknFloatingPointQueryDialog::PostLayoutDynInitL();
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::NeedToDismissQueryL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedNumberQueryDialog::NeedToDismissQueryL( const TKeyEvent& aKeyEvent )
+    {
+    if (aKeyEvent.iCode == EKeyNo)
+        {
+        
+          iKeypress = ETrue;
+          DismissQueryL();
+          return ETrue;
+            
+        }
+    return EFalse;
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedNumberQueryDialog::DismissQueryL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedNumberQueryDialog::DismissQueryL()
+	{
+	 TryExitL(EEikBidCancel);
+	}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/SyncMLTimedQueryDialog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* 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:  Implementation of the query dialog with timeout timer.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SyncMLTimedQueryDialog.h"
+#include "SyncMLNotifDebug.h"
+
+// CONSTANTS
+const TInt  KSyncMLuSecsInSec   = 1000000; // Microseconds in a second
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::CSyncMLTimedMessageQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedQueryDialog::CSyncMLTimedQueryDialog( TInt aTimeout )
+    : iTimeout( aTimeout )
+    {
+    iTone = EConfirmationTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSyncMLTimedQueryDialog* CSyncMLTimedQueryDialog::NewL( const TDesC& aMessage,
+                                                                TInt  aTimeout )
+    {
+    CSyncMLTimedQueryDialog* self =
+        new( ELeave ) CSyncMLTimedQueryDialog ( aTimeout );
+    
+    CleanupStack::PushL( self );
+    self->SetPromptL( aMessage );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+    
+// Destructor
+CSyncMLTimedQueryDialog::~CSyncMLTimedQueryDialog()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CSyncMLTimedQueryDialog::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == KErrTimedOut )
+        {
+        return ETrue;
+        }
+    return CAknQueryDialog::OkToExitL( aButtonId );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::TimerExpired
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedQueryDialog::TimerExpired()
+    {
+    if ( iTimer )
+        {
+        iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+        iTimeout = KSyncMLNNoTimeout;
+        }
+    TRAPD( err, TryExitL( KErrTimedOut ) );
+    
+    if ( err != KErrNone )
+        {
+        FTRACE( FPrint(
+            _L("[SmlNotif]\t CSyncMLTimedQueryDialog::TimerExpired() \
+             TryExitL returned %d"), err ) );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSyncMLTimedMessageQuery::PostLayoutDynInitL
+// -----------------------------------------------------------------------------
+//
+void CSyncMLTimedQueryDialog::PostLayoutDynInitL()
+    {
+    if ( iTimeout > KSyncMLNNoTimeout )
+        {
+        iTimer = CSyncMLQueryTimer::NewL( this );
+        iTimer->After( iTimeout * KSyncMLuSecsInSec );
+        }
+    CAknQueryDialog::PostLayoutDynInitL();
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncmlnotifier/src/syncmlmmcwatcher.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Methods for the SyncML Appserver starter notifier
+ *
+ */
+
+#include "syncmlmmcwatcher.h"
+
+// -----------------------------------------------------------------------------
+// CSyncmlmmcwatcher::NewL()
+// -----------------------------------------------------------------------------
+CSyncmlmmcwatcher* CSyncmlmmcwatcher::NewL( MSyncMLQueryMmcObserver* aObserver )
+    {
+    CSyncmlmmcwatcher* self = new( ELeave ) CSyncmlmmcwatcher( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncmlmmcwatcher::CSyncmlmmcwatcher()
+// -----------------------------------------------------------------------------
+inline CSyncmlmmcwatcher::CSyncmlmmcwatcher(MSyncMLQueryMmcObserver* aObserver)    
+    {    
+    immcobserver = aObserver;
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncmlmmcwatcher::ConstructL()
+// -----------------------------------------------------------------------------
+void CSyncmlmmcwatcher::ConstructL()
+    {    
+    TInt err = iMemoryCard.Connect();
+    if ( err == KErrNone )
+        {
+        }
+
+    else
+        User::LeaveIfError(err);
+    iDiskNotifyHandler = CDiskNotifyHandler::NewL( *this, iMemoryCard );
+    }
+
+// -----------------------------------------------------------------------------
+// CSyncmlmmcwatcher::StartL()
+// Logs a request to notify the disk events
+// -----------------------------------------------------------------------------
+void CSyncmlmmcwatcher::StartL()
+    {   
+    FLOG(_L("CSyncmlmmcwatcher::Start- begin"));
+
+    if(iDiskNotifyHandler)
+        {
+        iDiskNotifyHandler->NotifyDisk();
+        }
+    }
+
+// ----------------------------------------------------------------------------------------
+// CSyncmlmmcwatcher::~CSyncmlmmcwatcher() 
+// Destructor
+// ----------------------------------------------------------------------------------------
+CSyncmlmmcwatcher::~CSyncmlmmcwatcher()
+    { 
+    FLOG(_L("CSyncmlmmcwatcher::~CSyncmlmmcwatcher()"));  
+    if(iDiskNotifyHandler)
+        {
+        iDiskNotifyHandler->CancelNotifyDisk();
+        delete iDiskNotifyHandler;
+        iDiskNotifyHandler = NULL;
+        }
+
+    if(iMemoryCard.Handle())
+        {
+        iMemoryCard.Close();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSyncmlmmcwatcher::HandleNotifyDisk
+// Callback method to notify disk events
+// ---------------------------------------------------------------------------
+//
+void CSyncmlmmcwatcher::HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent )
+    {
+    FTRACE( FPrint(
+            _L( "CSysApMMCObserver::HandleNotifyDisk: error: %d, type: %d, drive: %d," ),
+            aError, aEvent.iType, aEvent.iDrive ) );
+
+    if ( aError != KErrNone )
+        {
+        return;
+        }
+    else
+        {
+        if(immcobserver)
+            {
+            FLOG(_L("mmc removal check"));
+            TInt diskinserted = EFalse;
+            RProperty::Get(KPSUidUikon, KUikMMCInserted,diskinserted);
+            if(diskinserted)//EDiskStatusChanged called for insert & hard removal
+                {
+                FLOG(_L("disk inserted"));
+                }
+            else
+                {
+                FLOG(_L("disk removed"));
+                immcobserver->MmcRemoved();
+                }
+            FLOG(_L("mmcremoved call completed"));
+            }
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CSyncmlmmcwatcher::CancelMmcwatch
+// Cancels the notification
+// ---------------------------------------------------------------------------
+//
+void CSyncmlmmcwatcher::CancelMmcwatch()
+    {
+    if(iDiskNotifyHandler)
+        {
+        iDiskNotifyHandler->CancelNotifyDisk();
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/BWINS/SyncServiceu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,6 @@
+EXPORTS
+	??0CSyncServiceSession@@QAE@XZ @ 1 NONAME ; CSyncServiceSession::CSyncServiceSession(void)
+	?NewL@CSyncService@@SAPAV1@PAVMAknServerAppExitObserver@@I@Z @ 2 NONAME ; class CSyncService * CSyncService::NewL(class MAknServerAppExitObserver *, unsigned int)
+	?StartSyncL@CSyncService@@QAE?AVTUid@@UTSyncServiceParam@@@Z @ 3 NONAME ; class TUid CSyncService::StartSyncL(struct TSyncServiceParam)
+	?EnableProgressNoteL@CSyncService@@QAEXH@Z @ 4 NONAME ; void CSyncService::EnableProgressNoteL(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/INC/SyncServiceDebug.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* 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 file defines logging macros for SyncService
+*
+*/
+
+
+
+#ifndef NSMLDMSYNCSERVICEDEBUG_H
+#define NSMLDMSYNCSERVICEDEBUG_H
+
+#ifdef _DEBUG
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT( KLogFile, "OmaDMApp.log" );
+_LIT( KLogDirFullName, "c:\\logs\\" );
+_LIT( KLogDir, "OmaDMApp" );
+
+#define FLOG( a )   { FPrint(a); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,
+                              KLogFile,
+                              EFileLoggingModeAppend,
+                              aFmt,
+                              list );
+    }
+
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+#include <e32svr.h>
+
+#define FLOG( a )   { RDebug::Print( a ); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    TInt tmpInt = VA_ARG( list, TInt );
+    TInt tmpInt2 = VA_ARG( list, TInt );
+    TInt tmpInt3 = VA_ARG( list, TInt );
+    VA_END( list );
+    RDebug::Print( aFmt, tmpInt, tmpInt2, tmpInt3 );
+    }
+
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG( a )
+#define FTRACE( a )
+
+#endif // _DEBUG
+
+#endif      // NSMLDMSYNCSERVICEDEBUG_H
+            
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/SRC/SyncService.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,328 @@
+/*
+* 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:  Client for DS and DM initiated syncs
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include <bldvariant.hrh>
+
+#include <centralrepository.h>
+#include <SyncMLNotifierDomainCRKeys.h>
+#include <SyncServiceSession.h>
+#include <SyncServiceParams.h>
+#include <SyncService.h>
+#include <SyncServiceConst.h>
+#include "SyncServiceDebug.h"
+
+#include <apgcli.h>
+#include <AknServerApp.h>
+#include <barsread2.h>
+
+// ----------------------------------------------------------------------------
+// RSyncService::StartSyncL
+// ----------------------------------------------------------------------------
+//
+void RSyncService::StartSyncL( TSyncServiceParam aParam )
+	{
+	FLOG( _L( "[RSyncService] StartSyncL" ) );
+	
+	TSyncParameters parameters;
+	parameters.iCommand = KSyncServCmdStartSync;
+    parameters.iJobId = aParam.iJobId;
+    parameters.iProfileId = aParam.iProfileId;
+    parameters.iSilent = aParam.iSilent;
+    TInt err = 
+		SendReceive( ESyncServiceCommand, TIpcArgs( parameters.iCommand,
+		                                            parameters.iJobId,
+		                                            parameters.iProfileId,
+		                                            parameters.iSilent ) );
+	User::LeaveIfError( err );
+	}
+
+// ----------------------------------------------------------------------------
+// RSyncService::EnableProgressNoteL
+// ----------------------------------------------------------------------------
+//
+void RSyncService::EnableProgressNoteL( TBool aEnabled )
+	{
+	FLOG( _L("[RSyncService] EnableProgressNoteL") );
+
+	TSyncParameters parameters;
+	parameters.iCommand = KSyncServCmdShowProgress;
+
+    if ( aEnabled )
+        {
+        parameters.iJobId = KSyncServEnabled;
+        }
+    else
+        {
+        parameters.iJobId = KSyncServDisabled;
+        }
+    
+    TInt err = 
+		SendReceive( ESyncServiceCommand, TIpcArgs( parameters.iCommand,
+		                                            parameters.iJobId,
+		                                            parameters.iProfileId,
+		                                            parameters.iSilent ) );
+	User::LeaveIfError( err );
+	}
+
+// ----------------------------------------------------------------------------
+// RSyncService::ServiceUid
+// ----------------------------------------------------------------------------
+//
+TUid RSyncService::ServiceUid() const
+	{
+	FLOG( _L( "[RSyncService] ServiceUid" ) );
+	
+	return TUid::Uid( KSyncServiceUid );
+	}
+
+// ----------------------------------------------------------------------------
+// CSyncService::CSyncService
+// ----------------------------------------------------------------------------
+//
+CSyncService::CSyncService( )
+	{
+	FLOG( _L( "[CSyncService] CSyncService" ) );
+	
+	}
+
+// ----------------------------------------------------------------------------
+// CSyncService::~CSyncService
+// ----------------------------------------------------------------------------
+//
+CSyncService::~CSyncService( )
+	{
+	FLOG( _L( "[CSyncService] ~CSyncService" ) );
+	
+	delete iMonitor;
+	iService.Close();
+	}
+
+// ----------------------------------------------------------------------------
+// CSyncService::NewL
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CSyncService* CSyncService::NewL( MAknServerAppExitObserver* aObserver,
+                                           TUint aServiceId )
+    {
+    FLOG( _L( "[CSyncService] NewL" ) );
+    
+	CSyncService* self = new(ELeave) CSyncService();
+	CleanupStack::PushL(self);
+    self->ConstructL( aObserver, aServiceId );
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CSyncService::ConstructL
+// ----------------------------------------------------------------------------
+//
+void CSyncService::ConstructL( MAknServerAppExitObserver* /*aObserver*/,
+                               TUint aServiceId )
+    {
+	FLOG( _L( "[CSyncService] ConstructL" ) );
+    iServiceId = aServiceId;
+    }
+
+// ----------------------------------------------------------------------------
+// CSyncService::StartSyncL
+// ----------------------------------------------------------------------------
+//
+EXPORT_C TUid CSyncService::StartSyncL( TSyncServiceParam aParam )
+    {
+    FLOG( _L( "[CSyncService] StartSyncL" ) );
+
+    iServiceId = aParam.iServiceId;
+	iUid = DiscoverL( iServiceId );
+	
+    TInt error = KErrNotFound;
+        
+    if( iService.ServerName().Length() > 0 )
+        {
+        FLOG( _L( "[CSyncService] ConstructL connect to existing app" ) );
+  	    TRAP( error, iService.StartSyncL( aParam ) );
+  	    if ( error == KErrNone )
+  	        {
+  	        return iUid;
+  	        }
+        }
+   	if ( error )
+		{
+		TFullName aServerName;
+		if ( iServiceId == KDevManServiceStart )
+		    {
+    		CRepository* centrep = NULL;
+    		centrep = CRepository::NewL( KCRUidNSmlNotifierDomainKeys );
+    		centrep->Get( KNSmlDMAppName, aServerName );
+    		delete centrep;
+		    }
+		else
+		    {
+		    aServerName = KDataSyncServiceName;
+		    }
+        FLOG( _L( "[CSyncService] ConstructL connect to existing app with predefined name" ) );
+        iService.Close();
+		TRAP( error, iService.ConnectExistingByNameL( aServerName ) );
+		}
+   	if ( error )
+		{
+		FLOG( _L( "[CSyncService] ConstructL connect to new app" ) );
+    	TRAP( error, iService.ConnectNewAppL( iUid ) );
+    	if( error )
+    		{
+    		FLOG( _L( "[CSyncService] ConnectNewAppL: Error not supported" ) );
+    		User::Leave( KErrNotSupported );
+    		}
+ 		}
+    
+    iService.StartSyncL( aParam );
+    return iUid;
+    }
+
+// ----------------------------------------------------------------------------
+// CSyncService::EnableProgressNoteL
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CSyncService::EnableProgressNoteL( TBool aEnabled )
+    {
+    FLOG( _L( "[CSyncService] EnableProgressNoteL" ) );
+    
+    TFullName DmAppName;
+    CRepository* centrep = NULL;
+    centrep = CRepository::NewL( KCRUidNSmlNotifierDomainKeys );
+    centrep->Get( KNSmlDMAppName, DmAppName );
+    delete centrep;
+    
+    if( iService.ServerName().Length() > 0 )
+        {
+		TRAPD(error, iService.EnableProgressNoteL( aEnabled ) );
+		if ( error != KErrNone )
+		    {
+    		TFullName aServerName;
+    		if ( iServiceId == KDevManServiceStart )
+    		    {
+                aServerName = DmAppName;
+    		    }
+    		else
+    		    {
+    		    aServerName = KDataSyncServiceName;
+    		    }
+            FLOG( _L( "[CSyncService] EnableProgressNoteL connect to existing app with predefined name" ) );
+            iService.Close();
+    		iService.ConnectExistingByNameL( aServerName );        
+            iService.EnableProgressNoteL( aEnabled );
+		    }
+        }
+    else
+        {
+        // Sync has been started from APP UI so connect to the service and enable progressnote
+		TFullName aServerName;
+		if ( iServiceId == KDevManServiceStart )
+		    {
+		    aServerName = DmAppName;
+		    }
+		else
+		    {
+		    aServerName = KDataSyncServiceName;
+		    }
+        FLOG( _L( "[CSyncService] EnableProgressNoteL connect to existing app with predefined name" ) );
+		iService.ConnectExistingByNameL( aServerName );        
+        iService.EnableProgressNoteL( aEnabled );
+        }
+    FLOG( _L( "[CSyncService] EnableProgressNoteL" ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CSyncService::DiscoverL
+// ----------------------------------------------------------------------------
+//
+TUid CSyncService::DiscoverL( TUint aServiceId )
+	{
+	FLOG( _L( "[CSyncService] DiscoverL" ) );
+	
+	CApaAppServiceInfoArray* services = NULL;	
+	RApaLsSession ls;
+	TUid appUid = TUid::Uid( 0x0 ); // Set the uid as NULL
+	
+	if( ls.Connect() == KErrNone )
+		{
+	    CleanupClosePushL( ls );
+		TInt ret = ls.GetServerApps( TUid::Uid( KSyncServiceUid ) );
+
+		if( ret != KErrNone )
+			{
+		    CleanupStack::PopAndDestroy( );  // closes RApaLsSession		
+		    return appUid; // return NULL appUid
+			}
+
+		services = ls.GetServiceImplementationsLC( TUid::Uid( KSyncServiceUid ) );			
+		
+		if( services )
+			{
+			TArray<TApaAppServiceInfo> s = services->Array( );
+			
+			TInt count = s.Count( );
+		
+			if( count != 0)
+				{	// 
+				for( TInt i = 0; i < count; i++ )
+					{
+					if( TryMatchL( s[i], appUid, aServiceId ) )
+						{ // If one of the services match, return the uid set by TryMatchL
+						break;
+						}
+					}
+				}		
+			}
+	    CleanupStack::PopAndDestroy( 2 );  // destroys services + closes RApaLsSession
+		}
+	return appUid;
+	}
+
+// ----------------------------------------------------------------------------
+// CSyncService::TryMatchL
+// ----------------------------------------------------------------------------
+//
+TBool CSyncService::TryMatchL( const TApaAppServiceInfo aInfo,
+                               TUid& aAppUid,
+                               TUint aServiceId )
+	{
+	FLOG( _L( "[CSyncService] TryMatchL" ) );
+	
+	RResourceReader r;
+	r.OpenLC( aInfo.OpaqueData() );
+
+	TInt serviceType = r.ReadUint32L( ); // the service type (sync start)
+
+    CleanupStack::PopAndDestroy( );				
+	
+	if( serviceType == aServiceId )
+		{
+		aAppUid.iUid = aInfo.Uid( ).iUid;
+		FLOG( _L( "[CSyncService] TryMatchL return ETrue" ) );
+		return ETrue;
+		}
+    
+    FLOG( _L( "[CSyncService] TryMatchL return EFalse" ) );
+	return EFalse;	
+	}
+	
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/SRC/SyncServiceSession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* 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:  Server side DS and DM sync services
+*
+*/
+
+
+// INCLUDE FILES
+
+#include <SyncServiceSession.h>
+#include <SyncServiceParams.h>
+#include "SyncServiceDebug.h"
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <s32mem.h>
+
+const TInt KMemoryStoreBuffSize = 127;
+
+// ----------------------------------------------------------------------------
+// CSyncServiceSession::CSyncServiceSesson
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CSyncServiceSession::CSyncServiceSession( )
+: iDoc( CEikonEnv::Static()->EikAppUi()->Document() )
+	{
+    FLOG( _L( "[CSyncServiceSession] CSyncServiceSession" ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CSyncServiceSession::~CSyncServiceSesson
+// ----------------------------------------------------------------------------
+//
+CSyncServiceSession::~CSyncServiceSession()
+	{
+	FLOG( _L( "[CSyncServiceSession] ~CSyncServiceSession" ) );
+	}
+
+// ----------------------------------------------------------------------------
+// CSyncServiceSession::CreateL
+// ----------------------------------------------------------------------------
+//
+void CSyncServiceSession::CreateL()
+	{
+	FLOG( _L( "[CSyncServiceSession] CreateL" ) );
+	
+	CAknAppServiceBase::CreateL();		
+	}
+	
+// ----------------------------------------------------------------------------
+// CSyncServiceSession::ServiceL
+// ----------------------------------------------------------------------------
+//
+void CSyncServiceSession::ServiceL( const RMessage2& aMessage )
+	{
+	FLOG( _L( "[CSyncServiceSession] ServiceL" ) );
+	
+	switch( aMessage.Function() )
+		{
+		case ESyncServiceCommand:
+			OpenEmbeddedL( aMessage );
+			break;
+		default:
+			CAknAppServiceBase::ServiceL( aMessage );
+			break;
+		}		
+	}
+	
+// ----------------------------------------------------------------------------
+// CSyncServiceSession::ServiceError
+// ----------------------------------------------------------------------------
+//
+void CSyncServiceSession::ServiceError( const RMessage2& aMessage, TInt aError )
+	{
+	FLOG( _L( "[CSyncServiceSession] ServiceError" ) );
+	
+	CAknAppServiceBase::ServiceError( aMessage, aError );		
+	}
+	
+// ----------------------------------------------------------------------------
+// CSyncServiceSession::OpenEmbeddedL
+// ----------------------------------------------------------------------------
+//
+void CSyncServiceSession::OpenEmbeddedL( const RMessage2& aMessage )
+	{
+	FLOG( _L( "[CSyncServiceSession] OpenEmbeddedL" ) );
+
+	TSyncParameters params;
+	params.iCommand = aMessage.Int0();
+	params.iJobId = aMessage.Int1();
+	params.iProfileId = aMessage.Int2();
+    params.iSilent = aMessage.Int3();
+    CBufStore* store = CBufStore::NewLC( KMemoryStoreBuffSize );
+    RStoreWriteStream outStream;
+    TStreamId id = outStream.CreateLC( *store );
+    params.ExternalizeL( outStream );
+    store->CommitL();
+    CleanupStack::PopAndDestroy();//outStream
+	
+    CStreamDictionary* dic = CStreamDictionary::NewLC();
+    dic->AssignL( KUidSyncParameterValue, id );
+    outStream.CreateLC( *store );
+    dic->ExternalizeL( outStream );
+    store->CommitL();
+    CleanupStack::PopAndDestroy();// outstream
+
+    // Restore the document from this store
+    RStoreReadStream readStream;
+    readStream.OpenLC( *store, id );
+    iDoc->RestoreL( *store, *dic );
+
+    CleanupStack::PopAndDestroy(3);// dic, store, readStream
+    aMessage.Complete( KErrNone );	
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/eabi/SyncServiceu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,13 @@
+EXPORTS
+	_ZN12CSyncService10StartSyncLE17TSyncServiceParam @ 1 NONAME
+	_ZN12CSyncService4NewLEP25MAknServerAppExitObserverj @ 2 NONAME
+	_ZN19CSyncServiceSessionC1Ev @ 3 NONAME
+	_ZN19CSyncServiceSessionC2Ev @ 4 NONAME
+	_ZTI12CSyncService @ 5 NONAME ; #<TI>#
+	_ZTI12RSyncService @ 6 NONAME ; #<TI>#
+	_ZTI19CSyncServiceSession @ 7 NONAME ; #<TI>#
+	_ZTV12CSyncService @ 8 NONAME ; #<VT>#
+	_ZTV12RSyncService @ 9 NONAME ; #<VT>#
+	_ZTV19CSyncServiceSession @ 10 NONAME ; #<VT>#
+	_ZN12CSyncService19EnableProgressNoteLEi @ 11 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/group/SyncService.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* 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:  Project specification file for SyncService
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include  <platform_paths.hrh>
+
+TARGET          syncservice.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x101F8769
+
+VENDORID    VID_DEFAULT
+CAPABILITY  CAP_CLIENT_DLL
+
+SOURCEPATH      ../SRC
+
+USERINCLUDE     ../INC
+// Default system include paths for app layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCE          SyncService.cpp
+SOURCE          SyncServiceSession.cpp
+
+LIBRARY         avkon.lib
+LIBRARY         euser.lib
+LIBRARY         estor.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         bafl.lib
+LIBRARY         apgrfx.lib
+LIBRARY         mtur.lib
+LIBRARY         eikcore.lib
+LIBRARY         centralrepository.lib 
+
+DEBUGLIBRARY    flogger.lib
+
+
+SMPSAFE
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/group/bld.inf	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* 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 file provides the information required for building
+*                 the whole of SyncService
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/syncservice.iby							CORE_MW_LAYER_IBY_EXPORT_PATH(syncservice.iby)
+
+PRJ_MMPFILES
+SyncService.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syncmlfw/syncservice/rom/syncservice.iby	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-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: Implementation of syncservice component
+* 	This is part of syncservice.
+*
+*/
+
+
+#ifndef SYNCSERVICE_IBY
+#define SYNCSERVICE_IBY
+
+#ifndef NO_SYNCML_IN_ROM  // Should not be included if no SyncML components are included
+
+file=ABI_DIR\BUILD_DIR\SyncService.dll    SHARED_LIB_DIR\SyncService.dll
+
+#endif
+
+#endif // SYNCSERVICE_IBY
+
+//  End of File  
\ No newline at end of file
--- a/sysdef_1_5_1.dtd	Tue Aug 31 16:04:06 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
- <!ELEMENT SystemDefinition (systemModel?, build?)>
- <!ATTLIST SystemDefinition
-  name CDATA #REQUIRED
-  schema CDATA #REQUIRED>
- <!ELEMENT systemModel (layer+)>
- <!ELEMENT layer (logicalset* | module*)*>
- <!ATTLIST layer
-  name CDATA #REQUIRED
-  levels CDATA #IMPLIED
-  span CDATA #IMPLIED>
- <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalset name CDATA #REQUIRED>
- <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalsubset name CDATA #REQUIRED>
- <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
- <!ATTLIST module
-  name CDATA #REQUIRED
-  level CDATA #IMPLIED>
- <!ELEMENT component (unit* | package* | prebuilt*)*>
- <!ATTLIST component name CDATA #REQUIRED>
- <!ELEMENT unit EMPTY>
- <!ATTLIST unit
-  unitID ID #REQUIRED
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  bldFile CDATA #REQUIRED
-  priority CDATA #IMPLIED
-  contract CDATA #IMPLIED
-  proFile CDATA #IMPLIED
-  qmakeArgs CDATA #IMPLIED>
- <!ELEMENT package EMPTY>
- <!ATTLIST package
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT prebuilt EMPTY>
- <!ATTLIST prebuilt
-  name CDATA #REQUIRED
-  version CDATA #REQUIRED
-  late (Y|N) #IMPLIED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
- <!ELEMENT unitList (unitRef+)>
- <!ATTLIST unitList
-  name ID #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT unitRef EMPTY>
- <!ATTLIST unitRef unit IDREF #REQUIRED>
- <!ELEMENT targetList EMPTY>
- <!ATTLIST targetList
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  target IDREFS #REQUIRED>
- <!ELEMENT target EMPTY>
- <!ATTLIST target
-  name ID #REQUIRED
-  abldTarget CDATA #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT option EMPTY>
- <!ATTLIST option
-  name ID #REQUIRED
-  abldOption CDATA #REQUIRED
-  description CDATA #REQUIRED
-  enable (Y | N | y | n) #REQUIRED>
- <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
- <!ATTLIST configuration
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  filter CDATA #REQUIRED>
- <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
- <!ELEMENT unitListRef EMPTY>
- <!ATTLIST unitListRef unitList IDREF #REQUIRED>
- <!ELEMENT layerRef EMPTY>
- <!ATTLIST layerRef layerName CDATA #REQUIRED>
- <!ELEMENT buildLayer EMPTY>
- <!ATTLIST buildLayer
-  command CDATA #REQUIRED
-  targetList IDREFS #IMPLIED
-  unitParallel (Y | N | y | n) #REQUIRED
-  targetParallel (Y | N | y | n) #IMPLIED>
- <!ELEMENT specialInstructions EMPTY>
- <!ATTLIST specialInstructions
-  name CDATA #REQUIRED
-  cwd CDATA #REQUIRED
-  command CDATA #REQUIRED>  
--- a/terminalsecurity/SCP/DmEventNotifier/group/DmEventNotifier.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/DmEventNotifier/group/DmEventNotifier.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -39,6 +39,7 @@
 SOURCE				MMCService.cpp
 
 USERINCLUDE 	. ../inc
+SYSTEMINCLUDE	/epoc32/include/swi
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 SYSTEMINCLUDE	/epoc32/include/platform/mw/swi
 #endif
@@ -62,3 +63,5 @@
 //Added for SCPEventHandler dll 
 LIBRARY		scpeventhandler.lib
 LIBRARY		flogger.lib
+
+SMPSAFE
\ No newline at end of file
--- a/terminalsecurity/SCP/DmEventNotifier/inc/JavaApplicationService.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/DmEventNotifier/inc/JavaApplicationService.h	Wed Sep 01 12:27:42 2010 +0100
@@ -20,9 +20,7 @@
 // System Includes
 #include <e32base.h>
 #include <e32property.h>    //Publish subscribe key
-//Commented to avoid app layer dependency
-//#include <javadomainpskeys.h> //Java installer
-//Comment ends here
+#include <javadomainpskeys.h> //Java installer
 #include <swispubsubdefs.h> //Java Installer defined here
 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
 #include <schinfo.h>
@@ -34,9 +32,6 @@
 //User includes
 #include "DmEventServiceBase.h"
 
-//Constants for java installer - done to avoid app layer dependency
-#define KPSUidJavaLatestInstallation 0x10282567
-
 //The publish subscribe key with condition. Do not alter this unless absolutely needed!
 const TPSKeyCondition KJavaPSKeyCondition(KUidSystemCategory,KPSUidJavaLatestInstallation, 0, TTaskSchedulerCondition::EGreaterThan);
 
--- a/terminalsecurity/SCP/DmEventNotifier/src/DmEventScheduler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/DmEventNotifier/src/DmEventScheduler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -238,7 +238,6 @@
 
     	service->GetServiceIdAndOperation(srvid,opn);
 
-		
     TBool mmcservice (EFalse);
     if (service == iServices[EMmcService])
         {
--- a/terminalsecurity/SCP/SCPClient/BWINS/SCPClientu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/BWINS/SCPClientu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -1,38 +1,33 @@
 EXPORTS
-	?SetParamValue@RSCPClient@@QAEHHAAVTDes16@@K@Z @ 1 NONAME ; int RSCPClient::SetParamValue(int, class TDes16 &, unsigned long)
-	?GetParamValue@RSCPClient@@QAEHHAAVTDes16@@@Z @ 2 NONAME ; int RSCPClient::GetParamValue(int, class TDes16 &)
-	?StoreLockcode@RSCPClient@@QAEHAAVTDesC16@@0AAV?$RArray@W4TDevicelockPolicies@@@@@Z @ 3 NONAME ; int RSCPClient::StoreLockcode(class TDesC16 &, class TDesC16 &, class RArray<enum TDevicelockPolicies> &)
-	?StoreCode@RSCPClient@@QAEHAAV?$TBuf@$07@@@Z @ 4 NONAME ; int RSCPClient::StoreCode(class TBuf<8> &)
-	?SetPhoneLock@RSCPClient@@QAEHH@Z @ 5 NONAME ; int RSCPClient::SetPhoneLock(int)
-	?NewLC@CSCPParamObject@@SAPAV1@XZ @ 6 NONAME ; class CSCPParamObject * CSCPParamObject::NewLC(void)
-	?GetLockState@RSCPClient@@QAEHAAH@Z @ 7 NONAME ; int RSCPClient::GetLockState(int &)
-	?WriteToFileL@CSCPParamObject@@QAEXAAVTDesC16@@PAVRFs@@@Z @ 8 NONAME ; void CSCPParamObject::WriteToFileL(class TDesC16 &, class RFs *)
-	?SetParamValue@RSCPClient@@QAEHHAAVTDes16@@@Z @ 9 NONAME ; int RSCPClient::SetParamValue(int, class TDes16 &)
-	?Set@CSCPParamObject@@QAEHHH@Z @ 10 NONAME ; int CSCPParamObject::Set(int, int)
-	?PerformCleanupL@RSCPClient@@QAEHAAV?$RArray@VTUid@@@@@Z @ 11 NONAME ; int RSCPClient::PerformCleanupL(class RArray<class TUid> &)
-	?Unset@CSCPParamObject@@QAEHH@Z @ 12 NONAME ; int CSCPParamObject::Unset(int)
-	?Connect@RSCPClient@@QAEHXZ @ 13 NONAME ; int RSCPClient::Connect(void)
-	?AddtoFailedPolices@CSCPParamObject@@QAEHH@Z @ 14 NONAME ; int CSCPParamObject::AddtoFailedPolices(int)
-	?Reset@CSCPParamObject@@QAEHXZ @ 15 NONAME ; int CSCPParamObject::Reset(void)
-	?Parse@CSCPParamObject@@QAEHAAVTDes8@@@Z @ 16 NONAME ; int CSCPParamObject::Parse(class TDes8 &)
-	?IsLockcodeChangeAllowedNow@RSCPClient@@QAEHAAV?$RArray@W4TDevicelockPolicies@@@@@Z @ 17 NONAME ; int RSCPClient::IsLockcodeChangeAllowedNow(class RArray<enum TDevicelockPolicies> &)
-	?QueryAdminCmd@RSCPClient@@QAEHW4TSCPAdminCommand@@@Z @ 18 NONAME ; int RSCPClient::QueryAdminCmd(enum TSCPAdminCommand)
-	?CheckConfiguration@RSCPClient@@QAEHH@Z @ 19 NONAME ; int RSCPClient::CheckConfiguration(int)
-	?VerifyNewLockcodeAgainstPolicies@RSCPClient@@QAEHAAVTDesC16@@AAV?$RArray@W4TDevicelockPolicies@@@@@Z @ 20 NONAME ; int RSCPClient::VerifyNewLockcodeAgainstPolicies(class TDesC16 &, class RArray<enum TDevicelockPolicies> &)
-	?GetCode@RSCPClient@@QAEHAAV?$TBuf@$07@@@Z @ 21 NONAME ; int RSCPClient::GetCode(class TBuf<8> &)
-	??0RSCPClient@@QAE@XZ @ 22 NONAME ; RSCPClient::RSCPClient(void)
-	??1CSCPParamObject@@UAE@XZ @ 23 NONAME ; CSCPParamObject::~CSCPParamObject(void)
-	?Get@CSCPParamObject@@QAEHHAAVTDes16@@@Z @ 24 NONAME ; int CSCPParamObject::Get(int, class TDes16 &)
-	?NewL@CSCPParamObject@@SAPAV1@XZ @ 25 NONAME ; class CSCPParamObject * CSCPParamObject::NewL(void)
-	?GetBuffer@CSCPParamObject@@QAEHAAPAVHBufC8@@@Z @ 26 NONAME ; int CSCPParamObject::GetBuffer(class HBufC8 * &)
-	?GetPolicies@RSCPClient@@QAEHAAV?$RArray@H@@@Z @ 27 NONAME ; int RSCPClient::GetPolicies(class RArray<int> &)
-	?Set@CSCPParamObject@@QAEHHAAVTDes16@@@Z @ 28 NONAME ; int CSCPParamObject::Set(int, class TDes16 &)
-	?GetParamLength@CSCPParamObject@@QAEHH@Z @ 29 NONAME ; int CSCPParamObject::GetParamLength(int)
-	?VerifyCurrentLockcode@RSCPClient@@QAEHAAVTDesC16@@AAV?$TBuf@$09@@AAV?$RArray@W4TDevicelockPolicies@@@@H@Z @ 30 NONAME ; int RSCPClient::VerifyCurrentLockcode(class TDesC16 &, class TBuf<10> &, class RArray<enum TDevicelockPolicies> &, int)
-	?Version@RSCPClient@@QBE?AVTVersion@@XZ @ 31 NONAME ; class TVersion RSCPClient::Version(void) const
-	?Get@CSCPParamObject@@QAEHHAAH@Z @ 32 NONAME ; int CSCPParamObject::Get(int, int &)
-	?ReadFromFileL@CSCPParamObject@@QAEXAAVTDesC16@@PAVRFs@@@Z @ 33 NONAME ; void CSCPParamObject::ReadFromFileL(class TDesC16 &, class RFs *)
-	?GetFailedPolices@CSCPParamObject@@QAEABV?$RArray@H@@XZ @ 34 NONAME ; class RArray<int> const & CSCPParamObject::GetFailedPolices(void)
-	?SetAutoLockPeriod@RSCPClient@@QAEHH@Z @ 35 NONAME ; int RSCPClient::SetAutoLockPeriod(int)
-	?ChangeCode@RSCPClient@@QAEHAAVTDes16@@@Z @ 36 NONAME ; int RSCPClient::ChangeCode(class TDes16 &)
+	??0RSCPClient@@QAE@XZ @ 1 NONAME ; RSCPClient::RSCPClient(void)
+	??1CSCPParamObject@@UAE@XZ @ 2 NONAME ; CSCPParamObject::~CSCPParamObject(void)
+	?ChangeCode@RSCPClient@@QAEHAAVTDes16@@@Z @ 3 NONAME ; int RSCPClient::ChangeCode(class TDes16 &)
+	?ChangeCodeRequest@RSCPClient@@QAEHXZ @ 4 NONAME ; int RSCPClient::ChangeCodeRequest(void)
+	?Connect@RSCPClient@@QAEHXZ @ 5 NONAME ; int RSCPClient::Connect(void)
+	?Get@CSCPParamObject@@QAEHHAAH@Z @ 6 NONAME ; int CSCPParamObject::Get(int, int &)
+	?Get@CSCPParamObject@@QAEHHAAVTDes16@@@Z @ 7 NONAME ; int CSCPParamObject::Get(int, class TDes16 &)
+	?GetBuffer@CSCPParamObject@@QAEHAAPAVHBufC8@@@Z @ 8 NONAME ; int CSCPParamObject::GetBuffer(class HBufC8 * &)
+	?GetCode@RSCPClient@@QAEHAAV?$TBuf@$07@@@Z @ 9 NONAME ; int RSCPClient::GetCode(class TBuf<8> &)
+	?GetLockState@RSCPClient@@QAEHAAH@Z @ 10 NONAME ; int RSCPClient::GetLockState(int &)
+	?GetParamLength@CSCPParamObject@@QAEHH@Z @ 11 NONAME ; int CSCPParamObject::GetParamLength(int)
+	?GetParamValue@RSCPClient@@QAEHHAAVTDes16@@@Z @ 12 NONAME ; int RSCPClient::GetParamValue(int, class TDes16 &)
+	?NewL@CSCPParamObject@@SAPAV1@XZ @ 13 NONAME ; class CSCPParamObject * CSCPParamObject::NewL(void)
+	?NewLC@CSCPParamObject@@SAPAV1@XZ @ 14 NONAME ; class CSCPParamObject * CSCPParamObject::NewLC(void)
+	?Parse@CSCPParamObject@@QAEHAAVTDes8@@@Z @ 15 NONAME ; int CSCPParamObject::Parse(class TDes8 &)
+	?QueryAdminCmd@RSCPClient@@QAEHW4TSCPAdminCommand@@@Z @ 16 NONAME ; int RSCPClient::QueryAdminCmd(enum TSCPAdminCommand)
+	?ReadFromFileL@CSCPParamObject@@QAEXAAVTDesC16@@PAVRFs@@@Z @ 17 NONAME ; void CSCPParamObject::ReadFromFileL(class TDesC16 &, class RFs *)
+	?Reset@CSCPParamObject@@QAEHXZ @ 18 NONAME ; int CSCPParamObject::Reset(void)
+	?SecCodeQuery@RSCPClient@@QAEHAAV?$TBuf@$09@@W4TSCPButtonConfig@1@HH@Z @ 19 NONAME ; int RSCPClient::SecCodeQuery(class TBuf<10> &, enum RSCPClient::TSCPButtonConfig, int, int)
+	?Set@CSCPParamObject@@QAEHHAAVTDes16@@@Z @ 20 NONAME ; int CSCPParamObject::Set(int, class TDes16 &)
+	?Set@CSCPParamObject@@QAEHHH@Z @ 21 NONAME ; int CSCPParamObject::Set(int, int)
+	?SetParamValue@RSCPClient@@QAEHHAAVTDes16@@@Z @ 22 NONAME ; int RSCPClient::SetParamValue(int, class TDes16 &)
+	?SetPhoneLock@RSCPClient@@QAEHH@Z @ 23 NONAME ; int RSCPClient::SetPhoneLock(int)
+	?StoreCode@RSCPClient@@QAEHAAV?$TBuf@$07@@@Z @ 24 NONAME ; int RSCPClient::StoreCode(class TBuf<8> &)
+	?Unset@CSCPParamObject@@QAEHH@Z @ 25 NONAME ; int CSCPParamObject::Unset(int)
+	?Version@RSCPClient@@QBE?AVTVersion@@XZ @ 26 NONAME ; class TVersion RSCPClient::Version(void) const
+	?WriteToFileL@CSCPParamObject@@QAEXAAVTDesC16@@PAVRFs@@@Z @ 27 NONAME ; void CSCPParamObject::WriteToFileL(class TDesC16 &, class RFs *)
+	?CheckConfiguration@RSCPClient@@QAEHH@Z @ 28 NONAME ; int RSCPClient::CheckConfiguration(int)
+	?PerformCleanupL@RSCPClient@@QAEHAAV?$RArray@VTUid@@@@@Z @ 29 NONAME ; int RSCPClient::PerformCleanupL(class RArray<class TUid> &)
+	?SetParamValue@RSCPClient@@QAEHHAAVTDes16@@K@Z @ 30 NONAME ; int RSCPClient::SetParamValue(int, class TDes16 &, unsigned long)
+	?SetAutoLockPeriod@RSCPClient@@QAEHH@Z @ 31 NONAME ; int RSCPClient::SetAutoLockPeriod(int)
 
--- a/terminalsecurity/SCP/SCPClient/data/SCPNotifier.rss	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/data/SCPNotifier.rss	Wed Sep 01 12:27:42 2010 +0100
@@ -109,5 +109,29 @@
     {
     buf = qtn_set_sec_code_setting_query_server;
     }
+    
+RESOURCE TBUF r_scp_lawmo_locked
+    {
+    buf = qtn_device_locked_remotely;
+    }
+    
+RESOURCE DIALOG r_dialog_warning
+{
+    flags = EAknWarningNoteFlags | EEikDialogFlagWait;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+    {
+    DLG_LINE
+        {
+            type = EAknCtNote;
+            id = EGeneralNote;
+            control = AVKON_NOTE
+            {
+                layout = EGeneralLayout;
+                animation = R_QGN_NOTE_WARNING_ANIM;
+            };
+        }
+    };
+}
 // end of file
 
--- a/terminalsecurity/SCP/SCPClient/eabi/SCPClientu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/eabi/SCPClientu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -1,43 +1,40 @@
 EXPORTS
 	_ZN10RSCPClient10ChangeCodeER6TDes16 @ 1 NONAME
-	_ZN10RSCPClient11GetPoliciesER6RArrayIiE @ 2 NONAME
-	_ZN10RSCPClient12GetLockStateERi @ 3 NONAME
+	_ZN10RSCPClient12GetLockStateERi @ 2 NONAME
+	_ZN10RSCPClient12SecCodeQueryER4TBufILi10EENS_16TSCPButtonConfigEii @ 3 NONAME
 	_ZN10RSCPClient12SetPhoneLockEi @ 4 NONAME
 	_ZN10RSCPClient13GetParamValueEiR6TDes16 @ 5 NONAME
 	_ZN10RSCPClient13QueryAdminCmdE16TSCPAdminCommand @ 6 NONAME
 	_ZN10RSCPClient13SetParamValueEiR6TDes16 @ 7 NONAME
-	_ZN10RSCPClient13SetParamValueEiR6TDes16m @ 8 NONAME
-	_ZN10RSCPClient13StoreLockcodeER7TDesC16S1_R6RArrayI19TDevicelockPoliciesE @ 9 NONAME
-	_ZN10RSCPClient15PerformCleanupLER6RArrayI4TUidE @ 10 NONAME
-	_ZN10RSCPClient17SetAutoLockPeriodEi @ 11 NONAME
-	_ZN10RSCPClient18CheckConfigurationEi @ 12 NONAME
-	_ZN10RSCPClient21VerifyCurrentLockcodeER7TDesC16R4TBufILi10EER6RArrayI19TDevicelockPoliciesEi @ 13 NONAME
-	_ZN10RSCPClient26IsLockcodeChangeAllowedNowER6RArrayI19TDevicelockPoliciesE @ 14 NONAME
-	_ZN10RSCPClient32VerifyNewLockcodeAgainstPoliciesER7TDesC16R6RArrayI19TDevicelockPoliciesE @ 15 NONAME
-	_ZN10RSCPClient7ConnectEv @ 16 NONAME
-	_ZN10RSCPClient7GetCodeER4TBufILi8EE @ 17 NONAME
-	_ZN10RSCPClient9StoreCodeER4TBufILi8EE @ 18 NONAME
-	_ZN10RSCPClientC1Ev @ 19 NONAME
-	_ZN10RSCPClientC2Ev @ 20 NONAME
-	_ZN15CSCPParamObject12WriteToFileLER7TDesC16P3RFs @ 21 NONAME
-	_ZN15CSCPParamObject13ReadFromFileLER7TDesC16P3RFs @ 22 NONAME
-	_ZN15CSCPParamObject14GetParamLengthEi @ 23 NONAME
-	_ZN15CSCPParamObject16GetFailedPolicesEv @ 24 NONAME
-	_ZN15CSCPParamObject18AddtoFailedPolicesEi @ 25 NONAME
-	_ZN15CSCPParamObject3GetEiR6TDes16 @ 26 NONAME
-	_ZN15CSCPParamObject3GetEiRi @ 27 NONAME
-	_ZN15CSCPParamObject3SetEiR6TDes16 @ 28 NONAME
-	_ZN15CSCPParamObject3SetEii @ 29 NONAME
-	_ZN15CSCPParamObject4NewLEv @ 30 NONAME
-	_ZN15CSCPParamObject5NewLCEv @ 31 NONAME
-	_ZN15CSCPParamObject5ParseER5TDes8 @ 32 NONAME
-	_ZN15CSCPParamObject5ResetEv @ 33 NONAME
-	_ZN15CSCPParamObject5UnsetEi @ 34 NONAME
-	_ZN15CSCPParamObject9GetBufferERP6HBufC8 @ 35 NONAME
-	_ZN15CSCPParamObjectD0Ev @ 36 NONAME
-	_ZN15CSCPParamObjectD1Ev @ 37 NONAME
-	_ZN15CSCPParamObjectD2Ev @ 38 NONAME
-	_ZNK10RSCPClient7VersionEv @ 39 NONAME
-	_ZTI15CSCPParamObject @ 40 NONAME
-	_ZTV15CSCPParamObject @ 41 NONAME
+	_ZN10RSCPClient17ChangeCodeRequestEv @ 8 NONAME
+	_ZN10RSCPClient7ConnectEv @ 9 NONAME
+	_ZN10RSCPClient7GetCodeER4TBufILi8EE @ 10 NONAME
+	_ZN10RSCPClient9StoreCodeER4TBufILi8EE @ 11 NONAME
+	_ZN10RSCPClientC1Ev @ 12 NONAME
+	_ZN10RSCPClientC2Ev @ 13 NONAME
+	_ZN15CSCPParamObject12WriteToFileLER7TDesC16P3RFs @ 14 NONAME
+	_ZN15CSCPParamObject13ReadFromFileLER7TDesC16P3RFs @ 15 NONAME
+	_ZN15CSCPParamObject14GetParamLengthEi @ 16 NONAME
+	_ZN15CSCPParamObject3GetEiR6TDes16 @ 17 NONAME
+	_ZN15CSCPParamObject3GetEiRi @ 18 NONAME
+	_ZN15CSCPParamObject3SetEiR6TDes16 @ 19 NONAME
+	_ZN15CSCPParamObject3SetEii @ 20 NONAME
+	_ZN15CSCPParamObject4NewLEv @ 21 NONAME
+	_ZN15CSCPParamObject5NewLCEv @ 22 NONAME
+	_ZN15CSCPParamObject5ParseER5TDes8 @ 23 NONAME
+	_ZN15CSCPParamObject5ResetEv @ 24 NONAME
+	_ZN15CSCPParamObject5UnsetEi @ 25 NONAME
+	_ZN15CSCPParamObject9GetBufferERP6HBufC8 @ 26 NONAME
+	_ZN15CSCPParamObjectD0Ev @ 27 NONAME
+	_ZN15CSCPParamObjectD1Ev @ 28 NONAME
+	_ZN15CSCPParamObjectD2Ev @ 29 NONAME
+	_ZNK10RSCPClient7VersionEv @ 30 NONAME
+	_ZTI15CSCPParamObject @ 31 NONAME ; #<TI>#
+	_ZTI15CSCPQueryDialog @ 32 NONAME ; #<TI>#
+	_ZTV15CSCPParamObject @ 33 NONAME ; #<VT>#
+	_ZTV15CSCPQueryDialog @ 34 NONAME ; #<VT>#
+	_ZN10RSCPClient18CheckConfigurationEi @ 35 NONAME
+	_ZN10RSCPClient15PerformCleanupLER6RArrayI4TUidE @ 36 NONAME
+	_ZN10RSCPClient13SetParamValueEiR6TDes16m @ 37 NONAME
+	_ZN10RSCPClient17SetAutoLockPeriodEi @ 38 NONAME
 
--- a/terminalsecurity/SCP/SCPClient/group/SCPClient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/group/SCPClient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -32,7 +32,8 @@
 
 SOURCEPATH      ../src
 SOURCE          SCPClient.cpp
-SOURCE          SCPParamObject.cpp
+SOURCE          SCPQueryDialog.cpp
+SOURCE          SCPParamObject.cpp SCPLockObserver.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
@@ -58,13 +59,16 @@
 LIBRARY         aknnotify.lib
 LIBRARY         eikdlg.lib
 LIBRARY         ws32.lib
-LIBRARY         CommonEngine.lib
+LIBRARY         commonengine.lib
 LIBRARY         bafl.lib
 LIBRARY					flogger.lib
 LIBRARY         featmgr.lib
 LIBRARY     centralrepository.lib  // CenRep
 LIBRARY					aknnotify.lib
 LIBRARY 		estor.lib
+LIBRARY     apgrfx.lib 
+
+SMPSAFE
 
 // End of file
 
--- a/terminalsecurity/SCP/SCPClient/inc/SCPLockObserver.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/inc/SCPLockObserver.h	Wed Sep 01 12:27:42 2010 +0100
@@ -27,6 +27,11 @@
 NONSHARABLE_CLASS(CSCPLockObserver): public CActive
     {
     public:
+        enum TCurrCallStatus {
+            EInProgress = 34221,
+            EEnded
+        };
+        
 		/**
         * Creates instance of the CLockObserver class.
         *
@@ -72,13 +77,16 @@
     private: // from CActive
          /** @see CActive::RunL() */
 		void RunL();
+		TInt RunError(TInt aError);
 		/** @see CActive::DoCancel() */
         void DoCancel();
     private: // data
         CSCPQueryDialog*      iDialog; //not owned!
         RProperty            iProperty;
-        TBool				 iSubscribedToEvent;
         TInt                 iType; //Type of the observer
+        TBool                iInformCallEnding;
+        TInt                 iSubscribedToEvent;
+        TInt                 iPrevCallState;
     };
 
 #endif 
--- a/terminalsecurity/SCP/SCPClient/inc/SCPQueryDialog.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/inc/SCPQueryDialog.h	Wed Sep 01 12:27:42 2010 +0100
@@ -34,6 +34,13 @@
 */
 class CSCPQueryDialog : public CAknTextQueryDialog, public MAknEcsObserver
 	{
+    public:
+        enum TKeypadContext {
+            ENumeric = 0,
+            EAlphaNumeric,
+            EContextSensitive
+        };
+    
 	public: // Construction and destruction
 	
 		/**
@@ -47,12 +54,14 @@
                          RSCPClient::TSCPButtonConfig aButtonsShown, 
                          TInt aMinLength,
                          TInt aMaxLength,
-                         TBool aECSSupport
+                         TBool aECSSupport,
+                         TKeypadContext aContext = EContextSensitive
                          );
 		/**
         * Destructor.
         */
 		~CSCPQueryDialog();
+		
 	public:
 		/**
 		* Allows dismissing of code queries. Only mandatory requirement is that PIN
@@ -91,6 +100,8 @@
 		
 		void HandleEcsEvent(CAknEcsDetector* aDetector, CAknEcsDetector::TState aUpdatedState);
 		void ShowWarningNoteL();
+		
+		void PostLayoutDynInitL();
 
 	private:
 		
@@ -120,11 +131,13 @@
         TBool                           iPrioritySet;
         TBool                           iPriorityDropped;
         TBool							isCallSoftkeyAdded;
+        TKeypadContext                  iContextSensitive;
         /** An integer variable to define the input mode of the lock code query */
         TInt def_mode;
         TInt iKeyUsed;
         CSCPLockObserver* iDeviceLockStatusObserver;
 		CSCPLockObserver* iCallStatusObserver;
+		TBool iLockedByLawMo;
 	};
 #endif
 
--- a/terminalsecurity/SCP/SCPClient/loc/SCPNotifier.loc	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/loc/SCPNotifier.loc	Wed Sep 01 12:27:42 2010 +0100
@@ -41,6 +41,8 @@
 //l:  popup_info_list_pane_t2/opt1
 //r: 5.2
 #define qtn_set_sec_code_setting_query_server "Lock Code has not been set. Please set the Lock Code."
-
+//d: The text informing user that phone is locked by an Operator server
+//l: popup_query_data_window
+#define qtn_device_locked_remotely "Locked by %U"
 // End of File
 
--- a/terminalsecurity/SCP/SCPClient/src/SCPClient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/src/SCPClient.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -19,17 +19,20 @@
 
 // INCLUDE FILES
 #include <e32svr.h>
+#include <bautils.h>
 #include <e32math.h>
 #include <e32uid.h>
+#include <barsc.h>
 #include <AknGlobalNote.h>
 #include <aknnotewrappers.h> 
 #include <AknQueryDialog.h>
 #include <AknGlobalConfirmationQuery.h>
 
 #include "SCPClient.h"
+#include "SCPQueryDialog.h"
 #include "SCPParamObject.h"
 
-#include <scpnotifier.rsg>
+#include <SCPNotifier.rsg>
 #include "SCP_IDs.h"
 
 #include <centralrepository.h>
@@ -37,14 +40,23 @@
 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
 #include <TerminalControl3rdPartyAPI.h>
 #include <SCPServerInterface.h>
+#include <SecUi.rsg>
+#include <scptimestamppluginlang.rsg>
 #include <secui.hrh>
 #include <StringLoader.h>
 #include <bautils.h>
 //#endif // DEVICE_LOCK_ENHANCEMENTS
+#include <DevManInternalCRKeys.h>
 
 #include <featmgr.h>
 #include "SCPDebug.h"
 #include <e32property.h>
+#include <SCPPServerPluginDefs.hrh>
+#include <apgtask.h>
+#include    <e32property.h>
+#include    <PSVariables.h>
+#include    <coreapplicationuisdomainpskeys.h>
+
 /*#ifdef _DEBUG
 #define __SCP_DEBUG
 #endif // _DEBUG
@@ -61,12 +73,13 @@
 
 static const TUint KDefaultMessageSlots = 3;
 static const TInt KSCPConnectRetries( 2 );
-
+const TInt KLockedbyLawmo (30);
 
 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
 _LIT( KDriveZ, "Z:" );
 _LIT( KSCPResourceFilename, "\\Resource\\SCPNotifier.RSC" );
 _LIT( KSCPSecUIResourceFilename, "\\Resource\\SecUi.RSC" );
+_LIT( KSCPTimestampPluginResFilename, "\\Resource\\SCPTimestampPluginLang.rsc");
 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
 
 // Uid for the application; this should match the mmp file
@@ -169,6 +182,74 @@
 
 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
 
+// ---------------------------------------------------------
+// RunDialog() Dialog execution wrapper
+// Initialize and run the query dialog
+// Returns: TInt: The return code from the dialog.
+//          Can leave with a generic error code.
+//
+// Status : Approved
+// ---------------------------------------------------------
+//
+TInt RunDialogL( TDes& aReplyBuf,
+                RSCPClient::TSCPButtonConfig aButtonsShown,
+                TInt aMinLen,
+                TInt aMaxLen,
+                TUint aResId = 0,
+                TDesC* aPrompt = NULL,
+                TBool aECSSupport = EFalse,
+                CSCPQueryDialog :: TKeypadContext aContext = CSCPQueryDialog :: ENumeric
+              )
+    {
+    Dprint(_L("[RSCPClient]-> RunDialogL() >>> "));
+    Dprint(_L("[RSCPClient]-> RunDialogL() aContext = %d "), aContext);
+    
+    FeatureManager::InitializeLibL();
+    if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
+	{
+			FeatureManager::UnInitializeLib();
+		return KErrNotSupported;
+	}
+		FeatureManager::UnInitializeLib();
+    if ( ( aPrompt == NULL ) && ( aResId == 0 ) )
+        {
+        return KErrArgument;
+        }
+    Dprint((_L("--> SCPClient::RunDialogL() start the dialog")));    
+    CSCPQueryDialog* dialog = new (ELeave) CSCPQueryDialog( 
+        aReplyBuf,
+        aButtonsShown,
+        aMinLen,
+        aMaxLen,
+        aECSSupport,
+        aContext
+        ); 
+        
+    CleanupStack::PushL( dialog );            
+    
+    if ( aResId != 0 )
+        {
+        // Load and set the prompt from a resource ID
+        HBufC* prompt;
+        
+        prompt = StringLoader::LoadLC( aResId );   
+        dialog->SetPromptL( *prompt ); 
+        
+        CleanupStack::PopAndDestroy( prompt );       
+        }
+    else
+        {
+        // Set the given prompt
+        dialog->SetPromptL( *aPrompt );
+        }        
+    Dprint((_L("-- SCPClient::RunDialogL() dialog->ExecuteLD")));
+    TInt ret = dialog->ExecuteLD( R_SCP_CODE_QUERY );
+    
+    CleanupStack::Pop( dialog );
+    Dprint( (_L("-- SCPClient::RunDialogL(): ret val %d"), ret));
+    return ret;
+    }
+    
 
 // ---------------------------------------------------------
 // LoadResources() Resource loader
@@ -395,13 +476,76 @@
 EXPORT_C TInt RSCPClient::SetPhoneLock( TBool aLocked )
     {
     Dprint( (_L("--> RSCPClient::SetPhoneLock( %d)"), aLocked ));
-            
+    TInt autolockState = -1;
+    RProperty aProperty;
+    aProperty.Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
+    Dprint( (_L("RSCPClient::SetPhoneLock()Autolock state before %d"), autolockState ));
+
+    if((aLocked==0)&&(autolockState != EAutolockStatusUninitialized))
+    InformAutolockTask();            
+    Dprint( (_L("RSCPClient sendreceive") ));
     TInt ret = SendReceive(ESCPServSetPhoneLock, TIpcArgs( aLocked ) );
-  
+    Dprint( (_L("RSCPClient sendreceive done") ));
+    aProperty.Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
+    Dprint( (_L("RSCPClient::SetPhoneLock()Autolock state after %d"), autolockState ));
+    // Put it here because, we cant change autolock status before sendreceive 
+    // Uninitialised state is Only at Bootup.
+    if((autolockState == EAutolockStatusUninitialized)&&(aLocked==0)&&(ret==KErrNone))
+        {
+        Dprint( (_L("RSCPClient::SetPhoneLock()setting autolock status") ));
+        aProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
+        // This is startup and we are done with ISA unlock
+        // So set the Startup cenrep key so tht it is used in SeccodeQuery
+        CRepository* lRepository = NULL; 
+        TInt returnv;
+        TRAP(returnv, lRepository = CRepository :: NewL(KCRUidSCPLockCode));
+        returnv = lRepository->Set(KSCPStartupQuery, 1);
+        if(returnv==KErrNone)
+        Dprint( (_L("RSCPClient::SetPhoneLock()setting KSCPStartupQuery") ));
+        delete lRepository;
+        }
     Dprint( (_L("<-- RSCPClient::SetPhoneLock(): %d"), ret ));
     return ret;
     }   
 
+void RSCPClient::InformAutolockTask()
+    {
+    Dprint( (_L("RSCPClient::InformAutolockTask") ));
+    // Deactivation call, send the deactivation message to Autolock
+        RWsSession wsSession;
+        if ( wsSession.Connect() != KErrNone )
+           {
+           Dprint( (_L("RSCPClient::InformAutolockTask():\
+               WsSession connection failed") ));        
+           User::Leave( KErrGeneral );
+           }
+        CleanupClosePushL( wsSession );
+
+        TApaTaskList taskList( wsSession );
+        TApaTask task = taskList.FindApp( TUid::Uid( 0x100059B5 ) ); // Autolock
+
+        if ( task.Exists() )
+            {
+            Dprint( (_L("RSCPClient::InformAutolockTask():\
+               Autolock task found, sending msg") ));        
+            // No parameters, just a dummy buffer
+            TBuf8<8> buf;
+            buf.Zero();            
+            const TPtrC8& message = buf;                      
+            User::LeaveIfError( 
+               task.SendMessage( TUid::Uid( SCP_CMDUID_UNLOCK+1 ), message ) 
+               );           
+            }
+        else
+            {
+            Dprint( (_L("RSCPClient::InformAutolockTask():\
+               Autolock task not found") ));
+            User::Leave( KErrNotFound );
+            }
+                  
+        CleanupStack::PopAndDestroy(); // wsSession
+    }   
+
 // ---------------------------------------------------------
 // TBool RSCPClient::QueryAdminCmd( TSCPAdminCommand aCommand )
 // Packs the command parameter into a buffer, and propagates
@@ -484,6 +628,184 @@
 
 // *********** Device lock new features ************* -->>
 
+// ---------------------------------------------------------
+// RSCPClient::SecCodeQuery()
+// Request the security code from the user and authenticate
+// through the server.
+// 
+// Status : Approved
+// ---------------------------------------------------------
+//
+EXPORT_C TInt RSCPClient::SecCodeQuery( RMobilePhone::TMobilePassword& aPassword, 
+                                        TSCPButtonConfig aButtonsShown, 
+                                        TBool aECSSupport,
+                                        TInt aFlags )
+    {
+    TInt lErr = KErrNone;
+    TInt lStatus = KErrNone;
+    TInt lResFileSCP = NULL;
+    TInt lResFileSecUi = NULL;
+    Dprint( (_L("--> RSCPClient::SecCodeQuery(%d, %d"), aButtonsShown, aECSSupport ));  
+    TRAP(lErr, lStatus = SetSecurityCodeL(aPassword, aButtonsShown, aECSSupport, aFlags, lResFileSCP, lResFileSecUi));    
+   
+    
+    if(lResFileSCP) {
+        CCoeEnv :: Static()->DeleteResourceFile(lResFileSCP);
+	}
+    
+    if(lResFileSecUi) {
+    
+    
+        CCoeEnv :: Static()->DeleteResourceFile(lResFileSecUi);
+    }
+    
+    Dprint((_L("<-- RSCPClient::SecCodeQuery(): lStatus= %d, lErr= %d"), lStatus, lErr));
+    CRepository* lRepository = NULL;  
+    TInt startup = 0;
+    TInt returnv;
+    TRAP(returnv, lRepository = CRepository :: NewL(KCRUidSCPLockCode));
+    returnv = lRepository->Get(KSCPStartupQuery, startup);
+    if(returnv == KErrNone)
+    Dprint( (_L("RSCPClient::SecCodeQuery()KSCPStartupQuery get done")));
+    lRepository->Set(KSCPStartupQuery, 0);
+    delete lRepository;
+    Dprint((_L("RSCPClient::SecCodeQuery(): startup ? %d"), startup ));
+    //Check if this is Startup Query and tht device is remote unlocked now ?
+    if(startup)
+        {
+        Dprint((_L("[RSCPClient] SecCodeQuery() startup remote Unlocked")));
+        return KErrNone;
+        }
+    else
+    return (lErr != KErrNone) ? lErr : lStatus;
+}
+
+// ---------------------------------------------------------
+// RSCPClient::ChangeCodeRequest()
+// Show the current code query dialog and continue in GetNew
+// CodeAndChange.
+// 
+// Status : Approved
+// ---------------------------------------------------------
+//
+EXPORT_C TInt RSCPClient::ChangeCodeRequest()
+    {
+    Dprint((_L("[RSCPClient] ChangeCodeRequest() >>>")));
+    
+    if(EFalse == isFlagEnabled) {
+        Dprint((_L("[RSCPClient]-> ChangeCodeRequest(): ERROR: Function not supported in this variant")));
+        User :: Invariant();
+        return KErrNotSupported;
+	}
+
+    TInt lRet(KErrNone);
+    TInt lErr(KErrNone);
+
+    TInt resourceFileSCP(NULL);
+    TInt resourceFileSecUi(NULL);
+
+    // Check if the code change is allowed
+    {
+        HBufC8* addParamsHBuf = NULL;
+        TRAP(lErr, addParamsHBuf = HBufC8 :: NewL(KSCPMaxTARMNotifParamLen));
+        
+        if(lErr != KErrNone) {
+            return lErr;
+        }
+
+        TPtr8 addParams = addParamsHBuf->Des();
+        addParams.Zero();
+
+        TInt status(KErrNone);
+        TPckg<TInt> retPackage(status);
+        
+        TInt ret = SendReceive(ESCPServCodeChangeQuery, TIpcArgs(&retPackage, &addParams));
+
+        if((ret == KErrNone) && (addParams.Length() > 0)) {
+            // The server has sent additional parameters, ignore errors in processing
+            TRAP_IGNORE(ProcessServerCommandsL(addParams));
+        }
+
+        delete addParamsHBuf;
+
+        if((ret != KErrNone) || (status != KErrNone)) {
+            // Password cannot be changed now
+            return KErrAbort;
+        }
+    }
+
+    // Load the required resource files into this process
+    lRet = LoadResources(resourceFileSCP, resourceFileSecUi);
+    
+    if(lRet != KErrNone) {
+        return lRet;
+    }
+
+    HBufC* codeHBuf = NULL;
+    
+    TRAP(lErr, codeHBuf = HBufC :: NewL(KSCPPasscodeMaxLength + 1));
+    
+    if(lErr != KErrNone) {
+        // Remove the resource files
+        CCoeEnv :: Static()->DeleteResourceFile(resourceFileSCP);
+        CCoeEnv :: Static()->DeleteResourceFile(resourceFileSecUi);
+        return lErr;
+    }
+
+    TPtr codeBuffer = codeHBuf->Des();
+    codeBuffer.Zero();
+
+    TInt def_code = -1;
+    CRepository* lRepository = NULL;
+    
+    TRAP(lErr, lRepository = CRepository :: NewL(KCRUidSCPLockCode));
+    
+    if(KErrNone == lErr) {
+        lErr = lRepository->Get(KSCPLockCodeDefaultLockCode, def_code);
+       
+        if(def_code == 0) {
+            TRAP(lErr, lRet = RunDialogL(codeBuffer, SCP_OK_CANCEL, KSCPPasscodeMinLength,
+                                     KSCPPasscodeMaxLength, R_SECUI_TEXT_ENTER_SEC_CODE));
+    
+            if((lRet) && (lErr == KErrNone) && (lRet != ESecUiEmergencyCall)) {
+                lErr = GetNewCodeAndChange(codeBuffer, KSCPNormalChange);
+            }
+    
+            if(lErr != KErrNone) {
+                Dprint((_L("RSCPClient::ChangeCodeRequest(): Code change FAILED: %d"), lErr));
+            }
+    
+            if(((!lRet) && (lErr == KErrNone)) || (lRet == ESecUiEmergencyCall)) {
+                // Cancelled by user
+                lErr = KErrAbort;
+            }
+        }
+        else if(def_code != -1) {
+            _LIT(KText, "12345");
+            TBufC<10> NBuf (KText);
+            TPtr codeBuf = NBuf.Des();
+            
+            lErr = GetNewCodeAndChange(codeBuf, KSCPNormalChange);
+            
+            if(lErr == KErrNone) {
+                lRepository->Set(KSCPLockCodeDefaultLockCode, 0);
+            }
+            else {
+                Dprint((_L("RSCPClient::ChangeCodeRequest(): Code change FAILED automatic: %d"), lErr));
+            }
+        }
+        
+        delete lRepository;
+    }
+    
+    Dprint((_L("<-- RSCPClient::ChangeCodeRequest(): %d"), lErr ));
+    
+    // Remove the resource files
+    CCoeEnv :: Static()->DeleteResourceFile(resourceFileSCP);
+    CCoeEnv :: Static()->DeleteResourceFile(resourceFileSecUi);    
+    delete codeHBuf;
+    return lErr;
+}
 
 // ---------------------------------------------------------
 // RSCPClient::CheckConfiguration()
@@ -530,6 +852,7 @@
     return ret;
     }
 EXPORT_C TInt RSCPClient :: PerformCleanupL(RArray<TUid>& aAppIDs) {
+    Dprint((_L("RSCPClient::PerformCleanupL() >>>")));
     TInt lCount = aAppIDs.Count();
     
     if(lCount < 1) {
@@ -548,6 +871,7 @@
     lWriteStream.CommitL();
     TInt lStatus = SendReceive(ESCPApplicationUninstalled, TIpcArgs(ESCPApplicationUninstalled, &lBuff->Des()));
     CleanupStack :: PopAndDestroy(2); // lBuff, lWriteStream
+    Dprint((_L("RSCPClient::PerformCleanupL() <<<")));
     return lStatus;
 }
 // ---------------------------------------------------------
@@ -564,48 +888,6 @@
     return ret;
 }
 
-EXPORT_C TInt RSCPClient::GetPolicies(RArray<TInt>& aDeviceLockPolicies) {
-    Dprint(_L("[RSCPClient]-> GetPolicies >>>"));
-    HBufC8* lBuff = NULL;
-    TInt lStatus = KErrNone;
-
-    TRAP(lStatus, lBuff = HBufC8 :: NewL((EDevicelockTotalPolicies - 1)  * sizeof(TInt)));
-
-    if (lStatus == KErrNone) {
-
-        lStatus = SendReceive(ESCPServGetParam, TIpcArgs(-1, &lBuff->Des()));
-
-        if (lStatus == KErrNone) {
-            // Copy data from lBuff to aDeviceLockPolicies
-            TPtr8 bufPtr = lBuff->Des();
-
-            if (bufPtr.Length() > 0) {
-                RDesReadStream lBufReadStream(bufPtr);
-                Dprint(_L("[RSCPClient]-> Get from server complete, returning service request..."));
-
-                for (TInt i = 0; i < 17; i++) {
-                    TInt32 lParamValue = 0;
-                    TRAP(lStatus, lParamValue = lBufReadStream.ReadInt32L());
-
-                    if (lStatus != KErrNone) {
-                        break;
-                    }
-
-                    aDeviceLockPolicies.Append(lParamValue);
-                }
-
-                lBufReadStream.Close();
-            }
-            else {
-                lStatus = KErrGeneral;
-            }
-        }
-    }
-    delete lBuff;
-    Dprint(_L("[RSCPClient]-> GetPolicies <<<"));
-    return lStatus;
-}
-
 /* ---------------------------------------------------------
  * Alternative function that can be used to set the Auto Lock period
  * Caller should have AllFiles access level
@@ -619,101 +901,376 @@
     Dprint((_L("[RSCPClient]-> SetAutoLockPeriod(): %d <<<"), ret));
     return ret;
 }
-
-EXPORT_C TBool RSCPClient :: IsLockcodeChangeAllowedNow(RArray<TDevicelockPolicies>& aFailedPolicies) {
-    Dprint((_L("[RSCPClient]-> IsLockcodeChangeAllowedNow() >>>")));
-    TInt lStatus = KErrNone;
-	TInt lErr = KErrNone;
-    
-    // extra one for failed policies count
-    //koys: if leave happens what errorcode we should return??
-    HBufC8* failedPoliciesBuff = NULL;
-    TRAP(lStatus, failedPoliciesBuff = HBufC8 :: NewL((EDevicelockTotalPolicies + 1)* sizeof(TInt32)));
-    
-	if (lStatus == KErrNone) {
-		lStatus = SendReceive(ESCPServCodeChangeQuery, TIpcArgs(&failedPoliciesBuff->Des()));
-		//koya: if leave happens what errorcode we should return??
-		TPtr8 failedPoliciesBufPtr = failedPoliciesBuff->Des();
-		TRAP(lErr, ReadFailedPoliciesL(failedPoliciesBufPtr, aFailedPolicies));
-		delete failedPoliciesBuff;
-	}
-	
-	Dprint((_L("[RSCPClient]-> IsLockcodeChangeAllowedNow() <<<")));
-    return (lStatus != KErrNone) ? lStatus : ((lErr != KErrNone) ? lErr : KErrNone);
-}
-
-EXPORT_C  TInt RSCPClient :: VerifyNewLockcodeAgainstPolicies(TDesC& aLockcode, RArray<TDevicelockPolicies>& aFailedPolicies) {
-    Dprint((_L("[RSCPClient]-> VerifyNewLockcodeAgainstPolicies() >>>")));
-    TInt lRet = KErrNone;
-    TInt lErr = KErrNone;
-    // extra one for failed policies count
-    HBufC8* failedPoliciesBuff = NULL;
-
-    TRAP(lRet, failedPoliciesBuff = HBufC8 :: NewL((EDevicelockTotalPolicies + 1) * sizeof(TInt32)));
-
-    if(lRet == KErrNone) {
-        lRet = SendReceive(ESCPServValidateLockcode, TIpcArgs(&aLockcode, &failedPoliciesBuff->Des()));
-
-        TPtr8 failedPoliciesBufPtr = failedPoliciesBuff->Des();
-        TRAP(lErr, ReadFailedPoliciesL(failedPoliciesBufPtr, aFailedPolicies));
-
-        delete failedPoliciesBuff;
-    }
-
-    Dprint((_L("[RSCPClient]-> VerifyNewLockcodeAgainstPolicies() <<<")));
-    return (lRet != KErrNone) ? lRet : ((lErr != KErrNone) ? lErr : KErrNone);
-}
-
-EXPORT_C  TInt RSCPClient :: StoreLockcode (TDesC& aNewLockcode, TDesC& aOldLockcode, RArray<TDevicelockPolicies>& aFailedPolicies) {
-    Dprint((_L("[RSCPClient]-> StoreLockcode() >>>")));
-    TInt lErr = KErrNone;
-    TInt lRet = KErrNone;
-
-    if (!IsLockcodeChangeAllowedNow(aFailedPolicies)) {
-        return KErrAccessDenied;
-    }
-
-    HBufC8* failedPoliciesBuff = NULL;
-
-    TRAP(lRet, failedPoliciesBuff = HBufC8 :: NewL((EDevicelockTotalPolicies + 1)* sizeof(TInt32)));
-
-    if(lRet == KErrNone) {
-        lRet = SendReceive(ESCPServChangeEnhCode, TIpcArgs(&aOldLockcode, &aNewLockcode, &failedPoliciesBuff->Des()));
-
-        TPtr8 failedPoliciesBufPtr = failedPoliciesBuff->Des();
-        TRAP(lErr, ReadFailedPoliciesL(failedPoliciesBufPtr, aFailedPolicies));
-
-        delete failedPoliciesBuff;
-    }
-
-    Dprint((_L("[RSCPClient]-> StoreLockcode() <<<")));
-    return (lRet != KErrNone) ? lRet : ((lErr != KErrNone) ? lErr : KErrNone);
-}
-
-EXPORT_C  TInt RSCPClient :: VerifyCurrentLockcode (TDesC& aLockcode,RMobilePhone::TMobilePassword& aISACode,RArray< TDevicelockPolicies > &aFailedPolicies, TInt aFlags) {
-    Dprint((_L("[RSCPClient]-> VerifyCurrentLockcode() >>>")));
-    TInt lErr = KErrNone;
-    TInt lRet = KErrNone;
-
-    // extra one for failed policies count
-    HBufC8* failedPoliciesBuff = NULL;
-
-    TRAP(lRet, failedPoliciesBuff = HBufC8 :: NewL((EDevicelockTotalPolicies + 1)* sizeof(TInt32)));
-
-    if(lRet == KErrNone) {
-        lRet = SendReceive(ESCPServAuthenticateS60, TIpcArgs(&aLockcode, &aISACode, &failedPoliciesBuff->Des(), aFlags));
-
-        TPtr8 failedPoliciesBufPtr = failedPoliciesBuff->Des();
-        TRAP(lRet, ReadFailedPoliciesL(failedPoliciesBufPtr, aFailedPolicies));
-
-        delete failedPoliciesBuff;
-    }
-
-    return (lRet != KErrNone) ? lRet : ((lErr != KErrNone) ? lErr : KErrNone);
-}
-
 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
 
+// ---------------------------------------------------------
+// RSCPClient::GetNewCodeAndChange()
+// Show the new code request and verification dialogs and
+// send the change request to the server.
+// 
+// Status : Approved
+// ---------------------------------------------------------
+//  
+TInt RSCPClient::GetNewCodeAndChange( TDes& aOldCode, 
+                                      TInt aMode,
+                                      TSCPSecCode* aNewDOSCode /*=NULL*/, 
+                                      HBufC** aNewCodePptr/* = NULL*/)
+    {
+    
+    Dprint(_L("[RSCPClient]-> GetNewCodeAndChange() >>>"));
+    
+    if(!isFlagEnabled)
+	{
+		return KErrNotSupported;
+	}
+    TInt err = KErrNone;
+    TInt ret = KErrNone;            
+    
+            
+    TInt maxLen = KSCPPasscodeMaxLength;
+    TInt minLen = 1;
+        
+    // Fetch the minimum and maximum lengths for the code, if available.
+    // This feature is commented out for correction to BU error ID: BNIN-6LC3AP.
+    // Left in the code for possible inclusion in the future.
+    //FetchLimits( minLen, maxLen );        
+        
+    // Request the new code and verify it. Repeat this until the codes match.
+    
+    // Create the buffers on the heap
+    HBufC* newCodeHBuf = NULL;
+    HBufC* verifyCodeHBuf = NULL;
+    
+    TRAP( err, newCodeHBuf = HBufC::NewL( KSCPPasscodeMaxLength + 1 ) );
+    if ( err == KErrNone )
+        {
+        TRAP( err, verifyCodeHBuf = HBufC::NewL( KSCPPasscodeMaxLength + 1 ) );
+        }
+    
+    if ( err != KErrNone )
+        {
+        if ( newCodeHBuf != NULL )
+            {
+            delete newCodeHBuf;
+            }
+        return err; 
+        }    
+        
+    TPtr newCodeBuffer = newCodeHBuf->Des();
+    TPtr verifyCodeBuffer = verifyCodeHBuf->Des();  
+    
+    // Configure the buttons according to the mode
+    TSCPButtonConfig bConfig;
+    TBool ecSupport;
+    if ( aMode == KSCPForcedChange )
+        {
+        bConfig = SCP_OK_ETEL;
+        ecSupport = ETrue;
+        }
+    else
+        {
+        bConfig = SCP_OK_CANCEL;
+        ecSupport = EFalse;
+        }
+    
+    TBool isMismatch = EFalse;
+    do // Repeat loop BEGIN
+        {
+        isMismatch = EFalse;
+                
+        if ( err == KErrSCPInvalidCode )
+            {
+            err = KErrNone; // "reset"
+            }
+                          
+        newCodeBuffer.Zero(); 
+        
+        TRAP( err, ret = RunDialogL( newCodeBuffer, 
+                                 bConfig, 
+                                 minLen,
+                                 maxLen,
+                                 R_SECUI_TEXT_ENTER_NEW_SEC_CODE,
+                                 NULL,
+                                 ecSupport) );
+    
+        if ( ( ret ) && ( ret != ESecUiEmergencyCall ) && ( err == KErrNone ) )
+            {
+            verifyCodeBuffer.Zero();
+            /*TChar ch = static_cast<TChar>(newCodeBuffer[0]);
+
+            CSCPQueryDialog :: TKeypadContext lKPContext =
+                    (ch.IsDigit() ? CSCPQueryDialog :: ENumeric : CSCPQueryDialog :: EAlphaNumeric);*/
+                    
+            TRAP( err, ret = RunDialogL( verifyCodeBuffer, 
+                                 bConfig, 
+                                 minLen,
+                                 maxLen,
+                                 R_SECUI_TEXT_VERIFY_NEW_SEC_CODE,
+                                 NULL,
+                                 ecSupport));
+            }
+
+        if ( ( !ret ) || ( err != KErrNone ) || ( ret == ESecUiEmergencyCall ) )
+            {
+            break;
+            }            
+            
+        if  ( verifyCodeBuffer.Compare( newCodeBuffer ) != 0 )
+            {                        
+            // Ignore the errors from showing the note, it's better to continue if it fails
+            
+            TRAP_IGNORE(
+                // Show an error note, the entered codes don't match             
+                CAknNoteDialog* noteDlg = 
+                    new (ELeave) CAknNoteDialog(reinterpret_cast<CEikDialog**>( &noteDlg ) );
+                noteDlg->SetTimeout( CAknNoteDialog::ELongTimeout );
+                noteDlg->SetTone( CAknNoteDialog::EErrorTone );
+                noteDlg->ExecuteLD( R_CODES_DONT_MATCH );
+            );
+            
+            isMismatch = ETrue; // Repeat code query
+            }        
+        
+        if ( !isMismatch )
+            {
+            HBufC8* addParamsHBuf = NULL;
+    
+            TRAP( err, addParamsHBuf = HBufC8::NewL( KSCPMaxTARMNotifParamLen ) );
+            if ( err != KErrNone )
+                {
+                delete verifyCodeHBuf;
+                delete newCodeHBuf;             
+                return err;
+                }      
+        
+            TPtr8 addParams = addParamsHBuf->Des();
+            addParams.Zero();                                    
+            
+            if ( !isMismatch )
+                {
+                // Try to change the code
+                TSCPSecCode newDOSCode;
+                newDOSCode.Zero();
+                
+                err = SendReceive(  ESCPServChangeEnhCode, 
+                            TIpcArgs( &aOldCode, &verifyCodeBuffer, &addParams, &newDOSCode ) 
+                         );
+                
+                if ( addParams.Length() > 0 )
+                    {
+                    // The server has sent additional parameters
+                    TRAPD( err, ProcessServerCommandsL( addParams ) );
+                    if ( err != KErrNone )
+                        {
+                        Dprint( (_L("RSCPClient::GetNewCodeAndChange():\
+                            Process cmds FAILED: %d"), err ));
+                        }                    
+                    }
+                    
+                if ( aNewDOSCode != NULL )
+                    {
+                    (*aNewDOSCode).Copy( newDOSCode );
+                    }
+                }
+            
+            delete addParamsHBuf;
+            }
+                            
+        } while ( ( isMismatch ) || ( err == KErrSCPInvalidCode ) ); // Loop END
+        
+    if ( ( ( !ret ) && ( err == KErrNone ) ) || ( ret == ESecUiEmergencyCall ) )
+        {
+        // Cancelled by user
+        err = KErrAbort;
+        }
+
+    if((KErrNone == err) && (aNewCodePptr != 0)) {
+        Dprint(_L("[RSCPClient]-> INFO: Updating new lock code to aNewCodePptr"));
+        TRAP(err, *aNewCodePptr = HBufC :: NewL(verifyCodeHBuf->Des().Length()));
+
+        if(*aNewCodePptr != NULL) {
+            (*aNewCodePptr)->Des().Copy(verifyCodeHBuf->Des());
+            Dprint(_L("[RSCPClient]-> INFO: Updated new lock code to aNewCodePptr"));
+        }
+    }
+    
+    delete verifyCodeHBuf;
+    delete newCodeHBuf;
+        
+    Dprint(_L("[RSCPClient]-> GetNewCodeAndChange() <<<"));
+    return err;        
+    }
+       
+            
+        
+// ---------------------------------------------------------
+// RSCPClient::ProcessServerCommandsL()
+// Handle the commands in the server's param-buffer
+// 
+// Status : Approved
+// ---------------------------------------------------------
+//
+void RSCPClient::ProcessServerCommandsL( TDes8& aInParams, 
+                                         CSCPParamObject** aOutParams,
+                                         TBool isNotifierEvent )
+    {    
+
+    if(!isFlagEnabled)
+	{
+		User::Leave(KErrNotSupported);
+	}
+    Dprint( (_L("--> RSCPClient::ProcessServerCommandsL()") ));
+    (void)aOutParams;
+    
+    CSCPParamObject* theParams = CSCPParamObject::NewL();
+    CleanupStack::PushL( theParams );
+    
+    theParams->Parse( aInParams );
+    TInt actionID;
+    TInt ret = theParams->Get( KSCPParamAction, actionID );
+    
+    Dprint( (_L("RSCPClient::ProcessServerCommandsL():Params parsed") ));
+    
+    if ( ret != KErrNone )
+        {
+        Dprint( (_L("RSCPClient::ProcessServerCommands(): Can't get action ID: %d"), ret )); 
+        }
+    else
+        {
+        switch ( actionID )
+            {
+            case ( KSCPActionShowUI ):
+                {
+                TRAP( ret, ShowUIL( *theParams ) );
+                break;
+                }
+                
+            case ( KSCPActionForceChange ):
+                {
+                if ( isNotifierEvent )
+                    {
+                    break; // Calling this through the notifier would jam the system
+                    // since the server is busy.
+                    }                                    
+                
+                HBufC* codeHBuf = NULL;
+                codeHBuf = HBufC::NewL( KSCPPasscodeMaxLength + 1 );    
+                CleanupStack::PushL( codeHBuf );
+                   
+                TPtr codeBuf = codeHBuf->Des();
+                codeBuf.Zero(); 
+                
+                ret = theParams->Get( KSCPParamPassword, codeBuf );
+				
+                if ( ret == KErrNone )
+                    {
+                    TInt lResFile = 0;
+                    TFileName resFile;
+                    resFile.Copy( KDriveZ );
+                    resFile.Append( KSCPTimestampPluginResFilename );
+                    BaflUtils :: NearestLanguageFile( CCoeEnv :: Static()->FsSession(), resFile );
+                    lResFile = CCoeEnv :: Static()->AddResourceFileL(resFile);
+					
+                    CAknNoteDialog* lNoteDlg = new (ELeave) CAknNoteDialog(CAknNoteDialog :: ENoTone, CAknNoteDialog :: ELongTimeout);
+                    CleanupStack :: PushL(lNoteDlg);
+					
+                    HBufC* lExpNoteMsg = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE_AGING);
+                    lNoteDlg->SetTextL(lExpNoteMsg->Des());
+					
+                    lNoteDlg->ExecuteLD(R_DIALOG_WARNING);
+                    CleanupStack :: PopAndDestroy(1); //lExpNoteMsg
+                    CleanupStack :: Pop(1); //lNoteDlg
+					
+                    CCoeEnv :: Static()->DeleteResourceFile( lResFile );
+					
+                    TSCPSecCode newDOSCode;
+                    ret = GetNewCodeAndChange( codeBuf, KSCPForcedChange, &newDOSCode );
+                    
+                    // If aOutParams is defined, return the new code
+                    if ( aOutParams != NULL )
+                        {
+                        (*aOutParams) = CSCPParamObject::NewL();
+                        (*aOutParams)->Set( KSCPParamPassword, newDOSCode );
+                        }
+                    }
+                    
+                CleanupStack::PopAndDestroy( codeHBuf );
+                                    
+                break;
+                }                            
+            }                
+        }
+                       
+    CleanupStack::PopAndDestroy( theParams );
+    
+    Dprint( (_L("<-- RSCPClient::ProcessServerCommandsL()") ));
+    User::LeaveIfError( ret );
+    }
+    
+// ---------------------------------------------------------
+// RSCPClient::ShowUI()
+// Show the requested UI through AVKON
+// 
+// Status : Approved
+// ---------------------------------------------------------
+//
+void RSCPClient::ShowUIL( CSCPParamObject& aContext )
+    {
+    
+    if(!isFlagEnabled)
+	{
+		User::Leave(KErrNotSupported);
+	}
+    Dprint( (_L("--> RSCPClient::ShowUIL()") ));
+    TInt mode;
+    User::LeaveIfError( aContext.Get( KSCPParamUIMode, mode ) );
+    
+    switch ( mode )
+        {
+        case ( KSCPUINote ):
+            {
+            // Get prompt
+            TBuf<KSCPMaxPromptTextLen> promptText;
+            aContext.Get( KSCPParamPromptText, promptText );
+                        
+            // Try to get note icon, default is to use "error"
+            TInt noteType = KSCPUINoteError;
+            Dprint( (_L("RSCPClient::ShowUIL(): Creating note object") ));
+            
+            CAknResourceNoteDialog* note = NULL;
+            
+            if ( aContext.Get( KSCPParamNoteIcon, noteType ) != KErrNone )
+                {
+                noteType = KSCPUINoteError;
+                }
+                
+            switch ( noteType )
+                {
+                case ( KSCPUINoteWarning ):
+                    {
+                    note = new (ELeave) CAknWarningNote( ETrue );    
+                    break;
+                    }
+                    
+                case ( KSCPUINoteError ):
+                default: // default to error
+                    {
+                    note = new (ELeave) CAknErrorNote( ETrue ); 
+                    break;
+                    }                         
+                }                                          
+
+            if ( note != NULL )
+                {
+                Dprint( (_L("RSCPClient::ShowUIL(): Showing note") ));
+                note->ExecuteLD( promptText );
+                }            
+            }
+        }
+
+    Dprint( (_L("<-- RSCPClient::ShowUIL()") ));
+    } 
+       
 
 // ---------------------------------------------------------
 // RSCPClient::FetchLimits()
@@ -759,31 +1316,223 @@
             aMax = KSCPPasscodeMaxLength;
             }
         }
+    }              
+TInt RSCPClient :: SetSecurityCodeL(RMobilePhone :: TMobilePassword& aPassword, 
+            TSCPButtonConfig aButtonsShown, TBool aECSSupport, TInt aFlags, TInt& aResFileSCP, TInt& aResFileSecUi) {
+    Dprint((_L("[RSCPClient]-> SetSecurityCodeL() >>>")));
+    Dprint((_L("[RSCPClient]-> input params - aButtonsShown=%d, aECSSupport=%d"), aButtonsShown, aECSSupport));
+
+    if(EFalse == isFlagEnabled) {
+        (void)aPassword;
+        Dprint((_L("[RSCPClient]-> ERROR: Function not supported in this variant")));
+        User :: Invariant();
+        return KErrNotSupported;
+    }
+
+    TInt lRet = LoadResources(aResFileSCP, aResFileSecUi);
+
+    if(lRet != KErrNone) {
+        return lRet;
     }
 
-void RSCPClient :: ReadFailedPoliciesL(TDes8& aFailedPolicyBuf, RArray< TDevicelockPolicies>& aFailedPolicies) {
-    Dprint((_L("[RSCPClient]-> ReadFailedPoliciesL() >>>")));
-    
-    if(aFailedPolicyBuf.Length() < 1) {
-        return;
+    TInt lDefCode = 0;
+    CRepository* lRepository = CRepository :: NewLC(KCRUidSCPLockCode);
+    lRet = lRepository->Get(KSCPLockCodeDefaultLockCode, lDefCode);
+
+    if(lRet != KErrNone) {
+        Dprint(_L("[RSCPClient]-> ERROR: Unable to perform get on CenRep, lErr=%d"), lRet);
+        CleanupStack :: PopAndDestroy(lRepository);
+        return lRet;
     }
-    
-    RDesReadStream readStream(aFailedPolicyBuf);
-    CleanupClosePushL(readStream);
-    
-    TInt failedPoliciesCount = readStream.ReadInt32L();    
-    aFailedPolicies.Reset();
-    Dprint((_L("[RSCPClient]-> ReadFailedPoliciesL failedPoliciesCount =%d"), failedPoliciesCount));
-    for(int i=0; i < failedPoliciesCount; i++) {
-        TInt32 temp =  readStream.ReadInt32L();
-        //aFailedPolicies.Append((TDevicelockPolicies) readStream.ReadInt32L());
-        aFailedPolicies.AppendL((TDevicelockPolicies)temp);
-        Dprint((_L("[RSCPClient]-> ReadFailedPoliciesL failed policy =%d"), temp));
+    TInt currentLawmoState(0); 
+    Dprint( (_L("CSCPClient::lawmo cenrep") ));
+    CRepository* crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys );
+    TInt reterr = crep->Get( KLAWMOPhoneLock, currentLawmoState ); 
+    Dprint( (_L("CSCPClient::lawmo cenrep done") ));
+    if(reterr != KErrNone) 
+        {
+        Dprint(_L("[RSCPClient]-> ERROR: Unable to perform get on CenRep lawmo, lErr=%d"), lRet);
+        CleanupStack :: PopAndDestroy(crep);
+        return reterr;
+        }
+    HBufC* codeHBuf = HBufC :: NewLC(KSCPPasscodeMaxLength + 1);
+    HBufC8* addParamsHBuf = HBufC8 :: NewLC(KSCPMaxTARMNotifParamLen);
+    TPtr codeBuffer = codeHBuf->Des();
+    TPtr8 addParams = addParamsHBuf->Des();
+    if(currentLawmoState!=KLockedbyLawmo)
+        {
+        // rundialog with a new resource file
+        Dprint((_L("[RSCPClient]-> lawmo current state !=30")));
+        TBuf<255> serverId;
+        serverId.Zero();
+        reterr = crep->Get( KLAWMOfactoryDmServerName, serverId );
+        Dprint( (_L("RSCPClient::SetSecurityCode serverid: %s"), serverId.PtrZ() ));
+        HBufC* prompt = StringLoader::LoadLC(R_SCP_LAWMO_LOCKED, serverId);
+        Dprint( (_L("RSCPClient::SetSecurityCode stringval: %s"), (prompt->Des()).PtrZ() ));
+
+        lRet = RunDialogL(codeBuffer, aButtonsShown, KSCPPasscodeMinLength, KSCPPasscodeMaxLength,
+                        0, prompt, aECSSupport);
+		if((lRet) && (lRet != ESecUiEmergencyCall) && (lRet != EAknSoftkeyEmergencyCall)) 
+			{
+			Dprint(_L("[RSCPClient]-> INFO: LL User has updated the lock code..."));
+			
+			lRet = SendReceive( ESCPServAuthenticateS60, TIpcArgs( &codeBuffer, &aPassword, &addParams, aFlags));
+			
+			Dprint((_L("[RSCPClient]-> INFO: LL addParams.Length()=%d")), addParams.Length());
+			Dprint((_L("[RSCPClient]-> INFO: LL lRet=%d")), lRet);
+			}
+		else
+			{
+	        switch(lRet) 
+	            {
+	            case 0:
+	                lRet = KErrCancel;
+	                break;
+	            }
+            }
+        CleanupStack::PopAndDestroy(1);
+        }
+    else if(lDefCode == 0) {
+        Dprint(_L("[RSCPClient]-> INFO: Default lock code has been set already by the user..."));
+
+        lRet = RunDialogL(codeBuffer, aButtonsShown, KSCPPasscodeMinLength, KSCPPasscodeMaxLength,
+                R_SECUI_TEXT_ENTER_SEC_CODE, NULL, aECSSupport);
+
+        if((lRet) && (lRet != ESecUiEmergencyCall) && (lRet != EAknSoftkeyEmergencyCall)) {
+            Dprint(_L("[RSCPClient]-> INFO: User has updated the lock code..."));
+
+            lRet = SendReceive( ESCPServAuthenticateS60, TIpcArgs( &codeBuffer, &aPassword, &addParams, aFlags));
+
+            Dprint((_L("[RSCPClient]-> INFO: addParams.Length()=%d")), addParams.Length());
+            Dprint((_L("[RSCPClient]-> INFO: lRet=%d")), lRet);
+        }
+        else {
+            switch(lRet) {
+            case 0:
+				lRet = KErrCancel;
+				break;
+            case EAknSoftkeyEmergencyCall:
+                //lRet = KErrCancel;
+                break;
+            case ESecUiEmergencyCall:
+                lRet = ESecUiEmergencyCall;
+                break;
+            /*default:
+                break;*/
+            }
+        }
+    }
+    else {
+        TRequestStatus statusSave;
+        Dprint(_L("[RSCPClient]-> INFO: Default lock code not set by the user, requesting for the same"));
+
+        HBufC* msgConfirmSave = NULL;
+        CAknGlobalConfirmationQuery* query = CAknGlobalConfirmationQuery :: NewLC();
+
+        if(aButtonsShown == SCP_OK || aButtonsShown == SCP_OK_ETEL) {
+            //msgConfirmSave = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE);
+             msgConfirmSave = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE_SETTING_QUERY_SERVER);
+            query->ShowConfirmationQueryL(statusSave, *msgConfirmSave, R_AVKON_SOFTKEYS_OK_EMPTY__OK, R_QGN_NOTE_INFO_ANIM);
+        }
+        else {
+            msgConfirmSave = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE);
+        	query->ShowConfirmationQueryL(statusSave, *msgConfirmSave, R_AVKON_SOFTKEYS_YES_NO__YES, R_QGN_NOTE_QUERY_ANIM);
+        }
+
+        User :: WaitForRequest(statusSave);
+        CleanupStack :: PopAndDestroy(2); // msgConfirmSave query
+
+        if((statusSave == EAknSoftkeyYes) || (statusSave == EAknSoftkeyOk)) {
+            Dprint(_L("[RSCPClient]-> INFO: calling GetNewCodeAndChange() ..."));
+
+            TBufC<10> NBuf(KSCPDefaultEnchSecCode);
+            TPtr codeBuf = NBuf.Des();
+
+            TSCPSecCode lNewSecCode;
+            TInt lButtonCfg = (aButtonsShown == SCP_OK || aButtonsShown == SCP_OK_ETEL) ? KSCPForcedChange : KSCPNormalChange;
+            HBufC* lNewLkCodeBuf = NULL;
+            lRet = GetNewCodeAndChange(codeBuf, lButtonCfg, &lNewSecCode, &lNewLkCodeBuf);
+
+            Dprint(_L("[RSCPClient]-> INFO: GetNewCodeAndChange() complete, err=%d"), lRet);
+
+            if(KErrNone == lRet) {
+                /* This is being called as a workaround for a freezing issue with SecUI. This is in place
+                 * as a temporary measure until the source is identified.
+                */
+                TInt lTmpRet = SendReceive(ESCPServAuthenticateS60, TIpcArgs(&lNewLkCodeBuf->Des(), &aPassword, &addParams, aFlags));
+
+                Dprint(_L("[RSCPClient]-> INFO: lTmpRet from SendReceive()=%d"), lTmpRet);
+                if(KErrNone == lRet) {
+                    Dprint(_L("[RSCPClient]-> INFO: updating CenRep ..."));
+                    lRepository->Set(KSCPLockCodeDefaultLockCode, 0);
+                    Dprint(_L("[RSCPClient]-> INFO: User updated lock code for the first time...err= %d"), lRet);
+                }
+            }
+
+            if(lNewLkCodeBuf) {
+                delete lNewLkCodeBuf;
+            }
+        }
+        else {
+            Dprint(_L("[RSCPClient]-> INFO: Returning KErrCancel"));
+            lRet = KErrCancel;
+        }
+
+        if(KErrAbort == lRet) {
+            Dprint(_L("[RSCPClient]-> INFO: Returning KErrCancel"));
+            lRet = KErrCancel;
+        }
+
     }
 
-    CleanupStack :: PopAndDestroy(&readStream);
-    Dprint((_L("[RSCPClient]-> ReadFailedPoliciesL() <<<")));
+    if(addParams.Length() > 0) {
+        CSCPParamObject* tmp = CSCPParamObject :: NewLC();
+        TInt lTempRet = tmp->Parse(addParams);
+
+        if(lTempRet == KErrNone) {
+            lTempRet = tmp->Set(KSCPParamPassword, codeBuffer);
+        }
+
+        if(lTempRet == KErrNone) {
+            addParams.Zero();
+            HBufC8* tmpBuf;
+            lTempRet = tmp->GetBuffer(tmpBuf);
+
+            if(lTempRet == KErrNone) {
+                addParams.Copy(tmpBuf->Des());
+                delete tmpBuf;
+            }
+        }
+
+        if(lTempRet == KErrNone) {
+            CSCPParamObject* outParams = NULL;
+            /*
+             * aECSSupport when passed to ProcessServerCommandsL decides if the expiry note and subsequently change device lock
+             * code has to be shown or not. Normally if the lock code has expired, the same has to be prompted from the user and 
+             * has to be done only during device unlock. aECSSupport value is being passed to ensure that new lock code is prompted
+             * only during device unlock.
+             */
+            ProcessServerCommandsL(addParams, &outParams, !aECSSupport);
+
+            if(outParams != NULL) {
+                TSCPSecCode newSecCode;
+                if(outParams->Get(KSCPParamPassword, newSecCode) == KErrNone) {
+                    Dprint((_L("[RSCPClient]-> INFO: Updating encoded password received from the server into aPassword...")));
+                    aPassword.Copy(newSecCode);
+                }
+
+                delete outParams;
+            }
+        }
+
+        CleanupStack :: PopAndDestroy(tmp);
+    }
+
+    CleanupStack :: PopAndDestroy(4); // repository * 2, addParamsHBuf, codeHBuf 
+    Dprint(_L("[RSCPClient]-> SetSecurityCodeL() <<< lRet=%d"), lRet);
+    return lRet;
 }
+
 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
 // <<-- *********** Device lock new features *************
 
--- a/terminalsecurity/SCP/SCPClient/src/SCPLockObserver.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/src/SCPLockObserver.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -24,7 +24,6 @@
 #include "SCPQueryDialog.h"
 #include "SCPDebug.h"
 
-
 // ================= MEMBER FUNCTIONS =======================
 //
 // ----------------------------------------------------------
@@ -55,9 +54,9 @@
 CSCPLockObserver::~CSCPLockObserver()
     {
     
-    Dprint(_L("CSCPLockObserver::~CSCPLockObserver"));
-    
+    Dprint(_L("CSCPLockObserver::~CSCPLockObserver >>>"));
     Cancel();
+    Dprint(_L("CSCPLockObserver::~CSCPLockObserver <<<"));
     }
 //
 // ----------------------------------------------------------
@@ -80,31 +79,27 @@
         
     iStatus = KRequestPending;
     
-    switch(iType)
-        {
-            case ESecUiDeviceLockObserver:
-                
-                Dprint(_L("CSCPLockObserver::Start() Device Lock Observer"));
-                
-                iProperty.Attach(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus); 
-                break;
-            case ESecUiCallStateObserver:
-                
-                Dprint(_L("CSCPLockObserver::Start() Call State Observer"));
-                
-                iProperty.Attach(KPSUidCtsyCallInformation, KCTsyCallState); 
-                break;
+    switch(iType) {
+        case ESecUiDeviceLockObserver:
+            
+            Dprint(_L("CSCPLockObserver::Start() Device Lock Observer"));
+            
+            iProperty.Attach(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus); 
+            break;
+        case ESecUiCallStateObserver: {
+            Dprint(_L("CSCPLockObserver::Start() Call State Observer"));                
+            iProperty.Attach(KPSUidCtsyCallInformation, KCTsyCallState);
+        }
+        break;
 
-            default:
-                break;
-        }
+        default:
+            break;
+    }
     
     iProperty.Subscribe(iStatus);
+    iSubscribedToEvent = ETrue;
     SetActive();
-    iSubscribedToEvent = ETrue;
-    
-    Dprint(_L("CSCPLockObserver::Start() END"));
-    
+    Dprint(_L("CSCPLockObserver::Start() END"));    
     return KErrNone;
     }
 //
@@ -113,9 +108,30 @@
 // C++ constructor
 // ----------------------------------------------------------
 // 
-CSCPLockObserver::CSCPLockObserver(CSCPQueryDialog* aDialog, TInt aType) : CActive(0), iDialog(aDialog), iSubscribedToEvent(EFalse), iType(aType)
-	{                            
-    }
+CSCPLockObserver :: CSCPLockObserver(CSCPQueryDialog* aDialog, TInt aType) : CActive(0),
+        iDialog(aDialog), iType(aType), 
+        iInformCallEnding(EFalse), iSubscribedToEvent(EFalse) {
+    
+    TInt lStatus;
+    RProperty :: Get(KPSUidCtsyCallInformation, KCTsyCallState, lStatus);
+    
+    switch(lStatus) {
+        default:
+        case EPSCTsyCallStateUninitialized:
+        case EPSCTsyCallStateNone:
+            iInformCallEnding = EFalse;
+            break;
+        case EPSCTsyCallStateDisconnecting:
+        case EPSCTsyCallStateAlerting:
+        case EPSCTsyCallStateHold:
+        case EPSCTsyCallStateRinging:
+        case EPSCTsyCallStateDialling:
+        case EPSCTsyCallStateAnswering:
+        case EPSCTsyCallStateConnected:
+            iInformCallEnding = ETrue;
+            break;
+    };
+}
 //
 // ----------------------------------------------------------
 // CSCPLockObserver::ConstructL()
@@ -141,50 +157,64 @@
 // Called by Active Scheduler
 // ----------------------------------------------------------
 // 
-void CSCPLockObserver::RunL()
-	{
-	
-    Dprint(_L("CSCPLockObserver::RunL() BEGIN"));
-    
+void CSCPLockObserver :: RunL() {
+    Dprint(_L("[CSCPLockObserver]-> RunL() >>>"));
     
-    switch(iType)
-        {
-            case ESecUiDeviceLockObserver:
-                 TInt autolockState;
-                 iProperty.Get( autolockState );
-                 if (autolockState > EAutolockOff)
-                    {
-                    
-                    Dprint(_L("CSCPLockObserver::RunL() TryCancelQueryL Device Lock"));
-                    
-                	iDialog->TryCancelQueryL(ESecUiDeviceLocked);
-                	iSubscribedToEvent = EFalse;
+    switch(iType) {
+        case ESecUiDeviceLockObserver:
+        TInt autolockState;
+        iProperty.Get(autolockState);
+        
+        if(autolockState > EAutolockOff) {            
+            Dprint(_L("CSCPLockObserver::RunL() TryCancelQueryL Device Lock"));
+            iDialog->TryCancelQueryL(ESecUiDeviceLocked);
+            iSubscribedToEvent = EFalse;
+        }
+        else if((autolockState == EAutolockOff)||(autolockState == EAutolockStatusUninitialized))
+            {
+            Dprint(_L("CSCPLockObserver::RunL() TryCancelQueryL Device UnLocked"));
+            iDialog->TryCancelQueryL(ESecUiNone);
+            iSubscribedToEvent = EFalse;
+            }
+        break;
+        case ESecUiCallStateObserver: {
+            TInt callState;
+            iProperty.Get(callState);
+            Dprint( (_L("CSCPLockObserver::RunL() callState before Start() : %d"), callState ));
+            Start();
+            
+            switch(callState) {
+                default:
+                    break;
+                case EPSCTsyCallStateNone:
+                    if(iInformCallEnding) {
+                        Dprint( (_L("CSCPLockObserver::RunL() Branched to EPSCTsyCallStateNone")));
+                        iDialog->TryCancelQueryL(EEnded);                    
+                        iInformCallEnding = EFalse;
                     }
+                    break;
+                case EPSCTsyCallStateAlerting:
+                case EPSCTsyCallStateHold:
+                case EPSCTsyCallStateRinging:
+                case EPSCTsyCallStateDialling:
+                case EPSCTsyCallStateAnswering:
+                case EPSCTsyCallStateConnected: {
+                        Dprint(_L("CSCPLockObserver::RunL() TryCancelQueryL Active Call"));                
+                        TRAPD(lErr, iDialog->TryCancelQueryL(EInProgress));
+                        Dprint( (_L("CSCPLockObserver::RunL() lErr : %d"), lErr ));                        
+                        iInformCallEnding = ETrue;
+                }
                 break;
-            case ESecUiCallStateObserver:
-                TInt callState;
-                iProperty.Get( callState );
-				 
-				 Dprint( (_L("CSCPLockObserver::RunL() callState : %d"),callState ));
-                if(callState == EPSCTsyCallStateDisconnecting)
-                    {
-                     
-                    Dprint(_L("CSCPLockObserver::RunL() TryCancelQueryL Active Call"));
-                    
-                	iDialog->TryCancelQueryL(EPSCTsyCallStateDisconnecting);
-                	iSubscribedToEvent = EFalse;   
-                    }
-                break;
+            };
+        }
+        break;
+        default:
+            break;
+    }
+    
+    Dprint(_L("[CSCPLockObserver]-> RunL() <<<"));    
+}
 
-            default:
-                break;
-        }
-
-   
-	
-    Dprint(_L("CSCPLockObserver::RunL() END"));
-    
-	}
 // ----------------------------------------------------------------------------
 // CSCPLockObserver::RunError
 // ----------------------------------------------------------------------------
@@ -192,6 +222,8 @@
     {
         return KErrNone;
     }	
+    
+   
 //
 // ----------------------------------------------------------
 // CSCPLockObserver::DoCancel()
@@ -204,7 +236,8 @@
     Dprint(_L("CSCPLockObserver::DoCancel() BEGIN"));
     
     if(iSubscribedToEvent)
-    	iProperty.Cancel();
+        iProperty.Cancel();
+    
     iStatus = KErrNone;
     
     Dprint(_L("CSCPLockObserver::DoCancel() END"));
--- a/terminalsecurity/SCP/SCPClient/src/SCPParamObject.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/src/SCPParamObject.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -285,7 +285,7 @@
     {
     iParamIDs.Reset();
 	iParamValues.ResetAndDestroy();
-	iFailedPolicyIDs.Reset();	
+	
 	return KErrNone;
     }
    
@@ -612,15 +612,7 @@
         }    
     }
 
-EXPORT_C TInt CSCPParamObject::AddtoFailedPolices( TInt aFailedpolicyID )
-    {
-    return iFailedPolicyIDs.Append(aFailedpolicyID);
-    }
 	
-EXPORT_C const RArray<TInt>& CSCPParamObject::GetFailedPolices( )
-    {
-    return iFailedPolicyIDs;
-    }
 // ----------------------------------------------------------
 // CSCPParamObject::~CSCPParamObject()
 // Destructor
--- a/terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2000-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"
@@ -26,13 +26,16 @@
 // Include the SecUi definitions
 #include <secui.hrh>
 #include "SCPDebug.h"
-#include <scpnotifier.rsg>
+#include <SCPNotifier.rsg>
 // For Central Repository
 #include <centralrepository.h>
 #include <AknIncallBubbleNotify.h>
 #include <e32property.h>
 #include <ctsydomainpskeys.h>
 #include "SCPCodePrivateCRKeys.h"
+#include <DevManInternalCRKeys.h>
+#include <featmgr.h>
+
 /*#ifdef _DEBUG
 #define __SCP_DEBUG
 #endif // _DEBUG
@@ -48,7 +51,7 @@
 #endif // _DEBUG*/
 
 const TInt KSCPSpecialDeleteEvent( 63529 );
-
+const TInt KLockedbyLawmo (30);
 // ================= MEMBER FUNCTIONS =======================
 //
 // ----------------------------------------------------------
@@ -60,7 +63,8 @@
                                     RSCPClient::TSCPButtonConfig aButtonsShown, 
                                     TInt aMinLength,
                                     TInt aMaxLength,
-                                    TBool aECSSupport
+                                    TBool aECSSupport,
+                                    TKeypadContext aContextSensitive /*= EContextSensitive*/
                                     )
             : CAknTextQueryDialog(aDataText, ENoTone),
 			  iMinLength(aMinLength),
@@ -74,8 +78,10 @@
 			  iPreviousCharacterWasInvalid( EFalse ),
 			  iPrioritySet( EFalse ),
 			  iPriorityDropped( EFalse ),
-			  iKeyUsed ( NULL )
-	{		 
+			  iLockedByLawMo( EFalse ),
+			  iKeyUsed ( NULL ),
+			  iContextSensitive(aContextSensitive)
+	{
         def_mode = 0;
         iAppKey = 0;
         iMode = KSCPModeNormal;
@@ -91,12 +97,12 @@
 	{
 	Dprint( (_L("CSCPQueryDialog::~CSCPQueryDialog()")) );
 	
-	    if ( AknLayoutUtils::PenEnabled() )
-        {
-        TRAP_IGNORE ( SetIncallBubbleAllowedInUsualL( ETrue ) );
-        }
-
-	
+   if (iDeviceLockStatusObserver)
+        delete iDeviceLockStatusObserver;
+    
+    if (iCallStatusObserver)
+        delete iCallStatusObserver;
+	    
 	if (iFront)
 		{
 		// Uncapture keys, if they were captured
@@ -105,14 +111,14 @@
 			RWindowGroup& groupWin=iCoeEnv->RootWin();
 			groupWin.CancelCaptureKeyUpAndDowns(iAppKey);
 			groupWin.CancelCaptureKeyUpAndDowns(iVoiceKey2);
-			groupWin.CancelCaptureKey(iVoiceKey1);						
+			groupWin.CancelCaptureKey(iVoiceKey1);
 			}
 
 		if ( iPrioritySet )
 		    {
     		// Return normal high-priority in case there are other notifiers active 
 	    	// and were are not going to lose foregroung right after following call	
-		    iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
+		    iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
 		    }
 		 						
 		iEikonEnv->BringForwards(EFalse);	
@@ -130,36 +136,37 @@
 		
 		iFront = EFalse;
 		}
-	
-	if (iDeviceLockStatusObserver)
-		delete iDeviceLockStatusObserver;
-		if (iCallStatusObserver)
-		delete iCallStatusObserver;
-	}
+}
+
+void CSCPQueryDialog :: PostLayoutDynInitL() {
+    Dprint( (_L("[CSCPQueryDialog]-> PostLayoutDynInitL() >>>") ));    
+    iDeviceLockStatusObserver = CSCPLockObserver::NewL(this);
+    iCallStatusObserver = CSCPLockObserver::NewL(this, ESecUiCallStateObserver);
+    Dprint( (_L("[CSCPQueryDialog]-> PostLayoutDynInitL() <<<") ));
+}
+
 //
 // ----------------------------------------------------------
 // CSCPQueryDialog::PreLayoutDynInitL()
 // Called by framework before dialog is shown 
 // ----------------------------------------------------------
 //
-void CSCPQueryDialog::PreLayoutDynInitL()
+void CSCPQueryDialog :: PreLayoutDynInitL()
     {
     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL()") ));
     
-    /* CEikSecretEditor* queryControl = 
-                    static_cast<CEikSecretEditor*>(
-                        QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) 
-                       ); 
-    queryControl->EnableSCT(EFalse); */
-    
     CAknTextQueryDialog::PreLayoutDynInitL();
     
+    CEikSecretEditor* queryControl = static_cast<CEikSecretEditor*>( 
+                QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) );
+
+    queryControl->SetFeature(CEikSecretEditor::ELockQuerySCT, ETrue);
+
     //disable in call bubble.
     if ( AknLayoutUtils::PenEnabled() )
         {
         SetIncallBubbleAllowedInUsualL( EFalse );
         }
-
     
     // Create the ECS detector object if required
     if ( iECSSupport )
@@ -171,24 +178,38 @@
     
     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Set input mode") ));
         
-    /* The default input mode of the lock code query must be set on the basis of the
-    very first character of the current lock code. If the first character of the current
-    lock code is numeric, the default input mode will also be numeric. Otherwise, the 
-    default input mode will be alphabetic */
-    
-    CRepository* repository;
-    repository = CRepository::NewL( KCRUidSCPParameters );
-    CleanupStack::PushL( repository );
-    
-    User::LeaveIfError(repository->Get( KSCPLockCodeDefaultInputMode , def_mode) );
-    
-    CleanupStack::PopAndDestroy( repository );
-    repository = NULL;   
-    
-    if (def_mode == 0)
-    	SetDefaultInputMode( EAknEditorNumericInputMode ); 
-    else
-    	SetDefaultInputMode( EAknEditorSecretAlphaInputMode );
+    switch(iContextSensitive) {
+        case EContextSensitive: {
+            Dprint(_L("[CSCPQueryDialog]-> iContextSensitive = EContextSensitive"));
+            /* The default input mode of the lock code query must be set on the basis of the
+            very first character of the current lock code. If the first character of the current
+            lock code is numeric, the default input mode will also be numeric. Otherwise, the 
+            default input mode will be alphabetic */
+            
+            CRepository* repository = CRepository :: NewL(KCRUidSCPParameters);
+            CleanupStack :: PushL(repository);
+            User :: LeaveIfError(repository->Get(KSCPLockCodeDefaultInputMode, def_mode));            
+            CleanupStack :: PopAndDestroy(repository);
+
+            if (def_mode == 0) {
+                Dprint(_L("[CSCPQueryDialog]-> Context determined as Numeric"));
+                SetDefaultInputMode(EAknEditorNumericInputMode);
+            }
+            else {
+                Dprint(_L("[CSCPQueryDialog]-> Context determined as Alphanumeric"));
+                SetDefaultInputMode(EAknEditorSecretAlphaInputMode);
+            }
+        }
+        break;
+        case ENumeric:
+            Dprint(_L("[CSCPQueryDialog]-> iContextSensitive = ENumeric"));
+            SetDefaultInputMode( EAknEditorNumericInputMode );
+            break;
+        case EAlphaNumeric:
+            Dprint(_L("[CSCPQueryDialog]-> iContextSensitive = EAlphaNumeric"));
+            SetDefaultInputMode( EAknEditorSecretAlphaInputMode );
+            break;
+    };
     
     // Set the mode, we use this to determine the functionality for special keys
     if ( ( iButtons == RSCPClient::SCP_OK ) || ( iButtons == RSCPClient::SCP_OK_CANCEL ) )
@@ -257,25 +278,39 @@
     TInt wgPrio = wsSession.GetWindowGroupOrdinalPriority(myWgId);
 	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): wgPrio %d"),wgPrio ));
 	TInt var;
-	RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState,var);
-	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): EPSCTsyCallStateNone %d"),var ));
-    // we are already on forgeround, need to update priority differently
-	if (var != EPSCTsyCallStateNone)
-	{
-		// If the call is made during device startup have the priority as normal
-		if (iECSSupport && (iButtons == RSCPClient::SCP_OK))
-		{
-		iEikonEnv->RootWin().SetOrdinalPosition(1,ECoeWinPriorityNormal);
-		}
+	RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, var);
+	Dprint((_L("CSCPQueryDialog::PreLayoutDynInitL(): EPSCTsyCallStateNone %d"), var));
 	
-	}
-    else if ((wgPrio == ECoeWinPriorityAlwaysAtFront)&&(iECSSupport))
-        {
-        Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): ECoeWinPriorityAlwaysAtFront+1") ));	
-        iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1);
-        iPrioritySet = ETrue;
+    // If the call is made during device startup have the priority as normal
+    if (iECSSupport)
+    {
+        switch(var) {
+            default:
+            case EPSCTsyCallStateNone:
+                Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Started Maximized...")));
+                iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
+                iPrioritySet = ETrue;
+                break;
+            case EPSCTsyCallStateAlerting:
+            case EPSCTsyCallStateHold:
+            case EPSCTsyCallStateRinging:
+            case EPSCTsyCallStateDialling:
+            case EPSCTsyCallStateAnswering:
+            case EPSCTsyCallStateConnected: {
+                switch(iButtons) {
+                    case RSCPClient::SCP_OK:
+                    case RSCPClient::SCP_OK_ETEL: {
+                        Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Started Minimized...")));
+                        iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityLow);
+                        break;
+                    }
+                    default:
+                        break;
+                }
+            }
         }
-        
+    }
+	        
    // this must be done always to keep the reference count in synch  
    // this does not have any effect if autoforwarding has not been set true (normal application.)
    iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1);
@@ -283,14 +318,14 @@
 	/// -- Change Window Priority for dialog and CBA 
 	if (iECSSupport)
 		{
-		Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") ));			
-		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
-		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); 	
+		Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") ));
+		DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
+		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
 		}
 	else
 		{
-		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal); //
-		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal); 	  	
+		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1); //
+		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1);
 		}	
 
 	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Key sounds") ));
@@ -303,12 +338,29 @@
 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext();
 
 	iFront = ETrue;
-	
-	Dprint( (_L("CSCPQueryDialog::CSCPLockObserver") ));
-	iDeviceLockStatusObserver = CSCPLockObserver::NewL(this);
-	iCallStatusObserver = CSCPLockObserver::NewL(this,ESecUiCallStateObserver);
+    TInt currentLawmoState(0); 
+    Dprint( (_L("CSCPQueryDialog::lawmo cenrep") ));
+    CRepository* crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys );
+    TInt reterr = crep->Get( KLAWMOPhoneLock, currentLawmoState ); 
+    Dprint( (_L("CSCPQueryDialog::lawmo cenrep done") ));
 
-	}
+    if(reterr != KErrNone) 
+        {
+        Dprint(_L("[RSCPClient]-> ERROR: Unable to perform get on CenRep lawmo, lErr=%d"), reterr);
+        CleanupStack :: PopAndDestroy(crep);
+        return;
+        }
+    
+    if(currentLawmoState!=KLockedbyLawmo)
+        {
+        // Hide the OK key
+        Dprint( (_L("CSCPQueryDialog::lawmo state !=30, dim key") ));
+        iLockedByLawMo = ETrue;
+        ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue );
+        ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue);
+        }	
+	CleanupStack::PopAndDestroy();
+}
 //
 // ---------------------------------------------------------
 // CSCPQueryDialog::OfferKeyEventL
@@ -384,9 +436,13 @@
 		
     if ( aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)
         {
-        // Try to exit with OK as well
-        TryExitL(EAknSoftkeyOk);
-        return EKeyWasConsumed;
+    
+            if(QueryControl()->GetTextLength() > 0) {
+                // Try to exit with OK as well
+                TryExitL(EAknSoftkeyOk);                
+            }
+            
+            return EKeyWasConsumed;
         }
 
 	// app key
@@ -417,10 +473,22 @@
             {
             if (iECSSupport)
                 {
-                if (iEcsDetector->State()== CAknEcsDetector::ECompleteMatch)
+                if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch ||
+                     iEcsDetector->State() == CAknEcsDetector::EServiceNumMatch )
                     {
-                    iEcsDetector->AddChar( (TText)(EKeyPhoneSend) );
+                    Dprint( (_L("CSCPQueryDialog::OfferKeyEventL(): adding EKeyPhoneSend to detector")));
                     
+                    switch(iButtons) {
+                        case RSCPClient::SCP_OK:
+                        case RSCPClient::SCP_OK_ETEL:
+                            //Required only during device startup
+                            iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityLow);
+                            break;
+                        default:
+                            break;
+                    }
+                    
+                    iEcsDetector->AddChar( (TText)(EKeyPhoneSend ) );
                     }   
                 else
                     {
@@ -500,16 +568,16 @@
         iValidTextLen = QueryControl()->GetTextLength();
         }   
         
-//Additional modifier set by query dialog, while simulating event
-// As raw key events are used to simulate, modifiers and scan codes cannot be set at a time
-// In the 1st event, modifiers are set and in subsequent event, scan codes will be set.
-if(aKeyEvent.iModifiers & EModifierNumLock &&
-        aKeyEvent.iModifiers & EModifierKeypad && aKeyEvent.iModifiers & EModifierSpecial
-)
-    {
-   
-    return EKeyWasConsumed;
+    //Additional modifier set by query dialog, while simulating event
+    // As raw key events are used to simulate, modifiers and scan codes cannot be set at a time
+    // In the 1st event, modifiers are set and in subsequent event, scan codes will be set.
+    if( aKeyEvent.iModifiers & EModifierNumLock &&
+        aKeyEvent.iModifiers & EModifierKeypad && 
+        aKeyEvent.iModifiers & EModifierSpecial) {
+    
+        return EKeyWasConsumed;
     }
+    
     if ( iECSSupport )
         {
         // Save the text
@@ -521,14 +589,14 @@
             {
             iEcsDetector->SetBuffer(iTextBuffer.Left(KAknEcsMaxMatchingLength));
             }
-        if ( aType == EEventKey )
+        /*if ( aType == EEventKey )
             {
         if ( iEMCallActivated )
             {
             TryExitL( ESecUiEmergencyCall );
             return EKeyWasConsumed;
             }
-        }
+        }*/
         // Retrieve the editor control ptr, we know it is a secret editor..
         CEikSecretEditor* queryControl = static_cast<CEikSecretEditor*>( 
             QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) );                
@@ -568,29 +636,36 @@
             if ( queryControl != NULL )
                 {
                 queryControl->RevealSecretText( EFalse );
-			if(aType == EEventKey)
-			{
-                HBufC* cbaLabel = NULL;
-                TRAPD ( err , cbaLabel= StringLoader::LoadL(R_SCPDIALOG_OK_TEXT) );
-                if ( err == KErrNone )
+				
+                if(aType == EEventKey)
                 {
-					if (isCallSoftkeyAdded)
-					{
-						isCallSoftkeyAdded = EFalse;
-						ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyEmergencyCall);
-					}
-					else
-					{
-					ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk);
-					}
-                TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0,EAknSoftkeyOk,*cbaLabel) );
-                ButtonGroupContainer().DrawDeferred();
-                delete cbaLabel;
-				}
-            	  }
+                    HBufC* cbaLabel = NULL;
+                    Dprint( (_L("CSCPQueryDialog::OfferKeyEventL(): R_SCPDIALOG_OK_TEXT") ));
+                    TRAPD ( err , cbaLabel= StringLoader::LoadL(R_SCPDIALOG_OK_TEXT) );
+                    if ( err == KErrNone )
+                    {
+                        if (isCallSoftkeyAdded)
+                        {
+                            isCallSoftkeyAdded = EFalse;
+                            ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyEmergencyCall);
+                        }
+                        else
+                        {
+                        ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk);
+                        }
+                    TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0,EAknSoftkeyOk,*cbaLabel) );
+	                if(iLockedByLawMo)
+	                {
+	                ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue );
+	                ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue);
+	                }
+                    ButtonGroupContainer().DrawDeferred();
+                    delete cbaLabel;
+                    }
                 }
             }
-        }                  
+        }
+    }
      
     Dprint( (_L("CSCPQueryDialog::OfferKeyEventL() exiting") ));
               
@@ -601,6 +676,13 @@
     else
         {
         return CAknTextQueryDialog::OfferKeyEventL(aKeyEvent,aType);
+        }  
+    
+    if(iLockedByLawMo)
+	    {
+	    Dprint( (_L("dim key hit 2") ));
+	    ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue );
+	    ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue);
         }    
 	}
 //
@@ -625,68 +707,33 @@
 	     Dprint( (_L("CSCPQueryDialog::OkToExitL ( aButtonId :%d, "), aButtonId ));
 	TInt ret = EFalse;
 	
-    if ( aButtonId == EAknSoftkeyOk )
-		{	        		
-		Dprint( (_L("CSCPQueryDialog::OkToExitL - EAknSoftkeyOk") ));		
-		TInt textLength = QueryControl()->GetTextLength();
-		if ( textLength < iMinLength )
-			{	
-			// The code was too short -> play error tone & clear editor
-			if ( textLength != 0 )
-				{
-				CAknKeySoundSystem* soundSystem;
-	            if ( iEikonEnv->AppUi() )
-		            {		            
-		            soundSystem = static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds();
-		            soundSystem->PlaySound( EAvkonSIDErrorTone );
-		            } 
-				QueryControl()->SetTextL( KNullDesC );
-				iTextBuffer.Zero();
-				iValidTextLen = 0;
-
-                // Hide the OK key
-                //ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, EFalse );
-               // ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue);
-
-                if (AknLayoutUtils::PenEnabled())
-                    {
-                    ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue);
-                    }
-                else
-                    {
-                    ButtonGroupContainer().MakeCommandVisible(EAknSoftkeyOk, EFalse);
-                    }
-                }
-            ret = EFalse;
-            }	
-		else
-			{		
-			ret = CAknTextQueryDialog::OkToExitL(aButtonId);
-			}			    
-		}
-				
-	// Cancel is allowed, if the key is active
-	if ( aButtonId == EAknSoftkeyCancel )
-		{
-    	Dprint( (_L("CSCPQueryDialog::OkToExitL EAknSoftkeyCancel ")) );	
-	    ret = CAknTextQueryDialog::OkToExitL(aButtonId);
-		}
-		
-    // Emergency call, exit
-    if ( aButtonId == ESecUiEmergencyCall )
-        {
-		Dprint( (_L("CSCPQueryDialog::OkToExitL(): ESecUiEmergencyCall") ));
-        ret = ETrue;
-        }
-    if (aButtonId == EAknSoftkeyEmergencyCall)
-        {
-        //add EKeyPhonesend to ecs detector. 
-        ret = ETrue;
-        Dprint( (_L("CSCPQueryDialog::OkToExitL(): adding EKeyPhoneSend to detector") ));
-         iEcsDetector->AddChar( (TText)(EKeyPhoneSend ) );
-        CAknTextQueryDialog::OkToExitL(aButtonId);
-        }
-   
+	switch(aButtonId) {
+	    case EAknSoftkeyOk:
+	    case EAknSoftkeyCancel:
+	        ret = CAknTextQueryDialog::OkToExitL(aButtonId);
+	        break;
+	    case ESecUiEmergencyCall:
+	    case EAknSoftkeyEmergencyCall: {
+            Dprint( (_L("CSCPQueryDialog::OkToExitL(): adding EKeyPhoneSend to detector") ));
+            
+            switch(iButtons) {
+                case RSCPClient::SCP_OK:
+                case RSCPClient::SCP_OK_ETEL:
+                    //Required only during device startup
+                    iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityLow);
+                    break;
+                default:
+                    break;
+            }
+            
+            iEMCallActivated = ETrue;
+            iEcsDetector->AddChar( (TText)(EKeyPhoneSend ) );   
+	    }
+        break;
+	    default:
+	        break;	        
+	}
+	
 	Dprint( (_L("CSCPQueryDialog::OkToExitL() done") ));   
 	return ret;
 	}
@@ -699,18 +746,23 @@
 //
 void CSCPQueryDialog::HandleEcsEvent(CAknEcsDetector* aDetector, 
                                      CAknEcsDetector::TState aUpdatedState)
-    {   
+    {
     (void)aDetector; // Not used
-    
     TInt err;
-    if ( ( aUpdatedState == CAknEcsDetector::ECompleteMatchThenSendKey ) || 
-         ( aUpdatedState == CAknEcsDetector::ECallAttempted ) )
+
+    // Check if service calling feature is enabled
+    TBool serviceCallEnabled( EFalse );
+    TRAP( err, FeatureManager::InitializeLibL() );
+    if ( err == KErrNone )
         {
-        // Call attempted, cancel the query
-        iEMCallActivated = ETrue; // OfferKeyEventL will close the dialog         
-        }        
-    else if ( aUpdatedState == CAknEcsDetector::ECompleteMatch )    
-        {                
+        serviceCallEnabled = FeatureManager::FeatureSupported( 
+            KFeatureIdFfServiceCallWhilePhoneLocked );
+        FeatureManager::UnInitializeLib();
+        }
+
+    if ( aUpdatedState == CAknEcsDetector::ECompleteMatch ||
+              ( serviceCallEnabled && aUpdatedState == CAknEcsDetector::EServiceNumMatch ) )
+        {
         iShowingEMNumber = ETrue;
         }
     else if ( iShowingEMNumber )
@@ -733,7 +785,7 @@
                 {
                 queryControl->RevealSecretText( EFalse );
                 }
-           // }        
+
                 HBufC* cbaLabel = NULL;
 				Dprint( (_L("CSCPQueryDialog::HandleEcsEvent(): R_SCPDIALOG_OK_TEXT") ));
                 TRAP ( err, cbaLabel= StringLoader::LoadL(R_SCPDIALOG_OK_TEXT) );
@@ -749,12 +801,17 @@
 							ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk);
 						}
                 	TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0, EAknSoftkeyOk, *cbaLabel) );
+                    if(iLockedByLawMo)
+                    {
+                    ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue );
+                    ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue);
+                    }
                 	ButtonGroupContainer().DrawDeferred();
                 	delete cbaLabel;
                 }
             }
-        }    
-    }
+        }
+    }    
  
 void CSCPQueryDialog::ShowWarningNoteL()
     {
@@ -775,33 +832,51 @@
 // CSCPQueryDialog::SetIncallBubbleAllowedInUsualL()
 // -----------------------------------------------------------------------------
 //
-void CSCPQueryDialog::SetIncallBubbleAllowedInUsualL(TBool aAllowed)
-    {
+void CSCPQueryDialog :: SetIncallBubbleAllowedInUsualL(TBool aAllowed) {
     CAknIncallBubble *incallBubble =  CAknIncallBubble::NewL();
-    CleanupStack::PushL(incallBubble);
-    incallBubble->SetIncallBubbleAllowedInUsualL( aAllowed );
-    CleanupStack::PopAndDestroy();
+    CleanupStack :: PushL(incallBubble);
+    incallBubble->SetIncallBubbleAllowedInUsualL(aAllowed);
+    CleanupStack :: PopAndDestroy();
+}
+	
+void CSCPQueryDialog::TryCancelQueryL(TInt aReason) {
+    Dprint( (_L("CSCPQueryDialog::TryCancelQueryL() >>>")) );
+    
+    switch(aReason) {
+        case CSCPLockObserver :: EEnded:
+            Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): Call ended, raising priority...")));
+            
+            switch(iButtons) {
+                case RSCPClient :: SCP_OK:
+                case RSCPClient :: SCP_OK_ETEL:
+                    if(iEMCallActivated) {
+                        TryExitL(EAknSoftkeyCancel);
+                    }
+                    else {
+                        iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
+                        iPrioritySet = ETrue;
+                    }
+                    break;
+                default:
+                    break;
+            }
+            break;
+        case CSCPLockObserver :: EInProgress:
+            Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): received call in progress event...")));
+            TryExitL(EAknSoftkeyCancel);
+            break;
+        case ESecUiDeviceLocked:
+            Dprint(_L("[CSCPQueryDialog]-> TryExitL 4"));
+            TryExitL(EAknSoftkeyCancel);
+            break;
+        case ESecUiNone:
+            Dprint(_L("[CSCPQueryDialog]-> TryExitL 5"));
+            TryExitL(EAknSoftkeyOk);
+            break;
+        default:
+            break;
     }
 	
-// Call from the SCPObserver
-	
-void CSCPQueryDialog::TryCancelQueryL(TInt aReason)
-    {
-    Dprint( (_L("CSCPQueryDialog::TryCancelQueryL()")) );
-    
-	if (EPSCTsyCallStateDisconnecting == aReason)
-	{
-	Dprint( (_L("CSCPQueryDialog::TryCancelQueryL() -SetOrdinalPosition ->0")) );
-	iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1);
-	iPrioritySet = ETrue;
-	}
-	else
-	{
-	Dprint( (_L("CSCPQueryDialog::TryExitL(EAknSoftkeyCancel)")) );
-    TryExitL(EAknSoftkeyCancel);
-	}
-    }
-
-    
+    Dprint( (_L("CSCPQueryDialog::TryCancelQueryL() <<<")) );
+}
 // End of file
-
--- a/terminalsecurity/SCP/SCPDatabase/group/SCPDatabase.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPDatabase/group/SCPDatabase.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -29,8 +29,9 @@
 USERINCLUDE		../inc
 USERINCLUDE		../../SCPServer/inc
 USERINCLUDE 		../../DmEventNotifier/inc
+SYSTEMINCLUDE		/epoc32/include
 
-MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
 SOURCEPATH	  	../src
 SOURCE		  	SCPParamDB.cpp SCPParamDBController.cpp
 
@@ -43,4 +44,6 @@
 LIBRARY		apgrfx.lib
 LIBRARY		apparc.lib
 
+SMPSAFE
+
 //End of file
--- a/terminalsecurity/SCP/SCPDatabase/src/SCPParamDB.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPDatabase/src/SCPParamDB.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -177,24 +177,24 @@
 
     __LEAVE_IF_ERROR(lDBView.Prepare(iParameterDB, TDbQuery(*lSelectQry)));
     __LEAVE_IF_ERROR(lDBView.EvaluateAll());
-    if( lDBView.FirstL())
-    {
-    	TInt lRowCount = lDBView.CountL();
+
+    lDBView.FirstL();
 
-    	if(lRowCount == 0) {
+    TInt lRowCount = lDBView.CountL();
+
+    if(lRowCount == 0) {
         _SCPDB_LOG(_L("[CSCPParamDB]-> No Rows found for this parameter"));
         CleanupStack :: PopAndDestroy(2);
         return KErrNotFound;
-    	}
-    	else if(lRowCount > 1) {
+    }
+    else if(lRowCount > 1) {
         _SCPDB_LOG(_L("[CSCPParamDB]-> ERROR: More than one record matches the criterion. Db is corrupt! Leaving..."));
         User :: Leave(KErrCorrupt);
-    	}
+    }
 
-    	lDBView.GetL();
-    	aApp = lDBView.ColInt(iColSet->ColNo(KColAppId));
-    	aValue = lDBView.ColInt(iColSet->ColNo(KColValueInt));
-    }
+    lDBView.GetL();
+    aApp = lDBView.ColInt(iColSet->ColNo(KColAppId));
+    aValue = lDBView.ColInt(iColSet->ColNo(KColValueInt));
     CleanupStack :: PopAndDestroy(2);
 
     _SCPDB_LOG(_L("[CSCPParamDB]-> GetValueForParameterL <<<"));
@@ -212,21 +212,21 @@
 
     __LEAVE_IF_ERROR(lDBView.Prepare(iParameterDB, TDbQuery(*lSelectQry)));
     __LEAVE_IF_ERROR(lDBView.EvaluateAll());
-    
-    if (lDBView.FirstL())
-    {
-    	TInt size(0);
-    	TInt lRowCount = lDBView.CountL();
+
+    lDBView.FirstL();
 
-    	if(lRowCount == 0) {
+    TInt size(0);
+    TInt lRowCount = lDBView.CountL();
+
+    if(lRowCount == 0) {
         _SCPDB_LOG(_L("[CSCPParamDB]-> No Rows found for this parameter"));
         CleanupStack :: PopAndDestroy(2);
         return KErrNotFound;
-    	}
+    }
     
-    	TInt lErr(KErrNone);
+    TInt lErr(KErrNone);
     
-    	do {
+    do {
         lDBView.GetL();
         size = lDBView.ColDes(iColSet->ColNo(KColValueDes)).Size();
 
@@ -242,9 +242,8 @@
                 User :: Leave(lErr);
             }
         }
-    	}
-    	while(lDBView.NextL());
     }
+    while(lDBView.NextL());
 
     CleanupStack :: PopAndDestroy(2);
     _SCPDB_LOG(_L("[CSCPParamDB]-> GetValuesForParameterL <<<"));
@@ -330,7 +329,7 @@
         _SCPDB_LOG(_L("[CSCPParamDB]-> WARNING: Nothing to do!!"));
         return KErrNone;  
     }
-    
+
     HBufC* lDelQuery(NULL);
     
     if(iParameterDB.InTransaction()) {
@@ -415,7 +414,7 @@
 
 TInt CSCPParamDB :: DropValuesL(TInt aParamID, const TInt32 aApp) {
     _SCPDB_LOG(_L("[CSCPParamDB]-> DropValuesL() >>>"));
-    
+
     HBufC* lDelQuery(NULL);
     
     if(iParameterDB.InTransaction()) {
--- a/terminalsecurity/SCP/SCPDatabase/src/SCPParamDBController.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPDatabase/src/SCPParamDBController.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -45,7 +45,6 @@
         TInt lVal = KErrNone;
     	TInt err_val = centrep->Get(KDmEventNotifierEnabled, lVal);
     	
-#ifndef __WINS__
         _SCPDB_LOG(_L("[CSCPParamDBController]-> ConstructL(): cenrep KDmEventNotifierEnabled value:  %d "), lVal);
         if(err_val == KErrNone && 0 == lVal) {
             _SCPDB_LOG(_L("[CSCPParamDBController]-> ConstructL(): RApaLsSession connection >>> "));
@@ -57,7 +56,7 @@
             _SCPDB_LOG(_L("[CSCPParamDBController]-> ConstructL(): run dmeventnotifier.exe "));
             //apaLsSession.GetAppInfo(appInfo, aUid); Required only if handle is registered through _reg file.
             #if defined (__WINS__) // ifdef (__WINSCW__)
-            _LIT(KExampleTaskHandlerExe, "dmeventnotifier.exe");
+            _LIT(KExampleTaskHandlerExe, "C:\\sys\\bin\\dmeventnotifier.exe");
             #else
             _LIT(KExampleTaskHandlerExe, "Z:\\Sys\\Bin\\dmeventnotifier.exe");            
             #endif
@@ -74,7 +73,6 @@
             apaLsSession.Close();
             _SCPDB_LOG(_L("[CSCPParamDBController]-> ConstructL(): started dmeventnotifier.exe successfully"));
         }
-#endif
     }
     _SCPDB_LOG(_L("[CSCPParamDBController]-> ConstructL(): Checking KAppUidDmEventNotifier cenrep completed "));
 
@@ -108,6 +106,7 @@
 
 EXPORT_C TInt CSCPParamDBController :: SetValueL(TInt aParamID, const TInt32 aValue, const TInt32 aApp) {
     switch(aParamID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
         case RTerminalControl3rdPartySession :: EMaxTimeout:
         case RTerminalControl3rdPartySession :: EPasscodeMinLength:
         case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
@@ -148,6 +147,7 @@
 
 EXPORT_C TInt CSCPParamDBController :: GetValueL(TInt aParamID, TInt32& aValue, TInt32& aApp) {
     switch(aParamID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
         case RTerminalControl3rdPartySession :: EMaxTimeout:
         case RTerminalControl3rdPartySession :: EPasscodeMinLength:
         case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
@@ -192,6 +192,7 @@
 
 EXPORT_C TInt CSCPParamDBController :: DropValuesL(TInt aParamID, const TInt32 aApp) {
     switch(aParamID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
     case RTerminalControl3rdPartySession :: EMaxTimeout:
     case RTerminalControl3rdPartySession :: EPasscodeMinLength:
     case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
@@ -218,6 +219,7 @@
 
 EXPORT_C TInt CSCPParamDBController :: DropValuesL(TInt aParamID, RPointerArray <HBufC>& aParamValues, const TInt32 aApp) {
     switch(aParamID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
     case RTerminalControl3rdPartySession :: EMaxTimeout:
     case RTerminalControl3rdPartySession :: EPasscodeMinLength:
     case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
--- a/terminalsecurity/SCP/SCPEventHandler/group/SCPEventHandler.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPEventHandler/group/SCPEventHandler.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -51,4 +51,5 @@
 LIBRARY 	siscontroller.lib
 //LIBRARY	javaregistryclient.lib
 
+SMPSAFE
 
--- a/terminalsecurity/SCP/SCPHistoryPlugin/group/SCPHistoryPlugin.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPHistoryPlugin/group/SCPHistoryPlugin.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -68,4 +68,7 @@
 LIBRARY			efsrv.lib			// FileServer
 LIBRARY					flogger.lib
 LIBRARY                 featmgr.lib
+
+SMPSAFE
+
 // End of File
--- a/terminalsecurity/SCP/SCPHistoryPlugin/inc/SCPHistoryPlugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPHistoryPlugin/inc/SCPHistoryPlugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -70,7 +70,7 @@
         /**
         * Event handler...
         */		
-		void HandleEventL( TInt aID, CSCPParamObject& aInParam , CSCPParamObject& aOutParam);
+		CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam );
 		
 		void SetEventHandler( MSCPPluginEventHandler* aHandler );
 
--- a/terminalsecurity/SCP/SCPHistoryPlugin/inc/SCPSpecificStringsPlugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPHistoryPlugin/inc/SCPSpecificStringsPlugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -67,7 +67,7 @@
         /**
         * Event handler...
         */		
-		void HandleEventL( TInt aID, CSCPParamObject& aParam,CSCPParamObject& aOutParam );
+		CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam );
 		
 		void SetEventHandler( MSCPPluginEventHandler* aHandler );
 
--- a/terminalsecurity/SCP/SCPHistoryPlugin/src/SCPHistoryPlugin.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPHistoryPlugin/src/SCPHistoryPlugin.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -23,9 +23,9 @@
 #include <SCPParamObject.h>
 
 #include "SCPHistoryPlugin.h"
-#include <scphistorypluginlang.rsg>
+#include <SCPHistoryPluginLang.rsg>
 #include "SCP_IDs.h"
-#include <SCPServerInterface.h>
+
 
 // ============================= LOCAL FUNCTIONS  =============================
 
@@ -84,240 +84,342 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //    
-void CSCPHistoryPlugin :: HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam)
-	{				
-	Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent()" ) ) );
-	
-	if ( iFs == NULL )
-	    {
-	    return ; // Eventhandler not available
-	    }	
-		// check for Case
-		
-	switch ( aID )
+CSCPParamObject* CSCPHistoryPlugin::HandleEvent(TInt aID,
+        CSCPParamObject& aParam)
+    {
+    Dprint((_L("CSCPHistoryPlugin::HandleEvent()")));
+    // Make the ParamObject for success ack, Delete later
+    CSCPParamObject* retParams = NULL;
+
+    TBool errRaised;
+    errRaised = EFalse;
+
+    TBool isInvalid = EFalse;
+
+    if (iFs == NULL)
+        {
+        return NULL; // Eventhandler not available
+        }
+
+    // check for Case
+    switch (aID)
         {
 
-        case ( KSCPEventValidate ) :
-            {            
-           	// Obtain the paramValue
-           	Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventValidate" ) ) );
-			TInt passhistoryParamValue;
-			passhistoryParamValue = GetHistoryCountParamValue();
-			Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent passhistoryParamValue = %d" ), passhistoryParamValue ) );
-			// if all required bounds are zero, there is nothing to do.
-			if ( passhistoryParamValue != 0)
-			    {
-				// Get the configFile's path.
-				// If this fails, there is something badly wrong(Private folder is not there)
-				TInt errSCF = SetConfigFile ();
-				if (errSCF != KErrNone)
-				{
-					break; // Break out from Case
-				}
+        case (KSCPEventValidate):
+            {
+            // Obtain the paramValue
+            Dprint((_L("CSCPHistoryPlugin::KSCPEventValidate")));
+            TInt passhistoryParamValue;
+            passhistoryParamValue = GetHistoryCountParamValue();
+            Dprint(
+                    (_L(
+                            "CSCPHistoryPlugin::HandleEvent passhistoryParamValue = %d"), passhistoryParamValue));
+            // if all required bounds are zero, there is nothing to do.
+            if (passhistoryParamValue != 0)
+                {
+                // Get the configFile's path.
+                // If this fails, there is something badly wrong(Private folder is not there)
+                TInt errSCF = SetConfigFile();
+                if (errSCF != KErrNone)
+                    {
+                    errRaised = ETrue;
+                    break; // Break out from Case
+                    }
+
+                // Get the historyItemCount, If the err is raised, the file is not there
+                // This will lead to KSCPEventPasswordChanged event and new history file will
+                // be created
+                TInt historyItemCounter;
+                TInt errHC = GetHistoryItemCount(historyItemCounter);
+                Dprint(
+                        (_L(
+                                "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d"), historyItemCounter));
+                if (errHC != KErrNone)
+                    {
+                    errRaised = ETrue;
+                    break; // Break out from Case
+                    }
 
-				// Get the historyItemCount, If the err is raised, the file is not there
-				// This will lead to KSCPEventPasswordChanged event and new history file will
-				// be created
-				TInt historyItemCounter;
-				TInt errHC = GetHistoryItemCount( historyItemCounter );
-				Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d" ), historyItemCounter ) );
-				if (errHC != KErrNone)
-				{
-					break; // Break out from Case
-				}
+                // continue with the KSCPEventValidate Check
+
+                // Get the password from the paramObject
+                TBuf<KSCPPasscodeMaxLength> seccode;
+                if (aParam.Get(KSCPParamPassword, seccode) != KErrNone)
+                    {
+                    // Nothing to do anymore
+                    Dprint(
+                            (_L(
+                                    "CSCPHistoryPlugin::HandleEvent()\
+					ERROR: KSCPEventValidate/KSCPParamPassword is != KErrNone")));
+                    errRaised = ETrue;
+                    break; // Break out from Case
+                    }
 
-				// continue with the KSCPEventValidate Check
+                // Hash  the securitycode	
+                TBuf<KSCPPasscodeMaxLength> securityhash;
+                iEventHandler->HashInput(seccode, securityhash);
+
+                // get history
+                CDesCArrayFlat* array = NULL;
+                TInt errGH = KErrNone;
+
+                array = new CDesCArrayFlat(1);
+                if (array != NULL)
+                    {
+                    TRAPD(err2, errGH = GetHistoryArrayL(*array));
+                    if (err2 != KErrNone)
+                        {
+                        errGH = err2;
+                        }
+                    }
+                else
+                    {
+                    errGH = KErrNoMemory;
+                    }
 
-				// Get the password from the paramObject
-				TBuf<KSCPPasscodeMaxLength> seccode;
-				if ( aParam.Get( KSCPParamPassword, seccode ) != KErrNone )
-				{
-					// Nothing to do anymore
-					Dprint( (_L("CSCPHistoryPlugin::HandleEvent()\
-					ERROR: KSCPEventValidate/KSCPParamPassword is != KErrNone") ));
-					break; // Break out from Case
-				}            
-				
-				// Hash  the securitycode	
-				TBuf<KSCPPasscodeMaxLength> securityhash;
-				iEventHandler->HashInput(seccode,securityhash);
-			
-				// get history
-				CDesCArrayFlat* array = NULL;
-				TInt errGH = KErrNone;
-				
-				array = new CDesCArrayFlat(1);			
-				if ( array != NULL )
-				    {
-				    TRAPD( err2, errGH = GetHistoryArrayL( *array ) );
-				    if ( err2 != KErrNone )
-				        {
-				        errGH = err2;
-				        }
-				    }
-				else
-				    {
-				    errGH = KErrNoMemory;
-				    }
-			
-				// If for some reason err is raised, break out
-				// If the Historyonfig file get deleted on the fly ex
-				if (errGH != KErrNone)
-				    {
-					array->Reset();
-					delete array;
-					break; // Break out from Case
-				    }
-				TInt correction;
-				correction = 0;
+                // If for some reason err is raised, break out
+                // If the Historyonfig file get deleted on the fly ex
+                if (errGH != KErrNone)
+                    {
+                    errRaised = ETrue;
+                    array->Reset();
+                    delete array;
+                    break; // Break out from Case
+                    }
+                TInt correction;
+                correction = 0;
+
+                if (array->Count() >= passhistoryParamValue)
+                    {
+                    correction = array->Count() - passhistoryParamValue;
+                    }
+                // check for match
+                TBuf<KSCPPasscodeMaxLength> arrayItem;
+
+                // Set the historyobject
+                for (TInt i = 0 + correction; i < array->Count(); i++)
+                    {
+                    arrayItem = array->MdcaPoint(i);
+                    if (arrayItem.Compare(securityhash) == KErrNone)
+                        {
+                        // Get the filesystem for Resource
+                        // If fail, bail out
+                        TInt errgGR = GetResource();
+                        if (errgGR != KErrNone)
+                            {
+                            errRaised = ETrue;
+                            break; // Break out from the For
+                            }
+
+                        // Prompt buf, iNote can show only 97 chars,
+                        // without ... markings.
+                        HBufC* hbuf = NULL;
 
-				if ( array->Count() >=  passhistoryParamValue )
-                {
-                    correction =  array->Count() - passhistoryParamValue;
-                }
-				// check for match
-				TBuf<KSCPPasscodeMaxLength> arrayItem;
-				
-				// Set the historyobject
-				for (TInt i= 0 + correction; i < array->Count(); i++)
-				    {
-					arrayItem =  array->MdcaPoint(i);
-					if (arrayItem.Compare(securityhash) == KErrNone)
-					    {
-                            aOutParam.Set( KSCPParamStatus, KErrSCPInvalidCode );
-                            Dprint ( ( _L( "EDeviceLockHistoryBuffer Failed" ) ) );
-                            aOutParam.AddtoFailedPolices(EDeviceLockHistoryBuffer);
+                        if (passhistoryParamValue == 1)
+                            {
+                            isInvalid = ETrue;
+TRAP_IGNORE                            (
+                                    hbuf = LoadAndFormatResL( R_SET_SEC_CODE_INFO_PREVIOUS );
+                            );
+                            }
+                        else
+                            {
+                            isInvalid = ETrue;
+                            TRAP_IGNORE(
+                                    hbuf = LoadAndFormatResL(
+                                            R_SET_SEC_CODE_INFO_CHECK,
+                                            &passhistoryParamValue );
+                            );
+                            }
+
+                        if ( isInvalid )
+                            {
+                            // Create the result-object to return
+                            TRAPD( err, retParams = CSCPParamObject::NewL() );
+
+                            if ( err == KErrNone )
+                                {
+                                retParams->Set( KSCPParamStatus, KErrSCPInvalidCode );
+                                retParams->Set( KSCPParamAction, KSCPActionShowUI );
+                                retParams->Set( KSCPParamUIMode, KSCPUINote );
+
+                                if ( hbuf != NULL )
+                                    {
+                                    TPtr ptr = hbuf->Des();
+                                    retParams->Set( KSCPParamPromptText, ptr );
+                                    delete hbuf;
+                                    }
+                                }
+
                             break;
+                            }
+
                         } // End of compare IF
                     } // End of For
-					
+
                 // kill the local
                 array->Reset();
                 delete array;
 
                 } // passhistoryParamValue
+
+            else
+                {
+                retParams = NULL;
+                }
+
             break;
             } // end of KSCPEventValidate
+
         // Someone has changed the Seccode and I need to include it to history
-         case ( KSCPEventPasswordChanged ) :
-			{																
-			// Get the configFile's path.
-			Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventPasswordChanged" ) ) );
-			TInt errSCF = SetConfigFile ();
-			if (errSCF != KErrNone)
-			    {
-				break; // Break out from the case
-			    }
-			
-			// Get the password from the paramObject
-     		TBuf<KSCPPasscodeMaxLength> securitycode;
+        case ( KSCPEventPasswordChanged ) :
+            {
+            // Get the configFile's path.
+            Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventPasswordChanged" ) ) );
+            TInt errSCF = SetConfigFile ();
+            if (errSCF != KErrNone)
+                {
+                errRaised = ETrue;
+                break; // Break out from the case
+                }
+
+            // Get the password from the paramObject
+            TBuf<KSCPPasscodeMaxLength> securitycode;
             if ( aParam.Get( KSCPParamPassword, securitycode ) != KErrNone )
                 {
-            	// Nothing to do anymore
-               	Dprint( (_L("CSCPHistoryPlugin::HandleEvent()\
+                // Nothing to do anymore
+                Dprint( (_L("CSCPHistoryPlugin::HandleEvent()\
                	ERROR: KSCPEventPasswordChanged/KSCPParamPassword is  != KErrNone") ));
-				break; // Break out from the Case
-                }          
+                errRaised = ETrue;
+                break; // Break out from the Case
+                }
 
-			// Hash  the securitycode	
-			TBuf<KSCPPasscodeMaxLength> securityhash;
-			iEventHandler->HashInput(securitycode,securityhash);
+            // Hash  the securitycode	
+            TBuf<KSCPPasscodeMaxLength> securityhash;
+            iEventHandler->HashInput(securitycode,securityhash);
 
-			// Get the historyItemCount, If error occures, File is not there yet, Make one
-			TInt historyItemCounter;
-			TInt errHC = GetHistoryItemCount( historyItemCounter );
-			Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d" ), historyItemCounter ) );
-			if (errHC != KErrNone)
-			    {
-				// The file does not exist yet (should not happen)
-				// Make the ParamObject,  Set the New historyData with count of 1
-				CSCPParamObject* historyObject = NULL;
-				TRAPD( err, historyObject = CSCPParamObject::NewL() );
-		 		if ( err == KErrNone )
-		 		    {
-			 		historyObject->Set(KHistoryCounterParamID,1);
-    				historyObject->Set(KHistoryItemParamBase,securityhash );
-                    
+            // Get the historyItemCount, If error occures, File is not there yet, Make one
+            TInt historyItemCounter;
+            TInt errHC = GetHistoryItemCount( historyItemCounter );
+            Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d" ), historyItemCounter ) );
+            if (errHC != KErrNone)
+                {
+                // The file does not exist yet (should not happen)
+                // Make the ParamObject,  Set the New historyData with count of 1
+                CSCPParamObject* historyObject = NULL;
+                TRAPD( err, historyObject = CSCPParamObject::NewL() );
+                if ( err == KErrNone )
+                    {
+                    historyObject->Set(KHistoryCounterParamID,1);
+                    historyObject->Set(KHistoryItemParamBase,securityhash );
+
                     TRAPD( errWC, historyObject->WriteToFileL( iCfgFilenamepath, iFs ) );
-					if ( errWC != KErrNone )
-    					{
-						Dprint( (_L("CSCPHistoryPlugin::HandleEvent(): WARNING:\
+                    if ( errWC != KErrNone )
+                        {
+                        Dprint( (_L("CSCPHistoryPlugin::HandleEvent(): WARNING:\
 						failed to write plugin configuration: %d"), errWC ));
-						break; // Break out from the Case
-	    				}
-					delete historyObject;
-		 		    }
-			    }
-			// There are passwords avail.
-			else
-			    {
-				// Append the new passwords
-				TInt err = KErrNone;
-				TRAPD( err2, err = AppendAndWriteSecurityCodeL( securityhash  ) );
-				if ( ( err != KErrNone ) || ( err2 != KErrNone ) )
-				    {
-					break; // Break out from the Case						
-				    }										
-			    }    					
-			break;
-			} // end of KSCPEventPasswordChanged
-          
-    	case ( KSCPEventConfigurationQuery ):
-            {            
+                        errRaised = ETrue;
+                        break; // Break out from the Case
+                        }
+                    delete historyObject;
+                    }
+                }
+            // There are passwords avail.
+
+            else
+                {
+                // Append the new passwords
+                TInt err = KErrNone;
+                TRAPD( err2, err = AppendAndWriteSecurityCodeL( securityhash ) );
+                if ( ( err != KErrNone ) || ( err2 != KErrNone ) )
+                    {
+                    errRaised = ETrue;
+                    break; // Break out from the Case						
+                    }
+                }
+            break;
+            } // end of KSCPEventPasswordChanged
+
+        case ( KSCPEventConfigurationQuery ):
+            {
             Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventConfigurationQuery" ) ) );
-        	TInt paramID = -1; 
+            TInt paramID = -1;
             // Get the ID from the paramObject      
             if ( aParam.Get( KSCPParamID, paramID ) != KErrNone )
                 {
                 // Nothing to do anymore
                 break;
-                }            
-                    
+                }
+
             // 1011
             if ( paramID == (RTerminalControl3rdPartySession::EPasscodeHistoryBuffer))
                 {
-				// All of our params are TInts
-				TInt paramValue;
-				if ( aParam.Get( KSCPParamValue, paramValue ) != KErrNone )
-				    {
-					aOutParam.Set( KSCPParamStatus, KErrGeneral );
-					break;
-				    }
-            	            
-					TInt retStatus = KErrNone;
-					switch ( paramID )
-					    {
-				
-						case ( RTerminalControl3rdPartySession::EPasscodeHistoryBuffer ):
-						    {
-							// Bounds are be be
-							if ( ( paramValue < KPasscodeHistoryBufferMinValue ) 
-							|| ( paramValue > KPasscodeHistoryBufferMaxValue ) )                                 
-							    {
-								// This is not a valid valuerange
-								retStatus = KErrArgument;
-						        }     
-							           
-						    break;				
-						    } // end of case EPasscodeHistoryBuffer
-					    } // end of switch ( paramID )
-								
-			        aOutParam.Set( KSCPParamStatus, retStatus );
+                // OK, we're interested, check that the value is valid
+                TRAPD( err, retParams = CSCPParamObject::NewL() );
+                if ( err != KErrNone )
+                    {
+                    break; // Nothing we can do
+                    }
+
+                // All of our params are TInts
+                TInt paramValue;
+                if ( aParam.Get( KSCPParamValue, paramValue ) != KErrNone )
+                    {
+                    retParams->Set( KSCPParamStatus, KErrGeneral );
+                    break;
                     }
-			 break;	            
-	         } //End of KSCPEventConfigurationQuery Case
-            
-            
-          case ( KSCPEventReset ):
-              {
-              Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventReset" ) ) );
-              // Reset the configuration for this plugin.
-              TRAP_IGNORE( FlushConfigFileL() );
-              
-              break;
-              }
-                          
-          } // End of  switch ( aID )
+
+                TInt retStatus = KErrNone;
+                switch ( paramID )
+                    {
+
+                    case ( RTerminalControl3rdPartySession::EPasscodeHistoryBuffer ):
+                        {
+                        // Bounds are be be
+                        if ( ( paramValue < KPasscodeHistoryBufferMinValue )
+                                || ( paramValue > KPasscodeHistoryBufferMaxValue ) )
+                            {
+                            // This is not a valid valuerange
+                            retStatus = KErrArgument;
+                            }
+
+                        break;
+                        } // end of case EPasscodeHistoryBuffer
+                    } // end of switch ( paramID )
+
+                retParams->Set( KSCPParamStatus, retStatus );
+                }
+            else
+                {
+                retParams = NULL;
+                }
+
+            break;
+            } //End of KSCPEventConfigurationQuery Case
+
+
+        case ( KSCPEventReset ):
+            {
+            Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventReset" ) ) );
+            // Reset the configuration for this plugin.
+            TRAP_IGNORE( FlushConfigFileL() );
+
+            break;
+            }
+
+        } // End of  switch ( aID )
+
+    // Check if Any errors were raised and handle it
+    if (errRaised)
+        {
+        if ( retParams != NULL )
+            {
+            delete retParams;
+            }
+        retParams = NULL;
+        }
+
+    return retParams;
     }
 
 // ----------------------------------------------------------------------------
@@ -561,6 +663,57 @@
     }
 
 // ----------------------------------------------------------------------------
+// CSCPHistoryPlugin::GetResource
+// GetResource
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+
+TInt CSCPHistoryPlugin::GetResource()
+    {
+ 	Dprint( (_L("CSCPSpecificStringsPlugin::GetResource()") ));
+	// The resource has to be loaded manually since it is not an application.
+          	
+	TFileName resourceFile;
+	resourceFile.Append( KDriveZ );
+	resourceFile.Append( SCPHistoryPluginSrcFile );
+	BaflUtils::NearestLanguageFile( *iFs, resourceFile );
+	TRAPD( err, iRf.OpenL( *iFs, resourceFile ) );
+
+	if ( err == KErrNone )
+	    {
+		TRAP( err, iRf.ConfirmSignatureL() );
+    	}          
+    
+    return err;       
+    }
+
+
+// ----------------------------------------------------------------------------
+// CSCPHistoryPlugin::LoadResourceLC
+// GetResource
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC16* CSCPHistoryPlugin::LoadResourceLC ( TInt aResId )
+    {
+	Dprint( (_L("CSCPHistoryPlugin::LoadResourceLC()") ));
+
+	// load the actual resource
+    HBufC8* readBuffer = iRf.AllocReadLC( aResId );
+    // as we are expecting HBufC16...
+    const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(),
+                                 ( readBuffer->Length() + 1 ) >> 1 );
+                                 
+    HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() );    
+    *textBuffer=ptrReadBuffer;
+    CleanupStack::PopAndDestroy( readBuffer ); // readBuffer
+    CleanupStack::PushL( textBuffer );
+  	return textBuffer;
+    }
+
+
+// ----------------------------------------------------------------------------
 // CSCPHistoryPlugin::FlushConfigFile
 // Remove all the other passwords from the file, except the last one (current)
 // 
@@ -609,5 +762,97 @@
 	CleanupStack::PopAndDestroy( historyObject );
 	
 	return err;			
-    } 
+    }
+
+
+// ----------------------------------------------------------------------------
+// CSCPHistoryPlugin::LoadAndFormatResL
+// Load the given resouce, and format the string according to the TInt parameters
+// if given.
+// 
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC* CSCPHistoryPlugin::LoadAndFormatResL( TInt aResId, TInt* aParam1, TInt* aParam2 )
+    {
+    Dprint ( ( _L( "CSCPHistoryPlugin::LoadAndFormatResL()" ) ) );
+    HBufC16* resource = NULL;
+    HBufC* hbuf = NULL;
+    
+    resource = LoadResourceLC( aResId );
+    FormatResourceString (*resource);
+    TInt allocLen = 0;
+    if ( aParam1 != NULL )
+        {
+        allocLen += KSCPMaxIntLength;
+        }
+    if ( aParam2 != NULL )
+        {
+        allocLen += KSCPMaxIntLength;
+        }
+                
+	hbuf = HBufC::NewL( resource->Length() + allocLen );
+	
+	if ( ( aParam1 == NULL ) && ( aParam2 == NULL ) )
+	    {
+	    hbuf->Des().Copy( resource->Des() );
+	    }
+	else
+	    {
+	    if ( aParam1 == NULL )
+	        {
+	        hbuf->Des().Format( resource->Des(), *aParam2 );
+	        }
+	    else if ( aParam2 == NULL )
+	        {
+	        hbuf->Des().Format(resource->Des(), *aParam1 );
+	        }
+	    else
+	        {
+	        hbuf->Des().Format(resource->Des(), *aParam1, *aParam2 );
+	        }	    
+	    }
+								    
+	CleanupStack::PopAndDestroy( resource );
+	return hbuf;
+    }
+
+// ----------------------------------------------------------------------------
+// CSCPHistoryPlugin::FormatResourceString
+// The buffer that is passed is formatted to have only %i as a format specifier instead of %N or %0N etc.
+// 
+// Status : Approved
+// ----------------------------------------------------------------------------
+//  
+void CSCPHistoryPlugin::FormatResourceString(HBufC16 &aResStr)
+{
+		TInt pos = 0;
+		TInt flag = 0;
+        TPtr16 bufPtr = aResStr.Des();
+        _LIT (mess1, "%N");
+        _LIT (mess2, "%i");
+        _LIT (mess3, "%0N");
+        _LIT (mess4, "%1N");
+                              
+        while ((pos = bufPtr.Find(mess1)) !=KErrNotFound)
+        {
+              bufPtr.Replace(pos,2,mess2); 
+              flag = 1;
+              break;                    
+        }
+               
+        if(flag == 0)
+        {
+              while ((pos = bufPtr.Find(mess3)) != KErrNotFound)
+              {
+              		bufPtr.Replace(pos,3,mess2);
+              }
+               		
+              while ((pos = bufPtr.Find(mess4)) != KErrNotFound)
+              {
+                	bufPtr.Replace(pos,3,mess2);
+              }
+        }	
+}
+  
 // End of File
--- a/terminalsecurity/SCP/SCPHistoryPlugin/src/SCPSpecificStringsPlugin.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPHistoryPlugin/src/SCPSpecificStringsPlugin.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -23,10 +23,10 @@
 #include <SCPParamObject.h>
 
 #include "SCPSpecificStringsPlugin.h"
-#include <scphistorypluginlang.rsg>
+#include <SCPHistoryPluginLang.rsg>
 #include "SCP_IDs.h"
 #include <featmgr.h>
-#include <SCPServerInterface.h>
+
 // ============================= LOCAL FUNCTIONS  =============================
 
 // ============================= MEMBER FUNCTIONS =============================
@@ -90,12 +90,18 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //    
-void CSCPSpecificStringsPlugin :: HandleEventL( TInt aID, CSCPParamObject& aParam,CSCPParamObject& aOutParam )
+CSCPParamObject* CSCPSpecificStringsPlugin::HandleEvent( TInt aID, CSCPParamObject& aParam )
 	{	
+	
+	// Make the ParamObject for success ack, Delete later
+	CSCPParamObject* retParams = NULL;
+
+	TBool errRaised;
+	errRaised = EFalse;
 		
 	if ( iFs == NULL )
 	    {
-	    User::Leave(KErrGeneral);
+	    return NULL; // Eventhandler not available
 	    }
 
 	// check for Case
@@ -122,6 +128,7 @@
 				TInt errSCF = SetConfigFile ();
 				if (errSCF != KErrNone)
 				    {
+					errRaised = ETrue;
 					break; // Break out from Case!
 				    }
 			 	
@@ -132,6 +139,7 @@
                 	// Nothing to do anymore
                    	Dprint( (_L("CSCPSpecificStringsPlugin::HandleEvent()\
                    	ERROR: KSCPEventPasswordChanged/KSCPParamPassword is  != KErrNone") ));
+                	errRaised = ETrue;
 					break; // Break out from the Case!;
                     }			 	
 			 	
@@ -140,16 +148,47 @@
 			 	TInt errCSS = CheckSpecificStrings ( securitycode, forbiddensecuritycode );
 			 	if (errCSS != KErrNone)
 				    {
+					errRaised = ETrue;
 					break; // Break out from Case!
     				}
 			 	
 			 	if ( forbiddensecuritycode )
 			    	{
-			    	    aOutParam.Set( KSCPParamStatus, KErrSCPInvalidCode );
-			    	    Dprint ( ( _L( "EDeviceLockDisallowSpecificStrings Failed" ) ) );
-			    	    aOutParam.AddtoFailedPolices(EDeviceLockDisallowSpecificStrings);
-			 	    }			 	    		
+			 		// Word was blacklisted!
+					// Get the filesystem for Resource
+					// If fail, bail out!
+					TInt errgGR = GetResource();
+					if (errgGR != KErrNone)
+					    {
+						errRaised = ETrue;
+						break; // Break out from the For!
+					    }
+			 	
+			 		// Prompt buf, iNote can show only 97 chars,
+					// without ... markings.
+					HBufC* hbuf = NULL;
 					
+					TRAP_IGNORE(
+					    hbuf = LoadAndFormatResL( R_SET_SEC_CODE_PERSONAL );
+		                );		                
+
+                    // Create the result-object to return
+				    TRAPD( err, retParams  = CSCPParamObject::NewL() );
+                    
+                    if ( err == KErrNone )
+				        {
+			            retParams->Set( KSCPParamStatus, KErrSCPInvalidCode );
+    		            retParams->Set( KSCPParamAction, KSCPActionShowUI );
+	    	            retParams->Set( KSCPParamUIMode, KSCPUINote );
+		                
+		                if ( hbuf != NULL )
+		                    {
+		                    TPtr ptr = hbuf->Des();
+		                    retParams->Set( KSCPParamPromptText, ptr );
+		                    delete hbuf;
+		                    }
+				        }    					        
+			 	    }			 	    		 	
 			    } // end of specificstringscheck
 
 			break;
@@ -173,9 +212,18 @@
 				||  ( paramID ==  RTerminalControl3rdPartySession::EPasscodeAllowSpecific)
 				||  ( paramID ==  RTerminalControl3rdPartySession::EPasscodeClearSpecificStrings) )
 			    {
+	            TRAPD( err, retParams  = CSCPParamObject::NewL() );
+	            if ( err == KErrNone )
+	                {
 	                Dprint ( ( _L( "CSCPSpecificStringsPlugin::HandleEvent():\
 	                    Get not supported for %d" ), paramID ) );
-	                aOutParam.Set( KSCPParamStatus, KErrNotSupported );
+	                retParams->Set( KSCPParamStatus, KErrNotSupported );
+	                }
+	            else
+	                {
+	                Dprint ( ( _L( "CSCPSpecificStringsPlugin::HandleEvent():\
+	                    ERROR: Cannot create paramObject" ) ) );
+	                }
 	            }
 	        break;
 	        }
@@ -196,14 +244,21 @@
 				||  paramID ==  (RTerminalControl3rdPartySession::EPasscodeDisallowSpecific)
 				||  paramID ==  (RTerminalControl3rdPartySession::EPasscodeAllowSpecific)
 				||  paramID ==  (RTerminalControl3rdPartySession::EPasscodeClearSpecificStrings) )
-			    {
+			    {						
+				// OK, we're interested
+                TRAPD( err, retParams  = CSCPParamObject::NewL() );
+                if ( err != KErrNone )
+                    {
+                    break; // Nothing we can do now
+                    }
+                                
 				TInt retStatus = KErrNone;
 				
 			    if ( paramID != RTerminalControl3rdPartySession::EPasscodeCheckSpecificStrings )
 			        {
         		    // Set the storage attribute, so the server won't save the value,
         		    // we'll do it ourselves.
-        			aOutParam.Set( KSCPParamStorage, KSCPStoragePrivate );			        
+        			retParams->Set( KSCPParamStorage, KSCPStoragePrivate );			        
 			        }
 
 				switch ( paramID )
@@ -267,7 +322,9 @@
 							    {
 								retStatus = KErrArgument;
 								break; // from case!
-							    }	
+							    }
+	
+							errRaised = ETrue;
 							break; // Break out.
 						    } 
 					    break;
@@ -325,6 +382,7 @@
 								break; // from case!
 							    }
 	
+							errRaised = ETrue;
 							break; // Break out.
 						    } 												
 						
@@ -334,14 +392,29 @@
 					case ( RTerminalControl3rdPartySession::EPasscodeClearSpecificStrings ):
 					    {					
 						// 1018, Flush the config file
-
-					    TRAP_IGNORE( FlushConfigFileL() );
+						TInt paramValue;
+						if ( (aParam.Get( KSCPParamValue, paramValue ) != KErrNone) ||
+							 ( paramValue < 0 ) || 	( paramValue > 1 ) )
+						    {
+                            retStatus = KErrArgument;
+						    }						     
+						
+						if (paramValue == 1 && retStatus == KErrNone) 
+						    {
+						    TRAP_IGNORE( FlushConfigFileL() );
+						    }
+						    
 						break;
 					    }							
     				} // End of switch                          
 
-				aOutParam.Set( KSCPParamStatus, retStatus );
+				retParams->Set( KSCPParamStatus, retStatus );
 			    }
+			else
+			    {
+				retParams = NULL;
+			    }		
+		         
 			break;
 		    } //End of KSCPEventConfigurationQuery Case
 
@@ -354,6 +427,18 @@
               }
 
 	} // End of  switch ( aID )
+
+	// Check if Any errors were raised and handle it
+	if (errRaised) 
+        {
+        if ( retParams != NULL )
+            {
+            delete retParams;
+            }
+        retParams = NULL;
+        }
+
+	return retParams; 
 	}
 
 // ----------------------------------------------------------------------------
@@ -385,6 +470,60 @@
 	return;
     }
 
+
+
+// ----------------------------------------------------------------------------
+// CSCPSpecificStringsPlugin::GetResource
+// GetResource
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+
+TInt CSCPSpecificStringsPlugin::GetResource()
+    {   
+ 	Dprint( (_L("CSCPSpecificStringsPlugin::GetResource()") ));
+	// The resource has to be loaded manually since it is not an application.
+    
+	TFileName resourceFile;
+	resourceFile.Append( KDriveZSpecific );
+	resourceFile.Append( SCPSpecificStringsPluginSrcFile );
+	BaflUtils::NearestLanguageFile( *iFs, resourceFile );
+	TRAPD( err, iRf.OpenL( *iFs, resourceFile ) );
+
+	if ( err == KErrNone )
+	    {
+		TRAP( err, iRf.ConfirmSignatureL() );
+	    }          
+ 
+    return err;       
+    }
+
+
+// ----------------------------------------------------------------------------
+// CSCPSpecificStringsPlugin::LoadResourceLC
+// GetResource
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC16* CSCPSpecificStringsPlugin::LoadResourceLC ( TInt aResId )
+    {
+	Dprint( (_L("CSCPSpecificStringsPlugin::LoadResourceLC()") ));
+
+	// load the actual resource
+     HBufC8* readBuffer = iRf.AllocReadLC( aResId );
+    // as we are expecting HBufC16...
+     const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(),
+                                 ( readBuffer->Length() + 1 ) >> 1 );
+    HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() );    
+    *textBuffer=ptrReadBuffer;
+    CleanupStack::PopAndDestroy( readBuffer ); // readBuffer
+    CleanupStack::PushL( textBuffer );
+  	return textBuffer;
+    }
+
+
+
+
 // ----------------------------------------------------------------------------
 // CSCPSpecificStringsPlugin::SetConfigFile
 // SetConfigFile
@@ -858,4 +997,55 @@
 	return err;
     }
     
+    
+// ----------------------------------------------------------------------------
+// CSCPSpecificStringsPlugin::LoadAndFormatResL
+// Load the given resouce, and format the string according to the TInt parameters
+// if given.
+// 
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC* CSCPSpecificStringsPlugin::LoadAndFormatResL( TInt aResId, TInt* aParam1, TInt* aParam2 )
+    {
+    HBufC16* resource = NULL;
+    HBufC* hbuf = NULL;
+    
+    resource = LoadResourceLC( aResId );
+    TInt allocLen = 0;
+    if ( aParam1 != NULL )
+        {
+        allocLen += KSCPMaxIntLength;
+        }
+    if ( aParam2 != NULL )
+        {
+        allocLen += KSCPMaxIntLength;
+        }
+                
+	hbuf = HBufC::NewL( resource->Length() + allocLen );
+	
+	if ( ( aParam1 == NULL ) && ( aParam2 == NULL ) )
+	    {
+	    hbuf->Des().Copy( resource->Des() );
+	    }
+	else
+	    {
+	    if ( aParam1 == NULL )
+	        {
+	        hbuf->Des().Format( resource->Des(), *aParam2 );
+	        }
+	    else if ( aParam2 == NULL )
+	        {
+	        hbuf->Des().Format(resource->Des(), *aParam1 );
+	        }
+	    else
+	        {
+	        hbuf->Des().Format(resource->Des(), *aParam1, *aParam2 );
+	        }	    
+	    }
+								    
+	CleanupStack::PopAndDestroy( resource );
+	return hbuf;
+    }    
+
 // End of File
--- a/terminalsecurity/SCP/SCPPatternPlugin/group/SCPPatternPlugin.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPPatternPlugin/group/SCPPatternPlugin.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -68,4 +68,7 @@
 LIBRARY			efsrv.lib	// FileServer
 LIBRARY					flogger.lib
 LIBRARY                 featmgr.lib
+
+SMPSAFE
+
 // End of File
--- a/terminalsecurity/SCP/SCPPatternPlugin/inc/SCPPatternPlugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPPatternPlugin/inc/SCPPatternPlugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -70,7 +70,7 @@
         /**
         * Event handler...
         */		
-	    void CSCPPatternPlugin::HandleEventL( TInt aID, CSCPParamObject& aParam,CSCPParamObject& aOutParam );
+		CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam );
 		
 		void SetEventHandler( MSCPPluginEventHandler* aHandler );
 
--- a/terminalsecurity/SCP/SCPPatternPlugin/src/SCPPatternPlugin.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPPatternPlugin/src/SCPPatternPlugin.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -24,9 +24,9 @@
 #include <featmgr.h>
 
 #include "SCPPatternPlugin.h"
-#include <scppatternpluginlang.rsg>
+#include <SCPPatternPluginLang.rsg>
 #include "SCP_IDs.h"
-#include <SCPServerInterface.h>
+
 
 
 
@@ -85,6 +85,60 @@
     return;
     }
     
+
+// ----------------------------------------------------------------------------
+// CSCPPatternPlugin::GetResource
+// GetResource, opens the localisation filesystem
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+TInt CSCPPatternPlugin::GetResource()
+    {
+ 	Dprint( (_L("CSCPPatternPlugin::GetResource()") ));
+	// The resource has to be loaded manually since it is not an application.        
+	
+	if ( iFs == NULL )
+	    {
+	    return KErrNotReady;
+	    }
+
+    // can't use resource here because it is not added yet....
+    TFileName resourceFile;
+    resourceFile.Append( KDriveZ );
+    resourceFile.Append( SCPPatternPluginSrcFile );
+    BaflUtils::NearestLanguageFile( *iFs, resourceFile );
+    
+    TRAPD( err, 
+        iRf.OpenL( *iFs, resourceFile );
+        iRf.ConfirmSignatureL();
+        );
+        
+    return err;
+    }
+
+// ----------------------------------------------------------------------------
+// CSCPPatternPlugin::LoadResourceLC
+// LoadResourceLC, loads the localisation resource
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC16* CSCPPatternPlugin::LoadResourceLC( TInt aResId )
+    {
+	Dprint ( ( _L( "CSCPPatternPlugin::LoadResourceLC()" ) ) );
+
+	// load the actual resource
+    HBufC8* readBuffer = iRf.AllocReadLC( aResId );
+    // as we are expecting HBufC16...
+    const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(),
+                                 ( readBuffer->Length() + 1 ) >> 1 );
+    HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() );    
+    *textBuffer=ptrReadBuffer;
+    CleanupStack::PopAndDestroy( readBuffer ); // readBuffer
+    CleanupStack::PushL( textBuffer );
+  	return textBuffer;
+    }
+
+
 // ----------------------------------------------------------------------------
 // CSCPPatternPlugin::~CSCPPatternPlugin
 // Destructor
@@ -108,10 +162,17 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //    
-void CSCPPatternPlugin :: HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam )
+CSCPParamObject* CSCPPatternPlugin::HandleEvent( TInt aID, CSCPParamObject& aParam )
 	{	
+	
 	Dprint ( ( _L( "CSCPPatternPlugin::HandleEvent()" ) ) );
 	
+	// Make the ParamObject for success ack, Delete later
+	CSCPParamObject* retParams = NULL;
+		
+	TBool errRaised;
+	errRaised = EFalse;
+	
 	TBool isInvalid = EFalse;
 	
 	// check for Case
@@ -160,17 +221,14 @@
             if ( config.Get( (RTerminalControl3rdPartySession::EPasscodeDisallowSimple), 
                  passcodedisallowsimple ) !=  KErrNone )
                     passcodedisallowsimple = EFalse;
-            Dprint( ( _L( "CSCPPatternPlugin :: HandleEventL): EPasscodeMinLength :%d, EPasscodeMaxLength :%d, "), passcodeminlength,passcodemaxlength ) );		
-            Dprint( ( _L( "CSCPPatternPlugin :: HandleEventL):  EPasscodeMaxRepeatedCharacters :%d, EPasscodeRequireCharsAndNumbers :%d"), passcodemaxrepeatedcharacters,passcoderequirecharsandnumbers ) );
-            Dprint( ( _L( "CSCPPatternPlugin :: HandleEventL): EPasscodeRequireUpperAndLower :%d,minspecialcharacters :%d  "), passcoderequireupperandlower ,passcodeminspecialcharacters) );
-            Dprint( ( _L( "CSCPPatternPlugin :: HandleEventL):  EPasscodeConsecutiveNumbers :%d, EPasscodeDisallowSimple :%d, "), passcodeconsecutivenumbers,passcodeminspecialcharacters ) );
+			
             // Get the password from the paramObject
             TBuf<KSCPPasscodeMaxLength> password;
             if ( aParam.Get( KSCPParamPassword, password ) != KErrNone )
                 {
                 // Nothing to do anymore
                 break;
-                }
+                }            
             
         	// The first rule is to check if securitycode has any
         	// forbidden chars, like WhiteSpace etc...
@@ -181,7 +239,12 @@
 			  TChar::TCategory chCat = ch.GetCategory();
 			  if ( ch.IsSpace() )
 				    {   
-					aOutParam.Set( KSCPParamStatus, KErrArgument );
+					TRAPD( err, retParams  = CSCPParamObject::NewL() );
+					if ( err == KErrNone )
+					    {
+					    retParams->Set( KSCPParamStatus, KErrArgument );    
+					    }
+					    					    
 					argumentError = ETrue;
 					break;
 				    }
@@ -201,6 +264,15 @@
 				 passcodeminspecialcharacters != 0 ||
 				 passcodedisallowsimple)
 			    {			
+				// Get the filesystem for Resource
+				// If fail, bail out
+				TInt errgGR = GetResource();
+				if (errgGR != KErrNone)
+				    {
+					errRaised = ETrue;
+					break; // Break out 
+				    }
+
 				// Declare the Check flags										
 				TBool istoosimilar = EFalse;					
 				TBool consecutively = EFalse;
@@ -214,41 +286,70 @@
 				TInt specialCount = 0;  // for passcodeminspecialcharacters
 				TChar temp = '1';
 			
+
+				// Prompt buf, iNote can show only 97 chars,
+				// without ... markings.
+				HBufC* hbuf = NULL;
+				
 			 	 // Check for required check or not.
 	        	if (passcodeminlength != 0)
 	        	    {
 		        	// check for Min lenght
 		            if (  password.Length() < passcodeminlength )
 		                {
-		                //koya: return error code to SecUi
-		                Dprint ( ( _L( "EDeviceLockMinlength Failed" ) ) );
-		                aOutParam.AddtoFailedPolices(EDeviceLockMinlength);
 		                isInvalid = ETrue;
+		                TRAP_IGNORE(
+		                    hbuf = LoadAndFormatResL( R_SET_SEC_CODE_MIN, &passcodeminlength ) 
+		                    );
 		                }
+	                }
 
+				if (!hbuf)
+				    {
 		        	// Check for required check or not.
+		        	if (passcodemaxlength!=0)
+		        	    {
 		        		// Check for Max Lenght
-		            else if ( password.Length() > passcodemaxlength )
+	             	    if ( password.Length() > passcodemaxlength )
 		             	    {
-		                Dprint ( ( _L( "EDeviceLockMaxlength Failed" ) ) );
-                            aOutParam.AddtoFailedPolices(EDeviceLockMaxlength);
 		                    isInvalid = ETrue;
+		                    TRAP_IGNORE(
+		                        hbuf = LoadAndFormatResL( R_SET_SEC_CODE_MAX, &passcodemaxlength );
+		                        );
+		             	    }
 		           	    }
 				    }
  	
+				if (!hbuf)
+				    {
 		  			// Check for required check or not.
 		  			if ( passcodemaxrepeatedcharacters != 0 )
 		  			    {
 			  			// Check for TooManySameChars
 			  			TRAPD( err, istoosimilar = TooManySameCharsL(password,passcodemaxrepeatedcharacters) );
 					  	if ( ( err == KErrNone ) && ( istoosimilar ) )
-					  	    {					  
-					  	  Dprint ( ( _L( "EDeviceLockAllowedMaxRepeatedChars Failed" ) ) );
-                            aOutParam.AddtoFailedPolices(EDeviceLockAllowedMaxRepeatedChars);
-                            isInvalid = ETrue;
-                            }
+					  	    {					  		
+					  		if ( passcodemaxrepeatedcharacters > 1 )
+					  		    {
+		                        isInvalid = ETrue;
+		                        TRAP_IGNORE(
+		                            hbuf = LoadAndFormatResL( R_SET_SEC_CODE_REPEATED,
+					  		                              &passcodemaxrepeatedcharacters );
+		                            );						  		    						  		    					  		    
+					  		    }
+					  		else // passcodemaxrepeatedcharacters == 1
+					  		    {
+		                        isInvalid = ETrue;
+		                        TRAP_IGNORE(
+		                            hbuf = LoadAndFormatResL( R_SET_SEC_CODE_REPEATED_ONCE );
+		                            );					  		   
+					  		    }						  								  				  						
+					  	    }						  		
 				  	    }
+				    }
 				    
+   		   		if (!hbuf)
+				    {
 	   				// Check for Alphadigit
 	   				if ( passcoderequirecharsandnumbers)
 	   				    {
@@ -264,13 +365,17 @@
 		  				if (digitCount >= password.Length() || alphaCount >= password.Length()
 		  				           || digitCount == 0 || alphaCount == 0 )
 		  				    {
-		  				  Dprint ( ( _L( "EDeviceLockRequireCharsAndNumbers Failed" ) ) );
-                              aOutParam.AddtoFailedPolices(EDeviceLockRequireCharsAndNumbers);
-                              isInvalid = ETrue;
+		                    isInvalid = ETrue;
+		                    TRAP_IGNORE(
+		                        hbuf = LoadAndFormatResL( R_SET_SEC_CODE_LETTERS_NUMBERS );
+		                        );		  				    				  				
 		  				    }
 	   				    }	// End of Alphadigit Check
+				    }
 				  	
 				  							
+				if (!hbuf)
+			    	{
 					// passcodeconsecutivenumbers
 					if (passcodeconsecutivenumbers)
 					    {
@@ -278,11 +383,57 @@
 
 						if ( consecutively )
 						    {
-						    Dprint ( ( _L( "EDeviceLockConsecutiveNumbers Failed" ) ) );
-						    aOutParam.AddtoFailedPolices(EDeviceLockConsecutiveNumbers);
 		                    isInvalid = ETrue;
+		                    TRAP_IGNORE(
+		                        hbuf = LoadAndFormatResL( R_SET_SEC_CODE_CONSECUTIVE );
+		                        );	
 						    }
 					    } 
+				    }
+        
+        		/*
+        		if (!hbuf)
+				    {
+		        	// Check for required check or not.
+		        	if (passcoderequireupperandlower)
+		        	    {				        	
+		        		// Count the IsDigits first and miinus them from the lenghth!
+		        		// Count the possible NUM's count first!
+		        		for (TInt numcounter=0; numcounter < password.Length(); numcounter++)
+			  			    {
+			  				if ( static_cast<TChar>( password[numcounter] ).IsDigit() )
+						  		numberCount++;
+			  			    }
+
+		   			// Check for Caps, both
+		  			for (TInt capscounter=0; capscounter < password.Length(); capscounter++)
+		  			    {
+						if ( static_cast<TChar>( password[capscounter] ).IsUpper() )
+					  		upperCount++;
+						
+						if ( static_cast<TChar>( password[capscounter] ).IsLower() )
+					  		lowerCount++;
+		  			    }
+		  			    					  								  			
+                        if (upperCount >= (password.Length()-numberCount ) )
+                        	isallcaps = ETrue;
+				  			
+		  				if (lowerCount >= (password.Length() -numberCount) )
+		  					isallsmall = ETrue;				  			
+				
+						if (isallsmall || isallcaps)
+						    {	  
+		                    isInvalid = ETrue;
+		                    TRAP_IGNORE(
+		                        hbuf = LoadAndFormatResL( R_SET_SEC_CODE_UPPER_LOWER );
+		                        );			                          							    	  							    
+						    }	  							    	  							    		
+			        	}	// End of Caps check
+				    }
+				 */	   		   		
+
+        		if (!hbuf)
+				    {
 		        	// Check for required check or not.
 		        	if (passcoderequireupperandlower)
 		        	    {
@@ -300,11 +451,18 @@
 		  			    
 		  			    if ( upperCount == 0 || lowerCount == 0)
 		  			    	{
-		  			      Dprint ( ( _L( "EDeviceLockRequireUpperAndLower Failed" ) ) );
-		  			    	aOutParam.AddtoFailedPolices(EDeviceLockRequireUpperAndLower);
 		  			    	isInvalid = ETrue;
+		                    TRAP_IGNORE(
+		                        hbuf = LoadAndFormatResL( R_SET_SEC_CODE_UPPER_LOWER );
+		                        );		
 		  			    	}
-		        	    }        		
+		        	    }
+				    }
+		        	    
+		        	    				        	
+        		
+        		if (!hbuf)
+        		   {
                     // Check for required check or not.
                     if (passcodeminspecialcharacters != 0)
                         {
@@ -316,13 +474,18 @@
                         
                         if ( specialCount < passcodeminspecialcharacters )
                             {
-                            //koya: return error code to SecUi
-                            Dprint ( ( _L( "EDeviceLockMinSpecialCharacters Failed" ) ) );
-                            aOutParam.AddtoFailedPolices(EDeviceLockMinSpecialCharacters);
                             isInvalid = ETrue;
-                            }                        
+                            TRAP_IGNORE(
+                                    hbuf = LoadAndFormatResL( R_SET_SEC_CODE_MIN_SPECIAL_CHARS, 
+                                    &passcodeminspecialcharacters );
+                            );
+                            }
+                        
                     	}
-						    		                
+        		   }
+        		                
+        		if (!hbuf)
+        		   {
                     if (passcodedisallowsimple)
                         {
                         for (TInt counter=0; counter< (password.Length()-1); counter++)
@@ -335,12 +498,12 @@
                             }
                         if (singlerepeat)
                             {
-                            //koya: return error code to SecUi
-                            Dprint ( ( _L( "EDeviceLockSingleCharRepeatNotAllowed Failed" ) ) );
-                            aOutParam.AddtoFailedPolices(EDeviceLockSingleCharRepeatNotAllowed);
                             isInvalid = ETrue;
+                            TRAP_IGNORE(
+                                    hbuf = LoadAndFormatResL( R_SET_SEC_CODE_SINGLE_REPEAT ) );                            
                             }
-                        
+                        if (!hbuf)
+                            {
                             for (TInt counter=0; counter< (password.Length()-1); counter++)
                                 {
                                 //The consecutivity to be checked with only Alphanumeric characters.
@@ -364,18 +527,43 @@
                                 }
                             if (consecutivechars)
                                 {
-                                //koya: return error code to SecUi
-                                Dprint ( ( _L( "EDevicelockConsecutiveCharsNotAllowed Failed" ) ) );
-                                aOutParam.AddtoFailedPolices(EDevicelockConsecutiveCharsNotAllowed);
                                 isInvalid = ETrue;
+                                TRAP_IGNORE(
+                                        hbuf = LoadAndFormatResL( R_SET_SEC_CODE_CONSECUTIVE_CHARS ) );
                                 }
-                        }			  	
+                            }
+                        }
+                    }
+				  	
+			  	
 				if ( isInvalid )
 				    {	    							
-			            aOutParam.Set( KSCPParamStatus, KErrSCPInvalidCode );		                
-		            }
+			    	// Create the result-object to return
+				    TRAPD( err, retParams  = CSCPParamObject::NewL() );
+                    
+                    if ( err == KErrNone )
+				        {
+			            retParams->Set( KSCPParamStatus, KErrSCPInvalidCode );
+    		            retParams->Set( KSCPParamAction, KSCPActionShowUI );
+	    	            retParams->Set( KSCPParamUIMode, KSCPUINote );
+		                
+		                if ( hbuf != NULL )
+		                    {
+		                    FormatResourceString(*hbuf);	
+		                    TPtr ptr = hbuf->Des();
+		                    retParams->Set( KSCPParamPromptText, ptr );
+		                    delete hbuf;
+		                    }
+				        }
+				    }
 				    
                 } // end of All Zero check
+		    // All params were zero! no check!
+            else 
+                {
+                retParams = NULL;
+                }
+                			
             break;  
             } // KSCPEventValidate
                 
@@ -399,11 +587,20 @@
 				||  paramID ==  (RTerminalControl3rdPartySession::EPasscodeMinSpecialCharacters)
 				||  paramID ==  (RTerminalControl3rdPartySession::EPasscodeDisallowSimple))
                 {
+                
+                // OK, we're interested, check that the value is valid
+                TRAPD( err, retParams  = CSCPParamObject::NewL() );
+                
+                if ( err != KErrNone )
+                    {
+                    break; // Fatal, cannot create paramObject
+                    }
+                
                 // All of our params are TInts
                 TInt paramValue;
                 if ( aParam.Get( KSCPParamValue, paramValue ) != KErrNone )
                     {
-                    aOutParam.Set( KSCPParamStatus, KErrArgument );
+                    retParams->Set( KSCPParamStatus, KErrGeneral );
                     break;
                     }
                                 
@@ -478,12 +675,29 @@
                         break;
                     }
                 
-                aOutParam.Set( KSCPParamStatus, retStatus );
+                retParams->Set( KSCPParamStatus, retStatus );
                 }
+            else
+                {
+                retParams = NULL;
+                }
+               
             break;
             } //KSCPEventConfigurationQuery                         
         } //  switch ( aID )
+
+   	// Check if Any errors were raised and handle it
+    if (errRaised) 
+        {
+        if ( retParams != NULL )
+            {
+            delete retParams;
+            }
+        retParams = NULL;
+        }
+        
     // The caller will own this pointer from now on   
+    return retParams; 
 	}
 
 // ----------------------------------------------------------------------------
@@ -602,4 +816,94 @@
     return charTooManyInRow;
     }
     
+
+// ----------------------------------------------------------------------------
+// CSCPPatternPlugin::LoadAndFormatResL
+// Load the given resouce, and format the string according to the TInt parameters
+// if given.
+// 
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC* CSCPPatternPlugin::LoadAndFormatResL( TInt aResId, TInt* aParam1, TInt* aParam2 )
+    {
+    HBufC16* resource = NULL;
+    HBufC* hbuf = NULL;
+    
+    resource = LoadResourceLC( aResId );
+    FormatResourceString(*resource);
+    TInt allocLen = 0;
+    if ( aParam1 != NULL )
+        {
+        allocLen += KSCPMaxIntLength;
+        }
+    if ( aParam2 != NULL )
+        {
+        allocLen += KSCPMaxIntLength;
+        }
+                
+	hbuf = HBufC::NewL( resource->Length() + allocLen );
+	
+	if ( ( aParam1 == NULL ) && ( aParam2 == NULL ) )
+	    {
+	    hbuf->Des().Copy( resource->Des() );
+	    }
+	else
+	    {
+	    if ( aParam1 == NULL )
+	        {
+	        hbuf->Des().Format( resource->Des(), *aParam2 );
+	        }
+	    else if ( aParam2 == NULL )
+	        {
+	        hbuf->Des().Format(resource->Des(), *aParam1 );
+	        }
+	    else
+	        {
+	        hbuf->Des().Format(resource->Des(), *aParam1, *aParam2 );
+	        }	    
+	    }
+								    
+	CleanupStack::PopAndDestroy( resource );
+	return hbuf;
+    }
+
+// ----------------------------------------------------------------------------
+// CSCPPatternPlugin::FormatResourceString
+// The buffer that is passed is formatted to have only %i as a format specifier instead of %N or %0N etc.
+// 
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+void CSCPPatternPlugin::FormatResourceString(HBufC16 &aResStr)
+{
+		TInt pos = 0;
+		TInt flag = 0;
+        TPtr16 bufPtr = aResStr.Des();
+        _LIT (mess1, "%N");
+        _LIT (mess2, "%i");
+        _LIT (mess3, "%0N");
+        _LIT (mess4, "%1N");
+                              
+        while ((pos = bufPtr.Find(mess1)) !=KErrNotFound)
+        {
+              bufPtr.Replace(pos,2,mess2); 
+              flag = 1;
+              break;                    
+        }
+               
+        if(flag == 0)
+        {
+              while ((pos = bufPtr.Find(mess3)) != KErrNotFound)
+              {
+              		bufPtr.Replace(pos,3,mess2);
+              }
+               		
+              while ((pos = bufPtr.Find(mess4)) != KErrNotFound)
+              {
+                	bufPtr.Replace(pos,3,mess2);
+              }
+        }	
+}    
+
 // End of File
--- a/terminalsecurity/SCP/SCPServer/group/SCPServer.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/group/SCPServer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -96,7 +96,9 @@
 LIBRARY     featmgr.lib
 LIBRARY 	estor.lib
 LIBRARY 	charconv.lib
-LIBRARY		devenccommonutils.lib //Device encryption utility
+
+SMPSAFE
+
 // End of file
 
 
--- a/terminalsecurity/SCP/SCPServer/inc/SCPConfiguration.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/inc/SCPConfiguration.h	Wed Sep 01 12:27:42 2010 +0100
@@ -29,9 +29,8 @@
 enum TSCPParamType
     {
     EParTypeInt = 0,
-    EParTypeDesc,
-    EParTypeBool
-    };
+    EParTypeDesc
+	};
 
 // LOCAL CONSTANTS
 
@@ -57,11 +56,10 @@
 const TInt KParamIDBlockedInOOS = 7;
 // ID number for the encrypted security code.
 const TInt KParamIDCryptoCode = 8;
-//ID number for the boolean for the configuartion check
-const TInt KParamIDConfigChecked = 9;
+
 
 // Total number of Param IDs
-const TInt KTotalParamIDs = 9;
+const TInt KTotalParamIDs = 8;
 
 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
 #define SCP_PARAMETERS_WithFlag { &iConfigFlag, \
@@ -71,9 +69,8 @@
                          &iFailedAttempts, \
                          &iBlockedAtTime, \
                          &iBlockedInOOS, \
-                         &iCryptoCode, \
-						 &iConfigChecked \
-                         };
+                         &iCryptoCode \
+						 };
 
 #define SCP_PARAMIDS_WithFlag    {  KParamIDConfigFlag, \
                            KParamIDMaxTimeout, \
@@ -82,9 +79,8 @@
                            KParamIDFailedAttempts, \
                            KParamIDBlockedAtTime, \
                            KParamIDBlockedInOOS, \
-                           KParamIDCryptoCode, \
-						   KParamIDConfigChecked \
-                        };
+                           KParamIDCryptoCode \
+						   };
 
 #define SCP_PARAMTYPES_WithFlag { EParTypeInt, \
                          EParTypeInt, \
@@ -93,9 +89,8 @@
                          EParTypeInt, \
                          EParTypeDesc, \
                          EParTypeInt, \
-                         EParTypeDesc, \
-						 EParTypeBool \
-                       };
+                         EParTypeDesc\
+						};
 
 //#else // !__SAP_DEVICE_LOCK_ENHANCEMENTS                   
 
@@ -189,10 +184,7 @@
         /** The name of the main configuration file */
         TFileName iConfigFileName; 
         TInt iBlockedInOOS;
-        
-        //Flag to check whether Configuration checked already
-        TBool iConfigChecked;
-        
+       
         /** A ptr to a connected RFs, not owned */
         RFs* iFsSession;
         
--- a/terminalsecurity/SCP/SCPServer/inc/SCPLockNotificationEventHandler.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/inc/SCPLockNotificationEventHandler.h	Wed Sep 01 12:27:42 2010 +0100
@@ -71,7 +71,7 @@
         * From CActive The active object request cancellation method.
         */
         void DoCancel();
-
+		
         // send passcode to ISA
         void VerifyPass();
 
--- a/terminalsecurity/SCP/SCPServer/inc/SCPPlugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/inc/SCPPlugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -97,7 +97,7 @@
         * @param aParam The event parameters
         * @returns The parameter object identifying the actions taken.
         */
-        virtual void HandleEventL( TInt aID, CSCPParamObject& aInParam, CSCPParamObject& aOutParam ) = 0;
+        virtual CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam ) = 0;
         
         virtual void SetEventHandler( MSCPPluginEventHandler* aHandler ) = 0;
                 
--- a/terminalsecurity/SCP/SCPServer/inc/SCPServer.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/inc/SCPServer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -92,7 +92,6 @@
 _LIT8( KCodePolicyTypeId, "http://www.w3.org/2001/XMLSchema#string" );
 
 // Allowed SIDs for the functions
-const TUint32 KSCPSTIF( 0x102073E4 ); // STIF exe
 const TUint32 KSCPServerSIDTelephone( 0x100058B3 ); // Terminal Control Server
 const TUint32 KSCPServerSIDLog( 0x101f4cd5 ); // Terminal Control Server
 const TUint32 KSCPServerSIDTerminalControl( 0x10207825 ); // Terminal Control Server
@@ -137,7 +136,7 @@
         // Only Autolock allowed for the Check configuration call
         },
         {
-        _INIT_SECURITY_POLICY_S0( KSCPEvntHndlrUid ),
+        _INIT_SECURITY_POLICY_C1( ECapability_None ),
             CPolicyServer::EFailClient
         },
         {
@@ -179,7 +178,7 @@
         {
         _INIT_SECURITY_POLICY_C1( ECapability_None ),
             CPolicyServer::EFailClient        
-        }
+        }                          
     };
 #endif // SCP_ENFORCE_SECURITY
 
@@ -495,11 +494,6 @@
 		* This method is called to remove the parameters set by the application(s) provided as arguments.
 		*/
         TInt PerformCleanupL( HBufC8* aAppIDBuffer, RArray<const TParamChange>& aChangeArray, RPointerArray<HBufC8>& aParamValArray );
-        
-        /**
-        * This method returns the values for the policies maintained at the server
-        */
-        void GetPoliciesL(HBufC8* aAppIDBuffer, TUint32 aCallerIdentity);
 //#endif //  __SAP_DEVICE_LOCK_ENHANCEMENTS 
         
         // Methods from base classes
@@ -521,8 +515,6 @@
         * @param aParam The parameter passed to the timer object
         */        
         void Timeout( TAny* aParam );
-		
-        TInt ValidateLockcodeAgainstPoliciesL(TDes& aLockcode,CSCPParamObject*& aRetParams);
         
     private: //Methods
     
--- a/terminalsecurity/SCP/SCPServer/inc/SCPSession.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/inc/SCPSession.h	Wed Sep 01 12:27:42 2010 +0100
@@ -26,7 +26,7 @@
 
 #include "SCPServerInterface.h"
 #include "SCPTimer.h"
-#include <SCPParamObject.h>
+
 #include <TerminalControl3rdPartyParamsPlugin.h>
 // FORWARD DECLARATIONS
 class CSCPServer;
@@ -241,14 +241,6 @@
         * @return KErrNone if successful, error status otherwise
         */         
         TInt HandleCleanupL( const RMessage2 &aMessage );
-        
-        /**
-        * Handles get on policies
-        * @param aMessage The message received from the client
-        * @return KErrNone if successful, error status otherwise
-        */         
-        void HandleGetPoliciesL( const RMessage2 &aMessage );
-		
         TInt HandleSetALPeriodL( const RMessage2 &aMessage );
 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS               
         
@@ -287,9 +279,6 @@
         */
         void NotifyChangeL( TInt aParamID, const TDesC8 aParamVal, TUint32 aCallerID );        
 
-        void ReadFailedPoliciestoMsgBufferL(CSCPParamObject*& aParamObject,const RMessage2 &aMessage,TInt aSlotNumber );
-		
-        void ValidateLockcodeAgainstPoliciesL(const RMessage2 &aMessage);
     private:   // Data
        // Possible states for iLockCommandState
        enum TSCPLockCmdState
--- a/terminalsecurity/SCP/SCPServer/src/SCPConfiguration.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/src/SCPConfiguration.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -155,12 +155,6 @@
                break;
                } 
                
-        case ( EParTypeBool ):
-               { 
-               ret = params->Get( KParamIDs[i], *(reinterpret_cast<TBool*>( KParameters[i] )) );
-               break;
-               }        
-               
            default:               
                 // No implementation needed           
                 break;
@@ -301,13 +295,7 @@
                ret = params->Set( KParamIDs[i], *(reinterpret_cast<TDes*>( KParameters[i] )) );
                break;
                } 
-               
-               case ( EParTypeBool ):
-               { 
-               ret = params->Set( KParamIDs[i], *(reinterpret_cast<TBool*>( KParameters[i] )) );
-               break;
-               } 
-               
+      
            default:               
                 // No implementation needed           
                 break;
--- a/terminalsecurity/SCP/SCPServer/src/SCPLockNotificationEventHandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/src/SCPLockNotificationEventHandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -46,8 +46,8 @@
             )
 	        : CSCPLockEventHandler( aServer ),
 	        iQueryState(ESCPLNQueryStateNotification),
-	        iAckReceived (EFalse),
-			iSession (aSession)
+	        iSession (aSession),
+	        iAckReceived (EFalse)
     {
     Dprint( (_L("--> CSCPLockNotificationEventHandler::\
 	      CSCPLockNotificationEventHandler()") ));
--- a/terminalsecurity/SCP/SCPServer/src/SCPLockSettingEventHandler.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/src/SCPLockSettingEventHandler.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -390,18 +390,21 @@
 	   
     if ( ( startFinalPhase ) && ( iAutolock ) )
         {
+        	Dprint( (_L("--> CSCPLockSettingEventHandler::RunL-startFinalPhase") ));
         // Autolock activation/deactivation was requested
         TRAPD( err, SetAutolockStateL( iState ) );
     
         if ( err != KErrNone )
             {
             // If the call failed, send the result as the message status
+            Dprint( (_L("--> CSCPLockSettingEventHandler::RunL-err!=Kerrnone") ));
             iMessageStatus = err;
             }
         else if ( !iState )
             {
             // Inform the session-class that an unlock-message has been sent
             // (the server won't respond to Autolock until the handler finishes)                    
+            Dprint( (_L("--> CSCPLockSettingEventHandler::RunL-!iState") ));                  
             iSession->LockOperationPending( ESCPCommandUnlockPhone, &iStatus );
             iUnlockSent = ETrue;	                
             finalCall = EFalse;
--- a/terminalsecurity/SCP/SCPServer/src/SCPPluginManager.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/src/SCPPluginManager.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -151,52 +151,60 @@
 // Status : Approved
 // ---------------------------------------------------------
 //
-CSCPParamObject* CSCPPluginManager :: PostEvent(TInt aID, CSCPParamObject& aParam) {       
+CSCPParamObject* CSCPPluginManager::PostEvent( TInt aID, CSCPParamObject& aParam )
+    {       
     Dprint(_L("[CSCPPluginManager]-> PostEvent() >>>"));
     // If the plugins aren't loaded, load them here
     TBool okToPost = ETrue;
-    TInt lErr = KErrNone;
     
-    if(!iPluginsLoaded) {
-        TRAP(lErr, LoadPluginsL());
-        
-        if(lErr != KErrNone) {
-            Dprint((_L("CSCPPluginManager::PostEvent(): ERROR loading plugins: %d"), lErr));
+    if ( !iPluginsLoaded )
+        {
+        TRAPD( err, LoadPluginsL() );
+        if ( err != KErrNone )
+            {
+            Dprint( (_L("CSCPPluginManager::PostEvent(): ERROR loading plugins: %d"), err ));
             okToPost = EFalse;
+            }           
         }
-    }
     
-    lErr = KErrNone;
     CSCPParamObject* reply = NULL;
     
-    TRAP(lErr, reply = CSCPParamObject :: NewL());
-    
-    if(lErr != KErrNone) {
-        return NULL;
-    }
-    
-    lErr = KErrNone;
-    TInt lPolicyRunStatus = KErrNone;
+    if ( okToPost )
+        {
+        // Send the incoming event to all plugins            
+        TBool continueProcessing = ETrue;            
     
-    if(okToPost) {
-        // Send the incoming event to all plugins
-        for(TInt i = 0; i < iPlugins.Count(); i++) {
+        for ( TInt i = 0; i < iPlugins.Count(); i++ )
+            {
             // The method shouldn't leave, but make sure
-            TRAP(lErr, iPlugins[i]->HandleEventL(aID, aParam, *reply));
-            
-            if(reply->Get(KSCPParamStatus, lPolicyRunStatus) == KErrNone) {
-                if(lPolicyRunStatus != KErrNone) {
-                    lErr = lPolicyRunStatus;
+            TRAPD( err, reply = iPlugins[i]->HandleEvent( aID, aParam ) );
+            if ( err != KErrNone )
+                {
+                // Plugin error
+                continue; 
                 }
-            }
-        }
+                
+            // Check reply
+            if ( reply != NULL )
+                {
+                Dprint(_L("[CSCPPluginManager]-> The event '%d' was consumed..."), aID);
+                continueProcessing = EFalse;                                  
+                }
+            else
+                {
+                // No action requested                
+                }        
         
-        reply->Set(KSCPParamStatus, lErr);
-    }
+            if ( !continueProcessing )
+                {
+                break; // Event consumed, don't continue
+                }
+            }         
+        }
         
     Dprint(_L("[CSCPPluginManager]-> PostEvent() okToPost=%d<<<"), okToPost);
     return reply;
-}
+    }
     
 // ---------------------------------------------------------
 // void CSCPPluginManager::~CSCPPluginManager()
--- a/terminalsecurity/SCP/SCPServer/src/SCPServer.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/src/SCPServer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -53,6 +53,20 @@
 #include <DevEncEngineConstants.h>
 #include <DevEncSessionBase.h>
 #include <startupdomainpskeys.h>
+/*
+#ifdef _DEBUG
+#define __SCP_DEBUG
+#endif // _DEBUG
+
+// Define this so the precompiler in CW 3.1 won't complain about token pasting,
+// the warnings are not valid
+#pragma warn_illtokenpasting off
+
+#ifdef __SCP_DEBUG
+#define Dprint(a) RDebug::Print##a
+#else
+#define Dprint(a)
+#endif // _DEBUG*/
 
 // ==================== LOCAL FUNCTIONS ====================
 
@@ -115,7 +129,7 @@
     
     // Assign default config flag
     iConfiguration.iConfigFlag = KSCPConfigUnknown;
-    iConfiguration.iConfigChecked = EFalse;
+    
     
     // Assign the default codes
     iConfiguration.iSecCode.Zero();
@@ -155,7 +169,7 @@
 //#endif
    
     // Assign the default max timeout
-    iConfiguration.iMaxTimeout = KSCPDefaultMaxTO;
+    iConfiguration.iMaxTimeout = 0;
    	iConfiguration.iBlockedInOOS = 0;
    
     // Read the configuration, overwriting the default values
@@ -172,24 +186,8 @@
         }
     
     
-    //If Configuration is not validated already, validate it
-    
-    if (!iConfiguration.iConfigChecked)
-        {
-        TInt valerr = KErrNone;
-        TRAP( valerr, ValidateConfigurationL( KSCPComplete ));
-        if (valerr != KErrNone)
-            {
-            Dprint( (_L("CSCPServer::ConstructL(): Configuration Validation failed: %d"), valerr ));
-            }
-        else
-            {
-            Dprint( (_L("CSCPServer::ConstructL(): Configuration Validation Passed")));
-            }
-        }
-    
-        
-        
+   
+
     Dprint( (_L("CSCPServer::ConstructL(): Connecting to CenRep") ));
     iALPeriodRep = CRepository::NewL( KCRUidSecuritySettings );        
     
@@ -654,155 +652,91 @@
 //	
 void CSCPServer::ValidateConfigurationL( TInt aMode )
     {
-    Dprint( (_L("--> CSCPServer::ValidateConfigurationL()") ));
-    RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()"));
-    TInt startupReason(ENormalStartup);
-    RProperty::Get(KPSUidStartup, KPSStartupReason, startupReason);
-    Dprint( (_L("CSCPServer::ValidateConfigurationL(): startupReason = %d"), startupReason));
-     if((startupReason == ENormalRFSReset)||(startupReason ==  EDeepRFSReset)||(startupReason == EFirmwareUpdate)||(iConfiguration.iConfigFlag == KSCPConfigUnknown))
-         {
+    if (aMode == KSCPInitial) {
+        // Return here, must be checked by complete mode
+        RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@@aMode == KSCPInitial "));
+        User::Leave(KErrAccessDenied);
+    }
     
-	RMobilePhone::TMobilePassword storedCode;
+    RMobilePhone::TMobilePassword storedCode;
     storedCode.Zero();
     User::LeaveIfError(GetCode(storedCode));
-    
-    
-	Dprint( (_L("CSCPServer::ValidateConfigurationL(): Checking code: %s"), storedCode.PtrZ() ));
-	// Check that the ISA code is stored correctly
-	TRAPD( err, CheckISACodeL( storedCode ) );
-	 //Bool for the correction of Defaultlockcode cenrep
-    TBool lCorrectDefaultlockcode = EFalse;
-    
-     Dprint( (_L("CSCPServer::ValidateConfigurationL(): iConfigFlag = %d, iConfigChecked = %d"), iConfiguration.iConfigFlag, iConfiguration.iConfigChecked));
-     
-    if ((iConfiguration.iConfigFlag == KSCPConfigOK)
-            && (iConfiguration.iConfigChecked) && (err == KErrNone))
-        {
-        // The configuration has already been checked, exit
-        Dprint( (_L("CSCPServer::ValidateConfigurationL(): Configuration is non-default.") ));
-        User::Leave( KErrNone );
-        }
-    else if ( aMode == KSCPInitial )
-        {
-        // Return here, must be checked by complete mode
-        User::Leave( KErrAccessDenied );
-        }
-    
-   
-    TInt hashedISAcode;
-    TSCPSecCode hashedCode;
-//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS    
-if(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-{
-	/*TInt*/ hashedISAcode = HashISACode( iConfiguration.iEnhSecCode );
-   // TSCPSecCode hashedCode;
-    hashedCode.Zero();
-    hashedCode.AppendNum( hashedISAcode );
-}
-//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS    
-            
-    
+    TBool isDefaultLockcode = ETrue;
+    TInt err = KErrNone;
     
-   
-    if (err != KErrNone)
-        {
-        lCorrectDefaultlockcode = ETrue;
+    RMobilePhone::TMobilePassword defaultLockcode;
+    defaultLockcode.Zero();
+    defaultLockcode.Copy(KSCPDefaultSecCode);
+    if (storedCode.Compare(KSCPDefaultSecCode) == 0) {
+        RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@config has KSCPDefaultSecCode "));
+        TRAP( err, CheckISACodeL( defaultLockcode ) );
+        if (err == KErrNone) {
+            RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@ISA also has KSCPDefaultSecCode "));
+            iConfiguration.iConfigFlag = KSCPConfigOK;
+            isDefaultLockcode = ETrue;
         }
-    if ( err == KErrNone ) 
-        {
-        iConfiguration.iConfigFlag = KSCPConfigOK;
-        }
-    else if ( err == KErrAccessDenied )
-        {        
-        iConfiguration.iConfigFlag = KSCPConfigInvalid;
-        }
-    else if ( err == KErrLocked )
-        {
-        Dprint( (_L("CSCPServer::ValidateConfigurationL(): ISA code locked.") ));
+        else {
+            RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@ISA doesn't has KSCPDefaultSecCode "));
+            iConfiguration.iConfigFlag = KSCPConfigInvalid;
+            iConfiguration.iFailedAttempts++;
+            isDefaultLockcode = EFalse;
         }
-    else
-        {
-        Dprint( (_L("CSCPServer::ValidateConfigurationL(): ERROR in validation.") ));
+    }
+    else {
+        RDebug::Print(_L("CSCPServer::CheckISACodeL(): config lock code %s"), storedCode.PtrZ());
+        TRAP( err, CheckISACodeL( storedCode ) );
+        if (err == KErrNone) {
+            RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@ISA and config are in SYNC !! "));
+            iConfiguration.iConfigFlag = KSCPConfigOK;
+            isDefaultLockcode = EFalse;
         }
-
-//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS         
-if(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-{
-    if ( err == KErrNone )
-        {
-        // Check that the codes are in-sync with each other. Especially the default ISA code must
-        // be changed according to the default enhanced code.        
-        if ( storedCode.Compare( hashedCode ) != 0 )
+        else {
+            iConfiguration.iSecCode.Zero();
+            iConfiguration.iSecCode.Append(KSCPDefaultSecCode);
+            RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@May be ISA has KSCPDefaultSecCode "));
+            TRAP(err,ChangeISACodeL(storedCode));
+            if (err == KErrNone) {
+                RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()chnaged ISA code with config value "));
+                iConfiguration.iConfigFlag = KSCPConfigOK;
+                isDefaultLockcode = EFalse;
+            }
+            else
             {
-            Dprint( (_L("CSCPServer::ValidateConfigurationL(): Correct ISA code stored.\
-               Changing ISA code to match enhanced code => %d"), hashedISAcode ));
-               
-            storedCode.Copy( hashedCode );
-            // Change the ISA code to match the hashed code
-            ChangeISACodeL( storedCode );
+                RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()it shouldn't reach this :( "));
             }
         }
-    else if ( ( err == KErrAccessDenied ) && ( storedCode.Compare( hashedCode ) != 0 ) )
-        {
-        // Try again with the hashed code
-        TRAP( err, CheckISACodeL( hashedCode ) );
-        
-        if ( err == KErrNone )
-            {            
-            Dprint( (_L("CSCPServer::ValidateConfigurationL(): Hashed code is correct.\
-               Storing hashed code(%d)"), hashedISAcode ));
-               
-            if ( StoreCode( hashedCode ) == KErrNone )
-                {
-                iConfiguration.iConfigFlag = KSCPConfigOK;
-                lCorrectDefaultlockcode = ETrue;
-                }
-            }        
-        }
+    }
+
+    CRepository* repository = CRepository::NewL(KCRUidSCPLockCode);
+    CleanupStack::PushL(repository);
+    if (isDefaultLockcode ) {
+        RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()setting def. lockcode to 12345 "));
+        repository->Set(KSCPLockCodeDefaultLockCode, 12345);
+    }
+    else {
+        RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()setting def. lockcode to 0 "));
+        repository->Set(KSCPLockCodeDefaultLockCode, 0);
+    }
+    CleanupStack::PopAndDestroy(repository);
     
-    //If Correction of Defaultlockcode cenrep is required for the mismatch between Config and ISA
-        if (lCorrectDefaultlockcode)
-            {
-            TInt lDefCode = -1;
-            CRepository* lRepository = CRepository::NewL(KCRUidSCPLockCode);
-            CleanupStack::PushL(lRepository);
-            TInt lRet = lRepository->Get(KSCPLockCodeDefaultLockCode,
-                    lDefCode);
-            if (lRet == KErrNone && lDefCode != -1)
-                {
-                if (lDefCode == 12345)
-                    {
-                    //Although lock code is already set, due to some unexpected condition
-                    //like C drive wipe, cenrep status is wrongly shown. Correcting it here.
-                    lRepository->Set(KSCPLockCodeDefaultLockCode, 0);
-                    Dprint( (_L("RSCPClient::ValidateConfigurationL(): Corrected the Default lock code cenrep status to 0") ));
-                    }
-                else if (lDefCode == 0)
-                    {
-                    //If only ISA side is formatted, then the lock code on ISA side is default; 
-                    //Cenrep status remains wrongly as the lock code is already set. Correcting it here.
-                    lRepository->Set(KSCPLockCodeDefaultLockCode, 12345);
-                    Dprint( (_L("RSCPClient::ValidateConfigurationL(): Corrected the Default lock code cenrep status to 12345") ));
-                    }
-                }
-            CleanupStack::PopAndDestroy(lRepository);
-            }
-        }
-//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
-    //Set the flag to True, after config is validated 
-    iConfiguration.iConfigChecked = ETrue;
-    
-    TRAPD( err2, iConfiguration.WriteSetupL() );
-    if ( err2 != KErrNone )
-        {
+    TRAP( err, iConfiguration.WriteSetupL() );
+    if (err != KErrNone) {
         Dprint( (_L("CSCPServer::ValidateConfigurationL(): WARNING: failed to write configuration\
-            : %d"), err2 ));        
-        } 
-    
-    User::LeaveIfError( err );
-         }
-    Dprint( (_L("<-- CSCPServer::ValidateConfigurationL()") ));
+                : %d"), err ));
+    }
+
+    if (iConfiguration.iConfigFlag == KSCPConfigOK) {
+        RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@iConfigFlag == KSCPConfigOK "));
+        err = KErrNone;
     }
+    else {
+        RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()@iConfigFlag == KErrAccessDenied "));
+        err = KErrAccessDenied;
+    }
+
+    User::LeaveIfError(err);
+}
+
 
         
     
@@ -823,7 +757,10 @@
     (void)aCode;    
 
 #endif // __WINS__
-   
+
+
+Dprint( (_L("CSCPServer::CheckISACodeL(): current lock code %s"), aCode.PtrZ() ));
+RDebug::Print(_L("CSCPServer::CheckISACodeL(): current lock code %s"), aCode.PtrZ());
     RMobilePhone::TMobilePhoneSecurityCode secCodeType;
     secCodeType = RMobilePhone::ESecurityCodePhonePassword;
     
@@ -859,6 +796,7 @@
 	         {
 	            	iConfiguration.iBlockedInOOS = 0;
    	            	Dprint( (_L("CSCPServer::CheckISACodeL():iBlockedInOOS = 0, KErrAccessDenied") ));
+   	            	RDebug::Print(_L("--> CSCPServer::CheckISACodeL()@@iBlockedInOOS = 0, KErrAccessDenie"));
 	         }            
             ret = KErrAccessDenied;             
             }
@@ -867,17 +805,20 @@
             Dprint( (_L("CSCPServer::CheckISACodeL(): ISA code BLOCKED") ));            
             if (ret==KErrGsmSSPasswordAttemptsViolation)
             {
-            	Dprint( (_L("CSCPServer::CheckISACodeL(): KErrGsmSSPasswordAttemptsViolation") ));            	
+            	Dprint( (_L("CSCPServer::CheckISACodeL(): KErrGsmSSPasswordAttemptsViolation") ));  
+            	RDebug::Print(_L("--> CSCPServer::CheckISACodeL()@@KErrGsmSSPasswordAttemptsViolation"));
             }
             else
             {
             	Dprint( (_L("CSCPServer::CheckISACodeL(): KErrLocked") ));
+            	RDebug::Print(_L("--> CSCPServer::CheckISACodeL()@@KErrLocked"));
             }	            
             ret = KErrLocked;
             if (iConfiguration.iBlockedInOOS == 0)
         	 {
             	iConfiguration.iBlockedInOOS = 1;
             	Dprint( (_L("CSCPServer::CheckISACodeL():iBlockedInOOS = 1, KSCPErrCodeBlockStarted") ));
+            	RDebug::Print(_L("--> CSCPServer::CheckISACodeL()@@@@@"));
             	ret = KSCPErrCodeBlockStarted;	
         	 }
             }            
@@ -885,6 +826,7 @@
             {
             Dprint( (_L("CSCPServer::CheckISACodeL(): ERROR reply checking ISA code: %d"),
                 status.Int() ));
+                RDebug::Print(_L("--> CSCPServer::ValidateConfigurationL()"));
             }            
         }
         TRAPD( err, iConfiguration.WriteSetupL() );
@@ -1002,6 +944,7 @@
     		TRAP(err, repository = CRepository :: NewL(KCRUidSCPLockCode));
     		
     		if(err == KErrNone) {
+    			RDebug::Print(_L("<-- CSCPServer::StoreEnhCode()  setting KSCPLockCodeDefaultLockCode to 0"));
                 err = repository->Set(KSCPLockCodeDefaultLockCode, 0);
                 delete repository;
     		}
@@ -1337,84 +1280,74 @@
     TInt lRetStatus(KErrNone);
     Dprint(_L("[CSCPServer]-> Initiating branching on parameter..."));
     
-    switch ( aID )
-        {
-        case ( ESCPAutolockPeriod ):
-        // Flow through            
-        case ( ESCPMaxAutolockPeriod ):
-            {
+    switch(aID) {
+        case ESCPAutolockPeriod:
+        case ESCPMaxAutolockPeriod: {
             // Convert the value, and set it
             TInt value;
             TLex lex(aValue);
             lRetStatus = lex.Val(value);
-             
 
             if((lRetStatus != KErrNone ) || ( value < 0) || ( value > KSCPAutolockPeriodMaximum )) {
                 lRetStatus = KErrArgument;
                 break;
-                }
+            }
                   
             //Check if the device memory is encrypted or not.
             TBool encryptionEnabled = IsDeviceMemoryEncrypted();
+            CSCPParamDBController* lParamDB = CSCPParamDBController :: NewLC();
             
             // Value OK
-            if(aID == ESCPMaxAutolockPeriod) 
-						{
-						   if (  encryptionEnabled )
-                  {
-                  Dprint(_L("Memory is encrypted"));
-                  if (( 0 == value) || value > KMaxAutolockPeriod)
-                      {
-                      Dprint((_L("Denying setting of max auto lock as value is %d"), value));
-                      User::Leave( KErrPermissionDenied );
-                      }
-                      
-                  }
-                else
-                    {
+            if(aID == ESCPMaxAutolockPeriod) {
+                if( encryptionEnabled ) {
+                    Dprint(_L("[CSCPServer]-> Memory is encrypted"));
+                    
+                    if(( 0 == value) || value > KMaxAutolockPeriod) {
+                        Dprint((_L("[CSCPServer]-> Denying setting of max auto lock as value is %d"), value));
+                        User :: Leave( KErrPermissionDenied );
+                    }
+                }
+                else {
                     Dprint(_L("Memory is decrypted, hence no restrictions to max autolock"));
-                    }
+                }
                     
-                Dprint(_L("[CSCPServer]-> Branched to ESCPMaxAutolockPeriod..."));
-                CSCPParamDBController* lParamDB = CSCPParamDBController :: NewLC();
+                Dprint(_L("[CSCPServer]-> Branched to ESCPMaxAutolockPeriod..."));                
                 lRetStatus = SetBestPolicyL(RTerminalControl3rdPartySession :: EMaxTimeout, aValue, aCallerIdentity, lParamDB);
 
-                if(lRetStatus == KErrNone) 
-								{
+                if(lRetStatus == KErrNone) {
                     // Do we have to change the Autolock period as well?
                     TInt currentALperiod;
                     lRetStatus = GetAutolockPeriodL(currentALperiod);
 
-                    if(lRetStatus == KErrNone) 
-										{
-                        if((iConfiguration.iMaxTimeout > 0) && ((iConfiguration.iMaxTimeout < currentALperiod) || (currentALperiod == 0))) 
-												{
+                    if(lRetStatus == KErrNone) {
+                        if( (iConfiguration.iMaxTimeout > 0) && 
+                            ((iConfiguration.iMaxTimeout < currentALperiod) ||
+                            (currentALperiod == 0))) {
+                        
                            Dprint((_L("[CSCPServer]-> Changing AL period to Max. AL period (Current ALP: %d, Max. ALP: %d)"), currentALperiod, value));
-                           lRetStatus = SetAutolockPeriodL(value);
+                           //lRetStatus = SetAutolockPeriodL(value);                           
+                           /*
+                            * Call to SetBestPolicyL will not check for Stronger/Weaker. The value of ETimeout just gets stored in 
+                            * both the internal DB and the CenRep
+                           */
+                           lRetStatus = SetBestPolicyL(RTerminalControl3rdPartySession :: ETimeout, aValue, aCallerIdentity, lParamDB);
                         }
                     }
-                    else 
-										{
+                    else {
                         Dprint((_L("[CSCPServer]-> ERROR: Couldn't get the Autolock period: %d"), lRetStatus));
                     }
                 }
+            }
+            // Autolock Period
+            else {
+                //Code is commented as it is already taken care by the below condition #1343 irrespective of the drive encryption state.
+                /*  if ( 0 == value ) {
+                    if(encryptionEnabled) {
+                        Dprint(_L("Permission denied!"));
+                        User :: Leave(KErrPermissionDenied);
+                    }
+                }*/
 
-                CleanupStack :: PopAndDestroy(); //lParamDB
-            }
-            
-            else 
-            { // Autolock Period
-            	
-            			//Code is commented as it is already taken care by the below condition #1343 irrespective of the drive encryption state.
-            	     /*  if ( 0 == value )
-                    {
-                    if ( encryptionEnabled )
-                        {
-                        Dprint(_L("Permission denied!"));
-                        User::Leave( KErrPermissionDenied );
-                        }
-                    }*/
-                    
                 Dprint(_L("[CSCPServer]-> Branched to ESCPAutolockPeriod..."));
                 //  Check if this value is not allowed by the Max. Autolock period
                 if ((iConfiguration.iMaxTimeout > 0) && ((iConfiguration.iMaxTimeout < value) || (value == 0))) {
@@ -1423,13 +1356,20 @@
                     lRetStatus = KErrArgument;
                 }
                 else {
-                    lRetStatus = SetAutolockPeriodL(value);
+                    //lRetStatus = SetAutolockPeriodL(value);
+                    /*
+                     * Call to SetBestPolicyL will not check for Stronger/Weaker. The value of ETimeout just gets stored in 
+                     * both the internal DB and the CenRep
+                    */
+                    lRetStatus = SetBestPolicyL(RTerminalControl3rdPartySession :: ETimeout, aValue, aCallerIdentity, lParamDB);
 
                     if(lRetStatus != KErrNone) {
                         Dprint((_L("[CSCPServer]-> ERROR: Couldn't set the Autolock period: %d"), lRetStatus));
                     }
                 }
             }
+            
+            CleanupStack :: PopAndDestroy(); //lParamDB
         }
         break;
         case ESCPCodeChangePolicy:
@@ -1757,7 +1697,6 @@
             
             if ( getFromCommonStorage )
                 {
-                Dprint(_L("[CSCPServer]-> Fetching from Common storage..."));
                 // OK, no objection, so try to get the value from common storage
                 ret = iPluginEventHandler->GetParameters().Get( aID, aValue );
                 }            
@@ -2070,13 +2009,13 @@
 //  
 TInt CSCPServer::IsCorrectEnhCode( TDes& aCode, TInt aFlags )
     {
-    Dprint( (_L("CSCPServer::IsCorrectEnhCode") ));
+    Dprint( (_L("CSCPServer::IsCorrectEnhCode(): ") ));
     if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
     {
     	return KErrNotSupported;
     }
     TInt ret = KErrAccessDenied;
-    
+   
     // Hash the code
     TBuf<KSCPMaxHashLength> hashBuf;
     hashBuf.Zero();
@@ -2091,14 +2030,17 @@
     TBool enhancedCodeMatches = EFalse;
     if ( hashBuf.Compare( iConfiguration.iEnhSecCode ) == 0 )
         {
+        	Dprint( (_L("CSCPServer::IsCorrectEnhCode(): enh code matches.") ));
         enhancedCodeMatches = ETrue;
         }
         
     // Check if the code is blocked (don't check if we're out-of-sync)
     if ( ( iConfiguration.iConfigFlag == KSCPConfigOK ) && ( IsCodeBlocked() ) )
         {
+        	Dprint( (_L("CSCPServer::IsCorrectEnhCode(): 1") ));
         if ( aFlags & KSCPEtelRequest )
             {
+            	Dprint( (_L("CSCPServer::IsCorrectEnhCode(): 2") ));
             // Check if the code is correct
             if ( enhancedCodeMatches )
                 {
@@ -2112,6 +2054,7 @@
             else 
                 {
                 // OK, the code is already invalid
+                Dprint( (_L("CSCPServer::IsCorrectEnhCode(): 3") ));
                 SendInvalidDOSCode( pswCandidate );
                 }
             }
@@ -2124,6 +2067,7 @@
         {
         // Normal situation: we have the correct code stored.
         // Compare the hashes (hashing error will result in EFalse )
+        Dprint( (_L("CSCPServer::IsCorrectEnhCode(): 4") ));
         if ( enhancedCodeMatches )
             {
             ret = KErrNone;
@@ -2131,6 +2075,7 @@
             if ( aFlags & KSCPEtelRequest )
                 {
                 // Send the correct code to DOS side
+                Dprint( (_L("CSCPServer::IsCorrectEnhCode(): 5") ));
                 TRAP( ret, CheckISACodeL( pswCandidate ) );
                 }  
                 
@@ -2139,7 +2084,7 @@
                 if ( iConfiguration.iFailedAttempts > 0 )
                     {
                     iConfiguration.iFailedAttempts = 0;  
-                    Dprint( (_L("CSCPServer::IsCorrectEnhCode():KErrAccessDenied: iFailedAttempts (%d)."), iConfiguration.iFailedAttempts ));
+                    Dprint( (_L("CSCPServer::IsCorrectEnhCode():: iFailedAttempts (%d)."), iConfiguration.iFailedAttempts ));
                     writeSetup = ETrue;
                     }                
                 }
@@ -2154,11 +2099,12 @@
             ret = KErrAccessDenied;
             
             iConfiguration.iFailedAttempts++;
-            Dprint( (_L("CSCPServer::IsCorrectEnhCode():KErrAccessDenied: iFailedAttempts (%d)."), iConfiguration.iFailedAttempts ));
+            Dprint( (_L("CSCPServer::IsCorrectEnhCode():@@@: iFailedAttempts (%d)."), iConfiguration.iFailedAttempts ));
             writeSetup = ETrue;
             
             if ( iConfiguration.iFailedAttempts == KSCPCodeBlockLimit )
                 {
+                	Dprint( (_L("CSCPServer::IsCorrectEnhCode(): KSCPCodeBlockLimit  ") ));
                 // Block the code
                 TTime curTime;
                 curTime.UniversalTime();
@@ -2179,63 +2125,60 @@
     else 
         {
         // iConfiguration.iConfigFlag == KSCPConfigInvalid or KSCPConfigUnknown
-        
+
         // We might be out-of-sync, no idea about the real code.
         // Check if the DOS code hashed from the given code is correct.
         Dprint( (_L("CSCPServer::IsCorrectEnhCode(): Attempting to correct OoS situation.") ));
-                
+        if (IsCodeBlocked()) {
+            Dprint( (_L("CSCPServer::IsCorrectEnhCode(): OOS ->KErrLocked  ") ));
+            return KErrLocked;
+        }
         TRAP( ret, CheckISACodeL( pswCandidate ) );
 
-        if ( ret == KErrNone )
-            {
+        if (ret == KErrNone) {
             // OK, we must assume that this is the correct code, since
             // the hashed DOS code is correct. Save the codes, and return OK.
 
             Dprint( (_L("CSCPServer::IsCorrectEnhCode(): Given code has the correct hash (%d)\
                 , saving codes."), ISACode ));
-                
+
             iConfiguration.iEnhSecCode.Zero();
-            iConfiguration.iEnhSecCode.Copy( hashBuf );
+            iConfiguration.iEnhSecCode.Copy(hashBuf);
 
             iConfiguration.iSecCode.Zero();
-            iConfiguration.iSecCode.AppendNum( ISACode );
-            
+            iConfiguration.iSecCode.AppendNum(ISACode);
+
             // Unset the invalid configuration flag
             iConfiguration.iConfigFlag = KSCPConfigOK;
             writeSetup = ETrue;
-            }
-        else
-            {
-				
-            Dprint( (_L("CSCPServer::IsCorrectEnhCode(): Given code does not have the \
-                correct hash: ret; %d user enter password: %d"), ret ));
-			TRAP( ret, CheckISACodeL( aCode ) );
-			if (ret == KErrNone)
-			{
-				//store this code in our interal storage as it is used as oldpassword while changing at ISA side in next command
-				//ChangeISACodeL. 
-				iConfiguration.iSecCode.Zero();
-				iConfiguration.iSecCode.Append( aCode );
-				TRAP(ret,ChangeISACodeL(pswCandidate));
-			}
-			if (ret == KErrNone)
-			{
-			iConfiguration.iEnhSecCode.Zero();
-            iConfiguration.iEnhSecCode.Copy( hashBuf );
+        }
+        else {
+            ret = KErrAccessDenied;
+
+            iConfiguration.iFailedAttempts++;
+            Dprint( (_L("CSCPServer::IsCorrectEnhCode():@@@: iFailedAttempts (%d)."), iConfiguration.iFailedAttempts ));
+            writeSetup = ETrue;
 
-            iConfiguration.iSecCode.Zero();
-            iConfiguration.iSecCode.AppendNum( ISACode );
-            
-            // Unset the invalid configuration flag
-            iConfiguration.iConfigFlag = KSCPConfigOK;
-            writeSetup = ETrue;
-			}
+            if (iConfiguration.iFailedAttempts == KSCPCodeBlockLimit) {
+                Dprint( (_L("CSCPServer::IsCorrectEnhCode(): KSCPCodeBlockLimit  ") ));
+                // Block the code
+                TTime curTime;
+                curTime.UniversalTime();
+
+                iConfiguration.iBlockedAtTime.Zero();
+                iConfiguration.iBlockedAtTime.AppendNum(curTime.Int64());
+
+                // The code will be blocked for now on
+                ret = KSCPErrCodeBlockStarted;
             }
         }
+
+    }
     
     // Write setup if needed
     if ( writeSetup )
         {
+        	Dprint( (_L("CSCPServer::IsCorrectEnhCode(): 7  ") ));
         TRAPD( err, iConfiguration.WriteSetupL() );
         if ( err != KErrNone )
             {
@@ -2243,7 +2186,7 @@
                 failed to write configuration: %d"), err ));                                        
             }                 
         }
-    Dprint( (_L("CSCPServer::IsCorrectEnhCode %d"), ret )); 
+        
     return ret;
     }
     
@@ -2364,7 +2307,7 @@
                                         CSCPParamObject*& aRetParams,
                                         TSCPSecCode& aNewDOSCode )
     {        
-    Dprint(_L("CSCPServer::CheckAndChangeEnhCodeL >>"));
+    
     if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
     {
     	return KErrNotSupported;
@@ -2383,47 +2326,66 @@
         CSCPParamObject* repParams = 
             iPluginManager->PostEvent( KSCPEventAuthenticationAttempted, *inParams );
         
-        if ( repParams != NULL ) {
-            // Ignore the return params at this point
-            delete repParams;
-       	}  
-		
-        CleanupStack::PopAndDestroy(inParams);
-        
-        ret = ValidateLockcodeAgainstPoliciesL(aNewPass, aRetParams);
-        
-        if(ret != KErrNone) {
-            Dprint(_L("[CSCPServer]-> ValidateLockcodeAgainstPoliciesL() failed in CheckAndChangeEnhCodeL() ret=%d"), ret);
-            return ret;
-        }
-
-
-        if ( IsValidEnhCode( aNewPass ) )
-            {
-            ret = StoreEnhCode( aNewPass, &aNewDOSCode );
-            }                        
-        else
-            {
-            // Invalid code format! Should not happen at this point, but make sure.
-            ret = KErrArgument; 
-            }
-            
-        if ( ret == KErrNone )
-            {
-            CSCPParamObject* inParams = CSCPParamObject::NewL();
-            CleanupStack::PushL( inParams );
-            inParams->Set( KSCPParamPassword, aNewPass );
-    
-            CSCPParamObject* repParams = 
-                iPluginManager->PostEvent( KSCPEventPasswordChanged, *inParams );
-    
-            CleanupStack::PopAndDestroy( inParams );
-        
-            if ( repParams != NULL )            
+        if ( repParams != NULL )            
                 {
                 // Ignore the return params at this point
                 delete repParams;
+                }  
+                
+        inParams->Reset();
+        
+        // Validate the code                
+        inParams->Set( KSCPParamPassword, aNewPass );
+        
+        repParams = iPluginManager->PostEvent( KSCPEventValidate, *inParams );
+        
+        CleanupStack::PopAndDestroy( inParams );
+        
+        if ( repParams != NULL )
+            {
+            // Check if the validation failed
+            TInt status;
+            if ( repParams->Get( KSCPParamStatus, status ) == KErrNone )
+                {
+                if ( status != KErrNone )
+                    {
+                    ret = status;
+                    }
                 }
+                
+            aRetParams = repParams; // pointer ownership changed                           
+            }
+        
+        // Set the new code, if it was OK
+        if ( ret == KErrNone )
+            {
+            if ( IsValidEnhCode( aNewPass ) )
+                {
+                ret = StoreEnhCode( aNewPass, &aNewDOSCode );
+                }                        
+            else
+                {
+                // Invalid code format! Should not happen at this point, but make sure.
+                ret = KErrArgument; 
+                }
+            
+            if ( ret == KErrNone )
+                {
+                CSCPParamObject* inParams = CSCPParamObject::NewL();
+                CleanupStack::PushL( inParams );
+                inParams->Set( KSCPParamPassword, aNewPass );
+        
+                CSCPParamObject* repParams = 
+                    iPluginManager->PostEvent( KSCPEventPasswordChanged, *inParams );
+        
+                CleanupStack::PopAndDestroy( inParams );
+            
+                if ( repParams != NULL )            
+                    {
+                    // Ignore the return params at this point
+                    delete repParams;
+                    }
+                }       
             }
         }    
     else
@@ -2453,7 +2415,7 @@
                 }                            
             }
         }
-    Dprint(_L("[CSCPServer]-> CheckAndChangeEnhCodeL ret=%d"), ret);           
+                
     return ret;    
     }
 
@@ -2487,7 +2449,7 @@
           
 TInt CSCPServer::IsPasswordChangeAllowedL( CSCPParamObject*& aRetParams )
     {
-    Dprint(_L("CSCPServer::IsPasswordChangeAllowedL >>"));
+    
     if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
     {
     	return KErrNotSupported;
@@ -2533,9 +2495,7 @@
 TBool CSCPServer::IsDeviceMemoryEncrypted()
     {
     Dprint(_L("CSCPServer::IsDeviceMemoryEncrypted >>"));
-    
     TBool ret(EFalse);
-    
     //First check if the feature is supported on device
     TRAPD(ferr, FeatureManager::InitializeLibL());
     if (ferr != KErrNone)
@@ -2547,6 +2507,9 @@
     FeatureManager::UnInitializeLib();
  
     //If feature is supported, check if any drive is encrypted.
+
+    
+            
     if (ret)
         {
         RLibrary library;   
@@ -2628,12 +2591,16 @@
 */
 TInt CSCPServer :: SetBestPolicyL( TInt aID, const TDesC& aValue, TUint32 aCallerIdentity, CSCPParamDBController* aParamDB ) {
     Dprint( (_L("[CSCPServer]-> SetBestPolicyL() >>>")));
+    Dprint( (_L("[CSCPServer]-> ParamID=%d "), aID, aValue));
+    Dprint( (_L("[CSCPServer]-> ParamValue=%d "), aValue));
+
     TBool lFirstTime(EFalse);
     TInt32 lNumValue (-1);
     TInt32 lNumValDB (-1);
-    TInt32 lRetStatus = KErrNone;
+    TInt lRetStatus = KErrNone;
 
     switch(aID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
         case RTerminalControl3rdPartySession :: EMaxTimeout:
         case RTerminalControl3rdPartySession :: EPasscodeMinLength:
         case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
@@ -2675,6 +2642,9 @@
     else {
         // Fetch the previous value of the parameter from the private database
         switch(aID) {
+            case RTerminalControl3rdPartySession :: ETimeout:
+                // No need to fetch previous value for ETimeout since Stronger/Weaker check is not required for it.
+                break;
             case RTerminalControl3rdPartySession :: EMaxTimeout:
             case RTerminalControl3rdPartySession :: EPasscodeMinLength:
             case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
@@ -2743,6 +2713,12 @@
 
         // Decision code that verifies if policy is strongest
         switch(aID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
+            /* 
+             * No need to check stronger/weaker for ETimeout. The value just has to be maintained in both
+             * DB and the CenRep
+            */
+            break;
         case RTerminalControl3rdPartySession :: EMaxTimeout:
         case RTerminalControl3rdPartySession :: EPasscodeMaxRepeatedCharacters:
         case RTerminalControl3rdPartySession :: EPasscodeExpiration:
@@ -2796,11 +2772,17 @@
     */
     if (lRetStatus == KErrNone) {
         switch (aID) {
+        case RTerminalControl3rdPartySession :: ETimeout:
+            lRetStatus = SetAutolockPeriodL(TInt(lNumValue));
+            Dprint(_L("[CSCPServer]-> After setting ETimeout lRetStatus = %d "), lRetStatus);
+            break;
+			
         case RTerminalControl3rdPartySession :: EMaxTimeout:
             iConfiguration.iMaxTimeout = lNumValue;
             lRetStatus = iConfiguration.WriteSetupL();
             Dprint(_L("[CSCPServer]-> After setting EMaxTimeout lRetStatus = %d "), lRetStatus);
             break;
+			
         default:
             TUint16* ptr = const_cast<TUint16*>(aValue.Ptr());
             TPtr valBuf(ptr, aValue.Length(), aValue.Length());
@@ -2895,14 +2877,31 @@
                 Dprint(_L("[CSCPServer]-> Old Index of EPasscodeHistoryBuffer=%d"), lHistBuffIndex);
                 Dprint(_L("[CSCPServer]-> Old Index of EPasscodeMinChangeTolerance=%d"), lMinTolIndex);
             }
+			
+            /*
+             * If both ETimeout and EMaxTimeout are marked for cleanup then interchange the cleanup order of 
+             * ETimeout and EMaxTimeout since AutoLock (ETimeout) cannot be disabled
+             * if MaxAutolock (EMaxTimeout) is still enabled
+             */
+            if( lParamIds[0] == RTerminalControl3rdPartySession :: ETimeout &&
+                lParamIds[1] == RTerminalControl3rdPartySession :: EMaxTimeout) {
+            
+                lParamIds[0] = RTerminalControl3rdPartySession :: EMaxTimeout;
+                lParamIds[1] = RTerminalControl3rdPartySession :: ETimeout;
+            }
        	}
 
         for(TInt j=0; j < lCount; j++) {
             TInt lCurrParamID = lParamIds[j];            
             lDefValueBuf->Des().Zero();
             lDefValueBuf->Des().Format(_L("%d "), 0);
+			
             // Initialize the default values here...
             switch(lCurrParamID) {
+                case RTerminalControl3rdPartySession :: ETimeout:
+                    // lDefValueBuf already has the default value, 0 initialized...
+                    lCurrParamID = ESCPAutolockPeriod;
+                    break;
                 case RTerminalControl3rdPartySession :: EMaxTimeout:
                     // lDefValueBuf already has the default value, 0 initialized...
                     lCurrParamID = ESCPMaxAutolockPeriod;
@@ -2931,6 +2930,7 @@
                         
                         for(TInt k=0; k < lDesCount; k++) {
                             TRAP(lStatus, lStatus = SetParameterValueL(lCurrParamID, lDesArr[k]->Des(), lAppID));
+							
                             if(KErrNone != lStatus) {
                                 Dprint(_L("[CSCPServer]-> ERROR: Unable to cleanup parameter %d error %d"), lParamIds[j], lStatus);
                                 lSubOpsFailed = ETrue;
@@ -2944,6 +2944,40 @@
                     CleanupStack :: PopAndDestroy(1); // lDesArray
                 }
                 break;
+				
+                case ESCPAutolockPeriod: {
+                    TInt32 lParamValueDB(0);
+                    TInt lParamValueCenRep(0);
+                    TInt32 lCurrParamOwner(0);
+					
+                    lStatus = lParamDB->GetValueL(RTerminalControl3rdPartySession :: ETimeout, lParamValueDB, lCurrParamOwner);
+					
+                    if(lStatus != KErrNone) {
+                        Dprint(_L("[CSCPServer]-> ERROR: Unable to get current value of ETimeout from DB..."));
+                        lSubOpsFailed = ETrue;
+                        break;
+                    }
+					
+                    lStatus = GetAutolockPeriodL(lParamValueCenRep);
+					
+                    if(lStatus != KErrNone) {
+                        Dprint(_L("[CSCPServer]-> ERROR: Unable to get current value of ETimeout from CenRep..."));
+                        lSubOpsFailed = ETrue;
+                        break;
+                    }
+                    
+                    /*
+                     *  It is possible that AutoLock set from UI is different. In that case internal DB and CenRep 
+                     *  are not in sync. Compare the two values and if they are same assume that the values are in sync.
+                     *  Limitation is that if the user sets the AutoLock with the same value as set by the current app then
+                     *  AutoLock will get disabled.
+                     *  
+                    */
+                    if(lParamValueCenRep != lParamValueDB) {
+                        break;
+                    }
+                }
+				
                 default: {
                     iOverrideForCleanup = ETrue;
                     TRAP(lStatus, lStatus = SetParameterValueL(lCurrParamID, lDefValueBuf->Des(), lAppID));
@@ -2960,7 +2994,8 @@
                         aParamValArray.AppendL(lTmpBuffer);
                     }
                 }
-            }
+                break;
+            };
             
             if(KErrNone != lStatus) {
                 Dprint(_L("[CSCPServer]-> ERROR: Unable to cleanup parameter %d error %d"), lParamIds[j], lStatus);
@@ -2974,131 +3009,6 @@
     return (lSubOpsFailed) ? KErrGeneral : KErrNone;
 }
 
-void CSCPServer :: GetPoliciesL(HBufC8* aAppIDBuffer, TUint32 aCallerIdentity) {
-    TInt lValue;
-    TInt lRet = KErrNone;
-    TBuf<25> lParamValBuf;
-    TPtr8 lBufPtr = aAppIDBuffer->Des();
-    RDesWriteStream lWriteStream(lBufPtr);
-    CleanupClosePushL(lWriteStream);
-    
-    lRet = GetAutolockPeriodL(lValue);
-    
-    if(lRet != KErrNone) {
-        User :: Leave(lRet);
-    }
-    
-    Dprint((_L("[CSCPServer]-> appending AutoLockPeriod value=%d"), lValue));
-    lWriteStream.WriteInt32L(lValue);    
-    
-    Dprint((_L("[CSCPServer]-> appending MaxAutoLockPeriod value=%d"), iConfiguration.iMaxTimeout));
-    lWriteStream.WriteInt32L(iConfiguration.iMaxTimeout);
-    
-    if(FeatureManager :: FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) {
-        Dprint(_L("[CSCPServer]-> (FeatureManager :: FeatureSupported() complete. Fetching values now..."));
-        /* Fetch parameters starting from RTerminalControl3rdPartySession :: EPasscodeMinLength to 
-         * RTerminalControl3rdPartySession :: EPasscodeMinChangeInterval
-         */
-        TInt lPID = RTerminalControl3rdPartySession :: EPasscodeMinLength;
-        
-        for(; lPID <= RTerminalControl3rdPartySession :: EPasscodeDisallowSimple; lPID++) {
-            switch(lPID) {
-                default:
-                    break;
-                case RTerminalControl3rdPartySession :: EPasscodeCheckSpecificStrings:
-                case RTerminalControl3rdPartySession :: EPasscodeAllowSpecific:
-                case RTerminalControl3rdPartySession :: EPasscodeClearSpecificStrings:
-                    // No need to fetch these three parameters
-                    continue;
-                case RTerminalControl3rdPartySession :: EPasscodeDisallowSpecific:
-                    Dprint(_L("[CSCPServer]-> appending EPasscodeDisallowSpecific value..."));
-                    // Get on EPasscodeDisallowSpecific returning -1 instead
-                    lWriteStream.WriteInt32L(-1);
-                    continue;
-                case RTerminalControl3rdPartySession :: EPasscodeDisallowSimple:
-                    Dprint(_L("[CSCPServer]-> appending EPasscodeDisallowSimple value..."));
-                    lWriteStream.WriteInt32L(1);
-                    lWriteStream.WriteInt32L(1);
-                    continue;
-            }
-            
-            //lRet = GetParameterValueL(lPID, lParamValBuf, aCallerIdentity);
-            lRet = iPluginEventHandler->GetParameters().Get(lPID, lValue);
-            
-            switch(lRet) {
-                
-                
-                case KErrNotFound: {
-                    switch(lPID) {
-                        case RTerminalControl3rdPartySession :: EPasscodeMinLength:
-                            lValue = KSCPPasscodeMinLength;
-                            break;
-                        case RTerminalControl3rdPartySession :: EPasscodeMaxLength:
-                            lValue = KSCPPasscodeMaxLength;
-                            break;
-                        default:
-                            lValue = 0;
-                            break;
-                    }
-                }
-                break;
-                case KErrNone: {
-//                    TLex lLex(lParamValBuf);
-//                    lRet = lLex.Val(lValue);                    
-//                    User :: LeaveIfError(lRet);
-                }
-                break;
-                default:
-                    User :: Leave(lRet);
-            }
-            
-            Dprint((_L("[CSCPServer]-> appending value for lPID=%d"), lPID));
-            Dprint((_L("[CSCPServer]-> lValue=%d"), lValue));            
-            
-            switch(lPID) {
-                default:
-                    lWriteStream.WriteInt32L(lValue);
-                    break;
-                case RTerminalControl3rdPartySession :: EPasscodeDisallowSimple:
-                    lWriteStream.WriteInt32L(1);
-                    lWriteStream.WriteInt32L(1);
-                    break;
-            }
-        }
-    }
-    else {
-        Dprint(_L("[CSCPServer]-> (FeatureManager :: FeatureSupported() failed!!..."));
-    }
-    
-    CleanupStack :: PopAndDestroy(1); // lWriteStream
-}
-
-TInt CSCPServer :: ValidateLockcodeAgainstPoliciesL(TDes& aLockcode, CSCPParamObject*& aRetParams) {
-    Dprint( (_L("[CSCPServer]-> ValidateLockcodeAgainstPoliciesL() >>>")));
-    
-    TInt ret = KErrNone;
-    CSCPParamObject* inParams = CSCPParamObject :: NewL();
-    inParams->Set(KSCPParamPassword, aLockcode);
-    CSCPParamObject* repParams = iPluginManager->PostEvent(KSCPEventValidate, *inParams);
-    delete inParams;
-    
-    if (repParams != NULL) {
-        // Check if the validation failed
-        TInt status;
-        
-        if (repParams->Get(KSCPParamStatus, status) == KErrNone) {
-            if (status != KErrNone) {
-                ret = status;
-            }
-        }
-        
-        aRetParams = repParams; // pointer ownership changed
-    }
-    
-    Dprint( (_L("[CSCPServer]-> ValidateLockcodeAgainstPoliciesL() <<<")));
-    return ret;
-}
-
 //#endif //  __SAP_DEVICE_LOCK_ENHANCEMENTS
 // <<<< ********************** NEW FEATURES ********************
 
--- a/terminalsecurity/SCP/SCPServer/src/SCPSession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPServer/src/SCPSession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -110,7 +110,6 @@
     iPendingCallStatus = NULL;
     
     iServer.SessionClosed();
-    
     if(iALParamValue) {
 		delete iALParamValue;		
     }
@@ -424,7 +423,6 @@
         User::Leave( KErrGeneral );
         }
      
-    
     // Create a timer object for this call
     iLockOperationTimer = CSCPTimer::NewL( KSCPLockOperationTimeout, NULL, this );
      
@@ -574,29 +572,8 @@
     Dprint( (_L("<-- CSCPSession::HandleGetLockStateMessageL()") ));
     }	
 		
-void CSCPSession :: HandleGetPoliciesL(const RMessage2 &aMessage) {
-    #ifdef SCP_ENFORCE_SECURITY
-    // Check the access for this parameter
-    if((aMessage.SecureId() != KSCPServerSIDTerminalControl) &&
-       (aMessage.SecureId() != KSCPServerSIDGeneralSettings) &&
-       (aMessage.SecureId() != KDevEncUiUid)) {
-       
-        Dprint((_L("CSCPSession::HandleSetParamMessageL(): ERROR: Permission denied")));
-        User :: Leave( KErrPermissionDenied);
-    }
-    #endif // SCP_ENFORCE_SECURITY
-    
-    // Init a local buffer to store the return value
-    HBufC8* lBuffer = HBufC8 :: NewLC(aMessage.GetDesMaxLength(1));
-
-    iServer.GetPoliciesL(lBuffer, aMessage.SecureId().iId);
-    Dprint((_L("[CSCPSession]-> iServer.GetPoliciesL complete...")));
-    
-    TPtr8 bufPtr = lBuffer->Des();
-    // OK, send the data to the client side
-    aMessage.WriteL(1, bufPtr);
-    CleanupStack :: PopAndDestroy(1); // lBuffer
-}
+		
+		
 		
 // ---------------------------------------------------------
 // void CSCPSession::HandleSetParamMessageL( const RMessage2 &aMessage )
@@ -876,7 +853,6 @@
     TSecureId id = aMessage.SecureId();
 	
     switch(id.iId) {
-        case KSCPSTIF:
         case KSCPServerSIDAutolock:
         case KAknNfySrvUid:
         case KSCPServerSIDGeneralSettings:
@@ -887,7 +863,7 @@
             break;
         default: {
             Dprint( (_L("[CSCPSession]-> ERROR: Permission denied") ));
-            User::Leave( KErrPermissionDenied );
+        User::Leave( KErrPermissionDenied );
         }
     };
 	
@@ -936,12 +912,37 @@
             returning %d"), ret ));
         User::Leave( ret );            
         }
-    // read failed polices to msg buffer
-    if (addParams != NULL)
+        
+    // If additional parameters are passed to client side, add them to slot 2
+    if ( addParams != NULL )
         {
-        ReadFailedPoliciestoMsgBufferL(addParams,aMessage,2);
+        HBufC8* paramBuf;
+        TInt pRet = addParams->GetBuffer( paramBuf );
+        
+        if ( pRet != KErrNone )
+            {
+            Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                failed to get additional parameter buffer: %d"), pRet ));
+            }
+        else
+            {
+            TPtr8 paramPtr = paramBuf->Des();
+            if ( aMessage.GetDesMaxLength( 2 ) >= paramPtr.Length() )
+                {
+                aMessage.Write( 2, paramPtr );    
+                }
+            else
+                {
+                Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                    WARNING: not enough space for additional parameters") ));                
+                }                
+            
+            delete paramBuf;            
+            }
+        
+        delete addParams;               
         }
-        delete addParams;
+                
     // OK, we either have the correct ISA code or don't, return it to the client in slot 1
     User::LeaveIfError( aMessage.Write( 1, isaCodeToReturn ) );    
             
@@ -958,72 +959,133 @@
 // Status : Approved
 // ---------------------------------------------------------
 //
-void CSCPSession :: HandleChangeEnhCodeMessageL(const RMessage2 &aMessage) {
-    
-    Dprint(_L("[CSCPSession]-> HandleChangeEnhCodeMessage() >>>"));
+void CSCPSession::HandleChangeEnhCodeMessageL( const RMessage2 &aMessage )
+    {
     
-    if(!FeatureManager :: FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) {	
-		FeatureManager :: UnInitializeLib();
-		User :: Leave(KErrNotSupported);
+    if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
+	{	
+		FeatureManager::UnInitializeLib();
+		User::Leave(KErrNotSupported);
 	}
+    Dprint( (_L("--> CSCPSession::HandleChangeEnhCodeMessage()") ));
+    
+    HBufC* oldPassBuf = NULL;
+    HBufC* newPassBuf = NULL;
     
     TInt oldPasswordLen = aMessage.GetDesLength(0);
     TInt newPasswordLen = aMessage.GetDesLength(1);
     
-    if ((newPasswordLen == 0) || (oldPasswordLen == 0)) {
+    if ( ( newPasswordLen == 0 ) || ( oldPasswordLen == 0 ) )
+        {
         // We cannot accept an empty code
-        Dprint(_L("[CSCPSession]-> ERROR: Input buffers are empty!!"));
-        User :: Leave(KErrArgument);
-    }
-
-    TInt lErr = KErrNone;
-    HBufC* oldPassBuf = HBufC :: NewLC(oldPasswordLen);
-    HBufC* newPassBuf = HBufC :: NewLC(newPasswordLen);
+        Dprint( (_L("<-- ERROR: CSCPSession::HandleChangeEnhCodeMessage():\
+            returning KErrArgument, buffer empty") ));
+        User::Leave( KErrArgument );      
+        }
+    else
+        {
+        oldPassBuf = HBufC::NewLC( oldPasswordLen );
+        newPassBuf = HBufC::NewLC( newPasswordLen );
+        }
     
     TPtr oldPassPtr = oldPassBuf->Des();
     TPtr newPassPtr = newPassBuf->Des();
     
     // Read the strings, slot 0 = old password, slot 1 = new password  
-    aMessage.ReadL(0, oldPassPtr);
-    aMessage.ReadL(1, newPassPtr);
+    TRAPD( err, aMessage.ReadL( 0, oldPassPtr ) );
+    TRAP( err, aMessage.ReadL( 1, newPassPtr ) );
         
     // A buffer for the updated DOS password
     TSCPSecCode newDosCode;
-    newDosCode.Zero();
+    newDosCode.Zero();    
+    
+    CSCPParamObject* addParams = NULL;
+    if ( err != KErrNone )
+        {
+        Dprint( (_L("<-- ERROR: CSCPSession::HandleChangeEnhCodeMessage():\
+            failed to read the strings to server side: %d"), err ));        
+        }
+    else
+        {
+        err = iServer.CheckAndChangeEnhCodeL( oldPassPtr, newPassPtr, addParams, newDosCode );
+        }        
     
-    CSCPParamObject* addParams = NULL;    
-    lErr = iServer.CheckAndChangeEnhCodeL(oldPassPtr, newPassPtr, addParams, newDosCode);    
-    CleanupStack :: PushL(addParams);
+    // If additional parameters are passed to client side, add them to slot 2
+    if ( addParams != NULL )
+        {
+        HBufC8* paramBuf;
+        TInt pRet = addParams->GetBuffer( paramBuf );
+        
+        if ( pRet != KErrNone )
+            {
+            Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                failed to get additional parameter buffer: %d"), pRet ));
+            }
+        else
+            {
+            TPtr8 paramPtr = paramBuf->Des();
+            if ( aMessage.GetDesMaxLength( 2 ) >= paramPtr.Length() )
+                {
+                aMessage.Write( 2, paramPtr );    
+                }
+            else
+                {
+                Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                    WARNING: not enough space for additional parameters") ));                
+                }                
+            
+            delete paramBuf;            
+            }
+        
+        delete addParams;               
+        }
+        
+    if ( err == KErrNone )
+        {
+        // Copy the new DOS code to slot 3
+        TInt ret = aMessage.Write( 3, newDosCode );
+        if ( ret != KErrNone )
+            {
+            Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                    WARNING: failed to write the new DOS code to client-side") ));
+            }
+         else
+         	{
+         	/* Get the very first character of the new lock code and set the default input mode of the
+         	lock code query on the basis of the first character. */
+         	ch = newPassPtr[0];
+			def_mode = ch.IsDigit() ? 0 : 1;
+		
+			CRepository* repository = CRepository :: NewL(KCRUidSCPParameters);			
+    		CleanupStack::PushL( repository );
+    	
+    		User::LeaveIfError(repository->Set( KSCPLockCodeDefaultInputMode , def_mode) );
+    		CleanupStack :: PopAndDestroy(repository);
+    		
+   			/* Set the value in the cenrep that the default lock code has been changed if it is not 
+             * already set
+             * */
+			repository = CRepository :: NewL(KCRUidSCPLockCode);
+            CleanupStack :: PushL(repository);
+            User :: LeaveIfError(repository->Set(KSCPLockCodeDefaultLockCode, 0));
+    		CleanupStack::PopAndDestroy( repository );
+    		repository = NULL;    	   	
+         	}
+        }
+        
+    oldPassPtr.Zero();
+    newPassPtr.Zero();
+    CleanupStack::PopAndDestroy( newPassBuf );
+    CleanupStack::PopAndDestroy( oldPassBuf );
     
-    if (addParams != NULL) {
-        ReadFailedPoliciestoMsgBufferL(addParams, aMessage, 2);
+    Dprint( (_L("<-- CSCPSession::HandleChangeEnhCodeMessage(): %d"), err ));
+    
+    if ( err != KErrNone )
+        {
+        User::Leave( err );
+        }
     }
     
-    CleanupStack :: PopAndDestroy(1); //addParams
-
-    if(lErr == KErrNone) {
-        /* Get the very first character of the new lock code and set the default input mode of the
-        lock code query on the basis of the first character. */
-        ch = newPassPtr[0];
-        def_mode = ch.IsDigit() ? 0 : 1;
-    
-        CRepository* repository = CRepository :: NewLC(KCRUidSCPParameters);
-        User :: LeaveIfError(repository->Set(KSCPLockCodeDefaultInputMode, def_mode));
-        CleanupStack :: PopAndDestroy(repository);
-        
-        /* Set the value in the cenrep that the default lock code has been changed if it is not 
-         * already set
-         * */
-        repository = CRepository :: NewLC(KCRUidSCPLockCode);
-        User :: LeaveIfError(repository->Set(KSCPLockCodeDefaultLockCode, 0));
-        CleanupStack :: PopAndDestroy(repository);
-    }
-    
-    CleanupStack :: PopAndDestroy(2); //newPassBuf, oldPassBuf
-    
-    Dprint(_L("[CSCPSession]-> HandleChangeEnhCodeMessage() lErr=%d <<<"), lErr);
-    User :: LeaveIfError(lErr);
-}   
     
 // ---------------------------------------------------------
 // void CSCPSession::HandleQueryChangeMessageL()
@@ -1035,24 +1097,52 @@
     
 void CSCPSession::HandleQueryChangeMessageL( const RMessage2 &aMessage )
     {
-    Dprint( (_L("--> CSCPSession::HandleQueryChangeMessage()") ));
     if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
 	{	
-        Dprint( (_L("--> CSCPSession::HandleQueryChangeMessage() .. Feature not Supported !!") ));
 		FeatureManager::UnInitializeLib();
 		User::Leave(KErrNotSupported);
 	}
+    Dprint( (_L("--> CSCPSession::HandleQueryChangeMessage()") ));
     
     CSCPParamObject* addParams = NULL;
     
     TInt ret = iServer.IsPasswordChangeAllowedL( addParams );        
-    if (ret != KErrNone)
+    
+    // Return the reply in slot 0
+    
+    TPckg<TInt> retPackage(ret);
+    aMessage.WriteL(0, retPackage );
+    
+    // If additional parameters are passed to client side, add them to slot 1
+    if ( addParams != NULL )
         {
-        ReadFailedPoliciestoMsgBufferL(addParams,aMessage,0);
-        }
-    if (addParams != NULL)
-        delete addParams;
-    
+        HBufC8* paramBuf;
+        TInt pRet = addParams->GetBuffer( paramBuf );
+        
+        if ( pRet != KErrNone )
+            {
+            Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                failed to get additional parameter buffer: %d"), pRet ));
+            }
+        else
+            {
+            TPtr8 paramPtr = paramBuf->Des();
+            if ( aMessage.GetDesMaxLength( 1 ) >= paramPtr.Length() )
+                {
+                aMessage.Write( 1, paramPtr );    
+                }
+            else
+                {
+                Dprint( (_L("WARNING: CSCPSession::HandleAuthenticationMessage():\
+                    WARNING: not enough space for additional parameters") ));                
+                }                
+            
+            delete paramBuf;            
+            }
+        
+        delete addParams;               
+        }    
+   
     Dprint( (_L("<-- CSCPSession::HandleQueryChangeMessage()") ));    
     }
 
@@ -1356,13 +1446,7 @@
                     
         case ( ESCPServGetParam ):
             {
-                if(aMessage.Int0() == -1) {
-                    HandleGetPoliciesL(aMessage);
-                }
-                else {
-                    HandleGetParamMessageL(aMessage);
-                }
-                
+            HandleGetParamMessageL( aMessage );
             break; 
             }
             
@@ -1413,11 +1497,6 @@
 		    }
             break;
             }
-        case ESCPServValidateLockcode:
-            {
-            ValidateLockcodeAgainstPoliciesL(aMessage);
-            break;
-            }
             
 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS         
                            		
@@ -1462,7 +1541,7 @@
         if(TUint32(id.iUid) != aCallerID) {
             CTC3rdPartyParamsEcomIF* plugin = CTC3rdPartyParamsEcomIF :: NewL(implementation);
             CleanupStack :: PushL(plugin);
-            TRAP_IGNORE( plugin->DeviceLockParamChangedL(aChange));
+            TRAPD(leaveCode, plugin->DeviceLockParamChangedL(aChange));
             CleanupStack :: PopAndDestroy(); // plugin 
         }
 
@@ -1476,19 +1555,24 @@
 }
 
 TInt CSCPSession :: HandleCleanupL(const RMessage2& aMessage) {
+    Dprint((_L("[CSCPSession]-> HandleCleanupL() >>>")));
+	
+    if( (aMessage.SecureId().iId != KSCPServerSIDTerminalControl) && 
+        (aMessage.SecureId().iId != KSCPEvntHndlrUid)) {
+		
+        Dprint((_L("[CSCPSession]-> ERROR: caller app id=%ld. Permission denied..."), aMessage.SecureId().iId));
+        User :: Leave(KErrPermissionDenied);
+    }
+	
     // Copy the client data into a local buffer
     TInt32 lCount = aMessage.GetDesLength(1);
     
-/*    // If the caller is not SCPEventHandler the deny access
-    if(aMessage.SecureId() != KSCPEvntHndlrUid) {
-        return KErrPermissionDenied;
-    }*/
-    
     // Atleast one application id has to be present in the received message (atleast 8 bytes)
     if(lCount < sizeof(TInt32)) {
         return KErrArgument;
     }
     
+    TInt lStatus = KErrNone;
     RArray<const TParamChange> lChangeArray;
     CleanupClosePushL(lChangeArray);
     
@@ -1497,9 +1581,7 @@
     
     HBufC8* lBuffer = HBufC8 :: NewLC(lCount);
     TPtr8 bufPtr = lBuffer->Des();
-    aMessage.ReadL(1, bufPtr);
-    
-    TInt lStatus = KErrNone;
+    aMessage.ReadL(1, bufPtr);    
     
     TRAPD(lErr, lStatus = iServer.PerformCleanupL(lBuffer, lChangeArray, lParamValArray));
     
@@ -1523,13 +1605,14 @@
     
     lParamValArray.ResetAndDestroy();
     CleanupStack :: PopAndDestroy(3); // lParamIDArray lParamValArray lBuffer    
+    Dprint((_L("[CSCPSession]-> HandleCleanupL() <<<")));
     return lStatus;
 }
 
 TInt CSCPSession :: HandleSetALPeriodL( const RMessage2& aMessage ) {
     Dprint((_L("[CSCPSession]-> HandleSetParamMessageL() >>>")));
     TBool oldALState = EFalse;
-    
+    TBool lNotifyChange = ETrue;
     #ifndef __WINS__ // No need to check for lock setting changes in emulator
     if ( ( (TSCPParameterID)aMessage.Int0() == ESCPAutolockPeriod ) ||
          ( (TSCPParameterID)aMessage.Int0() == ESCPMaxAutolockPeriod ) )    
@@ -1593,68 +1676,7 @@
 	}
 	
 	Dprint(_L("[CSCPSession]->INFO: Initiating notification to all the StakeHolders..."));
-	TRAP_IGNORE( NotifyAllStakeHoldersL(lChangeArray, aCallerID));
+	TRAPD(lErr, NotifyAllStakeHoldersL(lChangeArray, aCallerID));
 	Dprint(_L("[CSCPSession]->INFO: Notification to all the StakeHolders complete..."));
 	CleanupStack :: PopAndDestroy(); //lChangeArray
 }
-
-void CSCPSession :: ReadFailedPoliciestoMsgBufferL(CSCPParamObject*& aParamObject, const RMessage2& aMessage, TInt aSlotNumber) {
-    Dprint((_L("[CSCPSession]-> ReadFailedPoliciestoMsgBufferL() >>>")));
-    //get failed polices array from param object
-    const RArray<TInt>& failedPolicesArray = aParamObject->GetFailedPolices();
-    
-    // extra one for failed policies count
-    HBufC8* failedPoliciesBuf = HBufC8 :: NewLC((EDevicelockTotalPolicies+1) * sizeof(TInt32));
-    TPtr8 failedpoliciesBufPtr = failedPoliciesBuf->Des();
-    
-    RDesWriteStream writeStream(failedpoliciesBufPtr);
-    CleanupClosePushL(writeStream);
-    
-    writeStream.WriteInt32L(failedPolicesArray.Count());
-    
-    for(int count =0; count < failedPolicesArray.Count(); count++) {
-        writeStream.WriteInt32L(failedPolicesArray[count]);
-    }
-    
-    writeStream.CommitL();
-    aMessage.WriteL(aSlotNumber, failedPoliciesBuf->Des());
-    CleanupStack :: PopAndDestroy(2); //writeStream, failedPoliciesBuf
-    Dprint((_L("[CSCPSession]-> ReadFailedPoliciestoMsgBufferL() <<<")));
-}
-
-void CSCPSession :: ValidateLockcodeAgainstPoliciesL(const RMessage2& aMessage) {
-    Dprint((_L("[CSCPSession]-> ValidateLockcodeAgainstPolicies() <<<")));
-    TInt lRet = KErrNone;
-    HBufC* lockcodeBuf = NULL;
-    CSCPParamObject* addParams = NULL;
-    TInt lockcodeLen = aMessage.GetDesLength(0);
-    Dprint( (_L("CSCPSession :: ValidateLockcodeAgainstPoliciesL: lockcodeLen ->%d"), lockcodeLen ));
-    if (lockcodeLen == 0) {
-        User :: Leave(KErrArgument);
-    }
-    else {
-        lockcodeBuf = HBufC :: NewLC(lockcodeLen);
-    }
-    
-    TPtr lockcodeptr = lockcodeBuf->Des();
-    TRAP( lRet, aMessage.ReadL( 0, lockcodeptr ) );
-    User :: LeaveIfError(lRet);
-    
-    lRet = iServer.ValidateLockcodeAgainstPoliciesL(lockcodeptr, addParams);
-    
-    if(addParams) {
-        CleanupStack :: PushL(addParams);
-    }
-    
-    if (lRet != KErrNone) {
-        ReadFailedPoliciestoMsgBufferL(addParams, aMessage, 1);
-    }
-    
-    if(addParams) {
-        CleanupStack :: PopAndDestroy(addParams);
-    }
-    
-    CleanupStack :: PopAndDestroy(1); // lockcodeBuf
-    Dprint((_L("[CSCPSession]-> ValidateLockcodeAgainstPolicies() <<<")));
-    User :: LeaveIfError(lRet);
-}
--- a/terminalsecurity/SCP/SCPTimestampPlugin/group/SCPTimestampPlugin.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/group/SCPTimestampPlugin.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -33,6 +33,7 @@
 SOURCEPATH      ../src
 SOURCE          SCPTimestampPlugin.cpp
 SOURCE          SCPTimestampPluginImpCollection.cpp
+SOURCE          SCPUserInf.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
@@ -52,7 +53,7 @@
 LANGUAGE_IDS
 END
 
-
+LIBRARY 	avkon.lib eikcdlg.lib eikctl.lib 
 LIBRARY         euser.lib 
 LIBRARY         ecom.lib 
 LIBRARY         scpclient.lib
@@ -70,7 +71,9 @@
 LIBRARY					flogger.lib
 LIBRARY         featmgr.lib
 #ifdef RD_MULTIPLE_DRIVE
-LIBRARY         PlatformEnv.lib 
+LIBRARY         platformenv.lib 
 #endif
 
+SMPSAFE
+
 // End of File
--- a/terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPTimestampPlugin.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPTimestampPlugin.h	Wed Sep 01 12:27:42 2010 +0100
@@ -26,7 +26,7 @@
 #include <barsc.h>
 
 #include <TerminalControl3rdPartyAPI.h>
-
+#include "SCPUserInf.h"
 
 // LOCAL CONSTANTS
 const TInt KSCPMaxExpiration = 365;
@@ -51,6 +51,8 @@
 const TInt KSCPTypeHours = 1;
 const TInt KSCPTypeDays = 2;
 
+const TInt KSCPNoteTimeout = 2000000;
+
 _LIT( KSCPTSConfigFile, "SCPTimestampPlugin.ini");
 _LIT( KDriveZ, "Z:" );
 _LIT(KSCPTimestampPluginResFilename, "\\Resource\\SCPTimestampPluginLang.rsc");
@@ -86,7 +88,7 @@
         /**
         * Event handler
         */		
-	    void HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam );
+		CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam );
 		
 		void SetEventHandler( MSCPPluginEventHandler* aHandler );
 
@@ -107,25 +109,25 @@
 		/**        
         * Checks if the minimum timeout has expired since the last change
         */
-		void IsChangeAllowedL( CSCPParamObject& aParam, CSCPParamObject& aRetParams );	 
+		void IsChangeAllowedL( CSCPParamObject& aParam, CSCPParamObject*& aRetParams );	 
 		
 		/**        
         * Updates the status when the password is changed
         */
-        void PasswordChanged( CSCPParamObject& aParam, CSCPParamObject& aRetParams );
+        void PasswordChanged( CSCPParamObject& aParam, CSCPParamObject*& aRetParams );
         
 		/**
         * Updates the status when after an authentication attempt
         */
         void AuthenticationAttempt( TBool aIsSuccessful, 
                                     CSCPParamObject& aParam,
-                                    CSCPParamObject& aRetParams );
+                                    CSCPParamObject*& aRetParams );
                                     
 		/**
         * Updates the status after successful authentication
         */
         void SuccessfulAuthenticationL( CSCPParamObject& aParam,
-                                       CSCPParamObject& aRetParams );
+                                       CSCPParamObject*& aRetParams );
         
         
 		/**
@@ -139,12 +141,12 @@
         */
         void ConfigurationQuery(    TInt aParamID, 
                                     CSCPParamObject& aParam, 
-                                    CSCPParamObject& aRetParams );
+                                    CSCPParamObject*& aRetParams );
                                     
         /**
         * Initiates RFS Deep (device wipe)
         */
-        void WipeDeviceL( CSCPParamObject& aRetParams );
+        void WipeDeviceL( CSCPParamObject*& aRetParams );
                                     
 		/**
         * Read the configuration from flash.
@@ -194,6 +196,7 @@
 	    
 	    /* Resource-file indicator */
 	    TBool iResOpen;   
+	    CSCPUserInf *iUserInfo;
     };
 
 #endif // __CSCPPTIMESTAMPPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPUserInf.h	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2000 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: CSCPUserInf declaration
+*
+*/
+
+#ifndef CSCPUSERINF_H
+#define CSCPUSERINF_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+class CSCPUserInf : public CActive
+    {
+public:
+    // Cancel and destroy
+    ~CSCPUserInf();
+
+    // Two-phased constructor.
+    static CSCPUserInf* NewL();
+
+    // Two-phased constructor.
+    static CSCPUserInf* NewLC();
+
+public:
+    // New functions
+    // Function for making the initial request
+    void StartL(TDesC& aString);
+    void DoRfsL();
+private:
+    // C++ constructor
+    CSCPUserInf();
+
+    // Second-phase constructor
+    void ConstructL();
+
+private:
+    // From CActive
+    // Handle completion
+    void RunL();
+
+    // How to cancel me
+    void DoCancel();
+
+    // Override to handle leaves from RunL(). Default implementation causes
+    // the active scheduler to panic.
+    TInt RunError(TInt aError);
+
+private:
+    enum TCSCPUserInfState
+        {
+        EGlobalConf, // Uninitialized
+        ERfs, // Initalized
+        EError
+        // Error condition
+        };
+
+private:
+    TInt iState; // State of the active object
+    //RTimer iTimer; // Provides async timing service
+    HBufC16* idispText;
+    };
+
+#endif // CSCPUSERINF_H
--- a/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -21,27 +21,25 @@
 #include <e32std.h>
 #include <ecom/implementationproxy.h>
 #include <SCPParamObject.h>
-#include <SCPServerInterface.h>
-#include <scptimestamppluginlang.rsg>
+#include <SCPTimestampPluginLang.rsg>
 #include "SCP_IDs.h"
 #include <bautils.h>
 #include <hal.h>
 #include <AknGlobalNote.h>
-#include <AknGlobalConfirmationQuery.h>
 // For wipe
-#include <starterclient.h>
-#include <sysutil.h>
-#include <syslangutil.h>
-#include <rfsClient.h>
-#include "DMUtilClient.h"
+//#include <StarterClient.h>
+//#include <sysutil.h>
+//#include <SysLangUtil.h>
+//#include <rfsClient.h>
+//#include "DMUtilClient.h"
 
 #include "SCPTimestampPlugin.h"
 #include <featmgr.h>
-#ifdef RD_MULTIPLE_DRIVE
-#include <driveinfo.h>
-#include <pathinfo.h>
-#include <f32file.h>
-#endif //RD_MULTIPLE_DRIVEs
+//#ifdef RD_MULTIPLE_DRIVE
+//#include <DriveInfo.h>
+//#include <PathInfo.h>
+//#include <f32file.h>
+//#endif //RD_MULTIPLE_DRIVEs
 // CONSTANTS
 
 // ============================= LOCAL FUNCTIONS  =============================
@@ -101,6 +99,7 @@
    		User::Leave( KErrNotSupported );
   	}
    	FeatureManager::UnInitializeLib();  
+	iUserInfo = CSCPUserInf::NewL();
     Dprint ( ( _L( "CSCPTimestampPlugin::ConstructL()" ) ) );    
     
     return;
@@ -126,6 +125,8 @@
         iConfiguration = NULL;
         }
 
+    if(iUserInfo)
+        delete iUserInfo;
     Dprint( ( _L( "<-- CSCPTimestampPlugin::~CSCPTimestampPlugin()" ) ) );
     return;
     }
@@ -139,9 +140,11 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //    
-void CSCPTimestampPlugin :: HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam )
-	{
+CSCPParamObject* CSCPTimestampPlugin::HandleEvent( TInt aID, CSCPParamObject& aParam )
+	{		
 	Dprint ( ( _L( "CSCPTimestampPlugin::HandleEvent()" ) ) );		
+    	
+	CSCPParamObject* retParams = NULL;
 	
 	// Get our current functional configuration
 	if ( iEventHandler->GetParameters().Get( 
@@ -164,8 +167,18 @@
 	    {
 	    iMaxAttempts = 0;
 	    }	    	    
-	Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): iExpiration :%d, iExpiration :%d, iMinTolerance :%d, iMaxAttempts :%d"), iExpiration,iMinInterval,iMinTolerance,iMaxAttempts ) ); 
-	Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): aID is :%d"), aID) );
+	    
+	if ( !iResOpen )
+	    {
+	    // Load the resource file containing the localized texts
+        TInt ret = GetResource();
+        if ( ret == KErrNone )
+            {
+            iResOpen = ETrue;
+            }
+        // We'll continue without the resource if required
+	    }		    
+	
 	switch ( aID )
 	    {	    	    
 	    case ( KSCPEventPasswordChangeQuery ):
@@ -173,7 +186,7 @@
 	        if ( iMinInterval > 0 )
                 {   
 	            // Ignore errors, the plugin will stay silent on error
-	            TRAP_IGNORE( IsChangeAllowedL( aParam, aOutParam ) );
+	            TRAP_IGNORE( IsChangeAllowedL( aParam, retParams ) );
                 }
 	        break;
 	        }
@@ -185,7 +198,7 @@
 	            	            
 	        if ( aParam.Get( KSCPParamID, paramID ) == KErrNone ) 
 	            {	                
-	            ConfigurationQuery( paramID, aParam, aOutParam );
+	            ConfigurationQuery( paramID, aParam, retParams );
 	            }
 	                	                	            
 	        break;
@@ -193,7 +206,7 @@
 
 	    case ( KSCPEventPasswordChanged ):
 	        {	            
-	        PasswordChanged( aParam, aOutParam );
+	        PasswordChanged( aParam, retParams );
 	        break;
 	        }
 
@@ -204,7 +217,7 @@
                 {
                 TBool isSuccess = ( authStatus == KErrNone );
                 // No return value required in any case
-                AuthenticationAttempt( isSuccess, aParam, aOutParam );
+                AuthenticationAttempt( isSuccess, aParam, retParams );
                 }	            
            	                
             break;
@@ -228,6 +241,7 @@
 	    }	    	    
 	
     // The caller will own this pointer from now on   
+    return retParams; 
 	}
 
 // ----------------------------------------------------------------------------
@@ -253,7 +267,7 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 // 
-void CSCPTimestampPlugin::IsChangeAllowedL( CSCPParamObject& aParam, CSCPParamObject& aRetParams )
+void CSCPTimestampPlugin::IsChangeAllowedL( CSCPParamObject& aParam, CSCPParamObject*& aRetParams )
     {  
     (void)aParam;
                           
@@ -283,7 +297,8 @@
         iConfiguration->Get( KSCPUsedTolerance, tolerance ); // ignore errors
         Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): tolerance get: %d"), tolerance ) );                
         Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): iMinTolerance : %d"), iMinTolerance ) );                
-        if ( tolerance >= iMinTolerance )
+
+        if ( iMinTolerance > 0 && tolerance >= iMinTolerance )
             {
             ret = KErrSCPCodeChangeNotAllowed;
             Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL() KErrSCPCodeChangeNotAllowed") )); 
@@ -299,10 +314,79 @@
     
     if ( ret == KErrSCPCodeChangeNotAllowed )
         {
-        Dprint ( ( _L( "EDeviceLockMinChangeTolerance Failed" ) ) );
-        aRetParams.AddtoFailedPolices(EDeviceLockMinChangeTolerance);
-        aRetParams.Set( KSCPParamStatus, KErrSCPCodeChangeNotAllowed );
+        // Code change is not allowed, send the info back to the user
+        aRetParams  = CSCPParamObject::NewL();        
+                        
+        aRetParams->Set( KSCPParamStatus, KErrSCPCodeChangeNotAllowed );			        			        
+        aRetParams->Set( KSCPParamAction, KSCPActionShowUI );
+        aRetParams->Set( KSCPParamUIMode, KSCPUINote );
+        aRetParams->Set( KSCPParamNoteIcon, KSCPUINoteError );
+        
+        HBufC16* resText = NULL;
+        HBufC16* formatBuf = NULL;
+                
+        Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): iMinInterval : %d"), iMinInterval ) );                
+        Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): iMinTolerance : %d"), iMinTolerance ) );                 
+        if ( iMinInterval > 1 )
+            {
+            if ( iMinTolerance >1 )
+                {
+                Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL(): iMinInterval > 1,iMinTolerance >= 1") ));                      
+                resText = LoadResourceL( R_SET_SEC_CODE_CHANGE_DAY );
+                }
+            else
+                {
+                Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL(): iMinInterval > 1,iMinTolerance !>= 1") ));                      
+                resText = LoadResourceL( R_SET_SEC_CODE_CHANGE_HOURS );
+                }
+            }
+        else
+            if ( iMinTolerance > 1 )
+                {
+                Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL(): iMinInterval !> 1,iMinTolerance >= 1") ));                      
+                resText = LoadResourceL( R_SET_SEC_CODE_CHANGE_TIMES );
+                }
+            else
+                {
+                Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL(): iMinInterval !> 1,iMinTolerance !>= 1") ));                      
+                resText = LoadResourceL( R_SET_SEC_CODE_CHANGE_ONES );
+                }         
+                
+        CleanupStack::PushL( resText );
+        
+        formatBuf = HBufC::NewL( resText->Length() + KSCPMaxMinChangeValueLen );
+		    
+		TPtr16 bufDes = formatBuf->Des();
+		
+        if ( iMinInterval > 1 )
+            {
+            if ( iMinTolerance > 1 )
+                {
+                bufDes.Format( resText->Des(), iMinTolerance , iMinInterval );
+                }
+            else
+                {
+                bufDes.Format( resText->Des(), iMinInterval );
+                }
+            }
+        else
+            if ( iMinTolerance > 1 )
+                {
+                bufDes.Format( resText->Des(), iMinTolerance  );
+                }
+            else
+                {
+                bufDes.Format( resText->Des() );
+                }  		    	
+		            
+        aRetParams->Set( KSCPParamPromptText, bufDes );
+            
+        delete formatBuf;
+		    
+        CleanupStack::PopAndDestroy( resText );
         }
+        
+    // No need to write configuration changes            
     }
 
 
@@ -313,10 +397,10 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //    
-void CSCPTimestampPlugin::PasswordChanged( CSCPParamObject& aParam, CSCPParamObject& aRetParams )
+void CSCPTimestampPlugin::PasswordChanged( CSCPParamObject& aParam, CSCPParamObject*& aRetParams )
     {
     (void)aParam;
-    
+    (void)aRetParams;    
     Dprint( (_L("CSCPTimestampPlugin::PasswordChanged()") ));                      
     TInt err = ReadConfiguration();
     if ( err == KErrNone )
@@ -342,11 +426,13 @@
             {
             // Set the last time the password was changed, for expiration
             iConfiguration->Set( KSCPLastChangeTime, timeBuf );
-            }        
+            }
+
         Dprint( ( _L( "CSCPPatternPlugin::PasswordChanged(): iMinInterval: %d"), iMinInterval ) );
-        if ( iMinInterval > 0 )
-            {
+
+        if ( iMinInterval > 0 && iMinTolerance > 0) {
             TInt ret = IsAfter( KSCPIntervalStartTime, iMinInterval, KSCPTypeHours );
+
             if ( ret == KSCPIsAfter )
                 {                                                        
                 // Interval exceeded, start a new interval from here
@@ -378,7 +464,12 @@
                 Dprint( ( _L( "CSCPPatternPlugin::PasswordChanged(): tolerance set: %d"), tolerance ) );  
                 }                       
             }        
-        
+		else {
+			iConfiguration->Set( KSCPIntervalStartTime, 0 );
+			iConfiguration->Set( KSCPUsedTolerance, 0 );
+		}
+
+
         WriteConfiguration();
         }
         else
@@ -396,20 +487,20 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //    
-void CSCPTimestampPlugin :: AuthenticationAttempt( TBool aIsSuccessful, 
+void CSCPTimestampPlugin::AuthenticationAttempt( TBool aIsSuccessful, 
                                                  CSCPParamObject& aParam,
-                                                 CSCPParamObject& aRetParams )
+                                                 CSCPParamObject*& aRetParams )
     {
-    Dprint( (_L("CSCPTimestampPlugin::AuthenticationAttempt") )); 
     if ( ReadConfiguration() != KErrNone )
         {
         return;
         }
+    Dprint( (_L("CSCPTimestampPlugin::AuthenticationAttempt()") )); 
         
     // Check if immediate expiration is set
     TInt expireNow = 0;
     iConfiguration->Get( KSCPExpireOnNextCall, expireNow ); // ignore errors  
-    Dprint( ( _L( "CSCPPatternPlugin::AuthenticationAttempt(): expireNow = %d"), expireNow ) );
+    
     if ( ( iExpiration == 0 ) && ( iMaxAttempts == 0) && ( expireNow == 0 ) )
         {
         return; // We have no interest in this call
@@ -424,20 +515,27 @@
         // Failed authentication attempt
         if ( iMaxAttempts > 0 )
             {
+		    Dprint( (_L("CSCPTimestampPlugin::iMaxAttempts > 0") )); 
             TInt failedCount = 0;
             iConfiguration->Get( KSCPFailedAttempts, failedCount ); // ignore errors
             failedCount++;                        
         
             if ( failedCount == iMaxAttempts - 1 )
                 {
-                Dprint ( ( _L( "EDeviceLockAllowedMaxAtempts Failed" ) ) );
-                aRetParams.AddtoFailedPolices(EDeviceLockAllowedMaxAtempts);
+                // Warn the user. Only one attempt left. There's no use handling the error
+                // so we'll just stay silent at this point on failure.
+		        Dprint( (_L("CSCPTimestampPlugin::One Attempt Left") ));
+				HBufC16* resText = NULL;
+                resText = LoadResourceL( R_SET_SEC_CODE_WARNING_ATTEMPTS_LEFT );
+                FormatResourceString(*resText);               
+				// Call the dialog from an ActiveObj framework so that we could give control back to secui
+		        Dprint( (_L("CSCPTimestampPlugin::start actv obj for dialog") ));
+                iUserInfo->StartL(*resText);
                 }
             else if ( failedCount >= iMaxAttempts )
                 {
                 // Try to wipe the device
                 TRAPD( err, WipeDeviceL( aRetParams ) );
-                
                 if ( err != KErrNone )
                     {
                     Dprint( ( _L( "CSCPPatternPlugin::\
@@ -461,9 +559,8 @@
 // ----------------------------------------------------------------------------
 //
 void CSCPTimestampPlugin::SuccessfulAuthenticationL( CSCPParamObject& aParam,
-                                                    CSCPParamObject& aRetParams )
+                                                    CSCPParamObject*& aRetParams )
     {
-    Dprint( (_L("CSCPTimestampPlugin::IsAfter()..enter") ));
     // Reset the failed attempts -counter
     if ( iMaxAttempts > 0 )
         {
@@ -477,7 +574,7 @@
     // Check if immediate expiration is set
     TInt expireNow = 0;
     iConfiguration->Get( KSCPExpireOnNextCall, expireNow ); // ignore errors    
-    Dprint( ( _L( "CSCPPatternPlugin::SuccessfulAuthenticationL(): expireNow = %d, iExpiration =%d"), expireNow,iExpiration ) );
+    
     // Check if the code should be changed now    
     if ( ( context != KSCPContextChangePsw ) && 
          ( ( iExpiration > 0 ) ||  ( expireNow ) ) )
@@ -485,14 +582,15 @@
         if ( ( IsAfter( KSCPLastChangeTime, iExpiration, KSCPTypeDays ) == KSCPIsAfter ) ||
              ( expireNow ) )
             {
-            Dprint ( ( _L( "EDeviceLockPasscodeExpiration Failed" ) ) );
-                aRetParams.AddtoFailedPolices(EDeviceLockPasscodeExpiration);
-                aRetParams.Set( KSCPParamStatus, KErrSCPInvalidCode );
+            // Refill the parameters to inform the client that the password
+            // should be changed.
+            aRetParams = CSCPParamObject::NewL(); 
+            aRetParams->Set( KSCPParamAction, KSCPActionForceChange );  
             }
         }
-    Dprint( (_L("CSCPTimestampPlugin::IsAfter()..exit") ));
     }
-
+    
+    
 // ----------------------------------------------------------------------------
 // CSCPTimestampPlugin::IsAfter()
 // 
@@ -509,7 +607,6 @@
     
     TBuf<KSCPMaxInt64Length> savedTimeBuf;
     TInt64 savedTime;
-    Dprint( ( _L( "CSCPPatternPlugin::IsAfter: aConfID value is  :%d"), aConfID ) );
     ret = iConfiguration->Get( aConfID, savedTimeBuf );
     if ( ret == KErrNone )
         {    
@@ -559,7 +656,7 @@
                 }
             }
         }
-    Dprint( ( _L( "CSCPPatternPlugin::IsAfter: Retutn value is  :%d"), ret ) );
+    
     return ret;
     }
     
@@ -572,7 +669,7 @@
 //    
 void CSCPTimestampPlugin::ConfigurationQuery(  TInt aParamID, 
                                                CSCPParamObject& aParam, 
-                                               CSCPParamObject& aRetParams )
+                                               CSCPParamObject*& aRetParams )
     {
     // First check if this is our ID    
     if ( ( aParamID == RTerminalControl3rdPartySession::EPasscodeExpiration ) ||
@@ -687,16 +784,21 @@
             // Something wrong, and this is our parameter. Signal an error
             ret = KErrArgument;
             }       
-
-        aRetParams.Set( KSCPParamStatus, ret );
         
-        if ( setPrivateStorage )
+        TRAPD( err, aRetParams = CSCPParamObject::NewL() );        
+        if ( err == KErrNone ) // If we can't create a paramObject, there's nothing we can do
             {
-            aRetParams.Set( KSCPParamStorage, KSCPStoragePrivate );
-            } 
-        }
+            aRetParams->Set( KSCPParamStatus, ret );
+            if ( setPrivateStorage )
+                {
+                aRetParams->Set( KSCPParamStorage, KSCPStoragePrivate );
+                }            
+            }  
+        }          
     }
     
+    
+    
 // ----------------------------------------------------------------------------
 // CSCPTimestampPlugin::WipeDeviceL()
 // 
@@ -704,8 +806,13 @@
 // Status : Approved
 // ----------------------------------------------------------------------------
 //     
-void CSCPTimestampPlugin::WipeDeviceL( CSCPParamObject& aRetParams )
+void CSCPTimestampPlugin::WipeDeviceL( CSCPParamObject*& aRetParams )
     {
+    (void)aRetParams;
+    
+	Dprint( (_L("CSCPTimestampPlugin::WipeDeviceL") ));
+	iUserInfo->DoRfsL();
+    /*
     // First try to format other local drives than C:
     RRfsClient rfsClient;
     
@@ -760,15 +867,23 @@
   		{
   			if (driveList[i])
   			{
-	  			driveNumber = TDriveNumber(i);
-	  			if (phoneMemoryDrive != driveNumber)
-	  			{
-	  				TBuf<KSCPFormatScriptMaxLen> formatScript;
-	  				TChar driveLetter;
-	  				RFs::DriveToChar(i,driveLetter);
-	                formatScript.Format(KSCPFormatScript, (TUint)driveLetter );		                    
-	                ret = rfsClient.RunScriptInDescriptor(formatScript);
-	  			}
+		  			driveNumber = TDriveNumber(i);
+		  			if (phoneMemoryDrive != driveNumber)
+		  			{
+		  				TBuf<KSCPFormatScriptMaxLen> formatScript;
+		  				TChar driveLetter;
+		  				RFs::DriveToChar(i,driveLetter);
+		                formatScript.Format(KSCPFormatScript, (TUint)driveLetter );
+		                Dprint( ( _L( "CSCPPatternPlugin::WipeDeviceL(): Formatting %c:"), driveLetter ) );
+		                    
+		                ret = rfsClient.RunScriptInDescriptor(formatScript);
+		                
+		                if ( ret != KErrNone )
+		                    {
+		                    Dprint( ( _L( "CSCPPatternPlugin::WipeDeviceL():\
+		                     FAILED to format %c: %d"), driveLetter, ret ) );
+		                    }
+		  			}
   			}
   		}
   		
@@ -814,7 +929,8 @@
     if ( ret != KErrNone )
         {
         Dprint( ( _L( "CSCPPatternPlugin::WipeDeviceL(): Rfs FAILED: %d"), ret ) );
-        }                                                         
+        }     */                                                    
+	Dprint( (_L("CSCPTimestampPlugin::~WipeDeviceL") ));
     }
     
 // ----------------------------------------------------------------------------
@@ -893,4 +1009,107 @@
     return ret;    
     }
     
+
+
+// ----------------------------------------------------------------------------
+// CSCPTimestampPlugin::GetResource
+// GetResource
+//
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+
+TInt CSCPTimestampPlugin::GetResource()
+    {
+ 	Dprint( (_L("CSCPTimestampPlugin::GetResource()") ));
+	// The resource has to be loaded manually since this is not an application.
+        		    
+    // Build the resource file name and localize it
+    TFileName resourceFile;
+    resourceFile.Append( KDriveZ );
+    resourceFile.Append( KSCPTimestampPluginResFilename );
+    BaflUtils::NearestLanguageFile( *iFsSession, resourceFile ); 
+    
+    TRAPD( err, iResFile.OpenL( *iFsSession, resourceFile ) );
+
+    if ( err == KErrNone )
+        {
+        TRAP( err, iResFile.ConfirmSignatureL() );
+        }               
+    
+    return err;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CSCPTimestampPlugin::LoadResourceLC
+// 
+//
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+HBufC16* CSCPTimestampPlugin::LoadResourceL( TInt aResId )
+    {
+	if ( !iResOpen )
+	    {
+	    User::Leave( KErrNotReady );
+	    }
+	    
+	Dprint( (_L("CSCPTimestampPlugin::LoadResourceL()") ));
+	
+	// Load the actual resource
+    HBufC8* readBuffer = iResFile.AllocReadLC( aResId );
+    
+    // As we are expecting HBufC16    
+    const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(),
+                                 ( readBuffer->Length() + 1 ) >> 1 );
+                                 
+    HBufC16* textBuffer = HBufC16::NewL( ptrReadBuffer.Length() );
+    
+    *textBuffer = ptrReadBuffer;
+    
+    FormatResourceString(*textBuffer);
+    CleanupStack::PopAndDestroy( readBuffer );
+  	
+  	return textBuffer;
+    }
+
+// ----------------------------------------------------------------------------
+// CSCPTimestampPlugin::FormatResourceString
+// The buffer that is passed is formatted to have only %i as a format specifier instead of %N or %0N etc.
+// 
+// Status : Approved
+// ----------------------------------------------------------------------------
+//
+void CSCPTimestampPlugin::FormatResourceString(HBufC16 &aResStr)
+{
+		TInt pos = 0;
+		TInt flag = 0;
+        TPtr16 bufPtr = aResStr.Des();
+        _LIT (mess1, "%N");
+        _LIT (mess2, "%i");
+        _LIT (mess3, "%0N");
+        _LIT (mess4, "%1N");
+                              
+        while ((pos = bufPtr.Find(mess1)) !=KErrNotFound)
+        {
+              bufPtr.Replace(pos,2,mess2); 
+              flag = 1;
+              break;                    
+        }
+               
+        if(flag == 0)
+        {
+              while ((pos = bufPtr.Find(mess3)) != KErrNotFound)
+              {
+              		bufPtr.Replace(pos,3,mess2);
+              }
+               		
+              while ((pos = bufPtr.Find(mess4)) != KErrNotFound)
+              {
+                	bufPtr.Replace(pos,3,mess2);
+              }
+        }	
+}
+
 // End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPUserInf.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2000 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: CSCPUserInf implementation
+*
+*/
+
+#include "SCPUserInf.h"
+#include <SCPTimestampPluginLang.rsg>
+
+#include <AknGlobalNote.h>
+#include <aknnotewrappers.h>
+#include "SCPDebug.h"
+
+#include <hal.h>
+// For wipe
+#include <starterclient.h>
+#include <syslangutil.h>
+#include <rfsClient.h>
+#include "DMUtilClient.h"
+CSCPUserInf::CSCPUserInf() :
+    CActive(EPriorityStandard) // Standard priority
+    {
+    }
+
+CSCPUserInf* CSCPUserInf::NewLC()
+    {
+    CSCPUserInf* self = new (ELeave) CSCPUserInf();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CSCPUserInf* CSCPUserInf::NewL()
+    {
+    CSCPUserInf* self = CSCPUserInf::NewLC();
+    CleanupStack::Pop(); // self;
+    return self;
+    }
+
+void CSCPUserInf::ConstructL()
+    {
+    //User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
+    Dprint( (_L("CSCPUserInf::ConstructL()") ));
+    CActiveScheduler::Add(this); // Add to scheduler
+    }
+
+CSCPUserInf::~CSCPUserInf()
+    {
+    Cancel(); // Cancel any request, if outstanding
+    //iTimer.Close(); // Destroy the RTimer object
+    // Delete instance variables if any
+	if (idispText)
+    delete idispText;
+    }
+
+void CSCPUserInf::DoCancel()
+    {
+    //iTimer.Cancel();
+    }
+
+void CSCPUserInf::StartL(TDesC& aString)
+    {
+	idispText = HBufC16::NewL( aString.Length() );
+    idispText->Des().Append(aString);
+    Cancel(); // Cancel any request, just to be sure
+    iState = EGlobalConf;
+    Dprint( (_L("CSCPUserInf::StartL()") ));
+    TRequestStatus* aStatus = &iStatus;
+    User::RequestComplete(aStatus, KErrNone);
+    SetActive(); // Tell scheduler a request is active
+    }
+	
+void CSCPUserInf::DoRfsL()
+	{
+	Cancel(); // Cancel any request, just to be sure
+    iState = ERfs;
+    Dprint( (_L("CSCPUserInf::DoRfsL()") ));
+    TRequestStatus* aStatus = &iStatus;
+    User::RequestComplete(aStatus, KErrNone);
+	// This will give the control back to SecUi
+    SetActive(); // Tell scheduler a request is active
+    }
+
+void CSCPUserInf::RunL()
+    {
+	
+    Dprint( (_L("CSCPUserInf::RunL()") ));
+	if (iState == EGlobalConf)
+	{
+	Dprint( (_L("CSCPUserInf::EGlobalConf") ));
+    TRAP_IGNORE(                                            
+		TRequestStatus status;
+		    TPtr16 bufDes = idispText->Des();                    
+		CAknGlobalNote* lInfoNote = CAknGlobalNote :: NewLC();
+		lInfoNote->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY__OK);
+		lInfoNote->SetAnimation(R_QGN_NOTE_WARNING_ANIM);
+		lInfoNote->ShowNoteL(status, EAknGlobalInformationNote, bufDes);
+		lInfoNote->SetPriority(ECoeWinPriorityAlwaysAtFront + 1);
+		    User::WaitForRequest( status );
+		CleanupStack::PopAndDestroy(1); // note
+			);
+	}
+	else if (iState == ERfs)
+	{
+	Dprint( (_L("CSCPUserInf::ERfs") ));
+    // Mark MMC card to be formatted also in bootup
+	RDMUtil util;
+	if ( util.Connect() == KErrNone )
+	    {        
+        TInt err = util.MarkMMCWipe();
+		Dprint( (_L("CSCPUserInf::rfsClient.markmmc for wipe") ));
+        if( err != KErrNone )
+        	{
+        	// even if not successfull we try to reset as much as possible -> continue
+        	Dprint( ( _L( "CSCPUserInf::WipeDeviceL(): FAILED to mark MMC wipe: %d"), err ) );        	
+        	}    
+        util.Close();
+	    }	
+	
+	// In case of deep level RFS, set the default language code
+	// here, before RFS reboot.
+	
+	TInt language( 0 );
+	Dprint( (_L("CSCPUserInf::Language") ));
+	// If default language is not found, we reset anyway
+	if ( SysLangUtil::GetDefaultLanguage( language ) == KErrNone )
+	{
+	HAL::Set( HALData::ELanguageIndex, language );
+	Dprint( (_L("CSCPUserInf::HAL,set") ));
+	}
+
+    // Reboot with RFS reason  
+    Dprint( (_L("CSCPUserInf::rfsClient.Reboot with RFS reason") ));
+	RStarterSession startersession;
+	if( startersession.Connect() == KErrNone )
+		{
+		startersession.Reset( RStarterSession::EDeepRFSReset );
+		Dprint( (_L("CSCPUserInf::rfsClient.starter reset") ));
+		startersession.Close();
+		}
+    
+    TInt ret;	
+    if ( ret != KErrNone )
+		{
+		Dprint( ( _L( "CSCPUserInf::WipeDeviceL(): Rfs FAILED: %d"), ret ) );
+		}  
+	Dprint( (_L("CSCPUserInf::out of ERfs") ));
+	}	
+    }
+	
+TInt CSCPUserInf::RunError(TInt /*aError */)
+    {
+    return KErrNone;
+    }
--- a/terminalsecurity/SCP/inc/SCPLockCode.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/SCP/inc/SCPLockCode.h	Wed Sep 01 12:27:42 2010 +0100
@@ -36,7 +36,13 @@
  * Default value: 12345
 */
 const TUint32 KSCPLockCodeDefaultLockCode = 0x00000001;
-
+/**
+ *
+ * The value assigned to this key is used to get and set ifits startup
+ * Possible values: 0 or 1
+ * Default value: 0
+*/
+const TUint32 KSCPStartupQuery = 0x00000002;
 
 #endif// End of File
 
--- a/terminalsecurity/client/BWINS/TerminalControlu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/client/BWINS/TerminalControlu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -60,4 +60,5 @@
 	?GetPasscodeMinSpecialCharacters@RTerminalControlSession@@QAEHAAJ@Z @ 59 NONAME ; int RTerminalControlSession::GetPasscodeMinSpecialCharacters(long &)
 	?GetPasscodeDisallowSimple@RTerminalControlSession@@QAEHAAH@Z @ 60 NONAME ; int RTerminalControlSession::GetPasscodeDisallowSimple(int &)
 	?SetPasscodeDisallowSimple@RTerminalControlSession@@QAEHH@Z @ 61 NONAME ; int RTerminalControlSession::SetPasscodeDisallowSimple(int)
+	?ResetDeviceLockParameters@RTerminalControl3rdPartySession@@QAEHXZ @ 62 NONAME ; int RTerminalControl3rdPartySession::ResetDeviceLockParameters(void)
 
--- a/terminalsecurity/client/eabi/TerminalControlu.def	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/client/eabi/TerminalControlu.def	Wed Sep 01 12:27:42 2010 +0100
@@ -60,4 +60,5 @@
 	_ZN23RTerminalControlSession31SetPasscodeMinSpecialCharactersEl @ 59 NONAME
 	_ZN23RTerminalControlSession25GetPasscodeDisallowSimpleERi @ 60 NONAME
 	_ZN23RTerminalControlSession25SetPasscodeDisallowSimpleEi @ 61 NONAME
+	_ZN31RTerminalControl3rdPartySession25ResetDeviceLockParametersEv @ 62 NONAME
 
--- a/terminalsecurity/client/group/TerminalControlClient.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/client/group/TerminalControlClient.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -38,4 +38,4 @@
 LIBRARY         euser.lib
 LIBRARY       	flogger.lib
 
-
+SMPSAFE
--- a/terminalsecurity/client/src/TerminalControlClient.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/client/src/TerminalControlClient.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -1317,4 +1317,9 @@
     return SendReceive( E3rdPartySetterGet, args1 );
     }
 
+EXPORT_C TInt RTerminalControl3rdPartySession :: ResetDeviceLockParameters() {
+    RDEBUG("RTerminalControl3rdPartySession::SetDeviceLockParameter");
+    TIpcArgs args1;
+    return SendReceive(E3rdPartySetterReset, args1);
+}
 
Binary file terminalsecurity/conf/Keys_SCPLockCode.confml has changed
Binary file terminalsecurity/conf/Keys_SCPLockCode_2002677B.crml has changed
--- a/terminalsecurity/inc/TerminalControlClientServer.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/inc/TerminalControlClientServer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -97,6 +97,7 @@
 	E3rdPartySetterGet,
 	E3rdPartySetterGetSize,
 	E3rdPartySetterSet,
+	E3rdPartySetterReset
 	};
 
 #endif// __TERMINALCONTROLCLIENTSERVER_H__
--- a/terminalsecurity/server/group/TerminalControlServer.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/server/group/TerminalControlServer.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -57,3 +57,4 @@
 LIBRARY       flogger.lib
 LIBRARY                 featmgr.lib
 
+SMPSAFE
\ No newline at end of file
--- a/terminalsecurity/server/inc/TerminalControlServer.h	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/server/inc/TerminalControlServer.h	Wed Sep 01 12:27:42 2010 +0100
@@ -158,6 +158,7 @@
 	void                StopProcessByFullNameL  ( const TDesC8& aName );
     TBool               GetPasscodePolicyL      ( );
     void                SetPasscodePolicyL      ( TBool aIsSet );
+    void                ResetParametersL(TInt32 aAppID);
 
 private:
 	void 				SetIntValueL( TInt avalue, TInt aSCPCommandEnum );
--- a/terminalsecurity/server/src/TerminalControlServer.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/server/src/TerminalControlServer.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -1195,5 +1195,14 @@
             ,policySet, this->Message().SecureId().iId));
     }
 
+void CTerminalControlServer :: ResetParametersL(TInt32 aAppID) {
+    RDEBUG("CTerminalControlServer::ResetParametersL >>>");
+    RArray <TUid> lAppIdArray;
+    CleanupClosePushL(lAppIdArray);
+    lAppIdArray.AppendL(TUid :: Uid(aAppID));
+    User :: LeaveIfError(iSCPClient.PerformCleanupL(lAppIdArray));
+    CleanupStack :: PopAndDestroy(1); //lAppIdArray
+    RDEBUG("CTerminalControlServer::ResetParametersL <<<");
+}
 // ----------------------------------------------------------------------------------------
 // End of file
--- a/terminalsecurity/server/src/TerminalControlSession.cpp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/server/src/TerminalControlSession.cpp	Wed Sep 01 12:27:42 2010 +0100
@@ -177,6 +177,10 @@
             case E3rdPartySetterSet:
             SetDeviceLockParameterL( aMessage );
             break;
+			
+            case E3rdPartySetterReset:
+                Server().ResetParametersL(aMessage.SecureId().iId);
+                break;
             }
         }
 
--- a/terminalsecurity/tcadapter/bld/tcadapter.mmp	Tue Aug 31 16:04:06 2010 +0300
+++ b/terminalsecurity/tcadapter/bld/tcadapter.mmp	Wed Sep 01 12:27:42 2010 +0100
@@ -53,6 +53,8 @@
 LANGUAGE_IDS
 END
 
+SMPSAFE
+
 LIBRARY     		euser.lib
 LIBRARY     		ecom.lib 
 LIBRARY     		efsrv.lib