pub fn update_if_active(&mut self, update_factory: impl FnOnce() -> TreeUpdate) {
        let mut env = self.vm.get_env().unwrap();
        let Some(host) = self.host.upgrade_local(&env).unwrap() else {
            return;
        };
        let mut inner = self.inner.lock().unwrap();
        let Some(events) = inner.adapter.update_if_active(update_factory) else {
            return;
        };
        drop(inner);
        post_to_ui_thread(
            &mut env,
            self.delegate_class,
            &host,
            |env, _delegate_class, host| {
                events.raise(env, host);
            },
        );
    }
If and only if the tree has been initialized, call the provided function
and apply the resulting update. Note: If the caller's implementation of
[`ActivationHandler::request_initial_tree`] initially returned `None`,
the [`TreeUpdate`] returned by the provided function must contain
a full tree.
platforms/android/src/inject.rs