Revision: 201025
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 15:14:24 +0300
changeset 44 39aa16f3fdc2
parent 43 c8e5c3d81b42
child 53 b3a7d8e28262
child 57 f5b689a4f7a2
Revision: 201025 Kit: 2010127
dcmofw/dcmoserver/group/bld.inf
dcmofw/dcmoserver/group/dcmoserver.mmp
dcmofw/dcmoserver/inc/dcmomessagebox.h
dcmofw/dcmoserver/inc/dcmonotifieraob.h
dcmofw/dcmoserver/inc/dcmoserver.h
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/rom/dcmofwresources.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/provisioning/Group/bld.inf
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/ProvisioningParser/Src/CWPWbxmlParser.cpp
omaprovisioning/provisioning/ProvisioningParser/Src/OMAProvisioningDictionary.c
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/conf/CI_s60provisioning.confml
policymanagement/dmutilserver/group/DMUtilServer.mmp
policymanagement/dmutilserver/src/DMUtilSession.cpp
policymanagement/policyengine/group/PolicyEngineServer.mmp
policymanagement/policyengine/group/bld.inf
policymanagement/policyengine/policyengine.pro
policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h
policymanagement/policyengine/policyengineserver/src/PolicyProcessor.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/devicemgmt_dialogs_api/group/bld.inf
remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h
remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h
remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconst.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/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/group/bld.inf
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
syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp
syncmlfw/common/sosserver/bld/nsmlsosserver.mmp
syncmlfw/common/sosserver/inc/nsmlsosthread.h
syncmlfw/common/sosserver/src/nsmlsosthread.cpp
syncmlfw/conf/CI_devman.confml
syncmlfw/conf/devman.confml
syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp
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/NSmlDMSettings.cpp
syncmlfw/dm/syncagent/bld/nsmldmagent.mmp
syncmlfw/dm/syncagent/src/nsmldmcmds.cpp
syncmlfw/ds/settings/bld/nsmldssettings.mmp
syncmlfw/ds/settings/inc/NSmlProfileContentHandler.h
syncmlfw/ds/settings/src/NSmlDSSettings.cpp
syncmlfw/ds/settings/src/pcsuite/NSmlDSProfileRes.rss
syncmlfw/ds/syncagent/src/nsmldsagent.cpp
syncmlfw/ds/syncagent/src/nsmldscmds.cpp
syncmlfw/group/bld.inf
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/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/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
--- a/dcmofw/dcmoserver/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/dcmofw/dcmoserver/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -21,7 +21,6 @@
 
 
 ../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	Wed Jun 23 19:10:17 2010 +0300
+++ b/dcmofw/dcmoserver/group/dcmoserver.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -29,11 +29,13 @@
 SOURCEPATH    	../src
 SOURCE       	 	dcmoserver.cpp
 SOURCE       	 	dcmosession.cpp
-SOURCE       	 	dcmonotifieraob.cpp
+SOURCE       	 	dcmomessagebox.cpp
 SOURCE					dcmogenericcontrol.cpp
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
 USERINCLUDE   	../inc
 USERINCLUDE   	../../inc
 
@@ -42,9 +44,8 @@
     TARGETPATH  resource
     LANGUAGE_IDS
 END 
-
-LIBRARY     	euser.lib commonengine.lib efsrv.lib
+LIBRARY     	euser.lib 
 LIBRARY       ecom.lib
 LIBRARY       centralrepository.lib
-LIBRARY				aknnotify.lib eiksrv.lib
 LIBRARY    		flogger.lib
+LIBRARY       hbcore.lib hbwidgets.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/dcmoserver/inc/dcmomessagebox.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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__
--- a/dcmofw/dcmoserver/inc/dcmonotifieraob.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/dcmofw/dcmoserver/inc/dcmoserver.h	Tue Jul 06 15:14:24 2010 +0300
@@ -21,9 +21,11 @@
 // INCLUDES
 
 #include <e32base.h>
+#include <hbdevicemessageboxsymbian.h>
 #include "dcmoclientserver.h"
 #include "dcmoconst.h"
-#include "dcmonotifieraob.h"
+#include "dcmomessagebox.h"
+
 
 // CONSTANTS
 const TUid KCRUidDCMOServer={0x2001FE47};
