summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2021-02-22 22:54:12 +0100
committerPedro J. Estébanez <pedrojrulez@gmail.com>2021-10-09 11:13:26 +0200
commit007cb5ccfb26db2494610114be033726fa4b24d4 (patch)
tree258362672e8cb5fe0b11b50d4bab650e90223d0d /platform/android
parent58aa020a19162becc9a00fed8a240eb12b0ab964 (diff)
Implement get_cache_path() for iOS, and improve it for Android and Windows
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/os_android.cpp7
-rw-r--r--platform/android/os_android.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 21fb31d991..034885aa32 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -230,10 +230,13 @@ String OS_Android::get_user_data_dir() const {
}
String OS_Android::get_cache_path() const {
+ if (cache_dir_cache != String())
+ return cache_dir_cache;
+
String cache_dir = godot_io_java->get_cache_dir();
if (cache_dir != "") {
- cache_dir = _remove_symlink(cache_dir);
- return cache_dir;
+ cache_dir_cache = _remove_symlink(cache_dir);
+ return cache_dir_cache;
}
return ".";
}
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index c938297821..ce8083388f 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -57,6 +57,7 @@ private:
#endif
mutable String data_dir_cache;
+ mutable String cache_dir_cache;
AudioDriverOpenSL audio_driver_android;