Update WriteWifiConfigToNfcDialog.
- 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
This commit is contained in:
23
src/com/android/settings/wifi/WifiManagerWrapper.java
Normal file
23
src/com/android/settings/wifi/WifiManagerWrapper.java
Normal file
@@ -0,0 +1,23 @@
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user