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:
parent
1de33fd3d9
commit
af9b9034b5
1 changed files with 7 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue