/**
  * Updates the state as if it were never configured.
  *
  * <p>Note: This will not pass the forget call to the Wi-Fi API.
  */
 public void forget() {
   blockRefresh();
   setConfigured(false);
   setNetworkId(NETWORK_ID_NOT_SET);
   setPrimary(false);
   setStatus(null);
   setDisabled(false);
   unblockRefresh();
 }
 public void updateFromWifiConfiguration(WifiConfiguration wifiConfig) {
   if (wifiConfig != null) {
     blockRefresh();
     setBssid(wifiConfig.BSSID);
     setNetworkId(wifiConfig.networkId);
     setPriority(wifiConfig.priority);
     setHiddenSsid(wifiConfig.hiddenSSID);
     setSsid(wifiConfig.SSID);
     setConfigured(true);
     setDisabled(wifiConfig.status == WifiConfiguration.Status.DISABLED);
     parseWifiConfigurationSecurity(wifiConfig);
     unblockRefresh();
   }
 }