diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java index b4d3a112..c1434b57 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java @@ -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); + } } } diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/RestApi.java b/app/src/main/java/com/nutomic/syncthingandroid/service/RestApi.java index a5bdc0a2..3539b35e 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/service/RestApi.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/RestApi.java @@ -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); }); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/TestData.java b/app/src/main/java/com/nutomic/syncthingandroid/service/TestData.java new file mode 100644 index 00000000..efa9a40c --- /dev/null +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/TestData.java @@ -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"; +}