diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt index 974812ddc5d..e1e791b2046 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt @@ -26,7 +26,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import com.ramcosta.composedestinations.annotation.RootNavGraph -import com.wire.android.BuildConfig import com.wire.android.R import com.wire.android.navigation.Navigator import com.wire.android.ui.common.colorsScheme @@ -51,6 +50,7 @@ fun PrivacySettingsConfigScreen( with(viewModel) { PrivacySettingsScreenContent( isAnonymousUsageDataEnabled = state.isAnalyticsUsageEnabled, + shouldShowAnalyticsUsage = state.shouldShowAnalyticsUsage, areReadReceiptsEnabled = state.areReadReceiptsEnabled, setReadReceiptsState = ::setReadReceiptsState, isTypingIndicatorEnabled = state.isTypingIndicatorEnabled, @@ -66,6 +66,7 @@ fun PrivacySettingsConfigScreen( @Composable fun PrivacySettingsScreenContent( isAnonymousUsageDataEnabled: Boolean, + shouldShowAnalyticsUsage: Boolean, areReadReceiptsEnabled: Boolean, setReadReceiptsState: (Boolean) -> Unit, isTypingIndicatorEnabled: Boolean, @@ -91,7 +92,7 @@ fun PrivacySettingsScreenContent( .fillMaxSize() .padding(internalPadding) ) { - if (BuildConfig.ANALYTICS_ENABLED) { + if (shouldShowAnalyticsUsage) { GroupConversationOptionsItem( title = stringResource(id = R.string.settings_send_anonymous_usage_data_title), switchState = SwitchState.Enabled(value = isAnonymousUsageDataEnabled, onCheckedChange = setAnonymousUsageDataEnabled), @@ -143,6 +144,7 @@ fun PrivacySettingsScreenContent( fun PreviewSendReadReceipts() = WireTheme { PrivacySettingsScreenContent( isAnonymousUsageDataEnabled = true, + shouldShowAnalyticsUsage = true, areReadReceiptsEnabled = true, setReadReceiptsState = {}, isTypingIndicatorEnabled = true, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt index 4c9b5abb94e..dca52c5c24e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt @@ -90,6 +90,7 @@ class PrivacySettingsViewModel @Inject constructor( } viewModelScope.launch { + // TODO(Analytics): To be changed with UseCase val isAnalyticsConfigurationEnabled = analyticsEnabled is AnalyticsConfiguration.Enabled val isValidBackend = when (val serverConfig = selfServerConfig()) { is SelfServerConfigUseCase.Result.Success ->