boolean update(ScanResult result) { if (matches(result)) { /* Update the LRU timestamp, if BSSID exists */ mScanResultCache.get(result.BSSID); /* Add or update the scan result for the BSSID */ mScanResultCache.put(result.BSSID, result); int oldLevel = getLevel(); int oldRssi = getRssi(); mSeen = getSeen(); mRssi = (getRssi() + oldRssi) / 2; int newLevel = getLevel(); if (newLevel > 0 && newLevel != oldLevel && mAccessPointListener != null) { mAccessPointListener.onLevelChanged(this); } // This flag only comes from scans, is not easily saved in config if (security == SECURITY_PSK) { pskType = getPskType(result); } if (mAccessPointListener != null) { mAccessPointListener.onAccessPointChanged(this); } return true; } return false; }
void update(WifiConfiguration config) { mConfig = config; networkId = config.networkId; if (mAccessPointListener != null) { mAccessPointListener.onAccessPointChanged(this); } }
boolean update(WifiConfiguration config, WifiInfo info, NetworkInfo networkInfo) { boolean reorder = false; if (info != null && isInfoForThisAccessPoint(config, info)) { reorder = (mInfo == null); mRssi = info.getRssi(); mInfo = info; mNetworkInfo = networkInfo; if (mAccessPointListener != null) { mAccessPointListener.onAccessPointChanged(this); } } else if (mInfo != null) { reorder = true; mInfo = null; mNetworkInfo = null; if (mAccessPointListener != null) { mAccessPointListener.onAccessPointChanged(this); } } return reorder; }