@@ -40,7 +42,7 @@
 class CDCMOServer : public CServer2
 	{
 	friend class CDCMOSession;
-	friend class CDCMONotifierAob;
+	friend class CDCMOMessageBox;
 
 public:
 	/**
@@ -166,7 +168,14 @@
 	 * @return 
 	 */
 	void SetStarter(TBool aValue);	
-
+	
+	/**
+	 * Deletes the idcmoArray value if any
+	 * @param none
+	 * @return none
+	 */
+	void CleanDcmoArray();	
+	
 private:
 	
 	/**
@@ -187,7 +196,7 @@
 	RArray<dcmoInfoList> idcmoArray;
 	static TInt iSessionCount;
 	TBool iStarter;	
-	CDCMONotifierAob* iNotifier;
+	CDCMOMessageBox* iMessageBox;
 	};
 	
 #endif //__DCMO_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dcmofw/dcmoserver/src/dcmomessagebox.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* 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
--- a/dcmofw/dcmoserver/src/dcmonotifieraob.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +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 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/dcmofw/dcmoserver/src/dcmoserver.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -21,10 +21,9 @@
 #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"
@@ -33,7 +32,9 @@
 #include "dcmogenericcontrol.h"
 #include "dcmodebug.h"
 
-_LIT( KdcmoResourceFileName, "z:dcmo.rsc" );	
+
+_LIT( KdcmoResourceFileName, "deviceupdates_" );	
+_LIT( KdcmoResourceFilePath, "z:/resource/qt/translations/" );	
 const TInt KBufferSize = 256;
 
 TInt CDCMOServer::iSessionCount = 0;
@@ -114,7 +115,7 @@
 CDCMOServer::CDCMOServer() : CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/
 	{	
 		iStarter = EFalse;
-		iNotifier = NULL;
+		iMessageBox = NULL;
 	}
 
 // ----------------------------------------------------------------------------------------
@@ -130,8 +131,8 @@
 		for(TInt i=0; i< count; i++)
 				delete idcmoArray[i].iCategoryName;
 		idcmoArray.Reset();
-		delete iNotifier;
-		iNotifier = NULL;	
+		delete iMessageBox;
+		iMessageBox = NULL;	
 	}
 	else
 	{
@@ -157,7 +158,11 @@
   		RDEBUG("CDCMOServer::DropSession(): Starter");
   		SetStarter( EFalse );
   		return;                 
-  	}   
+  	} 
+  	if(CDCMOMessageBox::IsMsgBoxClosed())
+  	{
+  		CleanDcmoArray();
+  	}  
 		if( idcmoArray.Count() && ( iSessionCount == 0 ))
 		{
 			// A session is being destroyed		
@@ -369,25 +374,21 @@
 			RDEBUG("CDCMOServer::SetIntAttributeL(): LocalCategory");
 			CDCMOGenericControl* iGenericControl = new(ELeave) CDCMOGenericControl;
 			err = iGenericControl->SetIntAttributeL(categotyNumber, id, value);	
-			TFileName myFileName;
-  		TParse parseObj;
-  		parseObj.Set( KdcmoResourceFileName(), &KDC_RESOURCE_FILES_DIR,NULL );
- 			myFileName = parseObj.FullName();
- 			CStringResourceReader* test = CStringResourceReader::NewL( myFileName );
+			
+			TBool result = HbTextResolverSymbian::Init(KdcmoResourceFileName, KdcmoResourceFilePath );					
+
 			TPtrC buf;
 			dcmoList.iUid = categotyNumber;
 			if(categotyNumber == 0)
-			    {			    
-			    buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_CAMERA));
-			    stringHolder = buf.AllocL() ; 
+			    {
+					_LIT(KTextCamera, "txt_device_update_info_camera");
+					stringHolder = HbTextResolverSymbian::LoadL(KTextCamera);
 			    } 
 			else
-			    {			   
-			    buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_FIRMWARE_UPDATE));
-			    stringHolder = buf.AllocL() ; 
-			    }			
-     delete test;
-     test = NULL;
+			    {	
+					_LIT(KTextFOTA, "txt_device_update_info_firmware_update");
+					stringHolder = HbTextResolverSymbian::LoadL(KTextFOTA);
+			    }		
   	 delete iGenericControl;
 		 iGenericControl = NULL;
 	}
@@ -416,7 +417,7 @@
   		RDEBUG("CDCMOServer::SetIntAttributeL(): Starter");
   		SetStarter ( EFalse );
   		delete stringHolder;
-		stringHolder = NULL;
+			stringHolder = NULL;
   		return err;                
    }   
 	if((err == EDcmoSuccess) && (id == EEnable) ) 
@@ -477,7 +478,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);
@@ -485,10 +486,6 @@
 
 	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");
 		
@@ -509,38 +506,34 @@
       		disableContentptr.Append( idcmoArray[i].iCategoryName->Des() );
       		disable = ETrue;
       	}	
-		}
-	  
-  	CStringResourceReader* test = CStringResourceReader::NewL( myFileName );	  
+		}	  
+  
+		TBool result = HbTextResolverSymbian::Init(KdcmoResourceFileName, KdcmoResourceFilePath );
 		if ( enable )
 		{
-			TPtrC buf;
-			buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_ENABLE)); 	    	
-			contentptr.Append(buf);
+			_LIT(KTextEnabled, "txt_device_update_title_enabled_by_the_system_admi");
+			HBufC* buf = HbTextResolverSymbian::LoadL(KTextEnabled);
+			contentptr.Append(buf->Des());
 	 		contentptr.Append(enableContentptr);
+	 		delete buf;
 		}
 		if ( disable )
 		{
-	 		TPtrC buf;
-	 		buf.Set(test->ReadResourceString(R_DM_RUN_TIME_VAR_DISABLE));
+	 		_LIT(KTextDisabled, "txt_device_update_title_disabled_by_the_system_adm");
+			HBufC* buf = HbTextResolverSymbian::LoadL(KTextDisabled);
 	 		if( enable )
-	 			contentptr.Append(KNewLine());
-	 		contentptr.Append(buf);
+	 			contentptr.Append(KNewLine());	 		
+			contentptr.Append(buf->Des());
 	 		contentptr.Append(disableContentptr);
+	 		delete buf;
 		}
-		delete test;
-		test = NULL;
-		
-		if( iNotifier )
-		{
-			iNotifier->Cancel();
+	
+		if( !iMessageBox )
+		{		
+			iMessageBox = CDCMOMessageBox::NewL();					
 		}
-		else
-		{			
-			iNotifier = CDCMONotifierAob::NewL( );			
-		}
-		
-	  iNotifier->ShowNotifierL(contentptr);    
+		iMessageBox->ShowMessageL(contentptr);
+
 	  CleanupStack::PopAndDestroy(3); //disableContent, enableContent, content
 	}	
 	RDEBUG("CDCMOServer::DoFinalizeL(): end");
@@ -618,3 +611,22 @@
 	iStarter = aValue;
 	RDEBUG("CDCMOServer::SetStarter(): end");
 }
+
+// ----------------------------------------------------------------------------------------
+// CDCMOServer::CleanDcmoArray
+// Sets the iStarter value
+// ----------------------------------------------------------------------------------------
+void CDCMOServer::CleanDcmoArray()
+{
+	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");
+}
--- a/dcmofw/dcmoserver/src/dcmosession.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/dcmofw/dcmoserver/src/dcmosession.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -19,6 +19,7 @@
 
 #include "dcmosession.h"
 #include "dcmoclientserver.h"
+#include "dcmomessagebox.h"
 #include "dcmodebug.h"
 
 
@@ -73,6 +74,10 @@
   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);           
--- a/dcmofw/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/dcmofw/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -18,7 +18,6 @@
 
 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"
--- a/dcmofw/rom/dcmofwresources.iby	Wed Jun 23 19:10:17 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:   Image description file for project dcmofw
-*
-*/
-
-
-#ifndef _DCMOFWRESOURCES_IBY_
-#define _DCMOFWRESOURCES_IBY_
-
-
-#ifdef FF_RUNTIME_DEVICE_CAPABILITY_CONFIGURATION
-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/devicemgmtnotifications/dmdevdialogclient/bld/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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: Implementation of syncml dm device dialogs
+*
+*/
+
+// BLD.INF
+// Component description file 
+//
+
+PRJ_MMPFILES
+
+dmdevdialogclient.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogclient/bld/dmdevdialogclient.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -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: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogclient/bwins/dmdevdialogclientu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,11 @@
+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)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogclient/eabi/dmdevdialogclientu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,11 @@
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogclient/inc/dmdevdialogclientdebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogclient/src/dmdevdialogclient.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,167 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/bld/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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 DM Device Dialogs
+* 	This is part of syncmlfw.
+*
+*/
+
+// BLD.INF
+// Component description file 
+//
+
+PRJ_MMPFILES
+
+dmdevicedialog.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/bld/dmdevicedialog.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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 
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogdebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogserver.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,345 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/inc/dmdevicedialogsession.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/src/dmdevicedialogserver.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,755 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/dmdevdialogserver/src/dmdevicedialogsession.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,235 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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:  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"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/inc/dmdevdialogclientserver.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/devicemgmtnotifications/rom/devicemgmtnotifications.iby	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/FotaEngine/BWINS/fotaengineu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,24 @@
+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 &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/FotaEngine/INC/fotaenginedebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/FotaEngine/SRC/fotaengine.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,416 @@
+/*
+* 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)
+    {
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/FotaEngine/eabi/fotaengineu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,25 @@
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/FotaEngine/group/fotaengine.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/FotaScheduleHandler/group/fotaschedulehandler.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/FotaScheduleHandler/inc/FotaSchedDebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/FotaScheduleHandler/src/fotaschedulehandler.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,142 @@
+/*
+* 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/cenrep/fotadiskstoragePrivateCRKeys.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/cenrep/fotaserverPrivateCRKeys.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmsclient/bwins/fmsclientu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,8 @@
+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 &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmsclient/eabi/fmsclientu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN10RFMSClient16NotifyForResumeLERK15TFmsIpcCommandsRKiRK12TDriveNumberS4_ @ 1 NONAME
+	_ZN10RFMSClient16NotifyForUpdateLERK15TFmsIpcCommandsj @ 2 NONAME
+	_ZN10RFMSClient17IsPhoneCallActiveERi @ 3 NONAME
+	_ZN10RFMSClient5CloseEv @ 4 NONAME
+	_ZN10RFMSClient5OpenLEv @ 5 NONAME
+	_ZN10RFMSClient6CancelEv @ 6 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmsclient/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fmsclient/group/fmsclient.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fmsclient/inc/fmsclient.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmsclient/inc/fmsclientdebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fmsclient/src/fmsclient.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,195 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fmserver/group/fmsserver.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/inc/fmsdebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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: 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/inc/fmsinterruptaob.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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(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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/inc/fmsserver.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,297 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/inc/fmsserversession.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/src/fmsinterruptaob.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,996 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/src/fmsserver.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,839 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fmserver/src/fmsserversession.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,513 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaapplication.pro	Tue Jul 06 15:14:24 2010 +0300
@@ -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: This is the project specification file for the Organizer project.
+#  
+
+TEMPLATE = subdirs
+CONFIG += ordered
+SUBDIRS += fotaserver \
+
+# End of file	--Don't remove this.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotacustcmds/bwins/fotacustcmdsu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/eabi/fotacustcmdsu.def	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/group/fotacustcmds.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/inc/fotacustcmdallreasons.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/inc/fotacustcmdfirmwareupdate.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/inc/fotacustcmdfirstboot.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/inc/fotacustcmdsfactory.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/inc/fotastartupDebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/src/fotacustcmdallreasons.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,342 @@
+/*
+* 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"));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotacustcmds/src/fotacustcmdfirmwareupdate.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/src/fotacustcmdfirstboot.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/fotacustcmds/src/fotacustcmdsfactory.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -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/FotaEngine/BWINS/fotaengineu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-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)
-
--- a/fotaapplication/fotaserver/FotaEngine/INC/fotaenginedebug.h	Wed Jun 23 19:10:17 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/fotaserver/FotaEngine/SRC/fotaengine.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,559 +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>
-#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);
-	}
--- a/fotaapplication/fotaserver/FotaEngine/SRC/fotaengstream.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +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:   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
--- a/fotaapplication/fotaserver/FotaEngine/eabi/fotaengineu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-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
-
--- a/fotaapplication/fotaserver/FotaEngine/group/fotaengine.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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
-
-//End of file
--- a/fotaapplication/fotaserver/FotaRfsPlugin/group/RfsFotaPlugin.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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 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
--- a/fotaapplication/fotaserver/FotaRfsPlugin/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +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 provides the information required for building RFS AP
-*    	plugin
-*
-*/
-
-
-
-PRJ_PLATFORMS
-
-PRJ_MMPFILES
-
-../group/RfsFotaPlugin.mmp
-
-
-PRJ_EXPORTS
-
-
-PRJ_TESTMMPFILES
-
-
--- a/fotaapplication/fotaserver/FotaRfsPlugin/inc/RfsFotaPlugin.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +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 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
--- a/fotaapplication/fotaserver/FotaRfsPlugin/inc/fotadebug.h	Wed Jun 23 19:10:17 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, "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
--- a/fotaapplication/fotaserver/FotaRfsPlugin/src/10281873.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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 = "";
-					}
-				};
-			}
-		};
-	}
-
--- a/fotaapplication/fotaserver/FotaRfsPlugin/src/Proxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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 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;
-    }
-
--- a/fotaapplication/fotaserver/FotaRfsPlugin/src/RfsFotaPlugin.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +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.
-*
-*/
-
-
-
-// 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
--- a/fotaapplication/fotaserver/FotaScheduleHandler/group/fotaschedulehandler.mmp	Wed Jun 23 19:10:17 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
-
-
--- a/fotaapplication/fotaserver/FotaScheduleHandler/inc/FotaSchedDebug.h	Wed Jun 23 19:10:17 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/fotaserver/FotaScheduleHandler/src/fotaschedulehandler.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +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/fotaserver/FotaServer/data/fotaserver.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
-* 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 ; }
--- a/fotaapplication/fotaserver/FotaServer/data/fotaserver_reg.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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
--- a/fotaapplication/fotaserver/FotaServer/group/fotaserver.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +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 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		devenccommonutils.lib
-LIBRARY		aknnotify.lib
-// #ifdef _FOTA_DEBUG
-LIBRARY    flogger.lib
-// #endif
-
--- a/fotaapplication/fotaserver/FotaServer/inc/DevEncController.h	Wed Jun 23 19:10:17 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:   CDevEncController class declaration
-*
-*/
-
-#ifndef __DEVENCCONTROLLER_H__
-#define __DEVENCCONTROLLER_H__
-
-// INCLUDES
-#include <e32base.h>
-#include <DevEncSession.h>
-#include <DevEncConstants.h>
-#include "DevEncProgressDlg.h"
-#define KDevEncUIUid 0x2000259A
-
-//Forward declaration
-class CFotaServer;
-
-
-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 StartDecryptionL();
-        
-        void StartEncryptionL();
-        
-        TBool CheckBatteryL();
-        
-    // Data
-        CFotaServer* iCallback; // parent
-        
-        CDevEncSession*     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
--- a/fotaapplication/fotaserver/FotaServer/inc/DevEncProgressDlg.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +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 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
--- a/fotaapplication/fotaserver/FotaServer/inc/DevEncProgressObserver.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +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 __NFEOBSERVER_H__
-#define __NFEOBSERVER_H__
-
-// SYSTEM INCLUDES
-#include <e32base.h>
-#include "DevEncProgressDlg.h"
-
-//Forward declarations
-class CDevEncController;
-class CDevEncSession;
-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(CDevEncSession* 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
-		CDevEncSession*     iEncMemorySession;
-	
-	};
-
-#endif // __NFEOBSERVER_H__
-
-// End of File
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaDB.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +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 );
-
-
-    /** 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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaDLProgressDlg.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +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 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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaNetworkRegStatus.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +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
\ No newline at end of file
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaReminderDlg.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +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 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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaServer.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,874 +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 <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 = 0x0000008;
-
-/** 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 );
-
-//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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaSrvApp.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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 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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaSrvDebug.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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,...);
-    #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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaSrvDocument.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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 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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotaSrvUI.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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 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
--- a/fotaapplication/fotaserver/FotaServer/inc/FotasrvSession.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +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 <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 
--- a/fotaapplication/fotaserver/FotaServer/inc/fotaUpdateAgentComms.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +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/FotaServer/inc/fotadownload.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,608 +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:   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
--- a/fotaapplication/fotaserver/FotaServer/inc/fotaserverPrivatePSKeys.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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/FotaServer/inc/fotaserver_service.rh	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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.
-*
-*/
-
-
-
-STRUCT FOTASERVICE_STRUCT
-	{
-	LONG type = 0;
-	}
-
--- a/fotaapplication/fotaserver/FotaServer/inc/fotaupdate.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,404 +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___
-
-// 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
-	};
-
-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();
-
-
-    /**
-     * 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 );
-
-	/**
-	 * 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 interval type
-	 * @param interval
-	 * @return TInt 
-	 */
-    TInt CreateScheduleL ( const TInt aPackageId
-            ,const 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;
-    };
-
-
-
-
-#endif // __UPDATER_H___
\ No newline at end of file
--- a/fotaapplication/fotaserver/FotaServer/loc/fotaserver.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +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:   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 4 hour
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.2
-#define qtn_fota_reminder_4_hours 	"4 hours"
-
-//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 3 days
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.2
-#define qtn_fota_reminder_3_days 	"3 days"
-
-//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
--- a/fotaapplication/fotaserver/FotaServer/src/DevEncController.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,482 +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:   CDevEncController definitions Part of ES System Application
-*
-*/
-
-#include <apgcli.h> // for RApaLsSession
-#include <apacmdln.h> // for CApaCommandLine
-#include <centralrepository.h>
-#include <featmgr.h> // for checking DE feature
-#include "DevEncController.h"
-#include "FotaServer.h"
-#include "FotaSrvDebug.h"
-#include "DevEncSession.h"
-#include <DevEncEngineConstants.h>
-#include "DevEncProgressObserver.h"
-#include <fotaserver.rsg>
-#include <DevEncProtectedPSKey.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())
-        {
-        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 >>"));
-
-    if (iEncMemorySession)
-        {
-        iEncMemorySession->Close();
-        delete iEncMemorySession;
-        iEncMemorySession = NULL;
-        }
-
-    if (iDevEncObserver)
-        {
-        delete iDevEncObserver;
-        iDevEncObserver = NULL;
-        }
-
-    FLOG(_L("CDevEncController::~CDevEncController <<"));
-    }
-
-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);
-        }
-
-    if (!iEncMemorySession)
-        iEncMemorySession = new (ELeave) CDevEncSession( 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();
-    delete iEncMemorySession; iEncMemorySession = NULL;
-
-    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);
-
-    if (!iEncMemorySession)
-        iEncMemorySession = new (ELeave) CDevEncSession( 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();
-            delete iEncMemorySession;  iEncMemorySession = NULL;
-
-            iCallback->HandleDecryptionCompleteL(KErrBadPower, EBatteryLevelLevel4);
-            }
-        }
-    else if(status == EDecrypted)
-        {
-        FLOG(_L("Device is already decrypted"));
-
-        iDevEncOperation = EIdle;
-        iEncMemorySession->Close();
-        delete iEncMemorySession;  iEncMemorySession = NULL;
-
-        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();
-        delete iEncMemorySession;  iEncMemorySession = NULL;
-
-        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();
-        delete iEncMemorySession;  iEncMemorySession = NULL;
-        }
-
-    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);
-
-    if (!iEncMemorySession)
-        iEncMemorySession = new (ELeave) CDevEncSession( 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();
-            delete iEncMemorySession;  iEncMemorySession = NULL;
-
-            iCallback->HandleEncryptionCompleteL(KErrBadPower);
-            }
-        }
-    else if (status == EEncrypted)
-        {
-        FLOG(_L("Memory is already encrypted"));
-
-        iDevEncOperation = EIdle;
-        iEncMemorySession->Close();
-        delete iEncMemorySession;  iEncMemorySession = NULL;
-
-        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();
-        delete iEncMemorySession;  iEncMemorySession = NULL;
-
-        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
-
--- a/fotaapplication/fotaserver/FotaServer/src/DevEncProgressDlg.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +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:   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
--- a/fotaapplication/fotaserver/FotaServer/src/DevEncProgressObserver.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +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:   
- *
- */
-
-
-
-// INCLUDE FILES
-
-//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
-// -----------------------------------------------------------------------------
-
-EXPORT_C 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
-// -----------------------------------------------------------------------------
-
-EXPORT_C 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(CDevEncSession* 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 
--- a/fotaapplication/fotaserver/FotaServer/src/FotaDB.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,640 +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 "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 <<"));
-	}
--- a/fotaapplication/fotaserver/FotaServer/src/FotaDLProgressDlg.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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:   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
--- a/fotaapplication/fotaserver/FotaServer/src/FotaNetworkRegStatus.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,391 +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/FotaServer/src/FotaReminderDlg.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +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:   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   <<"));
-	}
-		
--- a/fotaapplication/fotaserver/FotaServer/src/FotaServer.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2585 +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 <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;
-	        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(KOmaDMAppUid), 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);
-    		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;
-    }
-
--- a/fotaapplication/fotaserver/FotaServer/src/FotaSrvApp.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +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:   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
--- a/fotaapplication/fotaserver/FotaServer/src/FotaSrvDocument.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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:   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"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------------------------
-// Desctructor
-// ---------------------------------------------------------------------------
-//
-CFotaSrvDocument::~CFotaSrvDocument()
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// CFotaSrvDocument::ConstructL
-// 2nd phase constructor
-// ---------------------------------------------------------------------------
-//
-void CFotaSrvDocument::ConstructL()
-    {
-	//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
--- a/fotaapplication/fotaserver/FotaServer/src/FotaSrvUi.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +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:   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 <<"));
-    }
--- a/fotaapplication/fotaserver/FotaServer/src/fotaSrvSession.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,458 +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"
-#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 )
-			{
-			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 && 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();
-}
--- a/fotaapplication/fotaserver/FotaServer/src/fotadownload.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1944 +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:   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>
-//Commented for resolving APP dependencyy
-//#include <nsmldmsync.rsg>	//OMA DM UI for reading resource
-//Comment ends here
-#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
-#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 aError;
-	}
-
-
-// --------------------------------------------------------------------------
-// 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();
-	iUpdateAfterDownload = aUpdateAfterDownload;
-	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);
-
-	// 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(KOmaDMAppUid), 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::EResUndefinedError;
-				}
-			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;
-//Commented for resolving APP dependency
-/*
-	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();
-		}
-*/
-//Comment ends here
-	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 && 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 ) 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(KOmaDMAppUid), KFotaDownloadActive, active );
-	FLOG(_L("active = %d"),active);
-	if (active==EFalse && iDLState.iState == RFotaEngineSession::EDownloadProgressingWithResume)
-		{
-		//Actual resume only
-		if (!iUserInitiatedResume && profIapid == KErrNotFound  )
-			{
-			//FMS triggered resume, apply Rule 1
-			newIapid = iDLState.iIapId;
-			}
-		else if (profIapid == KErrNotFound)
-			{
-			//User triggered resume, apply Rule 2
-			newIapid = KErrNotFound;
-			}
-		else if (profIapid != iDLState.iIapId)
-			{
-			//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(KOmaDMAppUid), KFotaDownloadActive, val );
-
-	if (err == KErrNone && val != aValue)
-		{
-		err = RProperty::Set(TUid::Uid(KOmaDMAppUid), 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;
-	}
--- a/fotaapplication/fotaserver/FotaServer/src/fotaupdate.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1815 +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 <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)
-                {
-                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();  
-    }
-
-
-// ---------------------------------------------------------------------------
-// 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 )
-        {
-        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::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 );
-        }
-    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
-            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
-            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);
-    }
-
-
-
-// ---------------------------------------------------------------------------
-// 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
-    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];
-        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];
-        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];
-        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];  
-        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
-            {
-            LaunchNotifierL( ESyncMLFwUpdStartQuery, iUpdateState.iProfileId );
-            }
-        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;
-    
-    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 
-        ,const 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;
-        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
-    }
-
--- a/fotaapplication/fotaserver/FotaStorage/BWINS/fotadiskstorageu.def	Wed Jun 23 19:10:17 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/fotaapplication/fotaserver/FotaStorage/data/102072C6.rss	Wed Jun 23 19:10:17 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: 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
--- a/fotaapplication/fotaserver/FotaStorage/group/fotadiskstorage.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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 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
-
-
--- a/fotaapplication/fotaserver/FotaStorage/group/fotastorage.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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:   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
-
-
--- a/fotaapplication/fotaserver/FotaStorage/inc/fotaDiskStorage.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +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 __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_
--- a/fotaapplication/fotaserver/FotaStorage/inc/fotadebug.h	Wed Jun 23 19:10:17 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, "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
--- a/fotaapplication/fotaserver/FotaStorage/src/fotaDiskStorage.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,545 +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:   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;
-    }
--- a/fotaapplication/fotaserver/FotaStorage/src/fotastorage.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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:   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 ()
-    {
-    }
-
--- a/fotaapplication/fotaserver/cenrep/fotadiskstoragePrivateCRKeys.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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;
-
-// In how large blocks fw update pkg should be moved
-const TUint32 KFotaDiskSpaceReservationChunkKey = 0x00000002;
-
-
-#endif // FOTADISKSTORAGE_PRIVATE_KEYS_H
-            
-// End of File
--- a/fotaapplication/fotaserver/cenrep/fotaserverPrivateCRKeys.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +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;
-
-// 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;
-
-#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/data/fullscreendialog.docml	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,144 @@
+<?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>
--- a/fotaapplication/fotaserver/fmsclient/bwins/fmsclientu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-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)
-
--- a/fotaapplication/fotaserver/fmsclient/eabi/fmsclientu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-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
-
--- a/fotaapplication/fotaserver/fmsclient/group/bld.inf	Wed Jun 23 19:10:17 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/fotaserver/fmsclient/group/fmsclient.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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
--- a/fotaapplication/fotaserver/fmsclient/inc/fmsclient.h	Wed Jun 23 19:10:17 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 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
-		 */
-		IMPORT_C 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
--- a/fotaapplication/fotaserver/fmsclient/inc/fmsclientdebug.h	Wed Jun 23 19:10:17 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/fotaserver/fmsclient/src/fmsclient.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +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 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
--- a/fotaapplication/fotaserver/fmserver/group/bld.inf	Wed Jun 23 19:10:17 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/fotaserver/fmserver/group/fmsserver.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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 
-
--- a/fotaapplication/fotaserver/fmserver/inc/fmsdebug.h	Wed Jun 23 19:10:17 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: 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_*/
--- a/fotaapplication/fotaserver/fmserver/inc/fmsinterruptaob.h	Wed Jun 23 19:10:17 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(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
--- a/fotaapplication/fotaserver/fmserver/inc/fmsserver.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +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(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
--- a/fotaapplication/fotaserver/fmserver/inc/fmsserversession.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +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
\ No newline at end of file
--- a/fotaapplication/fotaserver/fmserver/src/fmsinterruptaob.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,975 +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"
-
-
-// ----------------------------------------------------------------------------------------
-// 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 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(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
--- a/fotaapplication/fotaserver/fmserver/src/fmsserver.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,723 +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"
-
-
-// ----------------------------------------------------------------------------------------
-// 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
--- a/fotaapplication/fotaserver/fmserver/src/fmsserversession.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,496 +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"
-
-// ----------------------------------------------------------------------------------------
-// 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
--- a/fotaapplication/fotaserver/fotacustcmds/bwins/fotacustcmdsu.def	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/eabi/fotacustcmdsu.def	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/group/bld.inf	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/group/fotacustcmds.mmp	Wed Jun 23 19:10:17 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:
-* 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
--- a/fotaapplication/fotaserver/fotacustcmds/inc/fotacustcmdallreasons.h	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/inc/fotacustcmdfirmwareupdate.h	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/inc/fotacustcmdfirstboot.h	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/inc/fotacustcmdsfactory.h	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/inc/fotastartupDebug.h	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/src/fotacustcmdallreasons.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,381 +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.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;
-	
-	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/fotaserver/fotacustcmds/src/fotacustcmdfirmwareupdate.cpp	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/src/fotacustcmdfirstboot.cpp	Wed Jun 23 19:10:17 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/fotaserver/fotacustcmds/src/fotacustcmdsfactory.cpp	Wed Jun 23 19:10:17 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/fotaserver.pro	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,177 @@
+# 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 \
+        -lapengine \
+        -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
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/fotaservernotifier.qrc	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/xml">
+        <file>data/fullscreendialog.docml</file>
+    </qresource>
+</RCC>
--- a/fotaapplication/fotaserver/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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 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
--- a/fotaapplication/fotaserver/group/fota_icons_aif_scalable_dc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: 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
--- a/fotaapplication/fotaserver/group/fota_icons_dc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaDB.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,258 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaDlClient.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,269 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaDlMgrClient.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,354 @@
+/*
+ * 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
--- a/fotaapplication/fotaserver/inc/FotaIPCTypes.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +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::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
--- a/fotaapplication/fotaserver/inc/FotaIPCTypes.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,243 +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();
-
-    /**
-     * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaNetworkRegStatus.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,165 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaServer.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,740 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotaSrvDebug.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,64 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/FotasrvSession.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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:   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 
--- a/fotaapplication/fotaserver/inc/fmsclientserver.h	Wed Jun 23 19:10:17 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: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/fotaUpdateAgentComms.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,86 @@
+/*
+ * 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/inc/fotadevicedialogobserver.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,33 @@
+/*
+ * 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/fotafullscreendialog.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,191 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/fotanotifiers.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,113 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/fotaserverPrivatePSKeys.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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:   	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/inc/fotaupdate.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,186 @@
+/*
+ * 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___
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/inc/fsview.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,42 @@
+/*
+ * 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_ */
--- a/fotaapplication/fotaserver/rom/fotaserver.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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
-
-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
--- a/fotaapplication/fotaserver/rom/fotaserverresources.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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
-S60_APP_RESOURCE(fotaserver)
-#endif // __SYNCML_DM_FOTA
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/FotaDB.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,549 @@
+/*
+ * 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);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/FotaDlClient.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,615 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/FotaDlMgrClient.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,1128 @@
+/*
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/FotaNetworkRegStatus.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,392 @@
+/*
+ * 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/src/FotaServer.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,2705 @@
+/*
+ * 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 <ApUtils.h> 
+#include <commdb.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 >>"));
+    CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(commDb);
+    CApUtils* aputils = CApUtils::NewLC(*commDb);
+    TBool exists = aputils->IAPExistsL(aIapId);
+    CleanupStack::PopAndDestroy(aputils);
+    CleanupStack::PopAndDestroy(commDb);
+    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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/fotaSrvSession.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,396 @@
+/*
+ * 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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/fotafullscreendialog.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,455 @@
+/*
+ * 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 >>"));
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/fotanotifiers.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,122 @@
+/*
+ * 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() <<"));
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/fotaupdate.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,718 @@
+/*
+ * 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;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/fsview.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,60 @@
+/*
+ * 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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/fotaserver/src/main.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,118 @@
+/*
+ * 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/fotaapplication/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -16,12 +16,50 @@
 *
 */
 
+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)
 
 
-#ifdef __SYNCML_DM_FOTA
-#include "../fotaserver/group/bld.inf"
+// 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
+
 #endif
 
 #if ( defined (__SYNCML_DM ) || defined (__PLUG_AND_PLAY_MOBILE_SERVICES) )
-#include "../fotaserver/fotacustcmds/group/bld.inf"
+#include "../fotacustcmds/group/bld.inf"
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/inc/FotaIPCTypes.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,175 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/inc/FotaIPCTypes.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/inc/fmsclientserver.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/rom/fotaserver.iby	Tue Jul 06 15:14:24 2010 +0300
@@ -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:   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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fotaapplication/rom/fotaserverresources.iby	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -45,3 +45,6 @@
 
 //remotemgmt_pub
 #include "../remotemgmt_pub/group/bld.inf"
+
+//devicemgmtnotifications
+#include "../devicemgmtnotifications/group/bld.inf"
\ No newline at end of file
--- a/layers.sysdef.xml	Wed Jun 23 19:10:17 2010 +0300
+++ b/layers.sysdef.xml	Tue Jul 06 15:14:24 2010 +0300
@@ -1,13 +1,14 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
   <!ENTITY layer_real_source_path "sf/mw/remotemgmt" >
 ]>
 
-<SystemDefinition name="remotemgmt" schema="1.4.0">
+<SystemDefinition name="remotemgmt" schema="1.5.1">
   <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/provisioning/Group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/omaprovisioning/provisioning/Group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -38,93 +38,21 @@
 
 // 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)
-../accesspointadapter/loc/WPAPAdapter.loc		MW_LAYER_LOC_EXPORT_PATH(WPAPAdapter.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)
-
 
 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
-../MbxNbrAdapter/group/MbxNbrAdapter.mmp
-
-
-
-//../AuthtypePlugin/group/Authtypeplugin.mmp
-//../AlwaysOnAdapter/group/AlwaysOnAdapter.mmp
-//../cpdestinationnwadapter/group/wpdestinationnwadapter.mmp
-
-#ifdef __SMART_CARD_PROV
-//    ../ProvisioningSC/group/ProvisioningSC.mmp - commented
-#endif
-
-
-#ifndef SBSV2
-
-gnumakefile ../ProvisioningCx/group/iconscxdc.mk
-
-#ifdef __SCALABLE_ICONS
-   // gnumakefile ../provisioningcx/group/Iconscxaifscalabledc.mk - commented
-#else
-   // gnumakefile ../provisioningcx/group/Iconscxaifbitmaps.mk - commented
-#endif
-
-//gnumakefile ../AuthtypePlugin/group/AuthtypepluginIcons.mk - commented
-
-#endif
-
-
-
-
 PRJ_TESTMMPFILES
 
 //  End of File  
--- a/omaprovisioning/provisioning/MbxNbrAdapter/Data/10207281.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* 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
-
--- a/omaprovisioning/provisioning/MbxNbrAdapter/Data/WPMbxNbrAdapterResource.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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:  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
--- a/omaprovisioning/provisioning/MbxNbrAdapter/Group/MbxNbrAdapter.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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
-
--- a/omaprovisioning/provisioning/MbxNbrAdapter/Inc/MbxNbrAdapter.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +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:  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
--- a/omaprovisioning/provisioning/MbxNbrAdapter/Src/MbxNbrAdapter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +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:  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  
--- a/omaprovisioning/provisioning/MbxNbrAdapter/Src/MbxNbrAdapterGroupProxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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:  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  
--- a/omaprovisioning/provisioning/MbxNbrAdapter/loc/MailboxAdapter.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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:  
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/BWINS/ProvisioningBCu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-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 *)
-
--- a/omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: 
-#    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
--- a/omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Bif/ProvisioningBif_dc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: 
-#    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
--- a/omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.lnt	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
--w2
-
--i..\Inc
--d_UNICODE
-APP_LAYER_SYSTEMINCLUDE
-..\Src\*.cpp 
--- a/omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
-* 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
-
--- a/omaprovisioning/provisioning/ProvisioningBC/Group/ProvisioningBC.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPBioControl.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,276 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPCodeQueryDialog.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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: 
-*     
-*
-*/
-
-
-#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
--- a/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPNameValue.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPSaver.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
-* 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
--- a/omaprovisioning/provisioning/ProvisioningBC/Inc/CWPStringPair.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Src/CWPBioControl.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,875 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Src/CWPCodeQueryDialog.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/Src/CWPNameValue.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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: 
-*		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
--- a/omaprovisioning/provisioning/ProvisioningBC/Src/CWPSaver.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,327 +0,0 @@
-/*
-* 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();
-        }
-    }
-
-TInt CWPSaver::GetNumAccessDenied()
-    {
-    return iNumAccessDenied;
-    }	
-void CWPSaver::SetNumAccessDenied(TInt aNumAccessDenied )
-    {
-    iNumAccessDenied = aNumAccessDenied;
-    }	
-//  End of File
--- a/omaprovisioning/provisioning/ProvisioningBC/Src/CWPStringPair.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningBC/eabi/ProvisioningBCu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-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>#
-
--- a/omaprovisioning/provisioning/ProvisioningBC/loc/ProvisioningBC.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxApp.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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: 
-*     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
-
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxAppUi.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxContainer.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxDeleter.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-/*
-* 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
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxDocument.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: 
-*     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
-
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/CWPCxView.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningCx/Inc/ProvisioningCx.hrh	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 
-*     Provisioning context list view commands
-*
-*/
-
-
-#ifndef PROVISIONINGCX_HRH
-#define PROVISIONINGCX_HRH
-
-enum TProvisioningCxMenuCommands
-    {
-    EProvisioningCxCmdDeleteContext = 1,
-    EProvisioningCxCmdSelect
-    };
-
-
-#endif      //  PROVISIONINGCX_HRH
--- a/omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx_Caption.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 
-*    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
--- a/omaprovisioning/provisioning/ProvisioningCx/Rss/ProvisioningCx_reg.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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:  
-*
-*/
-
-
-#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
--- a/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxApp.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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  
-
--- a/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxAppUi.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +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:  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  
--- a/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxContainer.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +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:  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  
--- a/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxDeleter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-/*
-* 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
-
--- a/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxDocument.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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:  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  
--- a/omaprovisioning/provisioning/ProvisioningCx/Src/CWPCxView.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +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:  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
--- a/omaprovisioning/provisioning/ProvisioningCx/aif/ProvisioningCxaif.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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: 
-*     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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_bitmaps.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_scalable.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Icons_aif_scalable_dc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifbitmaps.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifbitmapsdc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifscalable.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/Iconscxaifscalabledc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/ProvisioningCx.lnt	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
--w2
-
--i..\Inc
--d_UNICODE
-
-APP_LAYER_SYSTEMINCLUDE
-
-..\Src\*.cpp 
--- a/omaprovisioning/provisioning/ProvisioningCx/group/ProvisioningCx.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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: 
-*     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
-
--- a/omaprovisioning/provisioning/ProvisioningCx/group/icons.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/group/iconscxdc.mk	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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: 
-#
-
-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
--- a/omaprovisioning/provisioning/ProvisioningCx/loc/ProvisioningCx.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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: 
-*     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/ProvisioningParser/Src/CWPWbxmlParser.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningParser/Src/CWPWbxmlParser.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -22,7 +22,7 @@
 #include "CWPWbxmlParser.h"
 #include "OMAProvisioningDictionary.h"
 #include "ProvisioningDebug.h"
-#include <nw_cXML_Parser.h>
+#include <xml/cxml/nw_cXML_Parser.h>
 
 // EXTERNAL DATA STRUCTURES
 extern "C" NW_WBXML_Dictionary_t NW_omawapprovisioning_WBXMLDictionary;
--- a/omaprovisioning/provisioning/ProvisioningParser/Src/OMAProvisioningDictionary.c	Wed Jun 23 19:10:17 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningParser/Src/OMAProvisioningDictionary.c	Tue Jul 06 15:14:24 2010 +0300
@@ -35,7 +35,7 @@
  */
 
 #include "OMAProvisioningDictionary.h"
-#include "nw_wbxml_dictionary.h"
+#include <xml/cxml/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/Rom/Provisioning.iby	Wed Jun 23 19:10:17 2010 +0300
+++ b/omaprovisioning/provisioning/Rom/Provisioning.iby	Tue Jul 06 15:14:24 2010 +0300
@@ -24,58 +24,8 @@
 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/omaprovisioning/provisioning/Rom/ProvisioningResources.iby	Tue Jul 06 15:14:24 2010 +0300
@@ -21,30 +21,9 @@
 
 
 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
-
-data=DATAZ_\RESOURCE_FILES_DIR\WPAPAdapterResource.rsc                          RESOURCE_FILES_DIR\WPAPAdapterResource.rsc
-data=DATAZ_\RESOURCE_FILES_DIR\wpdestinationnwadapter.rsc                       RESOURCE_FILES_DIR\wpdestinationnwadapter.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
--- a/omaprovisioning/provisioning/StreamingAdapter/Data/101F85CB.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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:  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
-
--- a/omaprovisioning/provisioning/StreamingAdapter/Data/WPStreamingAdapterResource.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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:  Resource file.
-*
-*/
-
-
-//  INCLUDES
-#include    <badef.rh>
-#include    <streamingadapter.loc>
-
-
-RESOURCE LBUF r_streaming_adapter_title
-	{
-	txt = qtn_op_head_streaming;
-	}
-
-// End of file
--- a/omaprovisioning/provisioning/StreamingAdapter/Group/StreamingAdapter.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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         cmmanager.lib
-LIBRARY         commdb.lib
-DEBUGLIBRARY    flogger.lib
-
-
-SMPSAFE
-//end of file
-
--- a/omaprovisioning/provisioning/StreamingAdapter/Inc/StreamingAdapter.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +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:  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
--- a/omaprovisioning/provisioning/StreamingAdapter/Src/Streamingadapter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,541 +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:  Handles streaming app settings in OMA provisioning.
-*
-*/
-
-
-// INCLUDE FILES
-#include    <f32file.h>
-#include    <CWPCharacteristic.h>
-#include    <CWPParameter.h>
-#include    <wpstreamingadapterresource.rsg>
-#include    <mpsettingsmodel.h>
-#include    <cmconnectionmethoddef.h>
-#include    <cmmanagerext.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
-    
-    RCmManagerExt  cmmanagerExt;
-    cmmanagerExt.OpenL();
-    CleanupClosePushL(cmmanagerExt);
-
-    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));
-        RCmConnectionMethodExt cm;
-        cm = cmmanagerExt.ConnectionMethodL( uid() );
-        CleanupClosePushL( cm );
-
-        TBool useProxy = cm.GetBoolAttributeL( CMManager::ECmProxyUsageEnabled );
-        
-        if (!apDefined || (!useProxy && !apWithoutProxyDefined))
-            {
-            iModel->SetDefaultAp(uid());
-            apDefined = ETrue;
-
-            iSavedID.Copy(uid);
-
-            if (!useProxy)
-                {
-                apWithoutProxyDefined = ETrue;
-                }
-            }
-        
-        if (!proxyDefined && useProxy)
-            {
-           // Get proxy port
-            TUint32 proxyPort = cm.GetIntAttributeL( CMManager::ECmProxyPortNumber );
-            
-
-            // Get proxy host name
-            const HBufC* proxyHost = cm.GetStringAttributeL( CMManager::ECmProxyServerName );
-
-            if(*proxyHost != KNullDesC && proxyPort <= 65535)
-                {
-                iModel->SetProxyHostNameL(*proxyHost);
-                iModel->SetProxyPort(static_cast<TInt>(proxyPort));
-                iModel->SetProxyMode(KProxyEnabled);
-                
-                proxyDefined = ETrue;
-                }
-            delete proxyHost;
-            }
-        CleanupStack::PopAndDestroy();//cm
-        }
-
-    CleanupStack::PopAndDestroy(); // cmmanagerext
-
-    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  
--- a/omaprovisioning/provisioning/StreamingAdapter/Src/StreamingadapterGroupProxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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  
--- a/omaprovisioning/provisioning/StreamingAdapter/loc/StreamingAdapter.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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:  
-*     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
--- a/omaprovisioning/provisioning/WAPAdapter/Data/101F84DC.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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:  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";
-                    }
-                };
-            }
-        };
-    }
-
--- a/omaprovisioning/provisioning/WAPAdapter/Data/WPWAPAdapterResource.rss	Wed Jun 23 19:10:17 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:  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;
-    }
--- a/omaprovisioning/provisioning/WAPAdapter/Group/WPWAPAdapter.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* 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         cmmanager.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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPAdapterBase.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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: 
-*     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 RCmConnectionMethodExt;
-class RCmManagerExt;
-
-// 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.
-        RCmManagerExt* iCmManager;
-    };
-
-#endif  // CWPWAPADAPTERBASE_H
-            
-// End of File
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBookmarkItem.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
-* 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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBrowserAdapter.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* 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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPBrowserItem.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 RCmManagerExt;
-// 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, 
-            RCmManagerExt*& aCmManager,
-            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, 
-            RCmManagerExt*& aCmManager,
-            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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPItemBAse.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +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: 
-*     Base class for WAP setting items.
-*
-*/
-
-
-#ifndef CWPWAPITEMBASE_H
-#define CWPWAPITEMBASE_H
-
-// INCLUDES
-#include <e32base.h>
-#include <MWPVisitor.h>
-#include "MWPWAPItemBase.h"
-#include <cmmanagerext.h>
-#include <cmconnectionmethodext.h>
-
-// FORWARD DECLARATIONS
-class CCommsDatabase;
-
-
-// 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, 
-            RCmManagerExt*& aCmManager);
-
-        /**
-        * 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( RCmConnectionMethodExt& aCmItem );
-
-        /**
-        * 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;
-
-                // @var Pointer to Connection Method Manager that is required to access
-        // Access Point data
-        RCmManagerExt*&   iCmManager;
-    };
-
-#endif  // CWPWAPITEMBASE_H
-            
-// End of File
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPMMSAdapter.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +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: 
-*     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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPMMSItem.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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: 
-*     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 RCmManagerExt;
-
-// 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, 
-            RCmManagerExt*& aCmManager);
-
-        /**
-        * 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, 
-            RCmManagerExt*& aCmManager);
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-
-
-    private:   // Data
-        // The bookmarks database. Refs.
-        CBookmarkDb* iDb;
-
-        // The potential links
-        RPointerArray<CWPCharacteristic> iLinks;
-    };
-
-#endif  // CWPWAPMMSITEM_H
-            
-// End of File
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/MWPWAPItemBase.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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: 
-*     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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPDebug.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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: 
-*     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 */
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPItemFactory.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* 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 RCmConnectionMethodExt;
-class RCmDestinationExt;
-class CBookmarkDb;
-class RFavouritesDb;
-// CLASS DECLARATION
-class RCmManagerExt;
-/**
- * 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, 
-            RCmManagerExt*& aCmManager );
-
-
-        /**
-        * 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, 
-            RCmManagerExt*& aCmManager,
-            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
--- a/omaprovisioning/provisioning/WAPAdapter/Inc/WPWAPUtil.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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: 
-*     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
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPAdapterBase.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +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:  Base for WAP adapters.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include <e32base.h>
-#include <commdb.h>
-#include <cmmanagerext.h>
-#include <cmconnectionmethodext.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;
-    
-    if ( iCmManager !=  NULL )
-        {
-        iCmManager->Close();
-        delete iCmManager;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// 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, iCmManager->ConnectionMethodL( pckg().iUID).DeleteL());
-        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();
-        }
-    iCmManager = new RCmManagerExt;
-    iCmManager->OpenL();
-
-    
-    }
-
-//  End of File  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBookmarkItem.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,273 +0,0 @@
-/*
-* 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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBrowserAdapter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* 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 "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, iCmManager, 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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPBrowserItem.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +0,0 @@
-/*
-* 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 <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, 
-                                      RCmManagerExt*& aCmManager,
-                                      RFavouritesDb aBookmarkDb 
-                                    )
-                                    : CWPWAPItemBase( aTitle,
-                                                      aDefaultName, 
-                                                      aCharacteristic, 
-                                                      aCommsDb, 
-                                                      aCmManager ), 
-                                    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, 
-                                            RCmManagerExt*& aCmManager,
-                                            RFavouritesDb aBookmarkDb
-                                            )
-    {
-    CWPWAPBrowserItem* self = new(ELeave) CWPWAPBrowserItem( aFirst,
-                                                             aTitle, 
-                                                             aBookmarkTitle, 
-                                                             aDefaultName, 
-                                                             aDefaultBookmarkName,
-                                                             aCharacteristic, 
-                                                             aCommsDb, 
-                                                             aCmManager, 
-                                                             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() );
-        }
-    RCmConnectionMethodExt cm;
-    cm = iCmManager->ConnectionMethodL( iUID );
-    CleanupClosePushL( cm );
-    if( iAddr )
-        {
-        // Update the access point startpage
-        WriteHomePageL( cm );
-        }
-    CleanupStack::PopAndDestroy(); // cm
-    }
-
-// -----------------------------------------------------------------------------
-// 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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPItemBAse.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +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:  Base class for WAP setting items.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include <e32base.h>
-#include <msvapi.h>
-#include <mmsclient.h> 
-#include <mtclreg.h>
-#include <f32file.h>
-#include <barsc.h>
-#include <bautils.h>
-#include <CWPCharacteristic.h>
-#include <CWPParameter.h>
-#include <WPAdapterUtil.h>
-#include <commdb.h>
-#include <CWPAdapter.h>
-#include "CWPWAPItemBAse.h"
-#include "ProvisioningDebug.h"
-#include <cmconnectionmethoddef.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, 
-                                 RCmManagerExt*& aCmManager)
-                                : iCharacteristic( aCharacteristic ), 
-                                  iTitle( aTitle ), 
-                                  iDefaultName( aDefaultName ), 
-                                  iCommsDb( aCommsDb ), 
-                                  iCmManager( aCmManager )
-    {
-    
-    }
-
-// -----------------------------------------------------------------------------
-// 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( !iCmManager )
-        {
-        iCmManager = new RCmManagerExt;
-        iCmManager->OpenL();
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CWPWAPItemBase::WriteHomePageL
-// -----------------------------------------------------------------------------
-//
-void CWPWAPItemBase::WriteHomePageL( RCmConnectionMethodExt& aCmItem )
-    {
-    FLOG( _L( "[Provisioning] CWPWAPItemBase::WriteHomePageL:" ) );
-
-    if( iAddr )
-        {
-        if( aCmItem.GetStringAttributeL(CMManager::ECmStartPage) > 0 )
-            {
-            FLOG( _L( "[Provisioning] CWPWAPItemBase::WriteHomePageL: EApWapStartPage " ) );
-            // Make a copy of the AP
-            RCmConnectionMethodExt cm = aCmItem.CreateCopyL();
-            CleanupClosePushL( cm );
-            
-            // Create a proper name for the copy
-            TBuf<KNameMaxLength> name( iName.Left( KNameMaxLength ) );
-           // MakeValidNameL( name, *iCommsDb );
-            
-            
-            // Write name 
-            cm.SetStringAttributeL(CMManager::ECmName,name);
-            cm.SetStringAttributeL(CMManager::ENamingUnique,name);
-            
-            // Write MMSC address
-            cm.SetStringAttributeL(CMManager::ECmStartPage,*iAddr);
-            
-            // Create the new access point
-            TRAPD( err, cm.UpdateL() );
-            
-            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 " ) );
-            aCmItem.SetStringAttributeL(CMManager::ECmStartPage,*iAddr);
-            
-            // Update the access point
-            TBool nameChanged( EFalse );
-            TRAPD( err, aCmItem.UpdateL() );
-            FTRACE(RDebug::Print(_L("[Provisioning] CWPWAPItemBase::WriteHomePageL: CreateFromDataL err (%d)"), err));
-            if( err == KErrLocked )
-                {
-                err = EWPCommsDBLocked;
-                }
-            User::LeaveIfError( err );
-            iUID = aCmItem.GetIntAttributeL(CMManager::ECmIapId);
-            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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPMMSAdapter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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:  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 "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, iCmManager );
-        if( item->ValidateL() )
-            {
-            item->AddL( iItems, iHiddenItems );
-            CleanupStack::Pop(); // item
-            }
-        else
-            {
-            CleanupStack::PopAndDestroy(); // item
-            }
-        }
-    }
-
-//  End of File  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/CWPWAPMMSItem.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
-* 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 <cmmanagerext.h>
-#include <cmconnectionmethodext.h>
-#include <cmpluginpacketdatadef.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, 
-    RCmManagerExt*& aCmManager )
-: CWPWAPItemBase( aTitle, aDefaultName, aCharacteristic, aDb, aCmManager )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// 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, 
-    RCmManagerExt*& aCmManager )
-    {
-    CWPWAPMMSItem* self = new(ELeave) CWPWAPMMSItem( aTitle, aDefaultName, 
-        aCharacteristic, aDb, aCmManager ); 
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// Destructor
-CWPWAPMMSItem::~CWPWAPMMSItem()
-    {
-    iLinks.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CWPWAPMMSItem::SaveL
-// -----------------------------------------------------------------------------
-//
-void CWPWAPMMSItem::SaveL()
-    {
-    CreateDbL();
-	TBool check = EFalse;
-    RCmConnectionMethodExt cm;
-    TUint32 bearer = 0;
-    for( TInt i( 0 ); i < iLinks.Count() && check == EFalse ; i++ )
-       {
-       CWPCharacteristic* curr = iLinks[i];
-       TPckgBuf<TUint32> uidPckg;
-       const TInt pkgLength( uidPckg.MaxLength() );
-       for( TInt dataNum( 0 ); check == EFalse && curr->Data( dataNum ).Length() == pkgLength;dataNum++ )
-          {
-          uidPckg.Copy( curr->Data( dataNum ) );
-          // Read the access point pointed to by TO-NAPID or TO-PROXY
-          cm = iCmManager->ConnectionMethodL( uidPckg() );
-          CleanupClosePushL( cm );
-          bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );
-          if( bearer == KUidPacketDataBearerType )
-            {
-            // Item left on cleanup stack
-            check = ETrue;
-            }
-          else
-            {
-            CleanupStack::PopAndDestroy(); // cm
-            }
-          }
-        }
-    
-    WriteHomePageL( cm );    
-    CleanupStack::PopAndDestroy(); // cm
-    }
-
-// -----------------------------------------------------------------------------
-// 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*/)
-    {
-    }
-
-
-
-//  End of File  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPAdapterGroupProxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:  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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPAdapterMain.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* 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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPItemFactory.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
-* 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, 
-            RCmManagerExt*& aCmManager )
-    {
-    CWPWAPMMSItem* item = CWPWAPMMSItem::NewL( aTitle, aDefaultName, 
-        aCharacteristic, aCommsDb, aCmManager );
-    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, 
-            RCmManagerExt*& aCmManager,
-            RFavouritesDb aBookmarkDb )
-    {
-    CWPWAPBrowserItem* item = CWPWAPBrowserItem::NewL( aFirst, aTitle, aBookmarkTitle, 
-        aDefaultName, aDefaultBookmarkName, aCharacteristic, aCommsDb, aCmManager, 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  
--- a/omaprovisioning/provisioning/WAPAdapter/Src/WPWAPUtil.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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:  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  
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAccesspointItem.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAdapter.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPItemBase.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +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:     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 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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPLogicalProxy.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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:     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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPNapdef.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,388 +0,0 @@
-/*
-* 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 CWPParameter;
-class CCommsDatabase;
-class EAPSettings;
-class EapCertificateEntry;
-class RCmManagerExt;
-class TEapExpandedType;
-
-
-// CLASS DECLARATION
-
-/**
- * CEapTypeElement is arrray element for several EapTypes  
- */ 
-class CEapTypeElement: public CBase
-        {
-        public:
-        ~CEapTypeElement();
-        TBuf8<KExpandedEapIdLength> iEapTypeString;
-        TBuf8<KExpandedEapIdLength> iEncapsulatingExpandedEapId;
-        EAPSettings* iEAPSettings;
-        EapCertificateEntry* 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, TEapExpandedType& 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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPPhysicalProxy.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +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:     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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPPort.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +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:     Defines a class, which holds proxy port information.
-*
-*/
-
-
-
-
-
-#ifndef CWPAPPORT_H
-#define CWPAPPORT_H
-
-// INCLUDES
-
-#include <MWPVisitor.h>
-#include "CWPAPItemBase.h"
-
-// FORWARD DECLARATIONS
-
-
-
-// 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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/ProvisioningDebug.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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 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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPAdapter.pan	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPDefs.h	Wed Jun 23 19:10:17 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:     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.
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPSharedDataKeys.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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:     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
--- a/omaprovisioning/provisioning/accesspointadapter/Inc/WPAPUtil.h	Wed Jun 23 19:10:17 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:     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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPAccesspointItem.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,320 +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:   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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPAdapter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,452 +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:   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  
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPItemBase.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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:    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  
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPLogicalProxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPNapdef.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2039 +0,0 @@
-/*
-* 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 <EapExpandedType.h>
-#include <centralrepository.h>
-#include <pdpcontextmanagerinternalcrkeys.h>
-#include <EapGeneralSettings.h>
-#include <EapTypeDefinitions.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) EapCertificateEntry;
-                    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, eap->iEAPSettings->iEAPExpandedType );
-        
-        }
-    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;
-            eap->iEAPSettings->iUseAutomaticUsernamePresent = ETrue;
-            eap->iEAPSettings->iUseAutomaticUsername = EFalse;
-            }
-        }// 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;
-            eap->iEAPSettings-> iShowPassWordPromptPresent = ETrue;
-            eap->iEAPSettings-> iShowPassWordPrompt = EFalse;
-            }
-        }// 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;
-            eap->iEAPSettings->iUseAutomaticRealmPresent = ETrue;
-            eap->iEAPSettings->iUseAutomaticRealm = EFalse;
-            }
-        }// 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" ) );
-        
-        TEapExpandedType 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->SetSubjectName(value);
-        eap->iCertificate->SetSubjectNamePresent();
-        }// else if        
-        
-    else if( ( aParameter.Name().Compare( EAPSUBNAME ) ) == 0 )
-        {
-        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPSUBNAME" ) );
-        
-        eap->iCertificate->SetIssuerName(value);
-        eap->iCertificate->SetIssuerNamePresent();       
-        }// 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->SetCertType(EapCertificateEntry::ECA);
-            eap->iEAPSettings-> iUseAutomaticCACertificatePresent = ETrue;
-            eap->iEAPSettings-> iUseAutomaticCACertificate = EFalse;
-			}
-		else
-		    {
-		    eap->iCertificate->SetCertType(EapCertificateEntry::EUser);
-		    }
-		// Certificates must be present since this field was added
-		eap->iEAPSettings->iCertificatesPresent = ETrue;
-		eap->iCertificate->SetIsEnabledPresent();
-		eap->iCertificate->SetIsEnabled(ETrue) ;
-        
-        }// else if        
-    else if( ( aParameter.Name().Compare( EAPSERNUM ) ) == 0 )
-        {
-        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPSERNUM" ) );
-        
-        eap->iCertificate->SetSerialNumber(value);
-        eap->iCertificate->SetSerialNumberPresent();
-        }// 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;
-       			}
-       		}
-       	TBuf8<KMaxSubKeyLenght> keyIdentifier;
-       	keyIdentifier.Copy(key);
-       	// store key value only if no errors occurred
-       	if (err == KErrNone) 
-       		{
-       		eap->iCertificate->SetSubjectKeyId(keyIdentifier);
-       		eap->iCertificate->SetSubjectKeyIdPresent();
-       		eap->iEAPSettings->iCertificatesPresent = ETrue; 
-       		}
-       	}
-       	
-        
-    else if( ( aParameter.Name().Compare( EAPTHUMBPRINT ) ) == 0 )
-        {
-        FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::HandleEAPParametersL EAPTHUMBPRINT" ) );
-        eap->iCertificate->SetThumbprintPresent();
-        eap->iCertificate->SetThumbprint(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.Append( 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->iEnabledEncapsulatedEAPExpandedTypes.Append( iEapTypeArray[j]->iEAPSettings->iEAPExpandedType );
-                         eap->iEAPSettings->iEnabledEncapsulatedEAPExpandedTypesPresent = ETrue;
-                         }
-                     }
-                 
-            FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::SaveWlanDataL save EAP settings CEapType::NewL" ) );        
-            CEapType* eapType = NULL;
-
-            
-            TRAPD( error, ( eapType = CEapType::NewL( ELan, serviceId, eap->iEAPSettings->iEAPExpandedType ) ) );
-
-            if ( ( error == KErrNone ) && eapType )
-                {
-                CleanupStack::PushL( eapType );
-                
-                // Check if this type is tunneled
-                if ( eap->iEncapsulatingExpandedEapId.Length() > 0 )
-                	{
-                	// It is tunneled. 
-                	eapType->SetTunnelingType( eap->iEncapsulatingExpandedEapId);
-                	
-                	}
-                
-                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;
-    		    }
-    		// load general EAP settings If
-    		CEapGeneralSettings* genSettings;
-    		genSettings = CEapGeneralSettings::NewL(ELan, serviceId);
-    		CleanupStack::PushL( genSettings );
-
-    		// get lists of enabled/disabled EAPs for the IAP
-    		
-    		RArray<TEapExpandedType> enabledEapMethods;
-    		RArray<TEapExpandedType> disabledEapMethods;
-
-    		enabledEapMethods.Reset();
-    		disabledEapMethods.Reset();
-   		    
-    		lex.Assign( eapList );
-    		
-    		while ( !lex.Eos() )
-    		    {
-    		    // beginning of implementation UID
-    		    TInt16 implUid = 0;
-    		    
-    		    if ( lex.Val( implUid ) != KErrNone || !implUid )
-    		        {
-    		        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 )
-    		        {
-    		        TBuf8<KExpandedEapIdLength> tempbuf;
-    		        if(Abs( implUid ) == KPlainMsChapV2ImplUid)
-    		            {
-    		            tempbuf.Append(KMsChapV2Padding);
-    		            }
-    		        else
-    		            {
-    		            tempbuf.Append(KPadding);
-    		            }
-    		        tempbuf.Append(Abs( implUid ));
-    		        TEapExpandedType expandedTypebuf(tempbuf);
-    		        enabledEapMethods.Append(expandedTypebuf);   
-    		        }
-    		        		    
-    		    // swallow the delimiter (',')
-    		    lex.Get();
-    		    }
-    
-    		genSettings->SetEapMethods(enabledEapMethods, disabledEapMethods);  
-    		            
-    		CleanupStack::PopAndDestroy( genSettings );
-    		
-    
-     
-            
-       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, TEapExpandedType& aID)
-	{
-    if ( aEAPString == KEAPSIM )
-		{	
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapSim" ) );
-		aExpandedId.Copy( KEapSimTypeId, KExpandedEapIdLength );
-		aID = *EapExpandedTypeSim.GetType();
-		}
-    else if( aEAPString == KEAPAKA )
-        {
-  		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapAka" ) );
-		aExpandedId.Copy( KEapAkaTypeId, KExpandedEapIdLength );	
-		aID = *EapExpandedTypeAka.GetType();	
-        }
-    else if( aEAPString == KEAPTLS )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapTls" ) );
-		aExpandedId.Copy( KEapTlsTypeId, KExpandedEapIdLength );	
-		aID = *EapExpandedTypeTls.GetType();	
-        }
-    else if( aEAPString == KEAPPEAP )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapPeap" ) );
-		aExpandedId.Copy( KEapPeapTypeId, KExpandedEapIdLength );	
-		aID = *EapExpandedTypePeap.GetType();	
-        }
-    else if( aEAPString == KEAPTTLS )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapTtls" ) );
-		aExpandedId.Copy( KEapTtlsTypeId, KExpandedEapIdLength );		
-		aID = *EapExpandedTypeTtls.GetType();
-        }
-   else if( aEAPString == KEAPLEAP )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapLeap" ) );
-		aExpandedId.Copy( KEapLeapTypeId, KExpandedEapIdLength );
-		aID = *EapExpandedTypeLeap.GetType();		
-        }                                    
-   else if( aEAPString == KEAPMSCHAPV2 )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapMschapv2" ) );
-		aExpandedId.Copy( KEapMschapv2TypeId, KExpandedEapIdLength );		
-		aID = *EapExpandedTypeMsChapv2.GetType();
-        }     
-   else if( aEAPString == KEAPGTC )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapGtc" ) );
-		aExpandedId.Copy( KEapGtcTypeId, KExpandedEapIdLength );
-		aID = *EapExpandedTypeGtc.GetType();
-        }
-   else if( aEAPString == KEAPFAST )
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapFast" ) );
-		aExpandedId.Copy( KEapFastTypeId, KExpandedEapIdLength );
-		aID = *EapExpandedTypeFast.GetType();
-        }
-
-    else
-        {
-		FLOG( _L( "[AccesspointAdapter] CWPAPNapdef::ConvertEAPStringToIds EEapNone" ) );
-		aExpandedId.Copy( KEapNoneId, KExpandedEapIdLength );
-		aID = *EapExpandedTypeNone.GetType();
-        }
-
-	}
- 
-// ---------------------------------------------------------------------------
-// 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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPPhysicalProxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPAPPort.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,294 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPLog.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +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:   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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPLog.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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:   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  
--- a/omaprovisioning/provisioning/accesspointadapter/Src/CWPLogDef.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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:   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  
--- a/omaprovisioning/provisioning/accesspointadapter/Src/WPAPAdapterGroupProxy.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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:    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  
--- a/omaprovisioning/provisioning/accesspointadapter/Src/WPAPAdapterPanics.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/Src/WPAPUtil.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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:    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
--- a/omaprovisioning/provisioning/accesspointadapter/group/101F84D8.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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:   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";
-					}
-				};
-			}
-		};
-	}
-
--- a/omaprovisioning/provisioning/accesspointadapter/group/WPAPAdapter.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* 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         commdb.lib
-LIBRARY         FeatMgr.lib
-LIBRARY         ecom.lib
-LIBRARY 		centralrepository.lib
-LIBRARY			cmmanager.lib
-LIBRARY			eapsymbiantools.lib
-LIBRARY			eaptools.lib
-LIBRARY			eaptrace.lib
-DEBUGLIBRARY    flogger.lib     // Only in debug builds
-
-// End of File
--- a/omaprovisioning/provisioning/accesspointadapter/group/WPAPAdapterResource.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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:   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; 
-	}
--- a/omaprovisioning/provisioning/accesspointadapter/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* 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
-
--- a/omaprovisioning/provisioning/accesspointadapter/loc/WPAPAdapter.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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
--- a/omaprovisioning/provisioning/accesspointadapter/rom/WPAPAdapter.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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:   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
--- a/omaprovisioning/provisioning/accesspointadapter/rom/WPAPAdapterResources.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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:   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
Binary file omaprovisioning/provisioning/conf/CI_s60provisioning.confml has changed
--- a/policymanagement/dmutilserver/group/DMUtilServer.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/dmutilserver/group/DMUtilServer.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -48,6 +48,10 @@
 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
@@ -56,11 +60,13 @@
 #endif // __TARM_SYMBIAN_CONVERGENCY
 
 // Symbian
-LIBRARY         euser.lib
-LIBRARY         efsrv.lib
-LIBRARY         bafl.lib
-LIBRARY         centralrepository.lib
-LIBRARY					flogger.lib
+LIBRARY     euser.lib
+LIBRARY     efsrv.lib
+LIBRARY     bafl.lib
+LIBRARY     centralrepository.lib
+LIBRARY		flogger.lib
+LIBRARY 	HbCore.lib
+LIBRARY     HbWidgets.lib
 
 #ifdef __TARM_SYMBIAN_CONVERGENCY
  LIBRARY				dmtreeclient.lib
--- a/policymanagement/dmutilserver/src/DMUtilSession.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/dmutilserver/src/DMUtilSession.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -31,7 +31,8 @@
 #include <centralrepository.h>
 
 #include <coreapplicationuisdomainpskeys.h>
-
+#include <hbsymbianvariant.h>
+#include <hbindicatorsymbian.h>
 
 
 #include <e32property.h>
@@ -48,6 +49,10 @@
 _LIT( MDriveColon, ":");
 _LIT( KMMCEraseFlagFileName, "fmmc.dat");
 
+_LIT(KDMSettingsIndicatorType, "com.nokia.devicemanagement.settingsindicatorplugin/1.0");
+_LIT(KTarmTrustManagementActive, "ManagementActive");
+_LIT(KTarmTrustTerminalSecurity, "TerminalSecurity");
+
 // MACROS
 
 
@@ -339,6 +344,9 @@
 	//get terminal security and management state from centrep
 	TInt terminalSecurity = 0;
 	TInt err( KErrNone );
+	
+	CHbIndicatorSymbian *ind = CHbIndicatorSymbian::NewL();
+	CleanupStack::PushL(ind);
 
 	if ( !aCenRep)
 		{
@@ -357,19 +365,34 @@
 	if ( CDMUtilServer::iManagementActive )			
 		{
 		RDEBUG(" iManagementActive is ETrue -> ECoreAppUIsTarmMngActiveIndicatorOn");
-		err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmMngActiveIndicatorOn);	
+		//err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmMngActiveIndicatorOn);
+		
+		CHbSymbianVariant* parameter = CHbSymbianVariant::NewL(&KTarmTrustManagementActive,  
+                            CHbSymbianVariant::EDes);
+		ind->Activate(KDMSettingsIndicatorType, parameter );
+		delete parameter;
+
 		}
 	else if ( terminalSecurity )
 		{
 		RDEBUG(" terminalSecurity is ETrue -> ECoreAppUIsTarmTerminalSecurityOnIndicatorOn");
-		err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmTerminalSecurityOnIndicatorOn);	
+		//err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmTerminalSecurityOnIndicatorOn);
+		
+		CHbSymbianVariant* parameter = CHbSymbianVariant::NewL(&KTarmTrustTerminalSecurity,  
+                            CHbSymbianVariant::EDes);
+		ind->Activate(KDMSettingsIndicatorType, parameter );
+		delete parameter;
 		}
 	else
 		{
 		RDEBUG(" terminalSecurity is EFalse -> ECoreAppUIsTarmIndicatorsOff");
-		err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmIndicatorsOff);	
+		//err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, ECoreAppUIsTarmIndicatorsOff);
+		
+		ind->Deactivate(KDMSettingsIndicatorType);
 		}	
 	
+	CleanupStack::PopAndDestroy(ind);
+	
 	if( err != KErrNone )
 		{
 		RDEBUG8_2("CDMUtilSession::SetIndicatorStateL ERROR: %d",err);
--- a/policymanagement/policyengine/group/PolicyEngineServer.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/group/PolicyEngineServer.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -59,6 +59,10 @@
 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 
@@ -75,6 +79,7 @@
 LIBRARY		  commsdat.lib
 LIBRARY		  flogger.lib
 LIBRARY 	  featmgr.lib
-LIBRARY     inetprotutil.lib
+LIBRARY       HbWidgets.lib HbCore.lib
+LIBRARY 	  inetprotutil.lib
 
 SMPSAFE
--- a/policymanagement/policyengine/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -29,7 +29,7 @@
 
 ../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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengine.pro	Tue Jul 06 15:14:24 2010 +0300
@@ -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:  Policy Engine project file
+#
+TEMPLATE = subdirs
+
+SUBDIRS  += policyengineui 
+
+CONFIG += ordered
+
+symbian: {
+SYMBIAN_PLATFORMS = WINSCW \
+    ARMV5
+    }
--- a/policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h	Tue Jul 06 15:14:24 2010 +0300
@@ -28,6 +28,9 @@
 #include "RequestContext.h"
 #include "PolicyStorage.h"
 #include <e32base.h>
+#include <MSVAPI.H>
+#include <hbsymbianvariant.h>
+#include <hbdevicedialogsymbian.h>
 
 // CONSTANTS
 // MACROS
@@ -142,6 +145,34 @@
 		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/PolicyProcessor.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -30,12 +30,19 @@
 #include "PolicyEngineServer.h"
 #include "PolicyEngineClientServer.h"
 #include "debug.h"
-
-#include "PolicyEngineUi.h"
-
+#include <hbdevicedialogsymbian.h>
+#include <hbdevicenotificationdialogsymbian.h>
+#include <hbtextresolversymbian.h>
 // CONSTANTS
 const TUid KUidPolicyEngineUi = { 0x10207817 };
+const TUint KDelimeterChar = '|';
+_LIT8( KUserAcceptMark, "A");
 
+enum TUserResponse
+    {
+    EUserAccept,
+    EUserDeny,
+    };
 
 // -----------------------------------------------------------------------------
 // RAttributeContainer::AppendL()
@@ -746,52 +753,24 @@
 	//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;
 
-	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));
+    CProcessorClient *client = new CProcessorClient();
+    TInt res = client->LaunchDialog(ptr, name);
+    
+    if(res == 0)
+        response = EUserAccept;
+    else
+        response = EUserDeny;  
 
-		//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
-	CleanupStack::PopAndDestroy( 2);
-		
-		
-	}
 
 	MakeBooleanResponseL( response == EUserAccept, aResponseElement);
 }
@@ -980,6 +959,185 @@
 }
 
 
+// -----------------------------------------------------------------------------
+// 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()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/InputDialog.docml	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,75 @@
+<?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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/PolicyEngineUI.pro	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,49 @@
+# 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
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/PolicyEngineUI.qrc	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/xml">
+        <file>dialog.docml</file>
+        <file>InputDialog.docml</file>
+    </qresource>
+</RCC>
--- a/policymanagement/policyengine/policyengineui/data/10207817.rss	Wed Jun 23 19:10:17 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: 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
--- a/policymanagement/policyengine/policyengineui/data/PolicyEngineUI.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/dialog.docml	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,49 @@
+<?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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/inc/Logger.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngUINotifierplugin.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h	Tue Jul 06 15:14:24 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* 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"
@@ -13,153 +13,55 @@
 *
 * Description: Implementation of policymanagement components
 *
-*
 */
 
-
-#ifndef POLICTY_ENGINE_UI_HEADER_
-#define POLICTY_ENGINE_UI_HEADER_
-
-//  INCLUDES
-#include <e32base.h>
-#include <eiknotapi.h>
-
-//  CONSTANTS
+#ifndef POLICYENGINEUI_H
+#define POLICYENGINEUI_H
 
-_LIT8( KUserAcceptMark, "A");
-_LIT8( KUserDenyMark, "D");
-const TUint KDelimeterChar = '|';
+#include <hbdialog.h>
+#include <hbdevicedialoginterface.h>
 
-enum TUserResponse
-	{
-	EUserAccept,
-	EUserDeny,
-	};
-
-//  FORWARD DECLARATIONS
-
-class CCoeEnv;
-class CPolicyEngineUi;
-
+class HbDialog;
+class HbLineEdit;
 
-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;
-	};
+class PolicyEngineUI : public HbDialog, public HbDeviceDialogInterface
+    {
+Q_OBJECT
 
-
-
-/**
-* 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:
+    PolicyEngineUI(const QVariantMap& parameters);
+    ~PolicyEngineUI();
+    void DisplayNotificationDialog(const QVariantMap &parameters);
+    void ShowInputDialog();
+    bool verifyFingerPrint();
 
-        /**
-        * Constructor.
-        */
-        CPolicyEngineUi();
-
-        /**
-        * Two-phased constructor.
-        */
-        static CPolicyEngineUi* NewL();
-    
-        /**
-        * Destructor.
-        */
-        virtual ~CPolicyEngineUi();
-        
-        void ActivateL( const TDesC8& aCorporate, const TDesC8& aRandomPart, CPolicyEngineNotifier* iNotifier); 
-    
-		void RunL();
-		void DoCancel();
-
-	public:
+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;
 
-        /**
-        * 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();
+signals:
+    //signal to be sent to client
+    void deviceDialogClosed();
+    void deviceDialogData(QVariantMap data);
+    
+private:
+    // number of tries user does
+    int estbTrustCount;
+    QString iServerName;
+    QString iFingerprint;
+    QString iCode;
+    HbLineEdit *mContentEdit;
+    HbDialog* mdialog;
+    };
 
-	
-		TInt ShowDialogL( const TDialog& aDialog);
-		TDlgResp ShowConfirmationQueryL( const TDesC& aText, const TBool& aWithCancel );
-		TDlgResp ShowPossessionMessageQueryL();
-		TDlgResp DataQueryL( const TDesC& aText, TDes& aInput );
-
-    private: // Data
-    
-    	HBufC * iCorporate;
-    	HBufC * iRandomPart;
-    	TInt iState;
-    	CPolicyEngineNotifier * iNotifier;
-    	
-	    TInt iResourceFileOffset;
-        CCoeEnv* iCoeEnv;  // not owned
-        };
-
-
-#endif      // POLICTY_ENGINE_UI_HEADER_
-            
-// End of File
+#endif // POLICYENGINEUI_H
--- a/policymanagement/policyengine/policyengineui/inc/policyengineui.hrh	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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:  contains common definitions for menu id:s
-*
-*/
-
-
-#ifndef POLICYENGINEUI_HRH
-#define POLICYENGINEUI_HRH
-
-#define RANDOM_PART_MAX_SIZE 4
-
-#endif      //  APPINST
-// End of File
--- a/policymanagement/policyengine/policyengineui/loc/PolicyEngineUI.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policyengine/policyengineui/src/PolicyEngNotifierplugin.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/policyengineui/src/PolicyEngineUi.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* 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"
@@ -11,533 +11,436 @@
 *
 * Contributors:
 *
-* Description:  This file contains the implementation of PolicyEngineUI
+* Description: Implementation of policymanagement components
 *
 */
 
-
-// INCLUDE FILES
-#include "PolicyEngineUi.h"
-#include "debug.h"
-#include "policyengineui.hrh"
-#include <policyengineuidlgs.rsg>
+#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 <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>
-
-
-_LIT( KCUIResourceFileName, "PolicyEngineUIDlgs.rsc" );
-const TUid KUidPolicyEngineUi = { 0x10207817 };
-const TUid KScreenOutputChannel = { 0x0000781F };
-
-LOCAL_C void CreateNotifiersL( CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers );
+const int KMaxTries = 4;
+const int KMaxCodeLength = 4;
 
 
-// ---------------------------------------------------------
-// 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!");
-}
-
-
-
-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;
+// -----------------------------------------------------------------------------
+// PolicyEngineUI::PolicyEngineUI()
+// -----------------------------------------------------------------------------
+PolicyEngineUI::PolicyEngineUI(const QVariantMap& parameters)
+    {
+    estbTrustCount = KMaxTries;
+    DisplayNotificationDialog(parameters);
     }
 
-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::~PolicyEngineUI()
+// -----------------------------------------------------------------------------
+PolicyEngineUI::~PolicyEngineUI()
+    {
 
-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()
-	{
-	}
-		
+// -----------------------------------------------------------------------------
+// PolicyEngineUI::DisplayNotificationDialog()
+// Read the parameters sent from client
+// -----------------------------------------------------------------------------
+void PolicyEngineUI::DisplayNotificationDialog(const QVariantMap& parameters)
+    {
+    LOGSTRING( "+ DisplayNotificationDialog +" );
+    QVariantMap::const_iterator i = parameters.constBegin();
 
-void CPolicyEngineNotifier::Release()
-	{
-	delete this;	
-	}
-
+    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());
 
-CPolicyEngineNotifier::TNotifierInfo CPolicyEngineNotifier::RegisterL()
-	{
-	//Registration info
-    iInfo.iUid = KUidPolicyEngineUi;
-    iInfo.iPriority = ENotifierPriorityHigh;
-	iInfo.iChannel = KScreenOutputChannel;	
-	
-	return iInfo;
-	}
+    LOGSTRING2( "serverdisplayname %S", &server );
+    LOGSTRING2( "fingerprint %S", &buffer );
 
-
-CPolicyEngineNotifier::TNotifierInfo CPolicyEngineNotifier::Info() const
-	{
-	//Registration info
-	return iInfo;
-	}
+    ShowInputDialog();
+    LOGSTRING( "- DisplayNotificationDialog -" );
+    }
 
 
-TPtrC8 CPolicyEngineNotifier::StartL(const TDesC8& /*aBuffer*/)
-	{
-	return KNullDesC8().Ptr();
-	}
-
-
-void CPolicyEngineNotifier::Complete( TUserResponse aResponse)
-	{
-	RDEBUG("CPolicyEngineNotifier::Complete");
+// -----------------------------------------------------------------------------
+// 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;
+        }
 
-	//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);
-	}
+    HbDialog *dialog1 =
+            qobject_cast<HbDialog *> (loader.findWidget("dialog"));
 
-
-void CPolicyEngineNotifier::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
-	{
-	RDEBUG("CPolicyEngineNotifier::StartL!");
+    //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);
 
-	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);
+    //set body content
+    HbLabel *contentbody = qobject_cast<HbLabel *> (loader.findWidget(
+            "qtl_dialog_pri5"));
 
-		iReplySlot = aReplySlot;
-		iMessage = aMessage;
+    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));
 
