1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-09 11:41:29 +00:00

Add service/TestData

This commit is contained in:
Catfriend1 2019-03-05 22:47:05 +01:00
parent 675de8a53b
commit 22a302d940
3 changed files with 16 additions and 2 deletions

View file

@ -38,6 +38,7 @@ import com.nutomic.syncthingandroid.service.Constants;
import com.nutomic.syncthingandroid.service.RestApi;
import com.nutomic.syncthingandroid.service.SyncthingService;
import com.nutomic.syncthingandroid.service.SyncthingServiceBinder;
import com.nutomic.syncthingandroid.service.TestData;
import com.nutomic.syncthingandroid.SyncthingApp;
import com.nutomic.syncthingandroid.util.Compression;
import com.nutomic.syncthingandroid.util.ConfigRouter;
@ -468,6 +469,9 @@ public class DeviceActivity extends SyncthingActivity {
if (scanResult != null) {
mDevice.deviceID = scanResult.getContents();
mEditDeviceId.setText(mDevice.deviceID);
if (ENABLE_TEST_DATA) {
mEditDeviceId.setText(TestData.DEVICE_A_ID);
}
}
}

View file

@ -637,8 +637,8 @@ public class RestApi {
if (ENABLE_TEST_DATA) {
DiscoveredDevice fakeDiscoveredDevice = new DiscoveredDevice();
fakeDiscoveredDevice.addresses = new String[]{"tcp4://192.168.178.10:40004"};
discoveredDevices.put("ZOK75WR-W3XWWUZ-NNLXV7V-DUYKVWA-SSPD7OH-3QYOZBY-SBH3N2Y-IAVJ4QH", fakeDiscoveredDevice);
discoveredDevices.put("ZPUZOWC-SUCJILE-ITNLBLL-MHBWJG5-46QM47Y-CDTQT3M-IA4RSJV-7BYA7QA", fakeDiscoveredDevice);
discoveredDevices.put(TestData.DEVICE_A_ID, fakeDiscoveredDevice);
discoveredDevices.put(TestData.DEVICE_B_ID, fakeDiscoveredDevice);
}
listener.onResult(discoveredDevices);
});

View file

@ -0,0 +1,10 @@
package com.nutomic.syncthingandroid.service;
/**
* Test data used if Constants.ENABLE_TEST_DATA == true.
*/
public class TestData {
public static final String DEVICE_A_ID = "ZOK75WR-W3XWWUZ-NNLXV7V-DUYKVWA-SSPD7OH-3QYOZBY-SBH3N2Y-IAVJ4QH";
public static final String DEVICE_B_ID = "ZPUZOWC-SUCJILE-ITNLBLL-MHBWJG5-46QM47Y-CDTQT3M-IA4RSJV-7BYA7QA";
}