Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b333464 authored by Roshan Pius's avatar Roshan Pius
Browse files

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
parent 36728984
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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);
}