Пример #1
0
 void update(WifiInfo info, DetailedState state) {
   boolean reorder = false;
   if (info != null
       && networkId != WifiConfiguration.INVALID_NETWORK_ID
       && networkId == info.getNetworkId()) {
     reorder = (mInfo == null);
     mRssi = info.getRssi();
     mInfo = info;
     mState = state;
     refresh();
   } else if (mInfo != null) {
     reorder = true;
     mInfo = null;
     mState = null;
     refresh();
   }
   if (reorder) {
     notifyHierarchyChanged();
   }
 }
Пример #2
0
 boolean update(ScanResult result) {
   if (ssid.equals(result.SSID) && security == getSecurity(result)) {
     if (WifiManager.compareSignalLevel(result.level, mRssi) > 0) {
       int oldLevel = getLevel();
       mRssi = result.level;
       if (getLevel() != oldLevel) {
         notifyChanged();
       }
     }
     // This flag only comes from scans, is not easily saved in config
     if (security == SECURITY_PSK) {
       pskType = getPskType(result);
     }
     refresh();
     return true;
   }
   return false;
 }
Пример #3
0
 AccessPoint(Context context, ScanResult result) {
   super(context);
   setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
   loadResult(result);
   refresh();
 }
Пример #4
0
 AccessPoint(Context context, WifiConfiguration config) {
   super(context);
   setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
   loadConfig(config);
   refresh();
 }