diff --git a/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.cpp b/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.cpp index 430b99e1cf5fc275110c0e73d2053de71948d769..61ae2eb1d3c78270ed46362311d0255b3dcd2084 100644 --- a/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.cpp +++ b/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.cpp @@ -49,6 +49,11 @@ bool UnwrapOpenLinkOptions(napi_env env, napi_value param, AAFwk::OpenLinkOption want.SetParam(APP_LINKING_ONLY, false); } + bool withoutDialog = false; + if (UnwrapBooleanByPropertyName(env, param, WITHOUT_DIALOG.c_str(), withoutDialog)) { + openLinkOptions.SetWithoutDialog(withoutDialog); + } + return true; } } // namespace AppExecFwk diff --git a/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.h b/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.h index 78c381a6c3de44335f8766b2e0ce03ebb7b5c232..27843975fa5e177fbc1c35013a90dab5eeb4c540 100644 --- a/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.h +++ b/frameworks/js/napi/inner/napi_common/open_link/napi_common_open_link_options.h @@ -22,6 +22,7 @@ namespace OHOS { namespace AppExecFwk { const std::string APP_LINKING_ONLY = "appLinkingOnly"; + const std::string WITHOUT_DIALOG = "withoutDialog"; bool UnwrapOpenLinkOptions(napi_env env, napi_value param, AAFwk::OpenLinkOptions &openLinkOptions, AAFwk::Want &want); diff --git a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp index 39bc51ebfd04fe1ab7b7447aa72318507812a64b..8c8c421e0db5988d6ec73719c5785b970bd9ac90 100644 --- a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp +++ b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp @@ -1235,10 +1235,10 @@ bool AbilityContextImpl::GetRestoreEnabled() return restoreEnabled_.load(); } -ErrCode AbilityContextImpl::OpenLink(const AAFwk::Want& want, int requestCode) +ErrCode AbilityContextImpl::OpenLink(const AAFwk::Want& want, int requestCode, const AAFwk::OpenLinkOptions &opt) { TAG_LOGD(AAFwkTag::CONTEXT, "called"); - return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode); + return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode, opt); } std::shared_ptr AbilityContextImpl::GetWant() diff --git a/frameworks/native/ability/native/ability_runtime/js_ability_context.cpp b/frameworks/native/ability/native/ability_runtime/js_ability_context.cpp index f273f8edd43439279851c2edb8e7bf912f220204..6e4124fe13fe3154121ae11e8b9467f185e6137a 100644 --- a/frameworks/native/ability/native/ability_runtime/js_ability_context.cpp +++ b/frameworks/native/ability/native/ability_runtime/js_ability_context.cpp @@ -983,21 +983,21 @@ napi_value JsAbilityContext::OnOpenLink(napi_env env, NapiCallbackInfo& info) TAG_LOGD(AAFwkTag::CONTEXT, "completionHandler is used"); CreateOpenLinkTask(env, info.argv[INDEX_TWO], want, requestCode); } - return OnOpenLinkInner(env, want, requestCode, startTime, linkValue); + return OnOpenLinkInner(env, want, requestCode, startTime, linkValue, openLinkOptions); } -napi_value JsAbilityContext::OnOpenLinkInner(napi_env env, const AAFwk::Want& want, - int requestCode, const std::string& startTime, const std::string& url) +napi_value JsAbilityContext::OnOpenLinkInner(napi_env env, const AAFwk::Want& want, int requestCode, + const std::string& startTime, const std::string& url, const AAFwk::OpenLinkOptions &opt) { auto innerErrCode = std::make_shared(ERR_OK); - NapiAsyncTask::ExecuteCallback execute = [weak = context_, want, innerErrCode, requestCode]() { + NapiAsyncTask::ExecuteCallback execute = [weak = context_, want, innerErrCode, requestCode, opt]() { auto context = weak.lock(); if (!context) { TAG_LOGW(AAFwkTag::CONTEXT, "null context"); *innerErrCode = static_cast(AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT); return; } - *innerErrCode = context->OpenLink(want, requestCode); + *innerErrCode = context->OpenLink(want, requestCode, opt); }; napi_value result = nullptr; AddFreeInstallObserver(env, want, nullptr, &result, false, true); diff --git a/frameworks/native/ability/native/js_service_extension_context.cpp b/frameworks/native/ability/native/js_service_extension_context.cpp index 163c4c3a3255a0a91f1e477c8fe304e58ed7d288..484f674150321766cfb4e7c90c602fa5453b1ee8 100644 --- a/frameworks/native/ability/native/js_service_extension_context.cpp +++ b/frameworks/native/ability/native/js_service_extension_context.cpp @@ -351,21 +351,21 @@ private: system_clock::now().time_since_epoch()).count()); want.SetParam(Want::PARAM_RESV_START_TIME, startTime); - return OnOpenLinkInner(env, want, startTime, linkValue); + return OnOpenLinkInner(env, want, startTime, linkValue, openLinkOptions); } napi_value OnOpenLinkInner(napi_env env, const AAFwk::Want& want, - const std::string& startTime, const std::string& url) + const std::string& startTime, const std::string& url, const AAFwk::OpenLinkOptions &opt) { auto innerErrorCode = std::make_shared(ERR_OK); - NapiAsyncTask::ExecuteCallback execute = [weak = context_, want, innerErrorCode]() { + NapiAsyncTask::ExecuteCallback execute = [weak = context_, want, innerErrorCode, opt]() { auto context = weak.lock(); if (!context) { TAG_LOGW(AAFwkTag::SERVICE_EXT, "context released"); *innerErrorCode = static_cast(AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT); return; } - *innerErrorCode = context->OpenLink(want, -1); + *innerErrorCode = context->OpenLink(want, -1, opt); }; NapiAsyncTask::CompleteCallback complete = [innerErrorCode, startTime, url, diff --git a/frameworks/native/ability/native/ui_extension_base/js_ui_extension_context.cpp b/frameworks/native/ability/native/ui_extension_base/js_ui_extension_context.cpp index bb48409d762b52901417d279bccaf0b837c29573..695f43ac645a692111a4f61733e46d38e4fb68e2 100755 --- a/frameworks/native/ability/native/ui_extension_base/js_ui_extension_context.cpp +++ b/frameworks/native/ability/native/ui_extension_base/js_ui_extension_context.cpp @@ -365,21 +365,21 @@ napi_value JsUIExtensionContext::OnOpenLink(napi_env env, NapiCallbackInfo& info #ifdef SUPPORT_SCREEN InitDisplayId(want); #endif - return OnOpenLinkInner(env, want, requestCode, startTime, linkValue); + return OnOpenLinkInner(env, want, requestCode, startTime, linkValue, openLinkOptions); } napi_value JsUIExtensionContext::OnOpenLinkInner(napi_env env, const AAFwk::Want& want, - int requestCode, const std::string& startTime, const std::string& url) + int requestCode, const std::string& startTime, const std::string& url, const AAFwk::OpenLinkOptions &opt) { auto innerErrorCode = std::make_shared(ERR_OK); - NapiAsyncTask::ExecuteCallback execute = [weak = context_, want, innerErrorCode, requestCode]() { + NapiAsyncTask::ExecuteCallback execute = [weak = context_, want, innerErrorCode, requestCode, opt]() { auto context = weak.lock(); if (!context) { TAG_LOGW(AAFwkTag::UI_EXT, "null context"); *innerErrorCode = static_cast(AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT); return; } - *innerErrorCode = context->OpenLink(want, requestCode); + *innerErrorCode = context->OpenLink(want, requestCode, opt); }; napi_value result = nullptr; diff --git a/frameworks/native/ability/native/ui_extension_base/ui_extension_context.cpp b/frameworks/native/ability/native/ui_extension_base/ui_extension_context.cpp index d8f1a0a551aaa154bf14ad5297eb3cfa69aeadfc..a8cf63f0ef5ae9bde5e4f656ce9d265816a794ed 100755 --- a/frameworks/native/ability/native/ui_extension_base/ui_extension_context.cpp +++ b/frameworks/native/ability/native/ui_extension_base/ui_extension_context.cpp @@ -333,10 +333,10 @@ ErrCode UIExtensionContext::AddFreeInstallObserver(const sptrOpenLink(want, token_, -1, requestCode); + return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode, opt); } std::shared_ptr UIExtensionContext::GetResourceManager() const diff --git a/frameworks/native/appkit/ability_runtime/service_extension_context.cpp b/frameworks/native/appkit/ability_runtime/service_extension_context.cpp index ac3fff62cf82b310d158f71cd4d455b1456d9d4b..fbc6ef402274fcb6fa52327f9a5be9a1c328faa5 100644 --- a/frameworks/native/appkit/ability_runtime/service_extension_context.cpp +++ b/frameworks/native/appkit/ability_runtime/service_extension_context.cpp @@ -269,10 +269,10 @@ ErrCode ServiceExtensionContext::PreStartMission(const std::string& bundleName, return err; } -ErrCode ServiceExtensionContext::OpenLink(const AAFwk::Want& want, int requestCode) +ErrCode ServiceExtensionContext::OpenLink(const AAFwk::Want& want, int requestCode, const AAFwk::OpenLinkOptions &opt) { TAG_LOGD(AAFwkTag::UI_EXT, "called"); - return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode); + return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode, opt); } ErrCode ServiceExtensionContext::OpenAtomicService(const AAFwk::Want &want, const AAFwk::StartOptions &options) 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 60e6e80a8145c07cdc6d07e8519968e74412c9ca..7a6aa099e77271b7b49715447360a0a5dd024cec 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_client.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_client.h @@ -25,6 +25,7 @@ #include "auto_startup_info.h" #include "iremote_object.h" #include "mission_info.h" +#include "open_link_options.h" #include "system_memory_attr.h" #include "ui_extension_window_command.h" #include "want.h" @@ -1678,7 +1679,8 @@ public: * @param requestCode Ability request code. * @return Returns ERR_OK on success, others on failure. */ - int32_t OpenLink(const Want& want, sptr callerToken, int32_t userId, int requestCode); + int32_t OpenLink(const Want& want, sptr callerToken, int32_t userId, int requestCode, + const AAFwk::OpenLinkOptions &opt = {}); /** * Terminate process by bundleName. 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 c04c88ea43ab51e130c205d27b365d65a3ec4de9..52e2aff62a2c504f390c028e682ae57871ae0bdd 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h @@ -44,6 +44,7 @@ #include "iprepare_terminate_callback_interface.h" #include "keep_alive_info.h" #include "mission_info.h" +#include "open_link_options.h" #include "query_erms_observer_interface.h" #include "remote_mission_listener_interface.h" #include "remote_on_listener_interface.h" @@ -1846,8 +1847,8 @@ public: * @param requestCode Ability request code. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t OpenLink(const Want& want, sptr callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, int requestCode = DEFAULT_INVAL_VALUE) + virtual int32_t OpenLink(const Want& want, sptr callerToken, int32_t userId = DEFAULT_INVAL_VALUE, + int requestCode = DEFAULT_INVAL_VALUE, const AAFwk::OpenLinkOptions &opt = {}) { return 0; } diff --git a/interfaces/inner_api/ability_manager/include/open_link_options.h b/interfaces/inner_api/ability_manager/include/open_link_options.h index f01875662fcdfc18f0fd7c857d20a48cbe833d08..cc1f485f8e2d0d0b1e0490265244bfcb8404c022 100644 --- a/interfaces/inner_api/ability_manager/include/open_link_options.h +++ b/interfaces/inner_api/ability_manager/include/open_link_options.h @@ -35,12 +35,15 @@ public: void SetAppLinkingOnly(bool appLinkingOnly); bool GetAppLinkingOnly() const; + void SetWithoutDialog(bool withoutDialog); + bool GetWithoutDialog() const; void SetParameters(WantParams parameters); WantParams GetParameters() const; bool WriteParameters(const WantParams ¶meters, Parcel &parcel) const; private: bool appLinkingOnly_ = false; + bool withoutDialog_ = false; WantParams parameters_; // no object in parcel static constexpr int VALUE_NULL = -1; diff --git a/interfaces/kits/native/ability/ability_runtime/ability_context.h b/interfaces/kits/native/ability/ability_runtime/ability_context.h index 1bc0b053dec44c07ec9e944136ed29da03c93cda..9f49e8692aa11eb9924857e747848b3a4469208a 100644 --- a/interfaces/kits/native/ability/ability_runtime/ability_context.h +++ b/interfaces/kits/native/ability/ability_runtime/ability_context.h @@ -27,6 +27,7 @@ #include "mission_info.h" #include "native_engine/native_reference.h" #include "native_engine/native_value.h" +#include "open_link_options.h" #include "start_options.h" #include "want.h" #include @@ -177,7 +178,7 @@ public: virtual ErrCode RequestModalUIExtension(const AAFwk::Want& want) = 0; - virtual ErrCode OpenLink(const AAFwk::Want& want, int requestCode) = 0; + virtual ErrCode OpenLink(const AAFwk::Want& want, int requestCode, const AAFwk::OpenLinkOptions &opt = {}) = 0; virtual ErrCode OpenAtomicService(AAFwk::Want& want, const AAFwk::StartOptions &options, int requestCode, RuntimeTask &&task) = 0; 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 35bdfd8339a9d81ee005826b29feec727ed2e6e7..6a12f0a060c4ad8be945c9c9241fbb9e11d775c6 100644 --- a/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h +++ b/interfaces/kits/native/ability/ability_runtime/ability_context_impl.h @@ -239,7 +239,7 @@ public: ErrCode AddFreeInstallObserver(const sptr &observer) override; - ErrCode OpenLink(const AAFwk::Want& want, int requestCode) override; + ErrCode OpenLink(const AAFwk::Want& want, int requestCode, const AAFwk::OpenLinkOptions &opt = {}) override; ErrCode OpenAtomicService(AAFwk::Want& want, const AAFwk::StartOptions &options, int requestCode, RuntimeTask &&task) override; diff --git a/interfaces/kits/native/ability/native/ability_runtime/js_ability_context.h b/interfaces/kits/native/ability/native/ability_runtime/js_ability_context.h index b1e8c0b70fcdbe862641925c40ca96ac43aeadef..65c8a961f0bd136313a8c1372278b7e908d0bd1b 100644 --- a/interfaces/kits/native/ability/native/ability_runtime/js_ability_context.h +++ b/interfaces/kits/native/ability/native/ability_runtime/js_ability_context.h @@ -106,8 +106,8 @@ private: const std::weak_ptr& abilityContext, const std::shared_ptr &callback); napi_value OnStartAbility(napi_env env, NapiCallbackInfo& info, bool isStartRecent = false); napi_value OnOpenLink(napi_env env, NapiCallbackInfo& info); - napi_value OnOpenLinkInner(napi_env env, const AAFwk::Want& want, - int requestCode, const std::string& startTime, const std::string& url); + napi_value OnOpenLinkInner(napi_env env, const AAFwk::Want& want, int requestCode, const std::string& startTime, + const std::string& url, const AAFwk::OpenLinkOptions &opt = {}); napi_value OnStartAbilityAsCallerInner(napi_env env, NapiCallbackInfo& info, const AAFwk::Want &want, size_t unwrapArgc, const AAFwk::StartOptions &startOptions); napi_value OnStartAbilityAsCaller(napi_env env, NapiCallbackInfo& info); diff --git a/interfaces/kits/native/ability/native/ui_extension_base/js_ui_extension_context.h b/interfaces/kits/native/ability/native/ui_extension_base/js_ui_extension_context.h index 41e074b89ae3004d544a031d660abd39eaafa977..a1f88cd9a9d2319d90b0908955d86f6abb8f542e 100755 --- a/interfaces/kits/native/ability/native/ui_extension_base/js_ui_extension_context.h +++ b/interfaces/kits/native/ability/native/ui_extension_base/js_ui_extension_context.h @@ -100,7 +100,7 @@ private: AAFwk::Want &want, int &requestCode); napi_value OnOpenLink(napi_env env, NapiCallbackInfo& info); napi_value OnOpenLinkInner(napi_env env, const AAFwk::Want& want, - int requestCode, const std::string& startTime, const std::string& url); + int requestCode, const std::string& startTime, const std::string& url, const AAFwk::OpenLinkOptions &opt = {}); void UnWrapCompletionHandlerForAtomicService( napi_env env, napi_value param, AAFwk::StartOptions &options, const std::string &appId); #ifdef SUPPORT_SCREEN diff --git a/interfaces/kits/native/ability/native/ui_extension_base/ui_extension_context.h b/interfaces/kits/native/ability/native/ui_extension_base/ui_extension_context.h index 8dcd4477f0e355fb883bbabf90a1718b28adc286..17faf24da4d381d5495899c8e5b7870b49fb8676 100755 --- a/interfaces/kits/native/ability/native/ui_extension_base/ui_extension_context.h +++ b/interfaces/kits/native/ability/native/ui_extension_base/ui_extension_context.h @@ -21,6 +21,7 @@ #include "ability_connect_callback.h" #include "extension_context.h" #include "free_install_observer_interface.h" +#include "open_link_options.h" #include "start_options.h" #include "ui_holder_extension_context.h" #include "want.h" @@ -176,7 +177,7 @@ public: Ace::UIContent* GetUIContent() override; #endif // SUPPORT_SCREEN - ErrCode OpenLink(const AAFwk::Want& want, int reuqestCode); + ErrCode OpenLink(const AAFwk::Want& want, int reuqestCode, const AAFwk::OpenLinkOptions &opt = {}); ErrCode OpenAtomicService(AAFwk::Want& want, const AAFwk::StartOptions &options, int requestCode, RuntimeTask &&task); diff --git a/interfaces/kits/native/appkit/ability_runtime/service_extension_context.h b/interfaces/kits/native/appkit/ability_runtime/service_extension_context.h index b43da9bde5e82ad772ce6075faff61d0f1963bea..d078134d8d1b1b90c89317699334cda86a7b1fdc 100644 --- a/interfaces/kits/native/appkit/ability_runtime/service_extension_context.h +++ b/interfaces/kits/native/appkit/ability_runtime/service_extension_context.h @@ -171,7 +171,7 @@ public: using SelfType = ServiceExtensionContext; static const size_t CONTEXT_TYPE_ID; - ErrCode OpenLink(const AAFwk::Want& want, int reuqestCode); + ErrCode OpenLink(const AAFwk::Want& want, int reuqestCode, const AAFwk::OpenLinkOptions &opt = {}); ErrCode OpenAtomicService(const AAFwk::Want &want, const AAFwk::StartOptions &options); ErrCode AddCompletionHandlerForAtomicService(const std::string &requestId, OnAtomicRequestSuccess onRequestSucc, diff --git a/services/abilitymgr/include/ability_manager_proxy.h b/services/abilitymgr/include/ability_manager_proxy.h index 90aa5002ea4b2fc397d3db6430d780e1c1cdde08..102ce230fe56a28e4e6dd0131bb3da58b5c71dc4 100644 --- a/services/abilitymgr/include/ability_manager_proxy.h +++ b/services/abilitymgr/include/ability_manager_proxy.h @@ -1537,8 +1537,8 @@ public: * @param requestCode Ability request code. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t OpenLink(const Want& want, sptr callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, int requestCode = DEFAULT_INVAL_VALUE) override; + virtual int32_t OpenLink(const Want& want, sptr callerToken, int32_t userId = DEFAULT_INVAL_VALUE, + int requestCode = DEFAULT_INVAL_VALUE, const AAFwk::OpenLinkOptions &opt = {}) override; /** * Terminate the mission. diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 2a291424e2d6d2fb30893c35ae3f6aa9b1e0bae9..0218565c93a209b875be7a90adc3a31b396f5d45 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -408,8 +408,8 @@ public: * @param requestCode Ability request code. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t OpenLink(const Want& want, sptr callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, int32_t requestCode = DEFAULT_INVAL_VALUE) override; + virtual int32_t OpenLink(const Want& want, sptr callerToken, int32_t userId = DEFAULT_INVAL_VALUE, + int32_t requestCode = DEFAULT_INVAL_VALUE, const AAFwk::OpenLinkOptions &opt = {}) override; /** * Pop-up launch of full-screen atomic service. @@ -1066,7 +1066,7 @@ public: const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam); int32_t StartAbilityByFreeInstall(const Want &want, sptr callerToken, int32_t userId, - int32_t requestCode); + int32_t requestCode, const AAFwk::OpenLinkOptions &opt = {}); int StartAbilityWrap( const Want &want, @@ -1078,7 +1078,8 @@ public: uint32_t specifyTokenId = 0, bool isForegroundToRestartApp = false, bool isImplicit = false, - bool isUIAbilityOnly = false); + bool isUIAbilityOnly = false, + const AAFwk::OpenLinkOptions &opt = {}); int StartAbilityInner( const Want &want, @@ -1090,7 +1091,8 @@ public: uint32_t specifyTokenId = 0, bool isForegroundToRestartApp = false, bool isImplicit = false, - bool isUIAbilityOnly = false); + bool isUIAbilityOnly = false, + const AAFwk::OpenLinkOptions &opt = {}); int32_t StartExtensionAbilityInner( const Want &want, @@ -1202,7 +1204,8 @@ public: int requestCode, AbilityRequest &request, const sptr &callerToken, - int32_t userId); + int32_t userId, + const AAFwk::OpenLinkOptions &opt = {}); /** * Get mission id by target ability token. @@ -2783,7 +2786,8 @@ private: void CloseAssertDialog(const std::string &assertSessionId); int32_t OpenLinkFreeInstallAtomicService(Want &convertedWant, const Want &originalWant, - sptr callerToken, int32_t userId, int32_t requestCode, bool removeInsightIntentFlag); + sptr callerToken, int32_t userId, int32_t requestCode, bool removeInsightIntentFlag, + const AAFwk::OpenLinkOptions &opt = {}); void ReportPreventStartAbilityResult(const AppExecFwk::AbilityInfo &callerAbilityInfo, const AppExecFwk::AbilityInfo &abilityInfo); @@ -2803,10 +2807,10 @@ private: const std::vector ¶mMappings, std::string &uri, AAFwk::Want &want); int StartAbilityWithRemoveIntentFlag(const Want &want, const sptr &callerToken, - int32_t userId, int requestCode, bool removeInsightIntentFlag); + int32_t userId, int requestCode, bool removeInsightIntentFlag, const AAFwk::OpenLinkOptions &opt = {}); int32_t OpenLinkInner(const Want &want, sptr callerToken, int32_t userId, int requestCode, - bool removeInsightIntentFlag); + bool removeInsightIntentFlag, const AAFwk::OpenLinkOptions &opt = {}); int32_t KillProcessWithReasonInner(int32_t pid, const ExitReason &reason, bool isKillPrecedeStart); #ifdef BGTASKMGR_CONTINUOUS_TASK_ENABLE std::shared_ptr bgtaskObserver_; diff --git a/services/abilitymgr/include/ability_record.h b/services/abilitymgr/include/ability_record.h index 79b765ebba50246adbebed8b66a80c3bad361b11..7e86e7d0dc446efc4178e33ae7bdfacb82ea5b59 100644 --- a/services/abilitymgr/include/ability_record.h +++ b/services/abilitymgr/include/ability_record.h @@ -285,6 +285,7 @@ struct AbilityRequest { AppExecFwk::AbilityInfo abilityInfo; AppExecFwk::ApplicationInfo appInfo; StartOptions startOptions; + OpenLinkOptions openLinkOptions; std::pair IsContinuation() const { auto flags = want.GetFlags(); @@ -326,13 +327,14 @@ struct AbilityRequest { void Voluation(const Want &srcWant, int srcRequestCode, const sptr &srcCallerToken, const std::shared_ptr srcStartSetting = nullptr, - int srcCallerUid = -1) + int srcCallerUid = -1, const AAFwk::OpenLinkOptions &opt = {}) { want = srcWant; requestCode = srcRequestCode; callerToken = srcCallerToken; startSetting = srcStartSetting; callerUid = srcCallerUid == -1 ? IPCSkeleton::GetCallingUid() : srcCallerUid; + openLinkOptions = opt; } }; diff --git a/services/abilitymgr/src/ability_manager_client.cpp b/services/abilitymgr/src/ability_manager_client.cpp index e4149b294d189bc161089b437af22d1e793e1e44..1faf9817c5c44248607c888397f2eaae3a1187a1 100644 --- a/services/abilitymgr/src/ability_manager_client.cpp +++ b/services/abilitymgr/src/ability_manager_client.cpp @@ -2100,11 +2100,11 @@ ErrCode AbilityManagerClient::PreStartMission(const std::string& bundleName, con } ErrCode AbilityManagerClient::OpenLink(const Want& want, sptr callerToken, - int32_t userId, int requestCode) + int32_t userId, int requestCode, const AAFwk::OpenLinkOptions &opt) { auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_INVALID_VALUE(abms); - return abms->OpenLink(want, callerToken, userId, requestCode); + return abms->OpenLink(want, callerToken, userId, requestCode, opt); } ErrCode AbilityManagerClient::TerminateMission(int32_t missionId) diff --git a/services/abilitymgr/src/ability_manager_proxy.cpp b/services/abilitymgr/src/ability_manager_proxy.cpp index 8ab7a0ec36fb0271e9bc7d2162079b9b9957befd..8aa3955e3a769fedd27ff9fa57fbb5c3325fac3d 100644 --- a/services/abilitymgr/src/ability_manager_proxy.cpp +++ b/services/abilitymgr/src/ability_manager_proxy.cpp @@ -5993,7 +5993,7 @@ int32_t AbilityManagerProxy::PreStartMission(const std::string& bundleName, cons } ErrCode AbilityManagerProxy::OpenLink(const Want& want, sptr callerToken, - int32_t userId, int requestCode) + int32_t userId, int requestCode, const AAFwk::OpenLinkOptions &opt) { if (AppUtils::GetInstance().IsForbidStart()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "forbid start: %{public}s", want.GetElement().GetBundleName().c_str()); @@ -6026,6 +6026,10 @@ ErrCode AbilityManagerProxy::OpenLink(const Want& want, sptr call TAG_LOGE(AAFwkTag::ABILITYMGR, "requestCode write fail"); return INNER_ERR; } + if (!data.WriteParcelable(&opt)) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "opt write fail"); + return INNER_ERR; + } auto error = SendRequest(AbilityManagerInterfaceCode::OPEN_LINK, data, reply, option); if (error != NO_ERROR) { TAG_LOGE(AAFwkTag::ABILITYMGR, "request error:%{public}d", error); diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index da29f8b836b117a1a7d275125e438efa832b421e..4a856acaabf22150eb87f6814fd1431cf3be141b 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -637,7 +637,7 @@ int AbilityManagerService::StartAbility(const Want &want, const sptr &callerToken, - int32_t userId, int requestCode, bool removeInsightIntentFlag) + int32_t userId, int requestCode, bool removeInsightIntentFlag, const AAFwk::OpenLinkOptions &opt) { if (AppUtils::GetInstance().IsForbidStart()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "forbid start: %{public}s", want.GetElement().GetBundleName().c_str()); @@ -654,11 +654,11 @@ int AbilityManagerService::StartAbilityWithRemoveIntentFlag(const Want &want, co #ifdef SUPPORT_SCREEN DmsUtil::GetInstance().UpdateFlagForCollaboration(want); #endif - return StartAbilityByFreeInstall(want, callerToken, userId, requestCode); + return StartAbilityByFreeInstall(want, callerToken, userId, requestCode, opt); } int32_t AbilityManagerService::StartAbilityByFreeInstall(const Want &want, sptr callerToken, - int32_t userId, int32_t requestCode) + int32_t userId, int32_t requestCode, const AAFwk::OpenLinkOptions &opt) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); bool startWithAccount = want.GetBoolParam(START_ABILITY_TYPE, false); @@ -680,7 +680,7 @@ int32_t AbilityManagerService::StartAbilityByFreeInstall(const Want &want, sptr< TAG_LOGD(AAFwkTag::ABILITYMGR, "Start ability come, ability is %{public}s, userId is %{public}d", want.GetElement().GetAbilityName().c_str(), userId); - int32_t ret = StartAbilityWrap(want, callerToken, requestCode, false, userId); + int32_t ret = StartAbilityWrap(want, callerToken, requestCode, false, 0, false, 0, false, false, false, opt); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "StartAbilityByFreeInstall error:%{public}d", ret); } @@ -1012,7 +1012,7 @@ bool AbilityManagerService::StartAbilityInChain(StartAbilityParams ¶ms, int int AbilityManagerService::StartAbilityWrap(const Want &want, const sptr &callerToken, int requestCode, bool isPendingWantCaller, int32_t userId, bool isStartAsCaller, uint32_t specifyToken, - bool isForegroundToRestartApp, bool isImplicit, bool isUIAbilityOnly) + bool isForegroundToRestartApp, bool isImplicit, bool isUIAbilityOnly, const AAFwk::OpenLinkOptions &opt) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); StartAbilityParams startParams(const_cast(want)); @@ -1028,7 +1028,7 @@ int AbilityManagerService::StartAbilityWrap(const Want &want, const sptr &callerToken, int requestCode, bool isPendingWantCaller, int32_t userId, bool isStartAsCaller, uint32_t specifyTokenId, - bool isForegroundToRestartApp, bool isImplicit, bool isUIAbilityOnly) + bool isForegroundToRestartApp, bool isImplicit, bool isUIAbilityOnly, const AAFwk::OpenLinkOptions &opt) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); if (!isStartAsCaller || isImplicit) { @@ -1290,7 +1290,7 @@ int AbilityManagerService::StartAbilityInner(const Want &want, const sptr 0 && callerToken != nullptr) { // for sa specify tokenId and caller token UpdateCallerInfoUtil::GetInstance().UpdateCallerInfoFromToken(abilityRequest.want, callerToken); } else if (!isStartAsCaller) { @@ -7301,7 +7301,7 @@ int AbilityManagerService::StartHighestPriorityAbility(int32_t userId, bool isBo } #endif int AbilityManagerService::GenerateAbilityRequest(const Want &want, int requestCode, AbilityRequest &request, - const sptr &callerToken, int32_t userId) + const sptr &callerToken, int32_t userId, const AAFwk::OpenLinkOptions &opt) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); auto abilityRecord = Token::GetAbilityRecordByToken(callerToken); @@ -7325,6 +7325,7 @@ int AbilityManagerService::GenerateAbilityRequest(const Want &want, int requestC request.want = want; request.requestCode = requestCode; request.callerToken = callerToken; + request.openLinkOptions = opt; auto setting = AbilityStartSetting::GetEmptySetting(); if (setting != nullptr) { setting->AddProperty(AbilityStartSetting::IS_START_BY_SCB_KEY, "false"); // default is false @@ -14049,13 +14050,13 @@ ErrCode AbilityManagerService::IntentOpenLinkInner(const std::shared_ptr callerToken, - int32_t userId, int32_t requestCode) + int32_t userId, int32_t requestCode, const AAFwk::OpenLinkOptions &opt) { - return OpenLinkInner(want, callerToken, userId, requestCode, true); + return OpenLinkInner(want, callerToken, userId, requestCode, true, opt); } ErrCode AbilityManagerService::OpenLinkInner(const Want& want, sptr callerToken, - int32_t userId, int32_t requestCode, bool removeInsightIntentFlag) + int32_t userId, int32_t requestCode, bool removeInsightIntentFlag, const AAFwk::OpenLinkOptions &opt) { if (AppUtils::GetInstance().IsForbidStart()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "forbid start: %{public}s", want.GetElement().GetBundleName().c_str()); @@ -14067,33 +14068,35 @@ ErrCode AbilityManagerService::OpenLinkInner(const Want& want, sptr(want)); std::string callerBundleName; Want convertedWant = want; + TAG_LOGD(AAFwkTag::ABILITYMGR, "openLinkOptions withoutDialog: %{public}d", opt.GetWithoutDialog()); if (!WantUtils::IsShortUrl(want) || WantUtils::GetCallerBundleName(callerBundleName) != ERR_OK) { TAG_LOGI(AAFwkTag::ABILITYMGR, "start ability by default"); - int retCode = StartAbilityWithRemoveIntentFlag(want, callerToken, userId, requestCode, removeInsightIntentFlag); + int retCode = StartAbilityWithRemoveIntentFlag( + want, callerToken, userId, requestCode, removeInsightIntentFlag, opt); CHECK_RET_RETURN_RET(retCode, "startAbility failed"); return ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK; } - TAG_LOGI(AAFwkTag::ABILITYMGR, "callerBundleName=%{public}s", callerBundleName.c_str()); convertedWant.SetParam(Want::PARAM_RESV_CALLER_BUNDLE_NAME, callerBundleName); uint32_t targetType = TARGET_TYPE_INIT; if (WantUtils::ConvertToExplicitWant(convertedWant, targetType) != ERR_OK) { TAG_LOGI(AAFwkTag::ABILITYMGR, "ConvertToExplicitWant fail. start ability by default"); - int retCode = StartAbilityWithRemoveIntentFlag(want, callerToken, userId, requestCode, removeInsightIntentFlag); + int retCode = StartAbilityWithRemoveIntentFlag(want, callerToken, userId, requestCode, + removeInsightIntentFlag, opt); CHECK_RET_RETURN_RET(retCode, "startAbility failed"); return ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK; } if (WantUtils::IsNormalApp(targetType)) { int retCode = StartAbilityWithRemoveIntentFlag(convertedWant, callerToken, userId, requestCode, - removeInsightIntentFlag); + removeInsightIntentFlag, opt); CHECK_RET_RETURN_RET(retCode, "startAbility failed"); return ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK; } if (WantUtils::IsAtomicService(targetType)) { return OpenLinkFreeInstallAtomicService(convertedWant, want, callerToken, userId, requestCode, - removeInsightIntentFlag); + removeInsightIntentFlag, opt); } bool curAppLinkingOnlyFlag = convertedWant.GetBoolParam(APP_LINKING_ONLY, false); TAG_LOGD(AAFwkTag::ABILITYMGR, "openLink not specific app or atomicService. AppLinkingOnly: %{public}d", @@ -14102,19 +14105,19 @@ ErrCode AbilityManagerService::OpenLinkInner(const Want& want, sptr callerToken, int32_t userId, int32_t requestCode, - bool removeInsightIntentFlag) + bool removeInsightIntentFlag, const AAFwk::OpenLinkOptions &opt) { if (freeInstallManager_ == nullptr) { TAG_LOGI(AAFwkTag::ABILITYMGR, "freeInstallManager_ nullptr. start ability by default"); auto retCode = StartAbilityWithRemoveIntentFlag(originalWant, callerToken, userId, requestCode, - removeInsightIntentFlag); + removeInsightIntentFlag, opt); CHECK_RET_RETURN_RET(retCode, "startAbility failed"); return ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK; } @@ -14133,7 +14136,7 @@ int32_t AbilityManagerService::OpenLinkFreeInstallAtomicService(Want &convertedW } TAG_LOGI(AAFwkTag::ABILITYMGR, "start ability by default"); retCode = StartAbilityWithRemoveIntentFlag(originalWant, callerToken, userId, requestCode, - removeInsightIntentFlag); + removeInsightIntentFlag, opt); CHECK_RET_RETURN_RET(retCode, "StartAbility failed"); return ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK; } diff --git a/services/abilitymgr/src/ability_manager_stub.cpp b/services/abilitymgr/src/ability_manager_stub.cpp index e5d8a75a12ed859921d589b4c6a60b40b98aafc7..e84a109fc3896655fa8326b3ffd6592cbceddd72 100644 --- a/services/abilitymgr/src/ability_manager_stub.cpp +++ b/services/abilitymgr/src/ability_manager_stub.cpp @@ -4356,8 +4356,13 @@ int32_t AbilityManagerStub::OpenLinkInner(MessageParcel &data, MessageParcel &re sptr callerToken = data.ReadRemoteObject(); int32_t userId = data.ReadInt32(); int requestCode = data.ReadInt32(); + sptr opt = data.ReadParcelable(); + if (opt == nullptr) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "openLinkOptions null"); + return ERR_INVALID_VALUE; + } - int32_t result = OpenLink(*want, callerToken, userId, requestCode); + int32_t result = OpenLink(*want, callerToken, userId, requestCode, *opt); if (result != NO_ERROR && result != ERR_OPEN_LINK_START_ABILITY_DEFAULT_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "openLink fail"); } diff --git a/services/abilitymgr/src/implicit_start_processor.cpp b/services/abilitymgr/src/implicit_start_processor.cpp index 64e0cd7c02e3568749ac6897fe13f5d87e72588b..5cf2a2d9b58e65ceb6cd4af9e405c344119bf368 100644 --- a/services/abilitymgr/src/implicit_start_processor.cpp +++ b/services/abilitymgr/src/implicit_start_processor.cpp @@ -203,8 +203,12 @@ int ImplicitStartProcessor::ImplicitStartAbility(AbilityRequest &request, int32_ } if (want.GetBoolParam("isCreateAppGallerySelector", false)) { want.RemoveParam("isCreateAppGallerySelector"); - DialogSessionManager::GetInstance().CreateImplicitSelectorModalDialog(request, want, userId, - dialogAppInfos); + TAG_LOGD(AAFwkTag::ABILITYMGR, "openLinkOptions withoutDialog: %{public}d", + request.openLinkOptions.GetWithoutDialog()); + if (!request.openLinkOptions.GetWithoutDialog()) { + DialogSessionManager::GetInstance().CreateImplicitSelectorModalDialog(request, want, userId, + dialogAppInfos); + } return ERR_IMPLICIT_START_ABILITY_FAIL; } std::vector dialogAllAppInfos; diff --git a/services/abilitymgr/src/open_link/open_link_options.cpp b/services/abilitymgr/src/open_link/open_link_options.cpp index b47db5d3cb5922ffdf3f3d586ad1e41eeab25dc2..598add10c2e4f60988a286fe6420e12b6b4d1b33 100644 --- a/services/abilitymgr/src/open_link/open_link_options.cpp +++ b/services/abilitymgr/src/open_link/open_link_options.cpp @@ -20,6 +20,7 @@ namespace AAFwk { OpenLinkOptions::OpenLinkOptions(const OpenLinkOptions &other) { appLinkingOnly_ = other.appLinkingOnly_; + withoutDialog_ = other.withoutDialog_; parameters_ = other.parameters_; } @@ -27,6 +28,7 @@ OpenLinkOptions &OpenLinkOptions::operator=(const OpenLinkOptions &other) { if (this != &other) { appLinkingOnly_ = other.appLinkingOnly_; + withoutDialog_ = other.withoutDialog_; parameters_ = other.parameters_; } return *this; @@ -59,7 +61,12 @@ bool OpenLinkOptions::ReadFromParcel(Parcel &parcel) if (!parcel.ReadBool(appLinkingOnly)) { return false; } + bool withoutDialog; + if (!parcel.ReadBool(withoutDialog)) { + return false; + } SetAppLinkingOnly(appLinkingOnly); + SetWithoutDialog(withoutDialog); if (!ReadParameters(parcel)) { return false; @@ -107,6 +114,10 @@ bool OpenLinkOptions::Marshalling(Parcel &parcel) const if (!parcel.WriteBool(GetAppLinkingOnly())) { return false; } + // write GetWithoutDialog + if (!parcel.WriteBool(GetWithoutDialog())) { + return false; + } // write parameters if (!WriteParameters(GetParameters(), parcel)) { return false; @@ -125,6 +136,16 @@ bool OpenLinkOptions::GetAppLinkingOnly() const return appLinkingOnly_; } +void OpenLinkOptions::SetWithoutDialog(bool withoutDialog) +{ + withoutDialog_ = withoutDialog; +} + +bool OpenLinkOptions::GetWithoutDialog() const +{ + return withoutDialog_; +} + void OpenLinkOptions::SetParameters(WantParams parameters) { parameters_ = parameters; diff --git a/test/unittest/ability_manager_service_fourth_test/BUILD.gn b/test/unittest/ability_manager_service_fourth_test/BUILD.gn index a4d09d987de94a3bf363b27edb405c0b74669ff0..f9d3ecb37c165cdb48c69535110eef41145ed993 100644 --- a/test/unittest/ability_manager_service_fourth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_fourth_test/BUILD.gn @@ -56,6 +56,7 @@ ohos_unittest("ability_manager_service_fourth_test") { "${ability_runtime_services_path}/abilitymgr/src/exit_reason.cpp", "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_execute_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/modal_system_dialog/modal_system_dialog_ui_extension.cpp", + "${ability_runtime_services_path}/abilitymgr/src/open_link/open_link_options.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/ability_event_util.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/modal_system_dialog_util.cpp", "${ability_runtime_services_path}/common/src/ffrt_task_handler_wrap.cpp", diff --git a/test/unittest/ability_manager_service_tenth_test/BUILD.gn b/test/unittest/ability_manager_service_tenth_test/BUILD.gn index ae432f006ab9c1de403030d2455176f7780ac770..09eb422bc64b0d9a16aec811df39640f3a5df2d0 100644 --- a/test/unittest/ability_manager_service_tenth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_tenth_test/BUILD.gn @@ -40,6 +40,7 @@ ohos_unittest("ability_manager_service_tenth_test") { "${ability_runtime_path}/services/abilitymgr/src/ability_auto_startup_service.cpp", "${ability_runtime_path}/services/abilitymgr/src/auto_startup_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_connect_callback_stub.cpp", + "${ability_runtime_services_path}/abilitymgr/src/open_link/open_link_options.cpp", "${ability_runtime_test_path}/mock/task_handler_wrap_mock/src/mock_task_handler_wrap.cpp", "ability_manager_service_tenth_test.cpp", ] diff --git a/test/unittest/ability_manager_service_twelfth_test/BUILD.gn b/test/unittest/ability_manager_service_twelfth_test/BUILD.gn index 106783e490d1b1f75de52d6bd14c7d38a3bf844c..1eef84f55d8001e9f65bdfa05364f680185ebb33 100644 --- a/test/unittest/ability_manager_service_twelfth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_twelfth_test/BUILD.gn @@ -59,6 +59,7 @@ ohos_unittest("ability_manager_service_twelfth_test") { "${ability_runtime_services_path}/abilitymgr/src/exit_reason.cpp", "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_execute_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/modal_system_dialog/modal_system_dialog_ui_extension.cpp", + "${ability_runtime_services_path}/abilitymgr/src/open_link/open_link_options.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/ability_event_util.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/modal_system_dialog_util.cpp", "${ability_runtime_services_path}/common/src/ffrt_task_handler_wrap.cpp", diff --git a/test/unittest/ability_timeout_test/BUILD.gn b/test/unittest/ability_timeout_test/BUILD.gn index 7b49789e40844e5e37e76f12ea35650c3066bf54..72f1a08c6773c84d90c9f667934cf3909ce76b67 100644 --- a/test/unittest/ability_timeout_test/BUILD.gn +++ b/test/unittest/ability_timeout_test/BUILD.gn @@ -26,6 +26,7 @@ ohos_unittest("ability_timeout_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/app_mgr_client_first_test/BUILD.gn b/test/unittest/app_mgr_client_first_test/BUILD.gn index dc867934d19e635bed8856a6930cf31e1a86d73d..1a2c4ff5d43461b481413ba05d1c6891e2021e6a 100644 --- a/test/unittest/app_mgr_client_first_test/BUILD.gn +++ b/test/unittest/app_mgr_client_first_test/BUILD.gn @@ -40,6 +40,7 @@ ohos_unittest("app_mgr_client_first_test") { ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", ] diff --git a/test/unittest/app_mgr_client_test/BUILD.gn b/test/unittest/app_mgr_client_test/BUILD.gn index 3066eaf37bb1eb302ec80dd37eb146f710ac1ff8..7f7cfee684c8da0972edad3aa2bf881658f52c7e 100644 --- a/test/unittest/app_mgr_client_test/BUILD.gn +++ b/test/unittest/app_mgr_client_test/BUILD.gn @@ -40,6 +40,7 @@ ohos_unittest("AppMgrClientTest") { ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", ] diff --git a/test/unittest/app_running_manager_fourth_test/BUILD.gn b/test/unittest/app_running_manager_fourth_test/BUILD.gn index 8272bd4e7998e2afd509958fc48b8eaff83492d6..5fcf54e4408f638b900d9fbb8050d7909933b266 100644 --- a/test/unittest/app_running_manager_fourth_test/BUILD.gn +++ b/test/unittest/app_running_manager_fourth_test/BUILD.gn @@ -31,6 +31,7 @@ ohos_unittest("app_running_manager_fourth_test") { sources = [ "app_running_manager_fourth_test.cpp" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/dialog_session_manager_test/BUILD.gn b/test/unittest/dialog_session_manager_test/BUILD.gn index d24f472d80e9f598739517978ca3a53fe905cdb5..9a9da310db576314491a75166a84fd29ee0f37c0 100644 --- a/test/unittest/dialog_session_manager_test/BUILD.gn +++ b/test/unittest/dialog_session_manager_test/BUILD.gn @@ -48,6 +48,7 @@ ohos_unittest("dialog_session_manager_test") { cflags = [] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_path}/utils/server/startup:startup_util", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/dlp_utils_test/BUILD.gn b/test/unittest/dlp_utils_test/BUILD.gn index dbfc9fee6adb72127e7db586e1bfd1684deb56c5..0ac0ffaf005c30d1ac4e2b11d4000611a311b376 100644 --- a/test/unittest/dlp_utils_test/BUILD.gn +++ b/test/unittest/dlp_utils_test/BUILD.gn @@ -24,6 +24,7 @@ ohos_unittest("dlp_utils_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", ] diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp b/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp index 3a130c3857300139cd4e44bc84bd48da045ed529..47f08658f28567d264618ff85949d9a8fcce15ca 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/ability_context_test.cpp @@ -282,7 +282,7 @@ public: { return ERR_OK; } - virtual ErrCode OpenLink(const AAFwk::Want& want, int requestCode) + virtual ErrCode OpenLink(const AAFwk::Want& want, int requestCode, const AAFwk::OpenLinkOptions &opt = {}) { return ERR_OK; } diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp index b46525e93d3065adb8f5a5deb98d7f7556b60099..a51ae56bb8362e345e6d549b149008f191eda460 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/mock_ability_manager_client.cpp @@ -998,7 +998,7 @@ ErrCode AbilityManagerClient::PreStartMission(const std::string& bundleName, con } ErrCode AbilityManagerClient::OpenLink(const Want& want, sptr callerToken, - int32_t userId, int requestCode) + int32_t userId, int requestCode, const AAFwk::OpenLinkOptions &opt) { return ERR_OK; } diff --git a/test/unittest/free_install_manager_test/BUILD.gn b/test/unittest/free_install_manager_test/BUILD.gn index c98cea2784ff7acc074aea163bf1862830ebf657..fca5a72efd4779e6264c389dec375cffc8ecf78b 100644 --- a/test/unittest/free_install_manager_test/BUILD.gn +++ b/test/unittest/free_install_manager_test/BUILD.gn @@ -26,6 +26,7 @@ ohos_unittest("free_install_manager_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/free_install_manager_third_test/BUILD.gn b/test/unittest/free_install_manager_third_test/BUILD.gn index d8a0c953af74cdcc9a87aa668010b4c349460da0..51f4c893b54c1f122eb1260df6f621ecd4e8d683 100644 --- a/test/unittest/free_install_manager_third_test/BUILD.gn +++ b/test/unittest/free_install_manager_third_test/BUILD.gn @@ -41,6 +41,7 @@ ohos_unittest("free_install_manager_third_test") { ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/free_install_observer_manager_test/BUILD.gn b/test/unittest/free_install_observer_manager_test/BUILD.gn index 9db6381c5c8fb96ec87e09bd0ba20f0abd6686ae..b5de6ac01295e06654bf327199e3e0dbee790ce2 100644 --- a/test/unittest/free_install_observer_manager_test/BUILD.gn +++ b/test/unittest/free_install_observer_manager_test/BUILD.gn @@ -32,6 +32,8 @@ ohos_unittest("free_install_observer_manager_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/hidden_start_observer_manager_test/BUILD.gn b/test/unittest/hidden_start_observer_manager_test/BUILD.gn index f9a95f72ad13ad1361c4c74c2327c9a6709970d3..0cd8d26aef4e003cae894d0e2a57374f890153ae 100644 --- a/test/unittest/hidden_start_observer_manager_test/BUILD.gn +++ b/test/unittest/hidden_start_observer_manager_test/BUILD.gn @@ -35,6 +35,7 @@ ohos_unittest("hidden_start_observer_manager_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/kiosk_manager_test/BUILD.gn b/test/unittest/kiosk_manager_test/BUILD.gn index bc4ddad0a8f13f6862b3077032ca01986c09e5a1..5e478fde33d174add7aedcbdde33545322ed0aa2 100644 --- a/test/unittest/kiosk_manager_test/BUILD.gn +++ b/test/unittest/kiosk_manager_test/BUILD.gn @@ -77,6 +77,7 @@ ohos_unittest("kiosk_manager_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_innerkits_path}/app_manager:app_manager", diff --git a/test/unittest/multi_instance_utils_second_test/BUILD.gn b/test/unittest/multi_instance_utils_second_test/BUILD.gn index 9d2e3cebea226588ffa2e0e1865268351f546de7..f6a45de7f14f0c3ba118d04cb041c037d77ca5fa 100644 --- a/test/unittest/multi_instance_utils_second_test/BUILD.gn +++ b/test/unittest/multi_instance_utils_second_test/BUILD.gn @@ -24,6 +24,7 @@ ohos_unittest("multi_instance_utils_second_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:app_util", ] diff --git a/test/unittest/multi_instance_utils_test/BUILD.gn b/test/unittest/multi_instance_utils_test/BUILD.gn index e7fd0321c607def260e9912c8a112f1bdec91058..c946bb97e60a9b00a375dedccaac590a08d834b9 100644 --- a/test/unittest/multi_instance_utils_test/BUILD.gn +++ b/test/unittest/multi_instance_utils_test/BUILD.gn @@ -24,6 +24,7 @@ ohos_unittest("multi_instance_utils_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:app_util", ] diff --git a/test/unittest/running_infos_test/BUILD.gn b/test/unittest/running_infos_test/BUILD.gn index ed9338a50ec630e61ca35d851dd1ac986c2c5b95..2f2219d4488612bac631e3355d4d8a5c5bd1c148 100644 --- a/test/unittest/running_infos_test/BUILD.gn +++ b/test/unittest/running_infos_test/BUILD.gn @@ -26,6 +26,7 @@ ohos_unittest("running_infos_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/uri_utils_test/BUILD.gn b/test/unittest/uri_utils_test/BUILD.gn index 438d6b81f2179e3bb5a915c7392cc6fe6d59db77..2b82d591a51ee9c5c255c3835fd15d8fd4652b33 100644 --- a/test/unittest/uri_utils_test/BUILD.gn +++ b/test/unittest/uri_utils_test/BUILD.gn @@ -42,6 +42,7 @@ ohos_unittest("uri_utils_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", "${ability_runtime_native_path}/appkit:appkit_manager_helper",