java/File: add method ToAbsolutePath() returning AllocatedPath

This commit is contained in:
Max Kellermann
2014-03-01 20:53:39 +01:00
parent e44c9a000d
commit 5268f55344
5 changed files with 67 additions and 60 deletions

View File

@@ -246,13 +246,7 @@ AllocatedPath GetUserMusicDir()
#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);
return Environment::getExternalStoragePublicDirectory("Music");
#else
return AllocatedPath::Null();
#endif