Main: load Android mpd.conf from ExternalFilesDir
See also https://github.com/MusicPlayerDaemon/MPD/issues/1061 Closes https://github.com/MusicPlayerDaemon/MPD/issues/1570
This commit is contained in:
11
src/Main.cxx
11
src/Main.cxx
@@ -607,6 +607,17 @@ TryReadConfigFile(ConfigData &config, Path path)
|
||||
static void
|
||||
LoadConfigFile(JNIEnv *env, ConfigData &config)
|
||||
{
|
||||
/* try loading mpd.conf from
|
||||
"Android/data/org.musicpd/files/mpd.conf" (the app specific
|
||||
data directory) first */
|
||||
if (const auto dir = context->GetExternalFilesDir(env);
|
||||
!dir.IsNull() &&
|
||||
TryReadConfigFile(config, dir / Path::FromFS("mpd.conf")))
|
||||
return;
|
||||
|
||||
/* if that fails, attempt to load "mpd.conf" from the root of
|
||||
the SD card (pre-0.23.9, ceases to work since Android
|
||||
12) */
|
||||
if (const auto dir = Environment::getExternalStorageDirectory(env);
|
||||
!dir.IsNull())
|
||||
TryReadConfigFile(config, dir / Path::FromFS("mpd.conf"));
|
||||
|
Reference in New Issue
Block a user