Fix moar ktlint issues
This commit is contained in:
committed by
Benoit Marty
parent
d3830af78b
commit
378692f743
@@ -28,7 +28,6 @@ class FakeAnalyticsService(
|
||||
isEnabled: Boolean = false,
|
||||
didAskUserConsent: Boolean = false
|
||||
) : AnalyticsService {
|
||||
|
||||
private val isEnabledFlow = MutableStateFlow(isEnabled)
|
||||
private val didAskUserConsentFlow = MutableStateFlow(didAskUserConsent)
|
||||
val capturedEvents = mutableListOf<VectorAnalyticsEvent>()
|
||||
|
||||
@@ -38,13 +38,13 @@ class SentryAnalyticsProvider @Inject constructor(
|
||||
@ApplicationContext private val context: Context,
|
||||
private val buildMeta: BuildMeta,
|
||||
) : AnalyticsProvider {
|
||||
override val name = SentryConfig.name
|
||||
override val name = SentryConfig.NAME
|
||||
|
||||
override fun init() {
|
||||
Timber.tag(analyticsTag.value).d("Initializing Sentry")
|
||||
if (Sentry.isEnabled()) return
|
||||
SentryAndroid.init(context) { options ->
|
||||
options.dsn = SentryConfig.dns
|
||||
options.dsn = SentryConfig.DNS
|
||||
options.beforeSend = SentryOptions.BeforeSendCallback { event, _ -> event }
|
||||
options.tracesSampleRate = 1.0
|
||||
options.isEnableUserInteractionTracing = true
|
||||
@@ -73,7 +73,7 @@ class SentryAnalyticsProvider @Inject constructor(
|
||||
}
|
||||
|
||||
private fun BuildType.toSentryEnv() = when (this) {
|
||||
BuildType.RELEASE -> SentryConfig.envRelease
|
||||
BuildType.RELEASE -> SentryConfig.ENV_RELEASE
|
||||
BuildType.NIGHTLY,
|
||||
BuildType.DEBUG -> SentryConfig.envDebug
|
||||
BuildType.DEBUG -> SentryConfig.ENV_DEBUG
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package io.element.android.services.analyticsproviders.sentry
|
||||
|
||||
object SentryConfig {
|
||||
const val name = "Sentry"
|
||||
const val dns = "https://32f7ff6a6e724f90838b7654042b2e81@sentry.tools.element.io/59"
|
||||
const val envDebug = "DEBUG"
|
||||
const val envRelease = "RELEASE"
|
||||
const val NAME = "Sentry"
|
||||
const val DNS = "https://32f7ff6a6e724f90838b7654042b2e81@sentry.tools.element.io/59"
|
||||
const val ENV_DEBUG = "DEBUG"
|
||||
const val ENV_RELEASE = "RELEASE"
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package io.element.android.services.apperror.api
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
interface AppErrorStateService {
|
||||
|
||||
val appErrorStateFlow: StateFlow<AppErrorState>
|
||||
|
||||
fun showError(title: String, body: String)
|
||||
|
||||
@@ -28,7 +28,6 @@ import javax.inject.Inject
|
||||
@ContributesBinding(AppScope::class)
|
||||
@SingleIn(AppScope::class)
|
||||
class DefaultAppErrorStateService @Inject constructor() : AppErrorStateService {
|
||||
|
||||
private val currentAppErrorState = MutableStateFlow<AppErrorState>(AppErrorState.NoError)
|
||||
override val appErrorStateFlow: StateFlow<AppErrorState> = currentAppErrorState
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
internal class DefaultAppErrorStateServiceTest {
|
||||
|
||||
@Test
|
||||
fun `initial value is no error`() = runTest {
|
||||
val service = DefaultAppErrorStateService()
|
||||
|
||||
@@ -24,7 +24,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
class DefaultAppForegroundStateService : AppForegroundStateService {
|
||||
|
||||
private val state = MutableStateFlow(false)
|
||||
override val isInForeground: StateFlow<Boolean> = state
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ class DefaultAppNavigationStateService @Inject constructor(
|
||||
private val appForegroundStateService: AppForegroundStateService,
|
||||
private val coroutineScope: CoroutineScope,
|
||||
) : AppNavigationStateService {
|
||||
|
||||
private val state = MutableStateFlow(
|
||||
AppNavigationState(
|
||||
navigationState = NavigationState.Root,
|
||||
|
||||
@@ -29,7 +29,6 @@ import io.element.android.services.appnavstate.impl.initializer.AppForegroundSta
|
||||
@Module
|
||||
@ContributesTo(AppScope::class)
|
||||
object AppNavStateModule {
|
||||
|
||||
@Provides
|
||||
fun provideAppForegroundStateService(
|
||||
@ApplicationContext context: Context
|
||||
|
||||
@@ -23,7 +23,6 @@ import kotlinx.coroutines.flow.StateFlow
|
||||
class FakeAppForegroundStateService(
|
||||
initialValue: Boolean = true,
|
||||
) : AppForegroundStateService {
|
||||
|
||||
private val state = MutableStateFlow(initialValue)
|
||||
override val isInForeground: StateFlow<Boolean> = state
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import javax.inject.Inject
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultSystemClock @Inject constructor() : SystemClock {
|
||||
|
||||
/**
|
||||
* Provides a UTC epoch in milliseconds
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user