locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp
branchRCL_3
changeset 55 c92d4f3c47c5
parent 54 0c2046328c85
child 65 a796fdeeb33c
equal deleted inserted replaced
54:0c2046328c85 55:c92d4f3c47c5
    39 #include "EPos_CPosServerDelayedShutdown.h"
    39 #include "EPos_CPosServerDelayedShutdown.h"
    40 #include "EPos_CPosModulesStatus.h"
    40 #include "EPos_CPosModulesStatus.h"
    41 #include "EPos_CPosLocMonitorReqHandlerHub.h"
    41 #include "EPos_CPosLocMonitorReqHandlerHub.h"
    42 
    42 
    43 #include "EPos_Global.h"
    43 #include "EPos_Global.h"
    44 #include "lbspositioningstatusprops.h"
       
    45 
    44 
    46 // CONSTANTS
    45 // CONSTANTS
    47 _LIT(KPosResourceFile, "\\private\\101F97B2\\eposserver.rsc");
    46 _LIT(KPosResourceFile, "\\private\\101F97B2\\eposserver.rsc");
    48 
    47 
    49 #ifdef _DEBUG
    48 #ifdef _DEBUG
   177             User::Leave(r);
   176             User::Leave(r);
   178             }
   177             }
   179 		}
   178 		}
   180 #endif // WINSCW
   179 #endif // WINSCW
   181 
   180 
       
   181     // make sure that root process is running 
       
   182     if(LocationManagementSupported && !FindRootProcess())
       
   183     	{
       
   184     	User::Leave(KErrNotReady);
       
   185     	}
       
   186 	
   182     // Backup listener
   187     // Backup listener
   183     DEBUG_TRACE("Checking for backup or restore...", __LINE__)
   188     DEBUG_TRACE("Checking for backup or restore...", __LINE__)
   184     iBackupListener = CPosBackupListener::NewL();
   189     iBackupListener = CPosBackupListener::NewL();
   185     if (iBackupListener->IsBackupOperationOngoing())
   190     if (iBackupListener->IsBackupOperationOngoing())
   186         {
   191         {
   212     iModuleSettings = CPosModuleSettings::NewL();
   217     iModuleSettings = CPosModuleSettings::NewL();
   213     iModulesStatus = CPosModulesStatus::NewL(iModuleSettings->PosModules());
   218     iModulesStatus = CPosModulesStatus::NewL(iModuleSettings->PosModules());
   214     DEBUG_TRACE("Setting Location Settings observer...", __LINE__)
   219     DEBUG_TRACE("Setting Location Settings observer...", __LINE__)
   215     iModuleSettings->AddListenerL(*this);
   220     iModuleSettings->AddListenerL(*this);
   216 
   221 
   217     // Define the MO Positioning Status property
       
   218 	LbsPositioningStatusProps::InitializeMoPropertyL();	
       
   219    
       
   220     DEBUG_TRACE("Starting server active object...", __LINE__)
   222     DEBUG_TRACE("Starting server active object...", __LINE__)
   221     StartL(KPositionServerName);
   223     StartL(KPositionServerName);
       
   224     
       
   225    
   222     }
   226     }
   223 
   227 
   224 /**
   228 /**
   225  * Two-phased constructor.
   229  * Two-phased constructor.
   226  */
   230  */
   236 /**
   240 /**
   237  * Destructor.
   241  * Destructor.
   238  */
   242  */
   239 CPosServer::~CPosServer()
   243 CPosServer::~CPosServer()
   240     {
   244     {
       
   245     
   241     delete iLocMonitorReqHandlerHub;
   246     delete iLocMonitorReqHandlerHub;
   242     
   247     
   243     delete iShutdown;
   248     delete iShutdown;
   244     delete iModulesStatus;
   249     delete iModulesStatus;
   245     delete iModuleSettings;
   250     delete iModuleSettings;
   246     delete iBackupListener;
   251     delete iBackupListener;
   247    
   252    
   248     
   253 
   249     // This is needed because CPositioner might have used ECom (PSYs)
   254     // This is needed because CPositioner might have used ECom (PSYs)
   250     REComSession::FinalClose();
   255     REComSession::FinalClose();
   251     }
   256     }
   252 
   257 
   253 /**
   258 /**