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