Refine callback handling

This commit is contained in:
Mygod
2015-12-26 23:10:54 +08:00
parent 179aab8094
commit 51ceb3dac5
3 changed files with 9 additions and 31 deletions
@@ -136,10 +136,8 @@ class ShadowsocksVpnService extends VpnService with BaseService {
conn = null
}
// stop the service if no callback registered
if (getCallbackCount == 0) {
stopSelf()
}
// stop the service if nothing has bound to it
stopSelf()
// clean up recevier
if (closeReceiver != null) {
@@ -458,10 +456,6 @@ class ShadowsocksVpnService extends VpnService with BaseService {
fd
}
override def stopBackgroundService() {
stopSelf()
}
override def getTag = TAG
override def getServiceMode = Mode.VPN