Loading packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +3 −52 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.net.ScoredNetwork; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiEnterpriseConfig; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiNetworkScoreCache; Loading Loading @@ -181,9 +180,6 @@ public class AccessPoint implements Comparable<AccessPoint> { static final String KEY_CONFIG = "key_config"; static final String KEY_FQDN = "key_fqdn"; static final String KEY_PROVIDER_FRIENDLY_NAME = "key_provider_friendly_name"; static final String KEY_IS_CARRIER_AP = "key_is_carrier_ap"; static final String KEY_CARRIER_AP_EAP_TYPE = "key_carrier_ap_eap_type"; static final String KEY_CARRIER_NAME = "key_carrier_name"; static final String KEY_EAPTYPE = "eap_psktype"; static final String KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS = "key_subscription_expiration_time_in_millis"; Loading Loading @@ -265,8 +261,6 @@ public class AccessPoint implements Comparable<AccessPoint> { @PasspointConfigurationVersion private int mPasspointConfigurationVersion = PasspointConfigurationVersion.INVALID; private boolean mIsCarrierAp = false; private OsuProvider mOsuProvider; private String mOsuStatus; Loading @@ -276,12 +270,6 @@ public class AccessPoint implements Comparable<AccessPoint> { private boolean mIsPskSaeTransitionMode = false; private boolean mIsOweTransitionMode = false; /** * The EAP type {@link WifiEnterpriseConfig.Eap} associated with this AP if it is a carrier AP. */ private int mCarrierApEapType = WifiEnterpriseConfig.Eap.NONE; private String mCarrierName = null; public AccessPoint(Context context, Bundle savedState) { mContext = context; Loading Loading @@ -330,15 +318,6 @@ public class AccessPoint implements Comparable<AccessPoint> { if (savedState.containsKey(KEY_PROVIDER_FRIENDLY_NAME)) { mProviderFriendlyName = savedState.getString(KEY_PROVIDER_FRIENDLY_NAME); } if (savedState.containsKey(KEY_IS_CARRIER_AP)) { mIsCarrierAp = savedState.getBoolean(KEY_IS_CARRIER_AP); } if (savedState.containsKey(KEY_CARRIER_AP_EAP_TYPE)) { mCarrierApEapType = savedState.getInt(KEY_CARRIER_AP_EAP_TYPE); } if (savedState.containsKey(KEY_CARRIER_NAME)) { mCarrierName = savedState.getString(KEY_CARRIER_NAME); } if (savedState.containsKey(KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS)) { mSubscriptionExpirationTimeInMillis = savedState.getLong(KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS); Loading Loading @@ -966,10 +945,6 @@ public class AccessPoint implements Comparable<AccessPoint> { mIsPskSaeTransitionMode = AccessPoint.isPskSaeTransitionMode(bestResult); mIsOweTransitionMode = AccessPoint.isOweTransitionMode(bestResult); mIsCarrierAp = bestResult.isCarrierAp; mCarrierApEapType = bestResult.carrierApEapType; mCarrierName = bestResult.carrierName; } // Update the config SSID of a Passpoint network to that of the best RSSI if (isPasspoint()) { Loading Loading @@ -1094,18 +1069,6 @@ public class AccessPoint implements Comparable<AccessPoint> { return null; } public boolean isCarrierAp() { return mIsCarrierAp; } public int getCarrierApEapType() { return mCarrierApEapType; } public String getCarrierName() { return mCarrierName; } public String getSavedNetworkSummary() { WifiConfiguration config = mConfig; if (config != null) { Loading Loading @@ -1181,15 +1144,9 @@ public class AccessPoint implements Comparable<AccessPoint> { summary.append(mContext.getString(R.string.tap_to_sign_up)); } } else if (isActive()) { if (getDetailedState() == DetailedState.CONNECTED && mIsCarrierAp) { // This is the active connection on a carrier AP summary.append(String.format(mContext.getString(R.string.connected_via_carrier), mCarrierName)); } else { summary.append(getSummary(mContext, /* ssid */ null, getDetailedState(), mInfo != null && mInfo.isEphemeral(), mInfo != null ? mInfo.getAppPackageName() : null)); } } else { // not active if (mConfig != null && mConfig.hasNoInternetAccess()) { int messageID = mConfig.getNetworkSelectionStatus().isNetworkPermanentlyDisabled() Loading @@ -1213,9 +1170,6 @@ public class AccessPoint implements Comparable<AccessPoint> { summary.append(mContext.getString(R.string.wifi_disabled_generic)); break; } } else if (mIsCarrierAp) { summary.append(String.format(mContext.getString( R.string.available_via_carrier), mCarrierName)); } else if (!isReachable()) { // Wifi out of range summary.append(mContext.getString(R.string.wifi_not_in_range)); } else { // In range, not disabled. Loading Loading @@ -1427,9 +1381,6 @@ public class AccessPoint implements Comparable<AccessPoint> { if (mProviderFriendlyName != null) { savedState.putString(KEY_PROVIDER_FRIENDLY_NAME, mProviderFriendlyName); } savedState.putBoolean(KEY_IS_CARRIER_AP, mIsCarrierAp); savedState.putInt(KEY_CARRIER_AP_EAP_TYPE, mCarrierApEapType); savedState.putString(KEY_CARRIER_NAME, mCarrierName); savedState.putLong(KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS, mSubscriptionExpirationTimeInMillis); savedState.putInt(KEY_PASSPOINT_CONFIGURATION_VERSION, mPasspointConfigurationVersion); Loading packages/SettingsLib/src/com/android/settingslib/wifi/TestAccessPointBuilder.java +0 −16 Original line number Diff line number Diff line Loading @@ -56,8 +56,6 @@ public class TestAccessPointBuilder { private int mSecurity = AccessPoint.SECURITY_NONE; private WifiConfiguration mWifiConfig; private WifiInfo mWifiInfo; private boolean mIsCarrierAp = false; private String mCarrierName = null; Context mContext; private ArrayList<ScanResult> mScanResults; Loading Loading @@ -99,10 +97,6 @@ public class TestAccessPointBuilder { } bundle.putInt(AccessPoint.KEY_SECURITY, mSecurity); bundle.putInt(AccessPoint.KEY_SPEED, mSpeed); bundle.putBoolean(AccessPoint.KEY_IS_CARRIER_AP, mIsCarrierAp); if (mCarrierName != null) { bundle.putString(AccessPoint.KEY_CARRIER_NAME, mCarrierName); } AccessPoint ap = new AccessPoint(mContext, bundle); ap.setRssi(mRssi); Loading Loading @@ -241,16 +235,6 @@ public class TestAccessPointBuilder { return this; } public TestAccessPointBuilder setIsCarrierAp(boolean isCarrierAp) { mIsCarrierAp = isCarrierAp; return this; } public TestAccessPointBuilder setCarrierName(String carrierName) { mCarrierName = carrierName; return this; } public TestAccessPointBuilder setScoredNetworkCache( ArrayList<TimestampedScoredNetwork> scoredNetworkCache) { mScoredNetworkCache = scoredNetworkCache; Loading packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java +9 −72 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.content.Context; import android.content.ContextWrapper; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Resources; Loading @@ -40,7 +41,6 @@ import android.net.WifiKey; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiEnterpriseConfig; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiNetworkScoreCache; Loading Loading @@ -472,51 +472,6 @@ public class AccessPointTest { R.string.wifi_check_password_try_again)); } @Test public void testSummaryString_showsAvaiableViaCarrier() { String carrierName = "Test Carrier"; ScanResult result = new ScanResult(); result.BSSID = "00:11:22:33:44:55"; result.capabilities = "EAP"; result.isCarrierAp = true; result.carrierApEapType = WifiEnterpriseConfig.Eap.SIM; result.carrierName = carrierName; AccessPoint ap = new AccessPoint(mContext, Collections.singletonList(result)); assertThat(ap.getSummary()).isEqualTo(String.format(mContext.getString( R.string.available_via_carrier), carrierName)); assertThat(ap.isCarrierAp()).isEqualTo(true); assertThat(ap.getCarrierApEapType()).isEqualTo(WifiEnterpriseConfig.Eap.SIM); assertThat(ap.getCarrierName()).isEqualTo(carrierName); } @Test public void testSummaryString_showsConnectedViaCarrier() { int networkId = 123; int rssi = -55; String carrierName = "Test Carrier"; WifiConfiguration config = new WifiConfiguration(); config.networkId = networkId; WifiInfo wifiInfo = new WifiInfo(); wifiInfo.setNetworkId(networkId); wifiInfo.setRssi(rssi); NetworkInfo networkInfo = new NetworkInfo(ConnectivityManager.TYPE_WIFI, 0 /* subtype */, "WIFI", ""); networkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, "", ""); AccessPoint ap = new TestAccessPointBuilder(mContext) .setNetworkInfo(networkInfo) .setNetworkId(networkId) .setRssi(rssi) .setWifiInfo(wifiInfo) .setIsCarrierAp(true) .setCarrierName(carrierName) .build(); assertThat(ap.getSummary()).isEqualTo(String.format(mContext.getString( R.string.connected_via_carrier), carrierName)); } @Test public void testSummaryString_showsDisconnected() { AccessPoint ap = createAccessPointWithScanResultCache(); Loading Loading @@ -580,31 +535,6 @@ public class AccessPointTest { assertThat(ap.getSummary()).isEqualTo("Connected via Test App"); } @Test public void testSetScanResultWithCarrierInfo() { String ssid = "ssid"; AccessPoint ap = new TestAccessPointBuilder(mContext).setSsid(ssid).build(); assertThat(ap.isCarrierAp()).isEqualTo(false); assertThat(ap.getCarrierApEapType()).isEqualTo(WifiEnterpriseConfig.Eap.NONE); assertThat(ap.getCarrierName()).isEqualTo(null); int carrierApEapType = WifiEnterpriseConfig.Eap.SIM; String carrierName = "Test Carrier"; ScanResult scanResult = new ScanResult(); scanResult.SSID = ssid; scanResult.BSSID = "00:11:22:33:44:55"; scanResult.capabilities = ""; scanResult.isCarrierAp = true; scanResult.carrierApEapType = carrierApEapType; scanResult.carrierName = carrierName; ap.setScanResults(Collections.singletonList(scanResult)); assertThat(ap.isCarrierAp()).isEqualTo(true); assertThat(ap.getCarrierApEapType()).isEqualTo(carrierApEapType); assertThat(ap.getCarrierName()).isEqualTo(carrierName); } private ScoredNetwork buildScoredNetworkWithMockBadgeCurve() { return buildScoredNetworkWithGivenBadgeCurve(mockBadgeCurve); } Loading Loading @@ -1435,8 +1365,15 @@ public class AccessPointTest { */ @Test public void testOsuAccessPointSummary_showsProvisioningUpdates() { AccessPoint osuAccessPoint = new AccessPoint(mContext, createOsuProvider(), OsuProvider provider = createOsuProvider(); Context spyContext = spy(new ContextWrapper(mContext)); AccessPoint osuAccessPoint = new AccessPoint(spyContext, provider, mScanResults); Map<OsuProvider, PasspointConfiguration> osuProviderConfigMap = new HashMap<>(); osuProviderConfigMap.put(provider, null); when(spyContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mMockWifiManager); when(mMockWifiManager.getMatchingPasspointConfigsForOsuProviders( Collections.singleton(provider))).thenReturn(osuProviderConfigMap); osuAccessPoint.setListener(mMockAccessPointListener); Loading Loading
packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +3 −52 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.net.ScoredNetwork; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiEnterpriseConfig; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiNetworkScoreCache; Loading Loading @@ -181,9 +180,6 @@ public class AccessPoint implements Comparable<AccessPoint> { static final String KEY_CONFIG = "key_config"; static final String KEY_FQDN = "key_fqdn"; static final String KEY_PROVIDER_FRIENDLY_NAME = "key_provider_friendly_name"; static final String KEY_IS_CARRIER_AP = "key_is_carrier_ap"; static final String KEY_CARRIER_AP_EAP_TYPE = "key_carrier_ap_eap_type"; static final String KEY_CARRIER_NAME = "key_carrier_name"; static final String KEY_EAPTYPE = "eap_psktype"; static final String KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS = "key_subscription_expiration_time_in_millis"; Loading Loading @@ -265,8 +261,6 @@ public class AccessPoint implements Comparable<AccessPoint> { @PasspointConfigurationVersion private int mPasspointConfigurationVersion = PasspointConfigurationVersion.INVALID; private boolean mIsCarrierAp = false; private OsuProvider mOsuProvider; private String mOsuStatus; Loading @@ -276,12 +270,6 @@ public class AccessPoint implements Comparable<AccessPoint> { private boolean mIsPskSaeTransitionMode = false; private boolean mIsOweTransitionMode = false; /** * The EAP type {@link WifiEnterpriseConfig.Eap} associated with this AP if it is a carrier AP. */ private int mCarrierApEapType = WifiEnterpriseConfig.Eap.NONE; private String mCarrierName = null; public AccessPoint(Context context, Bundle savedState) { mContext = context; Loading Loading @@ -330,15 +318,6 @@ public class AccessPoint implements Comparable<AccessPoint> { if (savedState.containsKey(KEY_PROVIDER_FRIENDLY_NAME)) { mProviderFriendlyName = savedState.getString(KEY_PROVIDER_FRIENDLY_NAME); } if (savedState.containsKey(KEY_IS_CARRIER_AP)) { mIsCarrierAp = savedState.getBoolean(KEY_IS_CARRIER_AP); } if (savedState.containsKey(KEY_CARRIER_AP_EAP_TYPE)) { mCarrierApEapType = savedState.getInt(KEY_CARRIER_AP_EAP_TYPE); } if (savedState.containsKey(KEY_CARRIER_NAME)) { mCarrierName = savedState.getString(KEY_CARRIER_NAME); } if (savedState.containsKey(KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS)) { mSubscriptionExpirationTimeInMillis = savedState.getLong(KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS); Loading Loading @@ -966,10 +945,6 @@ public class AccessPoint implements Comparable<AccessPoint> { mIsPskSaeTransitionMode = AccessPoint.isPskSaeTransitionMode(bestResult); mIsOweTransitionMode = AccessPoint.isOweTransitionMode(bestResult); mIsCarrierAp = bestResult.isCarrierAp; mCarrierApEapType = bestResult.carrierApEapType; mCarrierName = bestResult.carrierName; } // Update the config SSID of a Passpoint network to that of the best RSSI if (isPasspoint()) { Loading Loading @@ -1094,18 +1069,6 @@ public class AccessPoint implements Comparable<AccessPoint> { return null; } public boolean isCarrierAp() { return mIsCarrierAp; } public int getCarrierApEapType() { return mCarrierApEapType; } public String getCarrierName() { return mCarrierName; } public String getSavedNetworkSummary() { WifiConfiguration config = mConfig; if (config != null) { Loading Loading @@ -1181,15 +1144,9 @@ public class AccessPoint implements Comparable<AccessPoint> { summary.append(mContext.getString(R.string.tap_to_sign_up)); } } else if (isActive()) { if (getDetailedState() == DetailedState.CONNECTED && mIsCarrierAp) { // This is the active connection on a carrier AP summary.append(String.format(mContext.getString(R.string.connected_via_carrier), mCarrierName)); } else { summary.append(getSummary(mContext, /* ssid */ null, getDetailedState(), mInfo != null && mInfo.isEphemeral(), mInfo != null ? mInfo.getAppPackageName() : null)); } } else { // not active if (mConfig != null && mConfig.hasNoInternetAccess()) { int messageID = mConfig.getNetworkSelectionStatus().isNetworkPermanentlyDisabled() Loading @@ -1213,9 +1170,6 @@ public class AccessPoint implements Comparable<AccessPoint> { summary.append(mContext.getString(R.string.wifi_disabled_generic)); break; } } else if (mIsCarrierAp) { summary.append(String.format(mContext.getString( R.string.available_via_carrier), mCarrierName)); } else if (!isReachable()) { // Wifi out of range summary.append(mContext.getString(R.string.wifi_not_in_range)); } else { // In range, not disabled. Loading Loading @@ -1427,9 +1381,6 @@ public class AccessPoint implements Comparable<AccessPoint> { if (mProviderFriendlyName != null) { savedState.putString(KEY_PROVIDER_FRIENDLY_NAME, mProviderFriendlyName); } savedState.putBoolean(KEY_IS_CARRIER_AP, mIsCarrierAp); savedState.putInt(KEY_CARRIER_AP_EAP_TYPE, mCarrierApEapType); savedState.putString(KEY_CARRIER_NAME, mCarrierName); savedState.putLong(KEY_SUBSCRIPTION_EXPIRATION_TIME_IN_MILLIS, mSubscriptionExpirationTimeInMillis); savedState.putInt(KEY_PASSPOINT_CONFIGURATION_VERSION, mPasspointConfigurationVersion); Loading
packages/SettingsLib/src/com/android/settingslib/wifi/TestAccessPointBuilder.java +0 −16 Original line number Diff line number Diff line Loading @@ -56,8 +56,6 @@ public class TestAccessPointBuilder { private int mSecurity = AccessPoint.SECURITY_NONE; private WifiConfiguration mWifiConfig; private WifiInfo mWifiInfo; private boolean mIsCarrierAp = false; private String mCarrierName = null; Context mContext; private ArrayList<ScanResult> mScanResults; Loading Loading @@ -99,10 +97,6 @@ public class TestAccessPointBuilder { } bundle.putInt(AccessPoint.KEY_SECURITY, mSecurity); bundle.putInt(AccessPoint.KEY_SPEED, mSpeed); bundle.putBoolean(AccessPoint.KEY_IS_CARRIER_AP, mIsCarrierAp); if (mCarrierName != null) { bundle.putString(AccessPoint.KEY_CARRIER_NAME, mCarrierName); } AccessPoint ap = new AccessPoint(mContext, bundle); ap.setRssi(mRssi); Loading Loading @@ -241,16 +235,6 @@ public class TestAccessPointBuilder { return this; } public TestAccessPointBuilder setIsCarrierAp(boolean isCarrierAp) { mIsCarrierAp = isCarrierAp; return this; } public TestAccessPointBuilder setCarrierName(String carrierName) { mCarrierName = carrierName; return this; } public TestAccessPointBuilder setScoredNetworkCache( ArrayList<TimestampedScoredNetwork> scoredNetworkCache) { mScoredNetworkCache = scoredNetworkCache; Loading
packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java +9 −72 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.content.Context; import android.content.ContextWrapper; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Resources; Loading @@ -40,7 +41,6 @@ import android.net.WifiKey; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiEnterpriseConfig; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiNetworkScoreCache; Loading Loading @@ -472,51 +472,6 @@ public class AccessPointTest { R.string.wifi_check_password_try_again)); } @Test public void testSummaryString_showsAvaiableViaCarrier() { String carrierName = "Test Carrier"; ScanResult result = new ScanResult(); result.BSSID = "00:11:22:33:44:55"; result.capabilities = "EAP"; result.isCarrierAp = true; result.carrierApEapType = WifiEnterpriseConfig.Eap.SIM; result.carrierName = carrierName; AccessPoint ap = new AccessPoint(mContext, Collections.singletonList(result)); assertThat(ap.getSummary()).isEqualTo(String.format(mContext.getString( R.string.available_via_carrier), carrierName)); assertThat(ap.isCarrierAp()).isEqualTo(true); assertThat(ap.getCarrierApEapType()).isEqualTo(WifiEnterpriseConfig.Eap.SIM); assertThat(ap.getCarrierName()).isEqualTo(carrierName); } @Test public void testSummaryString_showsConnectedViaCarrier() { int networkId = 123; int rssi = -55; String carrierName = "Test Carrier"; WifiConfiguration config = new WifiConfiguration(); config.networkId = networkId; WifiInfo wifiInfo = new WifiInfo(); wifiInfo.setNetworkId(networkId); wifiInfo.setRssi(rssi); NetworkInfo networkInfo = new NetworkInfo(ConnectivityManager.TYPE_WIFI, 0 /* subtype */, "WIFI", ""); networkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, "", ""); AccessPoint ap = new TestAccessPointBuilder(mContext) .setNetworkInfo(networkInfo) .setNetworkId(networkId) .setRssi(rssi) .setWifiInfo(wifiInfo) .setIsCarrierAp(true) .setCarrierName(carrierName) .build(); assertThat(ap.getSummary()).isEqualTo(String.format(mContext.getString( R.string.connected_via_carrier), carrierName)); } @Test public void testSummaryString_showsDisconnected() { AccessPoint ap = createAccessPointWithScanResultCache(); Loading Loading @@ -580,31 +535,6 @@ public class AccessPointTest { assertThat(ap.getSummary()).isEqualTo("Connected via Test App"); } @Test public void testSetScanResultWithCarrierInfo() { String ssid = "ssid"; AccessPoint ap = new TestAccessPointBuilder(mContext).setSsid(ssid).build(); assertThat(ap.isCarrierAp()).isEqualTo(false); assertThat(ap.getCarrierApEapType()).isEqualTo(WifiEnterpriseConfig.Eap.NONE); assertThat(ap.getCarrierName()).isEqualTo(null); int carrierApEapType = WifiEnterpriseConfig.Eap.SIM; String carrierName = "Test Carrier"; ScanResult scanResult = new ScanResult(); scanResult.SSID = ssid; scanResult.BSSID = "00:11:22:33:44:55"; scanResult.capabilities = ""; scanResult.isCarrierAp = true; scanResult.carrierApEapType = carrierApEapType; scanResult.carrierName = carrierName; ap.setScanResults(Collections.singletonList(scanResult)); assertThat(ap.isCarrierAp()).isEqualTo(true); assertThat(ap.getCarrierApEapType()).isEqualTo(carrierApEapType); assertThat(ap.getCarrierName()).isEqualTo(carrierName); } private ScoredNetwork buildScoredNetworkWithMockBadgeCurve() { return buildScoredNetworkWithGivenBadgeCurve(mockBadgeCurve); } Loading Loading @@ -1435,8 +1365,15 @@ public class AccessPointTest { */ @Test public void testOsuAccessPointSummary_showsProvisioningUpdates() { AccessPoint osuAccessPoint = new AccessPoint(mContext, createOsuProvider(), OsuProvider provider = createOsuProvider(); Context spyContext = spy(new ContextWrapper(mContext)); AccessPoint osuAccessPoint = new AccessPoint(spyContext, provider, mScanResults); Map<OsuProvider, PasspointConfiguration> osuProviderConfigMap = new HashMap<>(); osuProviderConfigMap.put(provider, null); when(spyContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mMockWifiManager); when(mMockWifiManager.getMatchingPasspointConfigsForOsuProviders( Collections.singleton(provider))).thenReturn(osuProviderConfigMap); osuAccessPoint.setListener(mMockAccessPointListener); Loading