mirror of
https://github.com/jamessanford/kegs.git
synced 2024-06-18 09:30:41 +00:00
Fix one more spot that assumed external storage was available.
This commit is contained in:
parent
4abd03387d
commit
1c73953ad3
|
@ -44,7 +44,12 @@ class ConfigFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCachePath() {
|
public String getCachePath() {
|
||||||
return mContext.getExternalCacheDir().getPath();
|
File cacheDir = mContext.getExternalCacheDir();
|
||||||
|
if (cacheDir == null) {
|
||||||
|
// Use internal storage if external directory is not available.
|
||||||
|
cacheDir = mContext.getCacheDir();
|
||||||
|
}
|
||||||
|
return cacheDir.getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getAllImageDirs() {
|
public String[] getAllImageDirs() {
|
||||||
|
@ -53,11 +58,11 @@ class ConfigFile {
|
||||||
String externalStorage;
|
String externalStorage;
|
||||||
|
|
||||||
File externalDir = Environment.getExternalStorageDirectory();
|
File externalDir = Environment.getExternalStorageDirectory();
|
||||||
if (externalDir != null) {
|
if (externalDir == null) {
|
||||||
externalStorage = externalDir.getPath();
|
|
||||||
} else {
|
|
||||||
// Try harder. It is OK if this does not exist.
|
// Try harder. It is OK if this does not exist.
|
||||||
externalStorage = "/mnt/sdcard";
|
externalStorage = "/mnt/sdcard";
|
||||||
|
} else {
|
||||||
|
externalStorage = externalDir.getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] dirs = {
|
String[] dirs = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user