summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-05-19 12:26:52 +0200
committercyBerta <cyberta@riseup.net>2022-05-19 12:26:52 +0200
commit378dc870c6dca3c5186a311fbc9c90e560653a2d (patch)
tree9222ad008af430b18b21d3658a722a23b2a47745 /app
parent8b0a78e9b6691436d6facbb224d8bab7972ab775 (diff)
only wait until Tor has been completely shutdown successfully on startTorService command if the service was previously cancelled
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/TorServiceCommand.java4
1 files changed, 3 insertions, 1 deletions
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();
}