Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.2
-
-
21
-
Foundation PM Staging
Description
I run code below on Pixel 3A with Android 11.
It prints:
QNetworkInterface::Unknown QHostAddress("10.108.19.194") QAbstractSocket::IPv4Protocol "rmnet_data1" QNetworkInterface::Unknown QHostAddress("192.168.1.121") QAbstractSocket::IPv4Protocol "wlan0" QNetworkInterface::Unknown QHostAddress("127.0.0.1") QAbstractSocket::IPv4Protocol "lo"
As can you see `ifc.type()` always return `QNetworkInterface::Unknown`.
I expect QNetworkInterface::Wifi for "wlan0", 192.168.1.121 this is address that gives wifi router to phone, "rmnet_data1" is 4G network interface (have no idea what proper QNetworkInterface::InterfaceType), and "lo" should have QNetworkInterface::Loopback type.
auto interfaces = QNetworkInterface::allInterfaces(); for (const auto &ifc : interfaces) { const auto container = ifc.addressEntries(); for (const auto &addr : container) { qDebug() << ifc.type() << addr.ip() << addr.ip().protocol() << ifc.name(); } }
Attachments
Issue Links
- resulted from
-
QTBUG-86394 QNetworkInterface methods broken when targeting Android 11 (API-30)
- Closed