Fixed potential bug where throughput reporting would not stop

This commit is contained in:
Ziver Koc 2014-09-17 12:33:50 +02:00
parent 6417ef0c22
commit d932716742

View file

@ -87,8 +87,8 @@ public class UeControlExecutor implements Runnable{
}
private void terminateNonBlock(){
handler.removeCallbacks(throughputUpdateRunnable);
terminate = true;
handler.removeCallbacks(throughputUpdateRunnable);
if(currentlyActive != null)
currentlyActive.terminate();
}
@ -196,8 +196,10 @@ public class UeControlExecutor implements Runnable{
}
if (throughputListener != null && uploadSpeed.isUpdated())
throughputListener.throughputUpdate(downloadSpeed.getBitThroughput(), uploadSpeed.getBitThroughput());
// Rescedule this handler
handler.postDelayed(this, 100);
if(!terminate)
handler.postDelayed(this, 100);
}
protected boolean setRealDataUsage(){