aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorAlyssa Milburn2011-10-25 22:52:25 +0200
committerAlyssa Milburn2011-10-25 23:04:42 +0200
commit80e55c5e78a5161bda41b730892e1a853c872ccb (patch)
tree71aa5b3c30e8ed51a9c24e0ffda493577a2e1eb1 /backends/platform
parent44b7f3aed52b1213995f9e19e4395f4350997b01 (diff)
downloadscummvm-rg350-80e55c5e78a5161bda41b730892e1a853c872ccb.tar.gz
scummvm-rg350-80e55c5e78a5161bda41b730892e1a853c872ccb.tar.bz2
scummvm-rg350-80e55c5e78a5161bda41b730892e1a853c872ccb.zip
ANDROID: Point the default savepath to external storage.
(If that fails, fall back to a readable app-specific directory.)
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index a41e843323..7c61520d43 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -14,6 +14,8 @@ import android.view.MotionEvent;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
+import java.io.File;
+
public class ScummVMActivity extends Activity {
private class MyScummVM extends ScummVM {
@@ -128,6 +130,15 @@ public class ScummVMActivity extends Activity {
getFilesDir().mkdirs();
+ // Store savegames on external storage if we can, which means they're
+ // world-readable and don't get deleted on uninstall.
+ String savePath = Environment.getExternalStorageDirectory() + "/ScummVM/Saves/";
+ File saveDir = new File(savePath);
+ if (!saveDir.isDirectory()) {
+ // If it doesn't work, resort to the internal app path.
+ savePath = getDir("saves", MODE_WORLD_READABLE).getPath();
+ }
+
// Start ScummVM
_scummvm = new MyScummVM(main_surface.getHolder());
@@ -136,7 +147,7 @@ public class ScummVMActivity extends Activity {
"--config=" + getFileStreamPath("scummvmrc").getPath(),
"--path=" + Environment.getExternalStorageDirectory().getPath(),
"--gui-theme=scummmodern",
- "--savepath=" + getDir("saves", 0).getPath()
+ "--savepath=" + savePath
});
_events = new ScummVMEvents(this, _scummvm);