summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-07-14 21:35:36 -0400
committerMike Lockwood <lockwood@android.com>2009-07-14 21:44:30 -0400
commite2a5385c70b48b57476a0c8c52bad4ea40398641 (patch)
tree3bce146e2dc81fe4cee2b5edf3e4b7ef27353feb /wifi/java/android/net
parentc047d68372ece9fa74446b13ea66bc12b060b882 (diff)
parentf77035193152a0edba5abeb33d9c1a5f446c7dd8 (diff)
downloadframeworks_base-e2a5385c70b48b57476a0c8c52bad4ea40398641.zip
frameworks_base-e2a5385c70b48b57476a0c8c52bad4ea40398641.tar.gz
frameworks_base-e2a5385c70b48b57476a0c8c52bad4ea40398641.tar.bz2
resolved conflicts for merge of f7703519 to master
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r--wifi/java/android/net/wifi/WifiStateTracker.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index a2cdcc1..12abce5 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -242,6 +242,7 @@ public class WifiStateTracker extends NetworkStateTracker {
private SettingsObserver mSettingsObserver;
private boolean mIsScanModeActive;
+ private boolean mEnableRssiPolling;
// Wi-Fi run states:
private static final int RUN_STATE_STARTING = 1;
@@ -340,6 +341,7 @@ public class WifiStateTracker extends NetworkStateTracker {
private void setSupplicantState(SupplicantState state) {
mWifiInfo.setSupplicantState(state);
updateNetworkInfo();
+ checkPollTimer();
}
public SupplicantState getSupplicantState() {
@@ -354,6 +356,7 @@ public class WifiStateTracker extends NetworkStateTracker {
private void setSupplicantState(String stateName) {
mWifiInfo.setSupplicantState(stateName);
updateNetworkInfo();
+ checkPollTimer();
}
/**
@@ -550,8 +553,10 @@ public class WifiStateTracker extends NetworkStateTracker {
* Set the interval timer for polling connection information
* that is not delivered asynchronously.
*/
- private synchronized void setPollTimer () {
- if (!hasMessages(EVENT_POLL_INTERVAL)) {
+ private synchronized void checkPollTimer() {
+ if (mEnableRssiPolling &&
+ mWifiInfo.getSupplicantState() == SupplicantState.COMPLETED &&
+ !hasMessages(EVENT_POLL_INTERVAL)) {
sendEmptyMessageDelayed(EVENT_POLL_INTERVAL, POLL_STATUS_INTERVAL_MSECS);
}
}
@@ -651,6 +656,13 @@ public class WifiStateTracker extends NetworkStateTracker {
setBluetoothScanMode(isBluetoothPlaying);
}
+ public void enableRssiPolling(boolean enable) {
+ if (mEnableRssiPolling != enable) {
+ mEnableRssiPolling = enable;
+ checkPollTimer();
+ }
+ }
+
@Override
public void releaseWakeLock() {
if (mReleaseWakeLockCallback != null) {
@@ -1031,9 +1043,7 @@ public class WifiStateTracker extends NetworkStateTracker {
case EVENT_POLL_INTERVAL:
if (mWifiInfo.getSupplicantState() != SupplicantState.UNINITIALIZED) {
requestPolledInfo(mWifiInfo, true);
- if (mWifiInfo.getSupplicantState() == SupplicantState.COMPLETED) {
- setPollTimer();
- }
+ checkPollTimer();
}
break;
@@ -1170,7 +1180,7 @@ public class WifiStateTracker extends NetworkStateTracker {
}
private void configureInterface() {
- setPollTimer();
+ checkPollTimer();
mLastSignalLevel = -1;
if (!mUseStaticIp) {
if (!mHaveIpAddress && !mObtainingIpAddress) {