#[rustfmt::skip] // This file has been automatically generated by `jnim` from `Application.class`. // DO NOT EDIT use jnim::*; use crate::android::content::ComponentCallbacks; use crate::android::content::ComponentCallbacks2; use crate::android::content::ComponentCallbacks2Object; use crate::android::content::ComponentCallbacksObject; use crate::android::content::ContextWrapper; pub struct Application { __object: JObject, __supper: ContextWrapper, __component_callbacks2: ComponentCallbacks2Object, __component_callbacks: ComponentCallbacksObject, } impl JNameMaker for Application { const JAVA_PATH: &'static [u8] = b"android/app/Application\0"; } impl JPlainMarker for Application { fn class(env: Option<&JEnv>) -> Option { static CACHE: CachedID = CachedID::new(); CACHE.get(|| JEnv::env(env)?.find_class(Self::JAVA_PATH)) } } impl core::ops::Deref for Application { type Target = ContextWrapper; fn deref(&self) -> &Self::Target { &self.__supper } } impl AsRef for Application { fn as_ref(&self) -> &ContextWrapper { &self.__supper } } impl AsRef for Application { fn as_ref(&self) -> &JObject { &self.__object } } // impl interfaces impl ComponentCallbacks2 for Application {} impl AsRef for Application { fn as_ref(&self) -> &ComponentCallbacks2Object { &self.__component_callbacks2 } } impl ComponentCallbacks for Application {} impl AsRef for Application { fn as_ref(&self) -> &ComponentCallbacksObject { &self.__component_callbacks } } // field impl Application {} // method impl Application { pub fn get_process_name<'a>(env: &'a JEnv) -> Option<&'a JString> { let class = Self::class(Some(env))?; static CACHE: CachedID = CachedID::new(); CACHE .get(|| class.method_static(env, b"getProcessName\0", b"()Ljava/lang/String;\0"))? .call(env, class, ()) } pub fn on_create<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onCreate\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_terminate<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onTerminate\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_configuration_changed<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::content::res::Configuration) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onConfigurationChanged\0", b"(Landroid/content/res/Configuration;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn on_low_memory<'a>(&'a self, env: &'a JEnv) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onLowMemory\0", b"()V\0"))? .call(env, self.as_ref(), ()) } pub fn on_trim_memory<'a>(&'a self, env: &'a JEnv, arg0: JInt) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"onTrimMemory\0", b"(I)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn register_component_callbacks<'a>( &'a self, env: &'a JEnv, arg0: &'a crate::android::content::ComponentCallbacksObject, ) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"registerComponentCallbacks\0", b"(Landroid/content/ComponentCallbacks;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn unregister_component_callbacks<'a>( &'a self, env: &'a JEnv, arg0: &'a crate::android::content::ComponentCallbacksObject, ) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"unregisterComponentCallbacks\0", b"(Landroid/content/ComponentCallbacks;)V\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn register_activity_lifecycle_callbacks<'a>(&'a self, env: &'a JEnv, arg0: &'a JObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| { Self::class(Some(env))?.method( env, b"registerActivityLifecycleCallbacks\0", b"(Landroid/app/Application$ActivityLifecycleCallbacks;)V\0", ) })? .call(env, self.as_ref(), (arg0,)) } pub fn unregister_activity_lifecycle_callbacks<'a>(&'a self, env: &'a JEnv, arg0: &'a JObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| { Self::class(Some(env))?.method( env, b"unregisterActivityLifecycleCallbacks\0", b"(Landroid/app/Application$ActivityLifecycleCallbacks;)V\0", ) })? .call(env, self.as_ref(), (arg0,)) } pub fn register_on_provide_assist_data_listener<'a>(&'a self, env: &'a JEnv, arg0: &'a JObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| { Self::class(Some(env))?.method( env, b"registerOnProvideAssistDataListener\0", b"(Landroid/app/Application$OnProvideAssistDataListener;)V\0", ) })? .call(env, self.as_ref(), (arg0,)) } pub fn unregister_on_provide_assist_data_listener<'a>(&'a self, env: &'a JEnv, arg0: &'a JObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| { Self::class(Some(env))?.method( env, b"unregisterOnProvideAssistDataListener\0", b"(Landroid/app/Application$OnProvideAssistDataListener;)V\0", ) })? .call(env, self.as_ref(), (arg0,)) } } #[test] fn test_type_zero() { assert_eq!(0, std::mem::size_of::()); }