Skip to content
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

feat: Show team applock change dialog (WPB-4476) #2388

Merged
merged 34 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
37434b6
fix: app crash when user fails to unlock app with fingerprint
ohassine Oct 19, 2023
96ac249
Merge remote-tracking branch 'origin/develop' into develop
ohassine Oct 19, 2023
8f3e6eb
feat(appLock): adjust appLock to be handled correctly with other feat…
ohassine Oct 23, 2023
f70de8d
Merge remote-tracking branch 'origin/develop' into notifications_when…
ohassine Oct 23, 2023
198aa81
chore: detekt
ohassine Oct 23, 2023
8fd6940
chore: kalium reference
ohassine Oct 23, 2023
983f37a
Merge remote-tracking branch 'origin/develop' into notifications_when…
ohassine Oct 23, 2023
22e0127
Merge branch 'develop' into notifications_when_App_lock_is_on
ohassine Oct 24, 2023
a1958dd
feat: observe team app lock config
ohassine Oct 27, 2023
ad673ca
Merge remote-tracking branch 'origin/develop' into team_applock
ohassine Oct 27, 2023
8c1e0a3
chore: kalium reference
ohassine Oct 27, 2023
9c1e823
chore: pass timeout to app lock disabled status
ohassine Oct 27, 2023
640de6d
chore: detekt :)
ohassine Oct 27, 2023
9012111
feat: show team app lock change dialog
ohassine Oct 31, 2023
581306a
Merge remote-tracking branch 'origin/develop' into notifications_when…
ohassine Oct 31, 2023
8173e85
chore: kalium reference
ohassine Oct 31, 2023
5c25ae3
Merge branch 'notifications_when_App_lock_is_on' into show_team_applo…
ohassine Oct 31, 2023
acd4d3d
feat: show set app lock screen
ohassine Nov 1, 2023
d00cf29
Merge remote-tracking branch 'origin/develop' into show_team_applock_…
ohassine Nov 2, 2023
1a77eda
chore: detekt
ohassine Nov 2, 2023
feef673
chore: unit test
ohassine Nov 2, 2023
4471c33
Merge remote-tracking branch 'origin/develop' into show_team_applock_…
ohassine Nov 2, 2023
df749e7
fix: check session before using usecase
ohassine Nov 2, 2023
6aab2f4
chore: make context private
ohassine Nov 2, 2023
82fba4c
chore: cleanup
ohassine Nov 2, 2023
f706db1
chore: detekt
ohassine Nov 2, 2023
d4ace4e
feat: cleanup
ohassine Nov 2, 2023
ebc5f0f
feat: detekt
ohassine Nov 2, 2023
9ac94ea
Merge remote-tracking branch 'origin/develop' into show_team_applock_…
ohassine Nov 2, 2023
023b5ba
feat: kalium reference
ohassine Nov 2, 2023
a0c6e38
chore: cleanup
ohassine Nov 7, 2023
b6d1bd5
Merge remote-tracking branch 'origin/develop' into show_team_applock_…
ohassine Nov 7, 2023
b4fd6a4
chore: kalium reference
ohassine Nov 7, 2023
92296ee
chore: kalium reference
ohassine Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
72 changes: 61 additions & 11 deletions app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.runBlocking
import javax.inject.Inject
import javax.inject.Singleton

