diff --git a/app/src/main/kotlin/com/wire/android/WireApplication.kt b/app/src/main/kotlin/com/wire/android/WireApplication.kt index f5f04e4c4bc..2e1be40f05c 100644 --- a/app/src/main/kotlin/com/wire/android/WireApplication.kt +++ b/app/src/main/kotlin/com/wire/android/WireApplication.kt @@ -182,7 +182,7 @@ class WireApplication : BaseApp() { private suspend fun initializeApplicationLoggingFrameworks() { // 1. Datadog should be initialized first - ExternalLoggerManager.initDatadogLogger(applicationContext, globalDataStore.get()) + ExternalLoggerManager.initDatadogLogger(applicationContext) // 2. Initialize our internal logging framework val isLoggingEnabled = globalDataStore.get().isLoggingEnabled().first() val config = if (isLoggingEnabled) { diff --git a/app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt b/app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt index b9fa7463f57..7c06a72d2d9 100644 --- a/app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt +++ b/app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt @@ -53,8 +53,6 @@ class GlobalDataStore @Inject constructor(@ApplicationContext private val contex private val MIGRATION_COMPLETED = booleanPreferencesKey("migration_completed") private val WELCOME_SCREEN_PRESENTED = booleanPreferencesKey("welcome_screen_presented") private val IS_LOGGING_ENABLED = booleanPreferencesKey("is_logging_enabled") - private val IS_ENCRYPTED_PROTEUS_STORAGE_ENABLED = - booleanPreferencesKey("is_encrypted_proteus_storage_enabled") private val APP_LOCK_PASSCODE = stringPreferencesKey("app_lock_passcode") private val APP_LOCK_SOURCE = intPreferencesKey("app_lock_source") @@ -104,16 +102,6 @@ class GlobalDataStore @Inject constructor(@ApplicationContext private val contex context.dataStore.edit { it[RECORD_AUDIO_EFFECTS_CHECKBOX] = enabled } } - fun isEncryptedProteusStorageEnabled(): Flow = - getBooleanPreference( - IS_ENCRYPTED_PROTEUS_STORAGE_ENABLED, - BuildConfig.ENCRYPT_PROTEUS_STORAGE - ) - - suspend fun setEncryptedProteusStorageEnabled(enabled: Boolean) { - context.dataStore.edit { it[IS_ENCRYPTED_PROTEUS_STORAGE_ENABLED] = enabled } - } - suspend fun setMigrationCompleted() { context.dataStore.edit { it[MIGRATION_COMPLETED] = true } } diff --git a/app/src/main/kotlin/com/wire/android/di/KaliumConfigsModule.kt b/app/src/main/kotlin/com/wire/android/di/KaliumConfigsModule.kt index 9be6af3cae7..bcf905cd05e 100644 --- a/app/src/main/kotlin/com/wire/android/di/KaliumConfigsModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/KaliumConfigsModule.kt @@ -21,7 +21,6 @@ package com.wire.android.di import android.content.Context import android.os.Build import com.wire.android.BuildConfig -import com.wire.android.datastore.GlobalDataStore import com.wire.android.util.isWebsocketEnabledByDefault import com.wire.kalium.logic.featureFlags.BuildFileRestrictionState import com.wire.kalium.logic.featureFlags.KaliumConfigs @@ -29,15 +28,13 @@ import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.runBlocking @Module @InstallIn(SingletonComponent::class) class KaliumConfigsModule { @Provides - fun provideKaliumConfigs(globalDataStore: GlobalDataStore, context: Context): KaliumConfigs { + fun provideKaliumConfigs(context: Context): KaliumConfigs { val fileRestriction: BuildFileRestrictionState = if (BuildConfig.FILE_RESTRICTION_ENABLED) { BuildConfig.FILE_RESTRICTION_LIST.split(",").map { it.trim() }.let { BuildFileRestrictionState.AllowSome(it) @@ -55,7 +52,7 @@ class KaliumConfigsModule { lowerKeyingMaterialsUpdateThreshold = BuildConfig.PRIVATE_BUILD, developmentApiEnabled = BuildConfig.DEVELOPMENT_API_ENABLED, ignoreSSLCertificatesForUnboundCalls = BuildConfig.IGNORE_SSL_CERTIFICATES, - encryptProteusStorage = runBlocking { globalDataStore.isEncryptedProteusStorageEnabled().first() }, + encryptProteusStorage = true, guestRoomLink = BuildConfig.ENABLE_GUEST_ROOM_LINK, selfDeletingMessages = BuildConfig.SELF_DELETING_MESSAGES, wipeOnCookieInvalid = BuildConfig.WIPE_ON_COOKIE_INVALID, diff --git a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt index 165da415254..b0dc3665d5b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt +++ b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt @@ -65,11 +65,10 @@ fun DebugDataOptions( ) { LocalSnackbarHostState.current.collectAndShowSnackbar(snackbarFlow = viewModel.infoMessage) DebugDataOptionsContent( - state = viewModel.state(), + state = viewModel.state, appVersion = appVersion, buildVariant = buildVariant, onCopyText = onCopyText, - onEnableEncryptedProteusStorageChange = viewModel::enableEncryptedProteusStorage, onRestartSlowSyncForRecovery = viewModel::restartSlowSyncForRecovery, onForceUpdateApiVersions = viewModel::forceUpdateApiVersions, onManualMigrationPressed = { onManualMigrationPressed(viewModel.currentAccount()) }, @@ -89,7 +88,6 @@ fun DebugDataOptionsContent( appVersion: String, buildVariant: String, onCopyText: (String) -> Unit, - onEnableEncryptedProteusStorageChange: (Boolean) -> Unit, onDisableEventProcessingChange: (Boolean) -> Unit, onRestartSlowSyncForRecovery: () -> Unit, onForceUpdateApiVersions: () -> Unit, @@ -198,10 +196,7 @@ fun DebugDataOptionsContent( ) } } - ProteusOptions( - isEncryptedStorageEnabled = state.isEncryptedProteusStorageEnabled, - onEncryptedStorageEnabledChange = onEnableEncryptedProteusStorageChange - ) + if (BuildConfig.DEBUG) { MLSOptions( keyPackagesCount = state.keyPackagesCount, @@ -337,17 +332,6 @@ private fun MLSOptions( //endregion //region Proteus Options -@Composable -private fun ProteusOptions( - isEncryptedStorageEnabled: Boolean, - onEncryptedStorageEnabledChange: (Boolean) -> Unit, -) { - FolderHeader(stringResource(R.string.label_proteus_option_title)) - EnableEncryptedProteusStorageSwitch( - isEnabled = isEncryptedStorageEnabled, - onCheckedChange = onEncryptedStorageEnabledChange - ) -} @Composable private fun EnableEncryptedProteusStorageSwitch( @@ -539,7 +523,6 @@ fun PreviewOtherDebugOptions() = WireTheme { buildVariant = "debug", onCopyText = {}, state = DebugDataOptionsState( - isEncryptedProteusStorageEnabled = true, keyPackagesCount = 10, mslClientId = "clientId", mlsErrorMessage = "error", @@ -547,7 +530,6 @@ fun PreviewOtherDebugOptions() = WireTheme { debugId = "debugId", commitish = "commitish" ), - onEnableEncryptedProteusStorageChange = {}, onForceUpdateApiVersions = {}, onDisableEventProcessingChange = {}, onRestartSlowSyncForRecovery = {}, diff --git a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsState.kt b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsState.kt index 3f7387e53d3..5f35f0e4473 100644 --- a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsState.kt @@ -18,7 +18,6 @@ package com.wire.android.ui.debug data class DebugDataOptionsState( - val isEncryptedProteusStorageEnabled: Boolean = false, val isEventProcessingDisabled: Boolean = false, val keyPackagesCount: Int = 0, val mslClientId: String = "null", diff --git a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt index 27fdf191eb9..344d1cffa61 100644 --- a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt @@ -64,10 +64,9 @@ import javax.inject.Inject @ViewModelScopedPreview interface DebugDataOptionsViewModel { val infoMessage: SharedFlow get() = MutableSharedFlow() - fun state(): DebugDataOptionsState = DebugDataOptionsState() + val state: DebugDataOptionsState get() = DebugDataOptionsState() fun currentAccount(): UserId = UserId("value", "domain") fun checkCrlRevocationList() {} - fun enableEncryptedProteusStorage(enabled: Boolean) {} fun restartSlowSyncForRecovery() {} fun enrollE2EICertificate() {} fun handleE2EIEnrollmentResult(result: Either) {} @@ -95,7 +94,7 @@ class DebugDataOptionsViewModelImpl private val getDefaultProtocolUseCase: GetDefaultProtocolUseCase, ) : ViewModel(), DebugDataOptionsViewModel { - var state by mutableStateOf( + override var state by mutableStateOf( DebugDataOptionsState() ) @@ -103,7 +102,6 @@ class DebugDataOptionsViewModelImpl override val infoMessage = _infoMessage.asSharedFlow() init { - observeEncryptedProteusStorageState() observeMlsMetadata() checkIfCanTriggerManualMigration() setGitHashAndDeviceId() @@ -159,7 +157,6 @@ class DebugDataOptionsViewModelImpl } } - override fun state() = state override fun currentAccount(): UserId = currentAccount override fun checkCrlRevocationList() { @@ -170,14 +167,6 @@ class DebugDataOptionsViewModelImpl } } - override fun enableEncryptedProteusStorage(enabled: Boolean) { - if (enabled) { - viewModelScope.launch { - globalDataStore.setEncryptedProteusStorageEnabled(true) - } - } - } - override fun restartSlowSyncForRecovery() { viewModelScope.launch { restartSlowSyncProcessForRecovery() @@ -257,15 +246,6 @@ class DebugDataOptionsViewModelImpl } } - //region Private - private fun observeEncryptedProteusStorageState() { - viewModelScope.launch { - globalDataStore.isEncryptedProteusStorageEnabled().collect { - state = state.copy(isEncryptedProteusStorageEnabled = it) - } - } - } - // If status is NoNeed, it means that the user has already been migrated in and older app version, // or it is a new install // this is why we check the existence of the database file diff --git a/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt b/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt index 107666d1d15..34b9c1ebdb6 100644 --- a/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt +++ b/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt @@ -79,7 +79,7 @@ fun ReactionOption( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceEvenly ) { - listOf("❤ī¸", "👍", "😁", "🙂", "☚ī¸", "👎").forEach { emoji -> + listOf("👍", "🙂", "❤ī¸", "☚ī¸", "👎").forEach { emoji -> CompositionLocalProvider( LocalMinimumInteractiveComponentSize provides Dp.Unspecified, ) { diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt index 9eeed0f3439..2d2d5711545 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt @@ -30,6 +30,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.text.input.TextFieldLineLimits import androidx.compose.foundation.text.input.TextFieldState import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon @@ -312,7 +313,8 @@ private fun MessageComposerTextInput( }, interactionSource = interactionSource, onSelectedLineIndexChanged = onSelectedLineIndexChanged, - onLineBottomYCoordinateChanged = onLineBottomYCoordinateChanged + onLineBottomYCoordinateChanged = onLineBottomYCoordinateChanged, + lineLimits = TextFieldLineLimits.Default, ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeScreen.kt index b4e763d20c8..d8d511dea8b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeScreen.kt @@ -109,7 +109,11 @@ private fun SelfQRCodeContent( val context = LocalContext.current BackHandler { - trackAnalyticsEvent(AnalyticsEvent.QrCode.Modal.Back) + trackAnalyticsEvent( + AnalyticsEvent.QrCode.Modal.Back( + isTeam = state.isTeamMember + ) + ) onBackClick() } @@ -118,7 +122,11 @@ private fun SelfQRCodeContent( WireCenterAlignedTopAppBar( title = stringResource(id = R.string.user_profile_qr_code_title), onNavigationPressed = { - trackAnalyticsEvent(AnalyticsEvent.QrCode.Modal.Back) + trackAnalyticsEvent( + AnalyticsEvent.QrCode.Modal.Back( + isTeam = state.isTeamMember + ) + ) onBackClick() }, elevation = 0.dp @@ -127,26 +135,26 @@ private fun SelfQRCodeContent( ) { internalPadding -> Column( modifier = - Modifier - .fillMaxSize() - .background(colorsScheme().background) - .padding(internalPadding), + Modifier + .fillMaxSize() + .background(colorsScheme().background) + .padding(internalPadding), horizontalAlignment = Alignment.CenterHorizontally ) { VerticalSpace.x24() Column( modifier = - Modifier - .padding(horizontal = dimensions().spacing16x) - .clip(RoundedCornerShape(dimensions().spacing8x)) - .fillMaxWidth() - .drawWithContent { - graphicsLayer.record { - this@drawWithContent.drawContent() + Modifier + .padding(horizontal = dimensions().spacing16x) + .clip(RoundedCornerShape(dimensions().spacing8x)) + .fillMaxWidth() + .drawWithContent { + graphicsLayer.record { + this@drawWithContent.drawContent() + } + drawLayer(graphicsLayer) } - drawLayer(graphicsLayer) - } - .background(Color.White), + .background(Color.White), horizontalAlignment = Alignment.CenterHorizontally ) { VerticalSpace.x16() @@ -159,14 +167,14 @@ private fun SelfQRCodeContent( Box( contentAlignment = Alignment.Center, modifier = - Modifier - .clip(CircleShape) - .border( - width = dimensions().spacing2x, - shape = CircleShape, - color = Color.White - ) - .background(colorsScheme().primary) + Modifier + .clip(CircleShape) + .border( + width = dimensions().spacing2x, + shape = CircleShape, + color = Color.White + ) + .background(colorsScheme().primary) ) { Icon( painter = painterResource(id = R.drawable.ic_launcher_foreground), @@ -203,10 +211,14 @@ private fun SelfQRCodeContent( color = colorsScheme().secondaryText ) Spacer(modifier = Modifier.weight(1f)) - ShareLinkButton(state.userAccountProfileLink, trackAnalyticsEvent) + ShareLinkButton(state.isTeamMember, state.userAccountProfileLink, trackAnalyticsEvent) VerticalSpace.x8() ShareQRCodeButton { - trackAnalyticsEvent(AnalyticsEvent.QrCode.Modal.ShareQrCode) + trackAnalyticsEvent( + AnalyticsEvent.QrCode.Modal.ShareQrCode( + isTeam = state.isTeamMember + ) + ) coroutineScope.launch { val bitmap = graphicsLayer.toImageBitmap() val qrUri = shareQRAssetClick(bitmap.asAndroidBitmap()) @@ -222,11 +234,11 @@ private fun SelfQRCodeContent( fun ShareQRCodeButton(shareQRAssetClick: () -> Unit) { WirePrimaryButton( modifier = - Modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.background) - .padding(horizontal = dimensions().spacing16x) - .testTag("Share QR link"), + Modifier + .fillMaxWidth() + .background(MaterialTheme.colorScheme.background) + .padding(horizontal = dimensions().spacing16x) + .testTag("Share QR link"), text = stringResource(R.string.user_profile_qr_code_share_image_link), onClick = shareQRAssetClick ) @@ -234,20 +246,25 @@ fun ShareQRCodeButton(shareQRAssetClick: () -> Unit) { @Composable private fun ShareLinkButton( + isTeamMember: Boolean, selfProfileUrl: String, trackAnalyticsEvent: (AnalyticsEvent.QrCode.Modal) -> Unit ) { val context = LocalContext.current WirePrimaryButton( modifier = - Modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.background) - .padding(horizontal = dimensions().spacing16x) - .testTag("Share link"), + Modifier + .fillMaxWidth() + .background(MaterialTheme.colorScheme.background) + .padding(horizontal = dimensions().spacing16x) + .testTag("Share link"), text = stringResource(R.string.user_profile_qr_code_share_link), onClick = { - trackAnalyticsEvent(AnalyticsEvent.QrCode.Modal.ShareProfileLink) + trackAnalyticsEvent( + AnalyticsEvent.QrCode.Modal.ShareProfileLink( + isTeam = isTeamMember + ) + ) context.shareLinkToProfile(selfProfileUrl) } ) diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeState.kt index 71f6312a0e6..7e48401a852 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeState.kt @@ -26,5 +26,6 @@ data class SelfQRCodeState( val handle: String = "", val userProfileLink: String = "", val userAccountProfileLink: String = "", - val hasError: Boolean = false + val hasError: Boolean = false, + val isTeamMember: Boolean = false ) diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModel.kt index b996715e0a9..1fcbe8409ec 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModel.kt @@ -56,13 +56,18 @@ class SelfQRCodeViewModel @Inject constructor( private val analyticsManager: AnonymousAnalyticsManager ) : ViewModel() { private val selfQrCodeNavArgs: SelfQrCodeNavArgs = savedStateHandle.navArgs() - var selfQRCodeState by mutableStateOf(SelfQRCodeState(selfUserId, handle = selfQrCodeNavArgs.handle)) + var selfQRCodeState by mutableStateOf( + SelfQRCodeState( + selfUserId, + handle = selfQrCodeNavArgs.handle, + isTeamMember = selfQrCodeNavArgs.isTeamMember + ) + ) private set private val cachePath: Path get() = kaliumFileSystem.rootCachePath init { - trackAnalyticsEvent(AnalyticsEvent.QrCode.Modal.Displayed) viewModelScope.launch { getServerLinks() } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQrCodeNavArgs.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQrCodeNavArgs.kt index 82770c884f8..fde971b7e15 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQrCodeNavArgs.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/qr/SelfQrCodeNavArgs.kt @@ -22,5 +22,6 @@ import kotlinx.parcelize.Parcelize @Parcelize data class SelfQrCodeNavArgs( - val handle: String = "" + val handle: String = "", + val isTeamMember: Boolean ) : Parcelable diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt index c562b1ba5dc..276f658ac33 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt @@ -153,7 +153,14 @@ fun SelfUserProfileScreen( }, onQrCodeClick = { viewModelSelf.trackQrCodeClick() - navigator.navigate(NavigationCommand(SelfQRCodeScreenDestination(viewModelSelf.userProfileState.userName))) + navigator.navigate( + NavigationCommand( + SelfQRCodeScreenDestination( + viewModelSelf.userProfileState.userName, + !viewModelSelf.userProfileState.teamName.isNullOrBlank() + ) + ) + ) }, onCreateAccount = { viewModelSelf.sendPersonalToTeamMigrationEvent() diff --git a/app/src/private/kotlin/com/wire/android/ExternalLoggerManager.kt b/app/src/private/kotlin/com/wire/android/ExternalLoggerManager.kt index cf0fe327944..f25fdd6ecc0 100644 --- a/app/src/private/kotlin/com/wire/android/ExternalLoggerManager.kt +++ b/app/src/private/kotlin/com/wire/android/ExternalLoggerManager.kt @@ -10,18 +10,15 @@ import com.datadog.android.rum.GlobalRum import com.datadog.android.rum.RumMonitor import com.datadog.android.rum.tracking.ActivityViewTrackingStrategy import com.datadog.android.rum.tracking.ComponentPredicate -import com.wire.android.datastore.GlobalDataStore import com.wire.android.ui.WireActivity import com.wire.android.util.sha256 -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.runBlocking import com.wire.android.util.getDeviceIdString private const val LONG_TASK_THRESH_HOLD_MS = 1000L object ExternalLoggerManager { - fun initDatadogLogger(context: Context, globalDataStore: GlobalDataStore) { + fun initDatadogLogger(context: Context) { val clientToken = BuildConfig.DATADOG_CLIENT_TOKEN val applicationId = BuildConfig.DATADOG_APP_ID @@ -59,12 +56,9 @@ object ExternalLoggerManager { .build() val credentials = Credentials(clientToken, environmentName, appVariantName, applicationId) - val extraInfo = mapOf( - "encrypted_proteus_storage_enabled" to runBlocking { globalDataStore.isEncryptedProteusStorageEnabled().first() } - ) Datadog.initialize(context, credentials, configuration, TrackingConsent.GRANTED) - Datadog.setUserInfo(id = context.getDeviceIdString()?.sha256(), extraInfo = extraInfo) + Datadog.setUserInfo(id = context.getDeviceIdString()?.sha256(), extraInfo = emptyMap()) GlobalRum.registerIfAbsent(RumMonitor.Builder().build()) } } diff --git a/app/src/test/kotlin/com/wire/android/ui/settings/debug/DebugDataOptionsViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/settings/debug/DebugDataOptionsViewModelTest.kt index b14eb1d1cdf..05524f16575 100644 --- a/app/src/test/kotlin/com/wire/android/ui/settings/debug/DebugDataOptionsViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/settings/debug/DebugDataOptionsViewModelTest.kt @@ -263,9 +263,6 @@ internal class DebugDataOptionsHiltArrangement { MockKAnnotations.init(this, relaxUnitFun = true) Dispatchers.setMain(UnconfinedTestDispatcher()) - every { - globalDataStore.isEncryptedProteusStorageEnabled() - } returns flowOf(true) coEvery { mlsKeyPackageCount() } returns MLSKeyPackageCountResult.Success(ClientId("clientId"), 1, false) diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModelTest.kt index 5c690d7398a..9c391ae86f9 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/qr/SelfQRCodeViewModelTest.kt @@ -61,7 +61,7 @@ class SelfQRCodeViewModelTest { coEvery { selfServerConfig.invoke() } returns SelfServerConfigUseCase.Result.Success( serverLinks = newServerConfig(1).copy(links = ServerConfig.STAGING) ) - every { savedStateHandle.navArgs() } returns SelfQrCodeNavArgs("handle") + every { savedStateHandle.navArgs() } returns SelfQrCodeNavArgs("handle", false) } fun arrange() = this to SelfQRCodeViewModel( diff --git a/core/analytics/src/main/kotlin/com/wire/android/feature/analytics/model/AnalyticsEvent.kt b/core/analytics/src/main/kotlin/com/wire/android/feature/analytics/model/AnalyticsEvent.kt index f05fa6d71d9..652130a177c 100644 --- a/core/analytics/src/main/kotlin/com/wire/android/feature/analytics/model/AnalyticsEvent.kt +++ b/core/analytics/src/main/kotlin/com/wire/android/feature/analytics/model/AnalyticsEvent.kt @@ -30,7 +30,7 @@ import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_CONVERSATION_SIZE import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_CONVERSATION_TYPE import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_END_REASON -import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_IS_TEAM_MEMBER +import com.wire.android.feature.analytics.model.AnalyticsEventConstants.IS_TEAM_MEMBER import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_ENDED_UNIQUE_SCREEN_SHARE import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_QUALITY_REVIEW_IGNORE_REASON import com.wire.android.feature.analytics.model.AnalyticsEventConstants.CALLING_QUALITY_REVIEW_IGNORE_REASON_KEY @@ -151,7 +151,7 @@ interface AnalyticsEvent { override fun toSegmentation(): Map { return mapOf( - CALLING_ENDED_IS_TEAM_MEMBER to metadata.isTeamMember, + IS_TEAM_MEMBER to metadata.isTeamMember, CALLING_ENDED_CALL_SCREEN_SHARE to metadata.callDetails.screenShareDurationInSeconds, CALLING_ENDED_UNIQUE_SCREEN_SHARE to metadata.callDetails.callScreenShareUniques, CALLING_ENDED_CALL_DIRECTION to metadata.toCallDirection(), @@ -257,39 +257,48 @@ interface AnalyticsEvent { } sealed class QrCode : AnalyticsEvent { + fun createSegmentationMap( + isTeam: Boolean + ): Map { + val userType = if (isTeam) { + QR_CODE_SEGMENTATION_USER_TYPE_TEAM + } else { + QR_CODE_SEGMENTATION_USER_TYPE_PERSONAL + } + + return mapOf( + AnalyticsEventConstants.QR_CODE_SEGMENTATION_USER_TYPE to userType, + IS_TEAM_MEMBER to isTeam, + ) + } + data class Click( val isTeam: Boolean ) : QrCode() { override val key: String = AnalyticsEventConstants.QR_CODE_CLICK - - override fun toSegmentation(): Map { - val userType = if (isTeam) { - QR_CODE_SEGMENTATION_USER_TYPE_TEAM - } else { - QR_CODE_SEGMENTATION_USER_TYPE_PERSONAL - } - - return mapOf( - AnalyticsEventConstants.QR_CODE_SEGMENTATION_USER_TYPE to userType - ) - } + override fun toSegmentation(): Map = createSegmentationMap(isTeam) } sealed class Modal : QrCode() { - data object Displayed : Modal() { - override val key: String = AnalyticsEventConstants.QR_CODE_MODAL - } - - data object Back : Modal() { + data class Back( + val isTeam: Boolean + ) : Modal() { override val key: String = AnalyticsEventConstants.QR_CODE_MODAL_BACK + override fun toSegmentation(): Map = createSegmentationMap(isTeam) } - data object ShareProfileLink : Modal() { + data class ShareProfileLink( + val isTeam: Boolean + ) : Modal() { override val key: String = AnalyticsEventConstants.QR_CODE_SHARE_PROFILE_LINK + override fun toSegmentation(): Map = createSegmentationMap(isTeam) } - data object ShareQrCode : Modal() { + data class ShareQrCode( + val isTeam: Boolean + ) : Modal() { override val key: String = AnalyticsEventConstants.QR_CODE_SHARE_QR_CODE + override fun toSegmentation(): Map = createSegmentationMap(isTeam) } } } @@ -393,6 +402,8 @@ object AnalyticsEventConstants { const val TEAM_IS_TEAM = "team_is_team" const val APP_OPEN = "app.open" + const val IS_TEAM_MEMBER = "is_team_member" + /** * Calling */ @@ -412,7 +423,6 @@ object AnalyticsEventConstants { /** * Call ended */ - const val CALLING_ENDED_IS_TEAM_MEMBER = "is_team_member" const val CALLING_ENDED_CALL_SCREEN_SHARE = "call_screen_share_duration" const val CALLING_ENDED_UNIQUE_SCREEN_SHARE = "call_screen_share_unique" const val CALLING_ENDED_CALL_DIRECTION = "call_direction" @@ -455,7 +465,6 @@ object AnalyticsEventConstants { * Qr code */ const val QR_CODE_CLICK = "ui.QR-click" - const val QR_CODE_MODAL = "ui.share.profile" const val QR_CODE_MODAL_BACK = "user.back.share-profile" const val QR_CODE_SHARE_PROFILE_LINK = "user.share-profile" const val QR_CODE_SHARE_QR_CODE = "user.QR-code" diff --git a/default.json b/default.json index 3f0e58c7457..8d9ca499de9 100644 --- a/default.json +++ b/default.json @@ -7,7 +7,6 @@ "application_is_private_build": false, "development_api_enabled": false, "paginated_conversation_list_enabled": true, - "encrypt_proteus_storage": true, "analytics_enabled": true, "analytics_app_key": "4483f7a58ae3e70b3780319c4ccb5c88a037be49", "analytics_server_url": "https://countly.wire.com/" @@ -30,7 +29,6 @@ "default_backend_url_blacklist": "https://clientblacklist.wire.com/staging", "default_backend_url_website": "https://wire.com", "default_backend_title": "wire-staging", - "encrypt_proteus_storage": false, "analytics_enabled": false, "picture_in_picture_enabled": true, "analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438", @@ -53,7 +51,6 @@ "default_backend_url_blacklist": "https://clientblacklist.wire.com/staging", "default_backend_url_website": "https://wire.com", "default_backend_title": "wire-staging", - "encrypt_proteus_storage": true, "analytics_enabled": true, "picture_in_picture_enabled": true, "analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438", @@ -65,7 +62,6 @@ "logging_enabled": true, "application_is_private_build": true, "development_api_enabled": false, - "encrypt_proteus_storage": true, "analytics_enabled": true, "analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438", "analytics_server_url": "https://countly.wire.com/" @@ -76,7 +72,6 @@ "logging_enabled": true, "application_is_private_build": true, "development_api_enabled": false, - "encrypt_proteus_storage": true, "analytics_enabled": true, "picture_in_picture_enabled": true, "analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438", @@ -107,7 +102,6 @@ "force_constant_bitrate_calls": false, "ignore_ssl_certificates": false, "lower_keypackage_limit": false, - "encrypt_proteus_storage": false, "self_deleting_messages": true, "wipe_on_cookie_invalid": false, "wipe_on_device_removal": false, diff --git a/kalium b/kalium index 7456f22fa05..eb886e214a1 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 7456f22fa052bda1988aaea526109e229c52b458 +Subproject commit eb886e214a1346a65f65ade4f5163fb560793284