summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorlesl <lesl@google.com>2020-03-26 16:38:49 +0800
committerlesl <lesl@google.com>2020-03-26 23:56:55 +0800
commit33da6370769f3d0ba5a6464fe6abdd93d0a8ea8f (patch)
treea5e8f188f98c61b965390cbe670e813bb39bacb9 /service
parent776f77aa028f52fc08c51da38b502014938850ce (diff)
wifi: Add disabling check to avoid enable multi SoftApManager
Issue flow: stopSoftAp ->state change to DISABLING -> startSoftAp call(Allow to enable) -> state change to Enabling -> state update to Disable (Updated by stopSoftAp) -> startSoftAp call again cause multi SoftApManager Bug: 151906797 Test: atest FrameworksWifiTest Change-Id: I3e6ac31c6d9b143bc2e81a650bc7f0b07d407666
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 2e9372874..4e07e5ef3 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1035,8 +1035,10 @@ public class WifiServiceImpl extends BaseWifiService {
public boolean setEnablingIfAllowed() {
synchronized (mLock) {
- if (mTetheredSoftApState == WIFI_AP_STATE_ENABLING) return false;
- if (mTetheredSoftApState == WIFI_AP_STATE_ENABLED) return false;
+ if (mTetheredSoftApState != WIFI_AP_STATE_DISABLED
+ && mTetheredSoftApState != WIFI_AP_STATE_FAILED) {
+ return false;
+ }
mTetheredSoftApState = WIFI_AP_STATE_ENABLING;
return true;
}