v7: store-and-forward architecture

BREAKING: Complete rewrite of data flow to fix network isolation issue.

Problem: When connected to Bee's WiFi AP (192.168.0.10), the phone has
NO internet access. The Bee AP is just a direct connection to the dashcam
with no upstream gateway. The old design tried to simultaneously pull from
Bee and push to ADAMaps, which fundamentally couldn't work.

Solution: Store-and-forward with two independent subsystems:

1. BeeCollectorService - Collection only
   - Binds to unvalidated WiFi (Bee AP)
   - Polls Bee for detections
   - Stores to local Room database
   - Does NOT attempt internet uploads

2. AdaMapsUploadWorker - Upload only
   - WorkManager-based background worker
   - Only runs when device has VALIDATED internet
   - Reads from local DB, batch uploads to ADAMaps
   - Marks as synced, retries with backoff

New components:
- Room database (DetectionEntity, DetectionDao, VarroaDatabase)
- NetworkStateMonitor for tracking validated vs unvalidated networks
- Improved UI with BEE/LOCAL/UPLOAD indicators
- Manual sync trigger when internet + pending data

Version: 1.7.0 (versionCode 7)
This commit is contained in:
Kayos 2026-03-11 11:11:05 -07:00
parent a8b66230ab
commit c9645ac155
14 changed files with 1296 additions and 86 deletions

View file

@ -33,6 +33,13 @@
</intent-filter>
</activity>
<!-- v7: New Bee Collector Service (store-and-forward) -->
<service
android:name=".service.BeeCollectorService"
android:exported="false"
android:foregroundServiceType="dataSync" />
<!-- Legacy ForwardingService (deprecated, kept for migration) -->
<service
android:name=".service.ForwardingService"
android:exported="false"