Commit 65635c6b authored by Max Lv's avatar Max Lv

Avoid service restarted by system

parent 187cb28d
resolvers += Resolver.url("scalasbt releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.5.14")
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.5.15")
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
......
......@@ -178,6 +178,9 @@ trait BaseService extends Service {
})
}
// Service of shadowsocks should always be started explicitly
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = Service.START_NOT_STICKY
protected def changeState(s: Int, msg: String) {
val handler = new Handler(getContext.getMainLooper)
handler.post(() => if (state != s) {
......
......@@ -335,8 +335,6 @@ class ShadowsocksNatService extends BaseService {
ConfigUtils.refresh(this)
}
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = Service.START_STICKY
def killProcesses() {
if (sslocalProcess != null) {
sslocalProcess.destroy()
......
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