M3: operations engine (copy/move/delete, progress, cancellation, conflicts) + foreground service

This commit is contained in:
2026-10-14 15:40:37 +02:00
parent 0863b37d70
commit 993cac6e5b
13 changed files with 1014 additions and 6 deletions
+14
View File
@@ -12,6 +12,20 @@ upload needs a **higher `versionCode`** than every previous upload.
### Added
- **M3 — operations engine and foreground service.** `domain/FileOperations` turns the
backend primitives into copy, move, delete and rename: it walks folders, counts the
work up front so the progress bar has an honest denominator, checks for cancellation
between entries (never swallowing `CancellationException`), and reports per-item
failures instead of abandoning a batch because one file was unreadable. Conflicts are
resolved through the M1 `TransferPlanner` — `ASK` is deliberately surfaced to the
caller so the UI can prompt. A move tries the backend's atomic rename first and only
falls back to copy-then-delete when the backend cannot do it (the SAF path across
directories); the source is never deleted when its copy failed. `service/FileOpService`
is a `dataSync` foreground service that mirrors the engine's progress into an ongoing
notification, so a long operation survives the app being backgrounded. 23 new JVM
tests (99 total), including Robolectric coverage of the notification and the service
entering the foreground.
- **M2 — storage layer.** The two storage backends behind one interface. `AllFilesSource`
is `java.io.File` over every mounted volume (the "All files access" path);
`SafSource` is the Storage Access Framework fallback, reading a persisted tree URI