[WPA3] Filter unsupported networks from Add network spinner
Filter unsupported networks from Add network spinner. Removed entries from wifi_dialog.xml, adding them dynamically based on device capabilities. Adding position-to-security table, that decouples spinner positions from security values. Bug: 112195778 Test: atest WifiConfigControllerTest + device functional test Change-Id: I6a814c4d69fbd8d8076db5dbaa5da807b4da4c32
This commit is contained in:
@@ -83,12 +83,13 @@
|
|||||||
style="@style/wifi_item_label"
|
style="@style/wifi_item_label"
|
||||||
android:text="@string/wifi_security" />
|
android:text="@string/wifi_security" />
|
||||||
|
|
||||||
|
<!-- Entries are added dynamically to this spinner -->
|
||||||
|
<!-- See WifiConfigController.configureSecuritySpinner -->
|
||||||
<Spinner android:id="@+id/security"
|
<Spinner android:id="@+id/security"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/wifi_item_spinner"
|
style="@style/wifi_item_spinner"
|
||||||
android:prompt="@string/wifi_security"
|
android:prompt="@string/wifi_security" />
|
||||||
android:entries="@array/wifi_security" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -210,29 +210,6 @@
|
|||||||
<item>Temporarily avoiding poor connection</item>
|
<item>Temporarily avoiding poor connection</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Match this with the constants in AccessPoint. --> <skip />
|
|
||||||
<!-- Wi-Fi security choices used when manually added a Wi-Fi network -->
|
|
||||||
<string-array name="wifi_security">
|
|
||||||
<!-- The Wi-Fi network does not have any security. -->
|
|
||||||
<item>@string/wifi_security_none</item>
|
|
||||||
<item translatable="false">@string/wifi_security_wep</item>
|
|
||||||
<item translatable="false">@string/wifi_security_psk_generic</item>
|
|
||||||
<item translatable="false">@string/wifi_security_eap</item>
|
|
||||||
<item translatable="false">@string/wifi_security_owe</item>
|
|
||||||
<item translatable="false">@string/wifi_security_sae</item>
|
|
||||||
<item translatable="false">@string/wifi_security_eap_suiteb</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<!-- Match this with the constants in AccessPoint. --> <skip />
|
|
||||||
<!-- Wi-Fi security types for New User Dialog. EAP is not configurable. -->
|
|
||||||
<string-array name="wifi_security_no_eap">
|
|
||||||
<!-- The Wi-Fi network does not have any security. -->
|
|
||||||
<item>@string/wifi_security_none</item>
|
|
||||||
<item translatable="false">@string/wifi_security_wep</item>
|
|
||||||
<item translatable="false">@string/wifi_security_psk_generic</item>
|
|
||||||
<item translatable="false">@string/wifi_security_sae</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<!-- Security types for wireless tether -->
|
<!-- Security types for wireless tether -->
|
||||||
<string-array name="wifi_tether_security">
|
<string-array name="wifi_tether_security">
|
||||||
<!-- Do not translate. -->
|
<!-- Do not translate. -->
|
||||||
|
@@ -34,6 +34,7 @@ import android.net.wifi.WifiEnterpriseConfig;
|
|||||||
import android.net.wifi.WifiEnterpriseConfig.Eap;
|
import android.net.wifi.WifiEnterpriseConfig.Eap;
|
||||||
import android.net.wifi.WifiEnterpriseConfig.Phase2;
|
import android.net.wifi.WifiEnterpriseConfig.Phase2;
|
||||||
import android.net.wifi.WifiInfo;
|
import android.net.wifi.WifiInfo;
|
||||||
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.security.Credentials;
|
import android.security.Credentials;
|
||||||
import android.security.KeyStore;
|
import android.security.KeyStore;
|
||||||
@@ -119,9 +120,9 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
|
|
||||||
|
|
||||||
/* Phase2 methods supported by PEAP are limited */
|
/* Phase2 methods supported by PEAP are limited */
|
||||||
private final ArrayAdapter<String> mPhase2PeapAdapter;
|
private ArrayAdapter<String> mPhase2PeapAdapter;
|
||||||
/* Full list of phase2 methods */
|
/* Full list of phase2 methods */
|
||||||
private final ArrayAdapter<String> mPhase2FullAdapter;
|
private ArrayAdapter<String> mPhase2FullAdapter;
|
||||||
|
|
||||||
// e.g. AccessPoint.SECURITY_NONE
|
// e.g. AccessPoint.SECURITY_NONE
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -174,6 +175,9 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
private TextView mSsidView;
|
private TextView mSsidView;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
private Integer mSecurityInPosition[];
|
||||||
|
|
||||||
|
private final WifiManager mWifiManager;
|
||||||
|
|
||||||
public WifiConfigController(WifiConfigUiBase parent, View view, AccessPoint accessPoint,
|
public WifiConfigController(WifiConfigUiBase parent, View view, AccessPoint accessPoint,
|
||||||
int mode) {
|
int mode) {
|
||||||
@@ -181,11 +185,31 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
|
|
||||||
mView = view;
|
mView = view;
|
||||||
mAccessPoint = accessPoint;
|
mAccessPoint = accessPoint;
|
||||||
|
mContext = mConfigUi.getContext();
|
||||||
|
|
||||||
|
// Init Wi-Fi manager
|
||||||
|
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
|
||||||
|
initWifiConfigController(accessPoint, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
public WifiConfigController(WifiConfigUiBase parent, View view, AccessPoint accessPoint,
|
||||||
|
int mode, WifiManager wifiManager) {
|
||||||
|
mConfigUi = parent;
|
||||||
|
|
||||||
|
mView = view;
|
||||||
|
mAccessPoint = accessPoint;
|
||||||
|
mContext = mConfigUi.getContext();
|
||||||
|
mWifiManager = wifiManager;
|
||||||
|
initWifiConfigController(accessPoint, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initWifiConfigController(AccessPoint accessPoint, int mode) {
|
||||||
|
|
||||||
mAccessPointSecurity = (accessPoint == null) ? AccessPoint.SECURITY_NONE :
|
mAccessPointSecurity = (accessPoint == null) ? AccessPoint.SECURITY_NONE :
|
||||||
accessPoint.getSecurity();
|
accessPoint.getSecurity();
|
||||||
mMode = mode;
|
mMode = mode;
|
||||||
|
|
||||||
mContext = mConfigUi.getContext();
|
|
||||||
final Resources res = mContext.getResources();
|
final Resources res = mContext.getResources();
|
||||||
|
|
||||||
mLevels = res.getStringArray(R.array.wifi_signal);
|
mLevels = res.getStringArray(R.array.wifi_signal);
|
||||||
@@ -234,24 +258,10 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
mHiddenSettingsSpinner.getSelectedItemPosition() == NOT_HIDDEN_NETWORK
|
mHiddenSettingsSpinner.getSelectedItemPosition() == NOT_HIDDEN_NETWORK
|
||||||
? View.GONE
|
? View.GONE
|
||||||
: View.VISIBLE);
|
: View.VISIBLE);
|
||||||
|
mSecurityInPosition = new Integer[AccessPoint.SECURITY_MAX_VAL];
|
||||||
|
|
||||||
if (mAccessPoint == null) { // new network
|
if (mAccessPoint == null) { // new network
|
||||||
mConfigUi.setTitle(R.string.wifi_add_network);
|
configureSecuritySpinner();
|
||||||
|
|
||||||
mSsidView = (TextView) mView.findViewById(R.id.ssid);
|
|
||||||
mSsidView.addTextChangedListener(this);
|
|
||||||
mSecuritySpinner = ((Spinner) mView.findViewById(R.id.security));
|
|
||||||
mSecuritySpinner.setOnItemSelectedListener(this);
|
|
||||||
mView.findViewById(R.id.type).setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
showIpConfigFields();
|
|
||||||
showProxyFields();
|
|
||||||
mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
|
|
||||||
// Hidden option can be changed only when the user adds a network manually.
|
|
||||||
mView.findViewById(R.id.hidden_settings_field).setVisibility(View.VISIBLE);
|
|
||||||
((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox))
|
|
||||||
.setOnCheckedChangeListener(this);
|
|
||||||
|
|
||||||
mConfigUi.setSubmitButton(res.getString(R.string.wifi_save));
|
mConfigUi.setSubmitButton(res.getString(R.string.wifi_save));
|
||||||
} else {
|
} else {
|
||||||
if (!mAccessPoint.isPasspointConfig()) {
|
if (!mAccessPoint.isPasspointConfig()) {
|
||||||
@@ -1414,7 +1424,8 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
if (parent == mSecuritySpinner) {
|
if (parent == mSecuritySpinner) {
|
||||||
mAccessPointSecurity = position;
|
// Convert menu position to actual Wi-Fi security type
|
||||||
|
mAccessPointSecurity = mSecurityInPosition[position];
|
||||||
showSecurityFields();
|
showSecurityFields();
|
||||||
} else if (parent == mEapMethodSpinner || parent == mEapCaCertSpinner) {
|
} else if (parent == mEapMethodSpinner || parent == mEapCaCertSpinner) {
|
||||||
showSecurityFields();
|
showSecurityFields();
|
||||||
@@ -1459,4 +1470,53 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
public AccessPoint getAccessPoint() {
|
public AccessPoint getAccessPoint() {
|
||||||
return mAccessPoint;
|
return mAccessPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void configureSecuritySpinner() {
|
||||||
|
mConfigUi.setTitle(R.string.wifi_add_network);
|
||||||
|
|
||||||
|
mSsidView = (TextView) mView.findViewById(R.id.ssid);
|
||||||
|
mSsidView.addTextChangedListener(this);
|
||||||
|
mSecuritySpinner = ((Spinner) mView.findViewById(R.id.security));
|
||||||
|
mSecuritySpinner.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(mContext,
|
||||||
|
android.R.layout.simple_spinner_item, android.R.id.text1);
|
||||||
|
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
mSecuritySpinner.setAdapter(spinnerAdapter);
|
||||||
|
int idx = 0;
|
||||||
|
|
||||||
|
// Populate the Wi-Fi security spinner with the various supported key management types
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_none));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_NONE;
|
||||||
|
if (mWifiManager.isOweSupported()) {
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_owe));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_OWE;
|
||||||
|
}
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_wep));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_WEP;
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_wpa_wpa2));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_PSK;
|
||||||
|
if (mWifiManager.isWpa3SaeSupported()) {
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_sae));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_SAE;
|
||||||
|
}
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_eap));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_EAP;
|
||||||
|
if (mWifiManager.isWpa3SuiteBSupported()) {
|
||||||
|
spinnerAdapter.add(mContext.getString(R.string.wifi_security_eap_suiteb));
|
||||||
|
mSecurityInPosition[idx++] = AccessPoint.SECURITY_EAP_SUITE_B;
|
||||||
|
}
|
||||||
|
|
||||||
|
spinnerAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
mView.findViewById(R.id.type).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
showIpConfigFields();
|
||||||
|
showProxyFields();
|
||||||
|
mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
|
||||||
|
// Hidden option can be changed only when the user adds a network manually.
|
||||||
|
mView.findViewById(R.id.hidden_settings_field).setVisibility(View.VISIBLE);
|
||||||
|
((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox))
|
||||||
|
.setOnCheckedChangeListener(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,16 +22,19 @@ import static org.mockito.Mockito.any;
|
|||||||
import static org.mockito.Mockito.anyBoolean;
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
import static org.mockito.Mockito.anyInt;
|
import static org.mockito.Mockito.anyInt;
|
||||||
import static org.mockito.Mockito.anyString;
|
import static org.mockito.Mockito.anyString;
|
||||||
|
import static org.mockito.Mockito.doReturn;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.ServiceSpecificException;
|
import android.os.ServiceSpecificException;
|
||||||
import android.security.KeyStore;
|
import android.security.KeyStore;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -298,6 +301,74 @@ public class WifiConfigControllerTest {
|
|||||||
assertThat(hiddenField.getVisibility()).isEqualTo(View.VISIBLE);
|
assertThat(hiddenField.getVisibility()).isEqualTo(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void securitySpinner_saeSuitebAndOweNotVisible() {
|
||||||
|
securitySpinnerTestHelper(false, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void securitySpinner_saeSuitebAndOweVisible() {
|
||||||
|
securitySpinnerTestHelper(true, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void securitySpinner_saeVisible_suitebAndOweNotVisible() {
|
||||||
|
securitySpinnerTestHelper(true, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void securitySpinner_oweVisible_suitebAndSaeNotVisible() {
|
||||||
|
securitySpinnerTestHelper(false, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void securitySpinnerTestHelper(boolean saeVisible, boolean suitebVisible,
|
||||||
|
boolean oweVisible) {
|
||||||
|
WifiManager wifiManager = mock(WifiManager.class);
|
||||||
|
when(wifiManager.isWpa3SaeSupported()).thenReturn(saeVisible ? true : false);
|
||||||
|
when(wifiManager.isWpa3SuiteBSupported()).thenReturn(suitebVisible ? true : false);
|
||||||
|
when(wifiManager.isOweSupported()).thenReturn(oweVisible ? true : false);
|
||||||
|
|
||||||
|
mController = new TestWifiConfigController(mConfigUiBase, mView, null /* accessPoint */,
|
||||||
|
WifiConfigUiBase.MODE_MODIFY, wifiManager);
|
||||||
|
|
||||||
|
final Spinner securitySpinner = ((Spinner) mView.findViewById(R.id.security));
|
||||||
|
final ArrayAdapter<String> adapter = (ArrayAdapter) securitySpinner.getAdapter();
|
||||||
|
boolean saeFound = false;
|
||||||
|
boolean suitebFound = false;
|
||||||
|
boolean oweFound = false;
|
||||||
|
for (int i = 0; i < adapter.getCount(); i++) {
|
||||||
|
String val = adapter.getItem(i);
|
||||||
|
|
||||||
|
if (val.compareTo(mContext.getString(R.string.wifi_security_sae)) == 0) {
|
||||||
|
saeFound = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val.compareTo(mContext.getString(R.string.wifi_security_eap_suiteb)) == 0) {
|
||||||
|
suitebFound = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val.compareTo(mContext.getString(R.string.wifi_security_owe)) == 0) {
|
||||||
|
oweFound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saeVisible) {
|
||||||
|
assertThat(saeFound).isTrue();
|
||||||
|
} else {
|
||||||
|
assertThat(saeFound).isFalse();
|
||||||
|
}
|
||||||
|
if (suitebVisible) {
|
||||||
|
assertThat(suitebFound).isTrue();
|
||||||
|
} else {
|
||||||
|
assertThat(suitebFound).isFalse();
|
||||||
|
}
|
||||||
|
if (oweVisible) {
|
||||||
|
assertThat(oweFound).isTrue();
|
||||||
|
} else {
|
||||||
|
assertThat(oweFound).isFalse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class TestWifiConfigController extends WifiConfigController {
|
public class TestWifiConfigController extends WifiConfigController {
|
||||||
|
|
||||||
private TestWifiConfigController(
|
private TestWifiConfigController(
|
||||||
@@ -305,6 +376,12 @@ public class WifiConfigControllerTest {
|
|||||||
super(parent, view, accessPoint, mode);
|
super(parent, view, accessPoint, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TestWifiConfigController(
|
||||||
|
WifiConfigUiBase parent, View view, AccessPoint accessPoint, int mode,
|
||||||
|
WifiManager wifiManager) {
|
||||||
|
super(parent, view, accessPoint, mode, wifiManager);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean isSplitSystemUser() {
|
boolean isSplitSystemUser() {
|
||||||
return false;
|
return false;
|
||||||
|
@@ -66,11 +66,11 @@ public class WifiTetherSecurityPreferenceControllerTest {
|
|||||||
public void onPreferenceChange_securityValueUpdated() {
|
public void onPreferenceChange_securityValueUpdated() {
|
||||||
mController.onPreferenceChange(mPreference, WPA2_PSK);
|
mController.onPreferenceChange(mPreference, WPA2_PSK);
|
||||||
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
||||||
assertThat(mPreference.getSummary()).isEqualTo("WPA2-Personal");
|
assertThat(mPreference.getSummary().toString()).isEqualTo("WPA2-Personal");
|
||||||
|
|
||||||
mController.onPreferenceChange(mPreference, NONE);
|
mController.onPreferenceChange(mPreference, NONE);
|
||||||
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.NONE);
|
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.NONE);
|
||||||
assertThat(mPreference.getSummary()).isEqualTo("None");
|
assertThat(mPreference.getSummary().toString()).isEqualTo("None");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -79,7 +79,7 @@ public class WifiTetherSecurityPreferenceControllerTest {
|
|||||||
when(mWifiManager.getWifiApConfiguration()).thenReturn(null);
|
when(mWifiManager.getWifiApConfiguration()).thenReturn(null);
|
||||||
mController.updateDisplay();
|
mController.updateDisplay();
|
||||||
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
||||||
assertThat(mPreference.getSummary()).isEqualTo("WPA2-Personal");
|
assertThat(mPreference.getSummary().toString()).isEqualTo("WPA2-Personal");
|
||||||
|
|
||||||
// test open tether network
|
// test open tether network
|
||||||
when(mWifiManager.getWifiApConfiguration()).thenReturn(mConfig);
|
when(mWifiManager.getWifiApConfiguration()).thenReturn(mConfig);
|
||||||
@@ -87,13 +87,13 @@ public class WifiTetherSecurityPreferenceControllerTest {
|
|||||||
mConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
|
mConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
|
||||||
mController.updateDisplay();
|
mController.updateDisplay();
|
||||||
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.NONE);
|
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.NONE);
|
||||||
assertThat(mPreference.getSummary()).isEqualTo("None");
|
assertThat(mPreference.getSummary().toString()).isEqualTo("None");
|
||||||
|
|
||||||
// test WPA2-Personal tether network
|
// test WPA2-Personal tether network
|
||||||
mConfig.allowedKeyManagement.clear();
|
mConfig.allowedKeyManagement.clear();
|
||||||
mConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
mConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
||||||
mController.updateDisplay();
|
mController.updateDisplay();
|
||||||
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
||||||
assertThat(mPreference.getSummary()).isEqualTo("WPA2-Personal");
|
assertThat(mPreference.getSummary().toString()).isEqualTo("WPA2-Personal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user