- Use the new WifiManager API to retrieve the WPS NFC token for the current network. - Add WifiManagerWrapper class to support testing because Robolectric does not yet support testing Android O. Bug: 35725168 Test: m RunSettingsRoboTests Change-Id: I7805bdcbe02dc262083bcd371d4ad88d256f8089
24 lines
623 B
Java
24 lines
623 B
Java
package com.android.settings.wifi;
|
|
|
|
import android.net.wifi.WifiManager;
|
|
|
|
/**
|
|
* Wrapper around {@link WifiManager} to facilitate unit testing.
|
|
*
|
|
* TODO: delete this class once robolectric supports Android O
|
|
*/
|
|
public class WifiManagerWrapper {
|
|
private final WifiManager mWifiManager;
|
|
|
|
public WifiManagerWrapper(WifiManager wifiManager) {
|
|
mWifiManager = wifiManager;
|
|
}
|
|
|
|
/**
|
|
* {@link WifiManager#getCurrentNetworkWpsNfcConfigurationToken}
|
|
*/
|
|
public String getCurrentNetworkWpsNfcConfigurationToken() {
|
|
return mWifiManager.getCurrentNetworkWpsNfcConfigurationToken();
|
|
}
|
|
}
|