summaryrefslogtreecommitdiffstats
path: root/nexus/WifiNetwork.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nexus/WifiNetwork.cpp')
-rw-r--r--nexus/WifiNetwork.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/nexus/WifiNetwork.cpp b/nexus/WifiNetwork.cpp
index 1f53a20..818b91d 100644
--- a/nexus/WifiNetwork.cpp
+++ b/nexus/WifiNetwork.cpp
@@ -551,6 +551,20 @@ int WifiNetwork::setAllowedGroupCiphers(uint32_t mask) {
}
int WifiNetwork::setEnabled(bool enabled) {
+
+ if (enabled) {
+ if (getPriority() == -1) {
+ LOGE("Cannot enable network when priority is not set");
+ errno = EAGAIN;
+ return -1;
+ }
+ if (getAllowedKeyManagement() == KeyManagementMask::UNKNOWN) {
+ LOGE("Cannot enable network when KeyManagement is not set");
+ errno = EAGAIN;
+ return -1;
+ }
+ }
+
if (mSuppl->enableNetwork(mNetid, enabled))
return -1;