- this exception isn't much meaning about double-stop scenario
Change-Id: I20125b5ead9431165026fb50f05a24d00f40d3cc
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
public void Stop()
{
Log.Info(Globals.LogTag, "Stopping the sensor");
- if (_isSensing)
+ if (CheckListenerHandle())
{
int error = Interop.SensorListener.StopListener(_listenerHandle);
if (error != (int)SensorError.None)
_isSensing = false;
Log.Info(Globals.LogTag, "Sensor stopped");
}
- else
- {
- Log.Error(Globals.LogTag, "Can't stop sensor as it is already stopped");
- throw new InvalidOperationException("Operation Failed: Sensor is already stopped");
- }
}
public void Dispose()