Modern Apps git

← Modern-Apps.git

appstore: remove per-app ignore updates

Commit
0112d8e9fc21196c94a2a423d135bc26adbda656
Author
Vayun Mathur <[email protected]>
When
2026-10-31 22:31 UTC (1 month ago)
Parents
05c6b85
Drop the manual ignore toggle (detail page, update rows, ignored section
on phone and TV) and its persisted set. Update all still skips apps this
store did not install or own updates for; that is now the only update
exclusion.

Diff

appstore/src/main/java/com/vayunmathur/appstore/data/InstalledAppsRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/InstalledAppsRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/InstalledAppsRepository.ktindex 095cb4a1f2..75e76ab243 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/InstalledAppsRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/InstalledAppsRepository.kt@@ -68,7 +68,7 @@ class InstalledAppsRepository(private val context: Context) {     private fun PackageManager.readInstalledInfo(ai: ApplicationInfo): InstalledInfo? = try {         val pi = getPackageInfo(ai.packageName, 0)         // The OS fills this in for every install — including ones that predate the-        // skip/ignore feature — so no local history table needs backfilling (#885).+        // Update-all ownership check — so no local history table needs backfilling (#885).         // Null (adb installs, some system packages) never equals our package name,         // which is exactly the "not managed by us" signal the caller wants.         val source = runCatching { getInstallSourceInfo(ai.packageName) }.getOrNull()
appstore/src/main/java/com/vayunmathur/appstore/data/SettingsRepository.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/SettingsRepository.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/SettingsRepository.ktindex ecc2c3684b..e310c70d15 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/SettingsRepository.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/SettingsRepository.kt@@ -33,7 +33,6 @@ class SettingsRepository( ) {     private val _autoInstallUpdates = MutableStateFlow(DEFAULT_AUTO_INSTALL_UPDATES)     private val _enabledSources = MutableStateFlow(AppSource.DEFAULT_ENABLED)-    private val _ignoredUpdates = MutableStateFlow(emptySet<String>())      /**      * Whether the periodic update check may also download and install updates on its own,@@ -55,16 +54,6 @@ class SettingsRepository(      */     val enabledSources: StateFlow<Set<AppSource>> = _enabledSources.asStateFlow() -    /**-     * Packages the user asked never to be offered updates for (#885).-     *-     * Excluded from "Update all", the update count/badge, and update-     * notifications — but an explicit tap on the app's own Update button still-     * installs, so ignoring is never a dead end. Persisted as a plain string-     * set; an uninstalled package's entry is harmless and pruned on read.-     */-    val ignoredUpdates: StateFlow<Set<String>> = _ignoredUpdates.asStateFlow()-     init {         scope.launch {             context.settingsDataStore.data@@ -72,19 +61,10 @@ class SettingsRepository(                 .collect { prefs ->                     _autoInstallUpdates.value = prefs.autoInstallUpdates()                     _enabledSources.value = prefs.enabledSources()-                    _ignoredUpdates.value = prefs[KEY_IGNORED_UPDATES].orEmpty()                 }         }     } -    suspend fun setUpdateIgnored(packageName: String, ignored: Boolean) {-        context.settingsDataStore.edit { prefs ->-            val current = prefs[KEY_IGNORED_UPDATES].orEmpty()-            prefs[KEY_IGNORED_UPDATES] =-                if (ignored) current + packageName else current - packageName-        }-    }-     suspend fun setAutoInstallUpdates(enabled: Boolean) {         context.settingsDataStore.edit { it[KEY_AUTO_INSTALL_UPDATES] = enabled }     }@@ -112,12 +92,6 @@ class SettingsRepository(     /** One-shot read of [enabledSources], for the same cold-started callers. */     suspend fun readEnabledSources(): Set<AppSource> = read().enabledSources() -    /**-     * One-shot read of [ignoredUpdates], for the same cold-started callers — the-     * [UpdateCheckWorker] filters ignored packages out of notifications.-     */-    suspend fun readIgnoredUpdates(): Set<String> = read()[KEY_IGNORED_UPDATES].orEmpty()-     private suspend fun read(): Preferences =         context.settingsDataStore.data             .catch { e -> if (e is IOException) emit(emptyPreferences()) else throw e }@@ -146,7 +120,5 @@ class SettingsRepository(             booleanPreferencesKey("auto_install_updates")         private val KEY_DISABLED_SOURCES =             stringSetPreferencesKey("disabled_sources")-        private val KEY_IGNORED_UPDATES =-            stringSetPreferencesKey("ignored_updates")     } }
appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.ktindex 91df946b51..3e96b6d124 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateCheckWorker.kt@@ -105,9 +105,6 @@ class UpdateCheckWorker(             settings = SettingsRepository(context, scope),         )         val enabled = env.settings.readEnabledSources()-        // Ignored packages are excluded from the notification set the same way-        // the screens exclude them from the count and badge (#885).-        val ignored = env.settings.readIgnoredUpdates()          // Drop disabled sources' cached rows before the index is read: the last sync         // may predate the toggle, and nothing else purges on this path (#845).@@ -117,7 +114,6 @@ class UpdateCheckWorker(         if (AppSource.PLAYSTORE in enabled) env.play.restore()          val updates = collectUpdates(env, enabled)-            .filterNot { it.packageName in ignored }         reportUpdates(env, updates)          env.accrescent.shutdown()
appstore/src/main/java/com/vayunmathur/appstore/data/UpdateLists.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateLists.kt b/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateLists.ktindex e436733da8..e698730323 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateLists.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/data/UpdateLists.kt@@ -7,20 +7,15 @@ package com.vayunmathur.appstore.data  * tail partitions. [eligible] is what a bulk run attempts. [foreign] is newer  * versions of packages another store (or adb) installed — a bulk run skips  * these rather than spending a system confirmation dialog (or a doomed- * failure) on each one, but an explicit tap still installs them. [ignored] is- * what the user asked never to be offered; it is excluded everywhere except- * the ignored section that offers unignoring.+ * failure) on each one, but an explicit tap still installs them.  */ data class PartitionedUpdates(     val eligible: List<UnifiedApp> = emptyList(),     val foreign: List<UnifiedApp> = emptyList(),-    val ignored: List<UnifiedApp> = emptyList(), ) {     /**      * Everything the store may still draw as an update: the bulk run's targets-     * plus the individually-updatable foreign rows. Ignored packages are in-     * neither — that exclusion is what keeps them out of the count, the badge-     * and the notifications.+     * plus the individually-updatable foreign rows.      */     val actionable: List<UnifiedApp>         get() = (eligible + foreign).sortedBy { it.name.lowercase() }@@ -35,7 +30,6 @@ fun partitionUpdates(     pending: List<UnifiedApp>,     installed: Map<String, InstalledInfo>,     enabled: Set<AppSource>,-    ignoredPackages: Set<String>,     ownPackage: String, ): PartitionedUpdates {     val fresh = pending@@ -53,8 +47,7 @@ fun partitionUpdates(             app.versionCode > installedVersion         }         .sortedBy { it.name.lowercase() }-    val (ignoredList, rest) = fresh.partition { it.packageName in ignoredPackages }-    val (foreign, eligible) = rest.partition { app ->+    val (foreign, eligible) = fresh.partition { app ->         val info = installed.getValue(app.packageName)         !com.vayunmathur.appstore.domain.UpdateEligibility.installedByStore(             info.installerPackage,@@ -62,5 +55,5 @@ fun partitionUpdates(             ownPackage,         )     }-    return PartitionedUpdates(eligible = eligible, foreign = foreign, ignored = ignoredList)+    return PartitionedUpdates(eligible = eligible, foreign = foreign) }
appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreDetail.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreDetail.kt b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreDetail.ktindex 52cfbfd0f7..333e3696b6 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreDetail.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreDetail.kt@@ -37,7 +37,6 @@ import com.vayunmathur.library.tv.TvButton import com.vayunmathur.library.tv.TvDialog import com.vayunmathur.library.tv.TvEmptyState import com.vayunmathur.library.tv.TvInitialFocus-import com.vayunmathur.library.tv.TvSwitchRow import com.vayunmathur.library.tv.tvContentStart import com.vayunmathur.library.ui.IconBack import com.vayunmathur.library.ui.IconDelete@@ -68,7 +67,6 @@ fun TvStoreDetail(         onOpenInBrowser = viewModel::openInBrowser,         onOpenInPlayStore = viewModel::openInPlayStore,         onDismissFailure = viewModel::dismissInstallFailure,-        onSetIgnored = viewModel::setUpdateIgnored,         onBack = onBack,         modifier = modifier,     )@@ -84,7 +82,6 @@ internal fun TvStoreDetailScreen(     onOpenInBrowser: (String) -> Unit = {},     onOpenInPlayStore: (String) -> Unit = {},     onDismissFailure: (String) -> Unit = {},-    onSetIgnored: (String, Boolean) -> Unit = { _, _ -> },     onBack: () -> Unit = {}, ) {     val app = state.app@@ -118,7 +115,6 @@ internal fun TvStoreDetailScreen(                 onOpen = { onOpen(app.packageName) },                 onUninstall = { showUninstallConfirm = true },                 onDismissFailure = { onDismissFailure(app.packageName) },-                onSetIgnored = { onSetIgnored(app.packageName, it) },                 modifier = Modifier.weight(0.65f).fillMaxHeight(),             )             TvStoreDetailBody(@@ -165,7 +161,6 @@ private fun TvStoreDetailIdentity(     onOpen: () -> Unit,     onUninstall: () -> Unit,     onDismissFailure: () -> Unit,-    onSetIgnored: (Boolean) -> Unit,     modifier: Modifier = Modifier, ) {     val app = state.app ?: return@@ -257,42 +252,12 @@ private fun TvStoreDetailIdentity(                 onClick = onDismissFailure,             )         }-        // Per-app "ignore updates" (§885): same exclusion as the phone — Update-        // All, the count and notifications skip it, but Update above still works.-        TvStoreDetailIgnoreRow(-            appName = app.name,-            ignored = state.updateIgnored,-            visible = state.isInstalled,-            onSetIgnored = onSetIgnored,-        )         // Stats row: Size / Rated / Version, like the phone's facts row.         TvStoreDetailStats(app = app)         TvStoreVerificationLine(state = state)     } } -/**- * Per-app "ignore updates" toggle (§885). Its own function so the identity- * pane stays under the complexity cap: excluded from Update All, the count- * and notifications, but the Update button above still installs.- */-@Composable-private fun TvStoreDetailIgnoreRow(-    appName: String,-    ignored: Boolean,-    visible: Boolean,-    onSetIgnored: (Boolean) -> Unit,-    modifier: Modifier = Modifier,-) {-    if (!visible) return-    TvSwitchRow(-        headline = stringResource(R.string.detail_ignore_updates, appName),-        checked = ignored,-        onCheckedChange = onSetIgnored,-        supporting = stringResource(R.string.detail_ignore_updates_summary),-        modifier = modifier,-    )-}  /** Size / Rated / Version in whatever subset the source published. Like the phone. */ @Composable
appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreOps.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreOps.kt b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreOps.ktindex b53cfdc9a8..f74c71ba5b 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreOps.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreOps.kt@@ -183,7 +183,7 @@ internal fun TvStoreViewModel.checkForUpdatesImpl() {  * phone's `updateAllImpl`: concurrent system dialogs would bury the user in prompts,  * and failures are collected and summarised instead of one snackbar per app.  * Only the eligible batch runs — foreign installs stay listed for an explicit- * tap, ignored packages are excluded everywhere (#885).+ * tap (#885).  */ internal fun TvStoreViewModel.updateAllImpl() {     if (updateAllJob?.isActive == true) return
appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUiState.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUiState.kt b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUiState.ktindex 52e3280c2d..492fbafc44 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUiState.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUiState.kt@@ -71,8 +71,6 @@ data class TvDetailUiState(     val verification: VerificationResult? = null,     /** True while richer Play/Accrescent details are being fetched over the network. */     val isLoadingDetails: Boolean = false,-    /** True when the user asked never to be offered updates for this package (#885). */-    val updateIgnored: Boolean = false, ) {     val isInstalled: Boolean get() = installedInfo != null @@ -103,8 +101,6 @@ data class TvUpdatesUiState(     val updates: List<UnifiedApp> = emptyList(),     /** Newer versions of packages another store installed: listed, never bulk-run. */     val foreignUpdates: List<UnifiedApp> = emptyList(),-    /** Updates the user asked never to be offered: listed under their own header. */-    val ignoredUpdates: List<UnifiedApp> = emptyList(),     val installedIcons: Map<String, Drawable> = emptyMap(),     /** Currently-installed info per package, so the row can show old → new versions. */     val installedInfos: Map<String, InstalledInfo> = emptyMap(),
appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUpdates.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUpdates.kt b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUpdates.ktindex 7a7b076894..542380421d 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUpdates.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreUpdates.kt@@ -52,7 +52,6 @@ fun TvStoreUpdates(         onUpdateAll = viewModel::updateAll,         onInstall = viewModel::install,         onAppClick = onAppClick,-        onIgnore = viewModel::setUpdateIgnored,         modifier = modifier,     ) }@@ -65,7 +64,6 @@ internal fun TvStoreUpdatesScreen(     onUpdateAll: () -> Unit = {},     onInstall: (UnifiedApp) -> Unit = {},     onAppClick: (UnifiedApp) -> Unit = {},-    onIgnore: (String, Boolean) -> Unit = { _, _ -> }, ) {     val primaryFocus = remember { FocusRequester() }     val anyInstalling = state.stages.values.any { it !is InstallStage.Failed }@@ -84,7 +82,7 @@ internal fun TvStoreUpdatesScreen(     // Unkeyed: runs once per visit. Keying on the count would yank focus back to     // "Update all" every time a check completes or an update installs and drops off.     TvInitialFocus(primaryFocus)-    if (total == 0 && state.ignoredUpdates.isEmpty() && !state.isChecking) {+    if (total == 0 && !state.isChecking) {         TvEmptyState(             title = stringResource(R.string.all_apps_up_to_date),             body = stringResource(R.string.updates_empty_message),@@ -102,8 +100,6 @@ internal fun TvStoreUpdatesScreen(     // cannot live inside it.     val foreignTitle = stringResource(R.string.updates_foreign_title)     val foreignSubtitle = stringResource(R.string.updates_foreign_subtitle)-    val ignoredTitle = stringResource(R.string.updates_ignored_title)-    val ignoredSubtitle = stringResource(R.string.updates_ignored_subtitle)     TvGrid(columns = 3, modifier = modifier.fillMaxSize()) {         tvFullWidth(key = "header") {             TvScreenHeader(@@ -142,7 +138,6 @@ internal fun TvStoreUpdatesScreen(                 state = state,                 onAppClick = onAppClick,                 onInstall = { onInstall(app) },-                onIgnore = { onIgnore(app.packageName, true) },             )         }         if (state.foreignUpdates.isNotEmpty()) {@@ -157,24 +152,6 @@ internal fun TvStoreUpdatesScreen(                     state = state,                     onAppClick = onAppClick,                     onInstall = { onInstall(app) },-                    onIgnore = { onIgnore(app.packageName, true) },-                )-            }-        }-        if (state.ignoredUpdates.isNotEmpty()) {-            tvGridHeader(-                key = "ignored",-                title = ignoredTitle,-                subtitle = ignoredSubtitle,-            )-            items(state.ignoredUpdates, key = { "ignored-${it.packageName}" }) { app ->-                TvUpdateCard(-                    app = app,-                    state = state,-                    onAppClick = onAppClick,-                    onInstall = { onInstall(app) },-                    ignored = true,-                    onIgnore = { onIgnore(app.packageName, false) },                 )             }         }@@ -187,8 +164,6 @@ private fun TvUpdateCard(     state: TvUpdatesUiState,     onAppClick: (UnifiedApp) -> Unit,     onInstall: () -> Unit,-    ignored: Boolean = false,-    onIgnore: () -> Unit, ) {     val installed = state.installedInfos[app.packageName]     val old = installed?.let { info ->@@ -210,23 +185,16 @@ private fun TvUpdateCard(         stage = stage,         versionLabel = versionLabel,         trailing = {-            if (ignored) {-                TvButton(-                    text = stringResource(R.string.action_show_updates),-                    onClick = onIgnore,-                )-            } else {-                TvButton(-                    text = if (busy) {-                        stage.tvStageLabel()-                    } else {-                        stringResource(R.string.action_update)-                    },-                    onClick = { onInstall() },-                    primary = !busy,-                    enabled = !busy,-                )-            }+            TvButton(+                text = if (busy) {+                    stage.tvStageLabel()+                } else {+                    stringResource(R.string.action_update)+                },+                onClick = { onInstall() },+                primary = !busy,+                enabled = !busy,+            )         },     ) }
appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreViewModel.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreViewModel.kt b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreViewModel.ktindex f1b1b8deb9..d3dece61fa 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreViewModel.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/tv/TvStoreViewModel.kt@@ -124,8 +124,7 @@ class TvStoreViewModel(         ) { app, loading, installedPair -> Triple(app, loading, installedPair) },         installer.stages,         installer.verification,-        settings.ignoredUpdates,-    ) { appTriple, stages, verification, ignored ->+    ) { appTriple, stages, verification ->         val (app, loading, installedPair) = appTriple         val (installed, icons) = installedPair         val pkg = app?.packageName@@ -136,7 +135,6 @@ class TvStoreViewModel(             installedIcon = icons[pkg],             verification = verification[pkg],             isLoadingDetails = loading,-            updateIgnored = pkg != null && pkg in ignored,         )     }.stateIn(viewModelScope, SharingStarted.Eagerly, TvDetailUiState()) @@ -175,9 +173,8 @@ class TvStoreViewModel(      * Everything the TV updates hub draws.      *      * Same shape as the phone's `UpdatesUiState`: the merged update list plus the-     * installed versions behind it, so each row can show old → new. Ignored and-     * foreign partitions mirror the phone: Update All runs the eligible batch-     * only, and ignored rows surface under their own header with an unignore.+     * installed versions behind it, so each row can show old → new. The foreign+     * partition mirrors the phone: Update All runs the eligible batch only.      */     val updatesUi: StateFlow<TvUpdatesUiState> = combine(         combine(@@ -193,21 +190,18 @@ class TvStoreViewModel(         combine(isCheckingUpdatesFlow, lastUpdateCheckFlow, statusMessageFlow) { checking, checkedAt, message ->             Triple(checking, checkedAt, message)         },-        settings.ignoredUpdates,-    ) { pending, installedTriple, statusTriple, ignored ->+    ) { pending, installedTriple, statusTriple ->         val (installed, icons, stages) = installedTriple         val (checking, checkedAt, message) = statusTriple         val partitioned = partitionUpdates(             pending = pending,             installed = installed.associateBy { it.packageName },             enabled = enabledSourcesFlow.value,-            ignoredPackages = ignored,             ownPackage = context.packageName,         )         TvUpdatesUiState(             updates = partitioned.eligible,             foreignUpdates = partitioned.foreign,-            ignoredUpdates = partitioned.ignored,             installedIcons = icons,             installedInfos = installed.associateBy { it.packageName },             stages = stages,@@ -655,14 +649,6 @@ class TvStoreViewModel(         viewModelScope.launch { settings.setAutoInstallUpdates(enabled) }     } -    /**-     * Stop offering updates for [packageName] (or offer them again). Mirrors-     * the phone: ignored packages leave Update All, the count and the screen's-     * main list, and appear under the ignored header instead (#885).-     */-    fun setUpdateIgnored(packageName: String, ignored: Boolean) {-        viewModelScope.launch { settings.setUpdateIgnored(packageName, ignored) }-    }      /** Drop what a source had already contributed to the screens. Mirrors the phone. */     private fun forgetSource(source: AppSource) {
appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.ktindex 20de68b1e2..ff2797078b 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt@@ -29,10 +29,8 @@ import com.vayunmathur.library.ui.HorizontalDivider import com.vayunmathur.library.ui.IconDelete import com.vayunmathur.library.ui.IconDownload import com.vayunmathur.library.ui.IconGlobe-import com.vayunmathur.library.ui.IconVisibilityOff import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedButton-import com.vayunmathur.library.ui.SettingsSwitchRow import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.TextButton @@ -104,19 +102,6 @@ internal fun AppInstallActions(             )         } -        // Per-app "ignore updates" (§885): excluded from Update All, the count/-        // badge and notifications, but the Update button above still installs —-        // so ignoring is never a dead end.-        if (state.isInstalled) {-            SettingsSwitchRow(-                title = stringResource(R.string.detail_ignore_updates, app.name),-                checked = state.updateIgnored,-                onCheckedChange = { actions.setUpdateIgnored(app.packageName, it) },-                supportingText = stringResource(R.string.detail_ignore_updates_summary),-                leadingContent = { IconVisibilityOff() },-            )-        }-         StageProgress(stage)         if (stage is InstallStage.Failed) {             TextButton(onClick = { actions.dismissInstallFailure(app.packageName) }) {
appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.ktindex 8e9a226f4c..1c8b7e2760 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt@@ -30,14 +30,11 @@ import com.vayunmathur.appstore.util.UpdatesUiState import com.vayunmathur.library.ui.AppPullToRefreshBox import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.EmptyState-import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.IconCheck import com.vayunmathur.library.ui.IconDownload-import com.vayunmathur.library.ui.IconVisibilityOff import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TextButton  /** Binds [AppStoreViewModel] to the stateless [UpdatesScreen]. */ @Composable@@ -107,7 +104,7 @@ fun UpdatesScreen(                     )                 } -                if (total == 0 && state.ignoredUpdates.isEmpty()) {+                if (total == 0) {                     EmptyState(                         title = stringResource(R.string.all_apps_up_to_date),                         message = stringResource(R.string.updates_empty_message),@@ -118,58 +115,38 @@ fun UpdatesScreen(                         Modifier.fillMaxSize(),                         contentPadding = PaddingValues(bottom = 24.dp),                     ) {-                        if (total > 0) {-                            item("count") {-                                Text(-                                    pluralStringResource(-                                        R.plurals.updates_count,-                                        total,-                                        total,-                                    ),-                                    style = MaterialTheme.typography.titleSmall,-                                    modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),-                                )-                            }-                            items(state.updates, key = { it.packageName }) { app ->-                                UpdateRow(-                                    app = app,-                                    state = state,-                                    onAppClick = onAppClick,-                                    onInstall = { actions.install(app) },-                                    onIgnore = { actions.setUpdateIgnored(app.packageName, true) },-                                )-                            }-                            if (state.foreignUpdates.isNotEmpty()) {-                                item("foreign-header") {-                                    SectionHeader(-                                        title = stringResource(R.string.updates_foreign_title),-                                        subtitle = stringResource(R.string.updates_foreign_subtitle),-                                    )-                                }-                                items(state.foreignUpdates, key = { "foreign-${it.packageName}" }) { app ->-                                    UpdateRow(-                                        app = app,-                                        state = state,-                                        onAppClick = onAppClick,-                                        onInstall = { actions.install(app) },-                                        onIgnore = { actions.setUpdateIgnored(app.packageName, true) },-                                    )-                                }-                            }+                        item("count") {+                            Text(+                                pluralStringResource(+                                    R.plurals.updates_count,+                                    total,+                                    total,+                                ),+                                style = MaterialTheme.typography.titleSmall,+                                modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),+                            )                         }-                        if (state.ignoredUpdates.isNotEmpty()) {-                            item("ignored-header") {+                        items(state.updates, key = { it.packageName }) { app ->+                            UpdateRow(+                                app = app,+                                state = state,+                                onAppClick = onAppClick,+                                onInstall = { actions.install(app) },+                            )+                        }+                        if (state.foreignUpdates.isNotEmpty()) {+                            item("foreign-header") {                                 SectionHeader(-                                    title = stringResource(R.string.updates_ignored_title),-                                    subtitle = stringResource(R.string.updates_ignored_subtitle),+                                    title = stringResource(R.string.updates_foreign_title),+                                    subtitle = stringResource(R.string.updates_foreign_subtitle),                                 )                             }-                            items(state.ignoredUpdates, key = { "ignored-${it.packageName}" }) { app ->-                                IgnoredRow(+                            items(state.foreignUpdates, key = { "foreign-${it.packageName}" }) { app ->+                                UpdateRow(                                     app = app,                                     state = state,                                     onAppClick = onAppClick,-                                    onUnignore = { actions.setUpdateIgnored(app.packageName, false) },+                                    onInstall = { actions.install(app) },                                 )                             }                         }@@ -198,7 +175,6 @@ private fun UpdateRow(     state: UpdatesUiState,     onAppClick: (UnifiedApp) -> Unit,     onInstall: () -> Unit,-    onIgnore: () -> Unit, ) {     val stage = state.stages[app.packageName]     AppRow(@@ -209,14 +185,11 @@ private fun UpdateRow(         versionLabel = versionLabel(app, state),         onClick = { onAppClick(app) },         trailing = {-            Row(verticalAlignment = Alignment.CenterVertically) {-                IconButton(onClick = onIgnore) { IconVisibilityOff() }-                Button(-                    onClick = onInstall,-                    enabled = stage == null || stage is InstallStage.Failed,-                ) {-                    Text(stringResource(R.string.action_update))-                }+            Button(+                onClick = onInstall,+                enabled = stage == null || stage is InstallStage.Failed,+            ) {+                Text(stringResource(R.string.action_update))             }         },         // Library keys the same app with the same key, but the tabs are a@@ -226,29 +199,6 @@ private fun UpdateRow(     ) } -@Composable-private fun IgnoredRow(-    app: UnifiedApp,-    state: UpdatesUiState,-    onAppClick: (UnifiedApp) -> Unit,-    onUnignore: () -> Unit,-) {-    AppRow(-        app = app,-        isInstalled = true,-        stage = state.stages[app.packageName],-        installedIcon = state.installedIcons[app.packageName],-        versionLabel = versionLabel(app, state),-        onClick = { onAppClick(app) },-        trailing = {-            TextButton(onClick = onUnignore) {-                Text(stringResource(R.string.action_show_updates))-            }-        },-        sharedKey = null,-    )-}- @Composable private fun versionLabel(app: UnifiedApp, state: UpdatesUiState): String? {     val installed = state.installedInfos[app.packageName] ?: return null
appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUiContract.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUiContract.kt b/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUiContract.ktindex 062aac82d2..d7b955a984 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUiContract.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUiContract.kt@@ -105,8 +105,6 @@ data class AppDetailUiState(     val installedIcon: Drawable? = null,     /** True while richer details are being fetched over the network. */     val isLoadingDetails: Boolean = false,-    /** True when the user asked never to be offered updates for this package (#885). */-    val updateIgnored: Boolean = false, ) {     val isInstalled: Boolean get() = installedInfo != null @@ -123,12 +121,6 @@ data class UpdatesUiState(      * part of an Update All run (#885).      */     val foreignUpdates: List<UnifiedApp> = emptyList(),-    /**-     * Updates the user asked never to be offered. Listed under a collapsed-     * header so they can be unignored; excluded from Update All, the count,-     * the badge and notifications (#885).-     */-    val ignoredUpdates: List<UnifiedApp> = emptyList(),     val installedIcons: Map<String, Drawable> = emptyMap(),     /** Currently-installed info per package, so the row can show old → new versions. */     val installedInfos: Map<String, InstalledInfo> = emptyMap(),@@ -189,7 +181,6 @@ interface AppDetailActions : AppActions {     fun openInBrowser(url: String) {}     fun shareApp(app: UnifiedApp) {}     fun dismissInstallFailure(packageName: String) {}-    fun setUpdateIgnored(packageName: String, ignored: Boolean) {}      companion object {         val Noop: AppDetailActions = object : AppDetailActions {}@@ -200,7 +191,6 @@ interface AppDetailActions : AppActions { interface UpdatesActions : AppActions {     fun checkForUpdates() {}     fun updateAll() {}-    fun setUpdateIgnored(packageName: String, ignored: Boolean) {}      companion object {         val Noop: UpdatesActions = object : UpdatesActions {}
appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUpdateOps.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUpdateOps.kt b/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUpdateOps.ktindex f08917ae5b..a0371b6b0e 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUpdateOps.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreUpdateOps.kt@@ -107,7 +107,7 @@ internal fun AppStoreViewModel.updateAllImpl() {     if (updateAllJob?.isActive == true) return     updateAllJob = viewModelScope.launch {         // Eligible only: foreign installs are individually updatable but never-        // bulk-attempted, and ignored packages are excluded everywhere (#885).+        // bulk-attempted (#885).         val batch = partitionedUpdates.value.eligible         if (batch.isEmpty()) return@launch         val run = UpdateRun()
appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreViewModel.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreViewModel.kt b/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreViewModel.ktindex 8994957e20..a49bae7c89 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreViewModel.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/util/AppStoreViewModel.kt@@ -186,25 +186,15 @@ class AppStoreViewModel(         },         installedRepo.apps,         enabledSources,-        settings.ignoredUpdates,-    ) { pending, installed, enabled, ignored ->-        // Ignored packages are excluded here — before the count, badge and-        // notifications — but explicit taps still install via installImpl (#885).+    ) { pending, installed, enabled ->         partitionUpdates(             pending = pending,             installed = installed.associateBy { it.packageName },             enabled = enabled,-            ignoredPackages = ignored,             ownPackage = context.packageName,         ).actionable     }.stateIn(viewModelScope, SharingStarted.Eagerly, emptyList()) -    /**-     * Everything an update check found, including [PartitionedUpdates.ignored]:-     * the updates screen lists ignored rows under their own collapsed header so-     * the user can unignore them. Update All and the badge read [updates], which-     * excludes them.-     */     val partitionedUpdates: StateFlow<PartitionedUpdates> = combine(         combine(             catalogUpdatesFlow,@@ -215,13 +205,11 @@ class AppStoreViewModel(         },         installedRepo.apps,         enabledSources,-        settings.ignoredUpdates,-    ) { pending, installed, enabled, ignored ->+    ) { pending, installed, enabled ->         partitionUpdates(             pending = pending,             installed = installed.associateBy { it.packageName },             enabled = enabled,-            ignoredPackages = ignored,             ownPackage = context.packageName,         )     }.stateIn(viewModelScope, SharingStarted.Eagerly, PartitionedUpdates())@@ -326,8 +314,7 @@ class AppStoreViewModel(         isLoadingDetailsFlow,         chrome,         installer.verification,-        settings.ignoredUpdates,-    ) { app, loading, rows, verification, ignored ->+    ) { app, loading, rows, verification ->         val pkg = app?.packageName         AppDetailUiState(             app = app,@@ -336,7 +323,6 @@ class AppStoreViewModel(             stage = rows.stages[pkg],             installedIcon = rows.icons[pkg],             isLoadingDetails = loading,-            updateIgnored = pkg != null && pkg in ignored,         )     }.stateIn(viewModelScope, SharingStarted.Eagerly, AppDetailUiState()) @@ -350,7 +336,6 @@ class AppStoreViewModel(         UpdatesUiState(             updates = partitioned.eligible,             foreignUpdates = partitioned.foreign,-            ignoredUpdates = partitioned.ignored,             installedIcons = rows.icons,             installedInfos = rows.installed.associateBy { it.packageName },             stages = rows.stages,@@ -622,18 +607,6 @@ class AppStoreViewModel(      */     override fun updateAll() = updateAllImpl() -    /**-     * Stop offering updates for [packageName] (or offer them again).-     *-     * Ignored packages leave Update All, the count/badge and notifications, and-     * appear under the updates screen's own ignored header — but an explicit-     * tap on the app's Update button still installs, so ignoring is never a-     * dead end (#885).-     */-    override fun setUpdateIgnored(packageName: String, ignored: Boolean) {-        viewModelScope.launch { settings.setUpdateIgnored(packageName, ignored) }-    }-     /** Turn fully unattended (no-tap) background update installation on or off. */     fun setAutoInstallUpdates(enabled: Boolean) {         viewModelScope.launch { settings.setAutoInstallUpdates(enabled) }
appstore/src/main/res/values/strings.xml
diff --git a/appstore/src/main/res/values/strings.xml b/appstore/src/main/res/values/strings.xmlindex 1f7d6b4b1a..7187bedef4 100644--- a/appstore/src/main/res/values/strings.xml+++ b/appstore/src/main/res/values/strings.xml@@ -124,14 +124,6 @@         tap, never part of Update all. -->     <string name="updates_foreign_title">Installed elsewhere</string>     <string name="updates_foreign_subtitle">Update all skips these — tap Update on one to update it here.</string>-    <!-- Header over updates the user asked never to be offered, with a way back. -->-    <string name="updates_ignored_title">Ignored updates</string>-    <string name="updates_ignored_subtitle">These never count, notify or join Update all. Tap Show to offer one again.</string>-    <string name="action_ignore_updates">Ignore updates</string>-    <string name="action_show_updates">Show updates</string>-    <!-- Detail-page toggle. %1$s is the app name. -->-    <string name="detail_ignore_updates">Ignore updates for %1$s</string>-    <string name="detail_ignore_updates_summary">Skips Update all, the badge and notifications. You can still update from here.</string>      <!-- Install actions and progress. -->     <string name="action_install">Install</string>
appstore/src/test/java/com/vayunmathur/appstore/data/UpdateListsTest.kt
diff --git a/appstore/src/test/java/com/vayunmathur/appstore/data/UpdateListsTest.kt b/appstore/src/test/java/com/vayunmathur/appstore/data/UpdateListsTest.ktindex 9e88cfbbd9..c314268638 100644--- a/appstore/src/test/java/com/vayunmathur/appstore/data/UpdateListsTest.kt+++ b/appstore/src/test/java/com/vayunmathur/appstore/data/UpdateListsTest.kt@@ -34,12 +34,10 @@ class UpdateListsTest {             pending = listOf(app("a")),             installed = mapOf("a" to installed("a")),             enabled = enabled,-            ignoredPackages = emptySet(),             ownPackage = self,         )         assertEquals(listOf("a"), result.eligible.map { it.packageName })         assertTrue(result.foreign.isEmpty())-        assertTrue(result.ignored.isEmpty())     }      @Test@@ -54,40 +52,12 @@ class UpdateListsTest {                 "b" to installed("b", installer = self),             ),             enabled = enabled,-            ignoredPackages = emptySet(),             ownPackage = self,         )         assertEquals(listOf("b"), result.eligible.map { it.packageName })         assertEquals(listOf("a"), result.foreign.map { it.packageName })     } -    @Test-    fun `ignored apps are excluded everywhere and surfaced separately`() {-        val result = partitionUpdates(-            pending = listOf(app("a"), app("b")),-            installed = mapOf("a" to installed("a"), "b" to installed("b")),-            enabled = enabled,-            ignoredPackages = setOf("a"),-            ownPackage = self,-        )-        assertEquals(listOf("b"), result.eligible.map { it.packageName })-        assertEquals(listOf("a"), result.ignored.map { it.packageName })-    }--    @Test-    fun `ignored foreign app is ignored not foreign`() {-        val result = partitionUpdates(-            pending = listOf(app("a", AppSource.PLAYSTORE)),-            installed = mapOf("a" to installed("a", installer = "com.android.vending")),-            enabled = enabled,-            ignoredPackages = setOf("a"),-            ownPackage = self,-        )-        assertTrue(result.eligible.isEmpty())-        assertTrue(result.foreign.isEmpty())-        assertEquals(listOf("a"), result.ignored.map { it.packageName })-    }-     @Test     fun `stale and disabled-source rows are dropped before partitioning`() {         val result = partitionUpdates(@@ -97,12 +67,10 @@ class UpdateListsTest {             ),             installed = mapOf("stale" to installed("stale"), "disabled" to installed("disabled")),             enabled = setOf(AppSource.MODERN_APPS),-            ignoredPackages = emptySet(),             ownPackage = self,         )         assertTrue(result.eligible.isEmpty())         assertTrue(result.foreign.isEmpty())-        assertTrue(result.ignored.isEmpty())     }      @Test@@ -114,7 +82,6 @@ class UpdateListsTest {             pending = listOf(app("a")),             installed = mapOf("a" to info),             enabled = enabled,-            ignoredPackages = emptySet(),             ownPackage = self,         )         assertEquals(listOf("a"), result.eligible.map { it.packageName })