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

Commit d1a58b9b authored by Mark Kim's avatar Mark Kim
Browse files

Reload buttons on App Info page after app archiving.

Most of the buttons should become disabled after app archiving.

Test: n/a

Bug: 315770669
Change-Id: Ib94f8bbf94bb75e3ea9e09f6308a02e825317b52
parent e615b8fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ import kotlinx.coroutines.withContext
@Composable
fun AppBatteryPreference(app: ApplicationInfo) {
    val context = LocalContext.current
    val presenter = remember { AppBatteryPresenter(context, app) }
    val presenter = remember(app) { AppBatteryPresenter(context, app) }
    if (!presenter.isAvailable()) return

    Preference(object : PreferenceModel {
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ fun AppDataUsagePreference(
) {
    val context = LocalContext.current
    val coroutineScope = rememberCoroutineScope()
    val presenter = remember {
    val presenter = remember(app) {
        AppDataUsagePresenter(context, app, coroutineScope, networkTemplates, repositoryFactory)
    }
    if (!presenter.isAvailableFlow.collectAsStateWithLifecycle(initialValue = false).value) return
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ data class AppPermissionSummaryState(
@Composable
fun rememberAppPermissionSummary(app: ApplicationInfo): AppPermissionSummaryLiveData {
    val context = LocalContext.current
    return remember { AppPermissionSummaryLiveData(context, app) }
    return remember(app) { AppPermissionSummaryLiveData(context, app) }
}

class AppPermissionSummaryLiveData(
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import kotlinx.coroutines.Dispatchers
@Composable
fun AppTimeSpentPreference(app: ApplicationInfo) {
    val context = LocalContext.current
    val presenter = remember { AppTimeSpentPresenter(context, app) }
    val presenter = remember(app) { AppTimeSpentPresenter(context, app) }
    if (!presenter.isAvailable()) return

    val summary by presenter.summaryLiveData.observeAsState(
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ import kotlinx.coroutines.withContext
@Composable
fun HibernationSwitchPreference(app: ApplicationInfo) {
    val context = LocalContext.current
    val presenter = remember { HibernationSwitchPresenter(context, app) }
    val presenter = remember(app) { HibernationSwitchPresenter(context, app) }
    if (!presenter.isAvailable()) return

    val isEligibleState by presenter.isEligibleFlow.collectAsStateWithLifecycle(initialValue = false)