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.
This commit is contained in:
Hans-Christoph Steiner 2015-06-12 14:24:57 -04:00
parent b620f828a1
commit ff04bde300
1 changed files with 4 additions and 1 deletions

View File

@ -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));