66import android .content .Context ;
77import android .content .Intent ;
88import android .os .AsyncTask ;
9- import android .os .Environment ;
109import android .os .IBinder ;
1110import android .support .v4 .app .NotificationCompat ;
1211import android .util .Log ;
@@ -125,10 +124,9 @@ public void run() throws NativeExecutionException {
125124 try {
126125 Process p = Runtime .getRuntime ().exec ("sh" );
127126 dos = new DataOutputStream (p .getOutputStream ());
128- // Set home directory to sdcard (so the "create repo" hint makes sense)
129- dos .writeBytes ("HOME=" +
130- Environment .getExternalStorageDirectory ().toString () + "\n " );
131- // Set syncthing config folder to app data folder.
127+ // Set home directory to data folder for syncthing to use.
128+ dos .writeBytes ("HOME=" + getApplicationInfo ().dataDir + "\n " );
129+ // Call syncthing with -home (as it would otherwise use "~/.config/syncthing/".
132130 dos .writeBytes (getApplicationInfo ().dataDir + "/" + BINARY_NAME + " " +
133131 "-home " + getApplicationInfo ().dataDir + "\n " );
134132 dos .writeBytes ("exit\n " );
@@ -137,7 +135,7 @@ public void run() throws NativeExecutionException {
137135 ret = p .waitFor ();
138136
139137 // Write syncthing binary output to log.
140- // NOTE: This is only done on shutdown, not in real time .
138+ // NOTE: This is only done on shutdown, not live .
141139 isr = new InputStreamReader (p .getInputStream ());
142140 BufferedReader stdout = new BufferedReader (isr );
143141 String line ;
0 commit comments