mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
Android Auto loads browse item artwork from the item's icon URI in its own process, so it cannot open the app's private cover files and local covers were left out of every browse list. CoverContentProvider serves them as content://<applicationId>.covers/ <folder>/<file>. A car cannot hold a permission, so the provider is exported, and in exchange it only reads: openFile accepts mode "r" only, insert/update/delete throw, query lists nothing. CoverProviderFiles resolves a URI to a file only when its path is an allowed folder name and a plain file name, the canonical file sits directly in the canonical folder (no "..", encoded "/" or symbolic link out), and it is a regular file starting with a known image signature. The allowed folders are the ones browse lists name: the cover store (files/covers), Library thumbnails (files/library_covers) and embedded artwork extracted from downloads (cache/embedded_cover_previews). The covers channel hands Dart the authority and folder paths, registered on the shared engine so a car-started engine has it too.