1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-23 08:17:51 +00:00

Fixed start/reload/stop synchronization

This commit is contained in:
M66B 2015-11-01 07:50:49 +01:00
parent 1de33fd3d9
commit af9b9034b5

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;
}