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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user