Settings: remove usage of WifiConfig helper methods

These methods can be replaced with methods on
IpConfiguration itself. There is no need to expose
these as a @SystemApi, and they are being removed.

Bug: 146046526
Test: make RunSettingsRoboTests -j40
Change-Id: I592f277f5e23bf58e76b8c48a0f0370d53cc6b81
This commit is contained in:
David Su
2020-01-29 18:16:08 -08:00
parent 8ad24a25ad
commit 59ab4ce478
4 changed files with 22 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ import static org.mockito.Mockito.when;
import android.content.Context;
import android.content.res.Resources;
import android.net.IpConfiguration;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiEnterpriseConfig;
import android.net.wifi.WifiEnterpriseConfig.Eap;
@@ -389,6 +390,7 @@ public class WifiConfigControllerTest {
private void checkSavedMacRandomizedValue(int macRandomizedValue) {
when(mAccessPoint.isSaved()).thenReturn(true);
final WifiConfiguration mockWifiConfig = mock(WifiConfiguration.class);
when(mockWifiConfig.getIpConfiguration()).thenReturn(mock(IpConfiguration.class));
when(mAccessPoint.getConfig()).thenReturn(mockWifiConfig);
mockWifiConfig.macRandomizationSetting = macRandomizedValue;
mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
@@ -503,6 +505,7 @@ public class WifiConfigControllerTest {
when(mAccessPoint.isSaved()).thenReturn(true);
when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
final WifiConfiguration mockWifiConfig = mock(WifiConfiguration.class);
when(mockWifiConfig.getIpConfiguration()).thenReturn(mock(IpConfiguration.class));
final WifiEnterpriseConfig mockWifiEnterpriseConfig = mock(WifiEnterpriseConfig.class);
when(mockWifiEnterpriseConfig.getEapMethod()).thenReturn(Eap.PEAP);
mockWifiConfig.enterpriseConfig = mockWifiEnterpriseConfig ;