コード例 #1
0
 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();
   }
 }
コード例 #2
0
 public void updateFromWifiInfo(WifiInfo wifiInfo, NetworkInfo.DetailedState state) {
   if (wifiInfo != null) {
     blockRefresh();
     setBssid(wifiInfo.getBSSID());
     setLinkSpeed(wifiInfo.getLinkSpeed());
     setNetworkId(wifiInfo.getNetworkId());
     setIpAddress(wifiInfo.getIpAddress());
     setSsid(wifiInfo.getSSID());
     if (state != null) {
       setStatus(state);
     }
     setHiddenSsid(wifiInfo.getHiddenSSID());
     unblockRefresh();
   }
 }
コード例 #3
0
  public void updateFromScanResult(ScanResult scanResult) {
    blockRefresh();

    // We don't keep specific AP BSSIDs and instead leave that as wildcard

    setSeen(true);
    setSsid(scanResult.SSID);
    if (networkId == NETWORK_ID_NOT_SET) {
      // Since ScanResults don't cross-reference network ID, we set it as a wildcard
      setNetworkId(NETWORK_ID_ANY);
    }
    setSignal(scanResult.level);
    setSecurity(getScanResultSecurity(scanResult));
    unblockRefresh();
  }