summaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorvandwalle <vandwalle@google.com>2014-12-09 17:52:35 -0800
committervandwalle <vandwalle@google.com>2014-12-11 16:16:32 -0800
commita1c02f0a73ee35e198e2652cd65b8830a163d9dd (patch)
tree9a28904217c0d0e194725c20e15bc52ea934d527 /service
parent8ccabb81ad304b80dc8eaa162fd322643461529b (diff)
downloadandroid_frameworks_opt_net_wifi-a1c02f0a73ee35e198e2652cd65b8830a163d9dd.tar.gz
android_frameworks_opt_net_wifi-a1c02f0a73ee35e198e2652cd65b8830a163d9dd.tar.bz2
android_frameworks_opt_net_wifi-a1c02f0a73ee35e198e2652cd65b8830a163d9dd.zip
autojoin scanning + P2P
- discard autojoin scan when both infra and P2P are connected - reduce autojoin scan period when P2P is connected and infra is disconnected Bug:18692653 Change-Id: Id1891e6a9f2863d8876915cfefd158fb1712b8fe
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index a1ff29484..69444610a 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -7014,6 +7014,14 @@ public class WifiStateMachine extends StateMachine {
+ " -> obsolete");
return HANDLED;
}
+ if (mP2pConnected.get()) {
+ loge("WifiStateMachine L2Connected CMD_START_SCAN source "
+ + message.arg1
+ + " " + message.arg2 + ", " + mDelayedScanCounter
+ + " ignore because P2P is connected");
+ messageHandlingStatus = MESSAGE_HANDLING_STATUS_DISCARD;
+ return HANDLED;
+ }
boolean tryFullBandScan = false;
boolean restrictChannelList = false;
long now_ms = System.currentTimeMillis();
@@ -7931,8 +7939,14 @@ public class WifiStateMachine extends StateMachine {
if (message.arg1 == SCAN_ALARM_SOURCE) {
// Check if the CMD_START_SCAN message is obsolete (and thus if it should
// not be processed) and restart the scan
+ int period = mDisconnectedScanPeriodMs;
+ if (mP2pConnected.get()) {
+ period = (int)Settings.Global.getLong(mContext.getContentResolver(),
+ Settings.Global.WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS,
+ mDisconnectedScanPeriodMs);
+ }
if (!checkAndRestartDelayedScan(message.arg2,
- true, mDisconnectedScanPeriodMs, null, null)) {
+ true, period, null, null)) {
messageHandlingStatus = MESSAGE_HANDLING_STATUS_OBSOLETE;
loge("WifiStateMachine Disconnected CMD_START_SCAN source "
+ message.arg1
@@ -7968,6 +7982,12 @@ public class WifiStateMachine extends StateMachine {
if (DBG) log("Turn on scanning after p2p disconnected");
sendMessageDelayed(obtainMessage(CMD_NO_NETWORKS_PERIODIC_SCAN,
++mPeriodicScanToken, 0), mSupplicantScanIntervalMs);
+ } else {
+ // If P2P is not connected and there are saved networks, then restart
+ // scanning at the normal period. This is necessary because scanning might
+ // have been disabled altogether if WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS
+ // was set to zero.
+ startDelayedScan(mDisconnectedScanPeriodMs, null, null);
}
case CMD_RECONNECT:
case CMD_REASSOCIATE: