diff --git a/frameworks/js/napi/ability_manager/js_ability_manager.cpp b/frameworks/js/napi/ability_manager/js_ability_manager.cpp index da3a1d1872..8c98031f8d 100644 --- a/frameworks/js/napi/ability_manager/js_ability_manager.cpp +++ b/frameworks/js/napi/ability_manager/js_ability_manager.cpp @@ -696,9 +696,9 @@ napi_value JsAbilityManagerInit(napi_env env, napi_value exportObj) env, exportObj, "getForegroundUIAbilities", moduleName, JsAbilityManager::GetForegroundUIAbilities); BindNativeFunction(env, exportObj, "on", moduleName, JsAbilityManager::On); BindNativeFunction(env, exportObj, "off", moduleName, JsAbilityManager::Off); + BindNativeFunction(env, exportObj, "isEmbeddedOpenAllowed", moduleName, JsAbilityManager::IsEmbeddedOpenAllowed); BindNativeFunction( env, exportObj, "notifyDebugAssertResult", moduleName, JsAbilityManager::NotifyDebugAssertResult); - BindNativeFunction(env, exportObj, "isEmbeddedOpenAllowed", moduleName, JsAbilityManager::IsEmbeddedOpenAllowed); BindNativeFunction( env, exportObj, "setResidentProcessEnabled", moduleName, JsAbilityManager::SetResidentProcessEnabled); TAG_LOGD(AAFwkTag::ABILITYMGR, "end"); diff --git a/frameworks/js/napi/ability_manager/js_ability_manager_utils.cpp b/frameworks/js/napi/ability_manager/js_ability_manager_utils.cpp index 447666481a..ed9cee162a 100644 --- a/frameworks/js/napi/ability_manager/js_ability_manager_utils.cpp +++ b/frameworks/js/napi/ability_manager/js_ability_manager_utils.cpp @@ -38,8 +38,8 @@ napi_value CreateJSToken(napi_env env, const sptr target) env, "TokenClass", NAPI_AUTO_LENGTH, constructorcb, nullptr, 0, nullptr, &tokenClass); napi_value jsToken = nullptr; napi_new_instance(env, tokenClass, 0, nullptr, &jsToken); - auto finalizercb = [](napi_env env, void *data, void *hint) {}; - napi_wrap(env, jsToken, static_cast(target.GetRefPtr()), finalizercb, nullptr, nullptr); + auto finalizecb = [](napi_env env, void *data, void *hint) {}; + napi_wrap(env, jsToken, static_cast(target.GetRefPtr()), finalizecb, nullptr, nullptr); return jsToken; } diff --git a/frameworks/js/napi/app_startup/async_task_callback/async_task_callback.ts b/frameworks/js/napi/app_startup/async_task_callback/async_task_callback.ts index 6a7530ab1d..09b9f60642 100644 --- a/frameworks/js/napi/app_startup/async_task_callback/async_task_callback.ts +++ b/frameworks/js/napi/app_startup/async_task_callback/async_task_callback.ts @@ -20,7 +20,7 @@ class AsyncTaskCallback { this.__impl__ = object; } - onAsyncTaskCompleted(startupName, startupResult) { + onAsyncTaskCompleted(startupName, startupResult): void { console.log('AsyncTaskCallback onAsyncTaskCompleted called, startupName: ' + startupName); this.__impl__.onAsyncTaskCompleted(startupName, startupResult); } diff --git a/frameworks/js/napi/app_startup/async_task_excutor/async_task_excutor.ts b/frameworks/js/napi/app_startup/async_task_excutor/async_task_excutor.ts index 58aee08eda..8480a1b865 100644 --- a/frameworks/js/napi/app_startup/async_task_excutor/async_task_excutor.ts +++ b/frameworks/js/napi/app_startup/async_task_excutor/async_task_excutor.ts @@ -13,19 +13,19 @@ * limitations under the License. */ -async function concurrentFunc(startup, asyncCallback, context, startupName) { +async function concurrentFunc(startup, asyncCallback, context, startupName): void { 'use concurrent'; console.log('concurrentFunc start.'); let startupResult; await startup.init(context).then((result: Object) => { - startupResult = result + startupResult = result; let taskPool = requireNapi('taskpool'); taskPool.Task.sendData(asyncCallback, startupName, startupResult); }); console.log('concurrentFunc end.'); } -function receiveResult(asyncCallback, startupName, startupResult) { +function receiveResult(asyncCallback, startupName, startupResult): void { console.log('receiveResult called.'); asyncCallback.onAsyncTaskCompleted(startupName, startupResult); console.log('receiveResult end.'); diff --git a/frameworks/js/napi/js_mission_manager/mission_manager.cpp b/frameworks/js/napi/js_mission_manager/mission_manager.cpp index bda250387f..760c5f4ad6 100755 --- a/frameworks/js/napi/js_mission_manager/mission_manager.cpp +++ b/frameworks/js/napi/js_mission_manager/mission_manager.cpp @@ -702,7 +702,6 @@ private: { TAG_LOGI(AAFwkTag::MISSION, "%{public}s is called", __FUNCTION__); std::vector missionIds; - if (argc < ARGC_ONE) { TAG_LOGE(AAFwkTag::MISSION, "OnMoveMissionsToBackground Not enough params"); ThrowTooFewParametersError(env); @@ -726,7 +725,6 @@ private: } missionIds.push_back(missionId); } - NapiAsyncTask::CompleteCallback complete = [missionIds](napi_env env, NapiAsyncTask &task, int32_t status) { std::vector resultMissionIds; @@ -744,7 +742,6 @@ private: CreateJsErrorByNativeErr(env, ret, PermissionConstants::PERMISSION_MANAGE_MISSION)); } }; - napi_value lastParam = (argc <= 1) ? nullptr : argv[1]; napi_value result = nullptr; NapiAsyncTask::ScheduleHighQos("MissionManager::OnMoveMissionsToBackground", diff --git a/frameworks/native/appkit/ability_runtime/context/application_context.cpp b/frameworks/native/appkit/ability_runtime/context/application_context.cpp index e63adc1d78..b5c62a9423 100644 --- a/frameworks/native/appkit/ability_runtime/context/application_context.cpp +++ b/frameworks/native/appkit/ability_runtime/context/application_context.cpp @@ -566,6 +566,11 @@ std::string ApplicationContext::GetTempDir() return (contextImpl_ != nullptr) ? contextImpl_->GetTempDir() : ""; } +std::string ApplicationContext::GetResourceDir() +{ + return (contextImpl_ != nullptr) ? contextImpl_->GetResourceDir() : ""; +} + void ApplicationContext::GetAllTempDir(std::vector &tempPaths) { if (contextImpl_ == nullptr) { @@ -575,11 +580,6 @@ void ApplicationContext::GetAllTempDir(std::vector &tempPaths) contextImpl_->GetAllTempDir(tempPaths); } -std::string ApplicationContext::GetResourceDir() -{ - return (contextImpl_ != nullptr) ? contextImpl_->GetResourceDir() : ""; -} - std::string ApplicationContext::GetFilesDir() { return (contextImpl_ != nullptr) ? contextImpl_->GetFilesDir() : ""; diff --git a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp index 4036e5dfe4..d59d5227bc 100644 --- a/frameworks/native/appkit/ability_runtime/context/context_impl.cpp +++ b/frameworks/native/appkit/ability_runtime/context/context_impl.cpp @@ -268,6 +268,20 @@ std::string ContextImpl::GetTempDir() return dir; } +std::string ContextImpl::GetResourceDir() +{ + std::shared_ptr hapModuleInfoPtr = GetHapModuleInfo(); + if (hapModuleInfoPtr == nullptr || hapModuleInfoPtr->moduleName.empty()) { + return ""; + } + std::string dir = std::string(LOCAL_CODE_PATH) + CONTEXT_FILE_SEPARATOR + + hapModuleInfoPtr->moduleName + CONTEXT_RESOURCE_END; + if (OHOS::FileExists(dir)) { + return dir; + } + return ""; +} + void ContextImpl::GetAllTempDir(std::vector &tempPaths) { // Application temp dir @@ -299,20 +313,6 @@ void ContextImpl::GetAllTempDir(std::vector &tempPaths) } } -std::string ContextImpl::GetResourceDir() -{ - std::shared_ptr hapModuleInfoPtr = GetHapModuleInfo(); - if (hapModuleInfoPtr == nullptr || hapModuleInfoPtr->moduleName.empty()) { - return ""; - } - std::string dir = std::string(LOCAL_CODE_PATH) + CONTEXT_FILE_SEPARATOR + - hapModuleInfoPtr->moduleName + CONTEXT_RESOURCE_END; - if (OHOS::FileExists(dir)) { - return dir; - } - return ""; -} - std::string ContextImpl::GetFilesDir() { std::string dir = GetBaseDir() + CONTEXT_FILES; diff --git a/frameworks/native/appkit/ability_runtime/service_extension_context.cpp b/frameworks/native/appkit/ability_runtime/service_extension_context.cpp index 4036ab70b2..bfaa919984 100644 --- a/frameworks/native/appkit/ability_runtime/service_extension_context.cpp +++ b/frameworks/native/appkit/ability_runtime/service_extension_context.cpp @@ -246,6 +246,15 @@ AppExecFwk::AbilityType ServiceExtensionContext::GetAbilityInfoType() const return info->type; } +ErrCode ServiceExtensionContext::AddFreeInstallObserver(const sptr &observer) +{ + ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->AddFreeInstallObserver(token_, observer); + if (ret != ERR_OK) { + TAG_LOGE(AAFwkTag::APPKIT, "AddFreeInstallObserver error, ret: %{public}d", ret); + } + return ret; +} + ErrCode ServiceExtensionContext::PreStartMission(const std::string& bundleName, const std::string& moduleName, const std::string& abilityName, const std::string& startTime) { @@ -258,14 +267,5 @@ ErrCode ServiceExtensionContext::PreStartMission(const std::string& bundleName, TAG_LOGI(AAFwkTag::APPKIT, "End."); return err; } - -ErrCode ServiceExtensionContext::AddFreeInstallObserver(const sptr &observer) -{ - ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->AddFreeInstallObserver(token_, observer); - if (ret != ERR_OK) { - TAG_LOGE(AAFwkTag::APPKIT, "AddFreeInstallObserver error, ret: %{public}d", ret); - } - return ret; -} } // namespace AbilityRuntime } // namespace OHOS diff --git a/frameworks/native/appkit/dfr/appfreeze_inner.cpp b/frameworks/native/appkit/dfr/appfreeze_inner.cpp index 3f8f1c9639..2c9bae995f 100644 --- a/frameworks/native/appkit/dfr/appfreeze_inner.cpp +++ b/frameworks/native/appkit/dfr/appfreeze_inner.cpp @@ -128,7 +128,7 @@ void AppfreezeInner::SendProcessKillEvent(const std::string& killReason) std::string processName = applicationInfo->process; int result = HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::FRAMEWORK, "PROCESS_KILL", HiviewDFX::HiSysEvent::EventType::FAULT, EVENT_PID, pid, - EVENT_PROCESS_NAME, applicationInfo->process, EVENT_MESSAGE, killReason); + EVENT_PROCESS_NAME, processName, EVENT_MESSAGE, killReason); TAG_LOGI(AAFwkTag::APPDFR, "hisysevent write result=%{public}d, send event [FRAMEWORK,PROCESS_KILL]," " pid=%{public}d, processName=%{public}s, msg=%{public}s", result, pid, processName.c_str(), killReason.c_str()); diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_client.h b/interfaces/inner_api/ability_manager/include/ability_manager_client.h index 7cafb0967a..383d9ad37b 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_client.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_client.h @@ -41,7 +41,6 @@ class AbilityManagerClient { public: virtual ~AbilityManagerClient(); static std::shared_ptr GetInstance(); - void RemoveDeathRecipient(); /** @@ -1407,6 +1406,13 @@ public: int32_t UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, std::vector &sessionIds); + /** + * @brief Restart app self. + * @param want The ability type must be UIAbility. + * @return Returns ERR_OK on success, others on failure. + */ + int32_t RestartApp(const AAFwk::Want &want); + /** * @brief Get host info of root caller. * @@ -1429,13 +1435,6 @@ public: ErrCode GetUIExtensionSessionInfo(const sptr token, UIExtensionSessionInfo &uiExtensionSessionInfo, int32_t userId = DEFAULT_INVAL_VALUE); - /** - * @brief Restart app self. - * @param want The ability type must be UIAbility. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t RestartApp(const AAFwk::Want &want); - /** * Pop-up launch of full-screen atomic service. * diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_errors.h b/interfaces/inner_api/ability_manager/include/ability_manager_errors.h index 2fda501886..f0b30cfa01 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_errors.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_errors.h @@ -462,7 +462,7 @@ enum { * Native error(2097240) for memory size state unchanged. */ ERR_NATIVE_MEMORY_SIZE_STATE_UNCHANGED, - + /** * Native error(2097241) for target bundle not exist. */ diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h index ec05573bd5..265a140684 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h @@ -1505,6 +1505,16 @@ public: return 0; } + /** + * @brief Restart app self. + * @param want The ability type must be UIAbility. + * @return Returns ERR_OK on success, others on failure. + */ + virtual int32_t RestartApp(const AAFwk::Want &want) + { + return 0; + } + /** * @brief Get host info of root caller. * @@ -1533,16 +1543,6 @@ public: return 0; } - /** - * @brief Restart app self. - * @param want The ability type must be UIAbility. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RestartApp(const AAFwk::Want &want) - { - return 0; - } - /** * Open link of ability and atomic service. * diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_ipc_interface_code.h b/interfaces/inner_api/ability_manager/include/ability_manager_ipc_interface_code.h index 375f8b6413..6fc55147a8 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_ipc_interface_code.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_ipc_interface_code.h @@ -377,7 +377,7 @@ enum class AbilityManagerInterfaceCode { // request modal UIExtension by want REQUESET_MODAL_UIEXTENSION = 1056, - // get root host info of uiextesnion + // get root host info of uiextension GET_UI_EXTENSION_ROOT_HOST_INFO = 1057, // change current ability visibility diff --git a/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h b/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h index f741d4ebc8..8d05d44f36 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h +++ b/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h @@ -384,8 +384,8 @@ public: KILL_PROCESSES_BY_PIDS, ATTACH_PID_TO_PARENT, IS_MEMORY_SIZE_SUFFICIENT, - SET_KEEP_ALIVE_ENABLE_STATE, NOTIFY_APP_MGR_RECORD_EXIT_REASON, + SET_KEEP_ALIVE_ENABLE_STATE, ATTACHED_TO_STATUS_BAR, BLOCK_PROCESS_CACHE_BY_PIDS, IS_KILLED_FOR_UPGRADE_WEB, diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h index 50b52a3075..9db7604aee 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h +++ b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h @@ -682,13 +682,6 @@ public: */ int32_t UnregisterAppRunningStatusListener(const sptr &listener); - /** - * Whether the current application process is the last surviving process. - * - * @return Returns true is final application process, others return false. - */ - bool IsFinalAppProcess(); - /** * To clear the process by ability token. * @@ -696,6 +689,13 @@ public: */ void ClearProcessByToken(sptr token) const; + /** + * Whether the current application process is the last surviving process. + * + * @return Returns true is final application process, others return false. + */ + bool IsFinalAppProcess(); + int32_t RegisterRenderStateObserver(const sptr &observer); int32_t UnregisterRenderStateObserver(const sptr &observer); diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_proxy.h index b449d4d203..bdf07638cc 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_proxy.h +++ b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_proxy.h @@ -607,8 +607,6 @@ public: */ virtual int32_t NotifyMemorySizeStateChanged(bool isMemorySizeSufficent) override; - int32_t SetSupportedProcessCacheSelf(bool isSupport) override; - /** * Set application assertion pause state. * @@ -616,15 +614,7 @@ public: */ void SetAppAssertionPauseState(bool flag) override; - /** - * Start native child process, callde by ChildProcessManager. - * @param libName lib file name to be load in child process - * @param childProcessCount current started child process count - * @param callback callback for notify start result - * @return Returns ERR_OK on success, others on failure. - */ - int32_t StartNativeChildProcess(const std::string &libName, int32_t childProcessCount, - const sptr &callback) override; + int32_t SetSupportedProcessCacheSelf(bool isSupport) override; virtual void SaveBrowserChannel(sptr browser) override; @@ -636,6 +626,16 @@ public: */ int32_t CheckCallingIsUserTestMode(const pid_t pid, bool &isUserTest) override; + /** + * Start native child process, callde by ChildProcessManager. + * @param libName lib file name to be load in child process + * @param childProcessCount current started child process count + * @param callback callback for notify start result + * @return Returns ERR_OK on success, others on failure. + */ + int32_t StartNativeChildProcess(const std::string &libName, int32_t childProcessCount, + const sptr &callback) override; + virtual int32_t NotifyProcessDependedOnWeb() override; virtual void KillProcessDependedOnWeb() override; diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_stub.h b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_stub.h index 68e3ff0bbb..816132a736 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_stub.h +++ b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_stub.h @@ -128,8 +128,8 @@ private: int32_t HandleGetChildProcessInfoForSelf(MessageParcel &data, MessageParcel &reply); int32_t HandleAttachChildProcess(MessageParcel &data, MessageParcel &reply); int32_t HandleExitChildProcessSafely(MessageParcel &data, MessageParcel &reply); - int32_t HandleIsFinalAppProcess(MessageParcel &data, MessageParcel &reply); int32_t HandleClearUpApplicationDataBySelf(MessageParcel &data, MessageParcel &reply); + int32_t HandleIsFinalAppProcess(MessageParcel &data, MessageParcel &reply); int32_t HandleRegisterRenderStateObserver(MessageParcel &data, MessageParcel &reply); int32_t HandleUnregisterRenderStateObserver(MessageParcel &data, MessageParcel &reply); int32_t HandleUpdateRenderState(MessageParcel &data, MessageParcel &reply); @@ -138,11 +138,11 @@ private: int32_t HandleGetAllUIExtensionRootHostPid(MessageParcel &data, MessageParcel &reply); int32_t HandleGetAllUIExtensionProviderPid(MessageParcel &data, MessageParcel &reply); int32_t HandleNotifyMemorySizeStateChanged(MessageParcel &data, MessageParcel &reply); - int32_t HandleSetSupportedProcessCacheSelf(MessageParcel &data, MessageParcel &reply); int32_t HandleSetAppAssertionPauseState(MessageParcel &data, MessageParcel &reply); - int32_t HandleStartNativeChildProcess(MessageParcel &data, MessageParcel &reply); + int32_t HandleSetSupportedProcessCacheSelf(MessageParcel &data, MessageParcel &reply); int32_t HandleSaveBrowserChannel(MessageParcel &data, MessageParcel &reply); int32_t HandleCheckCallingIsUserTestMode(MessageParcel &data, MessageParcel &reply); + int32_t HandleStartNativeChildProcess(MessageParcel &data, MessageParcel &reply); int32_t HandleNotifyProcessDependedOnWeb(MessageParcel &data, MessageParcel &reply); int32_t HandleKillProcessDependedOnWeb(MessageParcel &data, MessageParcel &reply); int32_t HandleRestartResidentProcessDependedOnWeb(MessageParcel &data, MessageParcel &reply); diff --git a/interfaces/inner_api/app_manager/src/appmgr/app_scheduler_host.cpp b/interfaces/inner_api/app_manager/src/appmgr/app_scheduler_host.cpp index e1c3de701d..f7190190e6 100644 --- a/interfaces/inner_api/app_manager/src/appmgr/app_scheduler_host.cpp +++ b/interfaces/inner_api/app_manager/src/appmgr/app_scheduler_host.cpp @@ -28,7 +28,6 @@ AppSchedulerHost::AppSchedulerHost() InitMemberFuncMap(); } - void AppSchedulerHost::InitMemberFuncMap() {} AppSchedulerHost::~AppSchedulerHost() @@ -480,6 +479,13 @@ int32_t AppSchedulerHost::HandleScheduleDumpIpcStat(MessageParcel &data, Message return NO_ERROR; } +int32_t AppSchedulerHost::HandleScheduleCacheProcess(MessageParcel &data, MessageParcel &reply) +{ + HITRACE_METER(HITRACE_TAG_APP); + ScheduleCacheProcess(); + return NO_ERROR; +} + int32_t AppSchedulerHost::HandleScheduleDumpFfrt(MessageParcel &data, MessageParcel &reply) { HITRACE_METER(HITRACE_TAG_APP); @@ -491,12 +497,5 @@ int32_t AppSchedulerHost::HandleScheduleDumpFfrt(MessageParcel &data, MessagePar } return NO_ERROR; } - -int32_t AppSchedulerHost::HandleScheduleCacheProcess(MessageParcel &data, MessageParcel &reply) -{ - HITRACE_METER(HITRACE_TAG_APP); - ScheduleCacheProcess(); - return NO_ERROR; -} } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/inner_api/auto_fill_manager/src/auto_fill_extension_callback.cpp b/interfaces/inner_api/auto_fill_manager/src/auto_fill_extension_callback.cpp index 47ea7c33fe..40f1fc2138 100644 --- a/interfaces/inner_api/auto_fill_manager/src/auto_fill_extension_callback.cpp +++ b/interfaces/inner_api/auto_fill_manager/src/auto_fill_extension_callback.cpp @@ -28,7 +28,7 @@ namespace { #ifdef SUPPORT_GRAPHICS constexpr const char* WANT_PARAMS_VIEW_DATA_KEY = "ohos.ability.params.viewData"; constexpr const char* WANT_PARAMS_AUTO_FILL_CMD_KEY = "ohos.ability.params.autoFillCmd"; -constexpr const char* WANT_PARAMS_FILL_CONTENT = "ohos.ability.params.fillContent"; +constexpr const char* WANT_PARAMS_FILL_CONTENT = "ohos.ability.params.fillContent"; constexpr const char* WANT_PARAMS_CUSTOM_DATA_KEY = "ohos.ability.params.customData"; constexpr const char* WANT_PARAMS_AUTO_FILL_EVENT_KEY = "ability.want.params.AutoFillEvent"; constexpr const char* WANT_PARAMS_UPDATE_POPUP_WIDTH = "ohos.ability.params.popupWidth"; diff --git a/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h b/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h index bf81193294..01be15915a 100644 --- a/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h +++ b/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h @@ -222,9 +222,10 @@ public: ErrCode ChangeAbilityVisibility(bool isShow) override; - ErrCode OpenLink(const AAFwk::Want& want, int requestCode) override; ErrCode AddFreeInstallObserver(const sptr &observer) override; + ErrCode OpenLink(const AAFwk::Want& want, int requestCode) override; + ErrCode OpenAtomicService(AAFwk::Want& want, const AAFwk::StartOptions &options, int requestCode, RuntimeTask &&task) override; diff --git a/interfaces/kits/native/ability/native/extension.h b/interfaces/kits/native/ability/native/extension.h index d2ab9ecb48..f1236563e4 100644 --- a/interfaces/kits/native/ability/native/extension.h +++ b/interfaces/kits/native/ability/native/extension.h @@ -256,7 +256,7 @@ public: virtual void OnInsightIntentExecuteDone(const sptr &sessionInfo, const AppExecFwk::InsightIntentExecuteResult &result); - + virtual bool HandleInsightIntent(const AAFwk::Want &want); virtual bool OnInsightIntentExecuteDone(uint64_t intentId, const AppExecFwk::InsightIntentExecuteResult &result); diff --git a/interfaces/kits/native/ability/native/ui_extension_ability/js_ui_extension_content_session.h b/interfaces/kits/native/ability/native/ui_extension_ability/js_ui_extension_content_session.h index bf112df27d..37a0e40e94 100644 --- a/interfaces/kits/native/ability/native/ui_extension_ability/js_ui_extension_content_session.h +++ b/interfaces/kits/native/ability/native/ui_extension_ability/js_ui_extension_content_session.h @@ -117,10 +117,10 @@ protected: napi_env env, NapiCallbackInfo& info, std::shared_ptr &innerErrorCode); void StartAbilityForResultRuntimeTask(napi_env env, AAFwk::Want &want, std::shared_ptr asyncTask, size_t& unwrapArgc, AAFwk::StartOptions startOptions); - void SetCallbackForTerminateWithResult(int32_t resultCode, AAFwk::Want& want, - NapiAsyncTask::CompleteCallback& complete); bool CheckStartAbilityByTypeParam(napi_env env, NapiCallbackInfo& info, std::string& type, AAFwk::WantParams& wantParam); + void SetCallbackForTerminateWithResult(int32_t resultCode, AAFwk::Want& want, + NapiAsyncTask::CompleteCallback& complete); private: sptr sessionInfo_; diff --git a/interfaces/kits/native/appkit/app/main_thread.h b/interfaces/kits/native/appkit/app/main_thread.h index 82c7c1fee7..b30e50dca9 100644 --- a/interfaces/kits/native/appkit/app/main_thread.h +++ b/interfaces/kits/native/appkit/app/main_thread.h @@ -269,8 +269,6 @@ public: */ void ScheduleProcessSecurityExit() override; - void ScheduleClearPageStack() override; - void ScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName) override; void ScheduleNewProcessRequest(const AAFwk::Want &want, const std::string &moduleName) override; @@ -341,6 +339,7 @@ public: */ int32_t ScheduleDumpIpcStat(std::string& result) override; + void ScheduleClearPageStack() override; /** * ScheduleDumpFfrt, call ScheduleDumpFfrt(std::string& result) through proxy project, * Start querying the application's ffrt usage. diff --git a/interfaces/kits/native/appkit/dfr/appfreeze_inner.h b/interfaces/kits/native/appkit/dfr/appfreeze_inner.h index b616075697..76d325c2c6 100644 --- a/interfaces/kits/native/appkit/dfr/appfreeze_inner.h +++ b/interfaces/kits/native/appkit/dfr/appfreeze_inner.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/js_environment/frameworks/js_environment/src/js_environment.cpp b/js_environment/frameworks/js_environment/src/js_environment.cpp index 900ea3f0ed..5f0ba31c86 100644 --- a/js_environment/frameworks/js_environment/src/js_environment.cpp +++ b/js_environment/frameworks/js_environment/src/js_environment.cpp @@ -307,12 +307,6 @@ void JsEnvironment::GetHeapPrepare() panda::DFXJSNApi::GetHeapPrepare(vm_); } -void JsEnvironment::ReInitJsEnvImpl(std::unique_ptr impl) -{ - TAG_LOGD(AAFwkTag::JSENV, "ReInit jsenv impl."); - impl_ = std::move(impl); -} - void JsEnvironment::SetModuleLoadChecker(const std::shared_ptr moduleCheckerDelegate) { if (engine_ == nullptr) { @@ -323,6 +317,12 @@ void JsEnvironment::SetModuleLoadChecker(const std::shared_ptrSetModuleLoadChecker(moduleCheckerDelegate); } +void JsEnvironment::ReInitJsEnvImpl(std::unique_ptr impl) +{ + TAG_LOGD(AAFwkTag::JSENV, "ReInit jsenv impl."); + impl_ = std::move(impl); +} + void JsEnvironment::SetRequestAotCallback(const RequestAotCallback& cb) { if (vm_ == nullptr) { diff --git a/js_environment/interfaces/inner_api/js_environment.h b/js_environment/interfaces/inner_api/js_environment.h index b71140e4f9..296a47d117 100644 --- a/js_environment/interfaces/inner_api/js_environment.h +++ b/js_environment/interfaces/inner_api/js_environment.h @@ -27,9 +27,9 @@ namespace OHOS { namespace JsEnv { class JsEnvironmentImpl; +using DebuggerPostTask = std::function&&)>; using RequestAotCallback = std::function; -using DebuggerPostTask = std::function&&)>; class JsEnvironment final : public std::enable_shared_from_this { public: JsEnvironment() {} @@ -91,19 +91,19 @@ public: bool LoadScript(const std::string& path, uint8_t* buffer, size_t len, bool isBundle); + DebuggerPostTask GetDebuggerPostTask(); + void StartProfiler(const char* libraryPath, uint32_t instanceId, PROFILERTYPE profiler, int32_t interval, int tid, bool isDebugApp); - - DebuggerPostTask GetDebuggerPostTask(); void DestroyHeapProfiler(); void GetHeapPrepare(); - void ReInitJsEnvImpl(std::unique_ptr impl); - void SetModuleLoadChecker(const std::shared_ptr moduleCheckerDelegate); + void ReInitJsEnvImpl(std::unique_ptr impl); + void SetRequestAotCallback(const RequestAotCallback& cb); void SetDeviceDisconnectCallback(const std::function &cb);