summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorVinit Deshapnde <vinitd@google.com>2013-10-03 15:41:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-03 15:41:58 -0700
commit90a5192cd4af89a1b363ca25be2a63d0e57010d4 (patch)
tree35b7d6c5e19da10fe6be92e0d1a0c3e37fffa74a /services
parent2c64e2be0cf2e1fa537a0c0d353f3a8c9d5852d4 (diff)
parente72aa641d38911ed57c81ff4769ebe2c7ebb1397 (diff)
downloadframeworks_base-90a5192cd4af89a1b363ca25be2a63d0e57010d4.zip
frameworks_base-90a5192cd4af89a1b363ca25be2a63d0e57010d4.tar.gz
frameworks_base-90a5192cd4af89a1b363ca25be2a63d0e57010d4.tar.bz2
am e72aa641: am 3eb6e4b4: Merge "Fix EAP-TLS reconnect after reboot issue" into klp-dev
* commit 'e72aa641d38911ed57c81ff4769ebe2c7ebb1397': Fix EAP-TLS reconnect after reboot issue
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wifi/WifiController.java14
-rw-r--r--services/java/com/android/server/wifi/WifiService.java4
2 files changed, 18 insertions, 0 deletions
diff --git a/services/java/com/android/server/wifi/WifiController.java b/services/java/com/android/server/wifi/WifiController.java
index 87b4394..a3d514e 100644
--- a/services/java/com/android/server/wifi/WifiController.java
+++ b/services/java/com/android/server/wifi/WifiController.java
@@ -57,6 +57,7 @@ class WifiController extends StateMachine {
private int mStayAwakeConditions;
private long mIdleMillis;
private int mSleepPolicy;
+ private boolean mFirstUserSignOnSeen = false;
private AlarmManager mAlarmManager;
private PendingIntent mIdleIntent;
@@ -113,6 +114,7 @@ class WifiController extends StateMachine {
static final int CMD_AIRPLANE_TOGGLED = BASE + 9;
static final int CMD_SET_AP = BASE + 10;
static final int CMD_DEFERRED_TOGGLE = BASE + 11;
+ static final int CMD_USER_PRESENT = BASE + 12;
private DefaultState mDefaultState = new DefaultState();
private StaEnabledState mStaEnabledState = new StaEnabledState();
@@ -361,6 +363,9 @@ class WifiController extends StateMachine {
case CMD_AIRPLANE_TOGGLED:
case CMD_EMERGENCY_MODE_CHANGED:
break;
+ case CMD_USER_PRESENT:
+ mFirstUserSignOnSeen = true;
+ break;
case CMD_DEFERRED_TOGGLE:
log("DEFERRED_TOGGLE ignored due to state change");
break;
@@ -639,6 +644,15 @@ class WifiController extends StateMachine {
if (msg.what == CMD_DEVICE_IDLE) {
checkLocksAndTransitionWhenDeviceIdle();
// We let default state handle the rest of work
+ } else if (msg.what == CMD_USER_PRESENT) {
+ // TLS networks can't connect until user unlocks keystore. KeyStore
+ // unlocks when the user punches PIN after the reboot. So use this
+ // trigger to get those networks connected.
+ if (mFirstUserSignOnSeen == false) {
+ mWifiStateMachine.reloadTlsNetworksAndReconnect();
+ }
+ mFirstUserSignOnSeen = true;
+ return HANDLED;
}
return NOT_HANDLED;
}
diff --git a/services/java/com/android/server/wifi/WifiService.java b/services/java/com/android/server/wifi/WifiService.java
index f93a45b..86c68f3 100644
--- a/services/java/com/android/server/wifi/WifiService.java
+++ b/services/java/com/android/server/wifi/WifiService.java
@@ -83,6 +83,7 @@ import static com.android.server.wifi.WifiController.CMD_SCAN_ALWAYS_MODE_CHANGE
import static com.android.server.wifi.WifiController.CMD_SCREEN_OFF;
import static com.android.server.wifi.WifiController.CMD_SCREEN_ON;
import static com.android.server.wifi.WifiController.CMD_SET_AP;
+import static com.android.server.wifi.WifiController.CMD_USER_PRESENT;
import static com.android.server.wifi.WifiController.CMD_WIFI_TOGGLED;
/**
* WifiService handles remote WiFi operation requests by implementing
@@ -1084,6 +1085,8 @@ public final class WifiService extends IWifiManager.Stub {
String action = intent.getAction();
if (action.equals(Intent.ACTION_SCREEN_ON)) {
mWifiController.sendMessage(CMD_SCREEN_ON);
+ } else if (action.equals(Intent.ACTION_USER_PRESENT)) {
+ mWifiController.sendMessage(CMD_USER_PRESENT);
} else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
mWifiController.sendMessage(CMD_SCREEN_OFF);
} else if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {
@@ -1120,6 +1123,7 @@ public final class WifiService extends IWifiManager.Stub {
private void registerForBroadcasts() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_SCREEN_ON);
+ intentFilter.addAction(Intent.ACTION_USER_PRESENT);
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);