From 378dc870c6dca3c5186a311fbc9c90e560653a2d Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 19 May 2022 12:26:52 +0200 Subject: only wait until Tor has been completely shutdown successfully on startTorService command if the service was previously cancelled --- app/src/main/java/se/leap/bitmaskclient/tor/TorServiceCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceCommand.java b/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceCommand.java index 68988b67..0f721013 100644 --- a/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceCommand.java +++ b/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceCommand.java @@ -42,7 +42,9 @@ public class TorServiceCommand { public static boolean startTorService(Context context, String action) throws InterruptedException { Log.d(TAG, "startTorService"); try { - waitUntil(TorServiceCommand::isNotCancelled, 30); + if (TorStatusObservable.isCancelled()) { + waitUntil(TorServiceCommand::isNotCancelled, 30); + } } catch (TimeoutException e) { e.printStackTrace(); } -- cgit v1.2.3