summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-03-01 14:07:22 -0800
committerRoshan Pius <rpius@google.com>2019-03-01 14:08:47 -0800
commit5b3334648bb1decf51d46cf1a05dc2924b22619e (patch)
tree85d2d98037098c5385a8152090271c378d3bd925 /wifi
parent36728984b180d6d30d0f3a35a291e45a4418539b (diff)
downloadandroid_hardware_interfaces-5b3334648bb1decf51d46cf1a05dc2924b22619e.tar.gz
android_hardware_interfaces-5b3334648bb1decf51d46cf1a05dc2924b22619e.tar.bz2
android_hardware_interfaces-5b3334648bb1decf51d46cf1a05dc2924b22619e.zip
wifi(implementation): Fix spammy log
wifi.interface.0, etc should only be checked if the primary property used on most devices (wifi.interface & wifi.concurrent.interface) does not exist. wifi.interface.0, etc should only defined on Android auto platforms. Bug: 126925255 Test: Manually verified that the spammy log does not exist Change-Id: Ib5e6a87a7da2d4b26cdd35f668385b503e7c8006
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.3/default/wifi_chip.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/wifi/1.3/default/wifi_chip.cpp b/wifi/1.3/default/wifi_chip.cpp
index 906f14a1c..727aac534 100644
--- a/wifi/1.3/default/wifi_chip.cpp
+++ b/wifi/1.3/default/wifi_chip.cpp
@@ -86,16 +86,15 @@ std::string getWlanIfaceName(unsigned idx) {
}
std::array<char, PROPERTY_VALUE_MAX> buffer;
- std::string propName = "wifi.interface." + std::to_string(idx);
- auto res = property_get(propName.c_str(), buffer.data(), nullptr);
- if (res > 0) return buffer.data();
-
if (idx == 0 || idx == 1) {
const char* altPropName =
(idx == 0) ? "wifi.interface" : "wifi.concurrent.interface";
- res = property_get(altPropName, buffer.data(), nullptr);
+ auto res = property_get(altPropName, buffer.data(), nullptr);
if (res > 0) return buffer.data();
}
+ std::string propName = "wifi.interface." + std::to_string(idx);
+ auto res = property_get(propName.c_str(), buffer.data(), nullptr);
+ if (res > 0) return buffer.data();
return "wlan" + std::to_string(idx);
}