-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetworkInterface.list not implemented on Android #26329
Comments
@zanderso FYI |
https://codereview.chromium.org/1916223003/ ifaddrs.h still does not exist in the NDK, so to support this API, we'll have to implement as suggested in the comment in socket_android.cc. In the meantime, I've fixed the crash, and added NetworkInterface.listSupported. |
Previously, Socket::ListInterfaces failed to set the os_error out parameter causing a crash in the caller. This change sets an error here. I've also added NetworkInterface.listSupported, which returns false on Android, and true everywhere else. ifaddrs.h continues not to exist in the NDK, so in order to support NetworkInterface.list, we'd have to reimplement it, or find a suitable reimplementation somewhere. related #26329 R=johnmccutchan@google.com Review URL: https://codereview.chromium.org/1916223003 .
It looks like we landed @zanderso 's patch. Can we close this issue? |
Reopening since it appears ifaddrs.h is available as of Android API level 24 (August 2016). If we can take advantage of that API level, then we can implement this feature. |
It would be ideal if we could do this in a way that supports <API24 as well. WebRTC has an implementation that does this, for example. |
Can you link to that implementation? I guess that would require making a raw system call. |
My preference would be to see something like
Flutter, for example, currently supports down to API 16. I'd like to use this call in Flutter, but wouldn't be able to if it requires API 24 (which for Dart VM and the Engine, is a compile time flag). |
The #if should probably be more like this: #if __ANDROID_API__ >= 24
// use NDK
#else
// use system calls, e.g. the way that WebRTC does it
#endif // __ANDROID_API__ |
See flutter/flutter#205
The text was updated successfully, but these errors were encountered: