diff --git a/ability.tar b/ability.tar new file mode 100644 index 0000000000000000000000000000000000000000..872c01559ea7ac2302b7d73ae653f7ad29f8981d Binary files /dev/null and b/ability.tar differ diff --git a/ability_runtime b/ability_runtime new file mode 100644 index 0000000000000000000000000000000000000000..4148ea2cb936b2d93cfa62dade41a6459cfe485f Binary files /dev/null and b/ability_runtime differ diff --git a/ability_runtime.tgz b/ability_runtime.tgz new file mode 100644 index 0000000000000000000000000000000000000000..015ffb632b0e3d0f83e8b320635891cf8bb0e707 --- /dev/null +++ b/ability_runtime.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85cea451eec057fa7e734548ca3ba6d779ed5836a3f9de14b8394575ef0d7d8e +size 45 diff --git a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp index 91946998e9d4460da80a3551057e7a1e45d47f33..72f05c57b670f639ec1f64e7ab0d482dff30078e 100644 --- a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp +++ b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp @@ -165,7 +165,7 @@ ErrCode AbilityContextImpl::StartAbility(const AAFwk::Want& want, int requestCod { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); TAG_LOGD(AAFwkTag::CONTEXT, "called"); - ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode); + ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode, -1); if (err != ERR_OK) { TAG_LOGE(AAFwkTag::CONTEXT, "ret=%{public}d", err); } @@ -176,7 +176,8 @@ ErrCode AbilityContextImpl::StartAbilityAsCaller(const AAFwk::Want &want, int re { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); TAG_LOGD(AAFwkTag::CONTEXT, "called"); - ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbilityAsCaller(want, token_, nullptr, requestCode); + ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbilityAsCaller(want, token_, nullptr, + requestCode, -1); if (err != ERR_OK) { TAG_LOGE(AAFwkTag::CONTEXT, "ret=%{public}d", err); } @@ -199,7 +200,8 @@ ErrCode AbilityContextImpl::StartAbility(const AAFwk::Want& want, const AAFwk::S { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); TAG_LOGD(AAFwkTag::CONTEXT, "called"); - ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, startOptions, token_, requestCode); + ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, startOptions, token_, + requestCode, -1); if (err != ERR_OK) { TAG_LOGE(AAFwkTag::CONTEXT, "ret=%{public}d", err); } @@ -212,7 +214,7 @@ ErrCode AbilityContextImpl::StartAbilityAsCaller(const AAFwk::Want &want, const HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); TAG_LOGD(AAFwkTag::CONTEXT, "called"); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbilityAsCaller(want, - startOptions, token_, nullptr, requestCode); + startOptions, token_, nullptr, requestCode, -1); if (err != ERR_OK) { TAG_LOGE(AAFwkTag::CONTEXT, "ret=%{public}d", err); } @@ -263,7 +265,8 @@ ErrCode AbilityContextImpl::StartAbilityForResult(const AAFwk::Want& want, const { TAG_LOGD(AAFwkTag::CONTEXT, "called"); resultCallbacks_.insert(make_pair(requestCode, std::move(task))); - ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, startOptions, token_, requestCode); + ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, startOptions, token_, requestCode, + -1); if (err != ERR_OK && err != AAFwk::START_ABILITY_WAITING) { TAG_LOGE(AAFwkTag::CONTEXT, "ret=%{public}d", err); OnAbilityResultInner(requestCode, err, want); diff --git a/frameworks/native/ability/ability_runtime/connection_manager.cpp b/frameworks/native/ability/ability_runtime/connection_manager.cpp index 5eae8cc4358e78cb91ee0944063652adebdbdd27..f51d5c80841f6d3755d42695392f53b2c23a13d3 100644 --- a/frameworks/native/ability/ability_runtime/connection_manager.cpp +++ b/frameworks/native/ability/ability_runtime/connection_manager.cpp @@ -39,7 +39,7 @@ ConnectionManager& ConnectionManager::GetInstance() ErrCode ConnectionManager::ConnectAbility(const sptr& connectCaller, const AAFwk::Want& want, const sptr& connectCallback) { - return ConnectAbilityInner(connectCaller, want, AAFwk::DEFAULT_INVAL_VALUE, connectCallback); + return ConnectAbilityInner(connectCaller, want, DEFAULT_INVAL_VALUE, connectCallback); } ErrCode ConnectionManager::ConnectAbilityWithAccount(const sptr& connectCaller, @@ -51,7 +51,7 @@ ErrCode ConnectionManager::ConnectAbilityWithAccount(const sptr& ErrCode ConnectionManager::ConnectUIServiceExtensionAbility(const sptr& connectCaller, const AAFwk::Want& want, const sptr& connectCallback) { - return ConnectAbilityInner(connectCaller, want, AAFwk::DEFAULT_INVAL_VALUE, connectCallback, true); + return ConnectAbilityInner(connectCaller, want, DEFAULT_INVAL_VALUE, connectCallback, true); } ErrCode ConnectionManager::ConnectAbilityInner(const sptr& connectCaller, diff --git a/frameworks/native/ability/native/ability_context.cpp b/frameworks/native/ability/native/ability_context.cpp index 0d50d185cecf6aecb8e47eafebf0c992cc8bb24d..7aafd671ae2af50c52b48cb80a98dc3cd0c3c846 100644 --- a/frameworks/native/ability/native/ability_context.cpp +++ b/frameworks/native/ability/native/ability_context.cpp @@ -56,7 +56,7 @@ ErrCode AbilityContext::StartAbility(const AAFwk::Want &want, int requestCode) TAG_LOGE(AAFwkTag::CONTEXT, "abilityType: %{public}d", type); return ERR_INVALID_VALUE; } - ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode); + ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode, -1); TAG_LOGD(AAFwkTag::CONTEXT, "ret=%{public}d", err); return err; } @@ -71,7 +71,7 @@ ErrCode AbilityContext::StartAbility(const Want &want, int requestCode, const Ab return ERR_INVALID_VALUE; } ErrCode err = - AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, abilityStartSetting, token_, requestCode); + AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, abilityStartSetting, token_, requestCode, -1); TAG_LOGD(AAFwkTag::CONTEXT, "ret=%{public}d", err); return err; } @@ -174,7 +174,7 @@ bool AbilityContext::ConnectAbility(const Want &want, const sptrConnectAbility(want, conn, token_); + ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->ConnectAbility(want, conn, token_, -1); TAG_LOGD(AAFwkTag::CONTEXT, "ret=%{public}d", ret); bool value = ((ret == ERR_OK) ? true : false); if (!value) { diff --git a/frameworks/native/appkit/ability_delegator/ability_delegator.cpp b/frameworks/native/appkit/ability_delegator/ability_delegator.cpp index 1449f61557fd7bd7e29303c5e7c9defd09967ce3..7f0288856187fd798ed258a8a1e8639c20bfa306 100644 --- a/frameworks/native/appkit/ability_delegator/ability_delegator.cpp +++ b/frameworks/native/appkit/ability_delegator/ability_delegator.cpp @@ -289,7 +289,7 @@ ErrCode AbilityDelegator::StartAbility(const AAFwk::Want &want) } realWant.SetParam(IS_DELEGATOR_CALL, true); - return AbilityManagerClient::GetInstance()->StartAbility(realWant); + return AbilityManagerClient::GetInstance()->StartAbility(realWant, -1, -1); } bool AbilityDelegator::DoAbilityForeground(const sptr &token) diff --git a/frameworks/native/appkit/ability_delegator/cj_ability_delegator_impl.cpp b/frameworks/native/appkit/ability_delegator/cj_ability_delegator_impl.cpp index 112d4a00ca6cafdf1518344b1dbcad1946ac8e20..0f3df215ba71d2de67e92847c534b0f94e98170d 100644 --- a/frameworks/native/appkit/ability_delegator/cj_ability_delegator_impl.cpp +++ b/frameworks/native/appkit/ability_delegator/cj_ability_delegator_impl.cpp @@ -288,7 +288,7 @@ ErrCode CJAbilityDelegatorImpl::StartAbility(const AAFwk::Want& want) } realWant.SetParam(IS_DELEGATOR_CALL, true); - return AbilityManagerClient::GetInstance()->StartAbility(realWant); + return AbilityManagerClient::GetInstance()->StartAbility(realWant, -1, -1); } bool CJAbilityDelegatorImpl::DoAbilityForeground(const sptr& token) diff --git a/frameworks/native/appkit/ability_runtime/context/js_application_context_utils.cpp b/frameworks/native/appkit/ability_runtime/context/js_application_context_utils.cpp index 5eca238c7b3a86c34565204aee8af58fd13912c4..ca590956a964c32f0ad23e9032b555753b2c7e35 100644 --- a/frameworks/native/appkit/ability_runtime/context/js_application_context_utils.cpp +++ b/frameworks/native/appkit/ability_runtime/context/js_application_context_utils.cpp @@ -815,7 +815,8 @@ napi_value JsApplicationContextUtils::OnPreloadUIExtensionAbility(napi_env env, } auto hostBundleName = context->GetBundleName(); TAG_LOGD(AAFwkTag::APPKIT, "HostBundleName is %{public}s", hostBundleName.c_str()); - *innerErrCode = AAFwk::AbilityManagerClient::GetInstance()->PreloadUIExtensionAbility(want, hostBundleName); + *innerErrCode = AAFwk::AbilityManagerClient::GetInstance()->PreloadUIExtensionAbility(want, + hostBundleName, -1, -1); }; NapiAsyncTask::CompleteCallback complete = [innerErrCode](napi_env env, NapiAsyncTask& task, int32_t status) { if (*innerErrCode == ERR_OK) { diff --git a/interfaces/inner_api/ability_manager/BUILD.gn b/interfaces/inner_api/ability_manager/BUILD.gn index aa8715fafaeb2e06d73f1ea56cfc382ad238411a..8463cf4c40112f91c16f4319fec207a6bad22efb 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -11,8 +11,37 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build/config/components/idl_tool/idl.gni") import("//build/ohos.gni") import("//foundation/ability/ability_runtime/ability_runtime.gni") +idl_gen_interface("ability_manager_interface") { + sources = [ + "IAbilityManager.idl", + "IHiddenStartObserver.idl", + "IAbilityFirstFrameStateObserver.idl" + ] + sources_common = [ + "ability_state.idl", + "ExtensionAbilityType.idl", + "IFooCustom.idl", + "mission_info.idl", + "UIExtensionWindowCommand.idl" + ] + log_domainid = "0xD001336" + log_tag = "AbilityMgr" + subsystem_name = "ability" + part_name = "ability_runtime" +} + + + +config("ability_manager_idl_config") { + include_dirs = [ + "${ability_runtime_innerkits_path}/dataobs_manager/include", + "${target_gen_dir}", + "include/", + ] +} config("ability_manager_public_config") { visibility = [ ":*" ] @@ -61,7 +90,339 @@ config("ability_manager_public_config") { } } +ohos_source_set("ability_manager_proxy") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + output_values = get_target_outputs(":ability_manager_interface") + source_values = [ + "*ability_manager_proxy.cpp", + "*hidden_start_observer_proxy.cpp", + "*ability_first_frame_state_observer_proxy.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + public_deps = [ ":ability_connect_callback_stub" ] + + deps = [ + ":ability_manager_interface", + ":ability_start_options", + ":ability_start_setting", + ":mission_info", + ":process_options", + ":start_window_option", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_path}/utils/global/freeze:freeze_util", + "${ability_runtime_services_path}/abilitymgr:wantagent_manager", + ] + + external_deps = [ + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "samgr:samgr_proxy", + ] + + if (host_cpu != "arm64") { + external_deps += [ "relational_store:native_rdb" ] + } + + public_external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "ability_base:zuri", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "init:libbegetutil", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "ability_base:session_info", + "image_framework:image_native", + "window_manager:libwsutils", + "window_manager:session_manager_lite", + ] + public_external_deps += [ "graphic_2d:color_manager" ] + } + subsystem_name = "ability" + part_name = "ability_runtime" +} + +ohos_source_set("ability_manager_stub") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + output_values = get_target_outputs(":ability_manager_interface") + source_values = [ + "*ability_manager_stub.cpp", + "*hidden_start_observer_stub.cpp", + "*ability_first_frame_state_observer_stub.cpp" + + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + public_deps = [ ":ability_connect_callback_stub" ] + + deps = [ + ":ability_manager_interface", + ":ability_start_options", + ":ability_start_setting", + ":mission_info", + ":process_options", + ":start_window_option", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_path}/utils/global/freeze:freeze_util", + "${ability_runtime_services_path}/abilitymgr:wantagent_manager", + ] + + external_deps = [ + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "samgr:samgr_proxy", + ] + + if (host_cpu != "arm64") { + external_deps += [ "relational_store:native_rdb" ] + } + + public_external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "ability_base:zuri", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "init:libbegetutil", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "ability_base:session_info", + "image_framework:image_native", + "window_manager:libwsutils", + "window_manager:session_manager_lite", + ] + public_external_deps += [ "graphic_2d:color_manager" ] + } + subsystem_name = "ability" + part_name = "ability_runtime" +} + +ohos_source_set("abilityms_proxy") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + output_values = get_target_outputs(":ability_manager_interface") + source_values = [ + "*ability_manager_proxy.cpp", + "*hidden_start_observer_proxy.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + public_deps = [ ":ability_connect_callback_stub" ] + + deps = [ + ":ability_manager_interface", + ":ability_start_options", + ":ability_start_setting", + ":mission_info", + ":process_options", + ":start_window_option", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_path}/utils/global/freeze:freeze_util", + "${ability_runtime_services_path}/abilitymgr:wantagent_manager", + ] + + external_deps = [ + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "samgr:samgr_proxy", + ] + + if (host_cpu != "arm64") { + external_deps += [ "relational_store:native_rdb" ] + } + + public_external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "ability_base:zuri", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "init:libbegetutil", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "ability_base:session_info", + "image_framework:image_native", + "window_manager:libwsutils", + "window_manager:session_manager_lite", + ] + public_external_deps += [ "graphic_2d:color_manager" ] + } + subsystem_name = "ability" + part_name = "ability_runtime" +} + +ohos_source_set("abilityms_stub") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + output_values = get_target_outputs(":ability_manager_interface") + source_values = [ + "*ability_manager_stub.cpp", + "*hidden_start_observer_stub.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + public_deps = [ ":ability_connect_callback_stub" ] + + deps = [ + ":ability_manager_interface", + ":ability_start_options", + ":ability_start_setting", + ":mission_info", + ":process_options", + ":start_window_option", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_path}/utils/global/freeze:freeze_util", + "${ability_runtime_services_path}/abilitymgr:wantagent_manager", + ] + + external_deps = [ + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "samgr:samgr_proxy", + ] + + if (host_cpu != "arm64") { + external_deps += [ "relational_store:native_rdb" ] + } + + public_external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "ability_base:zuri", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "init:libbegetutil", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "ability_base:session_info", + "image_framework:image_native", + "window_manager:libwsutils", + "window_manager:session_manager_lite", + ] + public_external_deps += [ "graphic_2d:color_manager" ] + } + subsystem_name = "ability" + part_name = "ability_runtime" +} + ohos_shared_library("ability_manager") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } use_exceptions = true branch_protector_ret = "pac_ret" @@ -73,7 +434,6 @@ ohos_shared_library("ability_manager") { "${ability_runtime_native_path}/ability/native/task_handler_client.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_auto_startup_client.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_manager_client.cpp", - "${ability_runtime_services_path}/abilitymgr/src/ability_manager_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_running_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_scheduler_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/acquire_share_data_callback_proxy.cpp", @@ -106,8 +466,8 @@ ohos_shared_library("ability_manager") { "${ability_runtime_services_path}/abilitymgr/src/user_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_callback_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/window_config.cpp", - "src/hidden_start_observer_proxy.cpp", - "src/hidden_start_observer_stub.cpp", + #"src/hidden_start_observer_proxy.cpp", + #"src/hidden_start_observer_stub.cpp", "src/status_bar_delegate/status_bar_delegate_proxy.cpp", "src/status_bar_delegate/status_bar_delegate_stub.cpp", "src/window_manager_service_handler_proxy.cpp", @@ -117,13 +477,12 @@ ohos_shared_library("ability_manager") { if (ability_runtime_graphics) { sources += [ "src/ability_first_frame_state_data.cpp", - "src/ability_first_frame_state_observer_proxy.cpp", - "src/ability_first_frame_state_observer_stub.cpp", ] } public_configs = [ ":ability_manager_public_config", + ":ability_manager_idl_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", ] @@ -131,6 +490,8 @@ ohos_shared_library("ability_manager") { deps = [ ":ability_start_options", + ":ability_manager_proxy", + ":ability_manager_stub", ":ability_start_setting", ":mission_info", ":process_options", @@ -418,6 +779,8 @@ ohos_shared_library("ability_connect_callback_stub") { "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", ] if (ability_runtime_graphics) { external_deps += [ "graphic_2d:color_manager" ] diff --git a/interfaces/inner_api/ability_manager/include/hidden_start_observer_stub.h b/interfaces/inner_api/ability_manager/IAbilityFirstFrameStateObserver.idl similarity index 40% rename from interfaces/inner_api/ability_manager/include/hidden_start_observer_stub.h rename to interfaces/inner_api/ability_manager/IAbilityFirstFrameStateObserver.idl index cf7a8678659a9a5eacae6950f264a2ad35656a25..cbd46238bb23680ba8c0cc0aa20ce912d043fcd0 100644 --- a/interfaces/inner_api/ability_manager/include/hidden_start_observer_stub.h +++ b/interfaces/inner_api/ability_manager/IAbilityFirstFrameStateObserver.idl @@ -1,45 +1,19 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_HIDDEN_START_OBSERVER_STUB_H -#define OHOS_ABILITY_RUNTIME_HIDDEN_START_OBSERVER_STUB_H - -#include -#include - -#include "iremote_stub.h" -#include "nocopyable.h" -#include "string_ex.h" -#include "app_mgr_constants.h" -#include "ihidden_start_observer.h" - -namespace OHOS { -namespace AAFwk { -class HiddenStartObserverStub : public IRemoteStub { -public: - HiddenStartObserverStub() = default; - virtual ~HiddenStartObserverStub() = default; - - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleIsHiddenStart(MessageParcel &data, MessageParcel &reply); - - DISALLOW_COPY_AND_MOVE(HiddenStartObserverStub); -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_HIDDEN_START_OBSERVER_STUB_H \ No newline at end of file +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +sequenceable OHOS.AppExecFwk.AbilityFirstFrameStateData; +interface OHOS.AppExecFwk.IAbilityFirstFrameStateObserver { + boolean IsHiddenStart([in] int pid); + void OnAbilityFirstFrameState([in] AbilityFirstFrameStateData abilityFirstFrameStateData); +} \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/IAbilityManager.idl b/interfaces/inner_api/ability_manager/IAbilityManager.idl new file mode 100644 index 0000000000000000000000000000000000000000..a41043420f228b974713dd40c22d0467f4b96013 --- /dev/null +++ b/interfaces/inner_api/ability_manager/IAbilityManager.idl @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +sequenceable OHOS.AAFwk.AbilityRunningInfo; +sequenceable OHOS.AAFwk.AbilityStartSetting; +sequenceable OHOS.AbilityRuntime.AutoStartupInfo; +sequenceable OHOS.AAFwk.DialogSessionInfo; +sequenceable OHOS.AppExecFwk.ElementName; +sequenceable OHOS.AAFwk.ExitReason; +sequenceable OHOS.AAFwk.ExtensionRunningInfo; +interface OHOS.AAFwk.ISnapshotHandler; +sequenceable OHOS.AAFwk.MissionInfo; +sequenceable OHOS.AAFwk.MissionSnapshot; +sequenceable mission_info..OHOS.AAFwk.MissionValidResult; +sequenceable OHOS.AAFwk.PacMap; +sequenceable OHOS.AppExecFwk.RunningProcessInfo; +sequenceable OHOS.AAFwk.SenderInfo; +sequenceable OHOS.AAFwk.StartOptions; +sequenceable OHOS.AAFwk.Want; +sequenceable OHOS.AAFwk.WantParams; +sequenceable OHOS.AAFwk.WantSenderInfo; +sequenceable OHOS.AbilityRuntime.AutoStartupInfo; +sequenceable OHOS.AbilityRuntime.KeepAliveInfo; +sequenceable OHOS.AbilityRuntime.UIExtensionAbilityConnectInfo; +sequenceable OHOS.AbilityRuntime.UIExtensionHostInfo; +sequenceable OHOS.AbilityRuntime.UIExtensionSessionInfo; +sequenceable OHOS.AbilityRuntime.AtomicServiceStartupRule; +sequenceable window_manager_service_handler..OHOS.Media.PixelMap; +interface OHOS.AAFwk.IWindowManagerServiceHandler; + +sequenceable OHOS.AppExecFwk.AbilityStateData; +sequenceable InsightIntent.InsightIntentExecuteResult..OHOS.AppExecFwk.InsightIntentExecuteResult; +sequenceable InsightIntent.InsightIntentExecuteParam..OHOS.AppExecFwk.InsightIntentExecuteParam; + +sequenceable OHOS.AppExecFwk.IntentExemptionInfo; +sequenceable OHOS.IRemoteObject; +sequenceable OHOS.AAFwk.SessionInfo; +sequenceable OHOS.AAFwk.ContinueMissionInfo; + +sequenceable OHOS.Uri; +sequenceable OHOS.AAFwk.WindowConfig; +interface OHOS.AAFwk.IAbilityConnection; +interface OHOS.AppExecFwk.IAbilityController; +interface OHOS.AAFwk.IAbilityManagerCollaborator; +interface OHOS.AAFwk.IAbilityScheduler; +interface OHOS.AAFwk.IMissionListener; +interface OHOS.AAFwk.IAcquireShareDataCallback; +interface OHOS.AAFwk.IHiddenStartObserver; +interface OHOS.AAFwk.IPrepareTerminateCallback; +interface OHOS.AbilityRuntime.IQueryERMSObserver; +interface OHOS.AAFwk.IRemoteMissionListener; +interface OHOS.AAFwk.IRemoteOnListener; +interface status_bar_delegate..OHOS.AbilityRuntime.IStatusBarDelegate; +interface OHOS.AAFwk.IWantReceiver; +interface OHOS.AAFwk.IWantSender; +interface OHOS.AbilityRuntime.IFreeInstallObserver; +interface OHOS.AppExecFwk.IAppDebugListener; +interface OHOS.AppExecFwk.IUserCallback; +interface OHOS.AppExecFwk.IAbilityFirstFrameStateObserver; + +import ability_state; +import mission_info; +import UIExtensionWindowCommand; + +interface OHOS.AAFwk.IAbilityManager{ + void StartSelfUIAbility([in] Want want); + void StartSelfUIAbilityWithStartOptions([in] Want want, [in] StartOptions options); + void StartAbility([in] Want want, [in] int userId, [in] int requestCode); + void StartAbility([in] Want want, [in] IRemoteObject callerToken, [in] int userId, [in] int requestCode); + void StartAbilityWithSpecifyTokenId([in] Want want, [in] IRemoteObject callerToken, [in] unsigned int specifyTokenId, + [in] int userId, [in] int requestCode); + void StartAbilityByInsightIntent([in] Want want, [in] IRemoteObject callerToken, [in] unsigned long intentId, + [in] int userId); + void StartAbility([in] Want want, [in] AbilityStartSetting abilityStartSetting, [in] IRemoteObject callerToken, + [in] int userId, [in] int requestCode); + void StartAbility([in] Want want, [in] StartOptions startOptions, [in] IRemoteObject callerToken, [in] int userId, + [in] int requestCode); + void StartAbilityAsCaller([in] Want want, [in] IRemoteObject callerToken, [in] IRemoteObject asCallerSourceToken, + [in] int userId, [in] int requestCode); + void StartAbilityAsCaller([in] Want want, [in] StartOptions startOptions, [in] IRemoteObject callerToken, + [in] IRemoteObject asCallerSourceToken, [in] int userId, [in] int requestCode); + void StartAbilityByUIContentSession([in] Want want, [in] IRemoteObject callerToken, + [in] sptr sessionInfo, [in] int userId, [in] int requestCode); + void StartAbilityOnlyUIAbility([in] Want want, [in] IRemoteObject callerToken, [in] unsigned int specifyTokenId); + void StartExtensionAbility([in] Want want, [in] IRemoteObject callerToken, [in] int userId, + [in] int extensionType); + void RequestModalUIExtension([in] Want want); + void PreloadUIExtensionAbility([in] Want want, [in] String hostBundleName, [in] int userId, [in] int hostPid); + void ChangeAbilityVisibility([in] IRemoteObject token, [in] boolean isShow); + void ChangeUIAbilityVisibilityBySCB([in] sptr sessionInfo, [in] boolean isShow); + void StartUIExtensionAbility([in] sptr extensionSessionInfo, [in] int userId); + void StopExtensionAbility([in] Want want, [in] IRemoteObject callerToken, [in] int userId, + [in] int extensionType + ); + boolean IsRamConstrainedDevice(); + void GetAppMemorySize(); + ElementName GetTopAbility([in] boolean isNeedLocalDeviceId); + ElementName GetElementNameByToken([in] IRemoteObject token, [in] boolean isNeedLocalDeviceId); + void TerminateAbility([in] IRemoteObject token, [in] int resultCode, [in] sharedptr resultWant); + + void BackToCallerAbilityWithResult([in] IRemoteObject token, [in] int resultCode, + [in] sharedptr resultWant, [in] long callerRequestCode); + void TerminateUIServiceExtensionAbility([in] IRemoteObject token); + void TerminateUIExtensionAbility([in] sptr extensionSessionInfo, + [in] int resultCode, [in] sharedptr resultWant); + void CloseUIExtensionAbilityBySCB([in] IRemoteObject token); + void CloseUIAbilityBySCB([in] sptr sessionInfo, [in] boolean isUserRequestedExit, + [in] unsigned int sceneFlag); + void SendResultToAbility([in] int requestCode, [in] int resultCode, [in] Want resultWant); + void MoveAbilityToBackground([in] IRemoteObject token); + void MoveUIAbilityToBackground([in] IRemoteObject token); + void MinimizeAbility([in] IRemoteObject token, [in] boolean fromUser); + void MinimizeUIExtensionAbility([in] sptr extensionSessionInfo, + [in] boolean fromUser); + void MinimizeUIAbilityBySCB([in] sptr sessionInfo, [in] boolean fromUser, [in] unsigned int sceneFlag); + void ConnectAbility([in] Want want, [in] IAbilityConnection connect, [in] IRemoteObject callerToken, + [in] int userId); + void ConnectAbilityCommon([in] Want want, [in] IAbilityConnection connect, [in] IRemoteObject callerToken, + [in] int extensionType, [in] int userId, [in] boolean isQueryExtensionOnly); + void ConnectUIExtensionAbility([in] Want want, [in] IAbilityConnection connect, [in] sptr sessionInfo, + [in] int userId, [in] sptr connectInfo); + void DisconnectAbility([in] IAbilityConnection connect); + void ReleaseDataAbility([in] IAbilityScheduler dataAbilityScheduler, [in] IRemoteObject callerToken); + void AttachAbilityThread([in] IAbilityScheduler scheduler, [in] IRemoteObject token); + void AbilityTransitionDone([in] IRemoteObject token, [in] int state, [in] PacMap saveData); + [oneway] void AbilityWindowConfigTransitionDone([in] IRemoteObject token, [in] WindowConfig windowConfig); + void ScheduleConnectAbilityDone([in] IRemoteObject token, [in] IRemoteObject remoteObject); + void ScheduleDisconnectAbilityDone([in] IRemoteObject token); + void ScheduleCommandAbilityDone([in] IRemoteObject token); + void ScheduleCommandAbilityWindowDone([in] IRemoteObject token, [in] sptr sessionInfo, + [in] WindowCommand winCmd, [in] AbilityCommand abilityCmd); + void DumpState([in] String args, [out] String[] state); + void DumpSysState([in] String args, [out] String[] state, [in] boolean isClient, [in] boolean isUserID, + [in] int UserID); + void StopServiceAbility([in] Want want, [in] int userId, [in] IRemoteObject token); + void KillProcess([in] String bundleName, [in] boolean clearPageStack, [in] int appIndex); + [macrodef ABILITY_COMMAND_FOR_TEST]int ForceTimeoutForTest([in] String abilityName, [in] String state); + [macrodef SUPPORT_SCREEN]void SetMissionLabel([in] IRemoteObject abilityToken, [in] String label); + [macrodef SUPPORT_SCREEN]void RegisterWindowManagerServiceHandler([in] IWindowManagerServiceHandler handler, + [in] boolean animationEnabled); + [macrodef SUPPORT_SCREEN]void CompleteFirstFrameDrawing([in] IRemoteObject abilityToken); + [macrodef SUPPORT_SCREEN]void CompleteFirstFrameDrawing([in] int sessionId); + [macrodef SUPPORT_SCREEN]void PrepareTerminateAbility([in] IRemoteObject token, [in] IPrepareTerminateCallback callBack); + [macrodef SUPPORT_SCREEN]void GetDialogSessionInfo([in] String dialogSessionId, + [out] sptr dialogSessionInfo); + [macrodef SUPPORT_SCREEN]void SendDialogResult([in] Want want, [in] String dialogSessionId, [in] boolean isAllow); + [macrodef SUPPORT_SCREEN]void SetMissionIcon([in] IRemoteObject token, [in] sharedptr icon); + [macrodef SUPPORT_SCREEN]void UpdateMissionSnapShot([in] IRemoteObject token, [in] sharedptr pixelMap); + void UninstallApp([in] String bundleName, [in] int uid); + void UninstallApp([in] String bundleName, [in] int uid, [in] int appIndex); + void UpgradeApp([in] String bundleName, [in] int uid, [in] String exitMsg, [in] int appIndex); + IWantSender GetWantSender([in] WantSenderInfo wantSenderInfo, [in] IRemoteObject callerToken, [in] int uid); + void SendWantSender([in] IWantSender target, [in] SenderInfo senderInfo); + void CancelWantSender([in] IWantSender sender); + void GetPendingWantUid([in] IWantSender target); + void GetPendingWantUserId([in] IWantSender target); + String GetPendingWantBundleName([in] IWantSender target); + void GetPendingWantCode([in] IWantSender target); + void GetPendingWantType([in] IWantSender target); + void RegisterCancelListener([in] IWantSender sender, [in] IWantReceiver receiver); + void UnregisterCancelListener([in] IWantSender sender, [in] IWantReceiver receiver); + void GetPendingRequestWant([in] IWantSender target, [out] sharedptr want); + void GetWantSenderInfo([in] IWantSender target, [out] sharedptr info); + void ContinueMission([in] String srcDeviceId, [in] String dstDeviceId, [in] int missionId, + [in] IRemoteObject callBack, [in] WantParams wantParams); + void ContinueMission([in] ContinueMissionInfo continueMissionInfo, [in] IRemoteObject callBack); + void ContinueAbility([in] String deviceId, [in] int missionId, [in] unsigned int versionCode); + void StartContinuation([in] Want want, [in] IRemoteObject abilityToken, [in] int status); + void NotifyCompleteContinuation([in] String deviceId, [in] int sessionId, [in] boolean isSuccess); + void NotifyContinuationResult([in] int missionId, [in] int notifyResult); + void LockMissionForCleanup([in] int missionId); + void UnlockMissionForCleanup([in] int missionId); + [oneway]void SetLockedState([in] int sessionId, [in] boolean lockedState); + void RegisterMissionListener([in] IMissionListener listener); + void UnRegisterMissionListener([in] IMissionListener listener); + void GetMissionInfos([in] String deviceId, [in] int numMax, [out] MissionInfo[] missionInfos); + void GetMissionInfo([in] String deviceId, [in] int missionId, [out] MissionInfo missionInfo); + //void GetRecentMissions([in] String deviceId, [in] int numMax, [out] MissionInfo[] recentMissions); + void GetMissionSnapshot([in] String deviceId, [in] int missionId, [out] MissionSnapshot snapshot, + [in] boolean isLowResolution); + void CleanMission([in] int missionId); + void CleanAllMissions(); + void MoveMissionToFront([in] int missionId); + void MoveMissionToFront([in] int missionId, [in] StartOptions startOptions); + void MoveMissionsToForeground([in] int[] missionIds, [in] int topMissionId); + void MoveMissionsToBackground([in] int[] missionIds, [out] int[] moveMissionsResult); + void RegisterSessionHandler([in] IRemoteObject object); + void StartAbilityByCall([in] Want want, [in] IAbilityConnection connect, [in] IRemoteObject callerToken, + [in] int accountId); + void StartAbilityByCallWithErrMsg([in] Want want, [in] IAbilityConnection connect, + [in] IRemoteObject callerToken, [in] int accountId, [out] String errMsg); + void CallRequestDone([in] IRemoteObject token, [in] IRemoteObject callStub); + void ReleaseCall([in] IAbilityConnection connect, [in] ElementName element); + void StartUser([in] int userId, [in] IUserCallback callBack, [in] boolean isAppRecovery); + void StopUser([in] int userId, [in] IUserCallback callBack); + void LogoutUser([in] int userId, [in] IUserCallback callBack); + void SetMissionContinueState([in] IRemoteObject token, [in] ContinueState state); + + [macrodef SUPPORT_SCREEN]void RegisterAbilityFirstFrameStateObserver([in] IAbilityFirstFrameStateObserver observer, + [in] String targetBundleName); + [macrodef SUPPORT_SCREEN]void UnregisterAbilityFirstFrameStateObserver([in] IAbilityFirstFrameStateObserver observer); + + void GetAbilityRunningInfos([out] AbilityRunningInfo[] info); + void GetExtensionRunningInfos([in] int upperLimit, [out] ExtensionRunningInfo[] info); + void GetProcessRunningInfos([out] RunningProcessInfo[] info); + void StartSyncRemoteMissions([in] String devId, [in] boolean fixConflict, [in] long tag); + void StopSyncRemoteMissions([in] String devId); + void RegisterMissionListener([in] String deviceId, [in] IRemoteMissionListener listener); + void RegisterOnListener([in] String type, [in] IRemoteOnListener listener); + void RegisterOffListener([in] String type, [in] IRemoteOnListener listener); + void UnRegisterMissionListener([in] String deviceId, [in] IRemoteMissionListener listener); + void SetAbilityController([in] IAbilityController abilityController, [in] boolean imAStabilityTest); + boolean IsRunningInStabilityTest(); + void RegisterSnapshotHandler([in] ISnapshotHandler handler); + void StartUserTest([in] Want want, [in] IRemoteObject observer); + void FinishUserTest([in] String msg, [in] long resultCode, [in] String bundleName); + void GetTopAbility([out] IRemoteObject token); + void CheckUIExtensionIsFocused([in] unsigned int uiExtensionTokenId, [out] boolean isFocused); + void DelegatorDoAbilityForeground([in] IRemoteObject token); + void DelegatorDoAbilityBackground([in] IRemoteObject token); + void DoAbilityForeground([in] IRemoteObject token, [in] unsigned int flag); + void DoAbilityBackground([in] IRemoteObject token, [in] unsigned int flag); + void GetMissionIdByToken([in] IRemoteObject token); + void GetAbilityTokenByCalleeObj([in] IRemoteObject callStub, [out] IRemoteObject token); + void DumpAbilityInfoDone([in] String[] infos, [in] IRemoteObject callerToken); + void FreeInstallAbilityFromRemote([in] Want want, [in] IRemoteObject callBack, [in] int userId, [in] int requestCode); + void AddFreeInstallObserver([in] IRemoteObject callerToken, [in] IFreeInstallObserver observer); + void EnableRecoverAbility([in] IRemoteObject token); + void SubmitSaveRecoveryInfo([in] IRemoteObject token); + void ScheduleRecoverAbility([in] IRemoteObject token, [in] int reason, [in] sharedptr want); + void ScheduleClearRecoveryPageStack(); + void IsValidMissionIds([in] int[] missionIds, [out] MissionValidResult[] missionResults); + void VerifyPermission([in] String permission, [in] int pid, [in] int uid); + void RequestDialogService([in] Want want, [in] IRemoteObject callerToken); + void ReportDrawnCompleted([in] IRemoteObject callerToken); + void AcquireShareData([in] int missionId, [in] IAcquireShareDataCallback shareData); + void ShareDataDone([in] IRemoteObject token, [in] int resultCode, [in] int uniqueId, [in] WantParams wantParam); + void ForceExitApp([in] int pid, [in] ExitReason exitReason); + void RecordAppExitReason([in] ExitReason exitReason); + void RecordProcessExitReason([in] int pid, [in] ExitReason exitReason); + void RecordProcessExitReason([in] int pid, [in] int uid, [in] ExitReason exitReason); + [oneway]void SetRootSceneSession([in] IRemoteObject rootSceneSession); + void CallUIAbilityBySCB([in] sptr sessionInfo, [out] boolean isColdStart); + [oneway]void StartSpecifiedAbilityBySCB([in] Want want); + void NotifySaveAsResult([in] Want want, [in] int resultCode, [in] int requestCode); + void SetSessionManagerService([in] IRemoteObject sessionManagerService); + void RegisterIAbilityManagerCollaborator([in] int type, [in] IAbilityManagerCollaborator impl); + void UnregisterIAbilityManagerCollaborator([in] int type); + void RegisterStatusBarDelegate([in] IStatusBarDelegate delegate); + void KillProcessWithPrepareTerminate([in] int[] pids); + void KillProcessWithReason([in] int pid, [in] ExitReason reason); + void RegisterAutoStartupSystemCallback([in] IRemoteObject callBack); + void UnregisterAutoStartupSystemCallback([in] IRemoteObject callBack); + void SetApplicationAutoStartup([in] AutoStartupInfo info); + void CancelApplicationAutoStartup([in] AutoStartupInfo info); + void QueryAllAutoStartupApplications([out] AutoStartupInfo[] infoList); + void PrepareTerminateAbilityBySCB([in] sptr sessionInfo, [out] boolean isPrepareTerminate); + void RegisterAppDebugListener([in] IAppDebugListener listener); + void UnregisterAppDebugListener([in] IAppDebugListener listener); + void AttachAppDebug([in] String bundleName, [in] boolean isDebugFromLocal); + void DetachAppDebug([in] String bundleName, [in] boolean isDebugFromLocal); + void ExecuteIntent([in] unsigned long key, [in] IRemoteObject callerToken, [in] InsightIntentExecuteParam param); + void IsAbilityControllerStart([in] Want want); + void ExecuteInsightIntentDone([in] IRemoteObject token, [in] unsigned long intentId, [in] InsightIntentExecuteResult insightResult); + void SetApplicationAutoStartupByEDM([in] AutoStartupInfo info, [in] boolean flag); + void CancelApplicationAutoStartupByEDM([in] AutoStartupInfo info, [in] boolean flag); + void GetForegroundUIAbilities([out] AbilityStateData[] list); + void OpenFile([in] Uri uri, [in] unsigned int flag); + void UpdateSessionInfoBySCB([in] List sessionInfos, [in] int userId, [in] int[] sessionIds); + void RestartApp([in] Want want, [in] boolean isAppRecovery); + void GetUIExtensionRootHostInfo([in] IRemoteObject token, [out] UIExtensionHostInfo hostInfo, [in] int userId); + void GetUIExtensionSessionInfo([in] IRemoteObject token, [out] UIExtensionSessionInfo uiExtensionSessionInfo, + [in] int userId); + void OpenLink([in] Want want, [in] IRemoteObject callerToken, [in] int userId, [in] int requestCode); + void OpenAtomicService([in] Want want, [in] StartOptions options, [in] IRemoteObject callerToken, + [in] int requestCode, [in] int userId); + void SetResidentProcessEnabled([in] String bundleName, [in] boolean enable); + boolean IsEmbeddedOpenAllowed([in] IRemoteObject callerToken, [in] String appId); + void RequestAssertFaultDialog([in] IRemoteObject callBack, [in] WantParams wantParams); + void NotifyDebugAssertResult([in] unsigned long assertFaultSessionId, [in] UserStatus userStatus); + void StartShortcut([in] Want want, [in] StartOptions startOptions); + void GetAbilityStateByPersistentId([in] int persistentId, [out] boolean state); + void TransferAbilityResultForExtension([in] IRemoteObject callerToken, [in] int resultCode, [in] Want want); + [oneway]void NotifyFrozenProcessByRSS([in] int[] pidList, [in] int uid); + void CleanUIAbilityBySCB([in] sptr sessionInfo, [in] boolean isUserRequestedExit, [in] unsigned int sceneFlag); + void PreStartMission([in] String bundleName, [in] String moduleName, [in] String abilityName, [in] String startTime); + void TerminateMission([in] int missionId); + void BlockAllAppStart([in] boolean flag); + void UpdateAssociateConfigList([in] Map configs, [in] String[] exportConfigs, [in] int flag); + void SetApplicationKeepAlive([in] String bundleName, [in] int userId, [in] boolean flag); + void SetApplicationKeepAliveByEDM([in] String bundleName, [in] int userId, [in] boolean flag); + void QueryKeepAliveApplications([in] int appType, [in] int userId, [out] KeepAliveInfo[] list); + void GetAllIntentExemptionInfo([out] IntentExemptionInfo[] info); + void AddQueryERMSObserver([in] IRemoteObject callerToken, [in] IQueryERMSObserver observer); + void PrepareTerminateAbilityDone([in] IRemoteObject token, [in] boolean isTerminate); + void KillProcessWithPrepareTerminateDone([in] String moduleName, [in] int prepareTermination, + [in] boolean isExist); + void KillProcessForPermissionUpdate([in] unsigned int accessTokenId); + void RegisterHiddenStartObserver([in] IHiddenStartObserver observer); + void UnregisterHiddenStartObserver([in] IHiddenStartObserver observer); + void QueryPreLoadUIExtensionRecord([in] ElementName element, [in] String moduleName, + [in] String hostBundleName, [out] int recordNum, [in] int userId); + void RevokeDelegator([in] IRemoteObject token); + + void QueryAtomicServiceStartupRule([in] IRemoteObject callerToken, + [in] String appId, + [in] String startTime, + [out] AtomicServiceStartupRule rule); + + void StartAbilityForResultAsCaller([in] Want want, [in] IRemoteObject callerToken,[in] int requestCode, + [in] int userId); + + void StartAbilityForResultAsCaller( + [in] Want want, + [in] StartOptions startOptions, + [in] IRemoteObject callerToken, + [in] int requestCode, + [in] int userId); + + void StartAbilityByUIContentSession( + [in] Want want, + [in] StartOptions options, + [in] IRemoteObject callerToken, + [in] sptr sessionInfo, + [in] int userId, + [in] int requestCode); + + void StartUIAbilityBySCB( + [in] sptr sessionInfo, + [out] boolean isColdStart, + [in] unsigned int sceneFlag); + + void CloseAbility( + [in] IRemoteObject token, + [in] int resultCode, + [in] sharedptr resultWant); + + IAbilityScheduler AcquireDataAbility( + [in] Uri uri, + [in] boolean tryBind, + [in] IRemoteObject callerToken); + + void QueryKeepAliveApplicationsByEDM( + [in] int appType, + [in] int userId, + [out] List list); + + +} \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/IAbilityManagerWithSupportScreen.idl b/interfaces/inner_api/ability_manager/IAbilityManagerWithSupportScreen.idl new file mode 100644 index 0000000000000000000000000000000000000000..eaffc2b5eb9b9b261def8518706fbedfc3e04068 --- /dev/null +++ b/interfaces/inner_api/ability_manager/IAbilityManagerWithSupportScreen.idl @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +sequenceable OHOS.AAFwk.AbilityRunningInfo; +sequenceable OHOS.AAFwk.AbilityStartSetting; +sequenceable OHOS.AbilityRuntime.AutoStartupInfo; +sequenceable OHOS.AAFwk.DialogSessionInfo; +sequenceable OHOS.AppExecFwk.ElementName; +sequenceable OHOS.AAFwk.ExitReason; +sequenceable OHOS.AAFwk.ExtensionRunningInfo; +interface OHOS.AAFwk.ISnapshotHandler; +sequenceable OHOS.AAFwk.MissionInfo; +sequenceable OHOS.AAFwk.MissionSnapshot; +sequenceable mission_info..OHOS.AAFwk.MissionValidResult; +sequenceable OHOS.AAFwk.PacMap; +sequenceable OHOS.AppExecFwk.RunningProcessInfo; +sequenceable OHOS.AAFwk.SenderInfo; +sequenceable OHOS.AAFwk.StartOptions; +sequenceable OHOS.AAFwk.Want; +sequenceable OHOS.AAFwk.WantParams; +sequenceable OHOS.AAFwk.WantSenderInfo; +sequenceable OHOS.AbilityRuntime.AutoStartupInfo; +sequenceable OHOS.AbilityRuntime.KeepAliveInfo; +sequenceable OHOS.AbilityRuntime.UIExtensionAbilityConnectInfo; +sequenceable OHOS.AbilityRuntime.UIExtensionHostInfo; +sequenceable OHOS.AbilityRuntime.UIExtensionSessionInfo; +sequenceable OHOS.AppExecFwk.AbilityStateData; +sequenceable OHOS.AppExecFwk.InsightIntentExecuteParam; +sequenceable OHOS.AppExecFwk.InsightIntentExecuteResult; +sequenceable OHOS.AppExecFwk.IntentExemptionInfo; +sequenceable OHOS.IRemoteObject; +sequenceable OHOS.AAFwk.SessionInfo; +sequenceable OHOS.Uri; +sequenceable OHOS.AAFwk.WindowConfig; +sequenceable OHOS.AbilityRuntime.AtomicServiceStartupRule; +sequenceable OHOS.AAFwk.ContinueMissionInfo; +sequenceable window_manager_service_handler..OHOS.Media.PixelMap; + + + +interface OHOS.AAFwk.IAbilityConnection; +interface OHOS.AppExecFwk.IAbilityController; +interface OHOS.AAFwk.IAbilityManagerCollaborator; +interface OHOS.AAFwk.IAbilityScheduler; +interface OHOS.AAFwk.IMissionListener; +interface OHOS.AAFwk.IAcquireShareDataCallback; +interface OHOS.AAFwk.IHiddenStartObserver; +interface OHOS.AAFwk.IPrepareTerminateCallback; +interface OHOS.AbilityRuntime.IQueryERMSObserver; +interface OHOS.AAFwk.IRemoteMissionListener; +interface OHOS.AAFwk.IRemoteOnListener; +interface status_bar_delegate..OHOS.AbilityRuntime.IStatusBarDelegate; +interface OHOS.AAFwk.IWantReceiver; +interface OHOS.AAFwk.IWantSender; +interface OHOS.AAFwk.IWindowManagerServiceHandler; +interface OHOS.AbilityRuntime.IFreeInstallObserver; +interface OHOS.AppExecFwk.IAppDebugListener; +interface OHOS.AppExecFwk.IUserCallback; + +import ability_state; +import ExtensionAbilityType; +import mission_info; +import UIExtensionWindowCommand; + +interface OHOS.AAFwk.IAbilityManagerWithSupportScreen{ + void StartSelfUIAbility([in] Want want); + void StartSelfUIAbilityWithStartOptions([in] Want want, [in] StartOptions options); + void StartAbility([in] Want want, [in] int userId, [in] int requestCode); + void StartAbility([in] Want want, [in] IRemoteObject callerToken, [in] int userId, [in] int requestCode); + void StartAbilityWithSpecifyTokenId([in] Want want, [in] IRemoteObject callerToken, [in] unsigned int specifyTokenId, + [in] int userId, [in] int requestCode); + void StartAbilityByInsightIntent([in] Want want, [in] IRemoteObject callerToken, [in] unsigned long intentId, + [in] int userId); + void StartAbility([in] Want want, [in] AbilityStartSetting abilityStartSetting, [in] IRemoteObject callerToken, + [in] int userId, [in] int requestCode); + void StartAbility([in] Want want, [in] StartOptions startOptions, [in] IRemoteObject callerToken, [in] int userId, + [in] int requestCode); + void StartAbilityAsCaller([in] Want want, [in] IRemoteObject callerToken, [in] IRemoteObject asCallerSourceToken, + [in] int userId, [in] int requestCode); + void StartAbilityAsCaller([in] Want want, [in] StartOptions startOptions, [in] IRemoteObject callerToken, + [in] IRemoteObject asCallerSourceToken, [in] int userId, [in] int requestCode); + void StartAbilityByUIContentSession([in] Want want, [in] IRemoteObject callerToken, + [in] sptr sessionInfo, [in] int userId, [in] int requestCode); + void StartAbilityOnlyUIAbility([in] Want want, [in] IRemoteObject callerToken, [in] unsigned long specifyTokenId); + void StartExtensionAbility([in] Want want, [in] IRemoteObject callerToken, [in] int userId, + [in] ExtensionAbilityType extensionType); + void RequestModalUIExtension([in] Want want); + void PreloadUIExtensionAbility([in] Want want, [in] String hostBundleName, [in] int userId, [in] int hostPid); + void ChangeAbilityVisibility([in] IRemoteObject token, [in] boolean isShow); + void ChangeUIAbilityVisibilityBySCB([in] sptr sessionInfo, [in] boolean isShow); + void StartUIExtensionAbility([in] sptr extensionSessionInfo, [in] int userId); + void StopExtensionAbility([in] Want want, [in] IRemoteObject callerToken, [in] int userId, + [in] ExtensionAbilityType extensionType + ); + boolean IsRamConstrainedDevice(); + void GetAppMemorySize(); + ElementName GetTopAbility([in] boolean isNeedLocalDeviceId); + ElementName GetElementNameByToken([in] IRemoteObject token, [in] boolean isNeedLocalDeviceId); + void TerminateAbility([in] IRemoteObject token, [in] int resultCode, [in] Want resultWant); + + void BackToCallerAbilityWithResult([in] IRemoteObject token, [in] int resultCode, + [in] Want resultWant, [in] long callerRequestCode); + void TerminateUIServiceExtensionAbility([in] IRemoteObject token); + void TerminateUIExtensionAbility([in] sptr extensionSessionInfo, + [in] int resultCode, [in] Want resultWant); + void CloseUIExtensionAbilityBySCB([in] IRemoteObject token); + void CloseUIAbilityBySCB([in] sptr sessionInfo, [in] boolean isUserRequestedExit, + [in] unsigned int sceneFlag); + void SendResultToAbility([in] int requestCode, [in] int resultCode, [in] Want resultWant); + void MoveAbilityToBackground([in] IRemoteObject token); + void MoveUIAbilityToBackground([in] IRemoteObject token); + void MinimizeAbility([in] IRemoteObject token, [in] boolean fromUser); + void MinimizeUIExtensionAbility([in] sptr extensionSessionInfo, + [in] boolean fromUser); + void MinimizeUIAbilityBySCB([in] sptr sessionInfo, [in] boolean fromUser, [in] unsigned int sceneFlag); + void ConnectAbility([in] Want want, [in] IAbilityConnection connect, [in] IRemoteObject callerToken, + [in] int userId); + void ConnectAbilityCommon([in] Want want, [in] IAbilityConnection connect, [in] IRemoteObject callerToken, + [in] ExtensionAbilityType extensionType, [in] int userId, [in] boolean isQueryExtensionOnly); + void ConnectUIExtensionAbility([in] Want want, [in] IAbilityConnection connect, [in] sptr sessionInfo, + [in] int userId, [in] sptr connectInfo); + void DisconnectAbility([in] IAbilityConnection connect); + void ReleaseDataAbility([in] IAbilityScheduler dataAbilityScheduler, [in] IRemoteObject callerToken); + void AttachAbilityThread([in] IAbilityScheduler scheduler, [in] IRemoteObject token); + void AbilityTransitionDone([in] IRemoteObject token, [in] int state, [in] PacMap saveData); + [oneway] void AbilityWindowConfigTransitionDone([in] IRemoteObject token, [in] WindowConfig windowConfig); + void ScheduleConnectAbilityDone([in] IRemoteObject token, [in] IRemoteObject remoteObject); + void ScheduleDisconnectAbilityDone([in] IRemoteObject token); + void ScheduleCommandAbilityDone([in] IRemoteObject token); + void ScheduleCommandAbilityWindowDone([in] IRemoteObject token, [in] sptr sessionInfo, + [in] WindowCommand winCmd, [in] AbilityCommand abilityCmd); + void DumpState([in] String args, [out] String[] state); + void DumpSysState([in] String args, [out] String[] state, [in] boolean isClient, [in] boolean isUserID, + [in] int UserID); + void StopServiceAbility([in] Want want, [in] int userId, [in] IRemoteObject token); + void KillProcess([in] String bundleName, [in] boolean clearPageStack, [in] int appIndex); + [macrodef ABILITY_COMMAND_FOR_TEST]int ForceTimeoutForTest([in] String abilityName, [in] String state); + + void UninstallApp([in] String bundleName, [in] int uid); + void UninstallApp([in] String bundleName, [in] int uid, [in] int appIndex); + void UpgradeApp([in] String bundleName, [in] int uid, [in] String exitMsg, [in] int appIndex); + IWantSender GetWantSender([in] WantSenderInfo wantSenderInfo, [in] IRemoteObject callerToken, [in] int uid); + void SendWantSender([in] IWantSender target, [in] SenderInfo senderInfo); + void CancelWantSender([in] IWantSender sender); + void GetPendingWantUid([in] IWantSender target); + void GetPendingWantUserId([in] IWantSender target); + String GetPendingWantBundleName([in] IWantSender target); + void GetPendingWantCode([in] IWantSender target); + void GetPendingWantType([in] IWantSender target); + void RegisterCancelListener([in] IWantSender sender, [in] IWantReceiver receiver); + void UnregisterCancelListener([in] IWantSender sender, [in] IWantReceiver receiver); + void GetPendingRequestWant([in] IWantSender target, [out] sharedptr want); + void GetWantSenderInfo([in] IWantSender target, [out] sharedptr info); + void ContinueMission([in] String srcDeviceId, [in] String dstDeviceId, [in] int missionId, + [in] IRemoteObject callBack, [in] WantParams wantParams); + void ContinueMission([in] ContinueMissionInfo continueMissionInfo, [in] IRemoteObject callBack); + void ContinueAbility([in] String deviceId, [in] int missionId, [in] unsigned int versionCode); + void StartContinuation([in] Want want, [in] IRemoteObject abilityToken, [in] int status); + void NotifyCompleteContinuation([in] String deviceId, [in] int sessionId, [in] boolean isSuccess); + void NotifyContinuationResult([in] int missionId, [in] int notifyResult); + void LockMissionForCleanup([in] int missionId); + void UnlockMissionForCleanup([in] int missionId); + [oneway]void SetLockedState([in] int sessionId, [in] boolean lockedState); + void RegisterMissionListener([in] IMissionListener listener); + void UnRegisterMissionListener([in] IMissionListener listener); + void GetMissionInfos([in] String deviceId, [in] int numMax, [out] MissionInfo[] missionInfos); + void GetMissionInfo([in] String deviceId, [in] int missionId, [out] MissionInfo missionInfo); + void GetRecentMissions([in] String deviceId, [in] int numMax, [out] MissionInfo[] recentMissions); + void GetMissionSnapshot([in] String deviceId, [in] int missionId, [out] MissionSnapshot snapshot, + [in] boolean isLowResolution); + void CleanMission([in] int missionId); + void CleanAllMissions(); + void MoveMissionToFront([in] int missionId); + void MoveMissionToFront([in] int missionId, [in] StartOptions startOptions); + void MoveMissionsToForeground([in] int[] missionIds, [in] int topMissionId); + void MoveMissionsToBackground([in] int[] missionIds, [out] int[] moveMissionsResult); + void RegisterSessionHandler([in] IRemoteObject object); + void StartAbilityByCall([in] Want want, [in] IAbilityConnection connect, [in] IRemoteObject callerToken, + [in] int accountId); + void StartAbilityByCallWithErrMsg([in] Want want, [in] IAbilityConnection connect, + [in] IRemoteObject callerToken, [in] int accountId, [out] String errMsg); + void CallRequestDone([in] IRemoteObject token, [in] IRemoteObject callStub); + void ReleaseCall([in] IAbilityConnection connect, [in] ElementName element); + void StartUser([in] int userId, [in] IUserCallback callBack, [in] boolean isAppRecovery); + void StopUser([in] int userId, [in] IUserCallback callBack); + void LogoutUser([in] int userId, [in] IUserCallback callBack); + void SetMissionContinueState([in] IRemoteObject token, [in] ContinueState state); + [macrodef SUPPORT_SCREEN]void SetMissionLabel([in] IRemoteObject abilityToken, [in] String label); + [macrodef SUPPORT_SCREEN]void RegisterWindowManagerServiceHandler([in] IWindowManagerServiceHandler handler, + [in] boolean animationEnabled); + [macrodef SUPPORT_SCREEN]void CompleteFirstFrameDrawing([in] IRemoteObject abilityToken); + [macrodef SUPPORT_SCREEN]void CompleteFirstFrameDrawing([in] int sessionId); + [macrodef SUPPORT_SCREEN]void PrepareTerminateAbility([in] IRemoteObject token, [in] IPrepareTerminateCallback callBack); + [macrodef SUPPORT_SCREEN]void GetDialogSessionInfo([in] String dialogSessionId, + [out] sptr dialogSessionInfo); + [macrodef SUPPORT_SCREEN]void SendDialogResult([in] Want want, [in] String dialogSessionId, [in] boolean isAllow); + [macrodef SUPPORT_SCREEN]void SetMissionIcon([in] IRemoteObject token, [in] sharedptr icon); + [macrodef SUPPORT_SCREEN]void UpdateMissionSnapShot([in] IRemoteObject token, [in] sharedptr pixelMap); +/* + [macrodef SUPPORT_SCREEN]void RegisterAbilityFirstFrameStateObserver([in] IAbilityFirstFrameStateObserver observer, + [in] String targetBundleName); + [macrodef SUPPORT_SCREEN]void UnregisterAbilityFirstFrameStateObserver([in] IAbilityFirstFrameStateObserver observer); +*/ + void GetTopAbility([out] IRemoteObject token); + void GetAbilityRunningInfos([out] AbilityRunningInfo[] info); + void GetExtensionRunningInfos([in] int upperLimit, [out] ExtensionRunningInfo[] info); + void GetProcessRunningInfos([out] RunningProcessInfo[] info); + void StartSyncRemoteMissions([in] String devId, [in] boolean fixConflict, [in] long tag); + void StopSyncRemoteMissions([in] String devId); + void RegisterMissionListener([in] String deviceId, [in] IRemoteMissionListener listener); + void RegisterOnListener([in] String type, [in] IRemoteOnListener listener); + void RegisterOffListener([in] String type, [in] IRemoteOnListener listener); + void UnRegisterMissionListener([in] String deviceId, [in] IRemoteMissionListener listener); + void SetAbilityController([in] IAbilityController abilityController, [in] boolean imAStabilityTest); + boolean IsRunningInStabilityTest(); + void RegisterSnapshotHandler([in] ISnapshotHandler handler); + void StartUserTest([in] Want want, [in] IRemoteObject observer); + void FinishUserTest([in] String msg, [in] long resultCode, [in] String bundleName); + void CheckUIExtensionIsFocused([in] unsigned int uiExtensionTokenId, [out] boolean isFocused); + void DelegatorDoAbilityForeground([in] IRemoteObject token); + void DelegatorDoAbilityBackground([in] IRemoteObject token); + void DoAbilityForeground([in] IRemoteObject token, [in] unsigned int flag); + void DoAbilityBackground([in] IRemoteObject token, [in] unsigned int flag); + void GetMissionIdByToken([in] IRemoteObject token); + void GetAbilityTokenByCalleeObj([in] IRemoteObject callStub, [out] IRemoteObject token); + void DumpAbilityInfoDone([in] String[] infos, [in] IRemoteObject callerToken); + void FreeInstallAbilityFromRemote([in] Want want, [in] IRemoteObject callBack, [in] int userId, [in] int requestCode); + void AddFreeInstallObserver([in] IRemoteObject callerToken, [in] IFreeInstallObserver observer); + void EnableRecoverAbility([in] IRemoteObject token); + void SubmitSaveRecoveryInfo([in] IRemoteObject token); + void ScheduleRecoverAbility([in] IRemoteObject token, [in] int reason, [in] Want want); + void ScheduleClearRecoveryPageStack(); + void IsValidMissionIds([in] int[] missionIds, [out] MissionValidResult[] missionResults); + void VerifyPermission([in] String permission, [in] int pid, [in] int uid); + void RequestDialogService([in] Want want, [in] IRemoteObject callerToken); + void ReportDrawnCompleted([in] IRemoteObject callerToken); + void AcquireShareData([in] int missionId, [in] IAcquireShareDataCallback shareData); + void ShareDataDone([in] IRemoteObject token, [in] int resultCode, [in] int uniqueId, [in] WantParams wantParam); + void ForceExitApp([in] int pid, [in] ExitReason exitReason); + void RecordAppExitReason([in] ExitReason exitReason); + void RecordProcessExitReason([in] int pid, [in] ExitReason exitReason); + void RecordProcessExitReason([in] int pid, [in] int uid, [in] ExitReason exitReason); + [oneway]void SetRootSceneSession([in] IRemoteObject rootSceneSession); + void CallUIAbilityBySCB([in] sptr sessionInfo, [out] boolean isColdStart); + [oneway]void StartSpecifiedAbilityBySCB([in] Want want); + void NotifySaveAsResult([in] Want want, [in] int resultCode, [in] int requestCode); + void SetSessionManagerService([in] IRemoteObject sessionManagerService); + void RegisterIAbilityManagerCollaborator([in] int type, [in] IAbilityManagerCollaborator impl); + void UnregisterIAbilityManagerCollaborator([in] int type); + void RegisterStatusBarDelegate([in] IStatusBarDelegate delegate); + void KillProcessWithPrepareTerminate([in] int[] pids); + void KillProcessWithReason([in] int pid, [in] ExitReason reason); + void RegisterAutoStartupSystemCallback([in] IRemoteObject callBack); + void UnregisterAutoStartupSystemCallback([in] IRemoteObject callBack); + void SetApplicationAutoStartup([in] AutoStartupInfo info); + void CancelApplicationAutoStartup([in] AutoStartupInfo info); + void QueryAllAutoStartupApplications([out] AutoStartupInfo[] infoList); + void PrepareTerminateAbilityBySCB([in] sptr sessionInfo, [out] boolean isPrepareTerminate); + void RegisterAppDebugListener([in] IAppDebugListener listener); + void UnregisterAppDebugListener([in] IAppDebugListener listener); + void AttachAppDebug([in] String bundleName, [in] boolean isDebugFromLocal); + void DetachAppDebug([in] String bundleName, [in] boolean isDebugFromLocal); + void ExecuteIntent([in] unsigned long key, [in] IRemoteObject callerToken, [in] InsightIntentExecuteParam param); + void IsAbilityControllerStart([in] Want want); + void ExecuteInsightIntentDone([in] IRemoteObject token, [in] unsigned long intentId, [in] InsightIntentExecuteResult insightResult); + void SetApplicationAutoStartupByEDM([in] AutoStartupInfo info, [in] boolean flag); + void CancelApplicationAutoStartupByEDM([in] AutoStartupInfo info, [in] boolean flag); + void GetForegroundUIAbilities([out] AbilityStateData[] list); + void OpenFile([in] Uri uri, [in] unsigned int flag); + void UpdateSessionInfoBySCB([in] SessionInfo[] sessionInfos, [in] int userId, [in] int[] sessionIds); + void RestartApp([in] Want want, [in] boolean isAppRecovery); + void GetUIExtensionRootHostInfo([in] IRemoteObject token, [out] UIExtensionHostInfo hostInfo, [in] int userId); + void GetUIExtensionSessionInfo([in] IRemoteObject token, [out] UIExtensionSessionInfo uiExtensionSessionInfo, + [in] int userId); + void OpenLink([in] Want want, [in] IRemoteObject callerToken, [in] int userId, [in] int requestCode); + void OpenAtomicService([in] Want want, [in] StartOptions options, [in] IRemoteObject callerToken, + [in] int requestCode, [in] int userId); + void SetResidentProcessEnabled([in] String bundleName, [in] boolean enable); + boolean IsEmbeddedOpenAllowed([in] IRemoteObject callerToken, [in] String appId); + void RequestAssertFaultDialog([in] IRemoteObject callBack, [in] WantParams wantParams); + void NotifyDebugAssertResult([in] unsigned long assertFaultSessionId, [in] UserStatus userStatus); + void StartShortcut([in] Want want, [in] StartOptions startOptions); + void GetAbilityStateByPersistentId([in] int persistentId, [out] boolean state); + void TransferAbilityResultForExtension([in] IRemoteObject callerToken, [in] int resultCode, [in] Want want); + [oneway]void NotifyFrozenProcessByRSS([in] int[] pidList, [in] int uid); + void CleanUIAbilityBySCB([in] sptr sessionInfo, [in] boolean isUserRequestedExit, [in] unsigned int sceneFlag); + void PreStartMission([in] String bundleName, [in] String moduleName, [in] String abilityName, [in] String startTime); + void TerminateMission([in] int missionId); + void BlockAllAppStart([in] boolean flag); + void UpdateAssociateConfigList([in] Map configs, [in] String[] exportConfigs, [in] int flag); + void SetApplicationKeepAlive([in] String bundleName, [in] int userId, [in] boolean flag); + void SetApplicationKeepAliveByEDM([in] String bundleName, [in] int userId, [in] boolean flag); + void QueryKeepAliveApplications([in] int appType, [in] int userId, [out] KeepAliveInfo[] list); + void GetAllIntentExemptionInfo([out] IntentExemptionInfo[] info); + void AddQueryERMSObserver([in] IRemoteObject callerToken, [in] IQueryERMSObserver observer); + void PrepareTerminateAbilityDone([in] IRemoteObject token, [in] boolean isTerminate); + void KillProcessWithPrepareTerminateDone([in] String moduleName, [in] int prepareTermination, + [in] boolean isExist); + void KillProcessForPermissionUpdate([in] unsigned int accessTokenId); + void RegisterHiddenStartObserver([in] IHiddenStartObserver observer); + void UnregisterHiddenStartObserver([in] IHiddenStartObserver observer); + void QueryPreLoadUIExtensionRecord([in] ElementName element, [in] String moduleName, + [in] String hostBundleName, [out] int recordNum, [in] int userId); + void RevokeDelegator([in] IRemoteObject token); + void QueryAtomicServiceStartupRule([in] IRemoteObject callerToken, + [in] String appId, + [in] String startTime, + [out] AtomicServiceStartupRule rule); + + void StartAbilityForResultAsCaller( + [in] Want want, + [in] IRemoteObject callerToken, + [in] int requestCode, + [in] int userId); + + void StartAbilityForResultAsCaller( + [in] Want want, + [in] StartOptions startOptions, + [in] IRemoteObject callerToken, + [in] int requestCode, + [in] int userId); + + void StartAbilityByUIContentSession( + [in] Want want, + [in] StartOptions options, + [in] IRemoteObject callerToken, + [in] sptr sessionInfo, + [in] int userId, + [in] int requestCode); + + void StartUIAbilityBySCB( + [in] sptr sessionInfo, + [out] boolean isColdStart, + [in] int sceneFlag); + + void CloseAbility( + [in] IRemoteObject token, + [in] int resultCode, + [in] Want resultWant); + + IAbilityScheduler AcquireDataAbility( + [in] Uri uri, + [in] boolean tryBind, + [in] IRemoteObject callerToken); + +} \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/IFooCustom.idl b/interfaces/inner_api/ability_manager/IFooCustom.idl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/interfaces/inner_api/ability_manager/include/ihidden_start_observer.h b/interfaces/inner_api/ability_manager/IHiddenStartObserver.idl similarity index 44% rename from interfaces/inner_api/ability_manager/include/ihidden_start_observer.h rename to interfaces/inner_api/ability_manager/IHiddenStartObserver.idl index 663f58c30246b0b1e4c1e74799ba38ce74a43e6f..8afe667d8c6ef018279840684c4ab0e63975ec67 100644 --- a/interfaces/inner_api/ability_manager/include/ihidden_start_observer.h +++ b/interfaces/inner_api/ability_manager/IHiddenStartObserver.idl @@ -1,43 +1,18 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_IHIDDEN_START_OBSERVER_H -#define OHOS_ABILITY_RUNTIME_IHIDDEN_START_OBSERVER_H - -#include -#include "iremote_object.h" -#include "iremote_broker.h" - -namespace OHOS { -namespace AAFwk { -class IHiddenStartObserver : public OHOS::IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.IHiddenStartObserver"); - - /** - * IsHiddenStart, return if the given app is started hidden. - * - * @param pid Pid of the given app's process. - * @return if the given app is started hidden - */ - virtual bool IsHiddenStart(int32_t pid) = 0; - - enum class Message { - TRANSACT_ON_IS_HIDDEN_START = 0, - }; -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_IHIDDEN_START_OBSERVER_H \ No newline at end of file +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface OHOS.AAFwk.IHiddenStartObserver { + boolean IsHiddenStart([in] int pid); +} \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/UIExtensionWindowCommand.idl b/interfaces/inner_api/ability_manager/UIExtensionWindowCommand.idl new file mode 100644 index 0000000000000000000000000000000000000000..85e9dd88e98bc578194859ad6239d51f1b7be880 --- /dev/null +++ b/interfaces/inner_api/ability_manager/UIExtensionWindowCommand.idl @@ -0,0 +1,10 @@ +enum WindowCommand { + WIN_CMD_FOREGROUND, + WIN_CMD_BACKGROUND, + WIN_CMD_DESTROY +}; +enum AbilityCommand { + ABILITY_CMD_FOREGROUND, + ABILITY_CMD_BACKGROUND, + ABILITY_CMD_DESTROY +}; diff --git a/interfaces/inner_api/ability_manager/ability_state.idl b/interfaces/inner_api/ability_manager/ability_state.idl new file mode 100644 index 0000000000000000000000000000000000000000..15c1ffb62230b7ef75bf3acce4ddf19a82bce78a --- /dev/null +++ b/interfaces/inner_api/ability_manager/ability_state.idl @@ -0,0 +1,5 @@ +enum UserStatus { + ASSERT_TERMINATE = 0, + ASSERT_CONTINUE, + ASSERT_RETRY, +}; \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h b/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h index 338a24e588b7f90543311d0225c4dbd08d6639c5..c0b4b4a2842a40b0a18dda3bb3fdaf99ab5d821b 100644 --- a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h +++ b/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h @@ -18,7 +18,6 @@ #ifdef SUPPORT_GRAPHICS #include - #include "parcel.h" #include "app_mgr_constants.h" #include "iremote_object.h" diff --git a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_stub.h b/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_recipient.h similarity index 61% rename from interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_stub.h rename to interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_recipient.h index ab3494fe51be40eb4ee3b74fde38b49bd72fe76f..668fcb491977f0fe312b1a61104421ce21a9360d 100644 --- a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_stub.h +++ b/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_recipient.h @@ -13,33 +13,13 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_FIRST_FRAME_STATE_OBSERVER_STUB_H -#define OHOS_ABILITY_RUNTIME_FIRST_FRAME_STATE_OBSERVER_STUB_H +#ifndef OHOS_ABILITY_RUNTIME_ABILITY_FIRST_FRAME_STATE_OBSERVER_RECIPIENT_H +#define OHOS_ABILITY_RUNTIME_ABILITY_FIRST_FRAME_STATE_OBSERVER_RECIPIENT_H #ifdef SUPPORT_GRAPHICS - -#include -#include - -#include "ability_first_frame_state_observer_interface.h" #include "iremote_stub.h" namespace OHOS { namespace AppExecFwk { -class AbilityFirstFrameStateObserverStub : public IRemoteStub { -public: - AbilityFirstFrameStateObserverStub(); - virtual ~AbilityFirstFrameStateObserverStub(); - - int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleOnAbilityFirstFrameStateChanged(MessageParcel &data, MessageParcel &reply); - - static std::mutex callbackMutex_; - - DISALLOW_COPY_AND_MOVE(AbilityFirstFrameStateObserverStub); -}; - /** * @class AbilityFirstFrameStateObserverRecipient * AbilityFirstFrameStateObserverRecipient notices IRemoteBroker died. @@ -57,4 +37,4 @@ private: } // namespace AppExecFwk } // namespace OHOS #endif // SUPPORT_GRAPHICS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_FOREGROUND_STATE_OBSERVER_STUB_H +#endif // OHOS_ABILITY_RUNTIME_ABILITY_FIRST_FRAME_STATE_OBSERVER_RECIPIENT_H 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 4f974265a4063e6d379bfd57ff8420ad3099c662..0bcf711d93759859e9cf143e9b876cdf0f8b9139 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_client.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_client.h @@ -30,9 +30,10 @@ #include "want.h" #include "intent_exemption_info.h" #include "ihidden_start_observer.h" - +#include "dms_continue_info.h" namespace OHOS { namespace AAFwk { +const int DEFAULT_INVAL_VALUE = -1; class Snapshot; class ISnapshotHandler; using AutoStartupInfo = AbilityRuntime::AutoStartupInfo; @@ -144,8 +145,7 @@ public: * @param requestCode Ability request code. * @return Returns ERR_OK on success, others on failure. */ - ErrCode StartAbility(const Want &want, int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + ErrCode StartAbility(const Want &want, int requestCode, int32_t userId); /** * StartAbility with want, send want to ability manager service. @@ -158,8 +158,8 @@ public: ErrCode StartAbility( const Want &want, sptr callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * StartAbility by insight intent, send want to ability manager service. @@ -174,7 +174,7 @@ public: const Want &want, sptr callerToken, uint64_t intentId, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Starts a new ability with specific start settings. @@ -188,8 +188,8 @@ public: const Want &want, const AbilityStartSetting &abilityStartSetting, sptr callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Starts a new ability with specific start options. @@ -204,8 +204,8 @@ public: const Want &want, const StartOptions &startOptions, sptr callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Starts a new ability using the original caller information. @@ -221,8 +221,8 @@ public: const Want &want, sptr callerToken, sptr asCallerSourceToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Starts a new ability using the original caller information. @@ -240,8 +240,8 @@ public: const StartOptions &startOptions, sptr callerToken, sptr asCallerSourceToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Starts a new ability for result using the original caller information. @@ -255,8 +255,8 @@ public: ErrCode StartAbilityForResultAsCaller( const Want &want, sptr callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Starts a new ability for result using the original caller information. @@ -272,8 +272,8 @@ public: const Want &want, const StartOptions &startOptions, sptr callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Start ui session ability with extension session info, send session info to ability manager service. @@ -288,8 +288,8 @@ public: const Want &want, sptr callerToken, sptr sessionInfo, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Start ui session ability with extension session info, send session info to ability manager service. @@ -306,8 +306,8 @@ public: const StartOptions &startOptions, sptr callerToken, sptr sessionInfo, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE); + int requestCode, + int32_t userId); /** * Start ui ability @@ -354,7 +354,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode PreloadUIExtensionAbility(const Want &want, std::string &hostBundleName, - int32_t userId = DEFAULT_INVAL_VALUE, int32_t hostPid = DEFAULT_INVAL_VALUE); + int32_t userId, int32_t hostPid); ErrCode ChangeAbilityVisibility(sptr token, bool isShow); @@ -369,7 +369,7 @@ public: */ ErrCode StartUIExtensionAbility( sptr extensionSessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Start ui ability with want, send want to ability manager service. @@ -434,7 +434,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode TerminateUIExtensionAbility(sptr extensionSessionInfo, - int resultCode = DEFAULT_INVAL_VALUE, const Want *resultWant = nullptr); + int resultCode = DEFAULT_INVAL_VALUE, const std::shared_ptr &resultWant = nullptr); /** * CloseUIExtensionAbilityBySCB, terminate the specified ui extension ability by SCB. @@ -489,7 +489,7 @@ public: * @param Want Ability want returned. * @return Returns ERR_OK on success, others on failure. */ - ErrCode CloseAbility(sptr token, int resultCode = DEFAULT_INVAL_VALUE, + ErrCode CloseAbility(sptr token, int resultCode, const Want *resultWant = nullptr); /** @@ -540,7 +540,7 @@ public: const Want &want, sptr connect, sptr callerToken, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * ConnectUIServiceExtensionAbility, connect session with uiService ability. @@ -554,7 +554,7 @@ public: const Want &want, sptr connect, sptr callerToken, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Connect data share extension ability. @@ -565,7 +565,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode ConnectDataShareExtensionAbility(const Want &want, sptr connect, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Connect extension ability. @@ -576,7 +576,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode ConnectExtensionAbility(const Want &want, sptr connect, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Connect ui extension ability. @@ -589,7 +589,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode ConnectUIExtensionAbility(const Want &want, sptr connect, - sptr sessionInfo, int32_t userId = DEFAULT_INVAL_VALUE, + sptr sessionInfo, int32_t userId, sptr connectInfo = nullptr); /** @@ -902,7 +902,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode StartAbilityByCall(const Want &want, sptr connect, - sptr callToken, int32_t accountId = DEFAULT_INVAL_VALUE); + sptr callToken, int32_t accountId); int32_t StartAbilityByCallWithErrMsg(const Want &want, sptr connect, sptr callToken, int32_t accountId, std::string &errMsg); @@ -1129,7 +1129,7 @@ public: * @param token The target ability. * @param pixelMap The snapshot. */ - void UpdateMissionSnapShot(sptr token, + ErrCode UpdateMissionSnapShot(sptr token, std::shared_ptr pixelMap); ErrCode GetDialogSessionInfo(const std::string &dialogSessionId, sptr &info); @@ -1218,7 +1218,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode FreeInstallAbilityFromRemote(const Want &want, sptr callback, int32_t userId, - int requestCode = DEFAULT_INVAL_VALUE); + int requestCode); /** * Called when client complete dump. @@ -1234,14 +1234,14 @@ public: * * @param token Ability identify. */ - void EnableRecoverAbility(sptr token); + ErrCode EnableRecoverAbility(sptr token); /** * @brief Submit save recovery info. * * @param token Ability identify. */ - void SubmitSaveRecoveryInfo(sptr token); + ErrCode SubmitSaveRecoveryInfo(sptr token); /** * @brief Schedule recovery ability. @@ -1250,14 +1250,15 @@ public: * @param reason See AppExecFwk::StateReason. * @param want Want information. */ - void ScheduleRecoverAbility(sptr token, int32_t reason, const Want *want = nullptr); + ErrCode ScheduleRecoverAbility(const sptr token, int32_t reason, + const std::shared_ptr want= nullptr); /** * @brief Schedule clear recovery page stack. * * @param bundleName application bundleName. */ - void ScheduleClearRecoveryPageStack(); + ErrCode ScheduleClearRecoveryPageStack(); /** * @brief Add free install observer. @@ -1487,7 +1488,7 @@ public: * @brief Update session info. * @param sessionInfos The vector of session info. */ - int32_t UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, + int32_t UpdateSessionInfoBySCB(std::vector &sessionInfos, int32_t userId, std::vector &sessionIds); /** @@ -1506,7 +1507,7 @@ public: * @return ErrCode Returns ERR_OK on success, others on failure. */ ErrCode GetUIExtensionRootHostInfo(const sptr token, UIExtensionHostInfo &hostInfo, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * @brief Get ui extension session info @@ -1517,7 +1518,7 @@ public: * @return int32_t Returns ERR_OK on success, others on failure. */ ErrCode GetUIExtensionSessionInfo(const sptr token, UIExtensionSessionInfo &uiExtensionSessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Pop-up launch of full-screen atomic service. @@ -1529,7 +1530,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ int32_t OpenAtomicService(Want& want, const StartOptions &options, sptr callerToken, - int32_t requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE); + int32_t requestCode, int32_t userId); /** * @brief Querying whether to allow embedded startup of atomic service. @@ -1600,7 +1601,7 @@ public: * @param pidList, the pid list of the frozen process. * @param uid, the uid of the frozen process. */ - void NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid); + ErrCode NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid); /** * Open atomic service window prior to finishing free install. @@ -1659,8 +1660,8 @@ public: * @param exportConfigs The rss export config info. * @param flag UPDATE_CONFIG_FLAG_COVER is cover config, UPDATE_CONFIG_FLAG_APPEND is append config. */ - ErrCode UpdateAssociateConfigList(const std::map>& configs, - const std::list& exportConfigs, int32_t flag); + ErrCode UpdateAssociateConfigList(const std::map>& configs, + const std::vector& exportConfigs, int32_t flag); ErrCode GetAllIntentExemptionInfo(std::vector& info); @@ -1684,7 +1685,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode QueryAtomicServiceStartupRule(sptr callerToken, - const std::string &appId, const std::string &startTime, AtomicServiceStartupRule &rule); + const std::string &appId, const std::string &startTime, AbilityRuntime::AtomicServiceStartupRule &rule); /** * PrepareTerminateAbilityDone, called when PrepareTerminateAbility call is done. @@ -1692,7 +1693,7 @@ public: * @param token, the token of the ability to terminate. * @param callback callback. */ - void PrepareTerminateAbilityDone(sptr token, bool isTerminate); + ErrCode PrepareTerminateAbilityDone(sptr token, bool isTerminate); /** * KillProcessWithPrepareTerminateDone, called when KillProcessWithPrepareTerminate call is done. @@ -1701,7 +1702,7 @@ public: * @param prepareTermination, the result of prepareTermination call of the module. * @param isExist, whether the prepareTerminate functions are implemented. */ - void KillProcessWithPrepareTerminateDone(const std::string &moduleName, int32_t prepareTermination, bool isExist); + ErrCode KillProcessWithPrepareTerminateDone(const std::string &moduleName, int32_t prepareTermination, bool isExist); /** * KillProcessForPermissionUpdate @@ -1740,7 +1741,7 @@ public: const std::string &moduleName, const std::string &hostBundleName, int32_t &recordNum, - int32_t userId = DEFAULT_INVAL_VALUE); + int32_t userId); /** * Revoke delegator. 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 435b662c5551e7a371f460ae9393d4a33af1b601..4baacfd957b38e25136a883c02ed15096f264037 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h @@ -15,12 +15,9 @@ #ifndef OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H #define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H - -#include -#include -#include -#include - +#include "iability_manager.h" +#include "extension_running_info.h" +#include "window_manager_service_handler.h" #include "ability_connect_callback_interface.h" #include "ability_manager_ipc_interface_code.h" #include "ability_running_info.h" @@ -30,7 +27,6 @@ #include "ability_state_data.h" #include "app_debug_listener_interface.h" #include "auto_startup_info.h" -#include "dms_continueInfo.h" #include "exit_reason.h" #include "extension_running_info.h" #include "free_install_observer_interface.h" @@ -62,2070 +58,2152 @@ #include "dialog_session_info.h" #include "window_config.h" #include "intent_exemption_info.h" -#ifdef SUPPORT_SCREEN -#include "window_manager_service_handler.h" -#include "ability_first_frame_state_observer_interface.h" -#endif #include "ihidden_start_observer.h" - namespace OHOS { -namespace AbilityRuntime { -class IStatusBarDelegate; -} - namespace AAFwk { -class Snapshot; -class IMissionListener; -class ISnapshotHandler; -struct MissionSnapshot; -using KeepAliveInfo = AbilityRuntime::KeepAliveInfo; -using AutoStartupInfo = AbilityRuntime::AutoStartupInfo; -using InsightIntentExecuteParam = AppExecFwk::InsightIntentExecuteParam; -using InsightIntentExecuteResult = AppExecFwk::InsightIntentExecuteResult; -using UIExtensionAbilityConnectInfo = AbilityRuntime::UIExtensionAbilityConnectInfo; -using UIExtensionHostInfo = AbilityRuntime::UIExtensionHostInfo; -using UIExtensionSessionInfo = AbilityRuntime::UIExtensionSessionInfo; -#ifdef SUPPORT_SCREEN -using IAbilityFirstFrameStateObserver = AppExecFwk::IAbilityFirstFrameStateObserver; -#endif -using AtomicServiceStartupRule = AbilityRuntime::AtomicServiceStartupRule; - -constexpr const char* ABILITY_MANAGER_SERVICE_NAME = "AbilityManagerService"; -const int DEFAULT_INVAL_VALUE = -1; +constexpr const char* FROM_REMOTE_KEY = "freeInstallFromRemote"; const int DELAY_LOCAL_FREE_INSTALL_TIMEOUT = 40000; const int DELAY_REMOTE_FREE_INSTALL_TIMEOUT = 30000 + DELAY_LOCAL_FREE_INSTALL_TIMEOUT; -constexpr const char* FROM_REMOTE_KEY = "freeInstallFromRemote"; -/** - * @class IAbilityManager - * IAbilityManager interface is used to access ability manager services. - */ -class IAbilityManager : public OHOS::IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.AbilityManager") - - /** - * StartSelfUIAbility with want, start self uiability only on 2-in-1 devices. - * - * @param want, the want of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartSelfUIAbility(const Want &want) - { - return 0; - } - - /** - * StartSelfUIAbility with want and startOptions, start self uiability only on 2-in-1 devices. - * - * @param want, the want of the ability to start. - * @param options, the startOptions of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartSelfUIAbilityWithStartOptions(const Want &want, const StartOptions &options) - { - return 0; - } - - /** - * StartAbility with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param userId, Designation User ID. - * @param requestCode, Ability request code. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) = 0; - - /** - * StartAbility with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param requestCode, Ability request code. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) = 0; - - /** - * StartAbilityWithSpecifyTokenId with want and specialId, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param specialId the caller Id. - * @param userId, Designation User ID. - * @param requestCode, Ability request code. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityWithSpecifyTokenId( - const Want &want, - const sptr &callerToken, - uint32_t specifyTokenId, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) = 0; - - /** - * StartAbility by insight intent, send want to ability manager service. - * - * @param want Ability want. - * @param callerToken caller ability token. - * @param intentId insight intent id. - * @param userId userId of target ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t StartAbilityByInsightIntent( - const Want &want, - const sptr &callerToken, - uint64_t intentId, - int32_t userId = DEFAULT_INVAL_VALUE) = 0; - - /** - * Starts a new ability with specific start settings. - * - * @param want Indicates the ability to start. - * @param requestCode the resultCode of the ability to start. - * @param abilityStartSetting Indicates the setting ability used to start. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - const AbilityStartSetting &abilityStartSetting, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) = 0; - - /** - * Starts a new ability with specific start options. - * - * @param want, the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) = 0; - - /** - * Starts a new ability using the original caller information. - * - * @param want the want of the ability to start. - * @param callerToken caller ability token. - * @param asCallerSourceToken source caller ability token. - * @param userId Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityAsCaller( - const Want &want, - const sptr &callerToken, - sptr asCallerSourceToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Starts a new ability using the original caller information. - * - * @param want the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken caller ability token. - * @param asCallerSourceToken source caller ability token. - * @param userId Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityAsCaller( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - sptr asCallerSourceToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Starts a new ability for result using the original caller information. - * - * @param want the want of the ability to start. - * @param callerToken current caller ability token. - * @param requestCode the resultCode of the ability to start. - * @param userId Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityForResultAsCaller( - const Want &want, - const sptr &callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Starts a new ability for result using the original caller information. - * - * @param want the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken current caller ability token. - * @param requestCode the resultCode of the ability to start. - * @param userId Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityForResultAsCaller( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Start ui session ability with extension session info, send session info to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param sessionInfo the information of UIExtensionContentSession. - * @param userId, Designation User ID. - * @param requestCode, Ability request code. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityByUIContentSession( - const Want &want, - const sptr &callerToken, - const sptr &sessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) - { - return 0; - } - -/** - * Start ui session ability with extension session info, send session info to ability manager service. - * - * @param want, the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken, caller ability token. - * @param sessionInfo the information of UIExtensionContentSession. - * @param userId, Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityByUIContentSession( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - const sptr &sessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Start ui ability - * - * @param want the want of the ability to start. - * @param callerToken caller ability token. - * @param specifyTokenId The Caller ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityOnlyUIAbility( - const Want &want, - const sptr &callerToken, - uint32_t specifyTokenId) - { - return 0; - } - - /** - * Start extension ability with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be started. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t StartExtensionAbility( - const Want &want, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) - { - return 0; - } - - /** - * Create UIExtension with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RequestModalUIExtension(const Want &want) - { - return 0; - } - - /** - * Preload UIExtension with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param hostBundleName, the caller application bundle name. - * @param userId, the extension runs in. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int PreloadUIExtensionAbility(const Want &want, std::string &hostBundleName, - int32_t userId = DEFAULT_INVAL_VALUE, int32_t hostPid = DEFAULT_INVAL_VALUE) - { - return 0; - } - - virtual int ChangeAbilityVisibility(sptr token, bool isShow) - { - return 0; - } - - virtual int ChangeUIAbilityVisibilityBySCB(sptr sessionInfo, bool isShow) - { - return 0; - } - - /** - * Start ui extension ability with extension session info, send extension session info to ability manager service. - * - * @param extensionSessionInfo the extension session info of the ability to start. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUIExtensionAbility( - const sptr &extensionSessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Start ui ability with want, send want to ability manager service. - * - * @param sessionInfo the session info of the ability to start. - * @param isColdStart the session info of the ability is or not cold start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUIAbilityBySCB(sptr sessionInfo, bool &isColdStart, uint32_t sceneFlag = 0) - { - return 0; - } - - /** - * Stop extension ability with want, send want to ability manager service. - * - * @param want, the want of the ability to stop. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be stopped. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StopExtensionAbility( - const Want& want, - const sptr& callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) - { - return 0; - } - - virtual int GetAppMemorySize() - { - return 0; - } - - virtual bool IsRamConstrainedDevice() - { - return false; - } - - virtual AppExecFwk::ElementName GetTopAbility(bool isNeedLocalDeviceId = true) - { - return {}; - } - - virtual AppExecFwk::ElementName GetElementNameByToken(sptr token, - bool isNeedLocalDeviceId = true) - { - return {}; - } - - /** - * TerminateAbility, terminate the special ability. - * - * @param token, the token of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int TerminateAbility( - const sptr &token, int resultCode, const Want *resultWant = nullptr) = 0; - - /** - * BackToCallerAbilityWithResult, return to the caller ability. - * - * @param token, the token of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @param callerRequestCode, the requestCode of caller ability.· - * @return Returns ERR_OK on success, others on failure. - */ - virtual int BackToCallerAbilityWithResult(const sptr &token, int resultCode, - const Want *resultWant, int64_t callerRequestCode) - { - return 0; - }; - - /** - * TerminateUIServiceExtensionAbility, terminate the UIServiceExtensionAbility. - * - * @param token, the token of the ability to terminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t TerminateUIServiceExtensionAbility(const sptr &token) - { - return 0; - } - - /** - * TerminateUIExtensionAbility, terminate the special ui extension ability. - * - * @param extensionSessionInfo the extension session info of the ability to terminate. - * @param resultCode, the resultCode of the ui extension ability to terminate. - * @param resultWant, the Want of the ui extension ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int TerminateUIExtensionAbility(const sptr &extensionSessionInfo, - int resultCode, const Want *resultWant = nullptr) - { - return 0; - } - - /** - * CloseUIExtensionAbilityBySCB, terminate the specified ui extension ability by SCB. - * - * @param token the ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CloseUIExtensionAbilityBySCB(const sptr token) - { - return 0; - } - - /** - * CloseUIAbilityBySCB, close the special ability by scb. - * - * @param sessionInfo the session info of the ability to terminate. - * @param sceneFlag the reason info of the ability to terminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CloseUIAbilityBySCB(const sptr &sessionInfo, bool isUserRequestedExit, - uint32_t sceneFlag = 0) - { - return 0; - } - - /** - * SendResultToAbility, send the result to ability. - * - * @param requestCode, the requestCode of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int SendResultToAbility(int requestCode, int resultCode, Want &resultWant) - { - return 0; - } - - /** - * MoveAbilityToBackground. - * - * @param token, the token of the ability to move. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveAbilityToBackground(const sptr &token) - { - return 0; - }; - - /** - * Move the UIAbility to background, called by app self. - * - * @param token the token of the ability to move. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t MoveUIAbilityToBackground(const sptr token) - { - return 0; - }; - - /** - * CloseAbility, close the special ability. - * - * @param token, the token of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CloseAbility(const sptr &token, int resultCode = DEFAULT_INVAL_VALUE, - const Want *resultWant = nullptr) = 0; - - /** - * MinimizeAbility, minimize the special ability. - * - * @param token, the token of the ability to minimize. - * @param fromUser mark the minimize operation source. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MinimizeAbility(const sptr &token, bool fromUser = false) = 0; - - /** - * MinimizeUIExtensionAbility, minimize the special ui extension ability. - * - * @param extensionSessionInfo the extension session info of the ability to minimize. - * @param fromUser mark the minimize operation source. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MinimizeUIExtensionAbility(const sptr &extensionSessionInfo, - bool fromUser = false) - { - return 0; - }; - - /** - * MinimizeUIAbilityBySCB, minimize the special ui ability by scb. - * - * @param sessionInfo the session info of the ability to minimize. - * @param fromUser, Whether form user. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MinimizeUIAbilityBySCB(const sptr &sessionInfo, bool fromUser = false, - uint32_t sceneFlag = 0) - { - return 0; - }; - - /** - * ConnectAbility, connect session with service ability. - * - * @param want, Special want for service type's ability. - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ConnectAbility( - const Want &want, - const sptr &connect, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE) = 0; - - /** - * Connect ability common method. - * - * @param want, special want for service type's ability. - * @param connect, callback used to notify caller the result of connecting or disconnecting. - * @param callerToken, caller ability token. - * @param extensionType, type of the extension. - * @param userId, the service user ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ConnectAbilityCommon( - const Want &want, - const sptr &connect, - const sptr &callerToken, - AppExecFwk::ExtensionAbilityType extensionType, - int32_t userId = DEFAULT_INVAL_VALUE, - bool isQueryExtensionOnly = false) - { - return 0; - } - - /** - * Connect ui extension ability. - * - * @param want, special want for the ui extension ability. - * @param connect, callback used to notify caller the result of connecting or disconnecting. - * @param sessionInfo the extension session info of the ability to connect. - * @param userId, the extension runs in. - * @param connectInfo the connect info. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ConnectUIExtensionAbility(const Want &want, const sptr &connect, - const sptr &sessionInfo, int32_t userId = DEFAULT_INVAL_VALUE, - sptr connectInfo = nullptr) - { - return 0; - } - - /** - * DisconnectAbility, disconnect session with service ability. - * - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DisconnectAbility(sptr connect) = 0; - - /** - * AcquireDataAbility, acquire a data ability by its authority, if it not existed, - * AMS loads it synchronously. - * - * @param authority, a string to identify a data ability, decoded from uri. - * @param tryBind, true: when a data ability is died, ams will kill this client, or do nothing. - * @param callerToken, specifies the caller ability token. - * @return returns the data ability ipc object, or nullptr for failed. - */ - virtual sptr AcquireDataAbility( - const Uri &uri, bool tryBind, const sptr &callerToken) = 0; - - /** - * ReleaseDataAbility, release the data ability that referenced by 'dataAbilityToken'. - * - * @param dataAbilityScheduler, specifies the data ability that will be released. - * @param callerToken, specifies the caller ability token. - * @return returns ERR_OK if succeeded, or error codes for failed. - */ - virtual int ReleaseDataAbility( - sptr dataAbilityScheduler, const sptr &callerToken) = 0; - - /** - * AttachAbilityThread, ability call this interface after loaded. - * - * @param scheduler,.the interface handler of kit ability. - * @param token,.ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AttachAbilityThread(const sptr &scheduler, const sptr &token) = 0; - - /** - * AbilityTransitionDone, ability call this interface after life cycle was changed. - * - * @param token,.ability's token. - * @param state,.the state of ability life cycle. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AbilityTransitionDone(const sptr &token, int state, const PacMap &saveData) = 0; - - /** - * AbilityWindowConfigTransitionDone, ability call this interface after life cycle was changed. - * - * @param token,.ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AbilityWindowConfigTransitionDone( - const sptr &token, const WindowConfig &windowConfig) - { - return 0; - } - - /** - * ScheduleConnectAbilityDone, service ability call this interface while session was connected. - * - * @param token,.service ability's token. - * @param remoteObject,.the session proxy of service ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ScheduleConnectAbilityDone( - const sptr &token, const sptr &remoteObject) = 0; - - /** - * ScheduleDisconnectAbilityDone, service ability call this interface while session was disconnected. - * - * @param token,.service ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ScheduleDisconnectAbilityDone(const sptr &token) = 0; - - /** - * ScheduleCommandAbilityDone, service ability call this interface while session was commanded. - * - * @param token,.service ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ScheduleCommandAbilityDone(const sptr &token) = 0; - - virtual int ScheduleCommandAbilityWindowDone( - const sptr &token, - const sptr &sessionInfo, - AAFwk::WindowCommand winCmd, - AAFwk::AbilityCommand abilityCmd) = 0; - - /** - * dump ability stack info, about userID, mission stack info, - * mission record info and ability info. - * - * @param state Ability stack info. - * @return Returns ERR_OK on success, others on failure. - */ - virtual void DumpState(const std::string &args, std::vector &state) = 0; - virtual void DumpSysState( - const std::string& args, std::vector& state, bool isClient, bool isUserID, int UserID) = 0; - - /** - * Destroys this Service ability by Want. - * - * @param want, Special want for service type's ability. - * @param token ability's token. - * @return Returns true if this Service ability will be destroyed; returns false otherwise. - */ - virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE, - const sptr &token = nullptr) = 0; - - /** - * Kill the process immediately. - * - * @param bundleName. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int KillProcess(const std::string &bundleName, bool clearPageStack = false, int32_t appIndex = 0) = 0; - - #ifdef ABILITY_COMMAND_FOR_TEST - /** - * force timeout ability. - * - * @param abilityName. - * @param state. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ForceTimeoutForTest(const std::string &abilityName, const std::string &state) = 0; - #endif - - /** - * Uninstall app - * - * @param bundleName bundle name of uninstalling app. - * @param uid uid of bundle. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int UninstallApp(const std::string &bundleName, int32_t uid) - { - return 0; - } - - /** - * Uninstall app - * - * @param bundleName bundle name of uninstalling app. - * @param uid uid of bundle. - * @param appIndex the app index of app clone. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UninstallApp(const std::string &bundleName, int32_t uid, int32_t appIndex) - { - return 0; - } - - /** - * Upgrade app, record exit reason and kill application - * - * @param bundleName bundle name of upgrading app. - * @param uid uid of bundle. - * @param exitMsg the exit reason message. - * @param appIndex the app index of app clone. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UpgradeApp(const std::string &bundleName, const int32_t uid, const std::string &exitMsg, - int32_t appIndex = 0) - { - return 0; - } - - virtual sptr GetWantSender( - const WantSenderInfo &wantSenderInfo, const sptr &callerToken, int32_t uid = -1) = 0; - - virtual int SendWantSender(sptr target, const SenderInfo &senderInfo) = 0; - - virtual void CancelWantSender(const sptr &sender) = 0; - - virtual int GetPendingWantUid(const sptr &target) = 0; - - virtual int GetPendingWantUserId(const sptr &target) = 0; - - virtual std::string GetPendingWantBundleName(const sptr &target) = 0; - - virtual int GetPendingWantCode(const sptr &target) = 0; - - virtual int GetPendingWantType(const sptr &target) = 0; - - virtual void RegisterCancelListener(const sptr &sender, const sptr &receiver) = 0; - - virtual void UnregisterCancelListener(const sptr &sender, const sptr &receiver) = 0; - - virtual int GetPendingRequestWant(const sptr &target, std::shared_ptr &want) = 0; - - virtual int GetWantSenderInfo(const sptr &target, std::shared_ptr &info) = 0; - - virtual int ContinueMission(const std::string &srcDeviceId, const std::string &dstDeviceId, int32_t missionId, - const sptr &callBack, AAFwk::WantParams &wantParams) = 0; - - virtual int ContinueMission(AAFwk::ContinueMissionInfo continueMissionInfo, const sptr &callback) - { - return 0; - } - - virtual int ContinueAbility(const std::string &deviceId, int32_t missionId, uint32_t versionCode) = 0; - - virtual int StartContinuation(const Want &want, const sptr &abilityToken, int32_t status) = 0; - - virtual void NotifyCompleteContinuation(const std::string &deviceId, int32_t sessionId, bool isSuccess) = 0; - - virtual int NotifyContinuationResult(int32_t missionId, int32_t result) = 0; - - virtual int LockMissionForCleanup(int32_t missionId) = 0; - - virtual int UnlockMissionForCleanup(int32_t missionId) = 0; - - virtual void SetLockedState(int32_t sessionId, bool lockedState) - { - return; - } - - /** - * @brief Register mission listener to ability mgr. - * @param listener The handler of listener. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RegisterMissionListener(const sptr &listener) = 0; - - /** - * @brief UnRegister mission listener from ability mgr. - * @param listener The handler of listener. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int UnRegisterMissionListener(const sptr &listener) = 0; - - /** - * @brief Get mission infos from ability mgr. - * @param deviceId local or remote deviceId. - * @param numMax max number of missions. - * @param missionInfos mission info result. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetMissionInfos( - const std::string &deviceId, int32_t numMax, std::vector &missionInfos) = 0; - - /** - * @brief Get mission info by id. - * @param deviceId local or remote deviceId. - * @param missionId Id of target mission. - * @param missionInfo mission info of target mission. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetMissionInfo(const std::string &deviceId, int32_t missionId, MissionInfo &missionInfo) = 0; - - /** - * @brief Get the Mission Snapshot Info object - * @param deviceId local or remote deviceId. - * @param missionId Id of target mission. - * @param snapshot snapshot of target mission. - * @param isLowResolution get low resolution snapshot. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetMissionSnapshot(const std::string& deviceId, int32_t missionId, - MissionSnapshot& snapshot, bool isLowResolution) = 0; - - /** - * @brief Clean mission by id. - * @param missionId Id of target mission. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CleanMission(int32_t missionId) = 0; - - /** - * @brief Clean all missions in system. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CleanAllMissions() = 0; - - virtual int MoveMissionToFront(int32_t missionId) = 0; - - /** - * @brief Move a mission to front. - * @param missionId Id of target mission. - * @param startOptions Special startOptions for target mission. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveMissionToFront(int32_t missionId, const StartOptions &startOptions) = 0; - - /** - * Move missions to front - * @param missionIds Ids of target missions - * @param topMissionId Indicate which mission will be moved to top, if set to -1, missions' order won't change - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveMissionsToForeground(const std::vector& missionIds, int32_t topMissionId) - { - return 0; - } - - /** - * Move missions to background - * @param missionIds Ids of target missions - * @param result The result of move missions to background, and the array is sorted by zOrder - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveMissionsToBackground(const std::vector& missionIds, std::vector& result) - { - return 0; - } - - /** - * @brief Register session handler. - * @param object The handler. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RegisterSessionHandler(const sptr &object) - { - return 0; - } - - /** - * Start Ability, connect session with common ability. - * - * @param want, Special want for service type's ability. - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @param accountId Indicates the account to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) = 0; - - virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) - { - return 0; - }; - - /** - * CallRequestDone, after invoke callRequest, ability will call this interface to return callee. - * - * @param token, ability's token. - * @param callStub, ability's callee. - */ - virtual void CallRequestDone(const sptr &token, const sptr &callStub) {}; - - /** - * Release the call between Ability, disconnect session with common ability. - * - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ReleaseCall(const sptr &connect, const AppExecFwk::ElementName &element) = 0; - - /** - * @brief start user. - * @param accountId accountId. - * @param isAppRecovery is appRecovery or not. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUser(int userId, sptr callback, bool isAppRecovery = false) = 0; - - /** - * @brief stop user. - * @param accountId accountId. - * @param callback callback. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StopUser(int userId, const sptr &callback) = 0; - - /** - * @brief logout user. - * @param accountId accountId. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int LogoutUser(int32_t userId, sptr callback = nullptr) - { - return 0; - } - - virtual int SetMissionContinueState(const sptr &token, const AAFwk::ContinueState &state) - { - return 0; - }; - -#ifdef SUPPORT_SCREEN - virtual int SetMissionLabel(const sptr &abilityToken, const std::string &label) = 0; - - virtual int SetMissionIcon(const sptr &token, - const std::shared_ptr &icon) = 0; - - /** - * Called to update mission snapshot. - * @param token The target ability. - * @param pixelMap The snapshot. - */ - virtual void UpdateMissionSnapShot(const sptr &token, - const std::shared_ptr &pixelMap) {}; - - /** - * Register the WindowManagerService handler - * - * @param handler Indicate handler of WindowManagerService. - * @return ErrCode Returns ERR_OK on success, others on failure. - */ - virtual int RegisterWindowManagerServiceHandler(const sptr& handler, - bool animationEnabled) - { - return 0; - } - - /** - * WindowManager notification AbilityManager after the first frame is drawn. - * - * @param abilityToken Indicate token of ability. - */ - virtual void CompleteFirstFrameDrawing(const sptr &abilityToken) = 0; - - /** - * WindowManager notification AbilityManager after the first frame is drawn. - * - * @param sessionId Indicate session id. - */ - virtual void CompleteFirstFrameDrawing(int32_t sessionId) - {} - - /** - * PrepareTerminateAbility, prepare terminate the special ability. - * - * @param token, the token of the ability to terminate. - * @param callback callback. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int PrepareTerminateAbility(const sptr &token, sptr &callback) - { - return 0; - } - - virtual int GetDialogSessionInfo(const std::string &dialogSessionId, sptr &dialogSessionInfo) - { - return 0; - } - - virtual int SendDialogResult(const Want &want, const std::string &dialogSessionId, bool isAllow) - { - return 0; - } - - /** - * Register ability first frame state observer. - * @param observer Is ability first frame state observer. - * @param bundleName Is bundleName of the app to observe. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RegisterAbilityFirstFrameStateObserver(const sptr &observer, - const std::string &targetBundleName) - { - return 0; - } - - /** - * Unregister ability first frame state observer. - * @param observer Is ability first frame state observer. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UnregisterAbilityFirstFrameStateObserver(const sptr &observer) - { - return 0; - } - -#endif - /** - * @brief Get the ability running information. - * - * @param info Ability running information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetAbilityRunningInfos(std::vector &info) = 0; - - /** - * @brief Get the extension running information. - * - * @param upperLimit The maximum limit of information wish to get. - * @param info Extension running information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetExtensionRunningInfos(int upperLimit, std::vector &info) = 0; - - /** - * @brief Get running process information. - * - * @param info Running process information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetProcessRunningInfos(std::vector &info) = 0; - - /** - * Start synchronizing remote device mission - * @param devId, deviceId. - * @param fixConflict, resolve synchronizing conflicts flag. - * @param tag, call tag. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartSyncRemoteMissions(const std::string &devId, bool fixConflict, int64_t tag) = 0; - - /** - * Stop synchronizing remote device mission - * @param devId, deviceId. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StopSyncRemoteMissions(const std::string &devId) = 0; - - /** - * @brief Register mission listener to ability manager service. - * @param deviceId The remote device Id. - * @param listener The handler of listener. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RegisterMissionListener(const std::string &deviceId, const sptr &listener) = 0; - - virtual int RegisterOnListener(const std::string &type, const sptr &listener) - { - return 0; - } - - virtual int RegisterOffListener(const std::string &type, const sptr &listener) - { - return 0; - } - - virtual int UnRegisterMissionListener(const std::string &deviceId, - const sptr &listener) = 0; - - /** - * Set ability controller. - * - * @param abilityController, The ability controller. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int SetAbilityController(const sptr &abilityController, - bool imAStabilityTest) = 0; - - /** - * Is user a stability test. - * - * @return Returns true if user is a stability test. - */ - virtual bool IsRunningInStabilityTest() = 0; - - /** - * @brief Register the snapshot handler - * @param handler snapshot handler - * @return int Returns ERR_OK on success, others on failure. - */ - virtual int RegisterSnapshotHandler(const sptr& handler) = 0; - - /** - * @brief start user test. - * @param want the want of the ability user test to start. - * @param observer test observer callback. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUserTest(const Want &want, const sptr &observer) = 0; - - /** - * @brief Finish user test. - * @param msg user test message. - * @param resultCode user test result Code. - * @param bundleName user test bundleName. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int FinishUserTest(const std::string &msg, const int64_t &resultCode, const std::string &bundleName) = 0; - - /** - * GetTopAbility, get the token of top ability. - * - * @param token, the token of top ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetTopAbility(sptr &token) = 0; - - virtual int CheckUIExtensionIsFocused(uint32_t uiExtensionTokenId, bool& isFocused) - { - return 0; - } - - /** - * The delegator calls this interface to move the ability to the foreground. - * - * @param token, ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DelegatorDoAbilityForeground(const sptr &token) = 0; - - /** - * The delegator calls this interface to move the ability to the background. - * - * @param token, ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DelegatorDoAbilityBackground(const sptr &token) = 0; - - /** - * Calls this interface to move the ability to the foreground. - * - * @param token, ability's token. - * @param flag, use for lock or unlock flag and so on. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DoAbilityForeground(const sptr &token, uint32_t flag) = 0; - - /** - * Calls this interface to move the ability to the background. - * - * @param token, ability's token. - * @param flag, use for lock or unlock flag and so on. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DoAbilityBackground(const sptr &token, uint32_t flag) = 0; - - /** - * Get mission id by ability token. - * - * @param token The token of ability. - * @return Returns -1 if do not find mission, otherwise return mission id. - */ - virtual int32_t GetMissionIdByToken(const sptr &token) = 0; - - /** - * Get ability token by connect. - * - * @param token The token of ability. - * @param callStub The callee object. - */ - virtual void GetAbilityTokenByCalleeObj(const sptr &callStub, sptr &token) = 0; - - /** - * Called when client complete dump. - * - * @param infos The dump info. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DumpAbilityInfoDone(std::vector &infos, const sptr &callerToken) - { - return 0; - } - - /** - * Call free install from remote. - * - * @param want, the want of the ability to start. - * @param callback, Callback from remote. - * @param userId, Designation User ID. - * @param requestCode Ability request code. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int FreeInstallAbilityFromRemote(const Want &want, const sptr &callback, - int32_t userId, int requestCode = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Add free install observer. - * - * @param callerToken, The caller ability token. - * @param observer, The observer of the ability to free install start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AddFreeInstallObserver(const sptr &callerToken, - const sptr &observer) - { - return 0; - } - - virtual void EnableRecoverAbility(const sptr& token) {}; - virtual void SubmitSaveRecoveryInfo(const sptr& token) {}; - virtual void ScheduleRecoverAbility(const sptr &token, int32_t reason, - const Want *want = nullptr) {}; - - /** - * @brief Schedule clear recovery page stack. - * - * @param bundleName application bundleName. - */ - virtual void ScheduleClearRecoveryPageStack() {}; - - /** - * Called to verify that the MissionId is valid. - * @param missionIds Query mission list. - * @param results Output parameters, return results up to 20 query results. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t IsValidMissionIds( - const std::vector &missionIds, std::vector &results) = 0; - - /** - * Query whether the application of the specified PID and UID has been granted a certain permission - * @param permission - * @param pid Process id - * @param uid - * @return Returns ERR_OK if the current process has the permission, others on failure. - */ - virtual int VerifyPermission(const std::string &permission, int pid, int uid) - { - return 0; - } - - /** - * Request dialog service with want, send want to ability manager service. - * - * @param want, the want of the dialog service to start. - * @param callerToken, caller ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RequestDialogService(const Want &want, const sptr &callerToken) - { - return 0; - } - - /** - * Report drawn completed. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ReportDrawnCompleted(const sptr &callerToken) = 0; - - /** - * Acquire the shared data. - * @param missionId The missionId of Target ability. - * @param shareData The IAcquireShareData object. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t AcquireShareData(const int32_t &missionId, const sptr &shareData) - { - return 0; - } - - /** - * Notify sharing data finished. - * @param token The token of ability. - * @param resultCode The result of sharing data. - * @param uniqueId The uniqueId from request object. - * @param wantParam The params of acquiring sharing data from target ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ShareDataDone(const sptr& token, - const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam) - { - return 0; - } - - /** - * Force app exit and record exit reason. - * @param pid Process id . - * @param exitReason The reason of app exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ForceExitApp(const int32_t pid, const ExitReason &exitReason) - { - return 0; - } - - /** - * Record app exit reason. - * @param exitReason The reason of app exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RecordAppExitReason(const ExitReason &exitReason) - { - return 0; - } - - /** - * Record the process exit reason before the process being killed. - * @param pid The process id. - * @param exitReason The reason of process exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RecordProcessExitReason(const int32_t pid, const ExitReason &exitReason) - { - return 0; - } - - /** - * Record the exit reason of a killed process. - * @param pid The process id. - * @param uid The process uid. - * @param exitReason The reason of process exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RecordProcessExitReason(int32_t pid, int32_t uid, const ExitReason &exitReason) - { - return 0; - } - - /** - * Set rootSceneSession by SCB. - * - * @param rootSceneSession Indicates root scene session of SCB. - */ - virtual void SetRootSceneSession(const sptr &rootSceneSession) {} - - /** - * Call UIAbility by SCB. - * - * @param sessionInfo the session info of the ability to be called. - * @param isColdStart the session of the ability is or not cold start. - */ - virtual void CallUIAbilityBySCB(const sptr &sessionInfo, bool &isColdStart) {} - - /** - * Start specified ability by SCB. - * - * @param want Want information. - */ - virtual void StartSpecifiedAbilityBySCB(const Want &want) {}; - - /** - * Notify sandbox app the result of saving file. - * @param want Result of saving file, which contains the file's uri if success. - * @param resultCode Indicates the action's result. - * @param requestCode Pass the requestCode to match request. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t NotifySaveAsResult(const Want &want, int resultCode, int requestCode) - { - return 0; - } - - /** - * Set sessionManagerService - * @param sessionManagerService the point of sessionManagerService. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetSessionManagerService(const sptr &sessionManagerService) - { - return 0; - } - - /** - * @brief Register collaborator. - * @param type collaborator type. - * @param impl collaborator. - * @return 0 or else. - */ - virtual int32_t RegisterIAbilityManagerCollaborator(int32_t type, const sptr &impl) - { - return 0; - } - - /** - * @brief Unregister collaborator. - * @param type collaborator type. - * @return 0 or else. - */ - virtual int32_t UnregisterIAbilityManagerCollaborator(int32_t type) - { - return 0; - } - - virtual int32_t RegisterStatusBarDelegate(sptr delegate) - { - return 0; - } - - virtual int32_t KillProcessWithPrepareTerminate(const std::vector& pids) - { - return 0; - } - - virtual int32_t KillProcessWithReason(int32_t pid, const ExitReason &reason) - { - return 0; - } - - /** - * @brief Register auto start up callback for system api. - * @param callback The point of JsAbilityAutoStartupCallBack. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RegisterAutoStartupSystemCallback(const sptr &callback) - { - return 0; - } - - /** - * @brief Unregister auto start up callback for system api. - * @param callback The point of JsAbilityAutoStartupCallBack. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UnregisterAutoStartupSystemCallback(const sptr &callback) - { - return 0; - } - - /** - * @brief Set every application auto start up state. - * @param info The auto startup info,include bundle name, module name, ability name. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationAutoStartup(const AutoStartupInfo &info) - { - return 0; - } - - /** - * @brief Cancel every application auto start up . - * @param info The auto startup info,include bundle name, module name, ability name. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t CancelApplicationAutoStartup(const AutoStartupInfo &info) - { - return 0; - } - - /** - * @brief Query auto startup state all application. - * @param infoList Output parameters, return auto startup info list. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryAllAutoStartupApplications(std::vector &infoList) - { - return 0; - } - - /** - * PrepareTerminateAbilityBySCB, prepare to terminate ability by scb. - * - * @param sessionInfo the session info of the ability to start. - * @param isPrepareTerminate the result of ability onPrepareToTerminate - * @return Returns ERR_OK on success, others on failure. - */ - virtual int PrepareTerminateAbilityBySCB(const sptr &sessionInfo, bool &isPrepareTerminate) - { - return 0; - } - - /** - * @brief Register app debug listener. - * @param listener App debug listener. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RegisterAppDebugListener(sptr listener) = 0; - - /** - * @brief Unregister app debug listener. - * @param listener App debug listener. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UnregisterAppDebugListener(sptr listener) = 0; - - /** - * @brief Attach app debug. - * @param bundleName The application bundle name. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t AttachAppDebug(const std::string &bundleName, bool isDebugFromLocal) = 0; - - /** - * @brief Detach app debug. - * @param bundleName The application bundle name. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t DetachAppDebug(const std::string &bundleName, bool isDebugFromLocal) = 0; - - /** - * @brief Execute intent. - * @param key The key of intent executing client. - * @param callerToken Caller ability token. - * @param param The Intent execute param. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ExecuteIntent(uint64_t key, const sptr &callerToken, - const InsightIntentExecuteParam ¶m) = 0; - - /** - * @brief Check if ability controller can start. - * @param want The want of ability to start. - * @return Return true to allow ability to start, or false to reject. - */ - virtual bool IsAbilityControllerStart(const Want &want) - { - return true; - } - - /** - * @brief Called when insight intent execute finished. - * - * @param token ability's token. - * @param intentId insight intent id. - * @param result insight intent execute result. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ExecuteInsightIntentDone(const sptr &token, uint64_t intentId, - const InsightIntentExecuteResult &result) = 0; - - /** - * @brief Set application auto start up state by EDM. - * @param info The auto startup info, include bundle name, module name, ability name. - * @param flag Indicate whether to allow the application to change the auto start up state. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) = 0; - - /** - * @brief Cancel application auto start up state by EDM. - * @param info The auto startup info, include bundle name, module name, ability name. - * @param flag Indicate whether to allow the application to change the auto start up state. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t CancelApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) = 0; - - /** - * @brief Get foreground ui abilities. - * @param list Foreground ui abilities. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t GetForegroundUIAbilities(std::vector &list) = 0; - - /** - * @brief Open file by uri. - * @param uri The file uri. - * @param flag Want::FLAG_AUTH_READ_URI_PERMISSION or Want::FLAG_AUTH_WRITE_URI_PERMISSION. - * @return int The file descriptor. - */ - virtual int32_t OpenFile(const Uri& uri, uint32_t flag) - { - return 0; - } - - /** - * @brief Update session info. - * @param sessionInfos The vector of session info. - */ - virtual int32_t UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, - std::vector &sessionIds) - { - return 0; - } - - /** - * @brief Restart app self. - * @param want The ability type must be UIAbility. - * @param isAppRecovery True indicates that the app is restarted because of recovery. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RestartApp(const AAFwk::Want &want, bool isAppRecovery = false) - { - return 0; - } - - /** - * @brief Get host info of root caller. - * - * @param token The ability token. - * @param hostInfo The host info of root caller. - * @param userId The user id. - * @return int32_t Returns 0 on success, others on failure. - */ - virtual int32_t GetUIExtensionRootHostInfo(const sptr token, UIExtensionHostInfo &hostInfo, - int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * @brief Get ui extension session info - * - * @param token The ability token. - * @param uiExtensionSessionInfo The ui extension session info. - * @param userId The user id. - * @return int32_t Returns ERR_OK on success, others on failure. - */ - virtual int32_t GetUIExtensionSessionInfo(const sptr token, - UIExtensionSessionInfo &uiExtensionSessionInfo, int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Open link of ability and atomic service. - * - * @param want Ability want. - * @param callerToken Caller ability token. - * @param userId User ID. - * @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) - { - return 0; - } - - /** - * @brief Pop-up launch of full-screen atomic service. - * @param want The want with parameters. - * @param callerToken caller ability token. - * @param requestCode Ability request code. - * @param userId The User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t OpenAtomicService(Want& want, const StartOptions &options, sptr callerToken, - int32_t requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /* - * Set the enable status for starting and stopping resident processes. - * The caller application can only set the resident status of the configured process. - * @param bundleName The bundle name of the resident process. - * @param enable Set resident process enable status. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetResidentProcessEnabled(const std::string &bundleName, bool enable) - { - return 0; - } - - /** - * @brief Querying whether to allow embedded startup of atomic service. - * - * @param token The caller UIAbility token. - * @param appId The ID of the application to which this bundle belongs. - * @return Returns true to allow ability to start, or false to reject. - */ - virtual bool IsEmbeddedOpenAllowed(sptr callerToken, const std::string &appId) - { - return true; - } - - /** - * @brief Request to display assert fault dialog. - * @param callback Listen for user operation callbacks. - * @param wantParams Assert dialog box display information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RequestAssertFaultDialog(const sptr &callback, const AAFwk::WantParams &wantParams) - { - return -1; - } - - /** - * @brief Notify the operation status of the user. - * @param assertFaultSessionId Indicates the request ID of AssertFault. - * @param userStatus Operation status of the user. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t NotifyDebugAssertResult(uint64_t assertFaultSessionId, AAFwk::UserStatus userStatus) - { - return -1; - } - - /** - * Starts a new ability with specific start options. - * - * @param want, the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t StartShortcut(const Want &want, const StartOptions &startOptions) - { - return 0; - } - - /** - * Get ability state by persistent id. - * - * @param persistentId, the persistentId of the session. - * @param state Indicates the ability state. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t GetAbilityStateByPersistentId(int32_t persistentId, bool &state) - { - return 0; - } - - /** - * Transfer resultCode & want to ability manager service. - * - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t TransferAbilityResultForExtension(const sptr &callerToken, int32_t resultCode, - const Want &want) - { - return 0; - } - - /** - * Notify ability manager service frozen process. - * - * @param pidList, the pid list of the frozen process. - * @param uid, the uid of the frozen process. - */ - virtual void NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) - { - return; - } - - /** - * Request to clean UIAbility from user. - * - * @param sessionInfo the session info of the ability to clean. - * @param sceneFlag the reason info of the ability to terminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t CleanUIAbilityBySCB(const sptr &sessionInfo, bool isUserRequestedExit, - uint32_t sceneFlag = 0) - { - return 0; - } - - /** - * Open atomic service window prior to finishing free install. - * - * @param bundleName, the bundle name of the atomic service. - * @param moduleName, the module name of the atomic service. - * @param abilityName, the ability name of the atomic service. - * @param startTime, the starting time of the free install task. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t PreStartMission(const std::string& bundleName, const std::string& moduleName, - const std::string& abilityName, const std::string& startTime) - { - return 0; - } - - /** - * Terminate the mission. - * - * @param missionId, The mission id of the UIAbility need to be terminated. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t TerminateMission(int32_t missionId) - { - return 0; - } - - /** - * Notify ability manager to set the flag to block all apps from starting. - * Needs to apply for ohos.permission.BLOCK_ALL_APP_START. - * @param flag, The flag to block all apps from starting - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t BlockAllAppStart(bool flag) - { - return 0; - } - - /** - * update associate config list by rss. - * - * @param configs The rss config info. - * @param exportConfigs The rss export config info. - * @param flag UPDATE_CONFIG_FLAG_COVER is cover config, UPDATE_CONFIG_FLAG_APPEND is append config. - */ - virtual int32_t UpdateAssociateConfigList(const std::map>& configs, - const std::list& exportConfigs, int32_t flag) - { - return 0; - } - - /** - * Set keep-alive flag for application under a specific user. - * @param bundleName Bundle name. - * @param userId User Id. - * @param flag Keep-alive flag. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationKeepAlive(const std::string &bundleName, int32_t userId, bool flag) - { - return 0; - } - - /** - * Get keep-alive applications. - * @param appType Application type. - * @param userId User Id. - * @param list List of Keep-alive information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryKeepAliveApplications(int32_t appType, int32_t userId, std::vector &list) - { - return 0; - } - - /** - * Set keep-alive flag for application under a specific user by EDM. - * @param bundleName Bundle name. - * @param userId User Id. - * @param flag Keep-alive flag. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationKeepAliveByEDM(const std::string &bundleName, int32_t userId, bool flag) - { - return 0; - } - - /** - * Get keep-alive applications by EDM. - * @param appType Application type. - * @param userId User Id. - * @param list List of Keep-alive information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryKeepAliveApplicationsByEDM(int32_t appType, int32_t userId, std::vector &list) - { - return 0; - } - - virtual int32_t GetAllIntentExemptionInfo(std::vector &info) - { - return 0; - } - - /** - * Add query ERMS observer. - * - * @param callerToken, The caller ability token. - * @param observer, The observer of the ability to query ERMS. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t AddQueryERMSObserver(sptr callerToken, - sptr observer) - { - return 0; - } - - /** - * Query atomic service ERMS rule. - * - * @param callerToken, The caller ability token. - * @param appId, The appId of the atomic service. - * @param startTime, The startTime of the query. - * @param rule, The returned ERMS rule. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryAtomicServiceStartupRule(sptr callerToken, - const std::string &appId, const std::string &startTime, AtomicServiceStartupRule &rule) - { - return 0; - } - - /** - * PrepareTerminateAbilityDone, called when PrepareTerminateAbility call is done. - * - * @param token, the token of the ability to terminate. - * @param isTerminate, indicates whether the ability should be terminated. - */ - virtual void PrepareTerminateAbilityDone(const sptr &token, bool isTerminate) - {} - - /** - * KillProcessWithPrepareTerminateDone, called when KillProcessWithPrepareTerminate call is done. - * - * @param moduleName, the module name of the application. - * @param prepareTermination, the result of prepareTermination call of the module. - * @param isExist, whether the prepareTerminate functions are implemented. - */ - virtual void KillProcessWithPrepareTerminateDone(const std::string &moduleName, - int32_t prepareTermination, bool isExist) - {} - - /** - * KillProcessForPermissionUpdate, call KillProcessForPermissionUpdate() through proxy object, - * force kill the application by accessTokenId, notify exception to SCB. - * - * @param accessTokenId, accessTokenId. - * @return ERR_OK, return back success, others fail. - */ - virtual int32_t KillProcessForPermissionUpdate(uint32_t accessTokenId) - { - return 0; - } - - /** - * Register hidden start observer. - * @param observer, ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RegisterHiddenStartObserver(const sptr &observer) - { - return 0; - } - - /** - * Unregister hidden start observer. - * @param observer, ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UnregisterHiddenStartObserver(const sptr &observer) - { - return 0; - } - /** - * Query preload uiextension record. - * - * @param element, The uiextension ElementName. - * @param moduleName, The uiextension moduleName. - * @param hostBundleName, The uiextension caller hostBundleName. - * @param recordNum, The returned count of uiextension. - * @param userId, The User Id. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryPreLoadUIExtensionRecord(const AppExecFwk::ElementName &element, - const std::string &moduleName, - const std::string &hostBundleName, - int32_t &recordNum, - int32_t userId = DEFAULT_INVAL_VALUE) - { - return 0; - } - - /** - * Revoke delegator. - * - * @param token, ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RevokeDelegator(sptr token) - { - return 0; - } -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H +} +} +#endif // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H +// /* +// * Copyright (c) 2023-2025 Huawei Device Co., Ltd. +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ + +// #ifndef OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H +// #define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H + +// #include +// #include +// #include +// #include + +// #include "ability_connect_callback_interface.h" +// #include "ability_manager_ipc_interface_code.h" +// #include "ability_running_info.h" +// #include "ability_scheduler_interface.h" +// #include "ability_start_setting.h" +// #include "ability_state.h" +// #include "ability_state_data.h" +// #include "app_debug_listener_interface.h" +// #include "auto_startup_info.h" +// #include "dms_continueInfo.h" +// #include "exit_reason.h" +// #include "extension_running_info.h" +// #include "free_install_observer_interface.h" +// #include "iability_controller.h" +// #include "iability_manager_collaborator.h" +// #include "iacquire_share_data_callback_interface.h" +// #include "insight_intent/insight_intent_execute_param.h" +// #include "insight_intent/insight_intent_execute_result.h" +// #include "iprepare_terminate_callback_interface.h" +// #include "keep_alive_info.h" +// #include "mission_info.h" +// #include "query_erms_observer_interface.h" +// #include "remote_mission_listener_interface.h" +// #include "remote_on_listener_interface.h" +// #include "running_process_info.h" +// #include "sender_info.h" +// #include "start_options.h" +// #include "user_callback.h" +// #include "system_memory_attr.h" +// #include "ui_extension/ui_extension_ability_connect_info.h" +// #include "ui_extension/ui_extension_host_info.h" +// #include "ui_extension/ui_extension_session_info.h" +// #include "ui_extension_window_command.h" +// #include "uri.h" +// #include "want.h" +// #include "want_receiver_interface.h" +// #include "want_sender_info.h" +// #include "want_sender_interface.h" +// #include "dialog_session_info.h" +// #include "window_config.h" +// #include "intent_exemption_info.h" + + // /** + // * StartSelfUIAbility with want, start self uiability only on 2-in-1 devices. + // * + // * @param want, the want of the ability to start. + // * @return Returns ERR_OK on success, others on failure. + // */ + // virtual int StartSelfUIAbility(const Want &want) + // { + // return 0; + // } + +// #include "ihidden_start_observer.h" + +// namespace OHOS { +// namespace AbilityRuntime { +// class IStatusBarDelegate; +// } + +// namespace AAFwk { +// class Snapshot; +// class IMissionListener; +// class ISnapshotHandler; +// struct MissionSnapshot; +// using KeepAliveInfo = AbilityRuntime::KeepAliveInfo; +// using AutoStartupInfo = AbilityRuntime::AutoStartupInfo; +// using InsightIntentExecuteParam = AppExecFwk::InsightIntentExecuteParam; +// using InsightIntentExecuteResult = AppExecFwk::InsightIntentExecuteResult; +// using UIExtensionAbilityConnectInfo = AbilityRuntime::UIExtensionAbilityConnectInfo; +// using UIExtensionHostInfo = AbilityRuntime::UIExtensionHostInfo; +// using UIExtensionSessionInfo = AbilityRuntime::UIExtensionSessionInfo; +// #ifdef SUPPORT_SCREEN +// using IAbilityFirstFrameStateObserver = AppExecFwk::IAbilityFirstFrameStateObserver; +// #endif +// using AtomicServiceStartupRule = AbilityRuntime::AtomicServiceStartupRule; + +// constexpr const char* ABILITY_MANAGER_SERVICE_NAME = "AbilityManagerService"; +// const int DEFAULT_INVAL_VALUE = -1; +// const int DELAY_LOCAL_FREE_INSTALL_TIMEOUT = 40000; +// const int DELAY_REMOTE_FREE_INSTALL_TIMEOUT = 30000 + DELAY_LOCAL_FREE_INSTALL_TIMEOUT; +// constexpr const char* FROM_REMOTE_KEY = "freeInstallFromRemote"; +// /** +// * @class IAbilityManager +// * IAbilityManager interface is used to access ability manager services. +// */ +// class IAbilityManager : public OHOS::IRemoteBroker { +// public: +// DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.AbilityManager") + +// /** +// * StartSelfUIAbility with want, start self uiability only on 2-in-1 devices. +// * +// * @param want, the want of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartSelfUIAbility(const Want &want) +// { +// return 0; +// } + +// /** +// * StartSelfUIAbility with want and startOptions, start self uiability only on 2-in-1 devices. +// * +// * @param want, the want of the ability to start. +// * @param options, the startOptions of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartSelfUIAbilityWithStartOptions(const Want &want, const StartOptions &options) //生成一个writeToken +// { +// return 0; +// } + +// /** +// * StartAbility with want, send want to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param userId, Designation User ID. +// * @param requestCode, Ability request code. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbility( +// const Want &want, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE) = 0; + +// /** +// * StartAbility with want, send want to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param callerToken, caller ability token. +// * @param userId, Designation User ID. +// * @param requestCode, Ability request code. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbility( +// const Want &want, +// const sptr &callerToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE) = 0; + +// /** +// * StartAbilityWithSpecifyTokenId with want and specialId, send want to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param callerToken, caller ability token. +// * @param specialId the caller Id. +// * @param userId, Designation User ID. +// * @param requestCode, Ability request code. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityWithSpecifyTokenId( +// const Want &want, +// const sptr &callerToken, +// uint32_t specifyTokenId, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE) = 0; + +// /** +// * StartAbility by insight intent, send want to ability manager service. +// * +// * @param want Ability want. +// * @param callerToken caller ability token. +// * @param intentId insight intent id. +// * @param userId userId of target ability. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t StartAbilityByInsightIntent( +// const Want &want, +// const sptr &callerToken, +// uint64_t intentId, +// int32_t userId = DEFAULT_INVAL_VALUE) = 0; + +// /** +// * Starts a new ability with specific start settings. +// * +// * @param want Indicates the ability to start. +// * @param requestCode the resultCode of the ability to start. +// * @param abilityStartSetting Indicates the setting ability used to start. +// * @param userId, Designation User ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbility( +// const Want &want, +// const AbilityStartSetting &abilityStartSetting, +// const sptr &callerToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE) = 0; + +// /** +// * Starts a new ability with specific start options. +// * +// * @param want, the want of the ability to start. +// * @param startOptions Indicates the options used to start. +// * @param callerToken, caller ability token. +// * @param userId, Designation User ID. +// * @param requestCode the resultCode of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbility( +// const Want &want, +// const StartOptions &startOptions, +// const sptr &callerToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE) = 0; ///生成SendRequest 发送命令 + + +// /** +// * Starts a new ability using the original caller information.m +// * +// * @param want the want of the ability to start. +// * @param callerToken caller ability token. +// * @param asCallerSourceToken source caller ability token. +// * @param userId Designation User ID. +// * @param requestCode the resultCode of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityAsCaller( +// const Want &want, +// const sptr &callerToken, +// sptr asCallerSourceToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE)/////////生成CPP不太一样 +// { +// return 0; +// } + +// /** +// * Starts a new ability using the original caller information. +// * +// * @param want the want of the ability to start. +// * @param startOptions Indicates the options used to start. +// * @param callerToken caller ability token. +// * @param asCallerSourceToken source caller ability token. +// * @param userId Designation User ID. +// * @param requestCode the resultCode of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityAsCaller( +// const Want &want, +// const StartOptions &startOptions, +// const sptr &callerToken, +// sptr asCallerSourceToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE)////同上 +// { +// return 0; +// } + +// /** +// * Starts a new ability for result using the original caller information. +// * +// * @param want the want of the ability to start. +// * @param callerToken current caller ability token. +// * @param requestCode the resultCode of the ability to start. +// * @param userId Designation User ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityForResultAsCaller( +// const Want &want, +// const sptr &callerToken, +// int requestCode = DEFAULT_INVAL_VALUE, +// int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// }////// + +// /** +// * Starts a new ability for result using the original caller information. +// * +// * @param want the want of the ability to start. +// * @param startOptions Indicates the options used to start. +// * @param callerToken current caller ability token. +// * @param requestCode the resultCode of the ability to start. +// * @param userId Designation User ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityForResultAsCaller( +// const Want &want, +// const StartOptions &startOptions, +// const sptr &callerToken, +// int requestCode = DEFAULT_INVAL_VALUE, +// int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// } + +// /** +// * Start ui session ability with extension session info, send session info to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param callerToken, caller ability token. +// * @param sessionInfo the information of UIExtensionContentSession. +// * @param userId, Designation User ID. +// * @param requestCode, Ability request code. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityByUIContentSession( +// const Want &want, +// const sptr &callerToken, +// const sptr &sessionInfo, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE)////涉及datawriteflag +// { +// return 0; +// } + +// /** +// * Start ui session ability with extension session info, send session info to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param startOptions Indicates the options used to start. +// * @param callerToken, caller ability token. +// * @param sessionInfo the information of UIExtensionContentSession. +// * @param userId, Designation User ID. +// * @param requestCode the resultCode of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityByUIContentSession( +// const Want &want, +// const StartOptions &startOptions, +// const sptr &callerToken, +// const sptr &sessionInfo, +// int32_t userId = DEFAULT_INVAL_VALUE, +// int requestCode = DEFAULT_INVAL_VALUE)///同上 +// { +// return 0; +// } + +// /** +// * Start ui ability +// * +// * @param want the want of the ability to start. +// * @param callerToken caller ability token. +// * @param specifyTokenId The Caller ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityOnlyUIAbility( +// const Want &want, +// const sptr &callerToken, +// uint32_t specifyTokenId) +// { +// return 0; +// } + +// /** +// * Start extension ability with want, send want to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param callerToken, caller ability token. +// * @param userId, Designation User ID. +// * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be started. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t StartExtensionAbility( +// const Want &want, +// const sptr &callerToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) +// { +// return 0; +// } + +// /** +// * Create UIExtension with want, send want to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int RequestModalUIExtension(const Want &want) +// { +// return 0; +// } + +// /** +// * Preload UIExtension with want, send want to ability manager service. +// * +// * @param want, the want of the ability to start. +// * @param hostBundleName, the caller application bundle name. +// * @param userId, the extension runs in. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int PreloadUIExtensionAbility(const Want &want, std::string &hostBundleName, +// int32_t userId = DEFAULT_INVAL_VALUE, int32_t hostPid = DEFAULT_INVAL_VALUE)/////确认下 用in +// { +// return 0; +// } + +// virtual int ChangeAbilityVisibility(sptr token, bool isShow) +// { +// return 0; +// } + +// virtual int ChangeUIAbilityVisibilityBySCB(sptr sessionInfo, bool isShow) +// { +// return 0; +// } + +// /** +// * Start ui extension ability with extension session info, send extension session info to ability manager service. +// * +// * @param extensionSessionInfo the extension session info of the ability to start. +// * @param userId, Designation User ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartUIExtensionAbility( +// const sptr &extensionSessionInfo, +// int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// } + +// /** +// * Start ui ability with want, send want to ability manager service. +// * +// * @param sessionInfo the session info of the ability to start. +// * @param isColdStart the session info of the ability is or not cold start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartUIAbilityBySCB(sptr sessionInfo, bool &isColdStart, uint32_t sceneFlag = 0) +// { +// return 0; +// } + +// /** +// * Stop extension ability with want, send want to ability manager service. +// * +// * @param want, the want of the ability to stop. +// * @param callerToken, caller ability token. +// * @param userId, Designation User ID. +// * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be stopped. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StopExtensionAbility( +// const Want& want, +// const sptr& callerToken, +// int32_t userId = DEFAULT_INVAL_VALUE, +// AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) +// { +// return 0; +// } + +// virtual int GetAppMemorySize() +// { +// return 0; +// } + +// virtual bool IsRamConstrainedDevice()////////////生成的cpp和原来的cpp不太一样 +// { +// return false; +// } + +// virtual AppExecFwk::ElementName GetTopAbility(bool isNeedLocalDeviceId = true)/////自动生成的和原来的不太一样 +// { +// return {}; +// } + +// virtual AppExecFwk::ElementName GetElementNameByToken(sptr token, +// bool isNeedLocalDeviceId = true) +// { +// return {}; +// } + +// /** +// * TerminateAbility, terminate the special ability. +// * +// * @param token, the token of the ability to terminate. +// * @param resultCode, the resultCode of the ability to terminate. +// * @param resultWant, the Want of the ability to return. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int TerminateAbility( +// const sptr &token, int resultCode, const Want *resultWant = nullptr) = 0;////实现和cpp不同 + +// /** +// * BackToCallerAbilityWithResult, return to the caller ability. +// * +// * @param token, the token of the ability to terminate. +// * @param resultCode, the resultCode of the ability to terminate. +// * @param resultWant, the Want of the ability to return. +// * @param callerRequestCode, the requestCode of caller ability.· +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int BackToCallerAbilityWithResult(const sptr &token, int resultCode, +// const Want *resultWant, int64_t callerRequestCode) +// { +// return 0; +// }; + +// /** +// * TerminateUIServiceExtensionAbility, terminate the UIServiceExtensionAbility. +// * +// * @param token, the token of the ability to terminate. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t TerminateUIServiceExtensionAbility(const sptr &token) +// { +// return 0; +// } + +// /** +// * TerminateUIExtensionAbility, terminate the special ui extension ability. +// * +// * @param extensionSessionInfo the extension session info of the ability to terminate. +// * @param resultCode, the resultCode of the ui extension ability to terminate. +// * @param resultWant, the Want of the ui extension ability to return. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int TerminateUIExtensionAbility(const sptr &extensionSessionInfo, +// int resultCode, const Want *resultWant = nullptr) +// { +// return 0; +// } + +// /** +// * CloseUIExtensionAbilityBySCB, terminate the specified ui extension ability by SCB. +// * +// * @param token the ability token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int CloseUIExtensionAbilityBySCB(const sptr token) +// { +// return 0; +// } + +// /** +// * CloseUIAbilityBySCB, close the special ability by scb. +// * +// * @param sessionInfo the session info of the ability to terminate. +// * @param sceneFlag the reason info of the ability to terminate. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int CloseUIAbilityBySCB(const sptr &sessionInfo, bool isUserRequestedExit, +// uint32_t sceneFlag = 0) +// { +// return 0; +// } + +// /** +// * SendResultToAbility, send the result to ability. +// * +// * @param requestCode, the requestCode of the ability to terminate. +// * @param resultCode, the resultCode of the ability to terminate. +// * @param resultWant, the Want of the ability to return. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int SendResultToAbility(int requestCode, int resultCode, Want &resultWant) +// { +// return 0; +// } + +// /** +// * MoveAbilityToBackground. +// * +// * @param token, the token of the ability to move. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MoveAbilityToBackground(const sptr &token) +// { +// return 0; +// }; + +// /** +// * Move the UIAbility to background, called by app self. +// * +// * @param token the token of the ability to move. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t MoveUIAbilityToBackground(const sptr token) +// { +// return 0; +// }; + +// /** +// * CloseAbility, close the special ability. +// * +// * @param token, the token of the ability to terminate. +// * @param resultCode, the resultCode of the ability to terminate. +// * @param resultWant, the Want of the ability to return. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int CloseAbility(const sptr &token, int resultCode = DEFAULT_INVAL_VALUE, +// const Want *resultWant = nullptr) = 0; + +// /** +// * MinimizeAbility, minimize the special ability. +// * +// * @param token, the token of the ability to minimize. +// * @param fromUser mark the minimize operation source. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MinimizeAbility(const sptr &token, bool fromUser = false) = 0; + +// /** +// * MinimizeUIExtensionAbility, minimize the special ui extension ability. +// * +// * @param extensionSessionInfo the extension session info of the ability to minimize. +// * @param fromUser mark the minimize operation source. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MinimizeUIExtensionAbility(const sptr &extensionSessionInfo, +// bool fromUser = false) +// { +// return 0; +// }; + +// /** +// * MinimizeUIAbilityBySCB, minimize the special ui ability by scb. +// * +// * @param sessionInfo the session info of the ability to minimize. +// * @param fromUser, Whether form user. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MinimizeUIAbilityBySCB(const sptr &sessionInfo, bool fromUser = false, +// uint32_t sceneFlag = 0) +// { +// return 0; +// }; + +// /** +// * ConnectAbility, connect session with service ability. +// * +// * @param want, Special want for service type's ability. +// * @param connect, Callback used to notify caller the result of connecting or disconnecting. +// * @param callerToken, caller ability token. +// * @param userId, Designation User ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ConnectAbility( +// const Want &want, +// const sptr &connect, +// const sptr &callerToken, +// int32_t userId = DEFAULT_INVAL_VALUE) = 0; ////实现不一样 + +// /** +// * Connect ability common method. +// * +// * @param want, special want for service type's ability. +// * @param connect, callback used to notify caller the result of connecting or disconnecting. +// * @param callerToken, caller ability token. +// * @param extensionType, type of the extension. +// * @param userId, the service user ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ConnectAbilityCommon( +// const Want &want, +// const sptr &connect, +// const sptr &callerToken, +// AppExecFwk::ExtensionAbilityType extensionType, +// int32_t userId = DEFAULT_INVAL_VALUE, +// bool isQueryExtensionOnly = false) +// { +// return 0; +// } + +// /** +// * Connect ui extension ability. +// * +// * @param want, special want for the ui extension ability. +// * @param connect, callback used to notify caller the result of connecting or disconnecting. +// * @param sessionInfo the extension session info of the ability to connect. +// * @param userId, the extension runs in. +// * @param connectInfo the connect info. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int ConnectUIExtensionAbility(const Want &want, const sptr &connect, +// const sptr &sessionInfo, int32_t userId = DEFAULT_INVAL_VALUE, +// sptr connectInfo = nullptr) +// { +// return 0; +// } + +// /** +// * DisconnectAbility, disconnect session with service ability. +// * +// * @param connect, Callback used to notify caller the result of connecting or disconnecting. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int DisconnectAbility(sptr connect) = 0; + +// /** +// * AcquireDataAbility, acquire a data ability by its authority, if it not existed, +// * AMS loads it synchronously. +// * +// * @param authority, a string to identify a data ability, decoded from uri. +// * @param tryBind, true: when a data ability is died, ams will kill this client, or do nothing. +// * @param callerToken, specifies the caller ability token. +// * @return returns the data ability ipc object, or nullptr for failed. +// */ +// virtual sptr AcquireDataAbility( +// const Uri &uri, bool tryBind, const sptr &callerToken) = 0; + +// /** +// * ReleaseDataAbility, release the data ability that referenced by 'dataAbilityToken'. +// * +// * @param dataAbilityScheduler, specifies the data ability that will be released. +// * @param callerToken, specifies the caller ability token. +// * @return returns ERR_OK if succeeded, or error codes for failed. +// */ +// virtual int ReleaseDataAbility( +// sptr dataAbilityScheduler, const sptr &callerToken) = 0; + +// /** +// * AttachAbilityThread, ability call this interface after loaded. +// * +// * @param scheduler,.the interface handler of kit ability. +// * @param token,.ability's token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int AttachAbilityThread(const sptr &scheduler, const sptr &token) = 0; + +// /** +// * AbilityTransitionDone, ability call this interface after life cycle was changed. +// * +// * @param token,.ability's token. +// * @param state,.the state of ability life cycle. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int AbilityTransitionDone(const sptr &token, int state, const PacMap &saveData) = 0; + +// /** +// * AbilityWindowConfigTransitionDone, ability call this interface after life cycle was changed. +// * +// * @param token,.ability's token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int AbilityWindowConfigTransitionDone( +// const sptr &token, const WindowConfig &windowConfig) +// { +// return 0; +// } + +// /** +// * ScheduleConnectAbilityDone, service ability call this interface while session was connected. +// * +// * @param token,.service ability's token. +// * @param remoteObject,.the session proxy of service ability. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int ScheduleConnectAbilityDone( +// const sptr &token, const sptr &remoteObject) = 0; + +// /** +// * ScheduleDisconnectAbilityDone, service ability call this interface while session was disconnected. +// * +// * @param token,.service ability's token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int ScheduleDisconnectAbilityDone(const sptr &token) = 0; + +// /** +// * ScheduleCommandAbilityDone, service ability call this interface while session was commanded. +// * +// * @param token,.service ability's token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int ScheduleCommandAbilityDone(const sptr &token) = 0; + +// virtual int ScheduleCommandAbilityWindowDone( +// const sptr &token, +// const sptr &sessionInfo, +// AAFwk::WindowCommand winCmd, +// AAFwk::AbilityCommand abilityCmd) = 0; + +// /** +// * dump ability stack info, about userID, mission stack info, +// * mission record info and ability info. +// * +// * @param state Ability stack info. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual void DumpState(const std::string &args, std::vector &state) = 0; +// virtual void DumpSysState( +// const std::string& args, std::vector& state, bool isClient, bool isUserID, int UserID) = 0; + +// /** +// * Destroys this Service ability by Want. +// * +// * @param want, Special want for service type's ability. +// * @param token ability's token. +// * @return Returns true if this Service ability will be destroyed; returns false otherwise. +// */ +// virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE, +// const sptr &token = nullptr) = 0; + +// /** +// * Kill the process immediately. +// * +// * @param bundleName. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int KillProcess(const std::string &bundleName, bool clearPageStack = false, int32_t appIndex = 0) = 0; + +// #ifdef ABILITY_COMMAND_FOR_TEST +// /** +// * force timeout ability. +// * +// * @param abilityName. +// * @param state. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int ForceTimeoutForTest(const std::string &abilityName, const std::string &state) = 0;////////ifdef +// #endif + +// /** +// * Uninstall app +// * +// * @param bundleName bundle name of uninstalling app. +// * @param uid uid of bundle. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int UninstallApp(const std::string &bundleName, int32_t uid)//////调用其他函数 +// { +// return 0; +// } + +// /** +// * Uninstall app +// * +// * @param bundleName bundle name of uninstalling app. +// * @param uid uid of bundle. +// * @param appIndex the app index of app clone. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t UninstallApp(const std::string &bundleName, int32_t uid, int32_t appIndex) +// { +// return 0; +// } + +// /** +// * Upgrade app, record exit reason and kill application +// * +// * @param bundleName bundle name of upgrading app. +// * @param uid uid of bundle. +// * @param exitMsg the exit reason message. +// * @param appIndex the app index of app clone. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t UpgradeApp(const std::string &bundleName, const int32_t uid, const std::string &exitMsg, +// int32_t appIndex = 0) +// { +// return 0; +// } + +// virtual sptr GetWantSender( +// const WantSenderInfo &wantSenderInfo, const sptr &callerToken, int32_t uid = -1) = 0;//// + +// virtual int SendWantSender(sptr target, const SenderInfo &senderInfo) = 0; ////需要获取abms, + +// virtual void CancelWantSender(const sptr &sender) = 0;//.有的传引用 有的传临时变量 + +// virtual int GetPendingWantUid(const sptr &target) = 0; + +// virtual int GetPendingWantUserId(const sptr &target) = 0; + +// virtual std::string GetPendingWantBundleName(const sptr &target) = 0; + +// virtual int GetPendingWantCode(const sptr &target) = 0; + +// virtual int GetPendingWantType(const sptr &target) = 0; + +// virtual void RegisterCancelListener(const sptr &sender, const sptr &receiver) = 0; + +// virtual void UnregisterCancelListener(const sptr &sender, const sptr &receiver) = 0; + +// virtual int GetPendingRequestWant(const sptr &target, std::shared_ptr &want) = 0;//////对应shared_ptr + +// virtual int GetWantSenderInfo(const sptr &target, std::shared_ptr &info) = 0;///// + +// virtual int ContinueMission(const std::string &srcDeviceId, const std::string &dstDeviceId, int32_t missionId, +// const sptr &callBack, AAFwk::WantParams &wantParams) = 0; + +// virtual int ContinueMission(AAFwk::ContinueMissionInfo continueMissionInfo, const sptr &callback) +// { +// return 0; +// }///////////////不可序列化 + +// virtual int ContinueAbility(const std::string &deviceId, int32_t missionId, uint32_t versionCode) = 0; + +// virtual int StartContinuation(const Want &want, const sptr &abilityToken, int32_t status) = 0; + +// virtual void NotifyCompleteContinuation(const std::string &deviceId, int32_t sessionId, bool isSuccess) = 0; + +// virtual int NotifyContinuationResult(int32_t missionId, int32_t result) = 0; + +// virtual int LockMissionForCleanup(int32_t missionId) = 0; + +// virtual int UnlockMissionForCleanup(int32_t missionId) = 0; + +// virtual void SetLockedState(int32_t sessionId, bool lockedState)///async +// { +// return; +// } + +// /** +// * @brief Register mission listener to ability mgr. +// * @param listener The handler of listener. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int RegisterMissionListener(const sptr &listener) = 0; + +// /** +// * @brief UnRegister mission listener from ability mgr. +// * @param listener The handler of listener. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int UnRegisterMissionListener(const sptr &listener) = 0; + +// /** +// * @brief Get mission infos from ability mgr. +// * @param deviceId local or remote deviceId. +// * @param numMax max number of missions. +// * @param missionInfos mission info result. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetMissionInfos( +// const std::string &deviceId, int32_t numMax, std::vector &missionInfos) = 0; + +// /** +// * @brief Get mission info by id. +// * @param deviceId local or remote deviceId. +// * @param missionId Id of target mission. +// * @param missionInfo mission info of target mission. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetMissionInfo(const std::string &deviceId, int32_t missionId, MissionInfo &missionInfo) = 0; + +// /** +// * @brief Get the Mission Snapshot Info object +// * @param deviceId local or remote deviceId. +// * @param missionId Id of target mission. +// * @param snapshot snapshot of target mission. +// * @param isLowResolution get low resolution snapshot. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetMissionSnapshot(const std::string& deviceId, int32_t missionId, +// MissionSnapshot& snapshot, bool isLowResolution) = 0;///////不清楚MissionSnapshot是否可以序列化 + +// /** +// * @brief Clean mission by id. +// * @param missionId Id of target mission. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int CleanMission(int32_t missionId) = 0; + +// /** +// * @brief Clean all missions in system. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int CleanAllMissions() = 0;////// 含有日志 + +// virtual int MoveMissionToFront(int32_t missionId) = 0; + +// /** +// * @brief Move a mission to front. +// * @param missionId Id of target mission. +// * @param startOptions Special startOptions for target mission. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MoveMissionToFront(int32_t missionId, const StartOptions &startOptions) = 0; + +// /** +// * Move missions to front +// * @param missionIds Ids of target missions +// * @param topMissionId Indicate which mission will be moved to top, if set to -1, missions' order won't change +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MoveMissionsToForeground(const std::vector& missionIds, int32_t topMissionId) +// { +// return 0; +// } + +// /** +// * Move missions to background +// * @param missionIds Ids of target missions +// * @param result The result of move missions to background, and the array is sorted by zOrder +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int MoveMissionsToBackground(const std::vector& missionIds, std::vector& result) +// { +// return 0; +// } + +// /** +// * @brief Register session handler. +// * @param object The handler. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int RegisterSessionHandler(const sptr &object) +// { +// return 0; +// } + +// /** +// * Start Ability, connect session with common ability. +// * +// * @param want, Special want for service type's ability. +// * @param connect, Callback used to notify caller the result of connecting or disconnecting. +// * @param accountId Indicates the account to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartAbilityByCall(const Want &want, const sptr &connect, +// const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) = 0;/////////调用其他的 + +// virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, +// const sptr &callerToken, int32_t accountId, std::string &errMsg) +// { +// return 0; +// }; + +// /** +// * CallRequestDone, after invoke callRequest, ability will call this interface to return callee. +// * +// * @param token, ability's token. +// * @param callStub, ability's callee. +// */ +// virtual void CallRequestDone(const sptr &token, const sptr &callStub) {}; + +// /** +// * Release the call between Ability, disconnect session with common ability. +// * +// * @param connect, Callback used to notify caller the result of connecting or disconnecting. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int ReleaseCall(const sptr &connect, const AppExecFwk::ElementName &element) = 0; + +// /** +// * @brief start user. +// * @param accountId accountId. +// * @param isAppRecovery is appRecovery or not. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartUser(int userId, sptr callback, bool isAppRecovery = false) = 0;///变量名 + +// /** +// * @brief stop user. +// * @param accountId accountId. +// * @param callback callback. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StopUser(int userId, const sptr &callback) = 0;//// + +// /** +// * @brief logout user. +// * @param accountId accountId. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int LogoutUser(int32_t userId, sptr callback = nullptr)//// +// { +// return 0; +// } + +// virtual int SetMissionContinueState(const sptr &token, const AAFwk::ContinueState &state)/////枚举 需要自己创建 +// { +// return 0; +// }; + +// #ifdef SUPPORT_SCREEN +// virtual int SetMissionLabel(const sptr &abilityToken, const std::string &label) = 0;///变量名不同 + +// virtual int SetMissionIcon(const sptr &token, +// const std::shared_ptr &icon) = 0;////特殊类型 不可序列化 + +// /** +// * Called to update mission snapshot. +// * @param token The target ability. +// * @param pixelMap The snapshot. +// */ +// virtual void UpdateMissionSnapShot(const sptr &token, +// const std::shared_ptr &pixelMap) {};////特殊类型 不可序列化 + +// /** +// * Register the WindowManagerService handler +// * +// * @param handler Indicate handler of WindowManagerService. +// * @return ErrCode Returns ERR_OK on success, others on failure. +// */ +// virtual int RegisterWindowManagerServiceHandler(const sptr& handler, +// bool animationEnabled) +// { +// return 0; +// } + +// /** +// * WindowManager notification AbilityManager after the first frame is drawn. +// * +// * @param abilityToken Indicate token of ability. +// */ +// virtual void CompleteFirstFrameDrawing(const sptr &abilityToken) = 0;////void类型 + +// /** +// * WindowManager notification AbilityManager after the first frame is drawn. +// * +// * @param sessionId Indicate session id. +// */ +// virtual void CompleteFirstFrameDrawing(int32_t sessionId) +// {} + +// /** +// * PrepareTerminateAbility, prepare terminate the special ability. +// * +// * @param token, the token of the ability to terminate. +// * @param callback callback. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int PrepareTerminateAbility(const sptr &token, sptr &callback) +// { +// return 0; +// } + +// virtual int GetDialogSessionInfo(const std::string &dialogSessionId, sptr &dialogSessionInfo) +// { +// return 0; +// } + +// virtual int SendDialogResult(const Want &want, const std::string &dialogSessionId, bool isAllow) +// { +// return 0; +// } + +// /** +// * Register ability first frame state observer. +// * @param observer Is ability first frame state observer. +// * @param bundleName Is bundleName of the app to observe. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RegisterAbilityFirstFrameStateObserver(const sptr &observer, +// const std::string &targetBundleName) +// { +// return 0; +// } + +// /** +// * Unregister ability first frame state observer. +// * @param observer Is ability first frame state observer. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t UnregisterAbilityFirstFrameStateObserver(const sptr &observer) +// { +// return 0; +// } + +// #endif +// /** +// * @brief Get the ability running information. +// * +// * @param info Ability running information. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetAbilityRunningInfos(std::vector &info) = 0; + +// /** +// * @brief Get the extension running information. +// * +// * @param upperLimit The maximum limit of information wish to get. +// * @param info Extension running information. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetExtensionRunningInfos(int upperLimit, std::vector &info) = 0; + +// /** +// * @brief Get running process information. +// * +// * @param info Running process information. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetProcessRunningInfos(std::vector &info) = 0; + +// /** +// * Start synchronizing remote device mission +// * @param devId, deviceId. +// * @param fixConflict, resolve synchronizing conflicts flag. +// * @param tag, call tag. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartSyncRemoteMissions(const std::string &devId, bool fixConflict, int64_t tag) = 0; + +// /** +// * Stop synchronizing remote device mission +// * @param devId, deviceId. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StopSyncRemoteMissions(const std::string &devId) = 0; + +// /** +// * @brief Register mission listener to ability manager service. +// * @param deviceId The remote device Id. +// * @param listener The handler of listener. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int RegisterMissionListener(const std::string &deviceId, const sptr &listener) = 0; + +// virtual int RegisterOnListener(const std::string &type, const sptr &listener) +// { +// return 0; +// } + +// virtual int RegisterOffListener(const std::string &type, const sptr &listener) +// { +// return 0; +// } + +// virtual int UnRegisterMissionListener(const std::string &deviceId, +// const sptr &listener) = 0; + +// /** +// * Set ability controller. +// * +// * @param abilityController, The ability controller. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int SetAbilityController(const sptr &abilityController, +// bool imAStabilityTest) = 0; + +// /** +// * Is user a stability test. +// * +// * @return Returns true if user is a stability test. +// */ +// virtual bool IsRunningInStabilityTest() = 0; + +// /** +// * @brief Register the snapshot handler +// * @param handler snapshot handler +// * @return int Returns ERR_OK on success, others on failure. +// */ +// virtual int RegisterSnapshotHandler(const sptr& handler) = 0; + +// /** +// * @brief start user test. +// * @param want the want of the ability user test to start. +// * @param observer test observer callback. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int StartUserTest(const Want &want, const sptr &observer) = 0; + +// /** +// * @brief Finish user test. +// * @param msg user test message. +// * @param resultCode user test result Code. +// * @param bundleName user test bundleName. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int FinishUserTest(const std::string &msg, const int64_t &resultCode, const std::string &bundleName) = 0; + +// /** +// * GetTopAbility, get the token of top ability. +// * +// * @param token, the token of top ability. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int GetTopAbility(sptr &token) = 0; + +// virtual int CheckUIExtensionIsFocused(uint32_t uiExtensionTokenId, bool& isFocused) +// { +// return 0; +// } + +// /** +// * The delegator calls this interface to move the ability to the foreground. +// * +// * @param token, ability's token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int DelegatorDoAbilityForeground(const sptr &token) = 0; + +// /** +// * The delegator calls this interface to move the ability to the background. +// * +// * @param token, ability's token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int DelegatorDoAbilityBackground(const sptr &token) = 0; + +// /** +// * Calls this interface to move the ability to the foreground. +// * +// * @param token, ability's token. +// * @param flag, use for lock or unlock flag and so on. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int DoAbilityForeground(const sptr &token, uint32_t flag) = 0; + +// /** +// * Calls this interface to move the ability to the background. +// * +// * @param token, ability's token. +// * @param flag, use for lock or unlock flag and so on. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int DoAbilityBackground(const sptr &token, uint32_t flag) = 0; + +// /** +// * Get mission id by ability token. +// * +// * @param token The token of ability. +// * @return Returns -1 if do not find mission, otherwise return mission id. +// */ +// virtual int32_t GetMissionIdByToken(const sptr &token) = 0; ///包含部分日志 + +// /** +// * Get ability token by connect. +// * +// * @param token The token of ability. +// * @param callStub The callee object. +// */ +// virtual void GetAbilityTokenByCalleeObj(const sptr &callStub, sptr &token) = 0; + +// /** +// * Called when client complete dump. +// * +// * @param infos The dump info. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int DumpAbilityInfoDone(std::vector &infos, const sptr &callerToken) +// { +// return 0; +// } + +// /** +// * Call free install from remote. +// * +// * @param want, the want of the ability to start. +// * @param callback, Callback from remote. +// * @param userId, Designation User ID. +// * @param requestCode Ability request code. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int FreeInstallAbilityFromRemote(const Want &want, const sptr &callback, +// int32_t userId, int requestCode = DEFAULT_INVAL_VALUE)//////callback +// { +// return 0; +// } + +// /** +// * Add free install observer. +// * +// * @param callerToken, The caller ability token. +// * @param observer, The observer of the ability to free install start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int AddFreeInstallObserver(const sptr &callerToken, +// const sptr &observer) +// { +// return 0; +// } + +// virtual void EnableRecoverAbility(const sptr& token) {}; +// virtual void SubmitSaveRecoveryInfo(const sptr& token) {}; +// virtual void ScheduleRecoverAbility(const sptr &token, int32_t reason, +// const Want *want = nullptr) {}; + +// /** +// * @brief Schedule clear recovery page stack. +// * +// * @param bundleName application bundleName. +// */ +// virtual void ScheduleClearRecoveryPageStack() {}; + +// /** +// * Called to verify that the MissionId is valid. +// * @param missionIds Query mission list. +// * @param results Output parameters, return results up to 20 query results. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t IsValidMissionIds( +// const std::vector &missionIds, std::vector &results) = 0; + +// /** +// * Query whether the application of the specified PID and UID has been granted a certain permission +// * @param permission +// * @param pid Process id +// * @param uid +// * @return Returns ERR_OK if the current process has the permission, others on failure. +// */ +// virtual int VerifyPermission(const std::string &permission, int pid, int uid) +// { +// return 0; +// } + +// /** +// * Request dialog service with want, send want to ability manager service. +// * +// * @param want, the want of the dialog service to start. +// * @param callerToken, caller ability token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RequestDialogService(const Want &want, const sptr &callerToken) +// { +// return 0; +// } + +// /** +// * Report drawn completed. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ReportDrawnCompleted(const sptr &callerToken) = 0; + +// /** +// * Acquire the shared data. +// * @param missionId The missionId of Target ability. +// * @param shareData The IAcquireShareData object. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t AcquireShareData(const int32_t &missionId, const sptr &shareData) +// { +// return 0; +// } + +// /** +// * Notify sharing data finished. +// * @param token The token of ability. +// * @param resultCode The result of sharing data. +// * @param uniqueId The uniqueId from request object. +// * @param wantParam The params of acquiring sharing data from target ability. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ShareDataDone(const sptr& token, +// const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam) +// { +// return 0; +// } + +// /** +// * Force app exit and record exit reason. +// * @param pid Process id . +// * @param exitReason The reason of app exit. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ForceExitApp(const int32_t pid, const ExitReason &exitReason) +// { +// return 0; +// } + +// /** +// * Record app exit reason. +// * @param exitReason The reason of app exit. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RecordAppExitReason(const ExitReason &exitReason) +// { +// return 0; +// } + +// /** +// * Record the process exit reason before the process being killed. +// * @param pid The process id. +// * @param exitReason The reason of process exit. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RecordProcessExitReason(const int32_t pid, const ExitReason &exitReason) +// { +// return 0; +// } + +// /** +// * Record the exit reason of a killed process. +// * @param pid The process id. +// * @param uid The process uid. +// * @param exitReason The reason of process exit. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RecordProcessExitReason(int32_t pid, int32_t uid, const ExitReason &exitReason) +// { +// return 0; +// } + +// /** +// * Set rootSceneSession by SCB. +// * +// * @param rootSceneSession Indicates root scene session of SCB. +// */ +// virtual void SetRootSceneSession(const sptr &rootSceneSession) {} + +// /** +// * Call UIAbility by SCB. +// * +// * @param sessionInfo the session info of the ability to be called. +// * @param isColdStart the session of the ability is or not cold start. +// */ +// virtual void CallUIAbilityBySCB(const sptr &sessionInfo, bool &isColdStart) {} + +// /** +// * Start specified ability by SCB. +// * +// * @param want Want information. +// */ +// virtual void StartSpecifiedAbilityBySCB(const Want &want) {}; + +// /** +// * Notify sandbox app the result of saving file. +// * @param want Result of saving file, which contains the file's uri if success. +// * @param resultCode Indicates the action's result. +// * @param requestCode Pass the requestCode to match request. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t NotifySaveAsResult(const Want &want, int resultCode, int requestCode) +// { +// return 0; +// } + +// /** +// * Set sessionManagerService +// * @param sessionManagerService the point of sessionManagerService. +// * +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t SetSessionManagerService(const sptr &sessionManagerService) +// { +// return 0; +// } + +// /** +// * @brief Register collaborator. +// * @param type collaborator type. +// * @param impl collaborator. +// * @return 0 or else. +// */ +// virtual int32_t RegisterIAbilityManagerCollaborator(int32_t type, const sptr &impl) +// { +// return 0; +// } + +// /** +// * @brief Unregister collaborator. +// * @param type collaborator type. +// * @return 0 or else. +// */ +// virtual int32_t UnregisterIAbilityManagerCollaborator(int32_t type) +// { +// return 0; +// } + +// virtual int32_t RegisterStatusBarDelegate(sptr delegate)/////// +// { +// return 0; +// } + +// virtual int32_t KillProcessWithPrepareTerminate(const std::vector& pids) +// { +// return 0; +// } + +// virtual int32_t KillProcessWithReason(int32_t pid, const ExitReason &reason) +// { +// return 0; +// } + +// /** +// * @brief Register auto start up callback for system api. +// * @param callback The point of JsAbilityAutoStartupCallBack. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RegisterAutoStartupSystemCallback(const sptr &callback) +// { +// return 0; +// } + +// /** +// * @brief Unregister auto start up callback for system api. +// * @param callback The point of JsAbilityAutoStartupCallBack. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t UnregisterAutoStartupSystemCallback(const sptr &callback) +// { +// return 0; +// } + +// /** +// * @brief Set every application auto start up state. +// * @param info The auto startup info,include bundle name, module name, ability name. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t SetApplicationAutoStartup(const AutoStartupInfo &info) +// { +// return 0; +// } + +// /** +// * @brief Cancel every application auto start up . +// * @param info The auto startup info,include bundle name, module name, ability name. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t CancelApplicationAutoStartup(const AutoStartupInfo &info) +// { +// return 0; +// } + +// /** +// * @brief Query auto startup state all application. +// * @param infoList Output parameters, return auto startup info list. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t QueryAllAutoStartupApplications(std::vector &infoList) +// { +// return 0; +// } + +// /** +// * PrepareTerminateAbilityBySCB, prepare to terminate ability by scb. +// * +// * @param sessionInfo the session info of the ability to start. +// * @param isPrepareTerminate the result of ability onPrepareToTerminate +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int PrepareTerminateAbilityBySCB(const sptr &sessionInfo, bool &isPrepareTerminate) +// { +// return 0; +// } + +// /** +// * @brief Register app debug listener. +// * @param listener App debug listener. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RegisterAppDebugListener(sptr listener) = 0; + +// /** +// * @brief Unregister app debug listener. +// * @param listener App debug listener. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t UnregisterAppDebugListener(sptr listener) = 0; + +// /** +// * @brief Attach app debug. +// * @param bundleName The application bundle name. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t AttachAppDebug(const std::string &bundleName, bool isDebugFromLocal) = 0; + +// /** +// * @brief Detach app debug. +// * @param bundleName The application bundle name. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t DetachAppDebug(const std::string &bundleName, bool isDebugFromLocal) = 0; + +// /** +// * @brief Execute intent. +// * @param key The key of intent executing client. +// * @param callerToken Caller ability token. +// * @param param The Intent execute param. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ExecuteIntent(uint64_t key, const sptr &callerToken, +// const InsightIntentExecuteParam ¶m) = 0; + +// /** +// * @brief Check if ability controller can start. +// * @param want The want of ability to start. +// * @return Return true to allow ability to start, or false to reject. +// */ +// virtual bool IsAbilityControllerStart(const Want &want) +// { +// return true; +// } + +// /** +// * @brief Called when insight intent execute finished. +// * +// * @param token ability's token. +// * @param intentId insight intent id. +// * @param result insight intent execute result. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t ExecuteInsightIntentDone(const sptr &token, uint64_t intentId, +// const InsightIntentExecuteResult &result) = 0; + +// /** +// * @brief Set application auto start up state by EDM. +// * @param info The auto startup info, include bundle name, module name, ability name. +// * @param flag Indicate whether to allow the application to change the auto start up state. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t SetApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) = 0; + +// /** +// * @brief Cancel application auto start up state by EDM. +// * @param info The auto startup info, include bundle name, module name, ability name. +// * @param flag Indicate whether to allow the application to change the auto start up state. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t CancelApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) = 0; + +// /** +// * @brief Get foreground ui abilities. +// * @param list Foreground ui abilities. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t GetForegroundUIAbilities(std::vector &list) = 0; + +// /** +// * @brief Open file by uri. +// * @param uri The file uri. +// * @param flag Want::FLAG_AUTH_READ_URI_PERMISSION or Want::FLAG_AUTH_WRITE_URI_PERMISSION. +// * @return int The file descriptor. +// */ +// virtual int32_t OpenFile(const Uri& uri, uint32_t flag) +// { +// return 0; +// } + +// /** +// * @brief Update session info. +// * @param sessionInfos The vector of session info. +// */ +// virtual int32_t UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, +// std::vector &sessionIds)//////有内部逻辑处理 +// { +// return 0; +// } + +// /** +// * @brief Restart app self. +// * @param want The ability type must be UIAbility. +// * @param isAppRecovery True indicates that the app is restarted because of recovery. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RestartApp(const AAFwk::Want &want, bool isAppRecovery = false) +// { +// return 0; +// } + +// /** +// * @brief Get host info of root caller. +// * +// * @param token The ability token. +// * @param hostInfo The host info of root caller. +// * @param userId The user id. +// * @return int32_t Returns 0 on success, others on failure. +// */ +// virtual int32_t GetUIExtensionRootHostInfo(const sptr token, UIExtensionHostInfo &hostInfo, +// int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// } + +// /** +// * @brief Get ui extension session info +// * +// * @param token The ability token. +// * @param uiExtensionSessionInfo The ui extension session info. +// * @param userId The user id. +// * @return int32_t Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t GetUIExtensionSessionInfo(const sptr token, +// UIExtensionSessionInfo &uiExtensionSessionInfo, int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// } + +// /** +// * Open link of ability and atomic service. +// * +// * @param want Ability want. +// * @param callerToken Caller ability token. +// * @param userId User ID. +// * @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) +// { +// return 0; +// } + +// /** +// * @brief Pop-up launch of full-screen atomic service. +// * @param want The want with parameters. +// * @param callerToken caller ability token. +// * @param requestCode Ability request code. +// * @param userId The User ID. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t OpenAtomicService(Want& want, const StartOptions &options, sptr callerToken, +// int32_t requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// } + +// /* +// * Set the enable status for starting and stopping resident processes. +// * The caller application can only set the resident status of the configured process. +// * @param bundleName The bundle name of the resident process. +// * @param enable Set resident process enable status. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t SetResidentProcessEnabled(const std::string &bundleName, bool enable) +// { +// return 0; +// } + +// /** +// * @brief Querying whether to allow embedded startup of atomic service. +// * +// * @param token The caller UIAbility token. +// * @param appId The ID of the application to which this bundle belongs. +// * @return Returns true to allow ability to start, or false to reject. +// */ +// virtual bool IsEmbeddedOpenAllowed(sptr callerToken, const std::string &appId) +// { +// return true; +// } + +// /** +// * @brief Request to display assert fault dialog. +// * @param callback Listen for user operation callbacks. +// * @param wantParams Assert dialog box display information. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RequestAssertFaultDialog(const sptr &callback, const AAFwk::WantParams &wantParams) +// { +// return -1; +// } + +// /** +// * @brief Notify the operation status of the user. +// * @param assertFaultSessionId Indicates the request ID of AssertFault. +// * @param userStatus Operation status of the user. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t NotifyDebugAssertResult(uint64_t assertFaultSessionId, AAFwk::UserStatus userStatus) +// { +// return -1; +// } + +// /** +// * Starts a new ability with specific start options. +// * +// * @param want, the want of the ability to start. +// * @param startOptions Indicates the options used to start. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t StartShortcut(const Want &want, const StartOptions &startOptions) +// { +// return 0; +// } + +// /** +// * Get ability state by persistent id. +// * +// * @param persistentId, the persistentId of the session. +// * @param state Indicates the ability state. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t GetAbilityStateByPersistentId(int32_t persistentId, bool &state) +// { +// return 0; +// } + +// /** +// * Transfer resultCode & want to ability manager service. +// * +// * @param resultCode, the resultCode of the ability to terminate. +// * @param resultWant, the Want of the ability to return. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t TransferAbilityResultForExtension(const sptr &callerToken, int32_t resultCode, +// const Want &want) +// { +// return 0; +// } + +// /** +// * Notify ability manager service frozen process. +// * +// * @param pidList, the pid list of the frozen process. +// * @param uid, the uid of the frozen process. +// */ +// virtual void NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) +// { +// return; +// } + +// /** +// * Request to clean UIAbility from user. +// * +// * @param sessionInfo the session info of the ability to clean. +// * @param sceneFlag the reason info of the ability to terminate. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t CleanUIAbilityBySCB(const sptr &sessionInfo, bool isUserRequestedExit, +// uint32_t sceneFlag = 0) +// { +// return 0; +// } + +// /** +// * Open atomic service window prior to finishing free install. +// * +// * @param bundleName, the bundle name of the atomic service. +// * @param moduleName, the module name of the atomic service. +// * @param abilityName, the ability name of the atomic service. +// * @param startTime, the starting time of the free install task. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t PreStartMission(const std::string& bundleName, const std::string& moduleName, +// const std::string& abilityName, const std::string& startTime) +// { +// return 0; +// } + +// /** +// * Terminate the mission. +// * +// * @param missionId, The mission id of the UIAbility need to be terminated. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t TerminateMission(int32_t missionId) +// { +// return 0; +// } + +// /** +// * Notify ability manager to set the flag to block all apps from starting. +// * Needs to apply for ohos.permission.BLOCK_ALL_APP_START. +// * @param flag, The flag to block all apps from starting +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t BlockAllAppStart(bool flag) +// { +// return 0; +// } + +// /** +// * update associate config list by rss. +// * +// * @param configs The rss config info. +// * @param exportConfigs The rss export config info. +// * @param flag UPDATE_CONFIG_FLAG_COVER is cover config, UPDATE_CONFIG_FLAG_APPEND is append config. +// */ +// virtual int32_t UpdateAssociateConfigList(const std::map>& configs, +// const std::list& exportConfigs, int32_t flag)////////// +// { +// return 0; +// } + +// /** +// * Set keep-alive flag for application under a specific user. +// * @param bundleName Bundle name. +// * @param userId User Id. +// * @param flag Keep-alive flag. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t SetApplicationKeepAlive(const std::string &bundleName, int32_t userId, bool flag) +// { +// return 0; +// } + +// /** +// * Get keep-alive applications. +// * @param appType Application type. +// * @param userId User Id. +// * @param list List of Keep-alive information. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t QueryKeepAliveApplications(int32_t appType, int32_t userId, std::vector &list) +// { +// return 0; +// } + +// /** +// * Set keep-alive flag for application under a specific user by EDM. +// * @param bundleName Bundle name. +// * @param userId User Id. +// * @param flag Keep-alive flag. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t SetApplicationKeepAliveByEDM(const std::string &bundleName, int32_t userId, bool flag) +// { +// return 0; +// } + +// /** +// * Get keep-alive applications by EDM. +// * @param appType Application type. +// * @param userId User Id. +// * @param list List of Keep-alive information. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t QueryKeepAliveApplicationsByEDM(int32_t appType, int32_t userId, std::vector &list) +// { +// return 0; +// } + +// virtual int32_t GetAllIntentExemptionInfo(std::vector &info) +// { +// return 0; +// } + +// /** +// * Add query ERMS observer. +// * +// * @param callerToken, The caller ability token. +// * @param observer, The observer of the ability to query ERMS. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t AddQueryERMSObserver(sptr callerToken, +// sptr observer) +// { +// return 0; +// } + +// /** +// * Query atomic service ERMS rule. +// * +// * @param callerToken, The caller ability token. +// * @param appId, The appId of the atomic service. +// * @param startTime, The startTime of the query. +// * @param rule, The returned ERMS rule. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t QueryAtomicServiceStartupRule(sptr callerToken, +// const std::string &appId, const std::string &startTime, AtomicServiceStartupRule &rule)////////不可序列化 +// { +// return 0; +// } + +// /** +// * PrepareTerminateAbilityDone, called when PrepareTerminateAbility call is done. +// * +// * @param token, the token of the ability to terminate. +// * @param isTerminate, indicates whether the ability should be terminated. +// */ +// virtual void PrepareTerminateAbilityDone(const sptr &token, bool isTerminate) +// {} + +// /** +// * KillProcessWithPrepareTerminateDone, called when KillProcessWithPrepareTerminate call is done. +// * +// * @param moduleName, the module name of the application. +// * @param prepareTermination, the result of prepareTermination call of the module. +// * @param isExist, whether the prepareTerminate functions are implemented. +// */ +// virtual void KillProcessWithPrepareTerminateDone(const std::string &moduleName, +// int32_t prepareTermination, bool isExist) +// {} + +// /** +// * KillProcessForPermissionUpdate, call KillProcessForPermissionUpdate() through proxy object, +// * force kill the application by accessTokenId, notify exception to SCB. +// * +// * @param accessTokenId, accessTokenId. +// * @return ERR_OK, return back success, others fail. +// */ +// virtual int32_t KillProcessForPermissionUpdate(uint32_t accessTokenId) +// { +// return 0; +// } + +// /** +// * Register hidden start observer. +// * @param observer, ability token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RegisterHiddenStartObserver(const sptr &observer) +// { +// return 0; +// } + +// /** +// * Unregister hidden start observer. +// * @param observer, ability token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t UnregisterHiddenStartObserver(const sptr &observer) +// { +// return 0; +// } +// /** +// * Query preload uiextension record. +// * +// * @param element, The uiextension ElementName. +// * @param moduleName, The uiextension moduleName. +// * @param hostBundleName, The uiextension caller hostBundleName. +// * @param recordNum, The returned count of uiextension. +// * @param userId, The User Id. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t QueryPreLoadUIExtensionRecord(const AppExecFwk::ElementName &element, +// const std::string &moduleName, +// const std::string &hostBundleName, +// int32_t &recordNum, +// int32_t userId = DEFAULT_INVAL_VALUE) +// { +// return 0; +// } + +// /** +// * Revoke delegator. +// * +// * @param token, ability token. +// * @return Returns ERR_OK on success, others on failure. +// */ +// virtual int32_t RevokeDelegator(sptr token) +// { +// return 0; +// } +// }; +// } // namespace AAFwk +// } // namespace OHOS +// #endif // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_INTERFACE_H diff --git a/interfaces/inner_api/ability_manager/include/dms_continueInfo.h b/interfaces/inner_api/ability_manager/include/atomic_service_startup_rule.h similarity index 49% rename from interfaces/inner_api/ability_manager/include/dms_continueInfo.h rename to interfaces/inner_api/ability_manager/include/atomic_service_startup_rule.h index 89c16f36f5efdb1a0b28da50c861e393f22dc911..741390076bc6e498d8347640ac32342cb6694f03 100644 --- a/interfaces/inner_api/ability_manager/include/dms_continueInfo.h +++ b/interfaces/inner_api/ability_manager/include/atomic_service_startup_rule.h @@ -1,40 +1,19 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_DMS_CONTINUEINFO_INFO_H -#define OHOS_ABILITY_RUNTIME_DMS_CONTINUEINFO_INFO_H - -#include - -#include "parcel.h" -#include "want.h" - -namespace OHOS { -namespace AAFwk { -/** - * @struct AutoStartupInfo - * Defines auto startup info. - */ -struct ContinueMissionInfo { - std::string dstDeviceId; - std::string srcDeviceId; - std::string bundleName; - std::string srcBundleName; - std::string continueType; - AAFwk::WantParams wantParams; -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_DMS_CONTINUEINFO_INFO_H \ No newline at end of file +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_ATOMIC_SERVICE_STARTUP_RULE_H +#define OHOS_ABILITY_RUNTIME_ATOMIC_SERVICE_STARTUP_RULE_H +#include "query_erms_observer_interface.h" +#endif // OHOS_ABILITY_RUNTIME_ATOMIC_SERVICE_STARTUP_RULE_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_interface.h b/interfaces/inner_api/ability_manager/include/continue_mission_info.h similarity index 44% rename from interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_interface.h rename to interfaces/inner_api/ability_manager/include/continue_mission_info.h index 3529b935671e8c8580e6db45314174d6217fc548..e119093161b2a61f81232f645823fb2728c3dce5 100644 --- a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_interface.h +++ b/interfaces/inner_api/ability_manager/include/continue_mission_info.h @@ -1,39 +1,19 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_FIRST_FRAME_STATE_OBSERVER_INTERFACE_H -#define OHOS_ABILITY_FIRST_FRAME_STATE_OBSERVER_INTERFACE_H -#ifdef SUPPORT_GRAPHICS - -#include "ability_first_frame_state_data.h" -#include "iremote_broker.h" -#include "iremote_object.h" - -namespace OHOS { -namespace AppExecFwk { -class IAbilityFirstFrameStateObserver : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.IAbilitFirstFrameState"); - - virtual void OnAbilityFirstFrameState(const AbilityFirstFrameStateData &abilityFirstFrameStateData) = 0; - - enum class Message { - ON_ABILITY_FIRST_FRAME_STATE, - }; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // SUPPORT_GRAPHICS -#endif // OHOS_ABILITY_FIRST_FRAME_STATE_OBSERVER_INTERFACE_H +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_CONTINUEINFO_MISSION_INFO_H +#define OHOS_ABILITY_RUNTIME_CONTINUEINFO_MISSION_INFO_H +#include "dms_continue_info.h" +#endif // OHOS_ABILITY_RUNTIME_CONTINUEINFO_MISSION_INFO_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/dms_continue_info.h b/interfaces/inner_api/ability_manager/include/dms_continue_info.h new file mode 100644 index 0000000000000000000000000000000000000000..96e6be2b6aaf8afa7a8c489b1650bc6c003523e0 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/dms_continue_info.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_DMS_CONTINUEINFO_INFO_H +#define OHOS_ABILITY_RUNTIME_DMS_CONTINUEINFO_INFO_H + +#include + +#include "parcel.h" +#include "want.h" + +namespace OHOS { +namespace AAFwk { +/** + * @struct AutoStartupInfo + * Defines auto startup info. + */ +struct ContinueMissionInfo : public Parcelable{ + std::string dstDeviceId; + std::string srcDeviceId; + std::string bundleName; + std::string srcBundleName; + std::string continueType; + AAFwk::WantParams wantParams; + + bool Marshalling(Parcel &parcel) const override { + if (!parcel.WriteString(dstDeviceId)) { + // TAG_LOGW("Write isOpenAllowed failed"); + return false; + } + if (!parcel.WriteString(srcDeviceId)) { + // TAG_LOGW("Write isEmbeddedAllowed failed"); + return false; + } + return true; + } + + bool ReadFromParcel(Parcel &parcel) + { + dstDeviceId = parcel.ReadString(); + srcDeviceId = parcel.ReadString(); + bundleName = parcel.ReadString(); + srcBundleName = parcel.ReadString(); + continueType = parcel.ReadString(); + auto tempWantParams = parcel.ReadParcelable(); + if (tempWantParams == nullptr) { + return false; + } + wantParams = *tempWantParams; + delete tempWantParams; + tempWantParams = nullptr; + return true; + } + + static ContinueMissionInfo *Unmarshalling(Parcel &parcel) { + ContinueMissionInfo* continueMissionInfo = new (std::nothrow) ContinueMissionInfo(); + if (continueMissionInfo == nullptr) { + return nullptr; + } + + if (!continueMissionInfo->ReadFromParcel(parcel)) { + delete continueMissionInfo; + continueMissionInfo = nullptr; + } + return continueMissionInfo; + } + +}; +} // namespace AAFwk +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_DMS_CONTINUEINFO_INFO_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/hidden_start_observer_proxy.h b/interfaces/inner_api/ability_manager/include/hidden_start_observer_proxy.h deleted file mode 100644 index 40b0b2a07436e49b6e6b9bee4940650e7b4d78a1..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/include/hidden_start_observer_proxy.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_HIDDEN_START_OBSERVER_PROXY_H -#define OHOS_ABILITY_RUNTIME_HIDDEN_START_OBSERVER_PROXY_H - -#include "iremote_proxy.h" -#include "ihidden_start_observer.h" - -namespace OHOS { -namespace AAFwk { -class HiddenStartObserverProxy : public IRemoteProxy { -public: - explicit HiddenStartObserverProxy(const sptr &impl); - virtual ~HiddenStartObserverProxy() = default; - - /** - * IsHiddenStart, return if the given app is started hidden. - * - * @param pid Pid of the given app's process. - * @return if the given app is started hidden - */ - virtual bool IsHiddenStart(int32_t pid) override; - -private: - /** - * WriteInterfaceToken. - * - * @param data The message parcel data. - * @return Flag whether write is successful. - */ - bool WriteInterfaceToken(MessageParcel &data); - static inline BrokerDelegator delegator_; - int32_t SendTransactCmd(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option); -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_HIDDEN_START_OBSERVER_PROXY_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/iability_connection.h b/interfaces/inner_api/ability_manager/include/iability_connection.h index b4e1ac8f7d566bf723840a2cd13fd6090f707c8e..2e74d6f295561d1d59ac7b7cb177e9a096e2a3a6 100644 --- a/interfaces/inner_api/ability_manager/include/iability_connection.h +++ b/interfaces/inner_api/ability_manager/include/iability_connection.h @@ -15,6 +15,5 @@ #ifndef OHOS_ABILITY_RUNTIME_IABILITY_CONNECTION_H #define OHOS_ABILITY_RUNTIME_IABILITY_CONNECTION_H - #include "ability_connect_callback_interface.h" #endif // OHOS_ABILITY_RUNTIME_IABILITY_CONNECTION_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/iability_scheduler.h b/interfaces/inner_api/ability_manager/include/iability_scheduler.h new file mode 100644 index 0000000000000000000000000000000000000000..59f545574bc98232d7f7a2d1e34d50d25d678f61 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iability_scheduler.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IABILITY_SCHEDULER_H +#define OHOS_ABILITY_RUNTIME_IABILITY_SCHEDULER_H +#include "ability_scheduler_interface.h" +#endif //OHOS_ABILITY_RUNTIME_IABILITY_SCHEDULER_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/iacquire_share_data_callback.h b/interfaces/inner_api/ability_manager/include/iacquire_share_data_callback.h new file mode 100644 index 0000000000000000000000000000000000000000..734c67bc2ad029a8c7996150caad09e36878fa71 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iacquire_share_data_callback.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IACQUIRE_SHARE_DATA_CALLBACK_H +#define OHOS_ABILITY_RUNTIME_IACQUIRE_SHARE_DATA_CALLBACK_H +#include "iacquire_share_data_callback_interface.h" +#endif //OHOS_ABILITY_RUNTIME_IACQUIRE_SHARE_DATA_CALLBACK_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/ifree_install_observer.h b/interfaces/inner_api/ability_manager/include/ifree_install_observer.h new file mode 100644 index 0000000000000000000000000000000000000000..9c3f5f3f907ea57c8149b570e26ba23502744af0 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/ifree_install_observer.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IFREE_INSTALL_OBSERVER_H +#define OHOS_ABILITY_RUNTIME_IFREE_INSTALL_OBSERVER_H +#include "free_install_observer_interface.h" +#endif // OHOS_ABILITY_RUNTIME_FREE_INSTALL_OBSERVER_INTERFACE_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/imission_listener.h b/interfaces/inner_api/ability_manager/include/imission_listener.h new file mode 100644 index 0000000000000000000000000000000000000000..361507be4d1e630b67b0360cd36b9bcdb8871c26 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/imission_listener.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IMISSION_LISTENER_H +#define OHOS_ABILITY_RUNTIME_IMISSION_LISTENER_H +#include "mission_listener_interface.h" +#endif // OHOS_ABILITY_RUNTIME_MISSION_LISTENER_INTERFACE_H diff --git a/interfaces/inner_api/ability_manager/include/iprepare_terminate_callback.h b/interfaces/inner_api/ability_manager/include/iprepare_terminate_callback.h new file mode 100644 index 0000000000000000000000000000000000000000..22bb05e74610cc2fb7dbe0d332fa755ffaf49132 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iprepare_terminate_callback.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IPREPARE_TERMINATE_CALLBACK_H +#define OHOS_ABILITY_RUNTIME_IPREPARE_TERMINATE_CALLBACK_H +#include "iprepare_terminate_callback_interface.h" +#endif // OHOS_ABILITY_RUNTIME_IPREPARE_TERMINATE_CALLBACK_H diff --git a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_proxy.h b/interfaces/inner_api/ability_manager/include/iquery_e_r_m_s_observer.h similarity index 38% rename from interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_proxy.h rename to interfaces/inner_api/ability_manager/include/iquery_e_r_m_s_observer.h index e85361dbdc639f0baa20a7479383e8399e67267a..10fa7922ada19690dbef9519bfeff6857d756c2a 100644 --- a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_observer_proxy.h +++ b/interfaces/inner_api/ability_manager/include/iquery_e_r_m_s_observer.h @@ -13,29 +13,7 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_ABILITY_FIRST_FRAME_STATE_OBSERVER_H -#define OHOS_ABILITY_RUNTIME_ABILITY_FIRST_FRAME_STATE_OBSERVER_H -#ifdef SUPPORT_GRAPHICS - -#include "ability_first_frame_state_observer_interface.h" -#include "iremote_broker.h" -#include "iremote_object.h" -#include "iremote_proxy.h" - -namespace OHOS { -namespace AppExecFwk { -class AbilityFirstFrameStateObserverProxy : public IRemoteProxy { -public: - explicit AbilityFirstFrameStateObserverProxy(const sptr &impl); - virtual ~AbilityFirstFrameStateObserverProxy() = default; - - void OnAbilityFirstFrameState(const AbilityFirstFrameStateData &abilityFirstFrameStateData) override; - -private: - bool WriteInterfaceToken(MessageParcel &data); - static inline BrokerDelegator delegator_; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // SUPPORT_GRAPHICS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_FIRST_FRAME_STATE_OBSERVER_H +#ifndef OHOS_ABILITY_RUNTIME_IQUERY_E_R_M_S_OBSERVER_H +#define OHOS_ABILITY_RUNTIME_IQUERY_E_R_M_S_OBSERVER_H +#include "query_erms_observer_interface.h" +#endif // OHOS_ABILITY_RUNTIME_IQUERY_E_R_M_S_OBSERVER_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/iremote_mission_listener.h b/interfaces/inner_api/ability_manager/include/iremote_mission_listener.h new file mode 100644 index 0000000000000000000000000000000000000000..5fb7e09f4915023201c98c9ca717724009e7d22b --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iremote_mission_listener.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IREMOTE_MISSION_LISTENER_H +#define OHOS_ABILITY_RUNTIME_IREMOTE_MISSION_LISTENER_H +#include "remote_mission_listener_interface.h" +#endif // OHOS_ABILITY_RUNTIME_IREMOTE_MISSION_LISTENER_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/iremote_on_listener.h b/interfaces/inner_api/ability_manager/include/iremote_on_listener.h new file mode 100644 index 0000000000000000000000000000000000000000..8786990f1775f13c1a1faadc25b02c24763e4649 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iremote_on_listener.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_REMOTE_ON_LISTENER_H +#define OHOS_ABILITY_RUNTIME_REMOTE_ON_LISTENER_H +#include "remote_on_listener_interface.h" +#endif // OHOS_ABILITY_RUNTIME_REMOTE_ON_LISTENER_H diff --git a/interfaces/inner_api/ability_manager/include/isnapshot_handler.h b/interfaces/inner_api/ability_manager/include/isnapshot_handler.h new file mode 100644 index 0000000000000000000000000000000000000000..d794bb07f1ab7ae5def85793b01f09b786c1c0a2 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/isnapshot_handler.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_ISNAPSHOT_HANDLER_H +#define OHOS_ABILITY_RUNTIME_ISNAPSHOT_HANDLER_H +#include "snapshot.h" +#endif // OHOS_ABILITY_RUNTIME_ISNAPSHOT_HANDLER_H diff --git a/interfaces/inner_api/ability_manager/include/iuser_callback.h b/interfaces/inner_api/ability_manager/include/iuser_callback.h new file mode 100644 index 0000000000000000000000000000000000000000..d3df68ae1443b1aef63d511fccad0a59b5a3e8fb --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iuser_callback.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IUSER_CALLBACK_H +#define OHOS_ABILITY_RUNTIME_IUSER_CALLBACK_H +#include "user_callback.h" +#endif // OHOS_ABILITY_RUNTIME_USER_CALLBACK_H diff --git a/interfaces/inner_api/ability_manager/include/iwant_receiver.h b/interfaces/inner_api/ability_manager/include/iwant_receiver.h new file mode 100644 index 0000000000000000000000000000000000000000..42ed58bdf0a2f8fe53402afe7c8e96dd37dcbb46 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iwant_receiver.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IWANT_RECEIVER_H +#define OHOS_ABILITY_RUNTIME_IWANT_RECEIVER_H +#include "want_receiver_interface.h" +#endif // OHOS_ABILITY_RUNTIME_IWANT_RECEIVER_H diff --git a/interfaces/inner_api/ability_manager/include/iwant_sender.h b/interfaces/inner_api/ability_manager/include/iwant_sender.h new file mode 100644 index 0000000000000000000000000000000000000000..c292982af34b788db0a24721d467819afb99e383 --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iwant_sender.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IWANT_SENDER_H +#define OHOS_ABILITY_RUNTIME_IWANT_SENDER_H +#include "want_sender_interface.h" +#endif // OHOS_ABILITY_RUNTIME_WANT_SENDER_H diff --git a/interfaces/inner_api/ability_manager/include/iwindow_manager_service_handler.h b/interfaces/inner_api/ability_manager/include/iwindow_manager_service_handler.h new file mode 100644 index 0000000000000000000000000000000000000000..653069a84dd91b701f12922181fc1f7ce9438b3d --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/iwindow_manager_service_handler.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IWINDOW_MANAGER_SERVICE_HANDLER_H +#define OHOS_ABILITY_RUNTIME_IWINDOW_MANAGER_SERVICE_HANDLER_H +#include "window_manager_service_handler.h" +#endif // OHOS_ABILITY_RUNTIME_IWINDOW_MANAGER_SERVICE_HANDLER_H diff --git a/interfaces/inner_api/ability_manager/include/query_erms_observer_interface.h b/interfaces/inner_api/ability_manager/include/query_erms_observer_interface.h index f51d8c914382321b4f62522a76606b8466feecdc..c306c3769ebd9cd077efb8355ca4e802577f72be 100644 --- a/interfaces/inner_api/ability_manager/include/query_erms_observer_interface.h +++ b/interfaces/inner_api/ability_manager/include/query_erms_observer_interface.h @@ -21,9 +21,46 @@ namespace OHOS { namespace AbilityRuntime { -struct AtomicServiceStartupRule { +struct AtomicServiceStartupRule : public Parcelable { bool isOpenAllowed = false; bool isEmbeddedAllowed = false; + + AtomicServiceStartupRule() = default; + AtomicServiceStartupRule(bool allow, bool embedAllow) + : isOpenAllowed(allow), isEmbeddedAllowed(embedAllow) {} + + bool Marshalling(Parcel &parcel) const override { + if (!parcel.WriteBool(isOpenAllowed)) { + // TAG_LOGW("Write isOpenAllowed failed"); + return false; + } + if (!parcel.WriteBool(isEmbeddedAllowed)) { + // TAG_LOGW("Write isEmbeddedAllowed failed"); + return false; + } + return true; + } + + bool ReadFromParcel(Parcel &parcel) { + isOpenAllowed = parcel.ReadBool(); + isEmbeddedAllowed = parcel.ReadBool(); + return true; + } + + static AtomicServiceStartupRule* Unmarshalling(Parcel &parcel) { + AtomicServiceStartupRule* rule = new (std::nothrow) AtomicServiceStartupRule(); + if (rule == nullptr) { + // TAG_LOGW("Create AtomicServiceStartupRule failed"); + return nullptr; + } + + if (!rule->ReadFromParcel(parcel)) { + // TAG_LOGW("ReadFromParcel failed"); + delete rule; + rule = nullptr; + } + return rule; + } }; class IQueryERMSObserver : public OHOS::IRemoteBroker { diff --git a/interfaces/inner_api/ability_manager/include/status_bar_delegate/istatus_bar_delegate.h b/interfaces/inner_api/ability_manager/include/status_bar_delegate/istatus_bar_delegate.h new file mode 100644 index 0000000000000000000000000000000000000000..1f5c2f3397525538830ddee83d93f75ea1cfec3f --- /dev/null +++ b/interfaces/inner_api/ability_manager/include/status_bar_delegate/istatus_bar_delegate.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_ISTATUS_BAR_DELEGATE_H +#define OHOS_ABILITY_RUNTIME_ISTATUS_BAR_DELEGATE_H +#include "status_bar_delegate_interface.h" +#endif // OHOS_ABILITY_RUNTIME_ISTATUS_BAR_DELEGATE_H diff --git a/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h b/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h index be198d7b97c339f1494cdf99e759822ecd3a7c5c..814bc980b8cf1a44e8ab8bd082409501366b42c8 100644 --- a/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h +++ b/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h @@ -16,7 +16,6 @@ #ifndef OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_H #define OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_H -#ifdef SUPPORT_SCREEN #include "iremote_broker.h" #include "window_info.h" @@ -79,5 +78,5 @@ public: }; } // namespace AAFwk } // namespace OHOS -#endif + #endif // OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_H diff --git a/interfaces/inner_api/ability_manager/mission_info.idl b/interfaces/inner_api/ability_manager/mission_info.idl new file mode 100644 index 0000000000000000000000000000000000000000..cd35df7f62fec0536ef6c298198bc731d00d56b4 --- /dev/null +++ b/interfaces/inner_api/ability_manager/mission_info.idl @@ -0,0 +1,7 @@ + +enum ContinueState { + CONTINUESTATE_UNKNOWN = -1, + CONTINUESTATE_ACTIVE = 0, + CONTINUESTATE_INACTIVE = 1, + CONTINUESTATE_MAX +}; \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/src/ability_first_frame_state_observer_proxy.cpp b/interfaces/inner_api/ability_manager/src/ability_first_frame_state_observer_proxy.cpp deleted file mode 100644 index d87bc5e7dd69337fe0e8a67e8549ed1d301d808d..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/src/ability_first_frame_state_observer_proxy.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef SUPPORT_GRAPHICS -#include "ability_first_frame_state_observer_proxy.h" - -#include "hilog_tag_wrapper.h" -#include "ipc_types.h" - -namespace OHOS { -namespace AppExecFwk { -AbilityFirstFrameStateObserverProxy::AbilityFirstFrameStateObserverProxy(const sptr &impl) - : IRemoteProxy(impl) -{} - -bool AbilityFirstFrameStateObserverProxy::WriteInterfaceToken(MessageParcel &data) -{ - if (!data.WriteInterfaceToken(AbilityFirstFrameStateObserverProxy::GetDescriptor())) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "Write token failed"); - return false; - } - return true; -} - -void AbilityFirstFrameStateObserverProxy::OnAbilityFirstFrameState( - const AbilityFirstFrameStateData &abilityFirstFrameStateData) -{ - MessageParcel data; - if (!WriteInterfaceToken(data)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "Write Token failed"); - return; - } - if (!data.WriteParcelable(&abilityFirstFrameStateData)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write abilityFirstFrameStateData failed"); - return; - } - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "null remote"); - return; - } - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - int32_t ret = remote->SendRequest( - static_cast(IAbilityFirstFrameStateObserver::Message::ON_ABILITY_FIRST_FRAME_STATE), - data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "SendRequest error: %{public}d", ret); - } -} -} // namespace AppExecFwk -} // namespace OHOS -#endif \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/src/ability_first_frame_state_observer_stub.cpp b/interfaces/inner_api/ability_manager/src/ability_first_frame_state_observer_stub.cpp deleted file mode 100644 index 46f664c37704323bb10243861d28f4b3fd81f19a..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/src/ability_first_frame_state_observer_stub.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef SUPPORT_GRAPHICS -#include "ability_first_frame_state_observer_stub.h" - -#include "hilog_tag_wrapper.h" -#include "appexecfwk_errors.h" -#include "ipc_types.h" -#include "iremote_object.h" - -#include "ability_first_frame_state_data.h" - -namespace OHOS { -namespace AppExecFwk { -AbilityFirstFrameStateObserverStub::AbilityFirstFrameStateObserverStub() {} - -AbilityFirstFrameStateObserverStub::~AbilityFirstFrameStateObserverStub() {} - -int32_t AbilityFirstFrameStateObserverStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - TAG_LOGD(AAFwkTag::ABILITYMGR, "called"); - std::u16string descriptor = AbilityFirstFrameStateObserverStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "invalid descriptor"); - return ERR_INVALID_STATE; - } - - if (code == static_cast(IAbilityFirstFrameStateObserver::Message::ON_ABILITY_FIRST_FRAME_STATE)) { - return HandleOnAbilityFirstFrameStateChanged(data, reply); - } - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int32_t AbilityFirstFrameStateObserverStub::HandleOnAbilityFirstFrameStateChanged(MessageParcel &data, - MessageParcel &reply) -{ - std::unique_ptr stateData(data.ReadParcelable()); - if (stateData == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "null stateData"); - return ERR_APPEXECFWK_PARCEL_ERROR; - } - OnAbilityFirstFrameState(*stateData); - return NO_ERROR; -} - -AbilityFirstFrameStateObserverRecipient::AbilityFirstFrameStateObserverRecipient(RemoteDiedHandler handler) - : handler_(handler) -{} - -void AbilityFirstFrameStateObserverRecipient::OnRemoteDied(const wptr &__attribute__((unused)) remote) -{ - TAG_LOGE(AAFwkTag::ABILITYMGR, "Remote died"); - if (handler_) { - handler_(remote); - } -} -} // namespace AppExecFwk -} // namespace OHOS -#endif \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/type/ExtensionAbilityType.idl b/interfaces/inner_api/ability_manager/type/ExtensionAbilityType.idl new file mode 100644 index 0000000000000000000000000000000000000000..de1db9f1ff433df74e17505ca819f542e5d82aca --- /dev/null +++ b/interfaces/inner_api/ability_manager/type/ExtensionAbilityType.idl @@ -0,0 +1,32 @@ +enum ExtensionAbilityType { + FORM = 0, + WORK_SCHEDULER = 1, + INPUTMETHOD = 2, + SERVICE = 3, + ACCESSIBILITY = 4, + DATASHARE = 5, + FILESHARE = 6, + STATICSUBSCRIBER = 7, + WALLPAPER = 8, + BACKUP = 9, + WINDOW = 10, + ENTERPRISE_ADMIN = 11, + FILEACCESS_EXTENSION = 12, + THUMBNAIL = 13, + PREVIEW_TYPE = 14, + PRINT = 15, + PUSH = 17, + DRIVER = 18, + APP_ACCOUNT_AUTHORIZATION = 19, + FENCE = 24, + DISTRIBUTED = 28, + UNSPECIFIED = 255, + UI = 256, + HMS_ACCOUNT = 257, + SYSDIALOG_USERAUTH = 300, + SYSDIALOG_COMMON = 301, + SYSDIALOG_ATOMICSERVICEPANEL = 302, + SYSPICKER_MEDIACONTROL = 400, + SYSPICKER_SHARE = 401, + UI_SERVICE = 500, +}; diff --git a/interfaces/inner_api/ability_manager/type/IFooCustom.idl b/interfaces/inner_api/ability_manager/type/IFooCustom.idl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/interfaces/inner_api/ability_manager/type/UIExtensionWindowCommand.idl b/interfaces/inner_api/ability_manager/type/UIExtensionWindowCommand.idl new file mode 100644 index 0000000000000000000000000000000000000000..85e9dd88e98bc578194859ad6239d51f1b7be880 --- /dev/null +++ b/interfaces/inner_api/ability_manager/type/UIExtensionWindowCommand.idl @@ -0,0 +1,10 @@ +enum WindowCommand { + WIN_CMD_FOREGROUND, + WIN_CMD_BACKGROUND, + WIN_CMD_DESTROY +}; +enum AbilityCommand { + ABILITY_CMD_FOREGROUND, + ABILITY_CMD_BACKGROUND, + ABILITY_CMD_DESTROY +}; diff --git a/interfaces/inner_api/ability_manager/type/ability_state.idl b/interfaces/inner_api/ability_manager/type/ability_state.idl new file mode 100644 index 0000000000000000000000000000000000000000..15c1ffb62230b7ef75bf3acce4ddf19a82bce78a --- /dev/null +++ b/interfaces/inner_api/ability_manager/type/ability_state.idl @@ -0,0 +1,5 @@ +enum UserStatus { + ASSERT_TERMINATE = 0, + ASSERT_CONTINUE, + ASSERT_RETRY, +}; \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/type/mission_info.idl b/interfaces/inner_api/ability_manager/type/mission_info.idl new file mode 100644 index 0000000000000000000000000000000000000000..03d4becd0c456fe2215deb3326fa3d4eaa102995 --- /dev/null +++ b/interfaces/inner_api/ability_manager/type/mission_info.idl @@ -0,0 +1,6 @@ +enum ContinueState { + CONTINUESTATE_UNKNOWN = -1, + CONTINUESTATE_ACTIVE = 0, + CONTINUESTATE_INACTIVE = 1, + CONTINUESTATE_MAX +}; \ No newline at end of file diff --git a/interfaces/inner_api/app_manager/include/appmgr/iapp_debug_listener.h b/interfaces/inner_api/app_manager/include/appmgr/iapp_debug_listener.h new file mode 100644 index 0000000000000000000000000000000000000000..7900ab0319616c8490ae857a4b0b2a6660ba8598 --- /dev/null +++ b/interfaces/inner_api/app_manager/include/appmgr/iapp_debug_listener.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_IAPP_DEBUG_LISTENER_H +#define OHOS_ABILITY_RUNTIME_IAPP_DEBUG_LISTENER_H +#include "app_debug_listener_interface.h" +#endif // OHOS_ABILITY_RUNTIME_IAPP_DEBUG_LISTENER_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/process_data.h b/interfaces/inner_api/app_manager/include/appmgr/process_data.h index 5d5da0d1174b470ee68ef619077334e173c9d4b3..6121e98e03778ef656a22d3296ca5c90edb4db98 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/process_data.h +++ b/interfaces/inner_api/app_manager/include/appmgr/process_data.h @@ -71,6 +71,7 @@ struct ProcessData : public Parcelable { bool isPreloadModule = false; int32_t callerPid = -1; int32_t callerUid = -1; + std::string killReason; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/process_data.cpp b/interfaces/inner_api/app_manager/src/appmgr/process_data.cpp index a22aaefe3d414cca058b179aa098167b9a05b8e4..700cd993a3d5b02e93b2460a690f5271568f25c9 100644 --- a/interfaces/inner_api/app_manager/src/appmgr/process_data.cpp +++ b/interfaces/inner_api/app_manager/src/appmgr/process_data.cpp @@ -32,7 +32,7 @@ bool ProcessData::Marshalling(Parcel &parcel) const && parcel.WriteInt32(renderUid) && parcel.WriteUint32(accessTokenId) && parcel.WriteBool(isTestMode) && parcel.WriteInt32(exitReason) && parcel.WriteString16(Str8ToStr16(exitMsg)) && parcel.WriteInt32(childUid) && parcel.WriteBool(isPreload) && parcel.WriteBool(isPreloadModule) && - parcel.WriteInt32(callerPid) && parcel.WriteInt32(callerUid)); + parcel.WriteInt32(callerPid) && parcel.WriteInt32(callerUid) && parcel.WriteString(killReason)); } bool ProcessData::ReadFromParcel(Parcel &parcel) @@ -61,6 +61,7 @@ bool ProcessData::ReadFromParcel(Parcel &parcel) isPreloadModule = parcel.ReadBool(); callerPid = parcel.ReadInt32(); callerUid = parcel.ReadInt32(); + killReason = parcel.ReadString(); return true; } diff --git a/interfaces/inner_api/wantagent/BUILD.gn b/interfaces/inner_api/wantagent/BUILD.gn index a9f3008821ce8144f55e241721e9ab01b90077d1..1c9ee3c656690529cfb3b016ed6665532cf08e3d 100644 --- a/interfaces/inner_api/wantagent/BUILD.gn +++ b/interfaces/inner_api/wantagent/BUILD.gn @@ -64,7 +64,10 @@ ohos_shared_library("wantagent_innerkits") { "src/want_agent_info.cpp", ] - public_configs = [ ":wantagent_innerkits_public_config" ] + public_configs = [ + ":wantagent_innerkits_public_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + ] deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", diff --git a/interfaces/inner_api/wantagent/src/want_agent_client.cpp b/interfaces/inner_api/wantagent/src/want_agent_client.cpp index c19943ee44752f7beab39de62f36b51ceb4ec255..5a8bf6bca07f1d1b879ae6315e4070775a5d6bdc 100644 --- a/interfaces/inner_api/wantagent/src/want_agent_client.cpp +++ b/interfaces/inner_api/wantagent/src/want_agent_client.cpp @@ -71,7 +71,7 @@ ErrCode WantAgentClient::GetWantSender( return ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER; } - auto error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_SENDER), + auto error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_WANT_SENDER), data, reply, option); if (error != NO_ERROR) { return ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_WANTAGENT; @@ -99,8 +99,7 @@ ErrCode WantAgentClient::SendWantSender(sptr target, const SenderIn TAG_LOGE(AAFwkTag::WANTAGENT, "senderInfo write failed"); return ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER; } - - auto error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::SEND_PENDING_WANT_SENDER), + auto error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_SEND_WANT_SENDER), data, reply, option); if (error != NO_ERROR) { return ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_TIMEOUT; @@ -131,7 +130,7 @@ ErrCode WantAgentClient::CancelWantSender(const sptr &sender, uint3 return ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER; } - error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::CANCEL_PENDING_WANT_SENDER), + error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_CANCEL_WANT_SENDER), data, reply, option); if (error != NO_ERROR) { return ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY; @@ -147,7 +146,7 @@ ErrCode WantAgentClient::GetPendingWantUid(const sptr &target, int3 CHECK_POINTER_AND_RETURN(abms, ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY); ErrCode error; MessageParcel reply; - if (!SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_UID), + if (!SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_PENDING_WANT_UID), abms, target->AsObject(), reply, error)) { return error; } @@ -162,7 +161,7 @@ ErrCode WantAgentClient::GetPendingWantUserId(const sptr &target, i CHECK_POINTER_AND_RETURN(abms, ABILITY_SERVICE_NOT_CONNECTED); ErrCode error; MessageParcel reply; - if (!SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_USERID), + if (!SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_PENDING_WANT_USER_ID), abms, target->AsObject(), reply, error)) { return error; } @@ -177,7 +176,7 @@ ErrCode WantAgentClient::GetPendingWantBundleName(const sptr &targe CHECK_POINTER_AND_RETURN(abms, ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY); ErrCode error; MessageParcel reply; - if (!SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_BUNDLENAME), + if (!SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_PENDING_WANT_BUNDLE_NAME), abms, target->AsObject(), reply, error)) { return error; } @@ -192,7 +191,7 @@ ErrCode WantAgentClient::GetPendingWantCode(const sptr &target, int CHECK_POINTER_AND_RETURN(abms, ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY); ErrCode error; MessageParcel reply; - if (!SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_CODE), + if (!SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_PENDING_WANT_CODE), abms, target->AsObject(), reply, error)) { return ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_TIMEOUT; } @@ -207,7 +206,7 @@ ErrCode WantAgentClient::GetPendingWantType(sptr target, int32_t &t CHECK_POINTER_AND_RETURN(abms, ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_BUSY); ErrCode error; MessageParcel reply; - if (!SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_TYPE), + if (!SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_PENDING_WANT_TYPE), abms, target->AsObject(), reply, error)) { return ERR_ABILITY_RUNTIME_EXTERNAL_SERVICE_TIMEOUT; } @@ -240,7 +239,7 @@ void WantAgentClient::RegisterCancelListener(const sptr &sender, co TAG_LOGE(AAFwkTag::WANTAGENT, "receiver write failed"); return; } - auto error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::REGISTER_CANCEL_LISTENER), + auto error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_REGISTER_CANCEL_LISTENER), data, reply, option); if (error != NO_ERROR) { return; @@ -272,7 +271,7 @@ void WantAgentClient::UnregisterCancelListener( TAG_LOGE(AAFwkTag::WANTAGENT, "receiver write failed"); return; } - auto error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::UNREGISTER_CANCEL_LISTENER), + auto error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_UNREGISTER_CANCEL_LISTENER), data, reply, option); if (error != NO_ERROR) { return; @@ -307,7 +306,7 @@ ErrCode WantAgentClient::GetPendingRequestWant(const sptr &target, TAG_LOGE(AAFwkTag::WANTAGENT, "want write failed"); return ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER; } - auto error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_REQUEST_WANT), + auto error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_PENDING_REQUEST_WANT), data, reply, option); if (error != NO_ERROR) { TAG_LOGE(AAFwkTag::WANTAGENT, "Send request error: %{public}d", error); @@ -343,7 +342,7 @@ ErrCode WantAgentClient::GetWantSenderInfo(const sptr &target, std: TAG_LOGE(AAFwkTag::WANTAGENT, "info write failed"); return INNER_ERR; } - auto error = abms->SendRequest(static_cast(AbilityManagerInterfaceCode::GET_PENDING_WANT_SENDER_INFO), + auto error = abms->SendRequest(static_cast(IAbilityManagerIpcCode::COMMAND_GET_WANT_SENDER_INFO), data, reply, option); if (error != NO_ERROR) { TAG_LOGE(AAFwkTag::WANTAGENT, "Send request error: %{public}d", error); diff --git a/interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_client.h b/interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_client.h index 3492463ab4473d542a4e53842d1d8b8c5db07913..54146bf451edb8a2788d53b5284efa905d0bd6d5 100644 --- a/interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_client.h +++ b/interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_client.h @@ -19,7 +19,7 @@ #include -#include "dms_continueInfo.h" +#include "dms_continue_info.h" #include "mission_info.h" #include "mission_snapshot.h" #include "want_params.h" diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index af8b5ab776e4cd7ae6d4871348f1cf10fc7f9e1a..6876e77937a2f03618cb3cf866ca49355e7d8ed5 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -106,6 +106,164 @@ config("abilityms_config") { ] } +# ohos_source_set("abilityms_proxy") { +# sanitize = { +# cfi = true +# cfi_cross_dso = true +# debug = false +# } + +# # output_values = get_target_outputs("${ability_runtime_innerkits_path}/ability_manager:ability_manager_interface") +# # sources = [ +# # # "${output_values}/ability_manager_proxy.cpp" +# # ] + +# public_configs = [ +# "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", +# "${ability_runtime_services_path}/abilitymgr:abilityms_config", +# ] + +# public_deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub" ] + +# deps = [ +# "${ability_runtime_innerkits_path}/ability_manager:ability_manager_interface", +# "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", +# "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", +# "${ability_runtime_innerkits_path}/ability_manager:mission_info", +# "${ability_runtime_innerkits_path}/ability_manager:process_options", +# "${ability_runtime_innerkits_path}/ability_manager:start_window_option", +# "${ability_runtime_innerkits_path}/app_manager:app_manager", +# "${ability_runtime_path}/utils/global/freeze:freeze_util", +# "${ability_runtime_services_path}/abilitymgr:wantagent_manager", +# ] + +# external_deps = [ +# "bundle_framework:libappexecfwk_common", +# "c_utils:utils", +# "common_event_service:cesfwk_innerkits", +# "eventhandler:libeventhandler", +# "hilog:libhilog", +# "hisysevent:libhisysevent", +# "hitrace:hitrace_meter", +# "ipc:ipc_core", +# "ipc:ipc_napi", +# "jsoncpp:jsoncpp", +# "relational_store:native_dataability", +# "samgr:samgr_proxy", +# ] + +# if (host_cpu != "arm64") { +# external_deps += [ "relational_store:native_rdb" ] +# } + +# public_external_deps = [ +# "ability_base:base", +# "ability_base:configuration", +# "ability_base:session_info", +# "ability_base:want", +# "ability_base:zuri", +# "background_task_mgr:bgtaskmgr_innerkits", +# "bundle_framework:appexecfwk_base", +# "bundle_framework:appexecfwk_core", +# "init:libbegetutil", +# "jsoncpp:jsoncpp", +# "relational_store:native_dataability", +# "relational_store:native_rdb", +# ] + +# if (ability_runtime_graphics) { +# deps += [] +# external_deps += [ +# "ability_base:session_info", +# "image_framework:image_native", +# "window_manager:libwsutils", +# "window_manager:session_manager_lite", +# ] +# public_external_deps += [ "graphic_2d:color_manager" ] +# } +# subsystem_name = "ability" +# part_name = "ability_runtime" +# } + +# ohos_source_set("abilityms_stub") { +# sanitize = { +# cfi = true +# cfi_cross_dso = true +# debug = false +# } + +# output_values = get_target_outputs("${ability_runtime_innerkits_path}/ability_manager:ability_manager_interface") +# sources = [ +# "${output_values}/ability_manager_stub.cpp" +# ] + +# public_configs = [ +# "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", +# "${ability_runtime_services_path}/abilitymgr:abilityms_config", +# ] + +# public_deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub" ] + +# deps = [ +# "${ability_runtime_innerkits_path}/ability_manager:ability_manager_interface", +# "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", +# "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", +# "${ability_runtime_innerkits_path}/ability_manager:mission_info", +# "${ability_runtime_innerkits_path}/ability_manager:process_options", +# "${ability_runtime_innerkits_path}/ability_manager:start_window_option", +# "${ability_runtime_innerkits_path}/app_manager:app_manager", +# "${ability_runtime_path}/utils/global/freeze:freeze_util", +# "${ability_runtime_services_path}/abilitymgr:wantagent_manager", +# ] + +# external_deps = [ +# "bundle_framework:libappexecfwk_common", +# "c_utils:utils", +# "common_event_service:cesfwk_innerkits", +# "eventhandler:libeventhandler", +# "hilog:libhilog", +# "hisysevent:libhisysevent", +# "hitrace:hitrace_meter", +# "ipc:ipc_core", +# "ipc:ipc_napi", +# "jsoncpp:jsoncpp", +# "relational_store:native_dataability", +# "samgr:samgr_proxy", +# ] + +# if (host_cpu != "arm64") { +# external_deps += [ "relational_store:native_rdb" ] +# } + +# public_external_deps = [ +# "ability_base:base", +# "ability_base:configuration", +# "ability_base:session_info", +# "ability_base:want", +# "ability_base:zuri", +# "background_task_mgr:bgtaskmgr_innerkits", +# "bundle_framework:appexecfwk_base", +# "bundle_framework:appexecfwk_core", +# "init:libbegetutil", +# "jsoncpp:jsoncpp", +# "relational_store:native_dataability", +# "relational_store:native_rdb", +# ] + +# if (ability_runtime_graphics) { +# deps += [] +# external_deps += [ +# "ability_base:session_info", +# "image_framework:image_native", +# "window_manager:libwsutils", +# "window_manager:session_manager_lite", +# ] +# public_external_deps += [ "graphic_2d:color_manager" ] +# } +# subsystem_name = "ability" +# part_name = "ability_runtime" +# } + ohos_shared_library("abilityms") { sanitize = { cfi = true @@ -119,6 +277,7 @@ ohos_shared_library("abilityms") { configs = [ ":abilityms_config", ":abilityms_exception_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", ] include_dirs = [ "${ability_runtime_services_path}/appdfr/include", @@ -127,6 +286,8 @@ ohos_shared_library("abilityms") { ] deps = [ ":wantagent_manager", + "${ability_runtime_innerkits_path}/ability_manager:abilityms_proxy", + "${ability_runtime_innerkits_path}/ability_manager:abilityms_stub", "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub", "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", diff --git a/services/abilitymgr/abilitymgr.gni b/services/abilitymgr/abilitymgr.gni index 6da2249ea638b2d8703f26efc7fe6ad5125348b0..913b1f07634a4ad614042667449193ad108bcd51 100644 --- a/services/abilitymgr/abilitymgr.gni +++ b/services/abilitymgr/abilitymgr.gni @@ -20,8 +20,6 @@ abilityms_files = [ "src/ability_debug_deal.cpp", "src/ability_event_handler.cpp", "src/disposed_observer.cpp", - "src/ability_manager_service.cpp", - "src/ability_manager_stub.cpp", "src/ability_record.cpp", "src/ability_manager_collaborator_proxy.cpp", "src/ability_manager_xcollie.cpp", diff --git a/services/abilitymgr/include/ability_connect_manager.h b/services/abilitymgr/include/ability_connect_manager.h index bb7b93c35dcd3de3293c5bab04898a68a3c91736..7ebec9f7bd68c7eef267814403cd511ea9f98651 100644 --- a/services/abilitymgr/include/ability_connect_manager.h +++ b/services/abilitymgr/include/ability_connect_manager.h @@ -109,7 +109,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ int PreloadUIExtensionAbilityInner(const AbilityRequest &abilityRequest, std::string &hostBundleName, - int32_t hostPid = AAFwk::DEFAULT_INVAL_VALUE); + int32_t hostPid = -1); /** * PreloadUIExtensionAbilityLocked, preload uiextension ability. @@ -119,7 +119,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ int PreloadUIExtensionAbilityLocked(const AbilityRequest &abilityRequest, std::string &hostBundleName, - int32_t hostPid = AAFwk::DEFAULT_INVAL_VALUE); + int32_t hostPid = -1); /** * Query preload uiextension record. @@ -647,7 +647,7 @@ private: void HandleNotifyAssertFaultDialogDied(const std::shared_ptr &abilityRecord); EventInfo BuildEventInfo(const std::shared_ptr &abilityRecord); void UpdateUIExtensionInfo(const std::shared_ptr &abilityRecord, - int32_t hostPid = AAFwk::DEFAULT_INVAL_VALUE); + int32_t hostPid = -1); std::string GenerateBundleName(const AbilityRequest &abilityRequest) const; bool AddToServiceMap(const std::string &key, std::shared_ptr abilityRecord); diff --git a/services/abilitymgr/include/ability_first_frame_state_observer_manager.h b/services/abilitymgr/include/ability_first_frame_state_observer_manager.h index 7a4aa79b7cfff46898a0f2cf4eb8a3a940a6630d..c97a771e97cb9197198b8665f69fddeb88afd3c7 100644 --- a/services/abilitymgr/include/ability_first_frame_state_observer_manager.h +++ b/services/abilitymgr/include/ability_first_frame_state_observer_manager.h @@ -20,7 +20,7 @@ #include #include -#include "ability_first_frame_state_observer_interface.h" +#include "iability_first_frame_state_observer.h" #include "ability_record.h" #include "cpp/mutex.h" #include "singleton.h" diff --git a/services/abilitymgr/include/ability_manager_proxy.h b/services/abilitymgr/include/ability_manager_proxy.h deleted file mode 100644 index 75e0f121bac6f5c9fe9c8d67c3321138c5a4a1f1..0000000000000000000000000000000000000000 --- a/services/abilitymgr/include/ability_manager_proxy.h +++ /dev/null @@ -1,1704 +0,0 @@ -/* - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_PROXY_H -#define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_PROXY_H - -#include "ability_manager_interface.h" -#include "auto_startup_info.h" -#include "iremote_proxy.h" -#include "mission_info.h" -#include "intent_exemption_info.h" - -namespace OHOS { -namespace AAFwk { -using AutoStartupInfo = AbilityRuntime::AutoStartupInfo; -/** - * @class AbilityManagerProxy - * AbilityManagerProxy. - */ -class AbilityManagerProxy : public IRemoteProxy { -public: - explicit AbilityManagerProxy(const sptr &impl) : IRemoteProxy(impl) - {} - - virtual ~AbilityManagerProxy() - {} - - /** - * StartSelfUIAbility with want, start self uiability only on 2-in-1 devices. - * - * @param want, the want of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartSelfUIAbility(const Want &want) override; - - /** - * StartSelfUIAbility with want and startOptions, start self uiability only on 2-in-1 devices. - * - * @param want, the want of the ability to start. - * @param options, the startOptions of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartSelfUIAbilityWithStartOptions(const Want &want, - const StartOptions &options) override; - - /** - * StartAbility with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param requestCode, Ability request code. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * StartAbility with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param requestCode the resultCode of the ability to start. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * StartAbilityWithSpecifyTokenId with want and specialId, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param specialId the caller Id. - * @param userId, Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityWithSpecifyTokenId( - const Want &want, - const sptr &callerToken, - uint32_t specifyTokenId, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * StartAbility by insight intent, send want to ability manager service. - * - * @param want Ability want. - * @param callerToken caller ability token. - * @param intentId insight intent id. - * @param userId userId of target ability. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t StartAbilityByInsightIntent( - const Want &want, - const sptr &callerToken, - uint64_t intentId, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * Starts a new ability with specific start settings. - * - * @param want Indicates the ability to start. - * @param callerToken caller ability token. - * @param abilityStartSetting Indicates the setting ability used to start. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - const AbilityStartSetting &abilityStartSetting, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Starts a new ability with specific start options. - * - * @param want, the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbility( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Starts a new ability using the original caller information. - * - * @param want the want of the ability to start. - * @param callerToken current caller ability token. - * @param asCallerSourceToken source caller ability token. - * @param userId Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityAsCaller( - const Want &want, - const sptr &callerToken, - sptr asCallerSourceToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Starts a new ability using the original caller information. - * - * @param want the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken current caller ability token. - * @param asCallerSourceToken source caller ability token. - * @param userId Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityAsCaller( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - sptr asCallerSourceToken, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Starts a new ability for result using the original caller information. - * - * @param want the want of the ability to start. - * @param callerToken current caller ability token. - * @param requestCode the resultCode of the ability to start. - * @param userId Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - int StartAbilityForResultAsCaller( - const Want &want, - const sptr &callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * Starts a new ability for result using the original caller information. - * - * @param want the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken current caller ability token. - * @param requestCode the resultCode of the ability to start. - * @param userId Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - int StartAbilityForResultAsCaller( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - int requestCode = DEFAULT_INVAL_VALUE, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * Start ui session ability with extension session info, send session info to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param sessionInfo the information of UIExtensionContentSession. - * @param userId, Designation User ID. - * @param requestCode, Ability request code. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityByUIContentSession( - const Want &want, - const sptr &callerToken, - const sptr &sessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Start ui session ability with extension session info, send session info to ability manager service. - * - * @param want, the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @param callerToken, caller ability token. - * @param sessionInfo the information of UIExtensionContentSession. - * @param userId, Designation User ID. - * @param requestCode the resultCode of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityByUIContentSession( - const Want &want, - const StartOptions &startOptions, - const sptr &callerToken, - const sptr &sessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Start ui ability - * - * @param want the want of the ability to start. - * @param callerToken caller ability token. - * @param specifyTokenId The Caller ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityOnlyUIAbility( - const Want &want, - const sptr &callerToken, - uint32_t specifyTokenId) override; - - /** - * Start extension ability with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be started. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t StartExtensionAbility( - const Want &want, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) override; - - /** - * Create UIExtension with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - int RequestModalUIExtension(const Want &want) override; - - /** - * Preload UIExtension with want, send want to ability manager service. - * - * @param want, the want of the ability to start. - * @param hostBundleName, the caller application bundle name. - * @param userId, the extension runs in. - * @return Returns ERR_OK on success, others on failure. - */ - int PreloadUIExtensionAbility(const Want &want, std::string &hostBundleName, - int32_t userId = DEFAULT_INVAL_VALUE, int32_t hostPid = DEFAULT_INVAL_VALUE) override; - - int ChangeAbilityVisibility(sptr token, bool isShow) override; - - int ChangeUIAbilityVisibilityBySCB(sptr sessionInfo, bool isShow) override; - /** - * Start ui extension ability with extension session info, send extension session info to ability manager service. - * - * @param extensionSessionInfo the extension session info of the ability to start. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUIExtensionAbility( - const sptr &extensionSessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * Start ui ability with want, send want to ability manager service. - * - * @param sessionInfo the session info of the ability to start. - * @param isColdStart the session info of the ability is or not cold start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUIAbilityBySCB(sptr sessionInfo, bool &isColdStart, uint32_t sceneFlag = 0) override; - - /** - * Stop extension ability with want, send want to ability manager service. - * - * @param want, the want of the ability to stop. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be stopped. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StopExtensionAbility( - const Want& want, - const sptr& callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) override; - /** - * TerminateAbility, terminate the special ability. - * - * @param token, the token of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int TerminateAbility( - const sptr &token, int resultCode, const Want *resultWant = nullptr) override; - - /** - * BackToCallerAbilityWithResult, return to the caller ability. - * - * @param token, the token of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @param callerRequestCode, the requestCode of caller ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int BackToCallerAbilityWithResult(const sptr &token, int resultCode, - const Want *resultWant, int64_t callerRequestCode) override; - - /** - * TerminateUIServiceExtensionAbility, terminate UIServiceExtensionAbility. - * - * @param token, the token of the UIServiceExtensionAbility to terminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t TerminateUIServiceExtensionAbility(const sptr &token) override; - - /** - * TerminateUIExtensionAbility, terminate the special ui extension ability. - * - * @param extensionSessionInfo the extension session info of the ability to terminate. - * @param resultCode resultCode. - * @param Want Ability want returned. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int TerminateUIExtensionAbility(const sptr &extensionSessionInfo, int resultCode, - const Want *resultWant) override; - - /** - * CloseUIExtensionAbilityBySCB, terminate the specified ui extension ability by SCB. - * - * @param token the ability token. - * @return Returns ERR_OK on success, others on failure. - */ - int CloseUIExtensionAbilityBySCB(const sptr token) override; - - /** - * CloseUIAbilityBySCB, close the special ability by scb. - * - * @param sessionInfo the session info of the ability to terminate. - * @param sceneFlag the reason info of the ability to terminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CloseUIAbilityBySCB(const sptr &sessionInfo, bool isUserRequestedExit, - uint32_t sceneFlag = 0) override; - - /** - * SendResultToAbility with want, return want from ability manager service.(Only used for dms) - * - * @param requestCode, request code. - * @param resultCode, resultCode to return. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int SendResultToAbility(int32_t requestCode, int32_t resultCode, Want& resultWant) override; - - /** - * MoveAbilityToBackground. - * - * @param token, the token of the ability to move. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveAbilityToBackground(const sptr &token) override; - - /** - * Move the UIAbility to background, called by app self. - * - * @param token the token of the ability to move. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t MoveUIAbilityToBackground(const sptr token) override; - - /** - * CloseAbility, close the special ability. - * - * @param token, the token of the ability to terminate. - * @param resultCode, the resultCode of the ability to terminate. - * @param resultWant, the Want of the ability to return. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CloseAbility( - const sptr &token, int resultCode, const Want *resultWant = nullptr) override; - - /** - * MinimizeAbility, minimize the special ability. - * - * @param token, ability token. - * @param fromUser mark the minimize operation source. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MinimizeAbility(const sptr &token, bool fromUser = false) override; - - /** - * MinimizeUIExtensionAbility, minimize the special ui extension ability. - * - * @param extensionSessionInfo the extension session info of the ability to minimize. - * @param fromUser mark the minimize operation source. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MinimizeUIExtensionAbility(const sptr &extensionSessionInfo, - bool fromUser = false) override; - - /** - * MinimizeUIAbilityBySCB, minimize the special ability by scb. - * - * @param sessionInfo the session info of the ability to minimize. - * @param fromUser, Whether form user. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MinimizeUIAbilityBySCB(const sptr &sessionInfo, bool fromUser = false, - uint32_t sceneFlag = 0) override; - - /** - * ConnectAbility, connect session with service ability. - * - * @param want, Special want for service type's ability. - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @param callerToken, caller ability token. - * @param userId, Designation User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ConnectAbility( - const Want &want, - const sptr &connect, - const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - virtual int ConnectAbilityCommon( - const Want &want, - const sptr &connect, - const sptr &callerToken, - AppExecFwk::ExtensionAbilityType extensionType, - int32_t userId = DEFAULT_INVAL_VALUE, - bool isQueryExtensionOnly = false) override; - - virtual int ConnectUIExtensionAbility( - const Want &want, - const sptr &connect, - const sptr &sessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE, - sptr connectInfo = nullptr) override; - - /** - * DisconnectAbility, connect session with service ability. - * - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DisconnectAbility(sptr connect) override; - - /** - * AcquireDataAbility, acquire a data ability by its authority, if it not existed, - * AMS loads it synchronously. - * - * @param uri, data ability uri. - * @param isKill, true: when a data ability is died, ams will kill this client, or do nothing. - * @param callerToken, specifies the caller ability token. - * @return returns the data ability ipc object, or nullptr for failed. - */ - virtual sptr AcquireDataAbility( - const Uri &uri, bool isKill, const sptr &callerToken) override; - - /** - * ReleaseDataAbility, release the data ability that referenced by 'dataAbilityToken'. - * - * @param dataAbilityScheduler, specifies the data ability that will be released. - * @param callerToken, specifies the caller ability token. - * @return returns ERR_OK if succeeded, or error codes for failed. - */ - virtual int ReleaseDataAbility( - sptr dataAbilityScheduler, const sptr &callerToken) override; - - /** - * AttachAbilityThread, ability call this interface after loaded. - * - * @param scheduler,.the interface handler of kit ability. - * @param token,.ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AttachAbilityThread( - const sptr &scheduler, const sptr &token) override; - - /** - * AbilityTransitionDone, ability call this interface after lift cycle was changed. - * - * @param token,.ability's token. - * @param state,.the state of ability lift cycle. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AbilityTransitionDone(const sptr &token, int state, const PacMap &saveData) override; - - /** - * AbilityWindowConfigTransitionDone, ability call this interface after lift cycle was changed. - * - * @param token,.ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AbilityWindowConfigTransitionDone( - const sptr &token, const WindowConfig &windowConfig) override; - - /** - * ScheduleConnectAbilityDone, service ability call this interface while session was connected. - * - * @param token,.service ability's token. - * @param remoteObject,.the session proxy of service ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ScheduleConnectAbilityDone( - const sptr &token, const sptr &remoteObject) override; - - /** - * ScheduleDisconnectAbilityDone, service ability call this interface while session was disconnected. - * - * @param token,.service ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ScheduleDisconnectAbilityDone(const sptr &token) override; - - /** - * ScheduleCommandAbilityDone, service ability call this interface while session was commanded. - * - * @param token,.service ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ScheduleCommandAbilityDone(const sptr &token) override; - - virtual int ScheduleCommandAbilityWindowDone( - const sptr &token, - const sptr &sessionInfo, - WindowCommand winCmd, - AbilityCommand abilityCmd) override; - - /** - * dump ability stack info, about userID, mission stack info, - * mission record info and ability info. - * - * @param state Ability stack info. - * @return Returns ERR_OK on success, others on failure. - */ - virtual void DumpState(const std::string &args, std::vector &state) override; - virtual void DumpSysState( - const std::string& args, std::vector& state, bool isClient, bool isUserID, int UserID) override; - - /** - * Destroys this Service ability by Want. - * - * @param want, Special want for service type's ability. - * @param token ability's token. - * @return Returns true if this Service ability will be destroyed; returns false otherwise. - */ - virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE, - const sptr &token = nullptr) override; - - /** - * Get top ability. - * - * @param isNeedLocalDeviceId is need local device id. - * @return Returns front desk focus ability elementName. - */ - virtual AppExecFwk::ElementName GetTopAbility(bool isNeedLocalDeviceId = true) override; - - /** - * Get element name by token. - * - * @param token ability's token. - * @param isNeedLocalDeviceId is need local device id. - * @return Returns front desk focus ability elementName by token. - */ - virtual AppExecFwk::ElementName GetElementNameByToken(sptr token, - bool isNeedLocalDeviceId = true) override; - - /** - * Kill the process immediately. - * - * @param bundleName. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int KillProcess(const std::string &bundleName, bool clearPageStack = false, int32_t appIndex = 0) override; - - #ifdef ABILITY_COMMAND_FOR_TEST - /** - * force timeout ability. - * - * @param abilityName. - * @param state. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ForceTimeoutForTest(const std::string &abilityName, const std::string &state) override; - #endif - - /** - * Uninstall app - * - * @param bundleName bundle name of uninstalling app. - * @param uid uid of bundle. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int UninstallApp(const std::string &bundleName, int32_t uid) override; - - /** - * Uninstall app - * - * @param bundleName bundle name of uninstalling app. - * @param uid uid of bundle. - * @param appIndex the app index of app clone. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UninstallApp(const std::string &bundleName, int32_t uid, int32_t appIndex) override; - - /** - * Upgrade app, record exit reason and kill application - * - * @param bundleName bundle name of upgrading app. - * @param uid uid of bundle. - * @param exitMsg the exit reason message. - * @param appIndex the app index of app clone. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UpgradeApp(const std::string &bundleName, const int32_t uid, const std::string &exitMsg, - int32_t appIndex = 0) override; - - virtual sptr GetWantSender( - const WantSenderInfo &wantSenderInfo, const sptr &callerToken, int32_t uid = -1) override; - - virtual int SendWantSender(sptr target, const SenderInfo &senderInfo) override; - - virtual void CancelWantSender(const sptr &sender) override; - - virtual int GetPendingWantUid(const sptr &target) override; - - virtual int GetPendingWantUserId(const sptr &target) override; - - virtual std::string GetPendingWantBundleName(const sptr &target) override; - - virtual int GetPendingWantCode(const sptr &target) override; - - virtual int GetPendingWantType(const sptr &target) override; - - virtual void RegisterCancelListener(const sptr &sender, const sptr &receiver) override; - - virtual void UnregisterCancelListener( - const sptr &sender, const sptr &receiver) override; - - virtual int GetPendingRequestWant(const sptr &target, std::shared_ptr &want) override; - - virtual int GetWantSenderInfo(const sptr &target, std::shared_ptr &info) override; - - virtual int GetAppMemorySize() override; - - virtual bool IsRamConstrainedDevice() override; - virtual int ContinueMission(const std::string &srcDeviceId, const std::string &dstDeviceId, - int32_t missionId, const sptr &callBack, AAFwk::WantParams &wantParams) override; - - virtual int ContinueMission(AAFwk::ContinueMissionInfo continueMissionInfo, - const sptr &callback) override; - - virtual int ContinueAbility(const std::string &deviceId, int32_t missionId, uint32_t versionCode) override; - - virtual int StartContinuation(const Want &want, const sptr &abilityToken, int32_t status) override; - - virtual void NotifyCompleteContinuation(const std::string &deviceId, int32_t sessionId, bool isSuccess) override; - - virtual int NotifyContinuationResult(int32_t missionId, int32_t result) override; - - virtual int StartSyncRemoteMissions(const std::string& devId, bool fixConflict, int64_t tag) override; - - virtual int StopSyncRemoteMissions(const std::string& devId) override; - - virtual int LockMissionForCleanup(int32_t missionId) override; - - virtual int UnlockMissionForCleanup(int32_t missionId) override; - - virtual void SetLockedState(int32_t sessionId, bool lockedState) override; - - /** - * @brief Register mission listener to ability mgr. - * @param listener The handler of listener. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RegisterMissionListener(const sptr &listener) override; - - /** - * @brief UnRegister mission listener from ability mgr. - * @param listener The handler of listener. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int UnRegisterMissionListener(const sptr &listener) override; - - /** - * @brief Get mission infos from ability mgr. - * @param deviceId local or remote deviceId. - * @param numMax max number of missions. - * @param missionInfos mission info result. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetMissionInfos(const std::string& deviceId, int32_t numMax, - std::vector &missionInfos) override; - - /** - * @brief Get mission info by id. - * @param deviceId local or remote deviceId. - * @param missionId Id of target mission. - * @param missionInfo mission info of target mission. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetMissionInfo(const std::string& deviceId, int32_t missionId, - MissionInfo &missionInfos) override; - - /** - * @brief Clean mission by id. - * @param missionId Id of target mission. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CleanMission(int32_t missionId) override; - - /** - * @brief Clean all missions in system. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int CleanAllMissions() override; - - virtual int MoveMissionToFront(int32_t missionId) override; - - /** - * @brief Move a mission to front. - * @param missionId Id of target mission. - * @param startOptions Special startOptions for target mission. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveMissionToFront(int32_t missionId, const StartOptions &startOptions) override; - - /** - * Move missions to front - * @param missionIds Ids of target missions - * @param topMissionId Indicate which mission will be moved to top, if set to -1, missions' order won't change - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveMissionsToForeground(const std::vector& missionIds, int32_t topMissionId) override; - - /** - * Move missions to background - * @param missionIds Ids of target missions - * @param result The result of move missions to background, and the array is sorted by zOrder - * @return Returns ERR_OK on success, others on failure. - */ - virtual int MoveMissionsToBackground(const std::vector& missionIds, - std::vector& result) override; - - /** - * Start Ability, connect session with common ability. - * - * @param want, Special want for service type's ability. - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @param accountId Indicates the account to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartAbilityByCall(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE) override; - - virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr &connect, - const sptr &callerToken, int32_t accountId, std::string &errMsg) override; - - /** - * CallRequestDone, after invoke callRequest, ability will call this interface to return callee. - * - * @param token, ability's token. - * @param callStub, ability's callee. - */ - void CallRequestDone(const sptr &token, const sptr &callStub) override; - - /** - * Release the call between Ability, disconnect session with common ability. - * - * @param connect, Callback used to notify caller the result of connecting or disconnecting. - * @param element, the element of target service. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int ReleaseCall( - const sptr &connect, const AppExecFwk::ElementName &element) override; - - /** - * @brief start user. - * @param accountId accountId. - * @param isAppRecovery is appRecovery or not. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUser(int userId, sptr callback, bool isAppRecovery = false) override; - - /** - * @brief stop user. - * @param accountId accountId. - * @param callback callback. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StopUser(int userId, const sptr &callback) override; - - /** - * @brief logout user. - * @param accountId accountId. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int LogoutUser(int32_t userId, sptr callback) override; - - virtual int SetMissionContinueState(const sptr &token, const AAFwk::ContinueState &state) override; - -#ifdef SUPPORT_SCREEN - virtual int SetMissionLabel(const sptr &abilityToken, const std::string &label) override; - - virtual int SetMissionIcon(const sptr &token, - const std::shared_ptr &icon) override; - - virtual int RegisterWindowManagerServiceHandler(const sptr& handler, - bool animationEnabled) override; - - virtual void CompleteFirstFrameDrawing(const sptr &abilityToken) override; - - virtual void CompleteFirstFrameDrawing(int32_t sessionId) override; - - virtual int PrepareTerminateAbility( - const sptr &token, sptr &callback) override; - - virtual int GetDialogSessionInfo(const std::string &dialogSessionId, sptr &info) override; - - virtual int SendDialogResult(const Want &want, const std::string &dialogSessionId, bool isAllow) override; - - virtual int RegisterAbilityFirstFrameStateObserver(const sptr &observer, - const std::string &targetBundleName) override; - - virtual int UnregisterAbilityFirstFrameStateObserver( - const sptr &observer) override; -#endif - /** - * @brief Get the ability running information. - * - * @param info Ability running information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetAbilityRunningInfos(std::vector &info) override; - - /** - * @brief Get the extension running information. - * - * @param upperLimit The maximum limit of information wish to get. - * @param info Extension running information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetExtensionRunningInfos(int upperLimit, std::vector &info) override; - - /** - * @brief Get running process information. - * - * @param info Running process information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetProcessRunningInfos(std::vector &info) override; - - /** - * @brief Register mission listener to ability manager service. - * @param deviceId The remote device Id. - * @param listener The handler of listener. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RegisterMissionListener(const std::string &deviceId, - const sptr &listener) override; - - virtual int RegisterOnListener(const std::string &type, - const sptr &listener) override; - - virtual int RegisterOffListener(const std::string &deviceId, - const sptr &listener) override; - - virtual int UnRegisterMissionListener(const std::string &deviceId, - const sptr &listener) override; - - /** - * Set ability controller. - * - * @param abilityController, The ability controller. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int SetAbilityController(const sptr &abilityController, - bool imAStabilityTest) override; - - /** - * Is user a stability test. - * - * @return Returns true if user is a stability test. - */ - virtual bool IsRunningInStabilityTest() override; - - /** - * @brief Register the snapshot handler - * @param handler snapshot handler - * @return ErrCode Returns ERR_OK on success, others on failure. - */ - virtual int RegisterSnapshotHandler(const sptr& handler) override; - - /** - * @brief Get the Mission Snapshot Info object - * @param deviceId local or remote deviceId. - * @param missionId Id of target mission. - * @param snapshot snapshot of target mission. - * @param isLowResolution get low resolution snapshot. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetMissionSnapshot(const std::string& deviceId, int32_t missionId, - MissionSnapshot& snapshot, bool isLowResolution) override; - - /** - * @brief start user test. - * @param want the want of the ability user test to start. - * @param observer test observer callback. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartUserTest(const Want &want, const sptr &observer) override; - - /** - * @brief Finish user test. - * @param msg user test message. - * @param resultCode user test result Code. - * @param bundleName user test bundleName. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int FinishUserTest( - const std::string &msg, const int64_t &resultCode, const std::string &bundleName) override; - - /** - * GetTopAbility, get the token of top ability. - * - * @param token, the token of top ability. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int GetTopAbility(sptr &token) override; - - virtual int CheckUIExtensionIsFocused(uint32_t uiExtensionTokenId, bool& isFocused) override; - - /** - * The delegator calls this interface to move the ability to the foreground. - * - * @param token, ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DelegatorDoAbilityForeground(const sptr &token) override; - - /** - * The delegator calls this interface to move the ability to the background. - * - * @param token, ability's token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DelegatorDoAbilityBackground(const sptr &token) override; - - /** - * Calls this interface to move the ability to the foreground. - * - * @param token, ability's token. - * @param flag, use for lock or unlock flag and so on. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DoAbilityForeground(const sptr &token, uint32_t flag) override; - - /** - * Calls this interface to move the ability to the background. - * - * @param token, ability's token. - * @param flag, use for lock or unlock flag and so on. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DoAbilityBackground(const sptr &token, uint32_t flag) override; - - /** - * Get mission id by ability token. - * - * @param token The token of ability. - * @return Returns -1 if do not find mission, otherwise return mission id. - */ - virtual int32_t GetMissionIdByToken(const sptr &token) override; - - /** - * Get ability token by connect. - * - * @param token The token of ability. - * @param callStub The callee object. - */ - void GetAbilityTokenByCalleeObj(const sptr &callStub, sptr &token) override; - - /** - * Call free install from remote. - * - * @param want, the want of the ability to start. - * @param userId, Designation User ID. - * @param requestCode, Ability request code. - * @param callback, Callback from remote. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int FreeInstallAbilityFromRemote(const Want &want, const sptr &callback, - int32_t userId, int requestCode = DEFAULT_INVAL_VALUE) override; - - /** - * Add FreeInstall Observer - * - * @param observer the observer of ability free install start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int AddFreeInstallObserver(const sptr &callerToken, - const sptr &observer) override; - - /** - * Called when client complete dump. - * - * @param infos The dump info. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DumpAbilityInfoDone(std::vector &infos, const sptr &callerToken) override; - - /** - * Called to update mission snapshot. - * @param token The target ability. - * @param pixelMap The snapshot. - */ -#ifdef SUPPORT_SCREEN - virtual void UpdateMissionSnapShot(const sptr &token, - const std::shared_ptr &pixelMap) override; -#endif // SUPPORT_SCREEN - virtual void EnableRecoverAbility(const sptr& token) override; - virtual void SubmitSaveRecoveryInfo(const sptr& token) override; - virtual void ScheduleRecoverAbility(const sptr &token, int32_t reason, - const Want *want = nullptr) override; - - /** - * @brief Schedule clear recovery page stack. - * - * @param bundleName application bundleName. - */ - virtual void ScheduleClearRecoveryPageStack() override; - - /** - * Called to verify that the MissionId is valid. - * @param missionIds Query mission list. - * @param results Output parameters, return results up to 20 query results. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t IsValidMissionIds( - const std::vector &missionIds, std::vector &results) override; - - /** - * Query whether the application of the specified PID and UID has been granted a certain permission - * @param permission - * @param pid Process id - * @param uid - * @return Returns ERR_OK if the current process has the permission, others on failure. - */ - virtual int VerifyPermission(const std::string &permission, int pid, int uid) override; - - /** - * Request dialog service with want, send want to ability manager service. - * - * @param want, the want of the dialog service to start. - * @param callerToken, caller ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RequestDialogService(const Want &want, const sptr &callerToken) override; - - int32_t ReportDrawnCompleted(const sptr &callerToken) override; - - virtual int32_t AcquireShareData( - const int32_t &missionId, const sptr &shareData) override; - virtual int32_t ShareDataDone(const sptr &token, - const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam) override; - - /** - * Force app exit and record exit reason. - * @param pid Process id . - * @param exitReason The reason of app exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t ForceExitApp(const int32_t pid, const ExitReason &exitReason) override; - - /** - * Record app exit reason. - * @param exitReason The reason of app exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RecordAppExitReason(const ExitReason &exitReason) override; - - /** - * Record the process exit reason before the process being killed. - * @param pid The process id. - * @param exitReason The reason of process exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RecordProcessExitReason(const int32_t pid, const ExitReason &exitReason) override; - - /** - * Record the exit reason of a killed process. - * @param pid The process id. - * @param uid The process uid. - * @param exitReason The reason of process exit. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RecordProcessExitReason(int32_t pid, int32_t uid, const ExitReason &exitReason) override; - - /** - * Set rootSceneSession by SCB. - * - * @param rootSceneSession Indicates root scene session of SCB. - */ - virtual void SetRootSceneSession(const sptr &rootSceneSession) override; - - /** - * Call UIAbility by SCB. - * - * @param sessionInfo the session info of the ability to be called. - * @param isColdStart the session of the ability is or not cold start. - */ - virtual void CallUIAbilityBySCB(const sptr &sessionInfo, bool &isColdStart) override; - - /** - * Start specified ability by SCB. - * - * @param want Want information. - */ - void StartSpecifiedAbilityBySCB(const Want &want) override; - - /** - * Notify sandbox app the result of saving file. - * @param want Result of saving file, which contains the file's uri if success. - * @param resultCode Indicates the action's result. - * @param requestCode Pass the requestCode to match request. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t NotifySaveAsResult(const Want &want, int resultCode, int requestCode) override; - - /** - * Set sessionManagerService - * @param sessionManagerService the point of sessionManagerService. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetSessionManagerService(const sptr &sessionManagerService) override; - - /** - * @brief Register collaborator. - * @param type collaborator type. - * @param impl collaborator. - * @return 0 or else. - */ - virtual int32_t RegisterIAbilityManagerCollaborator( - int32_t type, const sptr &impl) override; - - /** - * @brief Unregister collaborator. - * @param type collaborator type. - * @return 0 or else. - */ - virtual int32_t UnregisterIAbilityManagerCollaborator(int32_t type) override; - - virtual int32_t RegisterStatusBarDelegate(sptr delegate) override; - - virtual int32_t KillProcessWithPrepareTerminate(const std::vector& pids) override; - - /** - * @brief the process with reason - * @param pid id of process. - * @param reason, kill process reason. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t KillProcessWithReason(int32_t pid, const ExitReason &reason) override; - - /** - * @brief Register auto start up callback for system api. - * @param callback The point of JsAbilityAutoStartupCallBack. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RegisterAutoStartupSystemCallback(const sptr &callback) override; - - /** - * @brief Unregister auto start up callback for system api. - * @param callback The point of JsAbilityAutoStartupCallBack. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UnregisterAutoStartupSystemCallback(const sptr &callback) override; - - /** - * @brief Set every application auto start up state. - * @param info The auto startup info,include bundle name, module name, ability name. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationAutoStartup(const AutoStartupInfo &info) override; - - /** - * @brief Cancel every application auto start up . - * @param info The auto startup info,include bundle name, module name, ability name. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t CancelApplicationAutoStartup(const AutoStartupInfo &info) override; - - /** - * @brief Query auto startup state all application. - * @param infoList Output parameters, return auto startup info list. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryAllAutoStartupApplications(std::vector &infoList) override; - - /** - * PrepareTerminateAbilityBySCB, prepare to terminate ability by scb. - * - * @param sessionInfo the session info of the ability to start. - * @param isPrepareTerminate the result of ability onPrepareToTerminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int PrepareTerminateAbilityBySCB(const sptr &sessionInfo, bool &isPrepareTerminate) override; - - /** - * @brief Register session handler. - * @param object The handler. - * - * @return Returns ERR_OK on success, others on failure. - */ - virtual int RegisterSessionHandler(const sptr &object) override; - - /** - * @brief Register app debug listener. - * @param listener App debug listener. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t RegisterAppDebugListener(sptr listener) override; - - /** - * @brief Unregister app debug listener. - * @param listener App debug listener. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t UnregisterAppDebugListener(sptr listener) override; - - /** - * @brief Attach app debug. - * @param bundleName The application bundle name. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t AttachAppDebug(const std::string &bundleName, bool isDebugFromLocal) override; - - /** - * @brief Detach app debug. - * @param bundleName The application bundle name. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t DetachAppDebug(const std::string &bundleName, bool isDebugFromLocal) override; - - /** - * @brief Execute intent. - * @param key The key of intent executing client. - * @param callerToken Caller ability token. - * @param param The Intent execute param. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t ExecuteIntent(uint64_t key, const sptr &callerToken, - const InsightIntentExecuteParam ¶m) override; - - /** - * @brief Check if ability controller can start. - * @param want The want of ability to start. - * @return Return true to allow ability to start, or false to reject. - */ - virtual bool IsAbilityControllerStart(const Want &want) override; - - /** - * @brief Called when insight intent execute finished. - * - * @param token ability's token. - * @param intentId insight intent id. - * @param result insight intent execute result. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t ExecuteInsightIntentDone(const sptr &token, uint64_t intentId, - const InsightIntentExecuteResult &result) override; - - /** - * @brief Set application auto start up state by EDM. - * @param info The auto startup info, include bundle name, module name, ability name. - * @param flag Indicate whether to allow the application to change the auto start up state. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t SetApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) override; - - /** - * @brief Cancel application auto start up state by EDM. - * @param info The auto startup info, include bundle name, module name, ability name. - * @param flag Indicate whether to allow the application to change the auto start up state. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t CancelApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) override; - - /** - * @brief Get foreground ui abilities. - * @param list Foreground ui abilities. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t GetForegroundUIAbilities(std::vector &list) override; - - /** - * @brief Open file by uri. - * @param uri The file uri. - * @param flag Want::FLAG_AUTH_READ_URI_PERMISSION or Want::FLAG_AUTH_WRITE_URI_PERMISSION. - * @return int The file descriptor. - */ - virtual int32_t OpenFile(const Uri& uri, uint32_t flag) override; - - /** - * @brief Update session info. - * @param sessionInfos The vector of session info. - */ - virtual int32_t UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, - std::vector &sessionIds) override; - - /** - * @brief Restart app self. - * @param want The ability type must be UIAbility. - * @param isAppRecovery True indicates that the app is restarted because of recovery. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t RestartApp(const AAFwk::Want &want, bool isAppRecovery = false) override; - - /** - * @brief Get host info of root caller. - * - * @param token The ability token. - * @param hostInfo The host info of root caller. - * @param userId The user id. - * @return int32_t Returns 0 on success, others on failure. - */ - int32_t GetUIExtensionRootHostInfo(const sptr token, UIExtensionHostInfo &hostInfo, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * @brief Get ui extension session info - * - * @param token The ability token. - * @param uiExtensionSessionInfo The ui extension session info. - * @param userId The user id. - * @return int32_t Returns ERR_OK on success, others on failure. - */ - int32_t GetUIExtensionSessionInfo(const sptr token, UIExtensionSessionInfo &uiExtensionSessionInfo, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * @brief Pop-up launch of full-screen atomic service. - * @param want The want with parameters. - * @param callerToken caller ability token. - * @param requestCode Ability request code. - * @param userId The User ID. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t OpenAtomicService(Want& want, const StartOptions &options, sptr callerToken, - int32_t requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * @brief Querying whether to allow embedded startup of atomic service. - * - * @param token The caller UIAbility token. - * @param appId The ID of the application to which this bundle belongs. - * @return Returns true to allow ability to start, or false to reject. - */ - virtual bool IsEmbeddedOpenAllowed(sptr callerToken, const std::string &appId) override; - - /** - * Set the enable status for starting and stopping resident processes. - * The caller application can only set the resident status of the configured process. - * @param bundleName The bundle name of the resident process. - * @param enable Set resident process enable status. - * @return Returns ERR_OK on success, others on failure. - */ - int32_t SetResidentProcessEnabled(const std::string &bundleName, bool enable) override; - - /** - * @brief Request to display assert fault dialog. - * @param callback Listen for user operation callbacks. - * @param wantParams Assert dialog box display information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RequestAssertFaultDialog( - const sptr &callback, const AAFwk::WantParams &wantParams) override; - - /** - * @brief Notify the operation status of the user. - * @param assertFaultSessionId Indicates the request ID of AssertFault. - * @param userStatus Operation status of the user. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t NotifyDebugAssertResult(uint64_t assertFaultSessionId, AAFwk::UserStatus userStatus) override; - - /** - * Starts a new ability with specific start options. - * - * @param want, the want of the ability to start. - * @param startOptions Indicates the options used to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t StartShortcut(const Want &want, const StartOptions &startOptions) override; - - /** - * Get ability state by persistent id. - * - * @param persistentId, the persistentId of the session. - * @param state Indicates the ability state. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t GetAbilityStateByPersistentId(int32_t persistentId, bool &state) override; - - /** - * Transfer resultCode & want to ability manager service. - * - * @param callerToken caller ability token. - * @param requestCode the resultCode of the ability to start. - * @param want Indicates the ability to start. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t TransferAbilityResultForExtension(const sptr &callerToken, int32_t resultCode, - const Want &want) override; - - /** - * Notify ability manager service frozen process. - * - * @param pidList, the pid list of the frozen process. - * @param uid, the uid of the frozen process. - */ - virtual void NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) override; - - /** - * Open atomic service window prior to finishing free install. - * - * @param bundleName, the bundle name of the atomic service. - * @param moduleName, the module name of the atomic service. - * @param abilityName, the ability name of the atomic service. - * @param startTime, the starting time of the free install task. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t PreStartMission(const std::string& bundleName, const std::string& moduleName, - const std::string& abilityName, const std::string& startTime) override; - - /** - * Request to clean UIAbility from user. - * - * @param sessionInfo the session info of the ability to clean. - * @param sceneFlag the reason info of the ability to terminate. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t CleanUIAbilityBySCB(const sptr &sessionInfo, bool isUserRequestedExit, - uint32_t sceneFlag = 0) override; - - /** - * Open link of ability and atomic service. - * - * @param want Ability want. - * @param callerToken Caller ability token. - * @param userId User ID. - * @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; - - /** - * Terminate the mission. - * - * @param missionId, The mission id of the UIAbility need to be terminated. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t TerminateMission(int32_t missionId) override; - - /** - * Notify ability manager to set the flag to block all apps from starting. - * Needs to apply for ohos.permission.BLOCK_ALL_APP_START. - * @param flag, The flag to block all apps from starting - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t BlockAllAppStart(bool flag) override; - - /** - * update associate config list by rss. - * - * @param configs The rss config info. - * @param exportConfigs The rss export config info. - * @param flag UPDATE_CONFIG_FLAG_COVER is cover config, UPDATE_CONFIG_FLAG_APPEND is append config. - */ - virtual int32_t UpdateAssociateConfigList(const std::map>& configs, - const std::list& exportConfigs, int32_t flag) override; - - /** - * Set keep-alive flag for application under a specific user. - * @param bundleName Bundle name. - * @param userId User Id. - * @param flag Keep-alive flag. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationKeepAlive(const std::string &bundleName, int32_t userId, bool flag) override; - - /** - * Get keep-alive applications. - * @param appType Application type. - * @param userId User Id. - * @param list List of Keep-alive information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryKeepAliveApplications(int32_t appType, int32_t userId, - std::vector &list) override; - - /** - * Set keep-alive flag for application under a specific user by EDM. - * @param bundleName Bundle name. - * @param userId User Id. - * @param flag Keep-alive flag. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t SetApplicationKeepAliveByEDM(const std::string &bundleName, int32_t userId, bool flag) override; - - /** - * Get keep-alive applications by EDM. - * @param appType Application type. - * @param userId User Id. - * @param list List of Keep-alive information. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryKeepAliveApplicationsByEDM(int32_t appType, int32_t userId, - std::vector &list) override; - - /** - * Get intent exemption info. - * @param list List of intent exemption info. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t GetAllIntentExemptionInfo(std::vector &info) override; - - /** - * Add query ERMS observer. - * - * @param callerToken, The caller ability token. - * @param observer, The observer of the ability to query ERMS. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t AddQueryERMSObserver(sptr callerToken, - sptr observer) override; - - /** - * Query atomic service ERMS rule. - * - * @param callerToken, The caller ability token. - * @param appId, The appId of the atomic service. - * @param startTime, The startTime of the query. - * @param rule, The returned ERMS rule. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryAtomicServiceStartupRule(sptr callerToken, - const std::string &appId, const std::string &startTime, AtomicServiceStartupRule &rule) override; - - /** - * PrepareTerminateAbilityDone, called when PrepareTerminateAbility call is done. - * - * @param token, the token of the ability to terminate. - * @param callback callback. - */ - virtual void PrepareTerminateAbilityDone(const sptr &token, bool isTerminate) override; - - /** - * KillProcessWithPrepareTerminateDone, called when KillProcessWithPrepareTerminate call is done. - * - * @param moduleName, the module name of the application. - * @param prepareTermination, the result of prepareTermination call of the module. - * @param isExist, whether the prepareTerminate functions are implemented. - */ - virtual void KillProcessWithPrepareTerminateDone(const std::string &moduleName, - int32_t prepareTermination, bool isExist) override; - - /** - * KillProcessForPermissionUpdate - * force kill the application by accessTokenId, notify exception to SCB. - * - * @param accessTokenId, accessTokenId. - * @return ERR_OK, return back success, others fail. - */ - virtual ErrCode KillProcessForPermissionUpdate(uint32_t accessTokenId) override; - - /** - * Register hidden start observer. - * @param observer, ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RegisterHiddenStartObserver(const sptr &observer) override; - - /** - * Unregister hidden start observer. - * @param observer, ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t UnregisterHiddenStartObserver(const sptr &observer) override; - - /** - * Query preload uiextension record. - * - * @param element, The uiextension ElementName. - * @param moduleName, The uiextension moduleName. - * @param hostBundleName, The uiextension caller hostBundleName. - * @param recordNum, The returned count of uiextension. - * @param userId, The User Id. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t QueryPreLoadUIExtensionRecord(const AppExecFwk::ElementName &element, - const std::string &moduleName, - const std::string &hostBundleName, - int32_t &recordNum, - int32_t userId = DEFAULT_INVAL_VALUE) override; - - /** - * Revoke delegator. - * - * @param token, ability token. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int32_t RevokeDelegator(sptr token) override; - -private: - template - int GetParcelableInfos(MessageParcel &reply, std::vector &parcelableInfos); - bool WriteInterfaceToken(MessageParcel &data); - // flag = true : terminate; flag = false : close - int TerminateAbility(const sptr &token, int resultCode, const Want *resultWant, bool flag); - ErrCode SendRequest(AbilityManagerInterfaceCode code, MessageParcel &data, MessageParcel &reply, - MessageOption& option); - int CheckUISessionParams(MessageParcel &data, const sptr &callerToken, - const sptr &sessionInfo, int32_t userId, int requestCode); - bool UpdateAssociateConfigInner(const std::map>& configs, - MessageParcel& data); - bool ExtendMaxIpcCapacityForWant(const Want &want, MessageParcel &data); - -private: - static inline BrokerDelegator delegator_; -}; -} // namespace AAFwk -} // namespace OHOS -#endif diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 79b3e74c318e447234978f9da5402a88802173bb..0afad1dbf4e9c028bb9789ccf34d9aa71a0eb2aa 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -69,8 +69,11 @@ #ifdef SUPPORT_GRAPHICS #include "implicit_start_processor.h" #include "system_dialog_scheduler.h" +#include "iconnection_observer.h" #endif - +#ifdef WITH_DLP +#include "dlp_connection_info.h" +#endif // WITH_DLP namespace OHOS { namespace AbilityRuntime { class IStatusBarDelegate; @@ -276,7 +279,7 @@ public: virtual int StartAbilityAsCaller( const Want &want, const sptr &callerToken, - sptr asCallerSourceToken, + const sptr &asCallerSourceToken, int32_t userId = DEFAULT_INVAL_VALUE, int requestCode = DEFAULT_INVAL_VALUE) override; @@ -295,9 +298,9 @@ public: const Want &want, const StartOptions &startOptions, const sptr &callerToken, - sptr asCallerSourceToken, + const sptr &asCallerSourceToken, int32_t userId = DEFAULT_INVAL_VALUE, - int requestCode = DEFAULT_INVAL_VALUE) override; + int32_t requestCode = DEFAULT_INVAL_VALUE) override; /** * Starts a new ability for result using the original caller information. @@ -375,7 +378,7 @@ public: * @param specifyTokenId The Caller ID. * @return Returns ERR_OK on success, others on failure. */ - virtual int StartAbilityOnlyUIAbility( + virtual ErrCode StartAbilityOnlyUIAbility( const Want &want, const sptr &callerToken, uint32_t specifyTokenId) override; @@ -389,8 +392,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 ErrCode OpenLink(const Want& want,const sptr& callerToken, + int32_t userId = DEFAULT_INVAL_VALUE, int32_t requestCode = DEFAULT_INVAL_VALUE) override; /** * Pop-up launch of full-screen atomic service. @@ -401,8 +404,9 @@ public: * @param userId The User ID. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t OpenAtomicService(Want& want, const StartOptions &options, sptr callerToken, - int32_t requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE) override; + virtual int32_t OpenAtomicService(const Want& want, const StartOptions &options, + const sptr &callerToken, int32_t requestCode = DEFAULT_INVAL_VALUE, + int32_t userId = DEFAULT_INVAL_VALUE) override; /** * @brief Querying whether to allow embedded startup of atomic service. @@ -411,7 +415,7 @@ public: * @param appId The ID of the application to which this bundle belongs. * @return Returns true to allow ability to start, or false to reject. */ - virtual bool IsEmbeddedOpenAllowed(sptr callerToken, const std::string &appId) override; + virtual int32_t IsEmbeddedOpenAllowed(const sptr &callerToken, const std::string &appId, bool& funcResult) override; /** * Start extension ability with want, send want to ability manager service. @@ -425,9 +429,10 @@ public: virtual int32_t StartExtensionAbility( const Want &want, const sptr &callerToken, - int32_t userId = DEFAULT_INVAL_VALUE, - AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) override; - + int32_t userId , + int32_t extensionType) override; + // int32_t userId = DEFAULT_INVAL_VALUE, +// AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED /** * Request modal UIExtension with want, send want to ability manager service. * @@ -436,14 +441,14 @@ public: */ int RequestModalUIExtension(const Want &want) override; - int PreloadUIExtensionAbility(const Want &want, std::string &hostBundleName, - int32_t userId = DEFAULT_INVAL_VALUE, int32_t hostPid = DEFAULT_INVAL_VALUE) override; + int PreloadUIExtensionAbility(const Want &want, const std::string &hostBundleName, + int32_t userId, int32_t hostPid) override; int UnloadUIExtensionAbility(const std::shared_ptr &abilityRecord, std::string &bundleName); - int ChangeAbilityVisibility(sptr token, bool isShow) override; + int ChangeAbilityVisibility(const sptr& token, bool isShow) override; - int ChangeUIAbilityVisibilityBySCB(sptr sessionInfo, bool isShow) override; + int ChangeUIAbilityVisibilityBySCB(const sptr& sessionInfo, bool isShow) override; /** * Start ui extension ability with extension session info, send extension session info to ability manager service. @@ -463,7 +468,7 @@ public: * @param isColdStart the session info of the ability is or not cold start. * @return Returns ERR_OK on success, others on failure. */ - virtual int StartUIAbilityBySCB(sptr sessionInfo, bool &isColdStart, uint32_t sceneFlag = 0) override; + virtual int StartUIAbilityBySCB(const sptr& sessionInfo, bool &isColdStart, uint32_t sceneFlag = 0) override; /** * Stop extension ability with want, send want to ability manager service. @@ -478,7 +483,7 @@ public: const Want& want, const sptr& callerToken, int32_t userId = DEFAULT_INVAL_VALUE, - AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) override; + int32_t extensionType = static_cast(AppExecFwk::ExtensionAbilityType::UNSPECIFIED)) override; /** * TerminateAbility, terminate the special ability. @@ -489,7 +494,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int TerminateAbility(const sptr &token, int resultCode = DEFAULT_INVAL_VALUE, - const Want *resultWant = nullptr) override; + const std::shared_ptr &resultWant = nullptr) override; /** * TerminateUIServiceExtensionAbility, terminate the UIServiceExtensionAbility. @@ -509,7 +514,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int BackToCallerAbilityWithResult(const sptr &token, int resultCode, - const Want *resultWant, int64_t callerRequestCode) override; + const std::shared_ptr &resultWant, int64_t callerRequestCode) override; /** * TerminateAbility, terminate the special ui extension ability. @@ -520,7 +525,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int TerminateUIExtensionAbility(const sptr &extensionSessionInfo, - int resultCode = DEFAULT_INVAL_VALUE, const Want *resultWant = nullptr) override; + int resultCode = DEFAULT_INVAL_VALUE, const std::shared_ptr &resultWant = nullptr) override; /** * CloseUIExtensionAbilityBySCB, terminate the specified ui extension ability by SCB. @@ -528,7 +533,7 @@ public: * @param token the ability token. * @return Returns ERR_OK on success, others on failure. */ - int CloseUIExtensionAbilityBySCB(const sptr token) override; + int CloseUIExtensionAbilityBySCB(const sptr& token) override; /** * CloseUIAbilityBySCB, close the special ability by scb. @@ -548,7 +553,7 @@ public: * @param resultWant, the Want of the ability to return. * @return Returns ERR_OK on success, others on failure. */ - virtual int SendResultToAbility(int32_t requestCode, int32_t resultCode, Want& resultWant) override; + virtual int SendResultToAbility(int32_t requestCode, int32_t resultCode,const Want& resultWant) override; /** * MoveAbilityToBackground. @@ -564,7 +569,7 @@ public: * @param token the token of the ability to move. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t MoveUIAbilityToBackground(const sptr token) override; + virtual int32_t MoveUIAbilityToBackground(const sptr& token) override; /** * CloseAbility, close the special ability. @@ -575,7 +580,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int CloseAbility(const sptr &token, int resultCode = DEFAULT_INVAL_VALUE, - const Want *resultWant = nullptr) override; + const std::shared_ptr &resultWant = nullptr) override; /** * MinimizeAbility, minimize the special ability. @@ -625,16 +630,16 @@ public: const Want &want, const sptr &connect, const sptr &callerToken, - AppExecFwk::ExtensionAbilityType extensionType, - int32_t userId = DEFAULT_INVAL_VALUE, - bool isQueryExtensionOnly = false) override; + int32_t extensionType, + int32_t userId, + bool isQueryExtensionOnly) override; virtual int ConnectUIExtensionAbility( const Want &want, const sptr &connect, const sptr &sessionInfo, int32_t userId = DEFAULT_INVAL_VALUE, - sptr connectInfo = nullptr) override; + const sptr& connectInfo = nullptr) override; /** * ContinueMission, continue ability from mission center. @@ -647,7 +652,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int ContinueMission(const std::string &srcDeviceId, const std::string &dstDeviceId, - int32_t missionId, const sptr &callBack, AAFwk::WantParams &wantParams) override; + int32_t missionId, const sptr &callBack, const AAFwk::WantParams &wantParams) override; /** * ContinueMission, continue ability from mission center. @@ -659,7 +664,7 @@ public: * @param wantParams, extended params. * @return Returns ERR_OK on success, others on failure. */ - virtual int ContinueMission(AAFwk::ContinueMissionInfo continueMissionInfo, + virtual int ContinueMission(const AAFwk::ContinueMissionInfo& continueMissionInfo, const sptr &callback) override; /** @@ -689,7 +694,7 @@ public: * @param isSuccess, continuation result. * @return */ - virtual void NotifyCompleteContinuation(const std::string &deviceId, int32_t sessionId, bool isSuccess) override; + virtual int NotifyCompleteContinuation(const std::string &deviceId, int32_t sessionId, bool isSuccess) override; /** * NotifyContinuationResult, notify continue result to ability. @@ -740,7 +745,7 @@ public: virtual int UnRegisterMissionListener(const std::string &deviceId, const sptr &listener)override; - virtual int DisconnectAbility(sptr connect) override; + virtual int DisconnectAbility(const sptr& connect) override; /** * AcquireDataAbility, acquire a data ability by its authority, if it not existed, @@ -751,8 +756,8 @@ public: * @param callerToken, specifies the caller ability token. * @return returns the data ability ipc object, or nullptr for failed. */ - virtual sptr AcquireDataAbility( - const Uri &uri, bool tryBind, const sptr &callerToken) override; + virtual int AcquireDataAbility(const Uri &uri, bool tryBind, const sptr &callerToken, + sptr& funcResult) override; /** * ReleaseDataAbility, release the data ability that referenced by 'dataAbilityToken'. @@ -762,7 +767,7 @@ public: * @return returns ERR_OK if succeeded, or error codes for failed. */ virtual int ReleaseDataAbility( - sptr dataAbilityScheduler, const sptr &callerToken) override; + const sptr& dataAbilityScheduler, const sptr &callerToken) override; /** * AttachAbilityThread, ability call this interface after loaded. @@ -781,7 +786,7 @@ public: * @param state,.the state of ability lift cycle. * @return Returns ERR_OK on success, others on failure. */ - virtual int AbilityTransitionDone(const sptr &token, int state, const PacMap &saveData) override; + virtual int AbilityTransitionDone(const sptr &token, int32_t state, const PacMap &saveData) override; /** * AbilityWindowConfigTransitionDone, ability call this interface after lift cycle was changed. @@ -865,9 +870,9 @@ public: * @param state Ability stack info. * @return Returns ERR_OK on success, others on failure. */ - virtual void DumpState(const std::string &args, std::vector &info) override; - virtual void DumpSysState( - const std::string& args, std::vector& info, bool isClient, bool isUserID, int UserID) override; + virtual int DumpState(const std::string &args, std::vector &info) override; + virtual int DumpSysState( + const std::string& args, std::vector& info, bool isClient, bool isUserID, int32_t UserID) override; /** * Destroys this Service ability by Want. @@ -918,49 +923,50 @@ public: virtual int32_t UpgradeApp(const std::string &bundleName, const int32_t uid, const std::string &exitMsg, int32_t appIndex = 0) override; - virtual sptr GetWantSender( - const WantSenderInfo &wantSenderInfo, const sptr &callerToken, int32_t uid = -1) override; + virtual int GetWantSender( + const WantSenderInfo &wantSenderInfo, const sptr &callerToken, int32_t uid, + sptr& funcResult) override; - virtual int SendWantSender(sptr target, const SenderInfo &senderInfo) override; + virtual int SendWantSender(const sptr& target, const SenderInfo &senderInfo) override; - virtual void CancelWantSender(const sptr &sender) override; + virtual int CancelWantSender(const sptr &sender) override; virtual int GetPendingWantUid(const sptr &target) override; virtual int GetPendingWantUserId(const sptr &target) override; - virtual std::string GetPendingWantBundleName(const sptr &target) override; + virtual int GetPendingWantBundleName(const sptr &target, std::string& funcResult) override; virtual int GetPendingWantCode(const sptr &target) override; virtual int GetPendingWantType(const sptr &target) override; - virtual void RegisterCancelListener(const sptr &sender, const sptr &receiver) override; + virtual int RegisterCancelListener(const sptr &sender, const sptr &receiver) override; - virtual void UnregisterCancelListener( + virtual int UnregisterCancelListener( const sptr &sender, const sptr &receiver) override; virtual int GetPendingRequestWant(const sptr &target, std::shared_ptr &want) override; virtual int GetWantSenderInfo(const sptr &target, std::shared_ptr &info) override; - virtual int RegisterObserver(const sptr &observer) override; + virtual int RegisterObserver(const sptr &observer); - virtual int UnregisterObserver(const sptr &observer) override; + virtual int UnregisterObserver(const sptr &observer); #ifdef WITH_DLP - virtual int GetDlpConnectionInfos(std::vector &infos) override; + virtual int GetDlpConnectionInfos(std::vector &infos); #endif // WITH_DLP - virtual int GetConnectionData(std::vector &connectionData) override; + virtual int GetConnectionData(std::vector &connectionData); - virtual void CancelWantSenderByFlags(const sptr &sender, uint32_t flags) override; + virtual void CancelWantSenderByFlags(const sptr &sender, uint32_t flags); virtual int LockMissionForCleanup(int32_t missionId) override; virtual int UnlockMissionForCleanup(int32_t missionId) override; - virtual void SetLockedState(int32_t sessionId, bool lockedState) override; + virtual int SetLockedState(int32_t sessionId, bool lockedState) override; virtual int RegisterMissionListener(const sptr &listener) override; @@ -987,7 +993,7 @@ public: virtual int32_t GetMissionIdByToken(const sptr &token) override; - void GetAbilityTokenByCalleeObj(const sptr &callStub, sptr &token) override; + int GetAbilityTokenByCalleeObj(const sptr &callStub, sptr &token) override; virtual int StartSyncRemoteMissions(const std::string& devId, bool fixConflict, int64_t tag) override; @@ -995,7 +1001,7 @@ public: virtual int GetAppMemorySize() override; - virtual bool IsRamConstrainedDevice() override; + virtual int IsRamConstrainedDevice(bool& funcResult) override; /** * Start Ability, connect session with common ability. * @@ -1024,7 +1030,7 @@ public: * @param token, ability's token. * @param callStub, ability's callee. */ - void CallRequestDone(const sptr &token, const sptr &callStub) override; + int CallRequestDone(const sptr &token, const sptr &callStub) override; /** * Release the call between Ability, disconnect session with common ability. @@ -1034,7 +1040,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ virtual int ReleaseCall( - const sptr &connect, const AppExecFwk::ElementName &element) override; + const sptr &connect, const ElementName &element) override; std::list> GetConnectRecordListByCallback(sptr callback); @@ -1203,11 +1209,11 @@ public: */ sptr GetAbilityTokenByMissionId(int32_t missionId); - virtual int StartUser(int userId, sptr callback, bool isAppRecovery = false) override; + virtual int StartUser(int userId,const sptr& callback, bool isAppRecovery = false) override; virtual int StopUser(int userId, const sptr &callback) override; - virtual int LogoutUser(int32_t userId, sptr callback) override; + virtual int LogoutUser(int32_t userId, const sptr &callback) override; /** * Called when client complete dump. @@ -1216,10 +1222,10 @@ public: * @param callerToken The caller ability token. * @return Returns ERR_OK on success, others on failure. */ - virtual int DumpAbilityInfoDone(std::vector &infos, const sptr &callerToken) override; + virtual int DumpAbilityInfoDone(const std::vector &infos, const sptr &callerToken) override; virtual int SetMissionContinueState(const sptr &abilityToken, - const AAFwk::ContinueState &state) override; + AAFwk::ContinueState state) override; #ifdef SUPPORT_SCREEN virtual int SetMissionLabel(const sptr &abilityToken, const std::string &label) override; @@ -1230,14 +1236,14 @@ public: virtual int RegisterWindowManagerServiceHandler(const sptr& handler, bool animationEnabled) override; - virtual void CompleteFirstFrameDrawing(const sptr &abilityToken) override; + virtual int CompleteFirstFrameDrawing(const sptr &abilityToken) override; - virtual void CompleteFirstFrameDrawing(int32_t sessionId) override; + virtual int CompleteFirstFrameDrawing(int32_t sessionId) override; sptr GetWMSHandler() const; virtual int PrepareTerminateAbility(const sptr &token, - sptr &callback) override; + const sptr &callback) override; void HandleFocused(const sptr &focusChangeInfo); @@ -1257,7 +1263,7 @@ public: void SetTargetCloneIndexInSameBundle(const Want &want, sptr callerToken); - virtual int RegisterAbilityFirstFrameStateObserver(const sptr &observer, + virtual int RegisterAbilityFirstFrameStateObserver(const sptr &observer, const std::string &bundleName) override; virtual int UnregisterAbilityFirstFrameStateObserver( @@ -1295,12 +1301,12 @@ public: * * @return Returns true if user is a stability test. */ - virtual bool IsRunningInStabilityTest() override; + virtual int IsRunningInStabilityTest(bool& funcResult) override; virtual int StartUserTest(const Want &want, const sptr &observer) override; virtual int FinishUserTest( - const std::string &msg, const int64_t &resultCode, const std::string &bundleName) override; + const std::string &msg,int64_t resultCode, const std::string &bundleName) override; /** * GetTopAbility, get the token of top ability. @@ -1366,17 +1372,17 @@ public: bool GetDataAbilityUri(const std::vector &abilityInfos, const std::string &mainAbility, std::string &uri); - virtual AppExecFwk::ElementName GetTopAbility(bool isNeedLocalDeviceId = true) override; + virtual int GetTopAbility(bool isNeedLocalDeviceId, ElementName& funcResult) override; - virtual AppExecFwk::ElementName GetElementNameByToken(sptr token, - bool isNeedLocalDeviceId = true) override; + virtual int GetElementNameByToken(const sptr& token, + bool isNeedLocalDeviceId, ElementName& funcResult) override; /** * AtomicServiceStatusCallback OnInstallFinished callback. * * @param resultCode FreeInstall result code. * @param want Want has been installed. - * @param userId User id. + * @param userId User4 id. */ void OnInstallFinished(int resultCode, const Want &want, int32_t userId); @@ -1428,15 +1434,14 @@ public: * @param pixelMap The snapshot. */ #ifdef SUPPORT_SCREEN - virtual void UpdateMissionSnapShot(const sptr &token, + virtual int UpdateMissionSnapShot(const sptr &token, const std::shared_ptr &pixelMap) override; #endif // SUPPORT_SCREEN - virtual void EnableRecoverAbility(const sptr& token) override; - virtual void SubmitSaveRecoveryInfo(const sptr& token) override; - virtual void ScheduleRecoverAbility(const sptr &token, int32_t reason, - const Want *want = nullptr) override; - - virtual void ScheduleClearRecoveryPageStack() override; + virtual int EnableRecoverAbility(const sptr& token) override; + virtual int SubmitSaveRecoveryInfo(const sptr& token) override; + virtual int ScheduleRecoverAbility(const sptr &token, int32_t reason, + const std::shared_ptr& want = nullptr) override; + virtual int ScheduleClearRecoveryPageStack() override; /** * Called to verify that the MissionId is valid. @@ -1452,9 +1457,9 @@ public: int32_t ReportDrawnCompleted(const sptr &callerToken) override; virtual int32_t AcquireShareData( - const int32_t &missionId, const sptr &shareData) override; + int32_t missionId, const sptr &shareData) override; virtual int32_t ShareDataDone(const sptr& token, - const int32_t &requestCode, const int32_t &uniqueId, WantParams &wantParam) override; + int32_t requestCode, int32_t uniqueId, const WantParams &wantParam) override; bool GetStartUpNewRuleFlag() const; @@ -1467,7 +1472,7 @@ public: * @param uid * @return Returns ERR_OK if the current process has the permission, others on failure. */ - virtual int VerifyPermission(const std::string &permission, int pid, int uid) override; + virtual int VerifyPermission(const std::string &permission, int32_t pid, int32_t uid) override; bool IsDmsAlive() const; @@ -1516,7 +1521,7 @@ public: * * @param rootSceneSession Indicates root scene session of SCB. */ - virtual void SetRootSceneSession(const sptr &rootSceneSession) override; + virtual int32_t SetRootSceneSession(const sptr &rootSceneSession) override; /** * Call UIAbility by SCB. @@ -1524,14 +1529,14 @@ public: * @param sessionInfo the session info of the ability to be called. * @param isColdStart the session of the ability is or not cold start. */ - virtual void CallUIAbilityBySCB(const sptr &sessionInfo, bool &isColdStart) override; + virtual int32_t CallUIAbilityBySCB(const sptr &sessionInfo, bool &isColdStart) override; /** * Start specified ability by SCB. * * @param want Want information. */ - virtual void StartSpecifiedAbilityBySCB(const Want &want) override; + virtual int32_t StartSpecifiedAbilityBySCB(const Want &want) override; /** * Notify sandbox app the result of saving file. @@ -1540,7 +1545,7 @@ public: * @param requestCode Pass the requestCode to match request. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t NotifySaveAsResult(const Want &want, int resultCode, int requestCode) override; + virtual int32_t NotifySaveAsResult(const Want &want, int32_t resultCode, int32_t requestCode) override; /** * Set sessionManagerService @@ -1579,7 +1584,7 @@ public: */ int32_t GetUserId() const; - virtual int32_t RegisterStatusBarDelegate(sptr delegate) override; + virtual int32_t RegisterStatusBarDelegate(const sptr& delegate) override; virtual int32_t KillProcessWithPrepareTerminate(const std::vector& pids) override; @@ -1634,14 +1639,14 @@ public: * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - int32_t RegisterAppDebugListener(sptr listener) override; + int32_t RegisterAppDebugListener(const sptr& listener) override; /** * @brief Unregister app debug listener. * @param listener App debug listener. * @return Returns ERR_OK on success, others on failure. */ - int32_t UnregisterAppDebugListener(sptr listener) override; + int32_t UnregisterAppDebugListener(const sptr& listener) override; /** * @brief Attach app debug. @@ -1684,7 +1689,7 @@ public: * @param want The want of ability to start. * @return Return true to allow ability to start, or false to reject. */ - virtual bool IsAbilityControllerStart(const Want &want) override; + virtual int32_t IsAbilityControllerStart(const Want &want) override; /** * @brief Called when insight intent execute finished. @@ -1733,8 +1738,8 @@ public: * @brief Update session info. * @param sessionInfos The vector of session info. */ - virtual int32_t UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, - std::vector &sessionIds) override; + virtual int32_t UpdateSessionInfoBySCB(const std::vector &sessionInfos, int32_t userId, + const std::vector &sessionIds) override; /** * @brief Restart app self. @@ -1752,7 +1757,7 @@ public: * @param userId The user id. * @return int32_t Returns ERR_OK on success, others on failure. */ - int32_t GetUIExtensionRootHostInfo(const sptr token, UIExtensionHostInfo &hostInfo, + int32_t GetUIExtensionRootHostInfo(const sptr& token, UIExtensionHostInfo &hostInfo, int32_t userId = DEFAULT_INVAL_VALUE) override; /** @@ -1763,7 +1768,7 @@ public: * @param userId The user id. * @return int32_t Returns ERR_OK on success, others on failure. */ - int32_t GetUIExtensionSessionInfo(const sptr token, UIExtensionSessionInfo &uiExtensionSessionInfo, + int32_t GetUIExtensionSessionInfo(const sptr& token, UIExtensionSessionInfo &uiExtensionSessionInfo, int32_t userId = DEFAULT_INVAL_VALUE) override; /** @@ -1830,7 +1835,7 @@ public: * @param pidList, the pid list of the frozen process. * @param uid, the uid of the frozen process. */ - virtual void NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) override; + virtual int32_t NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) override; /** * Open atomic service window prior to finishing free install. @@ -1853,8 +1858,8 @@ public: int32_t TerminateMission(int32_t missionId) override; - int32_t UpdateAssociateConfigList(const std::map>& configs, - const std::list& exportConfigs, int32_t flag) override; + int32_t UpdateAssociateConfigList(const std::unordered_map>& configs, + const std::vector& exportConfigs, int32_t flag) override; int32_t BlockAllAppStart(bool flag) override; @@ -1932,8 +1937,8 @@ public: * @param observer, The observer of the ability to query ERMS. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t AddQueryERMSObserver(sptr callerToken, - sptr observer) override; + virtual int32_t AddQueryERMSObserver(const sptr& callerToken, + const sptr& observer) override; /** * Query atomic service ERMS rule. @@ -1944,7 +1949,7 @@ public: * @param rule, The returned ERMS rule. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t QueryAtomicServiceStartupRule(sptr callerToken, + virtual int32_t QueryAtomicServiceStartupRule(const sptr& callerToken, const std::string &appId, const std::string &startTime, AtomicServiceStartupRule &rule) override; int StartUIAbilityForOptionWrap(const Want &want, const StartOptions &options, sptr callerToken, @@ -1957,7 +1962,7 @@ public: * @param token, the token of the ability to terminate. * @param callback callback. */ - virtual void PrepareTerminateAbilityDone(const sptr &token, bool isTerminate) override; + virtual int32_t PrepareTerminateAbilityDone(const sptr &token, bool isTerminate) override; /** * KillProcessForPermissionUpdate, call KillProcessForPermissionUpdate() through proxy object, @@ -1975,7 +1980,7 @@ public: * @param prepareTermination, the result of prepareTermination call of the module. * @param isExist, whether the prepareTerminate functions are implemented. */ - virtual void KillProcessWithPrepareTerminateDone(const std::string &moduleName, + virtual int32_t KillProcessWithPrepareTerminateDone(const std::string &moduleName, int32_t prepareTermination, bool isExist) override; std::shared_ptr GetAppExitReasonHelper() { @@ -2018,7 +2023,7 @@ public: * @param token, ability token. * @return Returns ERR_OK on success, others on failure. */ - virtual int32_t RevokeDelegator(sptr token) override; + virtual int32_t RevokeDelegator(const sptr& token) override; // MSG 0 - 20 represents timeout message static constexpr uint32_t LOAD_TIMEOUT_MSG = 0; diff --git a/services/abilitymgr/include/ability_manager_stub.h b/services/abilitymgr/include/ability_manager_stub.h deleted file mode 100644 index 9d75b8c106158fa7c6df2e456250978bc149227b..0000000000000000000000000000000000000000 --- a/services/abilitymgr/include/ability_manager_stub.h +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2023-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_STUB_H -#define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_STUB_H - -#include "ability_manager_interface.h" - -#include -#include -#ifdef WITH_DLP -#include "dlp_connection_info.h" -#endif // WITH_DLP -#include "iconnection_observer.h" - -namespace OHOS { -namespace AAFwk { -using AutoStartupInfo = AbilityRuntime::AutoStartupInfo; -/** - * @class AbilityManagerStub - * AbilityManagerStub. - */ -class AbilityManagerStub : public IRemoteStub { -public: - AbilityManagerStub(); - ~AbilityManagerStub(); - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - - /** - * Calls this interface to move the ability to the foreground. - * - * @param token, ability's token. - * @param flag, use for lock or unlock flag and so on. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DoAbilityForeground(const sptr &token, uint32_t flag) override; - - /** - * Calls this interface to move the ability to the background. - * - * @param token, ability's token. - * @param flag, use for lock or unlock flag and so on. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int DoAbilityBackground(const sptr &token, uint32_t flag) override; - - virtual int RegisterObserver(const sptr &observer); - - virtual int UnregisterObserver(const sptr &observer); - -#ifdef WITH_DLP - virtual int GetDlpConnectionInfos(std::vector &infos); -#endif // WITH_DLP - - virtual int GetConnectionData(std::vector &connectionData); - - virtual void CancelWantSenderByFlags(const sptr &sender, uint32_t flags); - -private: - int TerminateAbilityInner(MessageParcel &data, MessageParcel &reply); - int BackToCallerInner(MessageParcel &data, MessageParcel &reply); - int32_t TerminateUIServiceExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - int TerminateUIExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - int CloseUIExtensionAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int CloseUIAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int SendResultToAbilityInner(MessageParcel &data, MessageParcel &reply); - int MinimizeAbilityInner(MessageParcel &data, MessageParcel &reply); - int MinimizeUIExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - int MinimizeUIAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int AttachAbilityThreadInner(MessageParcel &data, MessageParcel &reply); - int AbilityTransitionDoneInner(MessageParcel &data, MessageParcel &reply); - int AbilityWindowConfigTransitionDoneInner(MessageParcel &data, MessageParcel &reply); - int ScheduleConnectAbilityDoneInner(MessageParcel &data, MessageParcel &reply); - int ScheduleDisconnectAbilityDoneInner(MessageParcel &data, MessageParcel &reply); - int ScheduleCommandAbilityDoneInner(MessageParcel &data, MessageParcel &reply); - int ScheduleCommandAbilityWindowDoneInner(MessageParcel &data, MessageParcel &reply); - int GetMissionSnapshotInner(MessageParcel &data, MessageParcel &reply); - int AcquireDataAbilityInner(MessageParcel &data, MessageParcel &reply); - int ReleaseDataAbilityInner(MessageParcel &data, MessageParcel &reply); - int KillProcessInner(MessageParcel &data, MessageParcel &reply); - int UninstallAppInner(MessageParcel &data, MessageParcel &reply); - int32_t UpgradeAppInner(MessageParcel &data, MessageParcel &reply); - int StartSelfUIAbilityInner(MessageParcel &data, MessageParcel &reply); - int StartSelfUIAbilityWithStartOptionsInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityInnerSpecifyTokenId(MessageParcel &data, MessageParcel &reply); - int StartAbilityByUIContentSessionAddCallerInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityByUIContentSessionForOptionsInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityAsCallerByTokenInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityAsCallerForOptionInner(MessageParcel &data, MessageParcel &reply); - int StartExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - int StartUIExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - int StartUIExtensionAbilityEmbeddedInner(MessageParcel &data, MessageParcel &reply); - int StartUIExtensionConstrainedEmbeddedInner(MessageParcel &data, MessageParcel &reply); - int StartUIAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int StopExtensionAbilityInner(MessageParcel& data, MessageParcel& reply); - int StartAbilityAddCallerInner(MessageParcel &data, MessageParcel &reply); - int ConnectAbilityInner(MessageParcel &data, MessageParcel &reply); - int ConnectAbilityWithTypeInner(MessageParcel &data, MessageParcel &reply); - int ConnectUIExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - int DisconnectAbilityInner(MessageParcel &data, MessageParcel &reply); - int StopServiceAbilityInner(MessageParcel &data, MessageParcel &reply); - int DumpStateInner(MessageParcel &data, MessageParcel &reply); - int DumpSysStateInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityForSettingsInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityForOptionsInner(MessageParcel &data, MessageParcel &reply); - int RequestModalUIExtensionInner(MessageParcel &data, MessageParcel &reply); - int ChangeAbilityVisibilityInner(MessageParcel &data, MessageParcel &reply); - int ChangeUIAbilityVisibilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int PreloadUIExtensionAbilityInner(MessageParcel &data, MessageParcel &reply); - - int GetWantSenderInner(MessageParcel &data, MessageParcel &reply); - int SendWantSenderInner(MessageParcel &data, MessageParcel &reply); - int CancelWantSenderInner(MessageParcel &data, MessageParcel &reply); - - int GetPendingWantUidInner(MessageParcel &data, MessageParcel &reply); - int GetPendingWantUserIdInner(MessageParcel &data, MessageParcel &reply); - int GetPendingWantBundleNameInner(MessageParcel &data, MessageParcel &reply); - int GetPendingWantCodeInner(MessageParcel &data, MessageParcel &reply); - int GetPendingWantTypeInner(MessageParcel &data, MessageParcel &reply); - - int RegisterCancelListenerInner(MessageParcel &data, MessageParcel &reply); - int UnregisterCancelListenerInner(MessageParcel &data, MessageParcel &reply); - - int GetPendingRequestWantInner(MessageParcel &data, MessageParcel &reply); - int GetWantSenderInfoInner(MessageParcel &data, MessageParcel &reply); - - int GetAppMemorySizeInner(MessageParcel &data, MessageParcel &reply); - int IsRamConstrainedDeviceInner(MessageParcel &data, MessageParcel &reply); - - int ContinueMissionInner(MessageParcel &data, MessageParcel &reply); - int ContinueMissionOfBundleNameInner(MessageParcel &data, MessageParcel &reply); - int ContinueAbilityInner(MessageParcel &data, MessageParcel &reply); - int StartContinuationInner(MessageParcel &data, MessageParcel &reply); - int NotifyCompleteContinuationInner(MessageParcel &data, MessageParcel &reply); - int NotifyContinuationResultInner(MessageParcel &data, MessageParcel &reply); - int RegisterRemoteMissionListenerInner(MessageParcel &data, MessageParcel &reply); - int RegisterRemoteOnListenerInner(MessageParcel &data, MessageParcel &reply); - int RegisterRemoteOffListenerInner(MessageParcel &data, MessageParcel &reply); - int UnRegisterRemoteMissionListenerInner(MessageParcel &data, MessageParcel &reply); - - int LockMissionForCleanupInner(MessageParcel &data, MessageParcel &reply); - int UnlockMissionForCleanupInner(MessageParcel &data, MessageParcel &reply); - int SetLockedStateInner(MessageParcel &data, MessageParcel &reply); - int RegisterMissionListenerInner(MessageParcel &data, MessageParcel &reply); - int UnRegisterMissionListenerInner(MessageParcel &data, MessageParcel &reply); - int GetMissionInfosInner(MessageParcel &data, MessageParcel &reply); - int GetMissionInfoInner(MessageParcel &data, MessageParcel &reply); - int CleanMissionInner(MessageParcel &data, MessageParcel &reply); - int CleanAllMissionsInner(MessageParcel &data, MessageParcel &reply); - int MoveMissionToFrontInner(MessageParcel &data, MessageParcel &reply); - int MoveMissionsToForegroundInner(MessageParcel &data, MessageParcel &reply); - int MoveMissionsToBackgroundInner(MessageParcel &data, MessageParcel &reply); - int GetMissionIdByTokenInner(MessageParcel &data, MessageParcel &reply); - - // for new version ability (call ability) - int StartAbilityByCallInner(MessageParcel &data, MessageParcel &reply); - int CallRequestDoneInner(MessageParcel &data, MessageParcel &reply); - int ReleaseCallInner(MessageParcel &data, MessageParcel &reply); - int StartUserInner(MessageParcel &data, MessageParcel &reply); - int StopUserInner(MessageParcel &data, MessageParcel &reply); - int LogoutUserInner(MessageParcel &data, MessageParcel &reply); - int GetAbilityRunningInfosInner(MessageParcel &data, MessageParcel &reply); - int GetExtensionRunningInfosInner(MessageParcel &data, MessageParcel &reply); - int GetProcessRunningInfosInner(MessageParcel &data, MessageParcel &reply); - int GetAllIntentExemptionInfoInner(MessageParcel &data, MessageParcel &reply); - - int StartSyncRemoteMissionsInner(MessageParcel &data, MessageParcel &reply); - int StopSyncRemoteMissionsInner(MessageParcel &data, MessageParcel &reply); - int RegisterSnapshotHandlerInner(MessageParcel &data, MessageParcel &reply); - int GetMissionSnapshotInfoInner(MessageParcel &data, MessageParcel &reply); - - int SetAbilityControllerInner(MessageParcel &data, MessageParcel &reply); - - int StartUserTestInner(MessageParcel &data, MessageParcel &reply); - int FinishUserTestInner(MessageParcel &data, MessageParcel &reply); - int GetTopAbilityTokenInner(MessageParcel &data, MessageParcel &reply); - int CheckUIExtensionIsFocusedInner(MessageParcel &data, MessageParcel &reply); - int DelegatorDoAbilityForegroundInner(MessageParcel &data, MessageParcel &reply); - int DelegatorDoAbilityBackgroundInner(MessageParcel &data, MessageParcel &reply); - int DoAbilityForegroundInner(MessageParcel &data, MessageParcel &reply); - int DoAbilityBackgroundInner(MessageParcel &data, MessageParcel &reply); - - int IsRunningInStabilityTestInner(MessageParcel &data, MessageParcel &reply); - int MoveMissionToFrontByOptionsInner(MessageParcel &data, MessageParcel &reply); - - int UpdateMissionSnapShotFromWMSInner(MessageParcel &data, MessageParcel &reply); - int RegisterConnectionObserverInner(MessageParcel &data, MessageParcel &reply); - int UnregisterConnectionObserverInner(MessageParcel &data, MessageParcel &reply); -#ifdef WITH_DLP - int GetDlpConnectionInfosInner(MessageParcel &data, MessageParcel &reply); -#endif // WITH_DLP - int GetConnectionDataInner(MessageParcel &data, MessageParcel &reply); - int MoveAbilityToBackgroundInner(MessageParcel &data, MessageParcel &reply); - int32_t MoveUIAbilityToBackgroundInner(MessageParcel &data, MessageParcel &reply); - int SetMissionContinueStateInner(MessageParcel &data, MessageParcel &reply); -#ifdef SUPPORT_GRAPHICS - int SetMissionLabelInner(MessageParcel &data, MessageParcel &reply); - int SetMissionIconInner(MessageParcel &data, MessageParcel &reply); - int RegisterWindowManagerServiceHandlerInner(MessageParcel &data, MessageParcel &reply); - int CompleteFirstFrameDrawingInner(MessageParcel &data, MessageParcel &reply); - int PrepareTerminateAbilityInner(MessageParcel &data, MessageParcel &reply); - int GetDialogSessionInfoInner(MessageParcel &data, MessageParcel &reply); - int SendDialogResultInner(MessageParcel &data, MessageParcel &reply); - int RegisterAbilityFirstFrameStateObserverInner(MessageParcel &data, MessageParcel &reply); - int UnregisterAbilityFirstFrameStateObserverInner(MessageParcel &data, MessageParcel &reply); - int CompleteFirstFrameDrawingBySCBInner(MessageParcel &data, MessageParcel &reply); -#endif - - #ifdef ABILITY_COMMAND_FOR_TEST - int ForceTimeoutForTestInner(MessageParcel &data, MessageParcel &reply); - #endif - - int FreeInstallAbilityFromRemoteInner(MessageParcel &data, MessageParcel &reply); - int AddFreeInstallObserverInner(MessageParcel &data, MessageParcel &reply); - - int EnableRecoverAbilityInner(MessageParcel &data, MessageParcel &reply); - int SubmitSaveRecoveryInfoInner(MessageParcel &data, MessageParcel &reply); - int ScheduleRecoverAbilityInner(MessageParcel &data, MessageParcel &reply); - int ScheduleClearRecoveryPageStackInner(MessageParcel &data, MessageParcel &reply); - int GetTopAbilityInner(MessageParcel &data, MessageParcel &reply); - int GetElementNameByTokenInner(MessageParcel &data, MessageParcel &reply); - int DumpAbilityInfoDoneInner(MessageParcel &data, MessageParcel &reply); - int32_t IsValidMissionIdsInner(MessageParcel &data, MessageParcel &reply); - - int VerifyPermissionInner(MessageParcel &data, MessageParcel &reply); - - int HandleRequestDialogService(MessageParcel &data, MessageParcel &reply); - int32_t HandleReportDrawnCompleted(MessageParcel &data, MessageParcel &reply); - - int AcquireShareDataInner(MessageParcel &data, MessageParcel &reply); - int ShareDataDoneInner(MessageParcel &data, MessageParcel &reply); - int GetAbilityTokenByCalleeObjInner(MessageParcel &data, MessageParcel &reply); - - int32_t ForceExitAppInner(MessageParcel &data, MessageParcel &reply); - int32_t RecordAppExitReasonInner(MessageParcel &data, MessageParcel &reply); - int32_t RecordProcessExitReasonInner(MessageParcel &data, MessageParcel &reply); - int32_t RecordProcessExitReasonPlusInner(MessageParcel &data, MessageParcel &reply); - int32_t SetResidentProcessEnableInner(MessageParcel &data, MessageParcel &reply); - - int SetRootSceneSessionInner(MessageParcel &data, MessageParcel &reply); - int CallUIAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int StartSpecifiedAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int NotifySaveAsResultInner(MessageParcel &data, MessageParcel &reply); - - int SetSessionManagerServiceInner(MessageParcel &data, MessageParcel &reply); - - int32_t RegisterIAbilityManagerCollaboratorInner(MessageParcel &data, MessageParcel &reply); - int32_t UnregisterIAbilityManagerCollaboratorInner(MessageParcel &data, MessageParcel &reply); - - int32_t RegisterStatusBarDelegateInner(MessageParcel &data, MessageParcel &reply); - int32_t KillProcessWithPrepareTerminateInner(MessageParcel &data, MessageParcel &reply); - - int32_t KillProcessWithReasonInner(MessageParcel &data, MessageParcel &reply); - - int32_t RegisterAutoStartupSystemCallbackInner(MessageParcel &data, MessageParcel &reply); - int32_t UnregisterAutoStartupSystemCallbackInner(MessageParcel &data, MessageParcel &reply); - int32_t SetApplicationAutoStartupInner(MessageParcel &data, MessageParcel &reply); - int32_t CancelApplicationAutoStartupInner(MessageParcel &data, MessageParcel &reply); - int32_t QueryAllAutoStartupApplicationsInner(MessageParcel &data, MessageParcel &reply); - - int PrepareTerminateAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int RegisterSessionHandlerInner(MessageParcel &data, MessageParcel &reply); - int32_t UpdateSessionInfoBySCBInner(MessageParcel &data, MessageParcel &reply); - - int32_t RegisterAppDebugListenerInner(MessageParcel &data, MessageParcel &reply); - int32_t UnregisterAppDebugListenerInner(MessageParcel &data, MessageParcel &reply); - int32_t AttachAppDebugInner(MessageParcel &data, MessageParcel &reply); - int32_t DetachAppDebugInner(MessageParcel &data, MessageParcel &reply); - int32_t ExecuteIntentInner(MessageParcel &data, MessageParcel &reply); - - int32_t SetApplicationAutoStartupByEDMInner(MessageParcel &data, MessageParcel &reply); - int32_t CancelApplicationAutoStartupByEDMInner(MessageParcel &data, MessageParcel &reply); - - int32_t IsAbilityControllerStartInner(MessageParcel &data, MessageParcel &reply); - int32_t OpenFileInner(MessageParcel &data, MessageParcel &reply); - - int32_t OpenAtomicServiceInner(MessageParcel &data, MessageParcel &reply); - int32_t IsEmbeddedOpenAllowedInner(MessageParcel &data, MessageParcel &reply); - - int StartAbilityForResultAsCallerInner(MessageParcel &data, MessageParcel &reply); - int StartAbilityForResultAsCallerForOptionsInner(MessageParcel &data, MessageParcel &reply); - - int32_t StartAbilityOnlyUIAbilityInner(MessageParcel &data, MessageParcel &reply); - - //insight intent related - int32_t StartAbilityByInsightIntentInner(MessageParcel &data, MessageParcel &reply); - int32_t ExecuteInsightIntentDoneInner(MessageParcel &data, MessageParcel &reply); - int32_t GetForegroundUIAbilitiesInner(MessageParcel &data, MessageParcel &reply); - int32_t RestartAppInner(MessageParcel &data, MessageParcel &reply); - - int32_t GetUIExtensionRootHostInfoInner(MessageParcel &data, MessageParcel &reply); - int32_t GetUIExtensionSessionInfoInner(MessageParcel &data, MessageParcel &reply); - int32_t RequestAssertFaultDialogInner(MessageParcel &data, MessageParcel &reply); - int32_t NotifyDebugAssertResultInner(MessageParcel &data, MessageParcel &reply); - int32_t StartShortcutInner(MessageParcel &data, MessageParcel &reply); - int32_t GetAbilityStateByPersistentIdInner(MessageParcel &data, MessageParcel &reply); - int32_t TransferAbilityResultForExtensionInner(MessageParcel &data, MessageParcel &reply); - int32_t NotifyFrozenProcessByRSSInner(MessageParcel &data, MessageParcel &reply); - int32_t CleanUIAbilityBySCBInner(MessageParcel &data, MessageParcel &reply); - int32_t PreStartMissionInner(MessageParcel &data, MessageParcel &reply); - int32_t SetApplicationKeepAliveInner(MessageParcel &data, MessageParcel &reply); - int32_t QueryKeepAliveApplicationsInner(MessageParcel &data, MessageParcel &reply); - int32_t SetApplicationKeepAliveByEDMInner(MessageParcel &data, MessageParcel &reply); - int32_t QueryKeepAliveApplicationsByEDMInner(MessageParcel &data, MessageParcel &reply); - int32_t AddQueryERMSObserverInner(MessageParcel &data, MessageParcel &reply); - int32_t QueryAtomicServiceStartupRuleInner(MessageParcel &data, MessageParcel &reply); - int32_t PrepareTerminateAbilityDoneInner(MessageParcel &data, MessageParcel &reply); - int32_t KillProcessWithPrepareTerminateDoneInner(MessageParcel &data, MessageParcel &reply); - int32_t KillProcessForPermissionUpdateInner(MessageParcel &data, MessageParcel &reply); - int32_t RegisterHiddenStartObserverInner(MessageParcel &data, MessageParcel &reply); - int32_t UnregisterHiddenStartObserverInner(MessageParcel &data, MessageParcel &reply); - int32_t QueryPreLoadUIExtensionRecordInner(MessageParcel &data, MessageParcel &reply); - int32_t RevokeDelegatorInner(MessageParcel &data, MessageParcel &reply); - - int OnRemoteRequestInnerFirst(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerSecond(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerThird(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerFourth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerFifth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerSixth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerSeventh(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerEighth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerNinth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerTenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerEleventh(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInner(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerTwelveth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerThirteenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerFourteenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerFifteenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerSixteenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerSeventeenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerEighteenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerNineteenth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int OnRemoteRequestInnerTwentieth(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int HandleOnRemoteRequestInnerFirst(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int HandleOnRemoteRequestInnerSecond(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option); - int32_t OpenLinkInner(MessageParcel &data, MessageParcel &reply); - int32_t TerminateMissionInner(MessageParcel &data, MessageParcel &reply); - int32_t BlockAllAppStartInner(MessageParcel &data, MessageParcel &reply); - int32_t UpdateAssociateConfigListInner(MessageParcel &data, MessageParcel &reply); -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_STUB_H diff --git a/services/abilitymgr/include/extension_record/extension_record_manager.h b/services/abilitymgr/include/extension_record/extension_record_manager.h index f45a6c553d064e79a6eb81d7cfe200a9fa7d687a..bf7060ef010118108040ebd7ff4ac404e691e9d5 100644 --- a/services/abilitymgr/include/extension_record/extension_record_manager.h +++ b/services/abilitymgr/include/extension_record/extension_record_manager.h @@ -88,7 +88,7 @@ public: int32_t CreateExtensionRecord(const AAFwk::AbilityRequest &abilityRequest, const std::string &hostBundleName, std::shared_ptr &extensionRecord, int32_t &extensionRecordId, - int32_t hostPid = AAFwk::DEFAULT_INVAL_VALUE); + int32_t hostPid = -1); bool IsPreloadExtensionRecord(const AAFwk::AbilityRequest &abilityRequest, const std::string &hostBundleName, std::shared_ptr &extensionRecord, bool &isLoaded); diff --git a/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp b/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp index 6cca42aa3fff2525bf433a8672873fece1b171c7..2d0b8ad70a9f333e3e23dd26167785b17a72bed2 100644 --- a/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp +++ b/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp @@ -15,7 +15,7 @@ #ifdef SUPPORT_GRAPHICS #include "ability_first_frame_state_observer_manager.h" - +#include "ability_first_frame_state_observer_recipient.h" #include "ability_first_frame_state_observer_stub.h" #include "hilog_tag_wrapper.h" #include "permission_verification.h" diff --git a/services/abilitymgr/src/ability_manager_client.cpp b/services/abilitymgr/src/ability_manager_client.cpp index 1ee4b1c8baad97ad54f327cc6f414702f9e6fee0..47b24956f2201354fea83cfd7807a8aa8aafe5b8 100644 --- a/services/abilitymgr/src/ability_manager_client.cpp +++ b/services/abilitymgr/src/ability_manager_client.cpp @@ -302,7 +302,7 @@ ErrCode AbilityManagerClient::StartExtensionAbility(const Want &want, sptrStartExtensionAbility(want, callerToken, userId, extensionType); + return abms->StartExtensionAbility(want, callerToken, userId, static_cast(extensionType)); } ErrCode AbilityManagerClient::RequestModalUIExtension(const Want &want) @@ -377,7 +377,7 @@ ErrCode AbilityManagerClient::StopExtensionAbility(const Want &want, sptrStopExtensionAbility(want, callerToken, userId, extensionType); + return abms->StopExtensionAbility(want, callerToken, userId, static_cast(extensionType)); } ErrCode AbilityManagerClient::TerminateAbility(sptr token, int resultCode, const Want *resultWant) @@ -385,7 +385,11 @@ ErrCode AbilityManagerClient::TerminateAbility(sptr token, int re auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); TAG_LOGD(AAFwkTag::ABILITYMGR, "call"); - return abms->TerminateAbility(token, resultCode, resultWant); + std::shared_ptr sharedWant = nullptr; + if (resultWant != nullptr) { + sharedWant = std::shared_ptr(const_cast(resultWant), [](Want*){}); + } + return abms->TerminateAbility(token, resultCode, sharedWant); } ErrCode AbilityManagerClient::BackToCallerAbilityWithResult(const sptr &token, int resultCode, @@ -394,7 +398,11 @@ ErrCode AbilityManagerClient::BackToCallerAbilityWithResult(const sptrBackToCallerAbilityWithResult(token, resultCode, resultWant, callerRequestCode); + std::shared_ptr sharedWant = nullptr; + if (resultWant != nullptr) { + sharedWant = std::shared_ptr(const_cast(resultWant), [](Want*){}); + } + return abms->BackToCallerAbilityWithResult(token, resultCode, sharedWant, callerRequestCode); } ErrCode AbilityManagerClient::TerminateUIServiceExtensionAbility(sptr token) @@ -406,7 +414,7 @@ ErrCode AbilityManagerClient::TerminateUIServiceExtensionAbility(sptr extensionSessionInfo, - int resultCode, const Want *resultWant) + int resultCode, const std::shared_ptr &resultWant) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); auto abms = GetAbilityManager(); @@ -447,6 +455,7 @@ ErrCode AbilityManagerClient::MoveUIAbilityToBackground(const sptrMoveUIAbilityToBackground(token); } +///调用函数创建两个吧 ErrCode AbilityManagerClient::CloseAbility(sptr token, int resultCode, const Want *resultWant) { #ifdef SUPPORT_SCREEN @@ -468,7 +477,11 @@ ErrCode AbilityManagerClient::CloseAbility(sptr token, int result auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); - return abms->CloseAbility(token, resultCode, resultWant); + std::shared_ptr sharedWant = nullptr; + if (resultWant != nullptr) { + sharedWant = std::shared_ptr(const_cast(resultWant), [](Want*){}); + } + return abms->CloseAbility(token, resultCode, sharedWant); } ErrCode AbilityManagerClient::CloseUIAbilityBySCB(sptr sessionInfo, @@ -527,7 +540,8 @@ ErrCode AbilityManagerClient::ConnectAbility(const Want &want, sptrConnectAbilityCommon(want, connect, nullptr, AppExecFwk::ExtensionAbilityType::SERVICE, userId); + bool isQueryExtensionOnly = false; + return abms->ConnectAbilityCommon(want, connect, nullptr, static_cast(AppExecFwk::ExtensionAbilityType::SERVICE), userId, isQueryExtensionOnly); } ErrCode AbilityManagerClient::ConnectAbility( @@ -538,7 +552,8 @@ ErrCode AbilityManagerClient::ConnectAbility( CHECK_POINTER_RETURN_NOT_CONNECTED(abms); TAG_LOGI(AAFwkTag::SERVICE_EXT, "name:%{public}s %{public}s, userId:%{public}d", want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), userId); - return abms->ConnectAbilityCommon(want, connect, callerToken, AppExecFwk::ExtensionAbilityType::SERVICE, userId); + bool isQueryExtensionOnly = false; + return abms->ConnectAbilityCommon(want, connect, callerToken, static_cast(AppExecFwk::ExtensionAbilityType::SERVICE), userId, isQueryExtensionOnly); } ErrCode AbilityManagerClient::ConnectUIServiceExtesnionAbility( @@ -549,8 +564,9 @@ ErrCode AbilityManagerClient::ConnectUIServiceExtesnionAbility( CHECK_POINTER_RETURN_NOT_CONNECTED(abms); TAG_LOGI(AAFwkTag::ABILITYMGR, "name:%{public}s %{public}s, userId:%{public}d", want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), userId); + bool isQueryExtensionOnly = false; return abms->ConnectAbilityCommon(want, connect, callerToken, - AppExecFwk::ExtensionAbilityType::UI_SERVICE, userId); + static_cast(AppExecFwk::ExtensionAbilityType::UI_SERVICE), userId, isQueryExtensionOnly);////////UI_SERVICE } ErrCode AbilityManagerClient::ConnectDataShareExtensionAbility(const Want &want, @@ -568,7 +584,9 @@ ErrCode AbilityManagerClient::ConnectDataShareExtensionAbility(const Want &want, TAG_LOGI(AAFwkTag::SERVICE_EXT, "name:%{public}s %{public}s, uri:%{public}s.", want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), want.GetUriString().c_str()); - return abms->ConnectAbilityCommon(want, connect, nullptr, AppExecFwk::ExtensionAbilityType::DATASHARE, userId); + bool isQueryExtensionOnly = false; + return abms->ConnectAbilityCommon(want, connect, nullptr, + static_cast(AppExecFwk::ExtensionAbilityType::DATASHARE), userId, isQueryExtensionOnly); } ErrCode AbilityManagerClient::ConnectExtensionAbility(const Want &want, sptr connect, @@ -584,7 +602,9 @@ ErrCode AbilityManagerClient::ConnectExtensionAbility(const Want &want, sptrConnectAbilityCommon(want, connect, nullptr, AppExecFwk::ExtensionAbilityType::UNSPECIFIED, userId); + bool isQueryExtensionOnly = false; + return abms->ConnectAbilityCommon(want, connect, nullptr, + static_cast(AppExecFwk::ExtensionAbilityType::UNSPECIFIED), userId, isQueryExtensionOnly); } ErrCode AbilityManagerClient::ConnectUIExtensionAbility(const Want &want, sptr connect, @@ -621,7 +641,11 @@ sptr AbilityManagerClient::AcquireDataAbility( if (!abms) { return nullptr; } - return abms->AcquireDataAbility(uri, tryBind, callerToken); + sptr tempIAbilityScheduler = nullptr; + if (abms->AcquireDataAbility(uri, tryBind, callerToken, tempIAbilityScheduler) != ERR_OK) { + return nullptr; + } + return tempIAbilityScheduler; } ErrCode AbilityManagerClient::ReleaseDataAbility( @@ -1082,7 +1106,8 @@ ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptrStartAbilityByCall(want, connect, nullptr, DEFAULT_INVAL_VALUE); + int32_t defaule_invale_value = -1; + return abms->StartAbilityByCall(want, connect, nullptr, defaule_invale_value); } ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr connect, @@ -1282,7 +1307,8 @@ ErrCode AbilityManagerClient::GetTopAbility(sptr &token) #endif //SUPPORT_SCREEN auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); - return abms->GetTopAbility(token); + AppExecFwk::ElementName elementName; + return abms->GetTopAbility(token, elementName); } AppExecFwk::ElementName AbilityManagerClient::GetElementNameByToken(sptr token, @@ -1294,7 +1320,11 @@ AppExecFwk::ElementName AbilityManagerClient::GetElementNameByToken(sptrGetElementNameByToken(token, isNeedLocalDeviceId); + AppExecFwk::ElementName elementName; + if (abms->GetElementNameByToken(token, isNeedLocalDeviceId, elementName) != ERR_OK) { + return {}; + } + return elementName; } ErrCode AbilityManagerClient::CheckUIExtensionIsFocused(uint32_t uiExtensionTokenId, bool& isFocused) @@ -1470,40 +1500,41 @@ ErrCode AbilityManagerClient::SetAbilityController(sptrSetAbilityController(abilityController, imAStabilityTest); } #ifdef SUPPORT_SCREEN -void AbilityManagerClient::UpdateMissionSnapShot(sptr token, +ErrCode AbilityManagerClient::UpdateMissionSnapShot(sptr token, std::shared_ptr pixelMap) { auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->UpdateMissionSnapShot(token, pixelMap); } #endif // SUPPORT_SCREEN -void AbilityManagerClient::EnableRecoverAbility(sptr token) +ErrCode AbilityManagerClient::EnableRecoverAbility(sptr token) { auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->EnableRecoverAbility(token); } -void AbilityManagerClient::ScheduleRecoverAbility(sptr token, int32_t reason, const Want *want) +int AbilityManagerClient::ScheduleRecoverAbility(const sptr token, int32_t reason, + const std::shared_ptr want) { TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->ScheduleRecoverAbility(token, reason, want); } -void AbilityManagerClient::SubmitSaveRecoveryInfo(sptr token) +ErrCode AbilityManagerClient::SubmitSaveRecoveryInfo(sptr token) { auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->SubmitSaveRecoveryInfo(token); } -void AbilityManagerClient::ScheduleClearRecoveryPageStack() +ErrCode AbilityManagerClient::ScheduleClearRecoveryPageStack() { auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->ScheduleClearRecoveryPageStack(); } @@ -1573,8 +1604,11 @@ AppExecFwk::ElementName AbilityManagerClient::GetTopAbility(bool isNeedLocalDevi TAG_LOGE(AAFwkTag::ABILITYMGR, "null abms"); return {}; } - - return abms->GetTopAbility(isNeedLocalDeviceId); + AppExecFwk::ElementName elementName; + if (abms->GetTopAbility(isNeedLocalDeviceId, elementName) != ERR_OK) { + return {}; + } + return elementName; } ErrCode AbilityManagerClient::DumpAbilityInfoDone(std::vector &infos, @@ -1932,13 +1966,15 @@ int32_t AbilityManagerClient::NotifyDebugAssertResult(uint64_t assertFaultSessio return abms->NotifyDebugAssertResult(assertFaultSessionId, userStatus); } -int32_t AbilityManagerClient::UpdateSessionInfoBySCB(std::list &sessionInfos, int32_t userId, +int32_t AbilityManagerClient::UpdateSessionInfoBySCB(std::vector &sessionInfos, int32_t userId, std::vector &sessionIds) { + auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); TAG_LOGD(AAFwkTag::ABILITYMGR, "scb call, UpdateSessionInfoBySCB"); - return abms->UpdateSessionInfoBySCB(sessionInfos, userId, sessionIds); + std::vector sessionInfoList(sessionInfos.begin(), sessionInfos.end()); + return abms->UpdateSessionInfoBySCB(sessionInfoList, userId, sessionIds); } ErrCode AbilityManagerClient::GetUIExtensionRootHostInfo(const sptr token, @@ -1965,7 +2001,8 @@ int32_t AbilityManagerClient::RestartApp(const AAFwk::Want &want) TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_INVALID_VALUE(abms); - return abms->RestartApp(want); + bool isAppRecovery = false; + return abms->RestartApp(want, isAppRecovery); } int32_t AbilityManagerClient::OpenAtomicService(Want& want, const StartOptions &options, @@ -1993,7 +2030,11 @@ bool AbilityManagerClient::IsEmbeddedOpenAllowed(sptr callerToken TAG_LOGE(AAFwkTag::ABILITYMGR, "null abms"); return false; } - return abms->IsEmbeddedOpenAllowed(callerToken, appId); + bool result = false; + if (abms->IsEmbeddedOpenAllowed(callerToken, appId, result) != ERR_OK) { + return false; + } + return result; } int32_t AbilityManagerClient::StartShortcut(const Want &want, const StartOptions &startOptions) @@ -2020,10 +2061,10 @@ int32_t AbilityManagerClient::TransferAbilityResultForExtension(const sptrTransferAbilityResultForExtension(callerToken, resultCode, want); } -void AbilityManagerClient::NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) +ErrCode AbilityManagerClient::NotifyFrozenProcessByRSS(const std::vector &pidList, int32_t uid) { auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->NotifyFrozenProcessByRSS(pidList, uid); } @@ -2095,13 +2136,19 @@ ErrCode AbilityManagerClient::BlockAllAppStart(bool flag) return abms->BlockAllAppStart(flag); } -ErrCode AbilityManagerClient::UpdateAssociateConfigList(const std::map>& configs, - const std::list& exportConfigs, int32_t flag) +ErrCode AbilityManagerClient::UpdateAssociateConfigList(const std::map>& configs, + const std::vector& exportConfigs, int32_t flag) { TAG_LOGD(AAFwkTag::ABILITYMGR, "call."); auto abms = GetAbilityManager(); CHECK_POINTER_RETURN_NOT_CONNECTED(abms); - return abms->UpdateAssociateConfigList(configs, exportConfigs, flag); + std::unordered_map> unorderedConfigs; + unorderedConfigs.reserve(configs.size()); + + for (const auto& [key, value] : configs) { + unorderedConfigs.emplace(key, value); + } + return abms->UpdateAssociateConfigList(unorderedConfigs, exportConfigs, flag); } ErrCode AbilityManagerClient::AddQueryERMSObserver(sptr callerToken, @@ -2139,20 +2186,20 @@ ErrCode AbilityManagerClient::StartSelfUIAbilityWithStartOptions(const Want &wan return abms->StartSelfUIAbilityWithStartOptions(want, options); } -void AbilityManagerClient::PrepareTerminateAbilityDone(sptr token, bool isTerminate) +ErrCode AbilityManagerClient::PrepareTerminateAbilityDone(sptr token, bool isTerminate) { TAG_LOGI(AAFwkTag::ABILITYMGR, "call PrepareTerminateAbilityDone"); auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->PrepareTerminateAbilityDone(token, isTerminate); } -void AbilityManagerClient::KillProcessWithPrepareTerminateDone(const std::string &moduleName, +ErrCode AbilityManagerClient::KillProcessWithPrepareTerminateDone(const std::string &moduleName, int32_t prepareTermination, bool isExist) { TAG_LOGI(AAFwkTag::ABILITYMGR, "call KillProcessWithPrepareTerminateDone"); auto abms = GetAbilityManager(); - CHECK_POINTER_RETURN(abms); + CHECK_POINTER_RETURN_NOT_CONNECTED(abms); return abms->KillProcessWithPrepareTerminateDone(moduleName, prepareTermination, isExist); } diff --git a/services/abilitymgr/src/ability_manager_proxy.cpp b/services/abilitymgr/src/ability_manager_proxy.cpp index 92eed91ba463b1badb33002ba11988075bb362d6..ee89d6a2b2932a9692e86b3a12a77d9d11633162 100644 --- a/services/abilitymgr/src/ability_manager_proxy.cpp +++ b/services/abilitymgr/src/ability_manager_proxy.cpp @@ -886,13 +886,16 @@ int AbilityManagerProxy::StopExtensionAbility(const Want &want, const sptr &token, int resultCode, const Want *resultWant) + + +int AbilityManagerProxy::TerminateAbility(const sptr &token, int resultCode, + const std::shared_ptr &resultWant) { return TerminateAbility(token, resultCode, resultWant, true); } int AbilityManagerProxy::TerminateAbility(const sptr &token, - int resultCode, const Want *resultWant, bool flag) + int resultCode, const std::shared_ptr &resultWant, bool flag) { int error; MessageParcel data; @@ -930,7 +933,7 @@ int AbilityManagerProxy::TerminateAbility(const sptr &token, } int AbilityManagerProxy::BackToCallerAbilityWithResult(const sptr &token, int resultCode, - const Want *resultWant, int64_t callerRequestCode) + const std::shared_ptr &resultWant, int64_t callerRequestCode) { int error; MessageParcel data; @@ -1001,7 +1004,7 @@ int32_t AbilityManagerProxy::TerminateUIServiceExtensionAbility(const sptr &extensionSessionInfo, int resultCode, - const Want *resultWant) + const std::shared_ptr &resultWant) { int error; MessageParcel data; @@ -1183,7 +1186,7 @@ int32_t AbilityManagerProxy::MoveUIAbilityToBackground(const sptr return reply.ReadInt32(); } -int AbilityManagerProxy::CloseAbility(const sptr &token, int resultCode, const Want *resultWant) +int AbilityManagerProxy::CloseAbility(const sptr &token, int resultCode, const std::shared_ptr &resultWant) { return TerminateAbility(token, resultCode, resultWant, false); } @@ -1884,7 +1887,8 @@ void AbilityManagerProxy::EnableRecoverAbility(const sptr& token) return; } -void AbilityManagerProxy::ScheduleRecoverAbility(const sptr& token, int32_t reason, const Want *want) +void AbilityManagerProxy::ScheduleRecoverAbility(const sptr& token, int32_t reason, + const std::shared_ptr &want) { int error; MessageParcel data; diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 8317a8533dc7ccbc316b2d5ea5a14f0a76110a27..4388e61a24b1920f4b8970d6eff93a2672dea8e6 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -851,7 +851,7 @@ int AbilityManagerService::StartAbilityOnlyUIAbility(const Want &want, const spt } int AbilityManagerService::StartAbilityAsCaller(const Want &want, const sptr &callerToken, - sptr asCallerSourceToken, int32_t userId, int requestCode) + const sptr &asCallerSourceToken, int32_t userId, int requestCode) { return StartAbilityAsCallerDetails(want, callerToken, asCallerSourceToken, userId, requestCode); } @@ -1759,8 +1759,8 @@ int AbilityManagerService::StartUIAbilityForOptionWrap(const Want &want, const S } int AbilityManagerService::StartAbilityAsCaller(const Want &want, const StartOptions &startOptions, - const sptr &callerToken, sptr asCallerSourceToken, - int32_t userId, int requestCode) + const sptr &callerToken, const sptr &asCallerSourceToken, + int32_t userId, int32_t requestCode) { TAG_LOGD(AAFwkTag::ABILITYMGR, "Start ability as caller with startOptions."); CHECK_CALLER_IS_SYSTEM_APP; @@ -2276,8 +2276,8 @@ int32_t AbilityManagerService::RequestDialogServiceInner(const Want &want, const return connectManager->StartAbility(abilityRequest); } -int32_t AbilityManagerService::OpenAtomicService(AAFwk::Want& want, const StartOptions &options, - sptr callerToken, int32_t requestCode, int32_t userId) +int32_t AbilityManagerService::OpenAtomicService(const Want& want, const StartOptions &options, + const sptr &callerToken, int32_t requestCode, int32_t userId) { auto accessTokenId = IPCSkeleton::GetCallingTokenID(); auto type = Security::AccessToken::AccessTokenKit::GetTokenTypeFlag(accessTokenId); @@ -4413,7 +4413,7 @@ int32_t AbilityManagerService::ConnectAbility( int32_t AbilityManagerService::ConnectAbilityCommon( const Want &want, const sptr &connect, const sptr &callerToken, - AppExecFwk::ExtensionAbilityType extensionType, int32_t userId, bool isQueryExtensionOnly) + int32_t extensionType, int32_t userId, bool isQueryExtensionOnly) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); TAG_LOGI(AAFwkTag::SERVICE_EXT, @@ -5756,33 +5756,38 @@ bool AbilityManagerService::GenerateDataAbilityRequestByUri(const std::string& d return true; } -sptr AbilityManagerService::AcquireDataAbility( - const Uri &uri, bool tryBind, const sptr &callerToken) + +int AbilityManagerService::AcquireDataAbility(const Uri &uri, bool tryBind, + const sptr &callerToken, sptr& funcResult) { auto localUri(uri); if (localUri.GetScheme() != AbilityConfig::SCHEME_DATA_ABILITY) { TAG_LOGE(AAFwkTag::ABILITYMGR, "acquire data ability invalid uri scheme"); - return nullptr; + funcResult = nullptr; + return ERR_INVALID_VALUE; } std::vector pathSegments; localUri.GetPathSegments(pathSegments); if (pathSegments.empty()) { TAG_LOGE(AAFwkTag::ABILITYMGR, "acquire data ability invalid uri path"); - return nullptr; + funcResult = nullptr; + return ERR_INVALID_VALUE; } auto userId = GetValidUserId(INVALID_USER_ID); AbilityRequest abilityRequest; if (!GenerateDataAbilityRequestByUri(localUri.ToString(), abilityRequest, callerToken, userId)) { TAG_LOGE(AAFwkTag::ABILITYMGR, "generate data ability request failed"); - return nullptr; + funcResult = nullptr; + return ERR_INVALID_VALUE; } auto isShellCall = AAFwk::PermissionVerification::GetInstance()->IsShellCall(); auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); if (!isSaCall && CheckCallDataAbilityPermission(abilityRequest, isShellCall, isSaCall) != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "invalid ability request info acquiring"); - return nullptr; + funcResult = nullptr; + return ERR_INVALID_VALUE; } TAG_LOGD(AAFwkTag::ABILITYMGR, "Query data ability info: %{public}s|%{public}s|%{public}s", @@ -5792,12 +5797,14 @@ sptr AbilityManagerService::AcquireDataAbility( if (CheckStaticCfgPermission(abilityRequest, false, -1, true, isSaCall) != AppExecFwk::Constants::PERMISSION_GRANTED) { TAG_LOGI(AAFwkTag::ABILITYMGR, "checkStaticCfgPermission fail"); - return nullptr; + funcResult = nullptr; + return ERR_INVALID_VALUE; } if (!VerificationAllToken(callerToken)) { TAG_LOGI(AAFwkTag::ABILITYMGR, "verificationAllToken fail"); - return nullptr; + funcResult = nullptr; + return ERR_INVALID_VALUE; } if (abilityRequest.abilityInfo.applicationInfo.singleton) { @@ -5805,11 +5812,20 @@ sptr AbilityManagerService::AcquireDataAbility( } std::shared_ptr dataAbilityManager = GetDataAbilityManagerByUserId(userId); - CHECK_POINTER_AND_RETURN(dataAbilityManager, nullptr); + if (!dataAbilityManager) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "dataAbilityManager nullptr"); + funcResult = nullptr; + return ERR_INVALID_VALUE; + } ReportEventToRSS(abilityRequest.abilityInfo, callerToken); bool isNotHap = isSaCall || isShellCall; UpdateCallerInfoUtil::GetInstance().UpdateCallerInfo(abilityRequest.want, callerToken); - return dataAbilityManager->Acquire(abilityRequest, tryBind, callerToken, isNotHap); + funcResult = dataAbilityManager->Acquire(abilityRequest, tryBind, callerToken, isNotHap); + if (funcResult) { + return ERR_OK; + } else { + return ERR_INVALID_VALUE; + } } int AbilityManagerService::ReleaseDataAbility( @@ -8674,7 +8690,7 @@ void AbilityManagerService::AppRecoverKill(pid_t pid, int32_t reason) IN_PROCESS_CALL(DelayedSingleton::GetInstance()->NotifyAppFaultBySA(faultDataSA)); } -void AbilityManagerService::ScheduleRecoverAbility(const sptr& token, int32_t reason, const Want *want) +void AbilityManagerService::ScheduleRecoverAbility(const sptr& token, int32_t reason, const std::shared_ptr& want) { if (token == nullptr) { return; @@ -8722,7 +8738,7 @@ void AbilityManagerService::ScheduleRecoverAbility(const sptr& to return; } - if (want != nullptr) { + if (want) { TAG_LOGD(AAFwkTag::ABILITYMGR, "BundleName:%{public}s targetBundleName:%{public}s.", appInfo.bundleName.c_str(), want->GetElement().GetBundleName().c_str()); if (want->GetElement().GetBundleName().empty() || @@ -9778,7 +9794,7 @@ void AbilityManagerService::ShowIllegalInfomation(std::string& result) result.append(ILLEGAL_INFOMATION); } -int AbilityManagerService::DumpAbilityInfoDone(std::vector &infos, const sptr &callerToken) +int AbilityManagerService::DumpAbilityInfoDone(const std::vector &infos, const sptr &callerToken) { TAG_LOGD(AAFwkTag::ABILITYMGR, "dumpAbilityInfoDone begin"); auto abilityRecord = Token::GetAbilityRecordByToken(callerToken); @@ -12511,33 +12527,40 @@ int32_t AbilityManagerService::SignRestartAppFlag(int32_t userId, int32_t uid, c } } -bool AbilityManagerService::IsEmbeddedOpenAllowed(sptr callerToken, const std::string &appId) +//注意调用方 这里要看一下 +int AbilityManagerService::IsEmbeddedOpenAllowed(const sptr &callerToken, + const std::string &appId, bool& funcResult) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); if (!AppUtils::GetInstance().IsLaunchEmbededUIAbility()) { TAG_LOGE(AAFwkTag::ABILITYMGR, "device type not allowd"); - return false; + funcResult = false; + return ERR_INVALID_VALUE; } auto accessTokenId = IPCSkeleton::GetCallingTokenID(); auto type = Security::AccessToken::AccessTokenKit::GetTokenTypeFlag(accessTokenId); if (type != Security::AccessToken::TypeATokenTypeEnum::TOKEN_HAP) { TAG_LOGE(AAFwkTag::ABILITYMGR, "caller not hap"); - return false; + funcResult = false; + return ERR_INVALID_VALUE; } auto uiAbilityManager = GetUIAbilityManagerByUid(IPCSkeleton::GetCallingUid()); CHECK_POINTER_AND_RETURN(uiAbilityManager, ERR_INVALID_VALUE); auto callerAbility = uiAbilityManager->GetAbilityRecordByToken(callerToken); if (callerAbility == nullptr) { TAG_LOGE(AAFwkTag::ABILITYMGR, "caller invalid"); - return false; + funcResult = false; + return ERR_INVALID_VALUE; } if (callerAbility->GetApplicationInfo().accessTokenId != accessTokenId) { TAG_LOGE(AAFwkTag::ABILITYMGR, "callerToken don't belong caller"); - return false; + funcResult = false; + return ERR_INVALID_VALUE; } if (!callerAbility->IsForeground() && !callerAbility->GetAbilityForegroundingFlag()) { TAG_LOGE(AAFwkTag::ABILITYMGR, "caller not foreground"); - return false; + funcResult = false; + return ERR_INVALID_VALUE; } CHECK_POINTER_AND_RETURN(freeInstallManager_, false); std::string bundleName = ATOMIC_SERVICE_PREFIX + appId; @@ -12548,11 +12571,17 @@ bool AbilityManagerService::IsEmbeddedOpenAllowed(sptr callerToke int32_t ret = freeInstallManager_->StartFreeInstall(want, GetUserId(), 0, callerToken); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "target not allowed free install"); - return false; + funcResult = false; + return ERR_INVALID_VALUE; } want.SetParam(Want::PARAM_RESV_CALLER_BUNDLE_NAME, callerAbility->GetElementName().GetBundleName()); auto erms = std::make_shared(); - return erms->DoProcess(want, GetUserId()); + if (erms->DoProcess(want, GetUserId())) { + funcResult = true; + return ERR_OK; + } else { + return ERR_INVALID_VALUE; + } } int32_t AbilityManagerService::AddQueryERMSObserver(sptr callerToken, @@ -13315,7 +13344,7 @@ void AbilityManagerService::RemovePreStartSession(const std::string& sessionId) preStartSessionMap_.erase(sessionId); } -ErrCode AbilityManagerService::OpenLink(const Want& want, sptr callerToken, +ErrCode AbilityManagerService::OpenLink(const Want& want, const sptr& callerToken, int32_t userId, int requestCode) { TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); diff --git a/services/abilitymgr/src/ability_record.cpp b/services/abilitymgr/src/ability_record.cpp index c6a5d713a37060dfaf7703fab8c393c769c48f59..58a2b24b194bfd8aaa37e76dd3a26fda67f89b21 100644 --- a/services/abilitymgr/src/ability_record.cpp +++ b/services/abilitymgr/src/ability_record.cpp @@ -2487,6 +2487,7 @@ void AbilityRecord::DumpUIExtensionRootHostInfo(std::vector &info) } UIExtensionHostInfo hostInfo; + int32_t userId = DEFAULT_INVAL_VALUE; auto ret = IN_PROCESS_CALL(AAFwk::AbilityManagerClient::GetInstance()->GetUIExtensionRootHostInfo(token, hostInfo)); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "failed: %{public}d", ret); @@ -3383,7 +3384,7 @@ void AbilityRecord::DumpClientInfo(std::vector &info, const std::ve } } -void AbilityRecord::DumpAbilityInfoDone(std::vector &infos) +void AbilityRecord::DumpAbilityInfoDone(const std::vector &infos) { TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); if (isDumpTimeout_) { diff --git a/services/abilitymgr/src/data_ability/data_ability_manager.cpp b/services/abilitymgr/src/data_ability/data_ability_manager.cpp index fe0a4abfa9895f4ea8dddd188eb3599b62d997c3..4b1e72982deddcf4e33866def57b9bd833f04009 100644 --- a/services/abilitymgr/src/data_ability/data_ability_manager.cpp +++ b/services/abilitymgr/src/data_ability/data_ability_manager.cpp @@ -666,7 +666,9 @@ void DataAbilityManager::RestartDataAbility(const std::shared_ptr TAG_LOGI(AAFwkTag::DATA_ABILITY, "restart dataability: %{public}s, uri: %{public}s", abilityRecord->GetAbilityInfo().name.c_str(), uriStr.c_str()); Uri uri(uriStr); - OHOS::DelayedSingleton::GetInstance()->AcquireDataAbility(uri, true, nullptr); + sptr tempIAbilityScheduler = nullptr; + OHOS::DelayedSingleton::GetInstance()->AcquireDataAbility(uri, true, nullptr, + tempIAbilityScheduler); return; } } diff --git a/services/abilitymgr/src/dialog_session/dialog_session_manager.cpp b/services/abilitymgr/src/dialog_session/dialog_session_manager.cpp index c5e656e3eafc0f442a501b930a6bb96181066d69..91d0eb333133c536514afcdbee21bec51bd2bc3d 100644 --- a/services/abilitymgr/src/dialog_session/dialog_session_manager.cpp +++ b/services/abilitymgr/src/dialog_session/dialog_session_manager.cpp @@ -109,6 +109,7 @@ bool DialogSessionManager::NotifyQueryERMSFinished(const std::string &dialogSess info = it->second; queryERMSInfoMap_.erase(dialogSessionId); } + AtomicServiceStartupRule rule = { isAllowed, info.isEmbeddedAllowed }; QueryERMSManager::GetInstance().OnQueryFinished(info.recordId, info.appId, info.startTime, rule, ERR_OK); return true; diff --git a/services/abilitymgr/src/disposed_observer.cpp b/services/abilitymgr/src/disposed_observer.cpp index 95a79cb74765c43054e813e3b8455da067315c79..ad963ec8cdbb73da922feacbcf0e3f8a8c794b47 100644 --- a/services/abilitymgr/src/disposed_observer.cpp +++ b/services/abilitymgr/src/disposed_observer.cpp @@ -63,7 +63,7 @@ void DisposedObserver::OnPageShow(const AppExecFwk::PageStateData &pageStateData { if (disposedRule_.componentType == AppExecFwk::ComponentType::UI_ABILITY) { TAG_LOGD(AAFwkTag::ABILITYMGR, "Call"); - int ret = IN_PROCESS_CALL(AbilityManagerClient::GetInstance()->StartAbility(*disposedRule_.want)); + int ret = IN_PROCESS_CALL(AbilityManagerClient::GetInstance()->StartAbility(*disposedRule_.want, -1, -1)); if (ret != ERR_OK) { interceptor_->UnregisterObserver(pageStateData.bundleName); TAG_LOGE(AAFwkTag::ABILITYMGR, "call failed"); diff --git a/services/abilitymgr/src/free_install_manager.cpp b/services/abilitymgr/src/free_install_manager.cpp index fe348d05ebd128c00ecee98500c1857c9b52b255..a1840c0fbaa3563c306dd2e24af954759214d50f 100644 --- a/services/abilitymgr/src/free_install_manager.cpp +++ b/services/abilitymgr/src/free_install_manager.cpp @@ -47,8 +47,9 @@ bool FreeInstallManager::IsTopAbility(const sptr &callerToken) { auto server = server_.lock(); CHECK_POINTER_AND_RETURN_LOG(server, false, "Get server failed!"); - AppExecFwk::ElementName elementName = IN_PROCESS_CALL(server->GetTopAbility()); - if (elementName.GetBundleName().empty() || elementName.GetAbilityName().empty()) { + AppExecFwk::ElementName elementName; + int ret = IN_PROCESS_CALL(server->GetTopAbility(true, elementName)); + if (ret != OHOS::ERR_OK || elementName.GetBundleName().empty() || elementName.GetAbilityName().empty()) { TAG_LOGE(AAFwkTag::FREE_INSTALL, "GetBundleName or GetAbilityName empty"); return false; } diff --git a/services/abilitymgr/src/hidden_start_observer_manager.cpp b/services/abilitymgr/src/hidden_start_observer_manager.cpp index 134d481d65a33485b04aa06a8c8ee77dced46817..1cb1a425f4c867e4b42951972ea7d749660dcaae 100644 --- a/services/abilitymgr/src/hidden_start_observer_manager.cpp +++ b/services/abilitymgr/src/hidden_start_observer_manager.cpp @@ -102,7 +102,9 @@ bool HiddenStartObserverManager::IsHiddenStart(int32_t pid) if (*it == nullptr) { continue; } - if ((*it)->IsHiddenStart(pid)) { + bool res = false; + (*it)->IsHiddenStart(pid, res); + if (res) { return true; } } diff --git a/services/abilitymgr/src/pending_want_manager.cpp b/services/abilitymgr/src/pending_want_manager.cpp index d60e26e57a4ea7cfa2a455b3b7d75f69163147ca..b954147f863463077d6cacb5efac590d3451149b 100644 --- a/services/abilitymgr/src/pending_want_manager.cpp +++ b/services/abilitymgr/src/pending_want_manager.cpp @@ -335,7 +335,9 @@ int32_t PendingWantManager::PendingWantStartServiceExtension(Want &want, const s } //reset flags want.SetFlags(0); - return DelayedSingleton::GetInstance()->StartExtensionAbility(want, callerToken); + int32_t userId = DEFAULT_INVAL_VALUE; + int32_t extensionType = static_cast(AppExecFwk::ExtensionAbilityType::UNSPECIFIED); + return DelayedSingleton::GetInstance()->StartExtensionAbility(want, callerToken, userId, extensionType); } int32_t PendingWantManager::PendingWantStartAbilitys(const std::vector &wantsInfo, diff --git a/services/abilitymgr/src/resident_process/resident_process_manager.cpp b/services/abilitymgr/src/resident_process/resident_process_manager.cpp index 069837459606f7e1e64743b238a4c24503314e64..3121571bb682fd4a1356a7e4ad2dc330c2d0d1a5 100644 --- a/services/abilitymgr/src/resident_process/resident_process_manager.cpp +++ b/services/abilitymgr/src/resident_process/resident_process_manager.cpp @@ -119,7 +119,9 @@ void ResidentProcessManager::StartResidentProcessWithMainElementPerBundleHap( TAG_LOGI(AAFwkTag::ABILITYMGR, "call, mainElement: %{public}s, uri: %{public}s", mainElement.c_str(), uriStr.c_str()); Uri uri(uriStr); - DelayedSingleton::GetInstance()->AcquireDataAbility(uri, true, nullptr); + sptr tempIAbilityScheduler = nullptr; + DelayedSingleton::GetInstance()->AcquireDataAbility(uri, true, nullptr, + tempIAbilityScheduler); } return; } diff --git a/services/appmgr/src/app_state_observer_manager.cpp b/services/appmgr/src/app_state_observer_manager.cpp index a40b5cb7b1c4fd1b26277dbcd111c785665dc5bc..af3fd0d59dd90d4a26b0afba927033eec6a860a0 100644 --- a/services/appmgr/src/app_state_observer_manager.cpp +++ b/services/appmgr/src/app_state_observer_manager.cpp @@ -878,6 +878,7 @@ ProcessData AppStateObserverManager::WrapProcessData(const std::shared_ptrGetGPUPid(); processData.callerPid = appRecord->GetCallerPid(); processData.callerUid = appRecord->GetCallerUid(); + processData.killReason = appRecord->GetKillReason(); return processData; } diff --git a/test/unittest/frameworks_kits_ability_native_test/distributed_client_test.cpp b/test/unittest/frameworks_kits_ability_native_test/distributed_client_test.cpp index 6a3bcdaa1aff7fcd79603c33d329b9637a3b3123..0b2140444f635c32c0b8421470062c4004b09004 100644 --- a/test/unittest/frameworks_kits_ability_native_test/distributed_client_test.cpp +++ b/test/unittest/frameworks_kits_ability_native_test/distributed_client_test.cpp @@ -20,7 +20,7 @@ #include "ability_manager_errors.h" #include "distributed_client.h" #include "distributed_parcel_helper.h" -#include "dms_continueInfo.h" +#include "dms_continue_info.h" #include "iservice_registry.h" #include "iremote_object.h" #include "mock_ability_connect_callback.h" diff --git a/tools/aa/BUILD.gn b/tools/aa/BUILD.gn index 45ca82c63105416d77ab5fdd25320b54ce075741..61bed5b0f6c83c7b2693df9d842a4fd440a46032 100644 --- a/tools/aa/BUILD.gn +++ b/tools/aa/BUILD.gn @@ -46,6 +46,7 @@ ohos_static_library("tools_aa_source_set") { ":ability_command_exception_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", "${ability_runtime_services_path}/common:common_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", ] cflags = [] @@ -95,7 +96,10 @@ ohos_executable("aa") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ ":tools_aa_source_set" ] + deps = [ + ":tools_aa_source_set", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + ] external_deps = [ "ability_base:base",