From d6b421552589d55834aea5803e38c26161e6c5eb Mon Sep 17 00:00:00 2001 From: wangbing Date: Sat, 16 Aug 2025 16:09:39 +0800 Subject: [PATCH] support deeplink withoutdialog Signed-off-by: wangbing --- .../napi_common_open_link_options.cpp | 5 +++ .../open_link/napi_common_open_link_options.h | 1 + .../ability_runtime/ability_context_impl.cpp | 4 +- .../ability_runtime/js_ability_context.cpp | 10 ++--- .../native/js_service_extension_context.cpp | 8 ++-- .../js_ui_extension_context.cpp | 8 ++-- .../ui_extension_context.cpp | 4 +- .../service_extension_context.cpp | 4 +- .../include/ability_manager_client.h | 4 +- .../include/ability_manager_interface.h | 5 ++- .../include/open_link_options.h | 3 ++ .../ability/ability_runtime/ability_context.h | 3 +- .../ability_runtime/ability_context_impl.h | 2 +- .../ability_runtime/js_ability_context.h | 4 +- .../js_ui_extension_context.h | 2 +- .../ui_extension_base/ui_extension_context.h | 3 +- .../service_extension_context.h | 2 +- .../include/ability_manager_proxy.h | 4 +- .../include/ability_manager_service.h | 22 +++++---- services/abilitymgr/include/ability_record.h | 4 +- .../abilitymgr/src/ability_manager_client.cpp | 4 +- .../abilitymgr/src/ability_manager_proxy.cpp | 6 ++- .../src/ability_manager_service.cpp | 45 ++++++++++--------- .../abilitymgr/src/ability_manager_stub.cpp | 7 ++- .../src/implicit_start_processor.cpp | 8 +++- .../src/open_link/open_link_options.cpp | 21 +++++++++ .../BUILD.gn | 1 + .../BUILD.gn | 1 + .../BUILD.gn | 1 + test/unittest/ability_timeout_test/BUILD.gn | 1 + .../app_mgr_client_first_test/BUILD.gn | 1 + test/unittest/app_mgr_client_test/BUILD.gn | 1 + .../app_running_manager_fourth_test/BUILD.gn | 1 + .../dialog_session_manager_test/BUILD.gn | 1 + test/unittest/dlp_utils_test/BUILD.gn | 1 + .../ability_context_test.cpp | 2 +- .../mock_ability_manager_client.cpp | 2 +- .../free_install_manager_test/BUILD.gn | 1 + .../free_install_manager_third_test/BUILD.gn | 1 + .../BUILD.gn | 2 + .../BUILD.gn | 1 + test/unittest/kiosk_manager_test/BUILD.gn | 1 + .../multi_instance_utils_second_test/BUILD.gn | 1 + .../multi_instance_utils_test/BUILD.gn | 1 + test/unittest/running_infos_test/BUILD.gn | 1 + test/unittest/uri_utils_test/BUILD.gn | 1 + 46 files changed, 146 insertions(+), 70 deletions(-) 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 430b99e1cf5..61ae2eb1d3c 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 78c381a6c3d..27843975fa5 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 39bc51ebfd0..8c8c421e0db 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 f273f8edd43..6e4124fe13f 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 163c4c3a325..484f6741503 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 bb48409d762..695f43ac645 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 d8f1a0a551a..a8cf63f0ef5 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 ac3fff62cf8..fbc6ef40227 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 60e6e80a814..7a6aa099e77 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 c04c88ea43a..52e2aff62a2 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 f01875662fc..cc1f485f8e2 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 1bc0b053dec..9f49e8692aa 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 35bdfd8339a..6a12f0a060c 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 b1e8c0b70fc..65c8a961f0b 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 41e074b89ae..a1f88cd9a9d 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 8dcd4477f0e..17faf24da4d 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 b43da9bde5e..d078134d8d1 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 90aa5002ea4..102ce230fe5 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 2a291424e2d..0218565c93a 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 79b765ebba5..7e86e7d0dc4 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 e4149b294d1..1faf9817c5c 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 8ab7a0ec36f..8aa3955e3a7 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 da29f8b836b..4a856acaabf 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 e5d8a75a12e..e84a109fc38 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 64e0cd7c02e..5cf2a2d9b58 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 b47db5d3cb5..598add10c2e 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 a4d09d987de..f9d3ecb37c1 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 ae432f006ab..09eb422bc64 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 106783e490d..1eef84f55d8 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 7b49789e408..72f1a08c677 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 dc867934d19..1a2c4ff5d43 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 3066eaf37bb..7f7cfee684c 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 8272bd4e799..5fcf54e4408 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 d24f472d80e..9a9da310db5 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 dbfc9fee6ad..0ac0ffaf005 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 3a130c38573..47f08658f28 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 b46525e93d3..a51ae56bb83 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 c98cea2784f..fca5a72efd4 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 d8a0c953af7..51f4c893b54 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 9db6381c5c8..b5de6ac0129 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 f9a95f72ad1..0cd8d26aef4 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 bc4ddad0a8f..5e478fde33d 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 9d2e3cebea2..f6a45de7f14 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 e7fd0321c60..c946bb97e60 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 ed9338a50ec..2f2219d4488 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 438d6b81f21..2b82d591a51 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", -- Gitee