Allow backwards compatibility to previous solution to add quotes

This commit is contained in:
Markus M. May 2018-06-23 22:41:01 +02:00
parent e32f33a8d3
commit 8bdaddb389
2 changed files with 10 additions and 1 deletions

View file

@ -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 {

View file

@ -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));