Is there a way to get system file descriptor (socket or file number as int) from Android's FileDescriptor object? I'd like to access file descriptor directly in JNI code without using any Java wrappers.
Edit: I've found getParcelFileDescriptorFD and that FileDescriptor has int field named "descriptor", example usage in media/jni/android_media_MediaPlayer.cpp; func definition is in frameworks/base/core/jni/android_util_Binder.cpp; field itself is in libcore/luni/src/main/java/java/io/FileDescriptor.java (http://3.ly/l8O)
But this is not part of official documented API. Is there a documented "right" way to do that?