Major Changes:
- Convert ChunkedUploadManager.java to Kotlin with coroutines
- Convert ZipUtil.java to Kotlin with Dispatchers.IO
- Convert FileController.java to Kotlin
ANR Fixes:
- All file I/O now runs on Dispatchers.IO (prevents main thread blocking)
- Chunk reading (4-10MB) moved to background thread
- File compression (zipping) moved to background thread
- Instant cancellation with proper coroutine handling
Chunking Improvements:
- Update thresholds to match chunk sizes (4MB mobile, 10MB WiFi)
- Files smaller than chunk size use standard upload
- Proper zipping logic: skip single .zip files, zip everything else
Progress & UX:
- Add PREPARING state for file compression phase
- Show 'Compressing file: X%' in notification during zip
- Throttle updates to 500ms for smooth notification display
- Broadcast ACTION_ZIP_PROGRESS for in-app UI
- ViewModel listens and displays zip progress
- Cancel button visible and functional during all phases
Cancellation:
- Instant cancel during zipping (checks every 8KB)
- Clean cancellation using CancellationException
- Automatic cleanup of partial zip files
- No error logs for user-initiated cancellation
Files Changed:
- ChunkedUploadManager: Java → Kotlin, uses coroutines + Dispatchers.IO
- ZipUtil: Java → Kotlin, cancellable with progress throttling
- FileController: Java → Kotlin, proper async job management
- UploadStrategySelector: Updated chunk size thresholds
- FileUploadForegroundService: Added PREPARING state, zip progress handling
- MainViewModel: Listen for ACTION_ZIP_PROGRESS, display status
- AppConstants: Added ACTION_ZIP_PROGRESS constant