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
diff --git a/wifi/1.3/default/wifi_chip.cpp b/wifi/1.3/default/wifi_chip.cpp
index 906f14a..727aac5 100644
--- a/wifi/1.3/default/wifi_chip.cpp
+++ b/wifi/1.3/default/wifi_chip.cpp
@@ -86,16 +86,15 @@
}
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);
}