mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
664ebf218e
commit
96060a0a4d
36 changed files with 621 additions and 182 deletions
|
|
@ -58,6 +58,7 @@ import org.meshtastic.feature.widget.di.FeatureWidgetModule
|
|||
includes =
|
||||
[
|
||||
org.meshtastic.app.MainKoinModule::class,
|
||||
org.meshtastic.core.di.di.CoreDiModule::class,
|
||||
CoreCommonModule::class,
|
||||
CoreBleModule::class,
|
||||
CoreBleAndroidModule::class,
|
||||
|
|
@ -93,14 +94,6 @@ class AppKoinModule {
|
|||
@Named("ProcessLifecycle")
|
||||
fun provideProcessLifecycle(): Lifecycle = ProcessLifecycleOwner.get().lifecycle
|
||||
|
||||
@Single
|
||||
fun provideCoroutineDispatchers(): org.meshtastic.core.di.CoroutineDispatchers =
|
||||
org.meshtastic.core.di.CoroutineDispatchers(
|
||||
io = kotlinx.coroutines.Dispatchers.IO,
|
||||
main = kotlinx.coroutines.Dispatchers.Main,
|
||||
default = kotlinx.coroutines.Dispatchers.Default,
|
||||
)
|
||||
|
||||
@Single
|
||||
fun provideBuildConfigProvider(): BuildConfigProvider = object : BuildConfigProvider {
|
||||
override val isDebug: Boolean = org.meshtastic.app.BuildConfig.DEBUG
|
||||
|
|
|
|||
|
|
@ -34,8 +34,10 @@ class FakeMeshServiceNotifications : MeshServiceNotifications {
|
|||
|
||||
override fun initChannels() {}
|
||||
|
||||
override fun updateServiceStateNotification(summaryString: String?, telemetry: Telemetry?): Notification =
|
||||
mock(MockMode.autofill)
|
||||
override fun updateServiceStateNotification(
|
||||
state: org.meshtastic.core.model.ConnectionState,
|
||||
telemetry: Telemetry?,
|
||||
): Notification = mock(MockMode.autofill)
|
||||
|
||||
override suspend fun updateMessageNotification(
|
||||
contactKey: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue