diff options
author | Roshan Pius <rpius@google.com> | 2019-07-29 13:24:21 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-08-06 12:19:13 -0700 |
commit | 840cdc08391ef0f24adf2f46fa1ea017d3d5eac4 (patch) | |
tree | 368755f953467c41b4214f543314cb517d8c29d1 /service | |
parent | e2921b824d04071ae5dcea6d594986b3eeda0752 (diff) |
WifiService: Ignore wifi state change API in crypt debounce state
When the device is in crypt debounce state (transitioning to full disk
encryption), we don't start wifi stack. Hence WifiController state
machine is not initialized in this state and any public API calls from
settings or other parts of the system will cause a crash. Handle this
state more gracefully by explicitly failing all the state change API's
in this
state.
Bug: 136799715
Test: atest com.android.server.wifi.WifiServiceImplTest
Change-Id: I36a603c01b1421bfa5e015696902946154ea0989
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index b25a84593..ea1be63eb 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -893,6 +893,11 @@ public class WifiServiceImpl extends BaseWifiService { return false; } + // If we're in crypt debounce, ignore any wifi state change APIs. + if (mFrameworkFacade.inStorageManagerCryptKeeperBounce()) { + return false; + } + mLog.info("setWifiEnabled package=% uid=% enable=%").c(packageName) .c(Binder.getCallingUid()).c(enable).flush(); long ident = Binder.clearCallingIdentity(); @@ -1045,6 +1050,10 @@ public class WifiServiceImpl extends BaseWifiService { public boolean startSoftAp(WifiConfiguration wifiConfig) { // NETWORK_STACK is a signature only permission. enforceNetworkStackPermission(); + // If we're in crypt debounce, ignore any wifi state change APIs. + if (mFrameworkFacade.inStorageManagerCryptKeeperBounce()) { + return false; + } mLog.info("startSoftAp uid=%").c(Binder.getCallingUid()).flush(); @@ -1091,6 +1100,10 @@ public class WifiServiceImpl extends BaseWifiService { public boolean stopSoftAp() { // NETWORK_STACK is a signature only permission. enforceNetworkStackPermission(); + // If we're in crypt debounce, ignore any wifi state change APIs. + if (mFrameworkFacade.inStorageManagerCryptKeeperBounce()) { + return false; + } // only permitted callers are allowed to this point - they must have gone through // connectivity service since this method is protected with the NETWORK_STACK PERMISSION @@ -1421,6 +1434,10 @@ public class WifiServiceImpl extends BaseWifiService { return LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE; } + if (mFrameworkFacade.inStorageManagerCryptKeeperBounce()) { + return LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE; + } + mLog.info("startLocalOnlyHotspot uid=% pid=%").c(uid).c(pid).flush(); synchronized (mLocalOnlyHotspotRequests) { |