added back possibility to move webviews cache to external storage
* in theory, this is not needed anymore since iitcm now has its own * tile cache. But the user may want to use tiles loaded by an external * plugin and cache them on sdCard. This would make use of the webviews * cache...to stay consistent with our external storage preference we * need this method.
This commit is contained in:
parent
ca5e7a890a
commit
1e75353eb3
@ -12,6 +12,16 @@ import java.io.File;
|
||||
* getContext().getCacheDir(); to decide where to store and read cached files.
|
||||
*/
|
||||
public class IITC_Application extends Application {
|
||||
|
||||
@Override
|
||||
public File getCacheDir() {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_external_storage", false)) {
|
||||
return (getExternalCacheDir() != null) ? getExternalCacheDir() : super.getCacheDir();
|
||||
} else {
|
||||
return super.getCacheDir();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFilesDir() {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_external_storage", false)) {
|
||||
@ -20,4 +30,5 @@ public class IITC_Application extends Application {
|
||||
return super.getFilesDir();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user