Repository navigation
Lull 1.12 — delete a track from the device
Delete a track from the device. The last entry on the selection bar — long-press a track, an album, a folder — and a button on the Now Playing top bar, because the moment you decide a track has to go is usually the moment you are listening to it.
- Lull asks before the system does. On Android 11 and up the platform puts its own confirmation over the app and does the deleting itself, and Lull's dialog still comes first: the system's asks whether you meant to delete a file, while Lull's says which track, how many, and that the rating and the playlist entries go too. On Android 9 and below there is no system dialog at all, and Lull's is the only thing between a long-press and a file being gone for good.
- All three of Android's answers to deleting are covered —
MediaStore.createDeleteRequestfor the whole batch on API 30+, a per-fileRecoverableSecurityExceptionconsent on API 29, and a plainWRITE_EXTERNAL_STORAGEdelete below that (which is why that permission is back, capped atmaxSdkVersion="28"). - Nothing trusts the result code.
RESULT_OKsays the user pressed a button, not that every file went. What actually happened is read back out of MediaStore afterwards, so the toast can say "Deleted 3 of 5" rather than claiming five. - Everything keyed to the track goes with it — the rating, the measured BPM, the loudness profile and its place in every playlist, each in one write. The deleted tracks come out of the playing queue too, highest position first.
- The API deliberately cannot do this, and
GET /api/docsnow says so: from Android 10 up the system has to ask a person, and this is the only irreversible thing in the app. - 171 unit tests to 183.
Full notes in CHANGELOG.md.