diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-04-17 02:17:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-17 02:17:44 +0000 |
commit | 84e590ea26498f9a1baa1ec1ee711dd31952fc74 (patch) | |
tree | cd88c4c6d4f5c5f460aa655d101d1b34eff14b89 | |
parent | 43c1e848f2b848a02738f3ccce7440c331e9262b (diff) | |
parent | 36ded65ee26a3c8a98d4b8ab83abb24d602d7877 (diff) |
Merge "[WifiKeyStore] Check needKeyStore before requesting keyStore service" into qt-dev
-rw-r--r-- | service/java/com/android/server/wifi/WifiKeyStore.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/service/java/com/android/server/wifi/WifiKeyStore.java b/service/java/com/android/server/wifi/WifiKeyStore.java index a22be9b51..c1706a20d 100644 --- a/service/java/com/android/server/wifi/WifiKeyStore.java +++ b/service/java/com/android/server/wifi/WifiKeyStore.java @@ -278,22 +278,24 @@ public class WifiKeyStore { */ public boolean updateNetworkKeys(WifiConfiguration config, WifiConfiguration existingConfig) { WifiEnterpriseConfig enterpriseConfig = config.enterpriseConfig; - if (needsKeyStore(enterpriseConfig)) { - try { - /* config passed may include only fields being updated. - * In order to generate the key id, fetch uninitialized - * fields from the currently tracked configuration - */ - String keyId = config.getKeyIdForCredentials(existingConfig); - if (!installKeys(existingConfig != null - ? existingConfig.enterpriseConfig : null, enterpriseConfig, keyId)) { - Log.e(TAG, config.SSID + ": failed to install keys"); - return false; - } - } catch (IllegalStateException e) { - Log.e(TAG, config.SSID + " invalid config for key installation: " + e.getMessage()); + if (!needsKeyStore(enterpriseConfig)) { + return true; + } + + try { + /* config passed may include only fields being updated. + * In order to generate the key id, fetch uninitialized + * fields from the currently tracked configuration + */ + String keyId = config.getKeyIdForCredentials(existingConfig); + if (!installKeys(existingConfig != null + ? existingConfig.enterpriseConfig : null, enterpriseConfig, keyId)) { + Log.e(TAG, config.SSID + ": failed to install keys"); return false; } + } catch (IllegalStateException e) { + Log.e(TAG, config.SSID + " invalid config for key installation: " + e.getMessage()); + return false; } // For WPA3-Enterprise 192-bit networks, set the SuiteBCipher field based on the |