From 5bc1007bca5eb2e3ae6278bcc2ab5e3455189be6 Mon Sep 17 00:00:00 2001 From: jiadexiang Date: Thu, 11 Nov 2021 19:25:33 +0800 Subject: [PATCH] Description: allow async work dispatching in advance IssueNo: I4H2AG Feature or Bugfix: Feature Binary Source:No Signed-off-by: jiadexiang --- frameworks/src/core/context/js_ability.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/src/core/context/js_ability.cpp b/frameworks/src/core/context/js_ability.cpp index 6a46fdf..a71b813 100644 --- a/frameworks/src/core/context/js_ability.cpp +++ b/frameworks/src/core/context/js_ability.cpp @@ -110,14 +110,14 @@ void JSAbility::Launch(const char * const abilityPath, const char * const bundle // mark the flag in advance to make sure we can take over render tick as soon as possible ProductAdapter::UpdateRenderTickAcceptable(true); JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_); - jsAbilityImpl->InitEnvironment(abilityPath, bundleName, token); - ACE_EVENT_PRINT(MT_ACE_FWK_LAUNCHING, 0); - FatalHandler::GetInstance().RegisterFatalHandler(this); - jsAbilityImpl->DeliverCreate(pageInfo); #ifndef MOCK_JS_ASYNC_WORK // simulator uses the self-implementation for async work, this interface is not included JsAsyncWork::SetEnvStatus(true); #endif + jsAbilityImpl->InitEnvironment(abilityPath, bundleName, token); + ACE_EVENT_PRINT(MT_ACE_FWK_LAUNCHING, 0); + FatalHandler::GetInstance().RegisterFatalHandler(this); + jsAbilityImpl->DeliverCreate(pageInfo); STOP_TRACING(); OUTPUT_TRACE(); }