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-net-VpnService"))]
__jni_bindgen! {
    /// public class [VpnService](https://developer.android.com/reference/android/net/VpnService.html)
    ///
    /// Required feature: "android-net-VpnService"
    public class VpnService ("android/net/VpnService") extends crate::android::app::Service {

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

        /// [prepare](https://developer.android.com/reference/android/net/VpnService.html#prepare(android.content.Context))
        ///
        /// Required features: "android-content-Context", "android-content-Intent"
        #[cfg(any(feature = "all", all(feature = "android-content-Context", feature = "android-content-Intent")))]
        pub fn prepare<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::content::Context>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::content::Intent>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/net/VpnService", java.flags == PUBLIC | STATIC, .name == "prepare", .descriptor == "(Landroid/content/Context;)Landroid/content/Intent;"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())];
                let (__jni_class, __jni_method) = __jni_env.require_class_static_method("android/net/VpnService\0", "prepare\0", "(Landroid/content/Context;)Landroid/content/Intent;\0");
                __jni_env.call_static_object_method_a(__jni_class, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [protect](https://developer.android.com/reference/android/net/VpnService.html#protect(int))
        pub fn protect_int<'env>(&'env self, arg0: i32) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/net/VpnService", java.flags == PUBLIC, .name == "protect", .descriptor == "(I)Z"
            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/net/VpnService\0", "protect\0", "(I)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

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

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

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

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

        /// [onRevoke](https://developer.android.com/reference/android/net/VpnService.html#onRevoke())
        pub fn onRevoke<'env>(&'env self) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/net/VpnService", java.flags == PUBLIC, .name == "onRevoke", .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/net/VpnService\0", "onRevoke\0", "()V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// public static final [SERVICE_INTERFACE](https://developer.android.com/reference/android/net/VpnService.html#SERVICE_INTERFACE)
        pub const SERVICE_INTERFACE : &'static str = "android.net.VpnService";

        /// public static final [SERVICE_META_DATA_SUPPORTS_ALWAYS_ON](https://developer.android.com/reference/android/net/VpnService.html#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON)
        pub const SERVICE_META_DATA_SUPPORTS_ALWAYS_ON : &'static str = "android.net.VpnService.SUPPORTS_ALWAYS_ON";
    }
}