diff --git a/wear/build.gradle b/wear/build.gradle index a4b592cf00..a7638ba42d 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -118,6 +118,7 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" // for old fashioned support-app version @@ -145,4 +146,4 @@ configurations { all { exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx' } -} \ No newline at end of file +} diff --git a/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt b/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt index 1875954570..014b247cc8 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt +++ b/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt @@ -3,11 +3,13 @@ package info.nightscout.androidaps.di import android.content.Context import dagger.Binds import dagger.Module +import dagger.Provides import dagger.android.HasAndroidInjector import info.nightscout.androidaps.WearApp import info.nightscout.rx.di.RxModule import info.nightscout.shared.di.SharedModule import info.nightscout.shared.impl.di.SharedImplModule +import kotlinx.datetime.Clock @Suppress("unused") @Module( @@ -27,5 +29,8 @@ open class WearModule { @Binds fun bindContext(aaps: WearApp): Context @Binds fun bindInjector(aaps: WearApp): HasAndroidInjector } + + @Provides + fun providesClock(): Clock = Clock.System }