Put code that updates the access points lists inside a Handler.

When access point is forgot, we got callbacks from WifiManager to tell
us if the forget action is successful or not. We will refresh the access
point list in both cases. However, these callbacks happens on a
different thread and updating preferences should only be done on the
main thread. Creating a handler to handler all updates in the main
thread.

Change-Id: I7593befb20e46391ad69a284375693351a2cc794
Fixes: 65745404
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-09-20 14:40:40 -07:00
parent 10ba1f1ee7
commit e76df1ca34
3 changed files with 130 additions and 8 deletions

View File

@@ -14,10 +14,32 @@ public class WifiManagerWrapper {
mWifiManager = wifiManager;
}
/**
* Gets the real WifiManager
* @return the real WifiManager
*/
public WifiManager getWifiManager() {
return mWifiManager;
}
/**
* {@link WifiManager#getCurrentNetworkWpsNfcConfigurationToken}
*/
public String getCurrentNetworkWpsNfcConfigurationToken() {
return mWifiManager.getCurrentNetworkWpsNfcConfigurationToken();
}
/**
* {@link WifiManager#removePasspointConfiguration}
*/
public void removePasspointConfiguration(String fqdn) {
mWifiManager.removePasspointConfiguration(fqdn);
}
/**
* {@link WifiManager#removePasspointConfiguration}
*/
public void forget(int netId, WifiManager.ActionListener listener) {
mWifiManager.forget(netId, listener);
}
}