diff options
author | Fredia Huya-Kouadio <fhuyakou@gmail.com> | 2021-07-10 18:39:31 -0700 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuya@fb.com> | 2022-07-05 03:00:37 -0700 |
commit | f9c19298ce9ba7a9a9943949b40c757979706a5a (patch) | |
tree | 96c949c4a238e3b831c11d81efce135e1ca2d19a /core/io | |
parent | 100d2237361004bd053aaf1b6d63ad3068d6272e (diff) |
Add full support for Android scoped storage.
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer.
This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/dir_access.cpp | 4 | ||||
-rw-r--r-- | core/io/dir_access.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/core/io/dir_access.cpp b/core/io/dir_access.cpp index 433a7efb21..0a900078b7 100644 --- a/core/io/dir_access.cpp +++ b/core/io/dir_access.cpp @@ -181,6 +181,10 @@ Error DirAccess::make_dir_recursive(String p_dir) { return OK; } +DirAccess::AccessType DirAccess::get_access_type() const { + return _access_type; +} + String DirAccess::fix_path(String p_path) const { switch (_access_type) { case ACCESS_RESOURCES: { diff --git a/core/io/dir_access.h b/core/io/dir_access.h index 0125f011b5..22017efaa3 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -57,6 +57,7 @@ protected: String _get_root_path() const; String _get_root_string() const; + AccessType get_access_type() const; String fix_path(String p_path) const; template <class T> |