Even with the WRITE_EXTERNAL_STORAGE permission, we appear to no
longer have permission to write to a random external storage
dir. Instead, we only have permission to write to an app-specific dir,
buried deep in the directory tree. We can get that directory name with
getExternalMediaDirs()[0].
Signed-off-by: Keith Packard <keithp@keithp.com>
public String getString(String key, String def) {
String ret;
public String getString(String key, String def) {
String ret;
- ret = prefs.getString(key, def);
-// AltosDebug.debug("AltosDroidPreferencesBackend get string %s:\n", key);
-// if (ret == null)
-// AltosDebug.debug(" (null)\n");
-// else {
-// String[] lines = ret.split("\n");
-// for (String l : lines)
-// AltosDebug.debug(" %s\n", l);
-// }
+ if (key.equals(AltosPreferences.logdirPreference))
+ ret = null;
+ else
+ ret = prefs.getString(key, def);
+ AltosDebug.debug("AltosDroidPreferencesBackend get string %s:\n", key);
+ if (ret == null)
+ AltosDebug.debug(" (null)\n");
+ else {
+ String[] lines = ret.split("\n");
+ for (String l : lines)
+ AltosDebug.debug(" %s\n", l);
+ }
}
public File homeDirectory() {
}
public File homeDirectory() {
- return Environment.getExternalStorageDirectory();
+ return context.getExternalMediaDirs()[0];
}
public void debug(String format, Object ... arguments) {
}
public void debug(String format, Object ... arguments) {