| 549 | } |
| 550 | |
| 551 | static void |
| 552 | LoadConfigFile(JNIEnv *env, ConfigData &config) |
| 553 | { |
| 554 | /* try loading mpd.conf from |
| 555 | "Android/data/org.musicpd/files/mpd.conf" (the app specific |
| 556 | data directory) first */ |
| 557 | if (const auto dir = context->GetExternalFilesDir(env); |
| 558 | !dir.IsNull() && |
| 559 | TryReadConfigFile(config, dir / Path::FromFS("mpd.conf"))) |
| 560 | return; |
| 561 | |
| 562 | /* if that fails, attempt to load "mpd.conf" from the root of |
| 563 | the SD card (pre-0.23.9, ceases to work since Android |
| 564 | 12) */ |
| 565 | if (const auto dir = Environment::getExternalStorageDirectory(env); |
| 566 | !dir.IsNull()) |
| 567 | TryReadConfigFile(config, dir / Path::FromFS("mpd.conf")); |
| 568 | } |
| 569 | |
| 570 | static void |
| 571 | AndroidMain(JNIEnv *env) |
no test coverage detected