@Suppress("TooManyFunctions")
@Singleton
class GlobalDataStore @Inject constructor(@ApplicationContext private val context: Context) {
class GlobalDataStore @Inject constructor(@ApplicationContext val context: Context) {

Check warning on line 45 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L45

Added line #L45 was not covered by tests

companion object {
private const val PREFERENCES_NAME = "global_data"
Expand All @@ -52,8 +53,10 @@
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 IS_APP_LOCKED_BY_USER = booleanPreferencesKey("is_app_locked_by_user")
private val APP_LOCK_PASSCODE = stringPreferencesKey("app_lock_passcode")
private val APP_THEME_OPTION = stringPreferencesKey("app_theme_option")
private val TEAM_APP_LOCK_PASSCODE = stringPreferencesKey("team_app_lock_passcode")
val APP_THEME_OPTION = stringPreferencesKey("app_theme_option")
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = PREFERENCES_NAME)
private fun userMigrationStatusKey(userId: String): Preferences.Key<Int> = intPreferencesKey("user_migration_status_$userId")
private fun userDoubleTapToastStatusKey(userId: String): Preferences.Key<Boolean> =
Expand All @@ -67,7 +70,7 @@
context.dataStore.edit { it.clear() }
}

private fun getBooleanPreference(key: Preferences.Key<Boolean>, defaultValue: Boolean): Flow<Boolean> =
fun getBooleanPreference(key: Preferences.Key<Boolean>, defaultValue: Boolean): Flow<Boolean> =
context.dataStore.data.map { it[key] ?: defaultValue }

private fun getStringPreference(key: Preferences.Key<String>, defaultValue: String): Flow<String> =
Expand Down Expand Up @@ -141,43 +144,90 @@
suspend fun getShouldShowDoubleTapToast(userId: String): Boolean =
getBooleanPreference(userDoubleTapToastStatusKey(userId), true).first()

// returns a flow with decoded passcode
/**
* returns a flow with decoded passcode
*/
@Suppress("TooGenericExceptionCaught")
fun getAppLockPasscodeFlow(): Flow<String?> =
context.dataStore.data.map {
it[APP_LOCK_PASSCODE]?.let {
it[APP_LOCK_PASSCODE]?.let { passcode ->
try {
EncryptionManager.decrypt(APP_LOCK_PASSCODE.name, it)
EncryptionManager.decrypt(APP_LOCK_PASSCODE.name, passcode)
} catch (e: Exception) {
null
}
}
}

// returns a flow only informing whether the passcode is set, without the need to decode it
/**
* returns a flow only informing whether the passcode is set, without the need to decode it
*/
fun isAppLockPasscodeSetFlow(): Flow<Boolean> =
context.dataStore.data.map {
it.contains(APP_LOCK_PASSCODE)
}

fun isAppLockPasscodeSet(): Boolean = runBlocking {
context.dataStore.data.map {

Check warning on line 171 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L170-L171

Added lines #L170 - L171 were not covered by tests
it.contains(APP_LOCK_PASSCODE)
}.first()
}

Check warning on line 174 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L173-L174

Added lines #L173 - L174 were not covered by tests

fun isAppTeamPasscodeSetFlow(): Flow<Boolean> =
context.dataStore.data.map {

Check warning on line 177 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L177

Added line #L177 was not covered by tests
it.contains(TEAM_APP_LOCK_PASSCODE)
}

Check warning on line 179 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L179

Added line #L179 was not covered by tests

fun isAppTeamPasscodeSet(): Boolean = runBlocking {
context.dataStore.data.map {

Check warning on line 182 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L181-L182

Added lines #L181 - L182 were not covered by tests
it.contains(TEAM_APP_LOCK_PASSCODE)
}.first()
}

Check warning on line 185 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L184-L185

Added lines #L184 - L185 were not covered by tests

suspend fun clearAppLockPasscode() {
context.dataStore.edit {
it.remove(APP_LOCK_PASSCODE)
}
}
suspend fun clearTeamAppLockPasscode() {
context.dataStore.edit {
it.remove(TEAM_APP_LOCK_PASSCODE)
}
}

Check warning on line 196 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L194-L196

Added lines #L194 - L196 were not covered by tests

@Suppress("TooGenericExceptionCaught")
suspend fun setAppLockPasscode(passcode: String) {
private suspend fun setAppLockPasscode(
passcode: String,
key: Preferences.Key<String>
) {
context.dataStore.edit {
try {
val encrypted = EncryptionManager.encrypt(APP_LOCK_PASSCODE.name, passcode)
it[APP_LOCK_PASSCODE] = encrypted
val encrypted =
EncryptionManager.encrypt(key.name, passcode)
it[key] = encrypted

Check warning on line 207 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L205-L207

Added lines #L205 - L207 were not covered by tests
} catch (e: Exception) {
it.remove(APP_LOCK_PASSCODE)
it.remove(key)

Check warning on line 209 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L209

Added line #L209 was not covered by tests
}
}
}

suspend fun setTeamAppLock(
passcode: String,
key: Preferences.Key<String> = TEAM_APP_LOCK_PASSCODE
) {
setAppLockPasscode(passcode, key)
}

Check warning on line 219 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L218-L219

Added lines #L218 - L219 were not covered by tests

suspend fun setUserAppLock(
passcode: String,
key: Preferences.Key<String> = APP_LOCK_PASSCODE
) {
setAppLockPasscode(passcode, key)
}

Check warning on line 226 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L225-L226

Added lines #L225 - L226 were not covered by tests

fun isAppLockedByUserFlow(): Flow<Boolean> =
getBooleanPreference(IS_APP_LOCKED_BY_USER, false)

Check warning on line 229 in app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt#L229

Added line #L229 was not covered by tests
ohassine marked this conversation as resolved.
Show resolved Hide resolved

suspend fun setThemeOption(option: ThemeOption) {
context.dataStore.edit { it[APP_THEME_OPTION] = option.toString() }
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@ class UseCaseModule {
fun provideMarkGuestLinkFeatureFlagAsNotChangedUseCase(@KaliumCoreLogic coreLogic: CoreLogic, @CurrentAccount currentAccount: UserId) =
coreLogic.getSessionScope(currentAccount).markGuestLinkFeatureFlagAsNotChanged

@ViewModelScoped
@Provides
fun provideMarkTeamAppLockStatusAsNotifiedUseCase(@KaliumCoreLogic coreLogic: CoreLogic, @CurrentAccount currentAccount: UserId) =
coreLogic.getSessionScope(currentAccount).markTeamAppLockStatusAsNotified

@ViewModelScoped
@Provides
fun provideGetOtherUserSecurityClassificationLabelUseCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class KaliumConfigsModule {
wipeOnDeviceRemoval = BuildConfig.WIPE_ON_DEVICE_REMOVAL,
wipeOnRootedDevice = BuildConfig.WIPE_ON_ROOTED_DEVICE,
isWebSocketEnabledByDefault = isWebsocketEnabledByDefault(context),
certPinningConfig = BuildConfig.CERTIFICATE_PINNING_CONFIG
certPinningConfig = BuildConfig.CERTIFICATE_PINNING_CONFIG,
teamAppLock = BuildConfig.TEAM_APP_LOCK,
teamAppLockTimeout = BuildConfig.TEAM_APP_LOCK_TIMEOUT
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,59 @@
package com.wire.android.feature

import com.wire.android.datastore.GlobalDataStore
import com.wire.android.di.KaliumCoreLogic
import com.wire.kalium.logic.CoreLogic
import com.wire.kalium.logic.feature.applock.AppLockTeamFeatureConfigObserverImpl.Companion.DEFAULT_TIMEOUT
import com.wire.kalium.logic.feature.session.CurrentSessionResult
import com.wire.kalium.logic.feature.session.CurrentSessionUseCase
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.channelFlow
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combineTransform
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds

@Singleton
class ObserveAppLockConfigUseCase @Inject constructor(
private val globalDataStore: GlobalDataStore,
@KaliumCoreLogic private val coreLogic: CoreLogic,
private val currentSession: CurrentSessionUseCase
) {

operator fun invoke(): Flow<AppLockConfig> =
globalDataStore.isAppLockPasscodeSetFlow().map { // TODO: include checking if any logged account does not enforce app-lock
when {
it -> AppLockConfig.Enabled
else -> AppLockConfig.Disabled
operator fun invoke(): Flow<AppLockConfig> = channelFlow {
when (val currentSession = currentSession()) {
is CurrentSessionResult.Failure -> {
send(AppLockConfig.Disabled(DEFAULT_TIMEOUT))
}

is CurrentSessionResult.Success -> {
val userId = currentSession.accountInfo.userId
val appLockTeamFeatureConfigFlow =
coreLogic.getSessionScope(userId).appLockTeamFeatureConfigObserver

appLockTeamFeatureConfigFlow().combineTransform(
globalDataStore.isAppLockPasscodeSetFlow()
) { isAppLockedByTeam, isAppLocked ->
if (isAppLockedByTeam.isEnabled) {
emit(AppLockConfig.EnforcedByTeam(isAppLockedByTeam.timeout))
} else {
if (isAppLocked) {
emit(AppLockConfig.Enabled(isAppLockedByTeam.timeout))
} else {
emit(AppLockConfig.Disabled(isAppLockedByTeam.timeout))
}
}
}.collectLatest {
send(it)
}
}
}
}
}

sealed class AppLockConfig(open val timeout: Duration = DEFAULT_TIMEOUT) {
data object Disabled : AppLockConfig()
data object Enabled : AppLockConfig()
data class Disabled(override val timeout: Duration) : AppLockConfig(timeout)
data class Enabled(override val timeout: Duration) : AppLockConfig(timeout)
data class EnforcedByTeam(override val timeout: Duration) : AppLockConfig(timeout)

companion object {
val DEFAULT_TIMEOUT = 60.seconds
}
}
27 changes: 18 additions & 9 deletions app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.wire.android.navigation.rememberNavigator
import com.wire.android.ui.destinations.AppUnlockWithBiometricsScreenDestination
import com.wire.android.ui.destinations.EnterLockCodeScreenDestination
import com.wire.android.ui.destinations.SetLockCodeScreenDestination
import com.wire.android.ui.theme.WireTheme
import dagger.hilt.android.AndroidEntryPoint

Expand All @@ -37,19 +38,23 @@
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
WireTheme {
val canAuthenticateWithBiometrics = BiometricManager
.from(this)
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG)

val navigator = rememberNavigator(this@AppLockActivity::finish)

val startDestination =
if (canAuthenticateWithBiometrics == BiometricManager.BIOMETRIC_SUCCESS) {
appLogger.i("appLock: requesting app Unlock with biometrics")
AppUnlockWithBiometricsScreenDestination
if (intent.getBooleanExtra(SET_TEAM_APP_LOCK, false)) {
appLogger.i("appLock: requesting set team app lock")
SetLockCodeScreenDestination

Check warning on line 46 in app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt#L45-L46

Added lines #L45 - L46 were not covered by tests
} else {
appLogger.i("appLock: requesting app Unlock with passcode")
EnterLockCodeScreenDestination
val canAuthenticateWithBiometrics = BiometricManager
.from(this)
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG)

Check warning on line 50 in app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt#L48-L50

Added lines #L48 - L50 were not covered by tests
if (canAuthenticateWithBiometrics == BiometricManager.BIOMETRIC_SUCCESS) {
appLogger.i("appLock: requesting app Unlock with biometrics")
AppUnlockWithBiometricsScreenDestination

Check warning on line 53 in app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt#L52-L53

Added lines #L52 - L53 were not covered by tests
} else {
appLogger.i("appLock: requesting app Unlock with passcode")
EnterLockCodeScreenDestination

Check warning on line 56 in app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt#L55-L56

Added lines #L55 - L56 were not covered by tests
}
}

NavigationGraph(
Expand All @@ -59,4 +64,8 @@
}
}
}

companion object {
const val SET_TEAM_APP_LOCK = "set_team_app_lock"
}
}
29 changes: 29 additions & 0 deletions app/src/main/kotlin/com/wire/android/ui/WireActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,35 @@
)
}

if (shouldShowTeamAppLockDialog) {
TeamAppLockFeatureFlagDialog(
isTeamAppLockEnabled = isTeamAppLockEnabled,

Check warning on line 268 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L267-L268

Added lines #L267 - L268 were not covered by tests
onConfirm = {
featureFlagNotificationViewModel.dismissTeamAppLockDialog()

Check warning on line 270 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L270

Added line #L270 was not covered by tests
if (isTeamAppLockEnabled) {
val isUserAppLockSet =
featureFlagNotificationViewModel.isUserAppLockSet()

Check warning on line 273 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L272-L273

Added lines #L272 - L273 were not covered by tests
// No need to setup another app lock if the user already has one
if (!isUserAppLockSet) {
Intent(this@WireActivity, AppLockActivity::class.java)
.apply {
putExtra(AppLockActivity.SET_TEAM_APP_LOCK, true)
}.also {
startActivity(it)
}

Check warning on line 281 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L276-L281

Added lines #L276 - L281 were not covered by tests
} else {
featureFlagNotificationViewModel.markTeamAppLockStatusAsNot()

Check warning on line 283 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L283

Added line #L283 was not covered by tests
}
} else {
with(featureFlagNotificationViewModel) {
markTeamAppLockStatusAsNot()
clearTeamAppLockPasscode()
saleniuk marked this conversation as resolved.
Show resolved Hide resolved
}

Check warning on line 289 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L286-L289

Added lines #L286 - L289 were not covered by tests
}
}

Check warning on line 291 in app/src/main/kotlin/com/wire/android/ui/WireActivity.kt

View check run for this annotation

Codecov / codecov/patch

app/src/main/kotlin/com/wire/android/ui/WireActivity.kt#L291

Added line #L291 was not covered by tests
)
}

if (shouldShowSelfDeletingMessagesDialog) {
SelfDeletingMessagesDialog(
areSelfDeletingMessagesEnabled = areSelfDeletedMessagesEnabled,
Expand Down
21 changes: 21 additions & 0 deletions app/src/main/kotlin/com/wire/android/ui/WireActivityDialogs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,27 @@ fun GuestRoomLinkFeatureFlagDialog(
)
}

@Composable
fun TeamAppLockFeatureFlagDialog(
isTeamAppLockEnabled: Boolean,
onConfirm: () -> Unit,
) {
val text: String =
stringResource(id = if (isTeamAppLockEnabled) R.string.team_app_lock_enabled
else R.string.team_app_lock_disabled)

WireDialog(
title = stringResource(id = R.string.team_settings_changed),
text = text,
onDismiss = {},
optionButton1Properties = WireDialogButtonProperties(
onClick = onConfirm,
text = stringResource(id = R.string.label_ok),
type = WireDialogButtonType.Primary,
)
)
}

@Composable
fun UpdateAppDialog(shouldShow: Boolean, onUpdateClick: () -> Unit) {
if (shouldShow) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ fun WireDialog(
)
}

@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun WireDialog(
title: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ data class FeatureFlagState(
val isFileSharingEnabledState: Boolean = true,
val fileSharingRestrictedState: SharingRestrictedState? = null,
val shouldShowGuestRoomLinkDialog: Boolean = false,
val shouldShowTeamAppLockDialog: Boolean = false,
val isTeamAppLockEnabled: Boolean = false,
val isGuestRoomLinkEnabled: Boolean = true,
val shouldShowSelfDeletingMessagesDialog: Boolean = false,
val enforcedTimeoutDuration: SelfDeletionDuration = SelfDeletionDuration.None,
Expand Down