mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-22 20:31:16 +00:00
Fix remaining merge issues
This commit is contained in:
parent
266909e086
commit
79f0e2a8dc
5 changed files with 12 additions and 9 deletions
|
@ -12,8 +12,9 @@ import java.util.List;
|
|||
public class MockRestApi extends RestApi {
|
||||
|
||||
public MockRestApi(Context context, String url, String apiKey,
|
||||
OnApiAvailableListener listener) {
|
||||
super(context, url, apiKey, listener);
|
||||
String guiUser, String guiPassword,
|
||||
OnApiAvailableListener listener) {
|
||||
super(context, url, apiKey, guiUser, guiPassword, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,7 +49,7 @@ public class MockSyncthingService extends SyncthingService {
|
|||
|
||||
@Override
|
||||
public RestApi getApi() {
|
||||
return new MockRestApi(this, null, null, null);
|
||||
return new MockRestApi(this, null, null, null, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,7 @@ public class PollWebGuiAvailableTaskTest extends AndroidTestCase {
|
|||
}
|
||||
|
||||
public void testPolling() throws InterruptedException {
|
||||
mSyncthing = new SyncthingRunnable(new MockContext(null), SyncthingRunnable.Command.main);
|
||||
new SyncthingRunnable(new MockContext(null), SyncthingRunnable.Command.main);
|
||||
|
||||
String httpsCertPath = getContext().getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public class RestApiTest extends AndroidTestCase {
|
|||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
mSyncthing = new SyncthingRunnable(new MockContext(null), SyncthingRunnable.Command.main);
|
||||
new SyncthingRunnable(new MockContext(null), SyncthingRunnable.Command.main);
|
||||
|
||||
ConfigXml config = new ConfigXml(new MockContext(getContext()));
|
||||
config.changeDefaultFolder();
|
||||
|
@ -39,6 +39,7 @@ public class RestApiTest extends AndroidTestCase {
|
|||
}
|
||||
}.execute(config.getWebGuiUrl());
|
||||
mApi = new RestApi(getContext(), config.getWebGuiUrl(), config.getApiKey(),
|
||||
null, null, // TODO
|
||||
new RestApi.OnApiAvailableListener() {
|
||||
@Override
|
||||
public void onApiAvailable() {
|
||||
|
|
|
@ -22,10 +22,12 @@ public class SyncthingRunnable implements Runnable {
|
|||
|
||||
private static final String TAG = "SyncthingRunnable";
|
||||
|
||||
private static final String TAG_IONICE = "SyncthingRunnableIoNice";
|
||||
|
||||
private static final String TAG_NATIVE = "SyncthingNativeCode";
|
||||
|
||||
private static final String TAG_NICE = "SyncthingRunnableIoNice";
|
||||
|
||||
private static final String TAG_KILL = "SyncthingRunnableKill";
|
||||
|
||||
public static final String UNIT_TEST_PATH = "was running";
|
||||
|
||||
private static final AtomicReference<Process> mSyncthing = new AtomicReference<>();
|
||||
|
@ -64,7 +66,6 @@ public class SyncthingRunnable implements Runnable {
|
|||
break;
|
||||
default:
|
||||
Log.w(TAG, "Unknown command option");
|
||||
mCommand = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,7 +95,7 @@ public class SyncthingRunnable implements Runnable {
|
|||
try {
|
||||
// Loop to handle Syncthing restarts (these always have an error code of 3).
|
||||
do {
|
||||
ProcessBuilder pb = new ProcessBuilder("sh");
|
||||
ProcessBuilder pb = new ProcessBuilder(mCommand);
|
||||
Map<String, String> env = pb.environment();
|
||||
// Set home directory to data folder for web GUI folder picker.
|
||||
env.put("HOME", Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
|
|
Loading…
Reference in a new issue