make sure tor network is re-enabled when user tries to restart
This commit is contained in:
parent
d09c2b59b4
commit
ff61d66bcf
|
@ -581,13 +581,12 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
|||
|
||||
if (mNotificationManager == null)
|
||||
{
|
||||
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
}
|
||||
|
||||
IntentFilter mNetworkStateFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mNetworkStateReceiver , mNetworkStateFilter);
|
||||
|
||||
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
}
|
||||
|
||||
new Thread(new Runnable ()
|
||||
{
|
||||
|
@ -773,6 +772,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
|||
} else if (mCurrentStatus == STATUS_ON) {
|
||||
|
||||
sendCallbackLogMessage("Ignoring start request, already started.");
|
||||
setTorNetworkEnabled (true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1521,7 +1521,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
|||
mNetworkType = newNetType;
|
||||
mConnectivity = newConnectivityState;
|
||||
|
||||
if (doNetworKSleep)
|
||||
if (doNetworKSleep && mCurrentStatus != STATUS_OFF)
|
||||
{
|
||||
setTorNetworkEnabled (mConnectivity);
|
||||
|
||||
|
@ -1539,8 +1539,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
|||
|
||||
try {
|
||||
|
||||
if (mCurrentStatus != STATUS_OFF)
|
||||
{
|
||||
if (mConnectivity)
|
||||
{
|
||||
if (Prefs.useRoot() && Prefs.useTransparentProxying() && Prefs.transProxyNetworkRefresh())
|
||||
|
@ -1552,7 +1550,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logException ("error updating state after network restart",e);
|
||||
|
|
Loading…
Reference in New Issue