summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-05-19 12:22:51 +0200
committercyBerta <cyberta@riseup.net>2022-05-19 12:22:51 +0200
commit483fce1c76b991d7ae1a5c2434876cb2fc90a98f (patch)
tree98cc606f0c9aa09df604761fd322dd4189422489 /app/src/main
parent5de151dc62caa499157224620ed05bfda5f6d612 (diff)
implement method to determine if tor is currently running and not yet about to be shutdown
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java b/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java
index c924caee..54868549 100644
--- a/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java
+++ b/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java
@@ -287,4 +287,9 @@ public class TorStatusObservable extends Observable {
public static boolean isCancelled() {
return getInstance().cancelled;
}
+
+ public static boolean isRunning() {
+ return !TorStatusObservable.isCancelled() &&
+ TorStatusObservable.getStatus() != TorStatusObservable.TorStatus.OFF;
+ }
}