This commit is contained in:
Max Lv
2014-07-25 18:13:51 +08:00
parent 028c5a6463
commit 4e22d26e84
4 changed files with 22 additions and 21 deletions
@@ -253,7 +253,10 @@ class ShadowsocksVpnService extends VpnService with BaseService {
notificationManager = getSystemService(Context.NOTIFICATION_SERVICE)
.asInstanceOf[NotificationManager]
}
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = {
Service.START_NOT_STICKY
}
override def onRevoke() {
@@ -295,9 +298,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
filter.addAction(Intent.ACTION_SHUTDOWN)
receiver = new BroadcastReceiver {
def onReceive(p1: Context, p2: Intent) {
spawn {
stopRunner()
}
stopRunner()
}
}
registerReceiver(receiver, filter)