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-UsbManager"))]
__jni_bindgen! {
    /// public class [UsbManager](https://developer.android.com/reference/android/hardware/usb/UsbManager.html)
    ///
    /// Required feature: "android-hardware-usb-UsbManager"
    public class UsbManager ("android/hardware/usb/UsbManager") extends crate::java::lang::Object {

        /// [getDeviceList](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#getDeviceList())
        ///
        /// Required features: "java-util-HashMap"
        #[cfg(any(feature = "all", all(feature = "java-util-HashMap")))]
        pub fn getDeviceList<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::util::HashMap>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "getDeviceList", .descriptor == "()Ljava/util/HashMap;"
            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/UsbManager\0", "getDeviceList\0", "()Ljava/util/HashMap;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [openDevice](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#openDevice(android.hardware.usb.UsbDevice))
        ///
        /// Required features: "android-hardware-usb-UsbDevice", "android-hardware-usb-UsbDeviceConnection"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbDevice", feature = "android-hardware-usb-UsbDeviceConnection")))]
        pub fn openDevice<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbDevice>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::hardware::usb::UsbDeviceConnection>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "openDevice", .descriptor == "(Landroid/hardware/usb/UsbDevice;)Landroid/hardware/usb/UsbDeviceConnection;"
            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/UsbManager\0", "openDevice\0", "(Landroid/hardware/usb/UsbDevice;)Landroid/hardware/usb/UsbDeviceConnection;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [getAccessoryList](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#getAccessoryList())
        ///
        /// Required features: "android-hardware-usb-UsbAccessory"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbAccessory")))]
        pub fn getAccessoryList<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, __jni_bindgen::ObjectArray<crate::android::hardware::usb::UsbAccessory, crate::java::lang::Throwable>>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "getAccessoryList", .descriptor == "()[Landroid/hardware/usb/UsbAccessory;"
            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/UsbManager\0", "getAccessoryList\0", "()[Landroid/hardware/usb/UsbAccessory;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [openAccessory](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#openAccessory(android.hardware.usb.UsbAccessory))
        ///
        /// Required features: "android-hardware-usb-UsbAccessory", "android-os-ParcelFileDescriptor"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbAccessory", feature = "android-os-ParcelFileDescriptor")))]
        pub fn openAccessory<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbAccessory>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::os::ParcelFileDescriptor>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "openAccessory", .descriptor == "(Landroid/hardware/usb/UsbAccessory;)Landroid/os/ParcelFileDescriptor;"
            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/UsbManager\0", "openAccessory\0", "(Landroid/hardware/usb/UsbAccessory;)Landroid/os/ParcelFileDescriptor;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [hasPermission](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#hasPermission(android.hardware.usb.UsbDevice))
        ///
        /// Required features: "android-hardware-usb-UsbDevice"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbDevice")))]
        pub fn hasPermission_UsbDevice<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbDevice>>) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "hasPermission", .descriptor == "(Landroid/hardware/usb/UsbDevice;)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/UsbManager\0", "hasPermission\0", "(Landroid/hardware/usb/UsbDevice;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [hasPermission](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#hasPermission(android.hardware.usb.UsbAccessory))
        ///
        /// Required features: "android-hardware-usb-UsbAccessory"
        #[cfg(any(feature = "all", all(feature = "android-hardware-usb-UsbAccessory")))]
        pub fn hasPermission_UsbAccessory<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbAccessory>>) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "hasPermission", .descriptor == "(Landroid/hardware/usb/UsbAccessory;)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/UsbManager\0", "hasPermission\0", "(Landroid/hardware/usb/UsbAccessory;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [requestPermission](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#requestPermission(android.hardware.usb.UsbDevice,%20android.app.PendingIntent))
        ///
        /// Required features: "android-app-PendingIntent", "android-hardware-usb-UsbDevice"
        #[cfg(any(feature = "all", all(feature = "android-app-PendingIntent", feature = "android-hardware-usb-UsbDevice")))]
        pub fn requestPermission_UsbDevice_PendingIntent<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbDevice>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::app::PendingIntent>>) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "requestPermission", .descriptor == "(Landroid/hardware/usb/UsbDevice;Landroid/app/PendingIntent;)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.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/UsbManager\0", "requestPermission\0", "(Landroid/hardware/usb/UsbDevice;Landroid/app/PendingIntent;)V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [requestPermission](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#requestPermission(android.hardware.usb.UsbAccessory,%20android.app.PendingIntent))
        ///
        /// Required features: "android-app-PendingIntent", "android-hardware-usb-UsbAccessory"
        #[cfg(any(feature = "all", all(feature = "android-app-PendingIntent", feature = "android-hardware-usb-UsbAccessory")))]
        pub fn requestPermission_UsbAccessory_PendingIntent<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::hardware::usb::UsbAccessory>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::app::PendingIntent>>) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/hardware/usb/UsbManager", java.flags == PUBLIC, .name == "requestPermission", .descriptor == "(Landroid/hardware/usb/UsbAccessory;Landroid/app/PendingIntent;)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.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/UsbManager\0", "requestPermission\0", "(Landroid/hardware/usb/UsbAccessory;Landroid/app/PendingIntent;)V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// public static final [ACTION_USB_DEVICE_ATTACHED](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#ACTION_USB_DEVICE_ATTACHED)
        pub const ACTION_USB_DEVICE_ATTACHED : &'static str = "android.hardware.usb.action.USB_DEVICE_ATTACHED";

        /// public static final [ACTION_USB_DEVICE_DETACHED](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#ACTION_USB_DEVICE_DETACHED)
        pub const ACTION_USB_DEVICE_DETACHED : &'static str = "android.hardware.usb.action.USB_DEVICE_DETACHED";

        /// public static final [ACTION_USB_ACCESSORY_ATTACHED](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#ACTION_USB_ACCESSORY_ATTACHED)
        pub const ACTION_USB_ACCESSORY_ATTACHED : &'static str = "android.hardware.usb.action.USB_ACCESSORY_ATTACHED";

        /// public static final [ACTION_USB_ACCESSORY_DETACHED](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#ACTION_USB_ACCESSORY_DETACHED)
        pub const ACTION_USB_ACCESSORY_DETACHED : &'static str = "android.hardware.usb.action.USB_ACCESSORY_DETACHED";

        /// public static final [EXTRA_DEVICE](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#EXTRA_DEVICE)
        pub const EXTRA_DEVICE : &'static str = "device";

        /// public static final [EXTRA_ACCESSORY](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#EXTRA_ACCESSORY)
        pub const EXTRA_ACCESSORY : &'static str = "accessory";

        /// public static final [EXTRA_PERMISSION_GRANTED](https://developer.android.com/reference/android/hardware/usb/UsbManager.html#EXTRA_PERMISSION_GRANTED)
        pub const EXTRA_PERMISSION_GRANTED : &'static str = "permission";
    }
}