Fix playlist bug
Use synthetic external view to get audio id of playlist members. Without
this fix, it would fail to insert audio id of playlist members into
audio_playlists_map table even though they are normally added to the
playlist file. Luckily we don't need to check volume name since playlist
for internal storage is not supported.
It doesn't seem that a playlist file is created normally due to
b/161228757 even though the playlist file is created well by
MediaProvider. To workaround this, MediaProvider#invalidateFuseDentry()
is invoked whenever Playlist#write() is invoked.
When playlist files are deleted, corresponding rows of
audio_playlists_map should be deleted as well. It takes wrong time to
resolve playlist members when some audio files are removed. That's why
The cleanup is done in OnFilesChangeListener#onDelete().
Bug: b/169300919
Test: atest MediaProviderTests MediaProviderClientTests
Change-Id: I7a8bf25d6974d6ea520b0d6ca45ad09f8d62a778
(cherry picked from commit e39e1108fe9378b26edefb548c56278566089892)
2 files changed