# 19. Implement Android background sync service

meta:
  id: native-business-logic-migration-19
  feature: native-business-logic-migration
  priority: P1
  depends_on: [native-business-logic-migration-16]
  tags: [implementation, android, background]

objective:
- Implement background feed sync using WorkManager

deliverables:
- SyncWorker.kt
- SyncScheduler.kt
- SyncConfiguration.kt
- WorkManager configuration
- Foreground service (if needed)

tests:
- Unit: Test Worker execution
- Unit: Test scheduler configuration
- Integration: Test background execution

acceptance_criteria:
- Work scheduled properly
- Constraints respected (network, charging)
- Battery-efficient scheduling
- Proper work cancellation
- State persisted between runs

validation:
- Test with WorkManager TestRule
- Verify with adb commands

notes:
- Use PeriodicWorkRequest
- Set appropriate constraints
- Handle Doze mode
