Skip to content

[PM-19947] Provide system clock in the core module #5000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ object PlatformManagerModule {
vaultRepository = vaultRepository,
)

@Provides
@Singleton
fun provideClock(): Clock = Clock.systemDefaultZone()

@Provides
@Singleton
fun provideBiometricsEncryptionManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import java.time.Clock
import javax.inject.Singleton

/**
Expand All @@ -52,10 +51,6 @@ object PlatformManagerModule {
@Singleton
fun provideSdkClientManager(): SdkClientManager = SdkClientManagerImpl()

@Provides
@Singleton
fun provideClock(): Clock = Clock.systemDefaultZone()

@Provides
@Singleton
fun provideBiometricsEncryptionManager(
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/kotlin/com/bitwarden/core/di/CoreModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import dagger.hilt.components.SingletonComponent
import kotlinx.serialization.json.Json
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.contextual
import java.time.Clock
import javax.inject.Singleton

/**
Expand Down Expand Up @@ -35,4 +36,8 @@ object CoreModule {
// Respect model default property values.
coerceInputValues = true
}

@Provides
@Singleton
fun provideClock(): Clock = Clock.systemDefaultZone()
}
Loading