-		//Show policy engine ui dialogs
-		iPolicyEngineUi = CPolicyEngineUi::NewL();
-		iPolicyEngineUi->ActivateL( name, fingerPrint, this);
-		}
-	else
-		{
-		Complete( EUserDeny);
-		}
-	}
+    //set dialog properties
+    dialog1->setTimeout(HbPopup::NoTimeout);
+    dialog1->setDismissPolicy(HbPopup::NoDismiss);
 
-
-void CPolicyEngineNotifier::Cancel()
-	{
-	RDEBUG("CPolicyEngineNotifier::Cancel!");
+    QObject::connect(primaryAction, SIGNAL(triggered()), this,
+            SLOT(onOKSelected()));
+    QObject::connect(secondaryAction, SIGNAL(triggered()), this,
+            SLOT(onCancelSelected()));
 
-	//Delete policy engine ui
-	delete iPolicyEngineUi;
-	iPolicyEngineUi = 0;
-	}
+    if (dialog1)
+        dialog1->show();
+
+    LOGSTRING( "- ShowInputDialog -" );
+    }
 
 
-TPtrC8 CPolicyEngineNotifier::UpdateL(const TDesC8& /*aBuffer*/)
-	{
-	return KNullDesC8().Ptr();
-	}
+// -----------------------------------------------------------------------------
+// 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);
 
