diff options
Diffstat (limited to '')
-rw-r--r-- | src/fs/StandardDirectory.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fs/StandardDirectory.cxx b/src/fs/StandardDirectory.cxx index 4f0958995..fce54a677 100644 --- a/src/fs/StandardDirectory.cxx +++ b/src/fs/StandardDirectory.cxx @@ -20,7 +20,7 @@ #include "config.h" // Use X Desktop guidelines where applicable -#if !defined(__APPLE__) && !defined(WIN32) +#if !defined(__APPLE__) && !defined(WIN32) && !defined(ANDROID) #define USE_XDG #endif @@ -47,6 +47,11 @@ #include <utility> #endif +#ifdef ANDROID +#include "java/Global.hxx" +#include "android/Environment.hxx" +#endif + #ifndef WIN32 class PasswdEntry { @@ -240,6 +245,14 @@ AllocatedPath GetUserMusicDir() return GetStandardDir(CSIDL_MYMUSIC); #elif defined(USE_XDG) return GetUserDir("XDG_MUSIC_DIR"); +#elif defined(ANDROID) + char buffer[1024]; + if (Environment::getExternalStoragePublicDirectory(buffer, + sizeof(buffer), + "Music") == nullptr) + return AllocatedPath::Null(); + + return AllocatedPath::FromUTF8(buffer); #else return AllocatedPath::Null(); #endif |