1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 11:21:29 +00:00

Fix several lint warnings

This commit is contained in:
Lode Hoste 2015-04-09 20:14:14 +02:00
parent bcbec555cd
commit df92b179c7
2 changed files with 10 additions and 16 deletions

View file

@ -17,35 +17,29 @@ import java.util.concurrent.TimeUnit;
public class RestApiTest extends AndroidTestCase {
private SyncthingRunnable mSyncthing;
private ConfigXml mConfig;
private RestApi mApi;
private String mHttpsCertPath;
@Override
protected void setUp() throws Exception {
super.setUp();
mSyncthing = new SyncthingRunnable(new MockContext(null),
new SyncthingRunnable(new MockContext(null),
getContext().getApplicationInfo().dataDir + "/" + SyncthingService.BINARY_NAME);
mConfig = new ConfigXml(new MockContext(getContext()));
mConfig.changeDefaultFolder();
ConfigXml config = new ConfigXml(new MockContext(getContext()));
config.changeDefaultFolder();
mHttpsCertPath = getContext().getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE;
String httpsCertPath = getContext().getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE;
final CountDownLatch latch = new CountDownLatch(2);
new PollWebGuiAvailableTask(mHttpsCertPath) {
new PollWebGuiAvailableTask(httpsCertPath) {
@Override
protected void onPostExecute(Void aVoid) {
mApi.onWebGuiAvailable();
latch.countDown();
}
}.execute(mConfig.getWebGuiUrl());
mApi = new RestApi(getContext(), mConfig.getWebGuiUrl(), mConfig.getApiKey(),
}.execute(config.getWebGuiUrl());
mApi = new RestApi(getContext(), config.getWebGuiUrl(), config.getApiKey(),
new RestApi.OnApiAvailableListener() {
@Override
public void onApiAvailable() {
@ -58,8 +52,6 @@ public class RestApiTest extends AndroidTestCase {
@Override
protected void tearDown() throws Exception {
super.tearDown();
final CountDownLatch latch = new CountDownLatch(1);
SyncthingRunnable.killSyncthing();
ConfigXml.getConfigFile(new MockContext(getContext())).delete();
}

View file

@ -90,7 +90,9 @@ public class GetTask extends AsyncTask<String, Void, String> {
try {
// Don't push the API too hard
Thread.sleep(500 * i);
} catch (InterruptedException e) { }
} catch (InterruptedException e) {
Log.w(TAG, e);
}
Log.w(TAG, "Retrying GetTask Rest API call ("+i+")");
}
return null;