-CPolicyEngineUi::CPolicyEngineUi()
-	: CActive( EPriorityStandard)
-    {  
+    //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 -" );
     }
 
-void CPolicyEngineUi::ConstructL()
-    {
-	RDEBUG("CPolicyEngineUi::ConstructL!");
-
-    //get pointer to CEikonEnv
-	iCoeEnv = CEikonEnv::Static();    
-    
-    if ( !iCoeEnv )
-    	{
-		RDEBUG("Policy engine ui: CoeEnv not found!");
-        User::Leave( KErrGeneral );        
-    	}
 
-	//Open resource file
-    TFileName fileName;
-    fileName.Zero();
+// -----------------------------------------------------------------------------
+// PolicyEngineUI::onCancelSelected()
+// -----------------------------------------------------------------------------
+void PolicyEngineUI::onCancelSelected()
+    {
+    LOGSTRING( "+ onCancelSelected +" );
 
-    TFileName drivePath;
-    Dll::FileName( drivePath );
-
-    fileName.Append( TParsePtrC( drivePath ).Drive() );
-    fileName.Append( KDC_RESOURCE_FILES_DIR );
-    fileName.Append( KCUIResourceFileName );   
-    
-    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+    QVariantMap 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; 
-	}
+    result.insert("keyResponse", -1);
+    emit
+    deviceDialogData(result);
 
-
-CPolicyEngineUi::~CPolicyEngineUi()
-	{
-	RDEBUG("CPolicyEngineUi::~CPolicyEngineUi()");
+    emit
+    deviceDialogClosed();
 
-    // Close non-modal dialogs
-    if( iResourceFileOffset )
-    	{
-        iCoeEnv->DeleteResourceFile( iResourceFileOffset );
-    	}
-	
-	delete iCorporate;
-	delete iRandomPart;
-	}
+    LOGSTRING( "- onCancelSelected -" );
+    }
 
 
-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;		
-		}
+// -----------------------------------------------------------------------------
+// PolicyEngineUI::onTrustCreation()
+// -----------------------------------------------------------------------------
+void PolicyEngineUI::onTrustCreation()
+    {
+    LOGSTRING( "+ onTrustCreation +" );
+    QVariantMap 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);
-	}
-
-
-
-void CPolicyEngineUi::DoCancel()
-	{
-	}
-
-
+    result.insert("keyResponse", 0);
+    emit
+    deviceDialogData(result);
 
-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;
-	}
+    emit
+    deviceDialogClosed();
 
-
-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;
-	}
+    LOGSTRING( "- onTrustCreation -" );
+    }
 
 
-TInt CPolicyEngineUi::ShowDialogL( const TDialog& aDialog)
-	{
-	TInt response = EUserDeny;
+// -----------------------------------------------------------------------------
+// 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();
 
-	//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);
-                        }
+        }
+    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()));
 
-                    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;
+            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);
 
-			//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;
-	}
+            //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 -" );
+    }
 
 
-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::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;
+    }
 
 
+// -----------------------------------------------------------------------------
+// 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/policymanagement/policyengine/rom/policyengine.iby	Tue Jul 06 15:14:24 2010 +0300
@@ -23,8 +23,10 @@
 	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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/policymanagement/policymanagement.pro	Tue Jul 06 15:14:24 2010 +0300
@@ -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:  Policy Management project file
+#
+TEMPLATE = subdirs
+
+SUBDIRS  += policyengine 
+
+CONFIG += ordered
+
+symbian: {
+SYMBIAN_PLATFORMS = WINSCW \
+    ARMV5
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt.pro	Tue Jul 06 15:14:24 2010 +0300
@@ -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:  Remote Management project file
+#
+TEMPLATE = subdirs
+
+SUBDIRS  += policymanagement \
+						fotaapplication
+
+CONFIG += ordered
+
+symbian: {
+SYMBIAN_PLATFORMS = WINSCW \
+    ARMV5
+    }
--- a/remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -24,4 +24,5 @@
 
 PRJ_EXPORTS
 
-../inc/devicedialogconsts.h     MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogconsts.h)
\ No newline at end of file
+../inc/devicedialogconsts.h     MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogconsts.h)
+../inc/dmindicatorconsts.h	MW_LAYER_PLATFORM_EXPORT_PATH(dmindicatorconsts.h)
\ No newline at end of file
--- a/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h	Tue Jul 06 15:14:24 2010 +0300
@@ -8,16 +8,17 @@
 #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 int KCPPinMaxLength = 20;
+ const TInt KCPPinMaxLength = 20;
  
 //Strings for CP PIN Query Dialog
 const QString pinquery = "omacppinquery";
-const QString returnkey = "returnkey";
 
 const char devicedialogtype[] = "com.nokia.hb.devicemanagementdialog/1.0";
 _LIT(KDeviceDialogType, "com.nokia.hb.devicemanagementdialog/1.0");
@@ -28,6 +29,15 @@
 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.
 
@@ -37,6 +47,7 @@
     EFwDLNeedMoreMemory = 100,
     EFwDLConnectionFailure,
     EFwDLGeneralFailure,
+    EFwDLNonResumableFailure,
     
     //Updated related notes	
     EFwUpdNotEnoughBattery,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,30 @@
+/*
+ * dmindicatorconsts.h
+ *
+ *  Created on: Apr 20, 2010
+ *      Author: gnataraj
+ */
+
+#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_ */
--- a/remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconst.h	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/dm_constant_definitions_api/inc/nsmldmconst.h	Tue Jul 06 15:14:24 2010 +0300
@@ -27,6 +27,13 @@
 // SyncML notification MIME type
 _LIT( KNSmlDMNotificationMIMEType, "application/vnd.syncml.notification" );
 // FOTA
+const TUid KPSUidNSmlSOSServerKey = {0x101F99FB};
+const TUint32 KNSmlDMSilentJob = 0x0000005;
+enum TDmSessionType
+{
+ESilent = 1,
+ENonSilent
+};
 const TInt KNSmlDMResetGenAlerts = -2;
 const TInt KNSmlMaxInt32Length = 10;
 // FOTA end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/dm_device_dialog_api.metaxml	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,18 @@
