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

This commit is contained in:
Mark Kim
2023-12-12 14:38:50 +00:00
committed by Android (Google) Code Review
5 changed files with 5 additions and 5 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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(

View File

@@ -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(

View File

@@ -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)