diff options
author | Danesh M <daneshm90@gmail.com> | 2016-02-22 16:51:30 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2016-02-22 16:55:13 -0800 |
commit | 78f9faa193e4f3e55140ad9c7b39fa1777532c71 (patch) | |
tree | 5d2f6711c34196790400c17be5e903fd10cc62d4 /packages/SettingsLib | |
parent | e5423f8a731543ae607936e2bbc336fcec1b3cc9 (diff) | |
download | frameworks_base-78f9faa193e4f3e55140ad9c7b39fa1777532c71.zip frameworks_base-78f9faa193e4f3e55140ad9c7b39fa1777532c71.tar.gz frameworks_base-78f9faa193e4f3e55140ad9c7b39fa1777532c71.tar.bz2 |
WifiTracker : Don't queue up duplicate messages for updating access points
Change-Id: If71dc16f19a2d44b6e5132f498125262d22ef9fa
Diffstat (limited to 'packages/SettingsLib')
-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)) { |