Commit 5f43500b authored by Max Lv's avatar Max Lv

Fix auto-start again

parent 8b4a8a92
......@@ -54,11 +54,13 @@ class ShadowsocksRunnerService extends Service with ServiceBoundContext {
}
override def onServiceConnected() {
if (bgService != null) {
if (app.isNatEnabled) startBackgroundService()
else if (VpnService.prepare(ShadowsocksRunnerService.this) == null) startBackgroundService()
handler.postDelayed(() => stopSelf(), 10000)
}
handler.postDelayed(() => {
if (bgService != null) {
if (app.isNatEnabled) startBackgroundService()
else if (VpnService.prepare(ShadowsocksRunnerService.this) == null) startBackgroundService()
handler.postDelayed(() => stopSelf(), 10000)
}
}, 1000)
}
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