Conversation
The two workers now use WorkManager's default (Context, WorkerParameters) constructor and get their use case from WorkerEntryPoint, so WorkManager can use its default initializer and worker factory. Remove the custom WorkManagerInitializer, its Dagger component, the startup provider manifest, androidx.hilt:hilt-work and its compiler, and the redundant KSP plugin declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Upxj1FvQeDpycupKdPQHUZ
fornewid
force-pushed
the
remove-hilt-worker
branch
from
October 4, 2026 04:10
448031c to
fbd2372
Compare
Member
Author
|
Closing: this change wasn't requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AndroidX HiltWorker is replaced with a Hilt entry point, which also removes the custom WorkManager setup it needed.
SyncOpenDateWorkerandAnnounceOpenDateWorkeruse WorkManager's default(Context, WorkerParameters)constructor and get their use case fromWorkerEntryPoint(renamed fromInitializerDependencies).WorkManagerInitializer,InitializerComponentand the module manifest (the androidx.startup provider config) are removed.androidx.hilt:hilt-work,ksp androidx.hilt:hilt-compilerand their catalog entries are removed, along with the redundantid "com.google.devtools.ksp"(moop.android.hiltalready applies KSP).Baselines
androidx.hilt:hilt-commonandandroidx.hilt:hilt-work.-keepnames @androidx.hilt.work.HiltWorker class * extends androidx.work.ListenableWorker. The default factory instantiates workers by class name, and work-runtime's own rules (-keepnames class * extends androidx.work.ListenableWorker,public <init>(...)) still keep the names and constructors it needs. R8's seeds for the release build list both workers and their(Context, WorkerParameters)constructors.Verification
MainViewModelschedules both periodic works. A temporary one-time enqueue (not committed) ran both workers, and both ended withWorker result SUCCESS.:app:minifyReleaseWithR8keeps both worker classes unobfuscated, with their constructors../gradlew :app:assembleDebug dependencyGuard manifestShield proguardShieldFast moduleRulespasses, and the manifestShield and module-rules baselines are unchanged.π€ Generated with Claude Code
https://claude.ai/code/session_01Upxj1FvQeDpycupKdPQHUZ