</plurals>
<!-- Wi-Fi settings screen, advanced, settings section. This is a header shown above advanced wifi settings. [CHAR LIMIT=30] -->
<string name="wifi_advanced_titlebar">Advanced Wi\u2011Fi</string>
+ <!-- Wi-Fi settings screen, advanced, title of the item to show the Wi-Fi device's SSID. [CHAR LIMIT=20] -->
+ <string name="wifi_advanced_ssid_title">SSID</string>
<!-- Wi-Fi settings screen, advanced, title of the item to show the Wi-Fi device's MAC address. -->
<string name="wifi_advanced_mac_address_title">MAC address</string>
<!-- Title of the screen to adjust IP settings -->
@VisibleForTesting
static final String KEY_SECURITY_PREF = "security";
@VisibleForTesting
+ static final String KEY_SSID_PREF = "ssid";
+ @VisibleForTesting
static final String KEY_MAC_ADDRESS_PREF = "mac_address";
@VisibleForTesting
static final String KEY_IP_ADDRESS_PREF = "ip_address";
private Preference mRxLinkSpeedPref;
private Preference mFrequencyPref;
private Preference mSecurityPref;
+ private Preference mSsidPref;
private Preference mMacAddressPref;
private Preference mIpAddressPref;
private Preference mGatewayPref;
mFrequencyPref = screen.findPreference(KEY_FREQUENCY_PREF);
mSecurityPref = screen.findPreference(KEY_SECURITY_PREF);
+ mSsidPref = screen.findPreference(KEY_SSID_PREF);
mMacAddressPref = screen.findPreference(KEY_MAC_ADDRESS_PREF);
mIpAddressPref = screen.findPreference(KEY_IP_ADDRESS_PREF);
mGatewayPref = screen.findPreference(KEY_GATEWAY_PREF);
refreshRxSpeed();
// IP related information
refreshIpLayerInfo();
+ // SSID Pref
+ refreshSsid();
// MAC Address Pref
refreshMacAddress();
}
R.string.rx_link_speed, mWifiInfo.getRxLinkSpeedMbps()));
}
+ private void refreshSsid() {
+ if (mAccessPoint.isPasspoint() || mAccessPoint.isOsuProvider()) {
+ mSsidPref.setVisible(true);
+ mSsidPref.setSummary(mAccessPoint.getSsidStr());
+ } else {
+ mSsidPref.setVisible(false);
+ }
+ }
+
private void refreshMacAddress() {
String macAddress = getMacAddress();
if (macAddress == null) {
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";
@Mock
private Preference mockSecurityPref;
@Mock
+ private Preference mockSsidPref;
+ @Mock
private Preference mockMacAddressPref;
@Mock
private Preference mockIpAddressPref;
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(
.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))
}
@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();