Commit 78e57de8 authored by Max Lv's avatar Max Lv

Refine #602 further

parent 017dd425
...@@ -396,7 +396,7 @@ class ShadowsocksNatService extends BaseService { ...@@ -396,7 +396,7 @@ class ShadowsocksNatService extends BaseService {
} catch { } catch {
case ex: Exception => case ex: Exception =>
changeState(State.STOPPED, getString(R.string.service_failed)) changeState(State.STOPPED, getString(R.string.service_failed))
stopRunner(false) stopRunner(true)
this.config = null this.config = null
} }
} }
...@@ -427,7 +427,7 @@ class ShadowsocksNatService extends BaseService { ...@@ -427,7 +427,7 @@ class ShadowsocksNatService extends BaseService {
notification = new ShadowsocksNotification(this, config.profileName, true) notification = new ShadowsocksNotification(this, config.profileName, true)
} else { } else {
changeState(State.STOPPED, getString(R.string.service_failed)) changeState(State.STOPPED, getString(R.string.service_failed))
stopRunner(false) stopRunner(true)
} }
} }
} }
......
...@@ -106,7 +106,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -106,7 +106,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
} }
override def onRevoke() { override def onRevoke() {
stopRunner(false) stopRunner(true)
} }
override def stopRunner(stopService: Boolean) { override def stopRunner(stopService: Boolean) {
...@@ -193,7 +193,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -193,7 +193,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
} catch { } catch {
case ex: Exception => case ex: Exception =>
changeState(State.STOPPED, getString(R.string.service_failed)) changeState(State.STOPPED, getString(R.string.service_failed))
stopRunner(false) stopRunner(true)
this.config = null this.config = null
} }
} }
...@@ -221,7 +221,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -221,7 +221,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
notification = new ShadowsocksNotification(this, config.profileName) notification = new ShadowsocksNotification(this, config.profileName)
} else { } else {
changeState(State.STOPPED, getString(R.string.service_failed)) changeState(State.STOPPED, getString(R.string.service_failed))
stopRunner(false) stopRunner(true)
} }
} }
} }
...@@ -386,7 +386,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -386,7 +386,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
} }
if (conn == null) { if (conn == null) {
stopRunner(false) stopRunner(true)
return -1 return -1
} }
......
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