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