mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-26 22: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 class MockRestApi extends RestApi {
|
||||||
|
|
||||||
public MockRestApi(Context context, String url, String apiKey,
|
public MockRestApi(Context context, String url, String apiKey,
|
||||||
OnApiAvailableListener listener) {
|
String guiUser, String guiPassword,
|
||||||
super(context, url, apiKey, listener);
|
OnApiAvailableListener listener) {
|
||||||
|
super(context, url, apiKey, guiUser, guiPassword, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class MockSyncthingService extends SyncthingService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RestApi getApi() {
|
public RestApi getApi() {
|
||||||
return new MockRestApi(this, null, null, null);
|
return new MockRestApi(this, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class PollWebGuiAvailableTaskTest extends AndroidTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPolling() throws InterruptedException {
|
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;
|
String httpsCertPath = getContext().getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class RestApiTest extends AndroidTestCase {
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
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()));
|
ConfigXml config = new ConfigXml(new MockContext(getContext()));
|
||||||
config.changeDefaultFolder();
|
config.changeDefaultFolder();
|
||||||
|
@ -39,6 +39,7 @@ public class RestApiTest extends AndroidTestCase {
|
||||||
}
|
}
|
||||||
}.execute(config.getWebGuiUrl());
|
}.execute(config.getWebGuiUrl());
|
||||||
mApi = new RestApi(getContext(), config.getWebGuiUrl(), config.getApiKey(),
|
mApi = new RestApi(getContext(), config.getWebGuiUrl(), config.getApiKey(),
|
||||||
|
null, null, // TODO
|
||||||
new RestApi.OnApiAvailableListener() {
|
new RestApi.OnApiAvailableListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onApiAvailable() {
|
public void onApiAvailable() {
|
||||||
|
|
|
@ -22,10 +22,12 @@ public class SyncthingRunnable implements Runnable {
|
||||||
|
|
||||||
private static final String TAG = "SyncthingRunnable";
|
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_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";
|
public static final String UNIT_TEST_PATH = "was running";
|
||||||
|
|
||||||
private static final AtomicReference<Process> mSyncthing = new AtomicReference<>();
|
private static final AtomicReference<Process> mSyncthing = new AtomicReference<>();
|
||||||
|
@ -64,7 +66,6 @@ public class SyncthingRunnable implements Runnable {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.w(TAG, "Unknown command option");
|
Log.w(TAG, "Unknown command option");
|
||||||
mCommand = "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +95,7 @@ public class SyncthingRunnable implements Runnable {
|
||||||
try {
|
try {
|
||||||
// Loop to handle Syncthing restarts (these always have an error code of 3).
|
// Loop to handle Syncthing restarts (these always have an error code of 3).
|
||||||
do {
|
do {
|
||||||
ProcessBuilder pb = new ProcessBuilder("sh");
|
ProcessBuilder pb = new ProcessBuilder(mCommand);
|
||||||
Map<String, String> env = pb.environment();
|
Map<String, String> env = pb.environment();
|
||||||
// Set home directory to data folder for web GUI folder picker.
|
// Set home directory to data folder for web GUI folder picker.
|
||||||
env.put("HOME", Environment.getExternalStorageDirectory().getAbsolutePath());
|
env.put("HOME", Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||||
|
|
Loading…
Reference in a new issue