contextengine/plugins/locationplugin/src/locationcontextplugin.cpp
branchRCL_3
changeset 63 e538444823de
parent 53 29d87345eaeb
equal deleted inserted replaced
57:2872ae438bf7 63:e538444823de
   136     	aHD.SetErrorCode( KErrNone );
   136     	aHD.SetErrorCode( KErrNone );
   137         aObserver.PluginSnapshotStatus( &aHD );
   137         aObserver.PluginSnapshotStatus( &aHD );
   138     	return;
   138     	return;
   139     	}
   139     	}
   140     
   140     
   141     if ( !iLocationTrailConnected ) 
   141     if ( !iLocationTrailConnected ) // no trail, no snapshot
   142     	{        
   142     	{
   143         WRITELOG( "CLocationContextPlugin::ContextSnapshot() - try to reconnect" );      
   143     	aHD.SetErrorCode( KErrDisconnected );
   144         iManipulator.Close();
   144         aObserver.PluginSnapshotStatus( &aHD );
   145         iLocationTrail.Close();        
   145     	return;
   146         TInt err = iLocationTrail.Connect();
       
   147         if ( err == KErrNone )
       
   148             {         
       
   149             err = iManipulator.Connect();
       
   150             if( err == KErrNone )
       
   151                 {
       
   152                 iLocationTrailConnected = ETrue;         
       
   153                 }
       
   154             }
       
   155         
       
   156         if (err != KErrNone )
       
   157             {
       
   158             // no trail, no snapshot            
       
   159             aHD.SetErrorCode( KErrDisconnected );
       
   160             aObserver.PluginSnapshotStatus( &aHD );
       
   161             return;
       
   162             }
       
   163     	}
   146     	}
   164     
   147     
   165     TInt ret = KErrNone;
   148     TInt ret = KErrNone;
   166     
   149     
   167     ret = iManipulator.LocationSnapshot( aHD.MdeObject().Id() );
   150     ret = iManipulator.LocationSnapshot( aHD.MdeObject().Id() );
   168     
       
   169     if( ret == KErrServerTerminated )
       
   170         {        
       
   171         iLocationTrailConnected = EFalse;
       
   172         }    
       
   173     
   151     
   174     if( ret != KErrNone )
   152     if( ret != KErrNone )
   175         {
   153         {
   176         ret = KErrCompletion;
   154         ret = KErrCompletion;
   177         }
   155         }