From d93271674204a1019bfcd94c34320c1b766243c5 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Wed, 17 Sep 2014 12:33:50 +0200 Subject: [PATCH] Fixed potential bug where throughput reporting would not stop --- .../java/com/ericsson/uecontrol/core/UeControlExecutor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java b/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java index 1cbb6a0..0801c0e 100755 --- a/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java +++ b/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java @@ -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(){