M2: storage layer (all-files + SAF backends, volumes, access policy) + 32 JVM tests

This commit is contained in:
2026-10-14 15:17:51 +02:00
parent 6d4c2c3f87
commit 0863b37d70
18 changed files with 1174 additions and 5 deletions
+11
View File
@@ -12,6 +12,17 @@ upload needs a **higher `versionCode`** than every previous upload.
### Added
- **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
through `DocumentsContract` with `SafDocumentIds` doing the tree↔path mapping and
`SafGrant` owning the folder picker and its persistence. `VolumeRepository` enumerates
volumes via `StorageManager`/`StorageVolume` and reports free/total space through
`StatFs`; `StorageAccess` and `StorageAccessPolicy` decide between the two backends.
Both sources confine their blocking I/O to `Dispatchers.IO` and expose a `suspend`
contract. 32 new JVM tests (76 total), including a Robolectric run of `SafSource`
against a stand-in `DocumentsProvider`.
- **M1 — pure-Kotlin core engine.** An Android-free `core/` package holding the logic
every other layer builds on: `StoragePath` (normalised absolute paths that can never
escape the root), `FileEntry` with extension-based `FileKind` classification and a