Commit 93a26969 authored by Max Lv's avatar Max Lv

refine refreshing

parent 8172befb
......@@ -366,6 +366,8 @@ class ShadowVpnService extends VpnService {
override def onCreate() {
super.onCreate()
Config.refresh(this)
EasyTracker
.getInstance(this)
.send(MapBuilder
......
......@@ -739,11 +739,10 @@ class Shadowsocks
}
}
val container = getApplication.asInstanceOf[ShadowsocksApplication].tagContainer
if (container != null) container.refresh();
switchButton.setOnCheckedChangeListener(this)
Config.refresh(this)
}
private def setPreferenceEnabled(enabled: Boolean) {
......
......@@ -388,6 +388,8 @@ class ShadowsocksService extends Service {
override def onCreate() {
super.onCreate()
Config.refresh(this)
EasyTracker
.getInstance(this)
.send(MapBuilder
......
......@@ -111,6 +111,11 @@ object Config {
}
}
def refresh(context: Context) {
val container = context.getApplicationContext.asInstanceOf[ShadowsocksApplication].tagContainer
if (container != null) container.refresh()
}
def getPublicConfig(container: Container, config: Config): Config = {
val list = container.getString("proxy_list")
val proxies = util.Random.shuffle(list.split('|').toSeq).toSeq
......
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