refine refreshing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user