Commit 3dba9663 authored by Max Lv's avatar Max Lv

fix two potential FCs

parent c9a7dc8d
......@@ -61,6 +61,7 @@ import com.nostra13.universalimageloader.core.{DisplayImageOptions, ImageLoader,
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer
import com.github.shadowsocks.utils.{Utils, Scheme, Key}
import scala.concurrent.ops._
import scala.language.implicitConversions
case class ProxiedApp(uid: Int, name: String, packageName: String, var proxied: Boolean)
......@@ -245,18 +246,17 @@ class AppManager extends Activity with OnCheckedChangeListener with OnClickListe
}
})
bypassSwitch.setChecked(prefs.getBoolean(Key.isBypassApps, false))
appListView = findViewById(R.id.applistview).asInstanceOf[ListView]
}
protected override def onResume() {
super.onResume()
new Thread {
override def run() {
spawn {
handler.post(loadStartRunnable)
appListView = findViewById(R.id.applistview).asInstanceOf[ListView]
if (!appsLoaded) loadApps()
handler.post(loadFinishRunnable)
}
}.start()
}
def saveAppSettings(context: Context) {
......
......@@ -181,6 +181,7 @@ object Utils {
}
def resolve(host: String, addrType: Int): Option[String] = {
try {
val lookup = new Lookup(host, addrType)
val resolver = new SimpleResolver("114.114.114.114")
resolver.setTimeout(5)
......@@ -196,6 +197,9 @@ object Utils {
return Some(r.asInstanceOf[AAAARecord].getAddress.getHostAddress)
}
}
} catch {
case e: Exception => None
}
None
}
......
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