+#if MONODROID
+ if (android_use_java_api) {
+ // Starting from API 24 (Android 7 "Nougat") Android restricts access to many
+ // files in the /sys filesystem (see https://code.google.com/p/android/issues/detail?id=205565
+ // for more information) and therefore we are forced to call into Java API in
+ // order to get the information. Alas, what we can obtain in this way is quite
+ // limited. In the case of OperationalStatus we can only determine whether the
+ // interface is up or down. There is a way to get more detailed information but
+ // it requires an instance of the Android Context class which is not available
+ // to us here.
+ bool is_up = false;
+ if (_monodroid_get_network_interface_up_state (Name, ref is_up))
+ return is_up ? OperationalStatus.Up : OperationalStatus.Down;
+ else
+ return OperationalStatus.Unknown;
+ }
+#endif