Fixed start/reload/stop synchronization

This commit is contained in:
M66B 2015-11-01 07:50:49 +01:00
parent 1de33fd3d9
commit af9b9034b5
1 changed files with 7 additions and 7 deletions

View File

@ -44,11 +44,11 @@ public class SinkholeService extends VpnService {
final Command cmd = (intent == null ? Command.start : (Command) intent.getSerializableExtra(EXTRA_COMMAND));
Log.i(TAG, "Start intent=" + intent + " command=" + cmd + " enabled=" + enabled + " vpn=" + (vpn != null));
synchronized (this) {
new Thread(new Runnable() {
@Override
public void run() {
// Process command
// Process command
new Thread(new Runnable() {
@Override
public void run() {
synchronized (SinkholeService.this) {
switch (cmd) {
case start:
if (enabled && vpn == null) {
@ -80,8 +80,8 @@ public class SinkholeService extends VpnService {
break;
}
}
}).start();
}
}
}).start();
return START_STICKY;
}