Update mobile data log message, simplify logic.

This commit is contained in:
akwizgran
2019-02-06 14:20:04 +00:00
parent 75c37a258e
commit 61e8d576d2

View File

@@ -701,16 +701,15 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
} }
try { try {
if (!online || (!charging && onlyWhenCharging)) { if (!online) {
if (!online) { LOG.info("Disabling network, device is offline");
LOG.info("Disabling network, device is offline"); enableNetwork(false);
} else { } else if (!charging && onlyWhenCharging) {
LOG.info("Disabling network, device is on battery"); LOG.info("Disabling network, device is on battery");
}
enableNetwork(false); enableNetwork(false);
} else if (network == PREF_TOR_NETWORK_NEVER || } else if (network == PREF_TOR_NETWORK_NEVER ||
(!useMobile && !wifi)) { (!useMobile && !wifi)) {
LOG.info("Disabling network due to setting"); LOG.info("Disabling network, device is using mobile data");
enableNetwork(false); enableNetwork(false);
} else if (automatic && blocked && !bridgesWork) { } else if (automatic && blocked && !bridgesWork) {
LOG.info("Disabling network, country is blocked"); LOG.info("Disabling network, country is blocked");