Add SSID to Network Details page for Passpoint

Added SSID to Network Details page under the Advanced portion only
when the network is for Passpoint, whose network title is not the
SSID of the underlying connected AP.

Bug: 129092023
Test: atest RunSettingsRoboTests

Change-Id: I13308d46e727fc01fec7a079d8e32ab9f1763e21
This commit is contained in:
Quang Luong
2019-03-21 16:37:55 -07:00
parent 533d8b6b9d
commit a2297dc1d1
4 changed files with 72 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ public class WifiDetailPreferenceControllerTest {
private static final int RSSI = -55;
private static final int TX_LINK_SPEED = 123;
private static final int RX_LINK_SPEED = 54;
private static final String SSID = "ssid";
private static final String MAC_ADDRESS = WifiInfo.DEFAULT_MAC_ADDRESS;
private static final String SECURITY = "None";
@@ -154,6 +155,8 @@ public class WifiDetailPreferenceControllerTest {
@Mock
private Preference mockSecurityPref;
@Mock
private Preference mockSsidPref;
@Mock
private Preference mockMacAddressPref;
@Mock
private Preference mockIpAddressPref;
@@ -245,6 +248,7 @@ public class WifiDetailPreferenceControllerTest {
when(mockAccessPoint.getConfig()).thenReturn(mockWifiConfig);
when(mockAccessPoint.getLevel()).thenReturn(LEVEL);
when(mockAccessPoint.getSecurityString(false)).thenReturn(SECURITY);
when(mockAccessPoint.getSsidStr()).thenReturn(SSID);
when(mockConnectivityManager.getNetworkInfo(any(Network.class)))
.thenReturn(mockNetworkInfo);
doNothing().when(mockConnectivityManager).registerNetworkCallback(
@@ -314,6 +318,8 @@ public class WifiDetailPreferenceControllerTest {
.thenReturn(mockFrequencyPref);
when(mockScreen.findPreference(WifiDetailPreferenceController.KEY_SECURITY_PREF))
.thenReturn(mockSecurityPref);
when(mockScreen.findPreference(WifiDetailPreferenceController.KEY_SSID_PREF))
.thenReturn(mockSsidPref);
when(mockScreen.findPreference(WifiDetailPreferenceController.KEY_MAC_ADDRESS_PREF))
.thenReturn(mockMacAddressPref);
when(mockScreen.findPreference(WifiDetailPreferenceController.KEY_IP_ADDRESS_PREF))
@@ -462,6 +468,50 @@ public class WifiDetailPreferenceControllerTest {
verify(mockRxLinkSpeedPref).setVisible(false);
}
@Test
public void ssidPref_shouldHaveDetailTextSet() {
when(mockAccessPoint.isPasspoint()).thenReturn(true);
when(mockAccessPoint.isOsuProvider()).thenReturn(false);
displayAndResume();
verify(mockSsidPref, times(1)).setSummary(SSID);
when(mockAccessPoint.isPasspoint()).thenReturn(false);
when(mockAccessPoint.isOsuProvider()).thenReturn(true);
displayAndResume();
verify(mockSsidPref, times(2)).setSummary(SSID);
}
@Test
public void ssidPref_shouldShowIfPasspointOrOsu() {
when(mockAccessPoint.isPasspoint()).thenReturn(true);
when(mockAccessPoint.isOsuProvider()).thenReturn(false);
displayAndResume();
verify(mockSsidPref, times(1)).setVisible(true);
when(mockAccessPoint.isPasspoint()).thenReturn(false);
when(mockAccessPoint.isOsuProvider()).thenReturn(true);
displayAndResume();
verify(mockSsidPref, times(2)).setVisible(true);
}
@Test
public void ssidPref_shouldNotShowIfNotPasspoint() {
when(mockAccessPoint.isPasspoint()).thenReturn(false);
when(mockAccessPoint.isOsuProvider()).thenReturn(false);
displayAndResume();
verify(mockSsidPref).setVisible(false);
}
@Test
public void macAddressPref_shouldHaveDetailTextSet() {
displayAndResume();