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;
@@ -391,6 +392,7 @@ public class WifiConfigController2Test {
private void checkSavedMacRandomizedValue(int macRandomizedValue) {
when(mWifiEntry.isSaved()).thenReturn(true);
final WifiConfiguration mockWifiConfig = mock(WifiConfiguration.class);
when(mockWifiConfig.getIpConfiguration()).thenReturn(mock(IpConfiguration.class));
when(mWifiEntry.getWifiConfiguration()).thenReturn(mockWifiConfig);
mockWifiConfig.macRandomizationSetting = macRandomizedValue;
mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
@@ -505,6 +507,7 @@ public class WifiConfigController2Test {
when(mWifiEntry.isSaved()).thenReturn(true);
when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.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;