wpa_supplicant(hidl): Use overlay conf file only if it exists
For devices that doesn't have a vendor overlay conf file, we should not
specify it in interface creation params to the core.
Note: Since we've moved the interface params inside the HIDL interface
(from .rc), we'll need to cater to the needs of the different devices
in our tree.
Bug: 36645291
Test: Locally tested wifi enable on GCE
Test: Treehugger tests should pass now.
Test: Toggled wifi on taimen & ensured that the overlay file is used.
Change-Id: Iccb358aa3e3ddeb985467ef78e066e489d3a1fe1
diff --git a/wpa_supplicant/hidl/1.1/supplicant.cpp b/wpa_supplicant/hidl/1.1/supplicant.cpp
index 43d1e21..7631eac 100644
--- a/wpa_supplicant/hidl/1.1/supplicant.cpp
+++ b/wpa_supplicant/hidl/1.1/supplicant.cpp
@@ -283,7 +283,10 @@
{}};
}
iface_params.confname = kP2pIfaceConfPath;
- iface_params.confanother = kP2pIfaceConfOverlayPath;
+ int ret = access(kP2pIfaceConfOverlayPath, R_OK);
+ if (ret == 0) {
+ iface_params.confanother = kP2pIfaceConfOverlayPath;
+ }
} else {
if (ensureConfigFileExists(
kStaIfaceConfPath, kOldStaIfaceConfPath) != 0) {
@@ -295,7 +298,10 @@
{}};
}
iface_params.confname = kStaIfaceConfPath;
- iface_params.confanother = kStaIfaceConfOverlayPath;
+ int ret = access(kStaIfaceConfOverlayPath, R_OK);
+ if (ret == 0) {
+ iface_params.confanother = kStaIfaceConfOverlayPath;
+ }
}
iface_params.ifname = iface_info.name.c_str();
struct wpa_supplicant* wpa_s =