diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegate.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegate.java index aa085d2a2d..ba6ec2c80b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegate.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegate.java @@ -122,7 +122,8 @@ class NsClientReceiverDelegate { boolean newAllowedState = true; if (ev.wifiConnected) { - if (!allowedSSIDs.trim().isEmpty() && !allowedSSIDs.contains(ev.getSsid())) { + if (!allowedSSIDs.trim().isEmpty() && + (!allowedSSIDs.contains(ev.getSsid()) && !allowedSSIDs.contains(ev.ssid))) { newAllowedState = false; } } else { diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegateTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegateTest.java index 70e8d2c9b7..5bb1ca9a44 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegateTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/NSClientInternal/NsClientReceiverDelegateTest.java @@ -70,6 +70,14 @@ public class NsClientReceiverDelegateTest { ev.mobileConnected = true; ev.wifiConnected = true; assertTrue(sut.calculateStatus(ev)); + + ev.ssid = "test"; + when(SP.getString(anyInt(), anyString())).thenReturn("\"test\""); + assertTrue(sut.calculateStatus(ev)); + + ev.ssid = "\"test\""; + assertTrue(sut.calculateStatus(ev)); + ev.wifiConnected = false; assertTrue(sut.calculateStatus(ev));