mock interface now pretty completely simulates a real device

This commit is contained in:
Kevin Hester 2021-02-01 10:56:47 +08:00
parent a0160cadf9
commit 7d846461e4
7 changed files with 103 additions and 43 deletions

View file

@ -11,7 +11,6 @@ import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.geeksville.android.BuildUtils.isEmulator
import com.geeksville.android.Logging
import com.geeksville.mesh.IMeshService
import com.geeksville.mesh.MeshProtos
@ -77,10 +76,7 @@ class UIViewModel(app: Application) : AndroidViewModel(app), Logging {
fun getChannel(c: MeshProtos.RadioConfig?): Channel? {
val channel = c?.channelSettings?.let { Channel(it) }
return if (channel == null && isEmulator)
Channel.emulated
else
channel
return channel
}
fun getPreferences(context: Context): SharedPreferences =