Skip to content

Handle disabled installed apps - #167

Merged
anod merged 4 commits into
masterfrom
fix/disabled-installed-state
Sep 29, 2026
Merged

anod merged 4 commits into
masterfrom
fix/disabled-installed-state

Conversation

@anod

@anod anod commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • detect Android's effective package-enabled state, including DISABLED_UNTIL_USED, and represent disabled installed apps with a distinct icon and "Installed but disabled" details
  • suppress update highlighting, update sections, notifications, and the Open action while an installed package is disabled
  • persistently clear stale update status on startup, package changes, and before sync so re-enabling cannot resurrect an obsolete update
  • keep watchlist paging generations internally consistent by snapshotting installed/enabled/version state and rejecting rows that change mid-generation
  • refresh list and details state for package enable/disable broadcasts
  • retain the existing DFE protocol after device identity, configuration, client metadata, and legacy-header comparisons found no safe change that reproduced private Play Store targeting

Validation

  • .\gradlew.bat :app:testDebugUnitTest :playstore:testAndroidHostTest ktlintCheck --no-daemon --console=plain
  • git diff --check
  • installed and launched the debug APK on a connected device; verified a disabled installed package is labeled correctly, excluded from update UI, and has no Open action
  • :app:lintDebug was also attempted earlier and remains blocked only by the pre-existing missing Hungarian/Russian no_document_provider translations

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 28, 2026 09:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

An unresolved moderate package-change scan issue and dependency-construction findings remain.

Review effort: Lite
Findings: 3 Low severity

Open (3)
What changed in this PR

This PR adds end-to-end handling for disabled installed Android apps, including UI state, update suppression, stale-status cleanup, paging consistency, and package-change refreshes.

Changes:

  • Detects effective enabled state, including DISABLED_UNTIL_USED.
  • Hides disabled apps from update actions, notifications, sections, and Open actions.
  • Adds disabled-app presentation, broadcast refreshes, snapshot validation, translations, and tests.

Review findings:

  • Moderate (1 vote): PackageRemovedReceiver.kt scans all updated rows on each package change; clear only the changed package.
  • Nit (4 votes): Require explicit packageEnabled dependencies in WatchListPagingSource.kt and InstalledPagingSource.kt.
  • Nit (2 votes): Require callers to explicitly pass the enabled state to IconsResources.kt.
File Description
app/​src/​test/​java/​com/​anod/​appwatcher/​watchlist/​WatchListPagingSourceRoomTest.kt Tests disabled filtering and paging snapshot consistency.
app/​src/​test/​java/​com/​anod/​appwatcher/​watchlist/​SectionItemTest.kt Updates section-item fixtures.
app/​src/​test/​java/​com/​anod/​appwatcher/​utils/​PackageEnabledStateTest.kt Tests effective package enabled-state resolution.
app/​src/​test/​java/​com/​anod/​appwatcher/​sync/​UpdateCheckVersionRollbackTest.kt Tests disabled-app update decisions.
app/​src/​test/​java/​com/​anod/​appwatcher/​details/​AppItemStateTest.kt Tests disabled-app presentation.
app/​src/​test/​java/​com/​anod/​appwatcher/​database/​AppListTableRoomTest.kt Updates database row-query fixtures.
app/​src/​test/​java/​com/​anod/​appwatcher/​database/​AppListTableQueriesTest.kt Tests snapshot ordering.
app/​src/​main/​res/​values/​strings.xml Adds default disabled-app strings.
app/​src/​main/​res/​values-ru/​strings.xml Adds Russian disabled-app translations.
app/​src/​main/​res/​values-hu/​strings.xml Adds Hungarian disabled-app translations.
app/​src/​main/​java/​com/​anod/​appwatcher/​watchlist/​WatchListStateViewModel.kt Refreshes watchlist state on startup and broadcasts.
app/​src/​main/​java/​com/​anod/​appwatcher/​watchlist/​WatchListPagingSource.kt Snapshots enabled state during paging.
app/​src/​main/​java/​com/​anod/​appwatcher/​watchlist/​WatchListPage.kt Renders disabled-app indicators.
app/​src/​main/​java/​com/​anod/​appwatcher/​watchlist/​SectionHeaderFactory.kt Excludes disabled apps from update sections.
app/​src/​main/​java/​com/​anod/​appwatcher/​watchlist/​Section.kt Carries enabled state in section items.
app/​src/​main/​java/​com/​anod/​appwatcher/​utils/​PackageEnabledState.kt Resolves package state and clears stale statuses.
app/​src/​main/​java/​com/​anod/​appwatcher/​sync/​UpdateCheck.kt Suppresses disabled-app updates and notifications.
app/​src/​main/​java/​com/​anod/​appwatcher/​model/​AppListFilter.kt Applies enabled-state-aware filtering.
app/​src/​main/​java/​com/​anod/​appwatcher/​installed/​PackageRemovedReceiver.kt Handles package-change broadcasts.
app/​src/​main/​java/​com/​anod/​appwatcher/​installed/​InstalledPagingSource.kt Propagates enabled state to installed items.
app/​src/​main/​java/​com/​anod/​appwatcher/​installed/​InstalledListViewModel.kt Refreshes the installed-app cache.
app/​src/​main/​java/​com/​anod/​appwatcher/​details/​DetailsViewModel.kt Refreshes package state and controls Open behavior.
app/​src/​main/​java/​com/​anod/​appwatcher/​details/​DetailsPanel.kt Displays disabled status and hides Open.
app/​src/​main/​java/​com/​anod/​appwatcher/​details/​AppItemState.kt Computes disabled-app presentation state.
app/​src/​main/​java/​com/​anod/​appwatcher/​database/​AppListTable.kt Adds snapshot queries and bulk status clearing.
app/​src/​main/​java/​com/​anod/​appwatcher/​compose/​IconsResources.kt Adds disabled installed-app icon support.
app/​src/​main/​AndroidManifest.xml Registers package-change broadcasts.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/src/main/java/com/anod/appwatcher/compose/IconsResources.kt Outdated
Comment thread app/src/main/java/com/anod/appwatcher/installed/InstalledPagingSource.kt Outdated
Comment thread app/src/main/java/com/anod/appwatcher/watchlist/WatchListPagingSource.kt Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 28, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

One or more issues must be addressed before approval.

Review effort: Lite
Findings: None

Resolved since last review (3)

Comment thread app/src/main/java/com/anod/appwatcher/installed/InstalledListViewModel.kt Outdated
Comment thread app/src/main/java/com/anod/appwatcher/installed/PackageRemovedReceiver.kt Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 28, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 28, 2026 20:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@anod
anod merged commit 98212e9 into master Sep 29, 2026
5 checks passed
@anod
anod deleted the fix/disabled-installed-state branch September 29, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants