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

Commit deca917b authored by Mark Kim's avatar Mark Kim Committed by Android (Google) Code Review
Browse files

Merge "Reload buttons on App Info page after app archiving." into main

parents 7580dac4 d1a58b9b
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
@@ -54,7 +54,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)