+<?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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -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 
+:                DM Device Dialog API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/dmdevdialogclient.h     MW_LAYER_PLATFORM_EXPORT_PATH(dmdevdialogclient.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/inc/dmdevdialogclient.h	Tue Jul 06 15:14:24 2010 +0300
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/conf/dmdevicedialogstest.cfg	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,72 @@
+[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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/group/dmdevicedialogstest.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,78 @@
+/*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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/group/dmdevicedialogstest.pkg	Tue Jul 06 15:14:24 2010 +0300
@@ -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:
+;
+; 	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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/inc/dmdevicedialogstest.h	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/init/dmdevicedialogs.ini	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,218 @@
+#
+# 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/src/dmdevicedialogstest.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,199 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/dm_device_dialog_api/tsrc/src/dmdevicedialogstestBlocks.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,412 @@
+/*
+* 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
--- a/remotemgmt_plat/fota_engine_api/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -24,6 +24,5 @@
 
 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)
--- a/remotemgmt_plat/fota_engine_api/inc/FotaEngStream.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +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:  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	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/inc/FotaEngine.h	Tue Jul 06 15:14:24 2010 +0300
@@ -11,70 +11,47 @@
 *
 * Contributors:
 *
-* Description:  Fotaengine hdr
+ * Description:  Fotaengine api
 *
 */
 
-
-
 #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
-	{
-	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
-	};
+    {
+    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
+    };
 
-
+/** Fota start up action states */
 enum TFotaUpdateStates
     {
-    EFotaDefault,
-    EFotaPendingGenAlert,
-    EFotaDownloadInterrupted,
-    EFotaUpdateInterrupted
+    EFotaDefault,               // No action        
+    EFotaPendingGenAlert,       // Send pending generic alert
+    EFotaDownloadInterrupted,   // Try to resume download
+    EFotaUpdateInterrupted      // Try to resume update
     };
 
 class TFotaScheduledUpdate;
@@ -82,436 +59,376 @@
 // CLASS DECLARATION
 
 /**
-*	A client handle to a FOTA engine session.
-*   @lib    fotaengine.lib
-*   @since  Series 60 3.1
-*/
-class RFotaEngineSession : public RAknAppServiceBase
-	{
+ *	A client handle to a FOTA engine session.
+ *   @lib    fotaengine.lib
+ *   @since   SF4
+ */
+//class RFotaEngineSession : public RAknAppServiceBase // 10.1 changes
+class RFotaEngineSession : public RSessionBase
+    {
 
-    friend class    TDP2StreamBuf;  // TDP2StreamBuf will use iChunk
-
-public: // enums
+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 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,	
-	    };
+        {
+        /** 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,
+        };
 
-	/** 
-    * 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
         {
-        EResSuccessful                     = 200,
-        EResUserCancelled                  = 401,
-        EResCorruptedFWUPD                 = 402,
-        EResPackageMismatch                = 403,
-        EResFailedSignatureAuthentication  = 404,
-        EResUndefinedError                  = 409,
-        EResUpdateFailed                   = 410,
-        EResMalformedOrBadURL              = 411,
-        EResAlternateDLServerUnavailable   = 412,
-        EResDLFailDueToDeviceOOM           = 501,
-        EResDLFailDueToNWIssues            = 503
-        };
-		    
-public: // Constructors 
+        /** 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,
 
-	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);	
-	
+        //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();
 
-	/**
-	* 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>/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);
 
-	/**
-    * 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();
+    /**
+     * 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);
 
-	
-	/**
-	* 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);
+
+    /**
+     * 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();
 
     /**
-    * 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 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
+     *
+     */
+
+    IMPORT_C TInt TryResumeDownload(TBool aSilentDownload = EFalse);
+
+    /**
+     * 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);
+
+    /**
+     * 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);
+
+    /**
+     * 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);
+
+    /**
+     * 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);
+
+    /**
+     * Tells device FW version
+     *
+     * @since   SF4
+     * @param aSWVersion On return, contains FW version of device.
+     * @return			Error code
+     */
+    IMPORT_C TInt CurrentVersion(TDes& aSWVersion);
 
-	/**
-    * 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 );
+    /**
+     * 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);
 
-	/**
-    * 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 );
+    /**
+     * 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);
 
-    IMPORT_C TVersion Version() const;
+    /**
+     * 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;
 
 
-	/**
-    * 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 ) ;
-
-
-	/**
-	* 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
-
-	/** 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;        
-
-    IMPORT_C virtual void ExtensionInterface( 
-                        TUid aInterfaceId
-                        ,TAny*& aImplementation );
-
-private: // New methods
+private:
 
     /**
-    * 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);
+     * 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 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 );
+     * Connects to the server
+     *
+     * @since SF4
+     * @return  KErrNone if successful, otherwise system wide errors
+     **/
+    
+    TBool connectToHbServer();
 
 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/fota_engine_api/inc/fotaconst.h	Tue Jul 06 15:14:24 2010 +0300
@@ -23,7 +23,6 @@
 // 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
@@ -38,9 +37,6 @@
 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 );
@@ -50,6 +46,21 @@
 const TInt KBmpMargin(21);
 
 _LIT8( KNSmlIAPId,			"NSmlIapId" ); 
-_LIT( KFotaPanic, "Download");
+_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
+    };
 
 #endif
\ No newline at end of file
--- a/remotemgmt_plat/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/remotemgmt_plat/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -46,8 +46,8 @@
 #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 "../devicemgmt_dialogs_api/group/bld.inf"
\ No newline at end of file
+#include "../devicemgmt_dialogs_api/group/bld.inf"
+#include "../dm_device_dialog_api/group/bld.inf"
\ No newline at end of file
--- a/remotemgmt_plat/sync_service_api/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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 
-:                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)
--- a/remotemgmt_plat/sync_service_api/inc/SyncService.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +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-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
-
--- a/remotemgmt_plat/sync_service_api/inc/SyncService.rh	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 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
--- a/remotemgmt_plat/sync_service_api/inc/SyncServiceConst.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 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
-
--- a/remotemgmt_plat/sync_service_api/inc/SyncServiceParams.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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: 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
--- a/remotemgmt_plat/sync_service_api/inc/SyncServiceSession.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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: 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
--- a/remotemgmt_plat/sync_service_api/sync_service_api.metaxml	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?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/syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -20,6 +20,8 @@
 #include <DevManInternalCRKeys.h>
 #include "NSmlAlertQueue.h"
 #include "nsmldebug.h" 
+#include <nsmldmconst.h>
+#include <e32Property.h>
 // ---------------------------------------------------------
 // CNSmlDSAlertParser11(CSmlAlertInfo& aAlertInfo, CSyncMLHistoryPushMsg& aHistoryInfo )
 // Returns pointer to the buffer
@@ -72,6 +74,16 @@
     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") );
+	        }
     iAlertInfo.SetUimode(uiMode);
    	}	
 	if (uiMode == 0)
--- a/syncmlfw/common/sosserver/bld/nsmlsosserver.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/common/sosserver/bld/nsmlsosserver.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -89,8 +89,8 @@
 LIBRARY		syncmldatafilter.lib
 LIBRARY		nsmlagentlog.lib
 LIBRARY		policyengine.lib
-LIBRARY		abclient.lib
+LIBRARY		abclient.lib dmdevdialogclient.lib
 LIBRARY     centralrepository.lib //tarm
-LIBRARY                 featmgr.lib flogger.lib HbWidgets.lib HbCore.lib
+LIBRARY                 featmgr.lib flogger.lib 
 
 SMPSAFE
--- a/syncmlfw/common/sosserver/inc/nsmlsosthread.h	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/common/sosserver/inc/nsmlsosthread.h	Tue Jul 06 15:14:24 2010 +0300
@@ -21,6 +21,7 @@
 
 #include <SyncMLNotifierParams.h>
 #include <SyncMLNotifier.h>
+#include <dmdevdialogclient.h>
 #include <hbdevicedialogsymbian.h>
 #include <hbsymbianvariant.h>
 #include "nsmlsosserver.h"
@@ -194,7 +195,7 @@
 		TRequestStatus& iCallerStatus;
 		
 //		RNotifier iNotifier;
-		TSyncMLAppLaunchNotifRetValPckg iResBuf;
+		TPckgBuf<TInt> iResBuf;
 	
 		CNSmlThreadParams& iThreadParams;
 		CNSmlNotifierTimeOut iNotifierTimeOut;
@@ -203,7 +204,7 @@
 		CHbDeviceDialogSymbian* iDevDialog;
             RProperty iProperty;
             TBool iHbSyncmlNotifierEnabled;
-		
+           RDmDevDialog iDmDevdialog;
 
 	};
 	
--- a/syncmlfw/common/sosserver/src/nsmlsosthread.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/common/sosserver/src/nsmlsosthread.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -29,6 +29,7 @@
 #include <featmgr.h>
 #include <e32property.h>
 #include <DevManInternalCRKeys.h>
+#include <nsmldmconst.h>
 
 
 enum TSyncmlHbNotifierKeys 
@@ -120,7 +121,8 @@
 	        CActiveScheduler::Start();                
 	        }	    
 	    }	
-	
+	LOGSTRING("P&S is deleted");  
+	RProperty::Delete(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob);
 	delete scheduler;
 	
 	if ( endStatus == KErrNone )
@@ -818,7 +820,8 @@
         }
     else
         {
-        iProperty.Close();
+        if(iDmDevdialog.Handle() )
+             iDmDevdialog.Close();
         }
 
     Cancel();
@@ -834,10 +837,10 @@
 	_DBG_FILE( "CNSmlNotifierObserver::ConnectToNotifierL:Begin" );
 	iTimeOut = EFalse;
 	
-	if ( !IsActive() )
+	/*if ( !IsActive() )
 		{
 		SetActive();
-		}
+		}*/
 		
 	   
     TSyncMLAppLaunchNotifParamsPckg data( aParam );
@@ -862,8 +865,13 @@
             }
         else
             {
+       iStatus = KRequestPending;
             HbNotifierObserverL(aParam);
             }
+        if ( !IsActive() )
+                {
+                SetActive();
+                }
         }
     else
         {
@@ -911,90 +919,10 @@
     {
 
     LOGSTRING2("iCallerStatus before HbNotifierObserverL creation %d", iCallerStatus.Int());
-    
-    _LIT(KHbNotifier,"com.nokia.hb.devicemanagementdialog/1.0");
-    
-    _LIT(KNotifierId, "aasyncmlfw");
-    _LIT(KProfileId, "profileid");
-    _LIT(KUImode, "uimode");
-    _LIT(KServerdisplayname, "serverdisplayname");
-  
-    CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-    CleanupStack::PushL(varMap);
-    
-    HBufC* notifierid = HBufC::NewL(10);
-    CleanupStack::PushL(notifierid);
-    *notifierid =KNotifierId;
-    
-   
-    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;
-        
-    TBuf<256> servername;
-    
-    CNSmlDMSettings* settings = CNSmlDMSettings::NewLC();
-    CNSmlDMProfile* prof = settings->ProfileL(
-            aParam.iProfileId);
-    CleanupStack::PushL(prof);
-    
-    servername = prof->StrValue(EDMProfileDisplayName);
-    
-    CleanupStack::PopAndDestroy(2);
-               
-    TInt id =1000000;
-
-    CHbSymbianVariant* notifieridvar = CHbSymbianVariant::NewL(&id,
-                          CHbSymbianVariant::EInt);
-    
-    
-    CHbSymbianVariant* infoprofileid = CHbSymbianVariant::NewL(&aParam.iProfileId,
-            CHbSymbianVariant::EInt);
-    
-    //CleanupStack::PushL(infoprofileid);
-    
-    CHbSymbianVariant* infouimode = CHbSymbianVariant::NewL(&aParam.iUimode,
-                CHbSymbianVariant::EInt);
-    
-    CHbSymbianVariant* serverdisplayname = CHbSymbianVariant::NewL(&servername,
-                CHbSymbianVariant::EDes);
-    //CleanupStack::PushL(infouimode);
-    
-    varMap->Add(*notifierid, notifieridvar);
-    varMap->Add(*profileid, infoprofileid); // takes ownership
-    varMap->Add(*uimode, infouimode);
-    varMap->Add(*serverdisplay, serverdisplayname);
-
-    /*subscribe key value*/
-    TInt err = RProperty::Define(sosserverpsuid, EHbSOSNotifierKeyStatus, RProperty::EInt);
-    	
-    err = RProperty::Define(sosserverpsuid, EHbSOSNotifierKeyStatusReturn, RProperty::EInt);
-
-    err = iProperty.Attach(sosserverpsuid, EHbSOSNotifierKeyStatus);
-
-    iProperty.Subscribe(iStatus);
-      
-    
-    
-    iDevDialog = CHbDeviceDialogSymbian::NewL();
-    iDevDialog->Show(KHbNotifier, *varMap);
-
-    CleanupStack::PopAndDestroy(5);
-
-   
-
-    LOGSTRING2("CNSmlNotifierObserver hb notifier %d before subscribe", iStatus.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());
@@ -1041,24 +969,7 @@
 void CNSmlNotifierObserver::RunL()
     {
 
-    if (iDevDialog && iHbSyncmlNotifierEnabled)
-        {
 
-        
-    TInt status = KErrNone;
-  
-          TInt err  =  RProperty::Get(sosserverpsuid,EHbSOSNotifierKeyStatusReturn , status);
-
-        LOGSTRING2("status is %d", status);
-
-         LOGSTRING2("err of ps key is %d", err);
-
-       if(status == KErrCancel)
-		iStatus = KErrCancel;
-
-        iDevDialog->Cancel();
-        delete iDevDialog;
-        }
 
     LOGSTRING("CNSmlNotifierObserver RunL start");
 
@@ -1071,7 +982,7 @@
     if ( ret == KErrNone )
     	{	   
         
-	  	TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier.
+	  	TInt sid = iResBuf(); // 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.
Binary file syncmlfw/conf/CI_devman.confml has changed
Binary file syncmlfw/conf/devman.confml has changed
--- a/syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -480,14 +480,14 @@
 
         RSyncMLDevManJob dmJob;
 
-        TInt IAPID = -1;
+        TInt IAPID = -2;
         TBuf<10> genalertap,temp;
         genalertap.Zero();
         temp.Zero();	  
         genalertap.Append(KNSmlDMJobIapPrefix);
         temp.Num(iapid);//Decimal Iap
         if( temp.Length() <= KNSmlHalfTransportIdLength && 
-                iapid > KErrNotFound)
+                iapid >= -2)
             {
             genalertap.AppendFill('0',KNSmlHalfTransportIdLength-temp.Length());
             genalertap.Append(temp);
--- a/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -40,6 +40,8 @@
 #include "NSmlTransportHandler.h"
 
 #include <data_caging_path_literals.hrh>
+#define KMINPORT 0
+#define KMAXPORT 65536
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -184,7 +186,35 @@
 		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;
@@ -289,7 +319,7 @@
 
 		connection.SetPropertyL( KNSmlIAPId, *iapBuf );
 		
-		CleanupStack::PopAndDestroy( 2 ); //cmmanager,cm	
+		CleanupStack::PopAndDestroy( 3 ); //cmmanager,cm, iapBuf
 		}
 		
 	if( iProfiles[aItem]->iHostAddress )
--- a/syncmlfw/dm/settings/bld/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/settings/bld/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -20,7 +20,7 @@
 PRJ_EXPORTS 
 
 ../conf/factorydmprofiles.gcfml				MW_LAYER_GCFML(factorydmprofiles.gcfml)
-../conf/factorydmprofiles.confml  		MW_LAYER_CONFML(factorydmprofiles.confml)
+../conf/CI_factorydmprofiles.confml  		MW_LAYER_CONFML(CI_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	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/settings/inc/DMprofileContentHandler.h	Tue Jul 06 15:14:24 2010 +0300
@@ -22,8 +22,8 @@
 //  INCLUDES
 #include <e32std.h>
 #include <f32file.h>
-#include "MXMLAttributes.h"
-#include "MXMLContentHandler.h"
+#include <xml/MXMLAttributes.h>
+#include <xml/MXMLContentHandler.h>
 #include "NSmlDMResourceProfile.h"
 
 const TInt KNSmlDmFileNameLength=255;
--- a/syncmlfw/dm/settings/src/NSmlDMSettings.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/settings/src/NSmlDMSettings.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -19,18 +19,17 @@
 #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	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/syncagent/bld/nsmldmagent.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -71,7 +71,7 @@
 LIBRARY         nsmldmmodule.lib 
 // FOTA
 LIBRARY			featmgr.lib
-LIBRARY			centralrepository.lib
+LIBRARY			centralrepository.lib dmdevdialogclient.lib
 // FOTA end
 
 //LIBRARY       nsmldmtestmodule.lib
--- a/syncmlfw/dm/syncagent/src/nsmldmcmds.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/dm/syncagent/src/nsmldmcmds.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -60,6 +60,7 @@
 #include "nsmldmagconstants.h"
 #include "NSmlDMCmds.h"
 #include "nsmldmerror.h"
+#include <dmdevdialogclient.h>
 #include "OnlineSupportLogger.h"
 #ifdef __TEST_TREEMODULE
 #include "nsmldmtestmodule.h"
@@ -76,7 +77,7 @@
 #endif
 
 
-const TUid KNSmlSyncDialogUid = { 0x101F876A };
+//const TUid KNSmlSyncDialogUid = { 0x101F876A };
 // FOTA
 const TInt KNSmlDmNoRequest = -1;
 // FOTA end
@@ -1768,89 +1769,26 @@
 void CNSmlDMCmds::ServerHbNotifierL(TSyncMLDlgNoteTypes& aNotetype, TDesC& aServerMsg)
     
     {
-				LOGSTRING("HandleDisplayAlertL ServerHbNotifier start");  
-				
-        _LIT(KHbNotifier,"com.nokia.hb.devicemanagementdialog/1.0");
-        
-        _LIT(KNotifierId, "syncmlfw");
-        _LIT(KServerpushalertInfo, "serverpushinformative");
-        _LIT(KServerpushalertConfirm, "serverpushconfirmative");
-        
-        TBuf<25> serverpushalertval;
-        
+				LOGSTRING("HandleDisplayAlertL ServerHbNotifier start");                
+        RDmDevDialog DmDevdialog;
+        TInt err = DmDevdialog.OpenL();
+        User::LeaveIfError(err);
+        TRequestStatus status = KRequestPending;
         if(aNotetype == ESyncMLInfoNote)
-            serverpushalertval.Copy(KServerpushalertInfo);
+            {
+        DmDevdialog.ShowDisplayAlert(aServerMsg,status);
+            }
+            
         else 
-            serverpushalertval.Copy(KServerpushalertConfirm);
-        
-        CHbDeviceDialogSymbian *devDialog = NULL;
-
-        CHbSymbianVariantMap* varMap = CHbSymbianVariantMap::NewL();
-        CleanupStack::PushL(varMap);
-        
-
-        HBufC* keyBuf = HBufC::NewL(25);
-        CleanupStack::PushL(keyBuf);
-        
-        *keyBuf = KNotifierId;
-        
-        HBufC* servalertmsg = HBufC::NewL(25);
-        CleanupStack::PushL(servalertmsg);
-                
-         *servalertmsg = serverpushalertval;
-         
-         TInt id =0;
-
-         CHbSymbianVariant* notifierid = CHbSymbianVariant::NewL(&id,
-                         CHbSymbianVariant::EInt);
-         
-        
-        CHbSymbianVariant* serveralertmsg = CHbSymbianVariant::NewL(&aServerMsg,
-                CHbSymbianVariant::EDes);
+            {
+        TInt timeout = 30; // dummy
+        TBuf<30> header; // dummy
+        DmDevdialog.ShowConfirmationAlert(timeout,header,aServerMsg,status);
+            }
+       
+        User::WaitForRequest(status);
 
-        varMap->Add(*keyBuf,notifierid);
-        varMap->Add(*servalertmsg, serveralertmsg); // takes ownership
-
-        LOGSTRING("HandleDisplayAlertL ServerHbNotifier step 2");
-        
-      
-        RProperty propertykey;
-        
-        TRequestStatus status;
-        
-        TInt err = RProperty::Define(dmagentuid , EHbDMSyncNotifierKeyStatus, RProperty::EInt);
-        	
-        err = RProperty::Define(dmagentuid , EHbDMSyncNotifierKeyStatusReturn, RProperty::EInt);
-
-         TInt err1 = propertykey.Attach(dmagentuid , EHbDMSyncNotifierKeyStatus);
-
-            propertykey.Subscribe(status);
-        
-        LOGSTRING2(" err = %d", err);
-        LOGSTRING2(" err1 = %d", err1);
-        
-        
-         LOGSTRING("HandleDisplayAlertL ServerHbNotifier step 3");
-
-
-        devDialog = CHbDeviceDialogSymbian::NewL();
-        devDialog->Show(KHbNotifier, *varMap);
-
-        User::WaitForRequest(status);
-        
-        propertykey.Close();
-
-
-
-
-        CleanupStack::PopAndDestroy(3);
-        
-
-        if(devDialog)
-            {
-            delete devDialog;
-            devDialog = NULL;
-            }
+DmDevdialog.Close();
         LOGSTRING("HandleDisplayAlertL ServerHbNotifier end");
 
 }
--- a/syncmlfw/ds/settings/bld/nsmldssettings.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/ds/settings/bld/nsmldssettings.mmp	Tue Jul 06 15:14:24 2010 +0300
@@ -54,6 +54,7 @@
 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	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/ds/settings/inc/NSmlProfileContentHandler.h	Tue Jul 06 15:14:24 2010 +0300
@@ -24,8 +24,8 @@
 #include <e32std.h>
 #include <f32file.h>
 #include <eikenv.h> //JIM is this needed ??
-#include "MXMLAttributes.h"
-#include "MXMLContentHandler.h"
+#include "xml/MXMLAttributes.h"
+#include "xml/MXMLContentHandler.h"
 
 #include "nsmldssettings.h"
 //#include "nsmldsresourceprofiledefs.h"
--- a/syncmlfw/ds/settings/src/NSmlDSSettings.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/ds/settings/src/NSmlDSSettings.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -26,7 +26,7 @@
 #include "bautils.h"
 #include "nsmlroam.h"
 //XML profiles
-#include "RXMLReader.h"
+#include "xml/RXMLReader.h"
 #include "NSmlProfileContentHandler.h"
 #include <centralrepository.h> //CRepository
 
--- a/syncmlfw/ds/settings/src/pcsuite/NSmlDSProfileRes.rss	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/ds/settings/src/pcsuite/NSmlDSProfileRes.rss	Tue Jul 06 15:14:24 2010 +0300
@@ -120,7 +120,8 @@
 			profiledisplayname="Intellisync";
 			//username="";
 			//password="";
-			serverurl="http://82.77.123.71:8080/services/syncml";
+		//	serverurl="http://82.77.123.71:8080/services/syncml";
+			serverurl="https://sync.ovi.com:443/services/syncml";
 			serverid="Ovi.com";
 			profilehidden=0;
 			transportid=0x101F99F0;
--- a/syncmlfw/ds/syncagent/src/nsmldsagent.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/ds/syncagent/src/nsmldsagent.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -972,7 +972,7 @@
 				if ( !iDSContent->ClientItemCountAsked() )
 					{
 					iDSContent->SetClientItemCountAsked();
-					iDSObserver->OnSyncMLSyncProgress( MSyncMLProgressObserver::ESmlSendingModificationsToServer, iDSContent->ClientItemCount(), 0 );
+					iDSObserver->OnSyncMLSyncProgress( MSyncMLProgressObserver::ESmlSendingModificationsToServer, iDSContent->ClientItemCount(), iDSContent->TaskId() );
 					}
 				break;
 			case CNSmlCmdsBase::EReturnBufferFull:
--- a/syncmlfw/ds/syncagent/src/nsmldscmds.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/ds/syncagent/src/nsmldscmds.cpp	Tue Jul 06 15:14:24 2010 +0300
@@ -1954,7 +1954,7 @@
 	            }
 			iDSObserver.OnSyncMLSyncProgress(
             	MSyncMLProgressObserver::ESmlReceivingModificationsFromServer,
-	        	iDSContent.ServerItemCount(), 0 );
+	        	iDSContent.ServerItemCount(), iDSContent.TaskId() );
 			}
 
         // If number of changes is more than batch limit then batch is used if
--- a/syncmlfw/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ b/syncmlfw/group/bld.inf	Tue Jul 06 15:14:24 2010 +0300
@@ -25,6 +25,7 @@
 ../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)
