diff options
| author | David Göransson <david.goransson@mullvad.net> | 2024-10-02 11:20:08 +0200 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2024-10-03 08:52:02 +0200 |
| commit | 029895582400827c4fe17ade882dd62bfd90f077 (patch) | |
| tree | 76694246a0ac93bfa3733b63fdf3d6773720fb28 /android/app | |
| parent | b573512e59cdfd455c182843319bf0df819aa621 (diff) | |
| download | mullvadvpn-029895582400827c4fe17ade882dd62bfd90f077.tar.xz mullvadvpn-029895582400827c4fe17ade882dd62bfd90f077.zip | |
Remove free compiler args
Diffstat (limited to 'android/app')
4 files changed, 7 insertions, 3 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c70a97f3ae..979eb466e2 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -140,8 +140,6 @@ android { allWarningsAsErrors = true freeCompilerArgs = listOf( - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi", // Opt-in option for Koin annotation of KoinComponent. "-opt-in=kotlin.RequiresOptIn", ) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt index 209c213feb..8fd97dc63d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt @@ -1,6 +1,7 @@ package net.mullvad.mullvadvpn.usecase import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted @@ -53,6 +54,7 @@ class OutOfTimeUseCase( ?.isCausedByExpiredAccount() ?: false } + @OptIn(ExperimentalCoroutinesApi::class) private fun pastAccountExpiry(): Flow<Boolean?> = repository.accountData .flatMapLatest { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/FlowUtils.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/FlowUtils.kt index c25e71ef9c..200502dee4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/FlowUtils.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/FlowUtils.kt @@ -3,6 +3,7 @@ package net.mullvad.mullvadvpn.util import kotlinx.coroutines.Deferred +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow inline fun <T1, T2, T3, T4, T5, T6, R> combine( @@ -28,6 +29,7 @@ inline fun <T1, T2, T3, T4, T5, T6, R> combine( } } +@OptIn(ExperimentalCoroutinesApi::class) fun <T> Deferred<T>.getOrDefault(default: T) = try { getCompleted() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt index 9a0d9cdeff..a196d4ae90 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt @@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.async import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -32,7 +33,7 @@ class SplashViewModel( splashCompleteRepository.onSplashCompleted() } - private val _uiState = MutableStateFlow<SplashScreenState>(SplashScreenState(false)) + private val _uiState = MutableStateFlow(SplashScreenState(false)) val uiState: StateFlow<SplashScreenState> = _uiState private suspend fun getStartDestination(): SplashUiSideEffect { @@ -61,6 +62,7 @@ class SplashViewModel( } // We know the user is logged in, but we need to find out if their account has expired + @OptIn(ExperimentalCoroutinesApi::class) private suspend fun getLoggedInStartDestination(): SplashUiSideEffect { val expiry = viewModelScope.async { accountRepository.accountData.filterNotNull().first() } |
