Fixed ANR when stoping the sampling service