diff --git a/vector/src/main/java/im/vector/app/features/analytics/AnalyticsTracker.kt b/vector/src/main/java/im/vector/app/features/analytics/AnalyticsTracker.kt index e1da0f4434..e85919a45f 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/AnalyticsTracker.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/AnalyticsTracker.kt @@ -18,6 +18,7 @@ package im.vector.app.features.analytics import im.vector.app.features.analytics.itf.VectorAnalyticsEvent import im.vector.app.features.analytics.itf.VectorAnalyticsScreen +import im.vector.app.features.analytics.plan.Identity interface AnalyticsTracker { /** @@ -29,4 +30,9 @@ interface AnalyticsTracker { * Track a displayed screen */ fun screen(screen: VectorAnalyticsScreen) + + /** + * Update user specific properties + */ + fun updateUserProperties(identity: Identity) } diff --git a/vector/src/main/java/im/vector/app/features/analytics/VectorAnalytics.kt b/vector/src/main/java/im/vector/app/features/analytics/VectorAnalytics.kt index ddab0412dd..95322412bd 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/VectorAnalytics.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/VectorAnalytics.kt @@ -16,7 +16,6 @@ package im.vector.app.features.analytics -import im.vector.app.features.analytics.plan.Identity import kotlinx.coroutines.flow.Flow interface VectorAnalytics : AnalyticsTracker { @@ -59,9 +58,4 @@ interface VectorAnalytics : AnalyticsTracker { * To be called when application is started */ fun init() - - /** - * Update user specific properties - */ - fun updateUserProperties(identity: Identity) } diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 7ab7662620..3e4ea68317 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -36,7 +36,7 @@ import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.resources.StringProvider import im.vector.app.core.utils.ensureTrailingSlash import im.vector.app.features.VectorFeatures -import im.vector.app.features.analytics.VectorAnalytics +import im.vector.app.features.analytics.AnalyticsTracker import im.vector.app.features.analytics.plan.Identity import im.vector.app.features.login.HomeServerConnectionConfigFactory import im.vector.app.features.login.LoginConfig @@ -78,7 +78,7 @@ class OnboardingViewModel @AssistedInject constructor( private val homeServerHistoryService: HomeServerHistoryService, private val vectorFeatures: VectorFeatures, private val onboardingStore: OnboardingStore, - private val vectorAnalytics: VectorAnalytics + private val analyticsTracker: AnalyticsTracker ) : VectorViewModel(initialState) { @AssistedFactory @@ -466,7 +466,7 @@ class OnboardingViewModel @AssistedInject constructor( private fun handleUpdateUseCase(action: OnboardingAction.UpdateUseCase) { viewModelScope.launch { onboardingStore.setUseCase(action.useCase) - vectorAnalytics.updateUserProperties( + analyticsTracker.updateUserProperties( Identity(ftueUseCaseSelection = action.useCase.toTrackingValue()) ) } @@ -476,7 +476,7 @@ class OnboardingViewModel @AssistedInject constructor( private fun resetUseCase() { viewModelScope.launch { onboardingStore.resetUseCase() - vectorAnalytics.updateUserProperties( + analyticsTracker.updateUserProperties( Identity(ftueUseCaseSelection = null) ) }