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
@@ -49,6 +49,7 @@ import android.util.Log
import android.widget.Toast
import com.github.shadowsocks.aidl.{Config, IShadowsocksService, IShadowsocksServiceCallback}
import com.github.shadowsocks.utils._
import com.github.shadowsocks.ShadowsocksApplication.app
trait BaseService extends Service {
@@ -162,11 +163,11 @@ trait BaseService extends Service {
def updateTrafficTotal(tx: Long, rx: Long) {
val config = this.config // avoid race conditions without locking
if (config != null) {
ShadowsocksApplication.profileManager.getProfile(config.profileId) match {
app.profileManager.getProfile(config.profileId) match {
case Some(profile) =>
profile.tx += tx
profile.rx += rx
ShadowsocksApplication.profileManager.updateProfile(profile)
app.profileManager.updateProfile(profile)
case None => // Ignore
}
}