Skip to content

build(android): drop Guava and purge notifee's residue on upgraded installs - #1890

Open
zancas wants to merge 2 commits into
devfrom
build/notifee-followup
Open

zancas wants to merge 2 commits into
devfrom
build/notifee-followup

Conversation

@zancas

@zancas zancas commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Follow-up to the review on #1888. Stacked on build/uninstall-notifee; the diff shows only this PR once #1888 lands.

What changes

  • android/app/build.gradle.kts: com.google.guava:guava leaves. com.google.guava:listenablefuture:1.0 takes its place, since BackgroundSyncWorker consumes the ListenableFuture that WorkManager returns and needs that one class on the compile classpath. A task per variant resolves the runtime classpath before preBuild and fails when Guava resolves or listenablefuture is absent.
  • android/app/proguard-rules.pro: the com.google.common.** keep and its dontwarn leave. The keep served Google Truth in the instrumentation APK. With no Guava in the app, AGP no longer excludes Guava from the test APK, and Truth brings its own copy.
  • NotifeeResidue.kt, called from MainApplication.onCreate: runs once per install, gated by a flag in the notifee_residue SharedPreferences file. It deletes the ironwood-migration notification channel, cancels every WorkManager job notifee enqueued by its two work tags app.notifee.core.NotificationManager.TRIGGER and app.notifee.core.BlockStateBroadcastReceiver.WORKER, and deletes notifee-core's Room database notifee_core_database. The names come from the notifee-core AAR of 202108261754, which holds no SharedPreferences of its own.
  • AGENTS.md: the doc-comment rule now reads as a bulleted list of side effects and doc-tests, the rule in force since 2026-10-02.

Tests

Each test failed before its fix and passes after it.

  • NotifeeResidueTest: the purge removes the channel, the two work tags and the database through its hooks, then marks the ledger. A recorded purge touches nothing.
  • verify<Variant>GuavaAbsent: fails with Guava resolves on the prodRelease runtime classpath when guava is declared beside listenablefuture, and passes without it.

Checked

  • ./gradlew :app:testProdReleaseUnitTest, ./gradlew buildHealth and ./gradlew :app:preProdDebugAndroidTestBuild pass.
  • prodReleaseRuntimeClasspath resolves listenablefuture:1.0 and no guava:guava. AGP constrains the androidTest classpath to the same listenablefuture version.

Needs CI

The offline device tests build the instrumentation APK and exercise Truth without the keep. The release APK build runs R8 without the com.google.common rules.

🤖 Generated with Claude Code

@zancas
zancas requested a review from juanky201271 November 9, 2026 00:31
zancas and others added 2 commits November 9, 2026 21:02
…stalls

Guava was on the classpath for notifee. BackgroundSyncWorker consumes
the ListenableFuture that WorkManager returns, and the standalone
listenablefuture jar provides that one class. With Guava gone, the
ProGuard keep for com.google.common goes with it. The keep existed for
Truth in the instrumentation APK, which now brings its own Guava
because the app no longer ships one.

An upgraded install keeps the notification channel of the private
migration and the WorkManager jobs notifee enqueued. MainApplication now
deletes the channel and cancels the jobs by notifee's two work tags on
every start.

Each change has a test that failed before it: a JVM test that the rest
of Guava is absent from the app classpath, a Jest test over the Gradle
and ProGuard files, and a JVM test of the purge through its two hooks.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ava at resolution

The purge now runs once per install. MainApplication reads a flag from
the notifee_residue SharedPreferences file and writes it after the
purge, which removes the NotificationManager and WorkManager calls from
every later start. The purge also deletes notifee-core's Room database,
notifee_core_database, which the AAR of 202108261754 names. That AAR
holds no SharedPreferences of its own.

A Gradle task per variant resolves the runtime classpath before preBuild
and fails when com.google.guava:guava resolves or listenablefuture is
absent. It replaces the Jest test over the Gradle and ProGuard text and
the JVM test over the unit-test classpath, which observed proxies for
the release artifact.

AGENTS.md now states the doc-comment rule in force since 2026-10-02: a
bulleted list of side effects and doc-tests, in place of the one
sentence rule it carried.

The residue test failed to compile before the change and the Gradle
check failed with Guava declared beside listenablefuture. Both pass on
the committed tree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@zancas
zancas force-pushed the build/notifee-followup branch from 47e462b to e160fe8 Compare November 10, 2026 05:08
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