locationmanager/server/src/clocationmanagersession.cpp
branchRCL_3
changeset 63 e538444823de
parent 47 b73252188534
--- a/locationmanager/server/src/clocationmanagersession.cpp	Wed Sep 15 12:40:59 2010 +0300
+++ b/locationmanager/server/src/clocationmanagersession.cpp	Wed Oct 13 15:02:02 2010 +0300
@@ -48,12 +48,7 @@
 CLocationManagerSession::~CLocationManagerSession()
     {
     LOG( "CLocationManagerSession::~CLocationManagerSession(), begin" );
-    // don't call stop GPS positioning from here...
-    // we are expecting the application to start and stop else on server terminate, we will do the same.
-    // this is not okay when user takes a photograph and then transfer photo using BT/PC .
-    // at this point, it will stop the trail for camera where as camera session is still valid.
-    
-
+    TRAP_IGNORE(Server().StopGPSPositioningL());
     Server().CancelNotificationRequest( iNotificationHandle );
     Server().CancelLocationRequest( iLocationHandle );
     Server().CancelTrackLogNotificationRequest( iTrackLogNotificationHandle );
@@ -91,15 +86,22 @@
 //
 void CLocationManagerSession::ServiceL( const RMessage2& aMessage )
     {
-    LOG( "CLocationManagerSession::ServiceL, begin" );
-    LOG1("Message id - %d", aMessage.Function());
+    LOG( "CLocationManagerSession::ServiceL" );
+    _LIT( KSemaphore, "LocManSynchSemaphore" );
+    RSemaphore semaphore;
+    const TInt result = semaphore.OpenGlobal( KSemaphore );
+    LOG1( "CLocationManagerSession::ServiceL - semaphore open result: %d", result );
     iMessage = RMessage2( aMessage );
+    if ( result == KErrNone )
+    	{
+    	semaphore.Signal();
+    	semaphore.Close();
+    	}
     TRAPD( err, DispatchMessageL( aMessage ) );
     if ( err != KErrNone )
         {
         aMessage.Complete( err );
         }    
-    LOG( "CLocationManagerSession::ServiceL, end" );
     }
 
 // --------------------------------------------------------------------------
@@ -178,18 +180,6 @@
         case ELocManCancelTrackLogNotify:
         	CancelTrackLogNotificationRequest( aMessage );
         	break;
-        case ELocManTagPending:
-        	Server().TagPendingRequestL(aMessage);
-        	break;
-        case ELocManStartGeoTaging:
-            Server().StartGeoTaggingL(aMessage);
-            break;
-        case ELocManCancelTagPendingReq:
-            Server().CancelTagPendingRequest(aMessage);
-			break;
-		case ELocManCancelGeoTaggingReq:
-            Server().CancelGeoTaggingRequest(aMessage);
-            break;
         default:
             aMessage.Complete( KErrArgument );
             break;
@@ -504,7 +494,7 @@
 	}
 
 // --------------------------------------------------------------------------
-// CLocationManagerSession::RegisterTrackLogObserver
+// CLocationManagerSession::GpsQualityChange
 // --------------------------------------------------------------------------
 //  
 void CLocationManagerSession::RegisterTrackLogObserver( const RMessage2& aMessage )
@@ -513,11 +503,6 @@
 	TRAP_IGNORE( Server().AddTrackLogNotificationRequestL( aMessage ) );
 	}
 
-
-// --------------------------------------------------------------------------
-// CLocationManagerSession::GetCaptureSettingL
-// --------------------------------------------------------------------------
-//
 void CLocationManagerSession::GetCaptureSettingL( const RMessage2& aMessage )
 	{
 	TInt KParamCaptureSetting = 0;