#[cfg(target_os = "android")]
pub mod android {
pub use winit::platform::android::activity;
#[cfg(target_os = "android")]
static ANDROID_APP: parking_lot::RwLock<Option<activity::AndroidApp>> = parking_lot::RwLock::new(None);
#[cfg(target_os = "android")]
pub fn init_android_app(app: activity::AndroidApp) {
let internal = app.internal_data_path().unwrap_or_default();
let external = app.external_data_path().unwrap_or_default();
zng_env::init_android_paths(internal, external);
*ANDROID_APP.write() = Some(app);
}
#[cfg(target_os = "android")]
pub fn android_app() -> activity::AndroidApp {
ANDROID_APP
.read()
.clone()
.expect("android_app is only available after `init_android_app` call")
}
}