diff options
Diffstat (limited to 'packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index ed0371c..fe8f757 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -180,7 +180,9 @@ public class WifiTracker { if (mWifiManager.isWifiEnabled()) { mScanner.resume(); } - mWorkHandler.sendEmptyMessage(WorkHandler.MSG_UPDATE_ACCESS_POINTS); + if (!mWorkHandler.hasMessages(WorkHandler.MSG_UPDATE_ACCESS_POINTS)) { + mWorkHandler.sendEmptyMessage(WorkHandler.MSG_UPDATE_ACCESS_POINTS); + } } /** @@ -507,7 +509,9 @@ public class WifiTracker { } else if (WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.equals(action) || WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION.equals(action) || WifiManager.LINK_CONFIGURATION_CHANGED_ACTION.equals(action)) { - mWorkHandler.sendEmptyMessage(WorkHandler.MSG_UPDATE_ACCESS_POINTS); + if (!mWorkHandler.hasMessages(WorkHandler.MSG_UPDATE_ACCESS_POINTS)) { + mWorkHandler.sendEmptyMessage(WorkHandler.MSG_UPDATE_ACCESS_POINTS); + } } else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) { NetworkInfo info = (NetworkInfo) intent.getParcelableExtra( WifiManager.EXTRA_NETWORK_INFO); @@ -515,7 +519,9 @@ public class WifiTracker { mMainHandler.sendEmptyMessage(MainHandler.MSG_CONNECTED_CHANGED); - mWorkHandler.sendEmptyMessage(WorkHandler.MSG_UPDATE_ACCESS_POINTS); + if (!mWorkHandler.hasMessages(WorkHandler.MSG_UPDATE_ACCESS_POINTS)) { + mWorkHandler.sendEmptyMessage(WorkHandler.MSG_UPDATE_ACCESS_POINTS); + } mWorkHandler.obtainMessage(WorkHandler.MSG_UPDATE_NETWORK_INFO, info) .sendToTarget(); } else if (WifiManager.RSSI_CHANGED_ACTION.equals(action)) { |