1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-27 13:21:30 +00:00

Use sdcard directory as home for web GUI folder picker (fixes #163).

If this causes problems on older devices, we can use the old path
based on API version.
This commit is contained in:
Felix Ableitner 2015-01-19 22:13:52 +01:00
parent fd861cdee9
commit fea483764d

View file

@ -3,6 +3,7 @@ package com.nutomic.syncthingandroid.syncthing;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.util.Log;
@ -47,7 +48,7 @@ public class SyncthingRunnable implements Runnable {
process = Runtime.getRuntime().exec("sh");
dos = new DataOutputStream(process.getOutputStream());
// Set home directory to data folder for syncthing to use.
dos.writeBytes("HOME=" + mContext.getFilesDir() + " ");
dos.writeBytes("HOME=" + Environment.getExternalStorageDirectory() + " ");
dos.writeBytes("STTRACE=" + pm.getString("sttrace", "") + " ");
dos.writeBytes("STNORESTART=1 ");
// Call syncthing with -home (as it would otherwise use "~/.config/syncthing/".