summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-07-23 11:46:52 -0700
committerThe Android Automerger <android-build@google.com>2015-10-27 10:38:41 -0700
commitc6249cce8c5025daf6f2a20fe36b7e517d5943ba (patch)
tree95b24822d1d92a44eba0a4096c130712738a55af
parent5921779b4827551735e9016c6b6a22adf176ec85 (diff)
downloadwifi-lollipop-mr1-release.tar.gz
disconnectFromSupplicant doesn't have any synchronization; so it can cause problems when WifiStateMachine is disconnecting and P2p statemachine is sending commands. Bug: 22667667 Change-Id: I92e6ee44618813341e171f84442791a6403a5010 (cherry picked from commit b577f391af2c484e443c19b3df1d62cc0924692a)
-rw-r--r--service/java/com/android/server/wifi/WifiNative.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index 864976c66..b95db2892 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -141,14 +141,17 @@ public class WifiNative {
}
public boolean connectToSupplicant() {
- // No synchronization necessary .. it is implemented in WifiMonitor
- localLog(mInterfacePrefix + "connectToSupplicant");
- return connectToSupplicantNative();
+ synchronized(mLock) {
+ localLog(mInterfacePrefix + "connectToSupplicant");
+ return connectToSupplicantNative();
+ }
}
public void closeSupplicantConnection() {
- localLog(mInterfacePrefix + "closeSupplicantConnection");
- closeSupplicantConnectionNative();
+ synchronized(mLock) {
+ localLog(mInterfacePrefix + "closeSupplicantConnection");
+ closeSupplicantConnectionNative();
+ }
}
public String waitForEvent() {