diff options
author | vng <viktor.govako@gmail.com> | 2013-03-22 12:56:09 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:52:15 +0300 |
commit | 47eaed0f5e3f635a4b0a8e571a9dc67ea5d14add (patch) | |
tree | 99448d24749294e33eac5431ce223d551d1e3553 /android/src/com/mapswithme/maps/MWMApplication.java | |
parent | 5ac4f5ff02e582e1e1784d1cc0ddc683dcd84fa8 (diff) |
[android] Replace all tmp folders with "cache" (Like getExternalCacheDir() in API level 8).
Diffstat (limited to 'android/src/com/mapswithme/maps/MWMApplication.java')
-rw-r--r-- | android/src/com/mapswithme/maps/MWMApplication.java | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/android/src/com/mapswithme/maps/MWMApplication.java b/android/src/com/mapswithme/maps/MWMApplication.java index b5c077f843..de4b45cd5f 100644 --- a/android/src/com/mapswithme/maps/MWMApplication.java +++ b/android/src/com/mapswithme/maps/MWMApplication.java @@ -95,17 +95,15 @@ public class MWMApplication extends android.app.Application implements MapStorag } final String extStoragePath = getDataStoragePath(); - final String extTmpPath = getExtAppDirectoryPath("caches"); + final String extTmpPath = getTempPath(); // Create folders if they don't exist new File(extStoragePath).mkdirs(); new File(extTmpPath).mkdirs(); - new File(getExtAppDirectoryPath("tmp")).mkdir(); // init native framework nativeInit(getApkPath(), extStoragePath, - getTmpPath(), extTmpPath, m_isProVersion); @@ -168,6 +166,12 @@ public class MWMApplication extends android.app.Application implements MapStorag return Environment.getExternalStorageDirectory().getAbsolutePath() + "/MapsWithMe/"; } + public String getTempPath() + { + // Can't use getExternalCacheDir() here because of API level = 7. + return getExtAppDirectoryPath("cache"); + } + public String getExtAppDirectoryPath(String folder) { final String storagePath = Environment.getExternalStorageDirectory().getAbsolutePath(); @@ -187,18 +191,6 @@ public class MWMApplication extends android.app.Application implements MapStorag return m_proVersionURL; } - private String getTmpPath() - { - return getCacheDir().getAbsolutePath() + "/"; - } - - /* - private String getSettingsPath() - { - return getFilesDir().getAbsolutePath() + "/"; - } - */ - static { System.loadLibrary("mapswithme"); @@ -207,7 +199,6 @@ public class MWMApplication extends android.app.Application implements MapStorag private native void nativeInit(String apkPath, String storagePath, String tmpPath, - String extTmpPath, boolean isPro); public native boolean nativeIsBenchmarking(); |