Use app.* instead of ShadowsocksApplication.*

Because typing ShadowsocksApplication is quite troublesome.
This commit is contained in:
Mygod
2016-05-24 11:37:33 +08:00
parent c695847403
commit 28ea9dd807
20 changed files with 132 additions and 113 deletions
@@ -40,6 +40,7 @@ package com.github.shadowsocks
import android.content.{BroadcastReceiver, Context, Intent}
import com.github.shadowsocks.utils.{TaskerSettings, Utils}
import com.github.shadowsocks.ShadowsocksApplication.app
/**
* @author CzBiX
@@ -47,9 +48,9 @@ import com.github.shadowsocks.utils.{TaskerSettings, Utils}
class TaskerReceiver extends BroadcastReceiver {
override def onReceive(context: Context, intent: Intent) {
val settings = TaskerSettings.fromIntent(intent)
val switched = ShadowsocksApplication.profileManager.getProfile(settings.profileId) match {
val switched = app.profileManager.getProfile(settings.profileId) match {
case Some(p) =>
ShadowsocksApplication.switchProfile(settings.profileId)
app.switchProfile(settings.profileId)
true
case _ => false
}