Don't send dev reports until transport is enabled.

This commit is contained in:
akwizgran
2016-05-06 09:22:34 +01:00
parent e36d1c8954
commit 86f409d0bf
2 changed files with 9 additions and 6 deletions

View File

@@ -233,7 +233,6 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
if (phase != null && phase.contains("PROGRESS=100")) { if (phase != null && phase.contains("PROGRESS=100")) {
LOG.info("Tor has already bootstrapped"); LOG.info("Tor has already bootstrapped");
connectionStatus.setBootstrapped(); connectionStatus.setBootstrapped();
sendDevReports();
} }
} }
// Register to receive network status events // Register to receive network status events
@@ -615,7 +614,10 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
connectionStatus.getAndSetCircuitBuilt()) { connectionStatus.getAndSetCircuitBuilt()) {
LOG.info("First circuit built"); LOG.info("First circuit built");
backoff.reset(); backoff.reset();
if (isRunning()) callback.transportEnabled(); if (isRunning()) {
sendDevReports();
callback.transportEnabled();
}
} }
} }
@@ -641,9 +643,11 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
if (LOG.isLoggable(INFO)) LOG.info(severity + " " + msg); if (LOG.isLoggable(INFO)) LOG.info(severity + " " + msg);
if (severity.equals("NOTICE") && msg.startsWith("Bootstrapped 100%")) { if (severity.equals("NOTICE") && msg.startsWith("Bootstrapped 100%")) {
connectionStatus.setBootstrapped(); connectionStatus.setBootstrapped();
sendDevReports();
backoff.reset(); backoff.reset();
if (isRunning()) callback.transportEnabled(); if (isRunning()) {
sendDevReports();
callback.transportEnabled();
}
} }
} }
@@ -688,7 +692,7 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
Object o = appContext.getSystemService(CONNECTIVITY_SERVICE); Object o = appContext.getSystemService(CONNECTIVITY_SERVICE);
ConnectivityManager cm = (ConnectivityManager) o; ConnectivityManager cm = (ConnectivityManager) o;
NetworkInfo net = cm.getActiveNetworkInfo(); NetworkInfo net = cm.getActiveNetworkInfo();
boolean online = net != null && net.isConnected(); boolean online = net != null && net.isConnected();
boolean wifi = online && net.getType() == TYPE_WIFI; boolean wifi = online && net.getType() == TYPE_WIFI;
String country = locationUtils.getCurrentCountry(); String country = locationUtils.getCurrentCountry();
boolean blocked = TorNetworkMetadata.isTorProbablyBlocked( boolean blocked = TorNetworkMetadata.isTorProbablyBlocked(

View File

@@ -2,7 +2,6 @@ package org.briarproject.api.reporting;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
/** /**
* A task for reporting back to the developers. * A task for reporting back to the developers.