summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-04-23 06:14:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-23 06:14:19 +0000
commit2f40bd06971989c6c9d5e5f5ea5c1c6243a6db4e (patch)
treed2a0d46d7bf3dfc5c12f7015d559f426084f51c1 /wifi
parent3f99e1db08da6680bebb15ac8a0aa50b48d69f0e (diff)
parent444473fbc083355c978ceb0476de56fc3af16f4c (diff)
downloadandroid_hardware_interfaces-2f40bd06971989c6c9d5e5f5ea5c1c6243a6db4e.tar.gz
android_hardware_interfaces-2f40bd06971989c6c9d5e5f5ea5c1c6243a6db4e.tar.bz2
android_hardware_interfaces-2f40bd06971989c6c9d5e5f5ea5c1c6243a6db4e.zip
Merge "wifi(implementation): Simplify getFirstActiveWlanIfaceName" into qt-dev
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.3/default/wifi_chip.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/wifi/1.3/default/wifi_chip.cpp b/wifi/1.3/default/wifi_chip.cpp
index 25eb28983..b768959f2 100644
--- a/wifi/1.3/default/wifi_chip.cpp
+++ b/wifi/1.3/default/wifi_chip.cpp
@@ -1436,14 +1436,11 @@ bool WifiChip::isStaApConcurrencyAllowedInCurrentMode() {
}
std::string WifiChip::getFirstActiveWlanIfaceName() {
- for (unsigned idx = 0; idx < kMaxWlanIfaces; idx++) {
- const auto ifname = getWlanIfaceName(idx);
- if (findUsingName(sta_ifaces_, ifname)) return ifname;
- if (findUsingName(ap_ifaces_, ifname)) return ifname;
- }
+ if (sta_ifaces_.size() > 0) return sta_ifaces_[0]->getName();
+ if (ap_ifaces_.size() > 0) return ap_ifaces_[0]->getName();
// This could happen if the chip call is made before any STA/AP
// iface is created. Default to wlan0 for such cases.
- LOG(WARNING) << "No active wlan interfaces in use!";
+ LOG(WARNING) << "No active wlan interfaces in use! Using default";
return getWlanIfaceName(0);
}