bump version
This commit is contained in:
@@ -49,7 +49,7 @@ import com.github.shadowsocks.utils.{State, TrafficMonitor, TrafficMonitorThread
|
||||
|
||||
trait BaseService extends Service {
|
||||
|
||||
@volatile private var state = State.INIT
|
||||
@volatile private var state = State.STOPPED
|
||||
@volatile private var callbackCount = 0
|
||||
|
||||
var timer: Timer = null
|
||||
@@ -76,7 +76,7 @@ trait BaseService extends Service {
|
||||
timer.cancel()
|
||||
timer = null
|
||||
}
|
||||
if (callbackCount == 0 && state != State.CONNECTING && state != State.CONNECTED) {
|
||||
if (callbackCount == 0 && state == State.STOPPED) {
|
||||
stopBackgroundService()
|
||||
}
|
||||
}
|
||||
@@ -101,13 +101,13 @@ trait BaseService extends Service {
|
||||
}
|
||||
|
||||
override def stop() {
|
||||
if (state != State.CONNECTING && state != State.STOPPING) {
|
||||
if (state == State.CONNECTED) {
|
||||
stopRunner()
|
||||
}
|
||||
}
|
||||
|
||||
override def start(config: Config) {
|
||||
if (state != State.CONNECTING && state != State.STOPPING) {
|
||||
if (state == State.STOPPED) {
|
||||
startRunner(config)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ class Shadowsocks
|
||||
var fabProgressCircle: FABProgressCircle = _
|
||||
var progressDialog: ProgressDialog = _
|
||||
var progressTag = -1
|
||||
var state = State.INIT
|
||||
var state = State.STOPPED
|
||||
var prepared = false
|
||||
var currentProfile = new Profile
|
||||
var vpnEnabled = -1
|
||||
@@ -165,8 +165,6 @@ class Shadowsocks
|
||||
|
||||
if (!ShadowsocksApplication.settings.getBoolean(ShadowsocksApplication.getVersionName, false)) {
|
||||
ShadowsocksApplication.settings.edit.putBoolean(ShadowsocksApplication.getVersionName, true).apply()
|
||||
recovery()
|
||||
|
||||
try {
|
||||
// Workaround that convert port(String) to port(Int)
|
||||
val oldLocalPort = ShadowsocksApplication.settings.getString("port", "-1")
|
||||
@@ -181,6 +179,8 @@ class Shadowsocks
|
||||
} catch {
|
||||
case ex: Exception => // Ignore
|
||||
}
|
||||
|
||||
recovery()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ object Mode {
|
||||
}
|
||||
|
||||
object State {
|
||||
val INIT = 0
|
||||
val CONNECTING = 1
|
||||
val CONNECTED = 2
|
||||
val STOPPING = 3
|
||||
|
||||
Reference in New Issue
Block a user