remove synchronized - not needed, and causing blocking

This commit is contained in:
Nathan Freitas 2014-06-04 23:52:28 -04:00
parent f52c22aa0d
commit d6f5720f27
1 changed files with 6 additions and 5 deletions

View File

@ -1002,17 +1002,18 @@ public class TorService extends Service implements TorServiceConstants, TorConst
} }
public synchronized void setTorProfile(int profile) { public void setTorProfile(int profile) {
if (profile == PROFILE_ON && currentStatus == STATUS_OFF) if (currentStatus == STATUS_OFF)
{ {
currentStatus = STATUS_CONNECTING;
sendCallbackStatusMessage (getString(R.string.status_starting_up)); sendCallbackStatusMessage (getString(R.string.status_starting_up));
try try
{ {
initTor(); initTor();
currentStatus = STATUS_CONNECTING;
} }
catch (Exception e) catch (Exception e)
{ {
@ -1024,11 +1025,11 @@ public class TorService extends Service implements TorServiceConstants, TorConst
} }
else else
{ {
currentStatus = STATUS_OFF;
sendCallbackStatusMessage (getString(R.string.status_shutting_down)); sendCallbackStatusMessage (getString(R.string.status_shutting_down));
stopTor(); stopTor();
currentStatus = STATUS_OFF;
} }
} }