Skip to content

feat(launcher): refresh drawer and eBoard on package changes - #65

Merged
thypon merged 1 commit into
masterfrom
feat/package-change-refresh
Nov 20, 2026
Merged

thypon merged 1 commit into
masterfrom
feat/package-change-refresh

Conversation

@thypon

@thypon thypon commented Nov 20, 2026

Copy link
Copy Markdown
Owner

What

The drawer, home slot links and eBoard widgets kept stale state until the launcher was relaunched. Now a runtime-registered BroadcastReceiver for the PACKAGE_ADDED / PACKAGE_REMOVED / PACKAGE_REPLACED system broadcasts keeps everything truthful immediately:

  • Drawer: re-queries the package manager and notifies the adapter on any package change. Updates (REMOVED with EXTRA_REPLACING followed by REPLACED) refresh once, on the final broadcast, so the drawer does not flicker mid-update.
  • eBoard: uninstalling an app drops the widgets bound from that app's provider and releases the appWidgetIds (DashboardActivity.removeWidgetsOfPackage), mirroring the existing manual-remove path.
  • Home screen: slots pointing at an uninstalled package fall back to the default "App" placeholder and their assignment prefs are cleared.
  • Fixes along the way: loadApps() no longer accumulates duplicate names in appNames, and changeLayout notifies the adapter after reloading apps (the drawer view previously never refreshed on reopen).

Why runtime registration

Manifest-declared PACKAGE_* receivers are not delivered to apps targeting API 34; a runtime registerReceiver for these system broadcasts is the supported pattern.

Test plan

  • New BDD feature package_changes.feature (red → green), 5 scenarios: install / uninstall / update while the drawer is open, home-slot reset on uninstall, widget removal on uninstall.
  • ./gradlew check green locally: full Cucumber + unit suite, JaCoCo 80% coverage gate, lint.

The drawer, home slot links and eBoard widgets kept stale state until
the launcher was relaunched. Register a runtime receiver for the
PACKAGE_ADDED/REMOVED/REPLACED system broadcasts: re-query the package
manager and notify the drawer adapter, drop the widgets of an
uninstalled provider, and fall unassigned home slots back to "App".
@thypon
thypon force-pushed the feat/package-change-refresh branch from b615beb to 072d284 Compare November 20, 2026 01:09
@thypon
thypon merged commit 07d33c1 into master Nov 20, 2026
5 checks passed
@thypon
thypon deleted the feat/package-change-refresh branch November 20, 2026 01:21
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.

1 participant