aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/fs/posix/posix-fs.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 507f075db4..fe72cfec04 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -57,6 +57,9 @@
#include <os2.h>
#endif
+#if defined(__ANDROID__) && !defined(ANDROIDSDL)
+#include "backends/platform/android/jni.h"
+#endif
bool POSIXFilesystemNode::exists() const {
return access(_path.c_str(), F_OK) == 0;
@@ -190,6 +193,23 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
}
#endif
+#if defined(__ANDROID__) && !defined(ANDROIDSDL)
+ if (_path == "/") {
+ Common::Array<Common::String> list = JNI::getAllStorageLocations();
+ for (Common::Array<Common::String>::const_iterator it = list.begin(), end = list.end(); it != end; ++it) {
+ POSIXFilesystemNode *entry = new POSIXFilesystemNode();
+
+ entry->_isDirectory = true;
+ entry->_isValid = true;
+ entry->_displayName = *it;
+ ++it;
+ entry->_path = *it;
+ myList.push_back(entry);
+ }
+ return true;
+ }
+#endif
+
DIR *dirp = opendir(_path.c_str());
struct dirent *dp;