Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <deathbaba@gmail.com>2012-01-07 02:51:43 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:31:24 +0300
commit7d9b25d33da63f2b3dc9316d969cd91f48c7dc9b (patch)
tree2510ac3db8a3a0a2537e1fd1bdcf2b6d9e076d4a /android/jni/com/mapswithme/platform/Platform.cpp
parent3932615f2a7e4539b06b8426028067ca92974776 (diff)
[android] Added dynamical support for external/internal tmp dir when it's available
Diffstat (limited to 'android/jni/com/mapswithme/platform/Platform.cpp')
-rw-r--r--android/jni/com/mapswithme/platform/Platform.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/android/jni/com/mapswithme/platform/Platform.cpp b/android/jni/com/mapswithme/platform/Platform.cpp
index 193eb7f36b..7fb32450f8 100644
--- a/android/jni/com/mapswithme/platform/Platform.cpp
+++ b/android/jni/com/mapswithme/platform/Platform.cpp
@@ -7,17 +7,29 @@
namespace android
{
void Platform::Initialize(JNIEnv * env, jstring apkPath, jstring storagePath,
- jstring tmpPath, jstring settingsPath)
+ jstring tmpPath, jstring extTmpPath, jstring settingsPath)
{
m_resourcesDir = jni::ToString(env, apkPath);
m_writableDir = jni::ToString(env, storagePath);
- m_tmpDir = jni::ToString(env, tmpPath);
m_settingsDir = jni::ToString(env, settingsPath);
+ m_localTmpPath = jni::ToString(env, tmpPath);
+ m_externalTmpPath = jni::ToString(env, extTmpPath);
+ // By default use external temporary folder
+ m_tmpDir = m_externalTmpPath;
+
LOG(LDEBUG, ("Apk path = ", m_resourcesDir));
LOG(LDEBUG, ("Writable path = ", m_writableDir));
}
+ void Platform::OnExternalStorageStatusChanged(bool isAvailable)
+ {
+ if (isAvailable)
+ m_tmpDir = m_externalTmpPath;
+ else
+ m_tmpDir = m_localTmpPath;
+ }
+
Platform & Platform::Instance()
{
static Platform platform;