From ff04bde300651b6f035beae562b66278693a54d4 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 12 Jun 2015 14:24:57 -0400 Subject: [PATCH] announce Orbot is ON once the first circuit is complete Before, it was announcing tor was started when it had completed starting the daemons. But that does not guarantee that Tor is actually connected and working. So instead, this waits for the first circuit to be built, then announces Tor is ON. --- src/org/torproject/android/service/TorService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 7e057a0a..fd7bcc89 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -840,7 +840,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon } shellUser.close(); - sendCallbackStatus(STATUS_ON); } catch (CannotKillException e) { logException(e.getMessage(), e); showToolbarNotification(getString(R.string.unable_to_reset_tor), @@ -1489,6 +1488,10 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon public void circuitStatus(String status, String circID, String path) { + /* once the first circuit is complete, then announce that Orbot is on*/ + if (mCurrentStatus == STATUS_STARTING && TextUtils.equals(status, "BUILT")) + sendCallbackStatus(STATUS_ON); + StringBuilder sb = new StringBuilder(); sb.append("Circuit ("); sb.append((circID));