From 797b3fda123a55faed02fa0657381e14e1312fa9 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 17 Jun 2016 17:58:58 +0800 Subject: [PATCH] Revert "Refine #530" This reverts commit 292f22cc86f6b9d93694575cd8385f486ba781ac. --- .../scala/com/github/shadowsocks/ServiceBoundContext.scala | 1 + .../com/github/shadowsocks/ShadowsocksRunnerService.scala | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala index 40ec6f3e..c2df8d68 100644 --- a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala +++ b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala @@ -62,6 +62,7 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient { connection = new ShadowsocksServiceConnection() bindService(intent, connection, Context.BIND_AUTO_CREATE) + startService(intent) } } diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala index 09470d29..929b6161 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala @@ -43,7 +43,6 @@ import android.app.Service import android.content.Intent import android.net.VpnService import android.os.{IBinder, Handler} -import com.github.shadowsocks.utils.Action import com.github.shadowsocks.utils.ConfigUtils import com.github.shadowsocks.ShadowsocksApplication.app @@ -73,11 +72,6 @@ class ShadowsocksRunnerService extends Service with ServiceBoundContext { override def onCreate() { super.onCreate() attachService() - - val s = if (app.isNatEnabled) classOf[ShadowsocksNatService] else classOf[ShadowsocksVpnService] - val intent = new Intent(this, s) - intent.setAction(Action.SERVICE) - startService(intent) } override def onDestroy() {