Commit 35f17f53 authored by Max Lv's avatar Max Lv

Fix #547

parent 172c0b24
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
package com.github.shadowsocks package com.github.shadowsocks
import android.content.{BroadcastReceiver, Context, Intent} import android.content.{BroadcastReceiver, Context, Intent}
import android.os.Handler
import com.github.shadowsocks.helper.TaskerSettings import com.github.shadowsocks.helper.TaskerSettings
import com.github.shadowsocks.utils.Utils import com.github.shadowsocks.utils.Utils
...@@ -55,6 +56,10 @@ class TaskerReceiver extends BroadcastReceiver { ...@@ -55,6 +56,10 @@ class TaskerReceiver extends BroadcastReceiver {
true true
case _ => false case _ => false
} }
if (settings.switchOn) Utils.startSsService(context) else if (!switched) Utils.stopSsService(context) val handler = new Handler(context.getMainLooper)
handler.postDelayed(() => {
if (settings.switchOn) Utils.startSsService(context)
else if (!switched) Utils.stopSsService(context)
}, 3000)
} }
} }
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