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

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

        /// [getConnectionState](https://developer.android.com/reference/android/bluetooth/BluetoothManager.html#getConnectionState(android.bluetooth.BluetoothDevice,%20int))
        ///
        /// Required features: "android-bluetooth-BluetoothDevice"
        #[cfg(any(feature = "all", all(feature = "android-bluetooth-BluetoothDevice")))]
        pub fn getConnectionState<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::bluetooth::BluetoothDevice>>, arg1: i32) -> __jni_bindgen::std::result::Result<i32, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/bluetooth/BluetoothManager", java.flags == PUBLIC, .name == "getConnectionState", .descriptor == "(Landroid/bluetooth/BluetoothDevice;I)I"
            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/bluetooth/BluetoothManager\0", "getConnectionState\0", "(Landroid/bluetooth/BluetoothDevice;I)I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

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

        /// [getDevicesMatchingConnectionStates](https://developer.android.com/reference/android/bluetooth/BluetoothManager.html#getDevicesMatchingConnectionStates(int,%20int%5B%5D))
        ///
        /// Required features: "java-util-List"
        #[cfg(any(feature = "all", all(feature = "java-util-List")))]
        pub fn getDevicesMatchingConnectionStates<'env>(&'env self, arg0: i32, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env __jni_bindgen::IntArray>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::util::List>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/bluetooth/BluetoothManager", java.flags == PUBLIC, .name == "getDevicesMatchingConnectionStates", .descriptor == "(I[I)Ljava/util/List;"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __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/bluetooth/BluetoothManager\0", "getDevicesMatchingConnectionStates\0", "(I[I)Ljava/util/List;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

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