From 10849b5b65ab1628a634b91e84d27e4f142097a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Fri, 10 Nov 2023 13:42:48 +0100 Subject: [PATCH] Fix formatting --- .../compose/dialog/ContentBlockersInfoDialog.kt | 4 +--- .../mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt | 4 +--- .../mullvadvpn/compose/dialog/CustomPortDialog.kt | 4 +--- .../mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt | 4 +--- .../mullvadvpn/compose/dialog/DeviceRemovalDialog.kt | 4 +--- .../mullvad/mullvadvpn/compose/dialog/DnsDialog.kt | 4 +--- .../compose/dialog/LocalNetworkSharingInfoDialog.kt | 4 +--- .../mullvad/mullvadvpn/compose/dialog/MtuDialog.kt | 4 +--- .../compose/dialog/ObfuscationInfoDialog.kt | 9 +++++---- .../compose/dialog/QuantumResistanceInfoDialog.kt | 4 +--- .../mullvadvpn/compose/dialog/RedeemVoucherDialog.kt | 4 +--- .../compose/dialog/ReportProblemNoEmailDialog.kt | 4 +--- .../mullvadvpn/compose/screen/DeviceListScreen.kt | 2 +- .../mullvad/mullvadvpn/compose/screen/LoginScreen.kt | 1 - .../mullvad/mullvadvpn/compose/screen/MullvadApp.kt | 1 - .../mullvadvpn/compose/screen/OutOfTimeScreen.kt | 2 +- .../compose/screen/RedeemVoucherDialogScreen.kt | 2 +- .../mullvadvpn/compose/screen/ReportProblemScreen.kt | 2 +- .../mullvadvpn/compose/screen/SettingsScreen.kt | 2 +- .../mullvadvpn/compose/screen/WelcomeScreen.kt | 4 +--- .../mullvadvpn/compose/state/VpnSettingsUiState.kt | 1 - .../kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt | 2 +- .../mullvad/mullvadvpn/viewmodel/SplashViewModel.kt | 2 +- .../mullvadvpn/viewmodel/VpnSettingsViewModel.kt | 8 ++++---- .../mullvadvpn/viewmodel/ChangelogViewModelTest.kt | 11 +++-------- .../mullvad/mullvadvpn/lib/common/util/SdkUtils.kt | 1 - 26 files changed, 31 insertions(+), 63 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt index b077fb9db93e..145208ce165e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt @@ -8,9 +8,7 @@ import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.component.textResource -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ContentBlockersInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt index 9e681d764069..f58768d0c6ab 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt @@ -15,9 +15,7 @@ private fun PreviewCustomDnsInfoDialog() { CustomDnsInfoDialog(EmptyDestinationsNavigator) } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun CustomDnsInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt index f58155e3f22f..a0008fe30f0a 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt @@ -44,9 +44,7 @@ private fun PreviewCustomPortDialog() { } } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun CustomPortDialog( customPort: String, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt index cc7ac9bbcabd..0e1c315959a4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt @@ -7,9 +7,7 @@ import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun DeviceNameInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt index 98c47e955c6c..52d137b6b8ea 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceRemovalDialog.kt @@ -37,9 +37,7 @@ private fun PreviewShowDeviceRemovalDialog() { ) } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ShowDeviceRemovalDialog(onDismiss: () -> Unit, onConfirm: () -> Unit, device: Device) { AlertDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt index cd90cf069181..e407a743235d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt @@ -80,9 +80,7 @@ private fun PreviewDnsDialogEditAllowLanDisabled() { } } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun DnsDialog( stagedDns: StagedDns, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt index 5a7b06f7a6d0..ebe46b6050dd 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt @@ -16,9 +16,7 @@ private fun PreviewLocalNetworkSharingInfoDialog() { LocalNetworkSharingInfoDialog(EmptyDestinationsNavigator) } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun LocalNetworkSharingInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt index 9b98efe2fb21..eeae864942b0 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt @@ -33,9 +33,7 @@ private fun PreviewMtuDialog() { } } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun MtuDialog( mtuInitial: Int?, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt index 05d3207099f1..cf4db26e2e9b 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt @@ -15,10 +15,11 @@ private fun PreviewObfuscationInfoDialog() { ObfuscationInfoDialog(EmptyDestinationsNavigator) } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ObfuscationInfoDialog(navigator: DestinationsNavigator) { - InfoDialog(message = stringResource(id = R.string.obfuscation_info), onDismiss = navigator::navigateUp) + InfoDialog( + message = stringResource(id = R.string.obfuscation_info), + onDismiss = navigator::navigateUp + ) } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt index d0d98b5c6c5b..e7773ed0a382 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt @@ -15,9 +15,7 @@ private fun PreviewQuantumResistanceInfoDialog() { QuantumResistanceInfoDialog(EmptyDestinationsNavigator) } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun QuantumResistanceInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt index 06a9bce72968..cb2752c5f18e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt @@ -92,9 +92,7 @@ private fun PreviewRedeemVoucherDialogSuccess() { } } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun RedeemVoucherDialog( uiState: VoucherDialogUiState, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt index 0cd9f1a1426b..88fc8c8d92f4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt @@ -31,9 +31,7 @@ private fun PreviewReportProblemNoEmailDialog() { } } -@Destination( - style = DestinationStyle.Dialog::class -) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ReportProblemNoEmailDialog(onDismiss: () -> Unit, onConfirm: () -> Unit) { AlertDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt index 73dacd0f091a..d4ffeedf51de 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt @@ -31,9 +31,9 @@ import net.mullvad.mullvadvpn.compose.button.PrimaryButton import net.mullvad.mullvadvpn.compose.button.VariantButton import net.mullvad.mullvadvpn.compose.component.ListItem import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar -import net.mullvad.mullvadvpn.compose.dialog.ShowDeviceRemovalDialog import net.mullvad.mullvadvpn.compose.destinations.LoginDestination import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination +import net.mullvad.mullvadvpn.compose.dialog.ShowDeviceRemovalDialog import net.mullvad.mullvadvpn.compose.state.DeviceListItemUiState import net.mullvad.mullvadvpn.compose.state.DeviceListUiState import net.mullvad.mullvadvpn.lib.common.util.parseAsDateTime diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt index 05f229501962..1b4baf79bd6c 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt @@ -1,6 +1,5 @@ package net.mullvad.mullvadvpn.compose.screen -import android.util.Log import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.Image import androidx.compose.foundation.background diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt index 7e99333a889f..99eee64bc051 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt @@ -14,7 +14,6 @@ import kotlinx.coroutines.flow.map import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.destinations.ChangelogDestination import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination import net.mullvad.mullvadvpn.viewmodel.ChangelogViewModel import org.koin.androidx.compose.koinViewModel diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt index c1e3ca391dac..0f2bdfcad7f1 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt @@ -34,11 +34,11 @@ import net.mullvad.mullvadvpn.compose.button.RedeemVoucherButton import net.mullvad.mullvadvpn.compose.button.SitePaymentButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBarAndDeviceName import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar -import net.mullvad.mullvadvpn.compose.extensions.createOpenAccountPageHook import net.mullvad.mullvadvpn.compose.destinations.AccountDestination import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination import net.mullvad.mullvadvpn.compose.destinations.RedeemVoucherDestination import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination +import net.mullvad.mullvadvpn.compose.extensions.createOpenAccountPageHook import net.mullvad.mullvadvpn.compose.state.OutOfTimeUiState import net.mullvad.mullvadvpn.constant.IS_PLAY_BUILD import net.mullvad.mullvadvpn.lib.theme.AppTheme diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/RedeemVoucherDialogScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/RedeemVoucherDialogScreen.kt index 0fc1ab1c301f..ffb416efe22a 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/RedeemVoucherDialogScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/RedeemVoucherDialogScreen.kt @@ -10,8 +10,8 @@ import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.compose.NavGraphs -import net.mullvad.mullvadvpn.compose.dialog.RedeemVoucherDialog import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination +import net.mullvad.mullvadvpn.compose.dialog.RedeemVoucherDialog import net.mullvad.mullvadvpn.compose.state.VoucherDialogUiState import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.viewmodel.VoucherDialogViewModel diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt index 593d3594ba79..cf0b794baeb9 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt @@ -38,8 +38,8 @@ import net.mullvad.mullvadvpn.compose.button.VariantButton import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicatorLarge import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.dialog.ReportProblemNoEmailDialog import net.mullvad.mullvadvpn.compose.destinations.ViewLogsDestination +import net.mullvad.mullvadvpn.compose.dialog.ReportProblemNoEmailDialog import net.mullvad.mullvadvpn.compose.textfield.mullvadWhiteTextFieldColors import net.mullvad.mullvadvpn.compose.transitions.SlideInFromRightTransition import net.mullvad.mullvadvpn.dataproxy.SendProblemReportResult diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt index a0926740fb12..11bf065e36ef 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt @@ -26,10 +26,10 @@ import net.mullvad.mullvadvpn.compose.cell.NavigationCellBody import net.mullvad.mullvadvpn.compose.cell.NavigationComposeCell import net.mullvad.mullvadvpn.compose.component.NavigateBackDownIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.extensions.itemWithDivider import net.mullvad.mullvadvpn.compose.destinations.ReportProblemDestination import net.mullvad.mullvadvpn.compose.destinations.SplitTunnelingDestination import net.mullvad.mullvadvpn.compose.destinations.VpnSettingsDestination +import net.mullvad.mullvadvpn.compose.extensions.itemWithDivider import net.mullvad.mullvadvpn.compose.state.SettingsUiState import net.mullvad.mullvadvpn.compose.test.LAZY_LIST_TEST_TAG import net.mullvad.mullvadvpn.compose.transitions.SettingsTransition diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt index 220105546ecb..ee485bd18e9d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt @@ -95,9 +95,7 @@ fun Welcome(navigator: DestinationsNavigator) { openConnectScreen = { navigator.navigate(ConnectDestination) { popUpTo(NavGraphs.root) { inclusive = true } } }, - navigateToDeviceInfoDialog = { - navigator.navigate(DeviceNameInfoDialogDestination) - } + navigateToDeviceInfoDialog = { navigator.navigate(DeviceNameInfoDialogDestination) } ) } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/VpnSettingsUiState.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/VpnSettingsUiState.kt index 1f19308f892f..84caa48d9b74 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/VpnSettingsUiState.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/VpnSettingsUiState.kt @@ -61,7 +61,6 @@ interface VpnSettingsDialog { data class Dns(val stagedDns: StagedDns) : VpnSettingsDialog - data class WireguardPortInfo(val availablePortRanges: List = emptyList()) : VpnSettingsDialog diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt index 89048ba6e980..0b744df51b3e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt @@ -67,7 +67,6 @@ open class MainActivity : ComponentActivity() { serviceConnectionManager.onVpnPermissionResult(resultCode == Activity.RESULT_OK) } - override fun onStart() { super.onStart() @@ -75,6 +74,7 @@ open class MainActivity : ComponentActivity() { initializeStateHandlerAndServiceConnection() } } + override fun onStop() { Log.d("mullvad", "Stopping main activity") super.onStop() 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 d6effb6f1d50..64d7aaa2d9c1 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 @@ -3,7 +3,6 @@ package net.mullvad.mullvadvpn.viewmodel import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import androidx.lifecycle.viewmodel.compose.viewModel import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.flow.filterNotNull @@ -32,6 +31,7 @@ class SplashViewModel( } } } + private suspend fun getStartDestination(): SplashUiSideEffect = deviceRepository.deviceState .map { deviceState -> diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt index 0f798a794216..75177b7f7326 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt @@ -64,11 +64,11 @@ class VpnSettingsViewModel( isLocalNetworkSharingEnabled = settings?.allowLan ?: false, isCustomDnsEnabled = settings?.isCustomDnsEnabled() ?: false, customDnsList = settings?.addresses()?.asStringAddressList() ?: listOf(), - contentBlockersOptions = - settings?.contentBlockersSettings() ?: DefaultDnsOptions(), + contentBlockersOptions = settings?.contentBlockersSettings() + ?: DefaultDnsOptions(), isAllowLanEnabled = settings?.allowLan ?: false, - selectedObfuscation = - settings?.selectedObfuscationSettings() ?: SelectedObfuscation.Off, + selectedObfuscation = settings?.selectedObfuscationSettings() + ?: SelectedObfuscation.Off, dialogState = dialogState, quantumResistant = settings?.quantumResistant() ?: QuantumResistantState.Off, selectedWireguardPort = settings?.getWireguardPort() ?: Constraint.Any(), diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ChangelogViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ChangelogViewModelTest.kt index fdf0e7060c27..e00bf36869ec 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ChangelogViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ChangelogViewModelTest.kt @@ -1,6 +1,5 @@ package net.mullvad.mullvadvpn.viewmodel -import app.cash.turbine.test import io.mockk.MockKAnnotations import io.mockk.Runs import io.mockk.every @@ -8,14 +7,13 @@ import io.mockk.impl.annotations.MockK import io.mockk.just import io.mockk.mockkStatic import io.mockk.unmockkAll -import kotlin.test.assertEquals +import kotlin.test.assertNotNull import kotlin.test.assertNull import kotlinx.coroutines.test.runTest import net.mullvad.mullvadvpn.repository.ChangelogRepository import org.junit.After import org.junit.Before import org.junit.Test -import kotlin.test.assertNotNull class ChangelogViewModelTest { @@ -52,20 +50,17 @@ class ChangelogViewModelTest { @Test fun testNotUpToDateVersionCode() = runTest { // Arrange - every { mockedChangelogRepository.getVersionCodeOfMostRecentChangelogShowed() } returns - -1 + every { mockedChangelogRepository.getVersionCodeOfMostRecentChangelogShowed() } returns -1 every { mockedChangelogRepository.getLastVersionChanges() } returns listOf("bla", "bla") // Given a new version with a change log we should return it assertNotNull(viewModel.getChangeLog()) } - @Test fun testNotUpToDateVersionCodeWithEmptyChangeLog() = runTest { // Arrange - every { mockedChangelogRepository.getVersionCodeOfMostRecentChangelogShowed() } returns - -1 + every { mockedChangelogRepository.getVersionCodeOfMostRecentChangelogShowed() } returns -1 every { mockedChangelogRepository.getLastVersionChanges() } returns emptyList() // Given a new version with a change log we should not return it diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/SdkUtils.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/SdkUtils.kt index c7776b5da00d..eeaa395b6928 100644 --- a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/SdkUtils.kt +++ b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/SdkUtils.kt @@ -8,7 +8,6 @@ import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.os.Build import android.service.quicksettings.Tile -import android.widget.Toast object SdkUtils { // TODO Rework how pending intents work