From a275b7b70bf6f3ba8394623ea8215e16a12b9928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Wed, 25 Oct 2023 14:30:29 +0200 Subject: [PATCH] Convert to val --- .../src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 f839472538fa..98b0c0576c37 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 @@ -9,7 +9,6 @@ import android.content.res.Configuration import android.net.VpnService import android.os.Bundle import android.util.Log -import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.runtime.collectAsState import androidx.compose.ui.platform.ComposeView @@ -57,7 +56,7 @@ import org.koin.android.ext.android.getKoin import org.koin.core.context.loadKoinModules open class MainActivity : FragmentActivity() { - private var requestNotificationPermissionLauncher: ActivityResultLauncher = + private val requestNotificationPermissionLauncher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { // NotificationManager.areNotificationsEnabled is used to check the state rather than // handling the callback value. @@ -174,7 +173,6 @@ open class MainActivity : FragmentActivity() { } private fun launchDeviceStateHandler(): Job { - return lifecycleScope.launch { launch { deviceRepository.deviceState