jni-android-sys 0.0.10

Autogenerated glue code for access Android JVM APIs from Rust
// WARNING:  This file was autogenerated by jni-bindgen.  Any changes to this file may be lost!!!


#[cfg(any(feature = "all", feature = "android-hardware-usb-UsbDeviceConnection"))]
__jni_bindgen! {
    /// public class [UsbDeviceConnection](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html)
    ///
    /// Required feature: "android-hardware-usb-UsbDeviceConnection"
    public class UsbDeviceConnection ("android/hardware/usb/UsbDeviceConnection") extends crate::java::lang::Object {

        /// [close](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#close())
        pub fn close<'env>(&'env self) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "close", .descriptor == "()V"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "close\0", "()V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [getFileDescriptor](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#getFileDescriptor())
        pub fn getFileDescriptor<'env>(&'env self) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "getFileDescriptor", .descriptor == "()I"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "getFileDescriptor\0", "()I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [getRawDescriptors](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#getRawDescriptors())
        pub fn getRawDescriptors<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, __jni_bindgen::ByteArray>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "getRawDescriptors", .descriptor == "()[B"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "getRawDescriptors\0", "()[B\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [claimInterface](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#claimInterface(android.hardware.usb.UsbInterface,%20boolean))
        ///
        /// Required features: "android-hardware-usb-UsbInterface"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbInterface")))]
        pub fn claimInterface<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbInterface>>, arg1: bool) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "claimInterface", .descriptor == "(Landroid/hardware/usb/UsbInterface;Z)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "claimInterface\0", "(Landroid/hardware/usb/UsbInterface;Z)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [releaseInterface](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#releaseInterface(android.hardware.usb.UsbInterface))
        ///
        /// Required features: "android-hardware-usb-UsbInterface"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbInterface")))]
        pub fn releaseInterface<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbInterface>>) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "releaseInterface", .descriptor == "(Landroid/hardware/usb/UsbInterface;)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "releaseInterface\0", "(Landroid/hardware/usb/UsbInterface;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [setInterface](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#setInterface(android.hardware.usb.UsbInterface))
        ///
        /// Required features: "android-hardware-usb-UsbInterface"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbInterface")))]
        pub fn setInterface<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbInterface>>) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "setInterface", .descriptor == "(Landroid/hardware/usb/UsbInterface;)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "setInterface\0", "(Landroid/hardware/usb/UsbInterface;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [setConfiguration](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#setConfiguration(android.hardware.usb.UsbConfiguration))
        ///
        /// Required features: "android-hardware-usb-UsbConfiguration"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbConfiguration")))]
        pub fn setConfiguration<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbConfiguration>>) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "setConfiguration", .descriptor == "(Landroid/hardware/usb/UsbConfiguration;)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "setConfiguration\0", "(Landroid/hardware/usb/UsbConfiguration;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [controlTransfer](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#controlTransfer(int,%20int,%20int,%20int,%20byte%5B%5D,%20int,%20int))
        pub fn controlTransfer_int_int_int_int_byte_array_int_int<'env>(&'env self, arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env __jni_bindgen::ByteArray>>, arg5: i32, arg6: i32) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "controlTransfer", .descriptor == "(IIII[BII)I"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __jni_bindgen::AsJValue::as_jvalue(&arg1), __jni_bindgen::AsJValue::as_jvalue(&arg2), __jni_bindgen::AsJValue::as_jvalue(&arg3), __jni_bindgen::AsJValue::as_jvalue(&arg4.into()), __jni_bindgen::AsJValue::as_jvalue(&arg5), __jni_bindgen::AsJValue::as_jvalue(&arg6)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "controlTransfer\0", "(IIII[BII)I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [controlTransfer](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#controlTransfer(int,%20int,%20int,%20int,%20byte%5B%5D,%20int,%20int,%20int))
        pub fn controlTransfer_int_int_int_int_byte_array_int_int_int<'env>(&'env self, arg0: i32, arg1: i32, arg2: i32, arg3: i32, arg4: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env __jni_bindgen::ByteArray>>, arg5: i32, arg6: i32, arg7: i32) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "controlTransfer", .descriptor == "(IIII[BIII)I"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __jni_bindgen::AsJValue::as_jvalue(&arg1), __jni_bindgen::AsJValue::as_jvalue(&arg2), __jni_bindgen::AsJValue::as_jvalue(&arg3), __jni_bindgen::AsJValue::as_jvalue(&arg4.into()), __jni_bindgen::AsJValue::as_jvalue(&arg5), __jni_bindgen::AsJValue::as_jvalue(&arg6), __jni_bindgen::AsJValue::as_jvalue(&arg7)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "controlTransfer\0", "(IIII[BIII)I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [bulkTransfer](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#bulkTransfer(android.hardware.usb.UsbEndpoint,%20byte%5B%5D,%20int,%20int))
        ///
        /// Required features: "android-hardware-usb-UsbEndpoint"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbEndpoint")))]
        pub fn bulkTransfer_UsbEndpoint_byte_array_int_int<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbEndpoint>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env __jni_bindgen::ByteArray>>, arg2: i32, arg3: i32) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "bulkTransfer", .descriptor == "(Landroid/hardware/usb/UsbEndpoint;[BII)I"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.into()), __jni_bindgen::AsJValue::as_jvalue(&arg2), __jni_bindgen::AsJValue::as_jvalue(&arg3)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "bulkTransfer\0", "(Landroid/hardware/usb/UsbEndpoint;[BII)I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [bulkTransfer](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#bulkTransfer(android.hardware.usb.UsbEndpoint,%20byte%5B%5D,%20int,%20int,%20int))
        ///
        /// Required features: "android-hardware-usb-UsbEndpoint"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbEndpoint")))]
        pub fn bulkTransfer_UsbEndpoint_byte_array_int_int_int<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbEndpoint>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env __jni_bindgen::ByteArray>>, arg2: i32, arg3: i32, arg4: i32) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "bulkTransfer", .descriptor == "(Landroid/hardware/usb/UsbEndpoint;[BIII)I"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.into()), __jni_bindgen::AsJValue::as_jvalue(&arg2), __jni_bindgen::AsJValue::as_jvalue(&arg3), __jni_bindgen::AsJValue::as_jvalue(&arg4)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "bulkTransfer\0", "(Landroid/hardware/usb/UsbEndpoint;[BIII)I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [requestWait](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#requestWait())
        ///
        /// Required features: "android-hardware-usb-UsbRequest"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbRequest")))]
        pub fn requestWait<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::hardware::usb::UsbRequest>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "requestWait", .descriptor == "()Landroid/hardware/usb/UsbRequest;"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "requestWait\0", "()Landroid/hardware/usb/UsbRequest;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [getSerial](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#getSerial())
        ///
        /// Required features: "java-lang-String"
        #[cfg(any(feature = "all", all(feature = "java-lang-String")))]
        pub fn getSerial<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::lang::String>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbDeviceConnection", java.flags == PUBLIC, .name == "getSerial", .descriptor == "()Ljava/lang/String;"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/hardware/usb/UsbDeviceConnection\0", "getSerial\0", "()Ljava/lang/String;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }
    }
}