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