Skip to content

Conversation

@jamesarich
Copy link
Collaborator

This commit introduces the @ProcessLifecycle qualifier to disambiguate Lifecycle and LifecycleOwner dependency injections. This resolves an issue where @ActivityScoped bindings in MeshServiceClient were conflicting with the application-wide ProcessLifecycleOwner provider in ApplicationModule.

  • Created the @ProcessLifecycle qualifier annotation in the core.di package.
  • Updated ApplicationModule to provide LifecycleOwner and Lifecycle using the @ProcessLifecycle qualifier.
  • Annotated Lifecycle dependencies in RadioInterfaceService, UsbRepository, NodeRepository, and BluetoothRepository with @ProcessLifecycle to ensure they receive the application-level lifecycle.
  • Refactored MeshServiceClient to inject @ActivityContext Context instead of Activity, resolving the scope conflict and simplifying the code.

…ection

This commit introduces the `@ProcessLifecycle` qualifier to disambiguate `Lifecycle` and `LifecycleOwner` dependency injections. This resolves an issue where `@ActivityScoped` bindings in `MeshServiceClient` were conflicting with the application-wide `ProcessLifecycleOwner` provider in `ApplicationModule`.

- Created the `@ProcessLifecycle` qualifier annotation in the `core.di` package.
- Updated `ApplicationModule` to provide `LifecycleOwner` and `Lifecycle` using the `@ProcessLifecycle` qualifier.
- Annotated `Lifecycle` dependencies in `RadioInterfaceService`, `UsbRepository`, `NodeRepository`, and `BluetoothRepository` with `@ProcessLifecycle` to ensure they receive the application-level lifecycle.
- Refactored `MeshServiceClient` to inject `@ActivityContext Context` instead of `Activity`, resolving the scope conflict and simplifying the code.

Signed-off-by: James Rich <[email protected]>
@github-actions github-actions bot added the enhancement New feature or request label Dec 12, 2025
@jamesarich jamesarich added refactor no functional changes chore and removed enhancement New feature or request refactor no functional changes labels Dec 12, 2025
@jamesarich jamesarich added this pull request to the merge queue Dec 12, 2025
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.52%. Comparing base (5006fa3) to head (264864d).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...main/java/com/geeksville/mesh/MeshServiceClient.kt 0.00% 4 Missing ⚠️
...main/java/com/geeksville/mesh/ApplicationModule.kt 0.00% 2 Missing ⚠️
...e/mesh/repository/bluetooth/BluetoothRepository.kt 0.00% 1 Missing ⚠️
...lle/mesh/repository/radio/RadioInterfaceService.kt 0.00% 1 Missing ⚠️
...om/geeksville/mesh/repository/usb/UsbRepository.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3978      +/-   ##
========================================
- Coverage   0.52%   0.52%   -0.01%     
========================================
  Files        394     394              
  Lines      23170   23172       +2     
  Branches    2943    2944       +1     
========================================
  Hits         122     122              
- Misses     23027   23029       +2     
  Partials      21      21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Merged via the queue into meshtastic:main with commit d2b15c7 Dec 12, 2025
9 of 12 checks passed
@jamesarich jamesarich deleted the feat/inject-lifecycle branch December 12, 2025 14:40
@jamesarich jamesarich added this to the 2.7.10 milestone Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore refactor no functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant