MPD icon indicating copy to clipboard operation
MPD copied to clipboard

android permission error

Open strider222 opened this issue 3 years ago • 0 comments

Feature request

On my android Samsung tab A mpd cannot open mpd-db due permission errors. This link suggests it is due to use of getExternalStorageDirectory api as mentioned in the mpd manual being replaced with scoped storage.

Quote/ Android 10 (API 29) introduces Scoped Storage. Changing your manifest to request legacy storage is not a long-term solution.

I fixed the issue when I replaced my previous instances of Environment.getExternalStorageDirectory() (which is deprecated with API 29) with context.getExternalFilesDir(null).

Note that context.getExternalFilesDir(type) can return null if the storage location isn't available, so be sure to check that whenever you're checking if you have external permissions.

Read more here. /Quote

mpd.conf opens for read ok but not the db. Ive moved it around but nowhere I tried worked.

strider222 avatar Jul 30 '22 15:07 strider222

But ... MPD doesn't use getExternalStorageDirectory for the database. Since you did not post any logs or any error message, I cannot help you.

MaxKellermann avatar Aug 18 '22 16:08 MaxKellermann