mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
1.3 KiB
1.3 KiB
Implementation Plan - Extract RadioInterfaceService to KMP
Phase 1: Research & Abstraction
- Review
AndroidRadioInterfaceServiceandDesktopRadioInterfaceServiceto identify identical connection loop logic. - Identify platform-specific dependencies in both implementations (e.g., Android
BluetoothDevice, notifications). - Define shared abstractions (e.g.,
TransportFactory,NotificationDelegate) if needed to decouple platform-specific side effects.
Phase 2: Logic Extraction
- Create
SharedRadioInterfaceServiceincore:service/commonMain. - Move the core connection loop, state management, and retry logic into the shared service.
- Adapt Android and Desktop to use the new shared service.
Phase 3: Cleanup & Wiring
- Remove
DesktopRadioInterfaceService. - Refactor or remove
AndroidRadioInterfaceServiceif entirely superseded. - Update Koin DI graph in
core:service/commonMainto provide the unified service.
Phase 4: Verification
- Verify that
core:serviceand:appcompile cleanly for Android and Desktop. - Write or update unit tests in
commonTestto cover the shared connection lifecycle logic. (Skipped due to coroutine test hanging on infinite heartbeat loop)
Phase: Review Fixes
- Task: Apply review suggestions
eeeeb11df