diff options
author | Purushottam Kushwaha <pkushwah@codeaurora.org> | 2018-05-04 14:31:15 +0530 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2020-04-17 20:40:45 +0200 |
commit | 26d9c2a4ab696cbdcfe71b7a80afa1a97cc172e2 (patch) | |
tree | 98cfae539efeb10081f3f75f48ba933419b8176b | |
parent | 0b36f8d81199840e126930b4b226b4bb20b85b11 (diff) | |
download | android_hardware_interfaces-26d9c2a4ab696cbdcfe71b7a80afa1a97cc172e2.tar.gz android_hardware_interfaces-26d9c2a4ab696cbdcfe71b7a80afa1a97cc172e2.tar.bz2 android_hardware_interfaces-26d9c2a4ab696cbdcfe71b7a80afa1a97cc172e2.zip |
wifi: Fetch softap interface name for creating ap_iface operations.
softap interface name could varry from platform to platform and
may need for addiitional features. This commit gets softap interface
name by property_get on "persist.vendor.wifi.softap.interface".
If not set, it will fall back to use either of available interface
in "wifi.interface" or "wifi.concurrent.interface".
This property can either be set via .rc files or at runtime by any
module.
CRs-Fixed: 2243203
Change-Id: Iec1684f6cdf8963e71bc0c40ca296ac6a79472ee
-rw-r--r-- | wifi/1.3/default/wifi_chip.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wifi/1.3/default/wifi_chip.cpp b/wifi/1.3/default/wifi_chip.cpp index e9991dcee..0d33ae6e2 100644 --- a/wifi/1.3/default/wifi_chip.cpp +++ b/wifi/1.3/default/wifi_chip.cpp @@ -107,6 +107,12 @@ std::string getP2pIfaceName() { return buffer.data(); } +std::string getApIfaceName() { + std::array<char, PROPERTY_VALUE_MAX> buffer; + property_get("persist.vendor.wifi.softap.interface", buffer.data(), ""); + return buffer.data(); +} + void setActiveWlanIfaceNameProperty(const std::string& ifname) { auto res = property_set(kActiveWlanIfaceNameProperty, ifname.data()); if (res != 0) { @@ -805,7 +811,9 @@ std::pair<WifiStatus, sp<IWifiApIface>> WifiChip::createApIfaceInternal() { if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } - std::string ifname = allocateApIfaceName(); + std::string ifname = getApIfaceName(); + if (ifname.empty()) + ifname = allocateApIfaceName(); sp<WifiApIface> iface = new WifiApIface(ifname, legacy_hal_, iface_util_, feature_flags_); ap_ifaces_.push_back(iface); |