diff options
author | Roshan Pius <rpius@google.com> | 2020-04-09 16:38:36 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-04-11 04:38:59 +0000 |
commit | 71709e04c9430c2a86a0906d6513fea0d8d8b2b3 (patch) | |
tree | cfef27e152c5d0d2ce33eae9cbe39c8628c81bb2 /wifi/java | |
parent | e715d2f0e77317787f7ce3124728b4af135d403a (diff) |
WifiConfiguration: Add a method to check if keymgmt needs preShareKey
Bug: 153435438
Test: atest android.net.wifi
Change-Id: If67d853000d99f32204bf0b8b95465909e8740e2
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index b110a6139429..71f0ab8087ab 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -2973,4 +2973,15 @@ public class WifiConfiguration implements Parcelable { */ public boolean isMostRecentlyConnected = false; + /** + * Whether the key mgmt indicates if the WifiConfiguration needs a preSharedKey or not. + * @return true if preSharedKey is needed, false otherwise. + * @hide + */ + public boolean needsPreSharedKey() { + return allowedKeyManagement.get(KeyMgmt.WPA_PSK) + || allowedKeyManagement.get(KeyMgmt.SAE) + || allowedKeyManagement.get(KeyMgmt.WAPI_PSK); + } + } |