Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8368219 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

test:4025: fix demo app after API upgrade.

parent 2d5ebd5a
Loading
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -29,12 +29,10 @@ import foundation.e.apps.installapp.AppLoungeConfiguration
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch

class MainActivity : ComponentActivity() {
    private val status = MutableStateFlow<String>("Not-connected")
    private val progress = MutableStateFlow<String>("Not-connected")
    private val installStatus = MutableStateFlow<String?>(null)
    private val appLoungeConfigurationFlow = MutableStateFlow<AppLoungeConfiguration?>(null)
    private var installJob: Job? = null
@@ -48,7 +46,7 @@ class MainActivity : ComponentActivity() {
                InstallAppScreen(
                    modifier = Modifier.padding(innerPadding),
                    appLoungeConfigurationFlow,
                    status,
                    progress,
                    installStatus,
                    ::installApp,
                    ::stopInstallApp
@@ -64,8 +62,9 @@ class MainActivity : ComponentActivity() {
        val appInstaller = AppInstaller(this)

        installJob = lifecycleScope.launch {
            appInstaller.status.map { status.value = it.name }.launchIn(lifecycleScope)
            installStatus.value = appInstaller.installByPackageName(packageName).name
            installStatus.value = appInstaller.installByPackageName(packageName, {
                progress.value = it.name
            }).name
        }
    }