@@ -149,6 +150,3 @@
 // Disabling OTA configuration
 //#include "../ds/ota/bld/bld.inf"
 
-#include "../syncmlnotifier/group/bld.inf"
-#include "../syncservice/group/bld.inf"
-
--- a/syncmlfw/syncmlnotifier/BWINS/SyncMLNotifieru.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase2> * NotifierArray(void)
-
--- a/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierAppserver.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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 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
--- a/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierAppserver.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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: 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
--- a/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierServerApplication.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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:  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  
--- a/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierServerApplication.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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:  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
--- a/syncmlfw/syncmlnotifier/appserver/SyncMLNotifierappserver_reg.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 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
--- a/syncmlfw/syncmlnotifier/data/SyncMLNotifier.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,743 +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:  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_fota_conf_query_connection_is_needed
-// Text for the server initiated management session acception
-// pop-up query.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE TBUF r_fota_conf_query_connection_is_needed    { buf = qtn_fota_conf_query_connection_is_needed; }
-
-// -----------------------------------------------------------------------------
-//   
-// 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_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; }
-
-// 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; }
-        };
-    }
-
-//------------------------------------------------------------------------------
-//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;   }
-        };
-    }
-
-// =============================================================================
-// 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;
-                };
-            }
-        };
-    }
-
-// -----------------------------------------------------------------------------
-//   
-// 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
-
-
--- a/syncmlfw/syncmlnotifier/eabi/SyncMLNotifieru.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-EXPORTS
-	_Z13NotifierArrayv @ 1 NONAME
-	_ZTI17CSyncmlmmcwatcher @ 2 NONAME
-	_ZTV17CSyncmlmmcwatcher @ 3 NONAME
--- a/syncmlfw/syncmlnotifier/ecom/101F876A.rss	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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 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";
-                    }
-                };
-            }
-        };
-    }
--- a/syncmlfw/syncmlnotifier/ecom/SyncMLNotifierWrapper.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +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:  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.
-// -----------------------------------------------------------------------------
-EXPORT_C 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;
-	}
-
--- a/syncmlfw/syncmlnotifier/ecom/SyncMLNotifierWrapper.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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 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
--- a/syncmlfw/syncmlnotifier/group/SyncMLNotifier.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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:  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
-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
-
-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
-
--- a/syncmlfw/syncmlnotifier/group/bld.inf	Wed Jun 23 19:10:17 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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLAknPopUplist.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLAppLaunchNotifier.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +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:  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>
-
-// CONSTANTS
-// From S60\SyncMLFota
-const TUid KUidNSmlMediumTypeInternet = { 0x101F99F0 };
-_LIT8( KNSmlIAPId, "NSmlIapId" );
-_LIT8( KNSmlAlwaysAsk, "-1" );
-const TInt  KDefaultTimeoutforNotes ( 30 );
-
-const TUid KCRUidNSmlDSApp       = { 0x101F9A1D };
-// CLASS DECLARATION
-/**
-*  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 );
-
-    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 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);
-        
-        
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CSyncMLAppLaunchNotifier();
-
-    private: // Data
-        // Type of session queried
-        TSyncMLSessionTypes iSmlProtocol;
-        
-        // 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;
-    };
-
-
-#endif      // CSYNCMLAPPLAUNCHNOTIFIER_H   
-            
-// End of File
--- a/syncmlfw/syncmlnotifier/inc/SyncMLDlgNotifier.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLFwUpdNotifier.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +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:  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();
-
-        /**
-        * 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 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
-        //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;
-
-    };
-
-
-#endif      // CSYNCMLFWUPDNOTIFIER_H   
-            
-// End of File
--- a/syncmlfw/syncmlnotifier/inc/SyncMLMessageQueryDialog.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLNotifDebug.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +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 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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLNotifPrivateCRKeys.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* 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
-
--- a/syncmlfw/syncmlnotifier/inc/SyncMLNotifier.hrh	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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: 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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLNotifierBase.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLQueryDialog.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLQueryTimer.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLTimedDateQuery.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLTimedInputTextQuery.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLTimedMessageQuery.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLTimedNumberQueryDialog.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/SyncMLTimedQueryDialog.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +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:  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
--- a/syncmlfw/syncmlnotifier/inc/syncmlmmcwatcher.h	Wed Jun 23 19:10:17 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:  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_ */
-
--- a/syncmlfw/syncmlnotifier/loc/SyncMLNotifier.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-/*
-* 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:Confirms that the user wants to connect to the Internet.
-//l:popup_note_window_1
-//w:
-//r:3.1
-//
-#define qtn_fota_conf_query_connection_is_needed   "You are about to connect to the Internet. Normal data call costs may apply. Connect?"
-
-//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
--- a/syncmlfw/syncmlnotifier/loc/SyncMLNotifierFota.loc	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +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:  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."
-
-// End of File
--- a/syncmlfw/syncmlnotifier/rom/SyncMLNotifier.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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:  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
--- a/syncmlfw/syncmlnotifier/rom/SyncMLNotifierResources.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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:  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
--- a/syncmlfw/syncmlnotifier/src/SyncMLAknPopUpList.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +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:  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;
-    }
--- a/syncmlfw/syncmlnotifier/src/SyncMLAppLaunchNotifier.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,772 +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:  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 <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"
-
-
-// CONSTANTS
-_LIT( KSmlNPanicCategory, "SyncMLNotifier");
-
-// medium type uids
-//const TUid KUidNSmlMediumTypeInternet  = { 0x101F99F0 };
-const TUid KUidNSmlMediumTypeBluetooth = { 0x101F99F1 };
-const TUid KUidNSmlMediumTypeUSB       = { 0x101F99F2 };
-const TUid KUidNSmlMediumTypeIrDA      = { 0x101F99F3 };
-
-
-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 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();
-        
-        // 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;
-                }            
-            }
-
-        connection.Close();
-        CleanupStack::Pop( &connection );
-        
-        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);
-    }
-
-// -----------------------------------------------------------------------------
-// CSyncMLAppLaunchNotifier::RunL
-// Ask user response and return it to caller.
-// -----------------------------------------------------------------------------
-//
-void CSyncMLAppLaunchNotifier::RunL()
-    {
-    FLOG(_L("[SmlNotif]\t CSyncMLAppLaunchNotifier::RunL()"));
-		stringholder =NULL;
-		centrep = NULL;
-    TRAPD( err, centrep = CRepository::NewL( KCRUidDeviceManagementInternalKeys) );    
-    if(err)
-    {
-    	centrep = 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 );
-            }
-			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 );
-
-    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 );
-    
-    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"));
-    }
-
-// -----------------------------------------------------------------------------
-// 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();
-	if( keypress == EAknSoftkeyYes || keypress == EAknSoftkeyOk || silent ) // User has accepted the dialog
-  {
-		TInt retval = 1; // Default for ESyncMLSyncSession or silent
-    if ( iSmlProtocol == ESyncMLMgmtSession && !silent )
-    {
-    	CRepository* cRepository=NULL;
-			TRAPD ( error, cRepository = CRepository::NewL ( KCRUidNSmlNotifierDomainKeys ) );
-		 	if ( error == KErrNone )
-			{
-				CleanupStack::PushL( cRepository );
-				TInt dmChargingNote(1);
-				cRepository->Get ( KNSmlDMChargingNote, dmChargingNote );
-				if(dmChargingNote==1)
-				{
-			    	stringholder = StringLoader::LoadLC( R_FOTA_CONF_QUERY_CONNECTION_IS_NEEDED );
-			    	CSyncMLTimedQueryDialog* dlg = CSyncMLTimedQueryDialog::NewL( *stringholder, Timeout );			    
-			    	dlg->PrepareLC( R_SML_CONFIRMATION_QUERY );
-        		dlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_YES_NO );
-       			keypress = dlg->RunLD();
-         		if( keypress == EAknSoftkeyYes ||	keypress == EAknSoftkeyOk ) 
-         			retval = 1;
-         		else retval = 0;   
-			    	dlg = NULL;
-			    	CleanupStack::PopAndDestroy( stringholder );
-        }
-        CleanupStack::PopAndDestroy( cRepository );//cRepository
-      }
-    }
-	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:
-	              param.iServiceId = KDevManServiceStart;
-								if( SanSupport == EON )
-								{													
-	              	param.iSilent = iUimode;	                    	                               
-								}
-			          pckg.iSecureId = SyncServiceL( param.iServiceId )->StartSyncL( param );
-	              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) );
-	  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;
-}
-//  End of File  
--- a/syncmlfw/syncmlnotifier/src/SyncMLDlgNotifier.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1002 +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:  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 );
-        }
-    
-    if ( AutoLockOnL() )
-        {
-        // The phone is locked, access denied.
-        // Write results back to caller and complete message.
-        aMessage.Complete( KErrLocked );
-        iNeedToCompleteMessage = EFalse;
-        return;
-        }
-
-    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") ); 
-		
-	  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") );
-		
-    //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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLFwUpdNotifier.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1000 +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:  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;
-
-    // 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 );
-
-    // 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 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;
-            }
-        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::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::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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLMessageQueryDialog.cpp	Wed Jun 23 19:10:17 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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLNotifierBase.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,287 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLNotifierMain.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLQueryDialog.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLQueryTimer.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLTimedDateQuery.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLTimedInputTextQuery.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLTimedMessageQuery.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLTimedNumberQueryDialog.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/SyncMLTimedQueryDialog.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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:  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  
--- a/syncmlfw/syncmlnotifier/src/syncmlmmcwatcher.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +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:  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();
-        }
-    }
--- a/syncmlfw/syncservice/BWINS/SyncServiceu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-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)
-
--- a/syncmlfw/syncservice/INC/SyncServiceDebug.h	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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 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
--- a/syncmlfw/syncservice/SRC/SyncService.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +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 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
--- a/syncmlfw/syncservice/SRC/SyncServiceSession.cpp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +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:  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
--- a/syncmlfw/syncservice/eabi/SyncServiceu.def	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-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
-
--- a/syncmlfw/syncservice/group/SyncService.mmp	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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:  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
-
--- a/syncmlfw/syncservice/group/bld.inf	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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 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
--- a/syncmlfw/syncservice/rom/syncservice.iby	Wed Jun 23 19:10:17 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd	Tue Jul 06 15:14:24 2010 +0300
@@ -0,0 +1,88 @@
+ <!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>