public void stopSampling(){
  if (mSamplingCounter.decrementAndGet() == 0) {
    mHandler.stopSamplingThread();
    addFinalSample();
  }
}

public void stopSampling ( ) { if ( mSamplingCounter . decrementAndGet ( ) == 0 ) { mHandler . stopSamplingThread ( ) ; addFinalSample ( ) ; } }
finish sampling and prevent further changes to the connectionclass until another timer is started .
