shadows/framework/src/main/java/org/robolectric/shadows/ShadowWifiManager.java
@Implementation
  protected int updateNetwork(WifiConfiguration config) {
    if (config == null || config.networkId < 0 || readOnlyNetworkIds.get(config.networkId)) {
      return -1;
    }
    networkIdToConfiguredNetworks.put(config.networkId, makeCopy(config, config.networkId));
    return config.networkId;
  }
@Implementation
  protected int updateNetwork(WifiConfiguration config) {
    if (config == null || config.networkId < 0 || readOnlyNetworkIds.get(config.networkId)) {
      return -1;
    }
    networkIdToConfiguredNetworks.put(config.networkId, makeCopy(config, config.networkId));
    return config.networkId;
  }
Adds or updates a network which can later be retrieved with {@link #getWifiConfiguration(int)}
method. A null {@param config}, or one with a networkId less than 0, or a networkId that had
its updatePermission removed using the {@link #setUpdateNetworkPermission(int, boolean)} will
return -1, which indicates a failure to update.