diff options
author | cyBerta <cyberta@riseup.net> | 2022-05-19 12:22:51 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2022-05-19 12:22:51 +0200 |
commit | 483fce1c76b991d7ae1a5c2434876cb2fc90a98f (patch) | |
tree | 98cc606f0c9aa09df604761fd322dd4189422489 /app/src | |
parent | 5de151dc62caa499157224620ed05bfda5f6d612 (diff) |
implement method to determine if tor is currently running and not yet about to be shutdown
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java | 5 |
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; + } } |