Commit fb960d06 authored by Max Lv's avatar Max Lv

Fix #900

parent 9ed320d3
...@@ -54,11 +54,11 @@ class ShadowsocksRunnerService extends Service with ServiceBoundContext { ...@@ -54,11 +54,11 @@ class ShadowsocksRunnerService extends Service with ServiceBoundContext {
} }
override def onServiceConnected() { override def onServiceConnected() {
handler.postDelayed(() => if (bgService != null) { if (bgService != null) {
if (app.isNatEnabled) startBackgroundService() if (app.isNatEnabled) startBackgroundService()
else if (VpnService.prepare(ShadowsocksRunnerService.this) == null) startBackgroundService() else if (VpnService.prepare(ShadowsocksRunnerService.this) == null) startBackgroundService()
stopSelf() handler.postDelayed(() => stopSelf(), 10000)
}, 1000) }
} }
def startBackgroundService() = bgService.useSync(app.profileId) def startBackgroundService() = bgService.useSync(app.profileId)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment