Merge branch 'issue_1130' into issue_1130_backwards

This commit is contained in:
Markus M. May 2018-06-23 22:42:34 +02:00
commit 7f9c459a4a
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));