diff --git a/frameworks/cj/ffi/want_agent/BUILD.gn b/frameworks/cj/ffi/want_agent/BUILD.gn index b6e9447be764c7805cd21f8fecf4fd32a2b3024d..12d69329e066071fd3bad9ecf68f9b4fdac5ef2f 100644 --- a/frameworks/cj/ffi/want_agent/BUILD.gn +++ b/frameworks/cj/ffi/want_agent/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-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 @@ -35,6 +35,10 @@ config("cj_want_agent_public_config") { "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", ] + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", + "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", + ] } ohos_shared_library("cj_want_agent_ffi") { diff --git a/frameworks/native/ability/native/BUILD.gn b/frameworks/native/ability/native/BUILD.gn index 0b8fcb13732b77f589b28505559e282b47949972..b725ff79c1416ffa4a015f2413e8cdd2aed372a9 100644 --- a/frameworks/native/ability/native/BUILD.gn +++ b/frameworks/native/ability/native/BUILD.gn @@ -43,6 +43,7 @@ config("ability_config") { "${ability_runtime_napi_path}/featureAbility", ] + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] @@ -140,7 +141,7 @@ config("abilitykit_utils_public_config") { "${ability_runtime_path}/interfaces/kits/native/appkit/app", "${ability_runtime_innerkits_path}/app_manager/include/appmgr", ] - + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] if (ability_runtime_graphics) { defines = [ "SUPPORT_GRAPHICS" ] } @@ -333,6 +334,7 @@ ohos_shared_library("abilitykit_native") { public_configs = [ ":ability_public_config", "${ability_runtime_native_path}/ability:ability_context_public_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits_public_config", ] @@ -550,7 +552,7 @@ config("extensionkit_public_config") { "${ability_runtime_innerkits_path}/app_manager/include/appmgr", "${ability_runtime_services_path}/common/include", ] - + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] if (ability_runtime_graphics) { defines = [ "SUPPORT_GRAPHICS" ] } @@ -758,7 +760,7 @@ config("uiability_config") { "${ability_runtime_services_path}/abilitymgr/include/utils", "${ability_runtime_services_path}/abilitymgr/include", ] - + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] if (ability_runtime_graphics) { defines = [ "SUPPORT_GRAPHICS", @@ -2224,7 +2226,7 @@ config("embedded_ui_extension_module_config") { "${ability_runtime_napi_path}/inner/napi_common", "${ability_runtime_napi_path}/featureAbility", ] - + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] diff --git a/interfaces/inner_api/ability_manager/BUILD.gn b/interfaces/inner_api/ability_manager/BUILD.gn index 55d58d3ea7abfb7c584459f4181dd618d19c0223..445b84edaff4cdf4bced740e0680f008a4ce5b2c 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -11,6 +11,7 @@ # 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") @@ -40,8 +41,9 @@ config("ability_manager_public_config") { "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", "${ability_runtime_path}/interfaces/kits/native/appkit", "${ability_runtime_innerkits_path}/dataobs_manager/include", + "${target_gen_dir}", ] - + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] defines = [] if (ability_command_for_test) { @@ -62,7 +64,94 @@ config("ability_manager_public_config") { } } +idl_gen_interface("ability_manager_innerkits") { + sources = [ + "idl/IUserCallback.idl", + ] + sources_callback = [ + ] + sources_common =[ + ] + log_domainid = "0xD001336" + log_tag = "AbilityMgr" + subsystem_name = "ability" + part_name = "ability_runtime" +} + +config("ability_manager_innerkits_config") { + include_dirs = [ "${target_gen_dir}" ] +} + +ohos_source_set("ability_manager_innerkits_include") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + + public_configs = [ + ":ability_manager_innerkits_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ ":ability_manager_innerkits" ] + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "ipc:ipc_core", + "samgr:samgr_proxy", + ] + + subsystem_name = "ability" + part_name = "ability_runtime" +} + +ohos_source_set("ability_manager_innerkits_source") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + output_values = get_target_outputs(":ability_manager_innerkits") + source_values = [ "*.cpp", ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_innerkits_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ ":ability_manager_innerkits" ] + + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + "hitrace:hitrace_meter", + "ipc:ipc_core", + ] + + subsystem_name = "ability" + part_name = "ability_runtime" +} + ohos_shared_library("ability_manager") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } use_exceptions = true branch_protector_ret = "pac_ret" @@ -108,8 +197,6 @@ ohos_shared_library("ability_manager") { "${ability_runtime_services_path}/abilitymgr/src/ui_extension/ui_extension_ability_connect_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension/ui_extension_host_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension/ui_extension_session_info.cpp", - "${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", "${ability_runtime_services_path}/abilitymgr/src/kiosk_status.cpp", "src/aa_tools/ability_start_with_wait_data.cpp", @@ -133,12 +220,15 @@ ohos_shared_library("ability_manager") { public_configs = [ ":ability_manager_public_config", + "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", ] public_deps = [ ":ability_connect_callback_stub" ] deps = [ + ":ability_manager_innerkits_include", + ":ability_manager_innerkits_source", ":ability_start_options", ":ability_start_setting", ":mission_info", @@ -292,6 +382,7 @@ ohos_shared_library("ability_manager_c") { external_deps = [ "ability_base:session_info", "c_utils:utils", + "hilog:libhilog", "image_framework:image_native", "ipc:ipc_core", "ipc:ipc_napi", diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_interface.h b/interfaces/inner_api/ability_manager/idl/IUserCallback.idl similarity index 32% rename from interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_interface.h rename to interfaces/inner_api/ability_manager/idl/IUserCallback.idl index 113002837ee096eeff6d444017c0b2645f674f91..4651d4c37b8207bc96cb4bdc17d7124ab6acfef8 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_interface.h +++ b/interfaces/inner_api/ability_manager/idl/IUserCallback.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -13,38 +13,8 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_INTERFACE_H -#define OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_INTERFACE_H - -#include "app_debug_info.h" -#include "iremote_broker.h" - -namespace OHOS { -namespace AppExecFwk { -/** - * @brief Interface to monitor when debug mode. - */ -class IAppDebugListener : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.AppExecFwk.AppDebugListener"); - - /** - * @brief Notification of application information registered in listening and debugging mode. - * @param tokens The app info of app running record. - */ - virtual void OnAppDebugStarted(const std::vector &debugInfos) = 0; - - /** - * @brief Notification of application information registered in listening and remove debug mode. - * @param tokens The app info of app running record. - */ - virtual void OnAppDebugStoped(const std::vector &debugInfos) = 0; - - enum class Message { - ON_APP_DEBUG_STARTED = 0, - ON_APP_DEBUG_STOPED, - }; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_INTERFACE_H +interface OHOS.AAFwk.IUserCallback { + [oneway] void OnStopUserDone([in] int userId, [in] int errcode); + [oneway] void OnStartUserDone([in] int userId, [in] int errcode); + [oneway] void OnLogoutUserDone([in] int userId, [in] int errcode); +} \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_errors.h b/interfaces/inner_api/ability_manager/include/ability_manager_errors.h index 87c485af117203e6366924447b492201ad0ec5fc..08b2c5c6acefb3ca23063c93ae0a3bba49e7a136 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_errors.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_errors.h @@ -903,6 +903,11 @@ enum { */ ERR_SA_INTERCEPTOR_READ_PARAMS_FAILED = 2097361, + /* + * Result(2097362) for abilitys debug empty tokens. + */ + ERR_ABILITY_DEBUG_EMPTY_TOKENS = 2097362, + /** * Native error(3000000) for target bundle not exist. */ diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h index 1785a9b14f7fd2008f8dd0ae650dacea3136ffbc..20529bbc02c52dddf38c28ee950092758fc45eb0 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_interface.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h @@ -29,7 +29,6 @@ #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" @@ -38,9 +37,11 @@ #include "iability_controller.h" #include "iability_manager_collaborator.h" #include "iacquire_share_data_callback_interface.h" +#include "iapp_debug_listener.h" #include "insight_intent/insight_intent_execute_param.h" #include "insight_intent/insight_intent_execute_result.h" #include "insight_intent/insight_intent_info_for_query.h" +#include "iuser_callback.h" #include "iprepare_terminate_callback_interface.h" #include "keep_alive_info.h" #include "mission_info.h" @@ -51,7 +52,6 @@ #include "sa_interceptor_interface.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" diff --git a/interfaces/inner_api/ability_manager/include/user_callback.h b/interfaces/inner_api/ability_manager/include/user_callback.h deleted file mode 100644 index f2fd6373927b80afe9da51a98ab1c6c90c0708b9..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/include/user_callback.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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_USER_CALLBACK_H -#define OHOS_ABILITY_RUNTIME_USER_CALLBACK_H - -#include "iremote_broker.h" - -namespace OHOS { -namespace AAFwk { -/** - * @class IUserCallback - * user callback. - */ -class IUserCallback : public OHOS::IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.UserCallback"); - - virtual void OnStopUserDone(int userId, int errcode) = 0; - - /** - * @brief OnStartUserDone. - * - * @param userId userId. - * @param errcode errcode. - */ - virtual void OnStartUserDone(int userId, int errcode) = 0; - - /** - * @brief OnLogoutUserDone. - * - * @param userId userId. - * @param errcode errcode. - */ - virtual void OnLogoutUserDone(int userId, int errcode) {} - - enum UserCallbackCmd { - // ipc id for OnStopUserDone - ON_STOP_USER_DONE = 0, - - // ipc id for OnStartUserDone - ON_START_USER_DONE = 1, - - // ipc id for OnLogoutUserDone - ON_LOGOUT_USER_DONE = 2, - - // maximum of enum - CMD_MAX - }; -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_USER_CALLBACK_H diff --git a/interfaces/inner_api/ability_manager/include/user_callback_proxy.h b/interfaces/inner_api/ability_manager/include/user_callback_proxy.h deleted file mode 100644 index e469b70b04d850e35dd14e65d69c4611761d4ca9..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/include/user_callback_proxy.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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_STOP_USER_CALLBACK_PROXY_H -#define OHOS_ABILITY_RUNTIME_STOP_USER_CALLBACK_PROXY_H - -#include -#include "iremote_proxy.h" -#include "user_callback.h" - -namespace OHOS { -namespace AAFwk { -/** - * interface for UserCallbackProxy. - */ -class UserCallbackProxy : public IRemoteProxy { -public: - explicit UserCallbackProxy(const sptr &impl) : IRemoteProxy(impl) - {} - ~UserCallbackProxy() = default; - - /** - * @brief OnStopUserDone. - * - * @param userId userId. - * @param errcode errcode. - */ - virtual void OnStopUserDone(int userId, int errcode) override; - - /** - * @brief OnStartUserDone. - * - * @param userId userId. - * @param errcode errcode. - */ - virtual void OnStartUserDone(int userId, int errcode) override; - - /** - * @brief OnLogoutUserDone. - * - * @param userId userId. - * @param errcode errcode. - */ - virtual void OnLogoutUserDone(int userId, int errcode) override; -private: - void SendRequestCommon(int userId, int errcode, IUserCallback::UserCallbackCmd cmd); - -private: - static inline BrokerDelegator delegator_; -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_STOP_USER_CALLBACK_PROXY_H diff --git a/interfaces/inner_api/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index c9658b81753f9371a938e6f71a55f0b8f1ebf6d0..59318b86d696ecc230586dab81c63f9db0e2327e 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_manager/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -11,6 +11,7 @@ # 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") @@ -40,9 +41,116 @@ config("appmgr_core_config") { } } +idl_gen_interface("appmgr_innerkits") { + sources = [ + "idl/IAbilityDebugResponse.idl", + "idl/IAppDebugListener.idl", + "idl/IStartSpecifiedAbilityResponse.idl", + ] + log_domainid = "0xD001311" + log_tag = "AppMgr" + subsystem_name = "ability" + part_name = "ability_runtime" +} + +config("appmgr_innerkits_config") { + include_dirs = [ "${target_gen_dir}" ] +} + +ohos_source_set("appmgr_innerkits_include") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + + public_configs = [ + ":appmgr_innerkits_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", + "${ability_runtime_path}/utils/server/startup:startup_util_config", + ] + + deps = [ + ":appmgr_innerkits", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits", + "${ability_runtime_path}/utils/server/startup:startup_util", + ] + external_deps = [ + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "hilog:libhilog", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "samgr:samgr_proxy", + "ability_base:configuration", + ] + subsystem_name = "ability" + part_name = "ability_runtime" +} + +ohos_source_set("appmgr_innerkits_source") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + configs = [ + ":appmgr_core_config", + ":appmgr_sdk_config", + ] + + public_configs = [ + ":appmgr_innerkits_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", + "${ability_runtime_path}/utils/server/startup:startup_util_config", + ] + + output_values = get_target_outputs(":appmgr_innerkits") + sources = filter_include(output_values, [ "*.cpp" ]) + + deps = [ + ":appmgr_innerkits", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits", + "${ability_runtime_path}/utils/server/startup:startup_util", + ] + external_deps = [ + "c_utils:utils", + "faultloggerd:libfaultloggerd", + "ffrt:libffrt", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "samgr:samgr_proxy", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "bundle_framework:appexecfwk_base", + ] + + subsystem_name = "ability" + part_name = "ability_runtime" +} + ohos_shared_library("app_manager") { + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } branch_protector_ret = "pac_ret" - include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", "${ability_runtime_path}/utils/global/time/include", @@ -57,8 +165,6 @@ ohos_shared_library("app_manager") { "${ability_runtime_services_path}/appdfr/src/appfreeze_util.cpp", "src/appmgr/ability_controller_proxy.cpp", "src/appmgr/ability_controller_stub.cpp", - "src/appmgr/ability_debug_response_proxy.cpp", - "src/appmgr/ability_debug_response_stub.cpp", "src/appmgr/ability_foreground_state_observer_proxy.cpp", "src/appmgr/ability_foreground_state_observer_stub.cpp", "src/appmgr/ability_info_callback_proxy.cpp", @@ -67,8 +173,6 @@ ohos_shared_library("app_manager") { "src/appmgr/ams_mgr_proxy.cpp", "src/appmgr/ams_mgr_stub.cpp", "src/appmgr/app_debug_info.cpp", - "src/appmgr/app_debug_listener_proxy.cpp", - "src/appmgr/app_debug_listener_stub.cpp", "src/appmgr/app_foreground_state_observer_proxy.cpp", "src/appmgr/app_foreground_state_observer_stub.cpp", "src/appmgr/app_jsheap_mem_info.cpp", @@ -120,15 +224,16 @@ ohos_shared_library("app_manager") { "src/appmgr/render_state_observer_stub.cpp", "src/appmgr/running_multi_info.cpp", "src/appmgr/running_process_info.cpp", - "src/appmgr/start_specified_ability_response_proxy.cpp", - "src/appmgr/start_specified_ability_response_stub.cpp", "src/appmgr/system_memory_attr.cpp", "src/appmgr/process_bind_data.cpp", ] public_configs = [ ":appmgr_core_config", + ":appmgr_innerkits_config", ":appmgr_sdk_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", + "${ability_runtime_path}/utils/server/startup:startup_util_config", ] defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ] @@ -138,6 +243,7 @@ ohos_shared_library("app_manager") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + ":appmgr_innerkits_source", "${ability_runtime_path}/utils/global/freeze:freeze_util", "${ability_runtime_path}/utils/server/startup:startup_util", "${ability_runtime_services_path}/common:app_util", diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_stub.h b/interfaces/inner_api/app_manager/idl/IAbilityDebugResponse.idl similarity index 39% rename from interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_stub.h rename to interfaces/inner_api/app_manager/idl/IAbilityDebugResponse.idl index 3aab199f486c133070a46827918d42d03c25293b..8f71029a117c3deccbc16bdf4a163f8caa2cfacd 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_stub.h +++ b/interfaces/inner_api/app_manager/idl/IAbilityDebugResponse.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -13,30 +13,10 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_STUB_H -#define OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_STUB_H +sequenceable OHOS.IRemoteObject; -#include - -#include "iremote_stub.h" -#include "app_debug_listener_interface.h" - -namespace OHOS { -namespace AppExecFwk { -class AppDebugListenerStub : public IRemoteStub { -public: - AppDebugListenerStub(); - virtual ~AppDebugListenerStub(); - - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleOnAppDebugStarted(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnAppDebugStoped(MessageParcel &data, MessageParcel &reply); - - DISALLOW_COPY_AND_MOVE(AppDebugListenerStub); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_STUB_H +interface OHOS.AppExecFwk.IAbilityDebugResponse { + void OnAbilitysDebugStarted([in] List tokens); + void OnAbilitysDebugStoped([in] List tokens); + void OnAbilitysAssertDebugChange([in] List tokens, [in] boolean isAssertDebug); +} \ No newline at end of file diff --git a/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_stub.h b/interfaces/inner_api/app_manager/idl/IAppDebugListener.idl similarity index 35% rename from interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_stub.h rename to interfaces/inner_api/app_manager/idl/IAppDebugListener.idl index 9753d7051b3d9a919fe390464038b42643e3528f..2020004d5fca8dd8af6da5d16cdd00b97ab6cf10 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_stub.h +++ b/interfaces/inner_api/app_manager/idl/IAppDebugListener.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * 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 @@ -13,31 +13,9 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_ABILIYT_DEBUG_RESPONSE_STUB_H -#define OHOS_ABILITY_RUNTIME_ABILIYT_DEBUG_RESPONSE_STUB_H +sequenceable app_debug_info..AppDebugInfo; -#include - -#include "ability_debug_response_interface.h" -#include "iremote_stub.h" - -namespace OHOS { -namespace AppExecFwk { -class AbilityDebugResponseStub : public IRemoteStub { -public: - AbilityDebugResponseStub(); - virtual ~AbilityDebugResponseStub(); - - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleOnAbilitysDebugStarted(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnAbilitysDebugStoped(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnAbilitysAssertDebugChange(MessageParcel &data, MessageParcel &reply); - - DISALLOW_COPY_AND_MOVE(AbilityDebugResponseStub); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ABILIYT_DEBUG_RESPONSE_STUB_H +interface OHOS.AppExecFwk.IAppDebugListener { + [oneway] void OnAppDebugStarted([in] List debugInfos); + [oneway] void OnAppDebugStoped([in] List debugInfos); +} \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/user_callback_stub.h b/interfaces/inner_api/app_manager/idl/IStartSpecifiedAbilityResponse.idl similarity index 35% rename from interfaces/inner_api/ability_manager/include/user_callback_stub.h rename to interfaces/inner_api/app_manager/idl/IStartSpecifiedAbilityResponse.idl index bed99d5a402af2831e52066b2c0f0bbebce6da74..652fa7c75bab2e411e4c2851568780a7f421c1a2 100644 --- a/interfaces/inner_api/ability_manager/include/user_callback_stub.h +++ b/interfaces/inner_api/app_manager/idl/IStartSpecifiedAbilityResponse.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * 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 @@ -13,37 +13,14 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_USER_CALLBACK_STUB_H -#define OHOS_ABILITY_RUNTIME_USER_CALLBACK_STUB_H +sequenceable want..OHOS.AAFwk.Want; -#include -#include -#include +interface OHOS.AAFwk.IUserCallback; -#include "user_callback.h" -#include "nocopyable.h" - -namespace OHOS { -namespace AAFwk { -/** - * @class UserCallbackStub - * UserCallbackStub. - */ -class UserCallbackStub : public IRemoteStub { -public: - UserCallbackStub(); - virtual ~UserCallbackStub() = default; - - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - DISALLOW_COPY_AND_MOVE(UserCallbackStub); - - int OnStopUserDoneInner(MessageParcel &data, MessageParcel &reply); - int OnStartUserDoneInner(MessageParcel &data, MessageParcel &reply); - int OnLogoutUserDoneInner(MessageParcel &data, MessageParcel &reply); -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_USER_CALLBACK_STUB_H +interface OHOS.AppExecFwk.IStartSpecifiedAbilityResponse { + [oneway] void OnAcceptWantResponse([in] Want want, [in] String flag, [in] int requestId); + [oneway] void OnTimeoutResponse([in] int requestId); + [oneway] void OnNewProcessRequestResponse([in] String flag, [in] int requestId); + [oneway] void OnNewProcessRequestTimeoutResponse([in] int requestId); + [oneway] void OnStartSpecifiedFailed([in] int requestId); +} \ No newline at end of file diff --git a/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_interface.h b/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_interface.h deleted file mode 100644 index 87ec00b7b17419f546753f04aa51bd6063be409c..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_interface.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2023-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_ABILITY_DEBUG_RESPONSE_INTERFACE_H -#define OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_RESPONSE_INTERFACE_H - -#include "iremote_broker.h" - -namespace OHOS { -namespace AppExecFwk { -class IAbilityDebugResponse : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.AbilityDebugResponse"); - - /** - * @brief Set ability attach debug flag to ability manager service. - * @param tokens The token of ability token. - */ - virtual void OnAbilitysDebugStarted(const std::vector> &tokens) = 0; - - /** - * @brief Cancel ability attach debug flag to ability manager service. - * @param tokens The token of ability token. - */ - virtual void OnAbilitysDebugStoped(const std::vector> &tokens) = 0; - - /** - * @brief Change ability assert debug flag. - * @param tokens The token of ability records. - * @param isAssertDebug Assert debug flag. - */ - virtual void OnAbilitysAssertDebugChange(const std::vector> &tokens, bool isAssertDebug) = 0; - - enum class Message { - ON_ABILITYS_DEBUG_STARTED = 0, - ON_ABILITYS_DEBUG_STOPED, - ON_ABILITYS_ASSERT_DEBUG, - }; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_RESPONSE_INTERFACE_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_proxy.h deleted file mode 100644 index 1bdac574de5079f573caa45cb0f94fa48f45b400..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_proxy.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2023-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_ABILITY_DEBUG_RESPONSE_PROXY_H -#define OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_RESPONSE_PROXY_H - -#include "ability_debug_response_interface.h" -#include "iremote_object.h" -#include "iremote_proxy.h" - -namespace OHOS { -namespace AppExecFwk { -class AbilityDebugResponseProxy : public IRemoteProxy { -public: - explicit AbilityDebugResponseProxy(const sptr &impl); - virtual ~AbilityDebugResponseProxy() = default; - - /** - * @brief Set ability attach debug flag through proxy project. - * @param tokens The token of ability token. - */ - void OnAbilitysDebugStarted(const std::vector> &tokens) override; - - /** - * @brief Cancel ability attach debug flag through proxy project. - * @param tokens The token of ability token. - */ - void OnAbilitysDebugStoped(const std::vector> &tokens) override; - - /** - * @brief Change ability assert debug flag. - * @param tokens The token of ability records. - * @param isAssertDebug Assert debug flag. - */ - void OnAbilitysAssertDebugChange(const std::vector> &tokens, bool isAssertDebug) override; - -private: - bool WriteInterfaceToken(MessageParcel &data); - void SendRequest(const IAbilityDebugResponse::Message &message, const std::vector> &tokens); - static inline BrokerDelegator delegator_; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_RESPONSE_PROXY_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h b/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h index d919a230212a1e201219df9f6acb316c16ab10f6..2df1661f0b0ced9e7af822ef1ab369f3523a2d80 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h +++ b/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_interface.h @@ -16,9 +16,9 @@ #ifndef OHOS_ABILITY_RUNTIME_AMS_MGR_INTERFACE_H #define OHOS_ABILITY_RUNTIME_AMS_MGR_INTERFACE_H -#include "ability_debug_response_interface.h" +#include "iability_debug_response.h" #include "ability_info.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "app_record_id.h" #include "application_info.h" #include "configuration.h" @@ -26,8 +26,8 @@ #include "iremote_broker.h" #include "iremote_object.h" #include "istart_specified_ability_response.h" +#include "iuser_callback.h" #include "running_process_info.h" -#include "user_callback.h" namespace OHOS { namespace AbilityRuntime { diff --git a/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_proxy.h index fec486a478f85c862b9dfa97cb26618c0f1b60a3..411dd010e6b8d2db327d0438842bc6928a8fa3b9 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_proxy.h +++ b/interfaces/inner_api/app_manager/include/appmgr/ams_mgr_proxy.h @@ -17,7 +17,7 @@ #define OHOS_ABILITY_RUNTIME_AMS_MGR_PROXY_H #include "ams_mgr_interface.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "iremote_proxy.h" namespace OHOS { diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_proxy.h deleted file mode 100644 index a309079a93810ad641b1c80af5bbf64a70c737b5..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_proxy.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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_APP_DEBUG_LISTENER_PROXY_H -#define OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_PROXY_H - -#include "app_debug_info.h" -#include "app_debug_listener_interface.h" -#include "iremote_proxy.h" - -namespace OHOS { -namespace AppExecFwk { -class AppDebugListenerProxy : public IRemoteProxy { -public: - explicit AppDebugListenerProxy(const sptr &impl); - virtual ~AppDebugListenerProxy() = default; - - /** - * @brief Notification of application information registered in listening and debugging mode. - * @param tokens The app info of app running record. - */ - void OnAppDebugStarted(const std::vector &debugInfos) override; - - /** - * @brief Notification of application information registered in listening and remove debug mode. - * @param tokens The app info of app running record. - */ - void OnAppDebugStoped(const std::vector &debugInfos) override; - -private: - bool WriteInterfaceToken(MessageParcel &data); - void SendRequest(const IAppDebugListener::Message &message, const std::vector &debugInfos); - static inline BrokerDelegator delegator_; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_APP_DEBUG_LISTENER_PROXY_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h index 3a5e83250bc11b5db72b39366a1886ee86260dfc..5eec5d778fbe66cc35148843c447c3b0c464f58b 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h +++ b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h @@ -16,9 +16,7 @@ #ifndef OHOS_ABILITY_RUNTIME_APP_MGR_CLIENT_H #define OHOS_ABILITY_RUNTIME_APP_MGR_CLIENT_H -#include "ability_debug_response_interface.h" #include "ability_info.h" -#include "app_debug_listener_interface.h" #include "app_malloc_info.h" #include "app_mem_info.h" #include "app_mgr_constants.h" @@ -27,6 +25,8 @@ #include "application_info.h" #include "bundle_info.h" #include "fault_data.h" +#include "iability_debug_response.h" +#include "iapp_debug_listener.h" #include "iapplication_state_observer.h" #include "iapp_state_callback.h" #include "iconfiguration_observer.h" diff --git a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_interface.h b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_interface.h index 78c33ca8ff10759c433cbe893e184c8a80e51de8..f0d1dbfabbf912a084e45c7843e572d219179b4a 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/app_mgr_interface.h +++ b/interfaces/inner_api/app_manager/include/appmgr/app_mgr_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -450,7 +450,7 @@ public: /** * UpdateConfigurationForBackgroundApp - * + * * @param appInfos Background application information. * @param policy Update policy. * @param userId configuration for the user diff --git a/interfaces/inner_api/app_manager/include/appmgr/istart_specified_ability_response.h b/interfaces/inner_api/app_manager/include/appmgr/istart_specified_ability_response.h deleted file mode 100644 index 0777f67ee1d2ce89d4bd6aca6db7e97b324bef6a..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/istart_specified_ability_response.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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_ISTART_SPECIFIED_ABILITY_RESPONSE_H -#define OHOS_ABILITY_RUNTIME_ISTART_SPECIFIED_ABILITY_RESPONSE_H - -#include "iremote_broker.h" -#include "iremote_object.h" -#include "want.h" - -namespace OHOS { -namespace AppExecFwk { -class IStartSpecifiedAbilityResponse : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.startSpecifiedAbilityResponse"); - - /** - * @brief called when the module's onAcceptWant done to notify ability mgr to continue - * @param want request param being accepted - * @param flag specified flag return by application - * @param requestId a number represents a request - */ - virtual void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) = 0; - - /** - * @brief called when the module's onAcceptWant happens time out - * @param requestId a number represents a request - */ - virtual void OnTimeoutResponse(int32_t requestId) = 0; - - virtual void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) = 0; - - virtual void OnNewProcessRequestTimeoutResponse(int32_t requestId) = 0; - - virtual void OnStartSpecifiedFailed(int32_t requestId) {}; - - enum Message { - ON_ACCEPT_WANT_RESPONSE = 0, - ON_TIMEOUT_RESPONSE, - ON_NEW_PROCESS_REQUEST_RESPONSE, - ON_NEW_PROCESS_REQUEST_TIMEOUT_RESPONSE, - ON_START_SPECIFIED_FAILED - }; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_ISTART_SPECIFIED_ABILITY_RESPONSE_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_proxy.h deleted file mode 100644 index bf2037afc012bef53d69bc394ba8fc2e3ffa541d..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_proxy.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022-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_START_SPECIFIED_ABILITY_RESPONSE_PROXY_H -#define OHOS_ABILITY_RUNTIME_START_SPECIFIED_ABILITY_RESPONSE_PROXY_H - -#include "iremote_proxy.h" -#include "istart_specified_ability_response.h" -namespace OHOS { -namespace AppExecFwk { -class StartSpecifiedAbilityResponseProxy : public IRemoteProxy { -public: - explicit StartSpecifiedAbilityResponseProxy(const sptr &impl); - virtual ~StartSpecifiedAbilityResponseProxy() = default; - - /** - * @brief called when the module's onAcceptWant done to notify ability mgr to continue - * @param want request param being accepted - * @param flag specified flag return by application - * @param requestId a number represents a request - */ - virtual void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, - int32_t requestId) override; - - /** - * @brief called when the module's onAcceptWant happens time out - * @param requestId a number represents a request - */ - virtual void OnTimeoutResponse(int32_t requestId) override; - - virtual void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId = 0) override; - - virtual void OnNewProcessRequestTimeoutResponse(int32_t requestId) override; - - virtual void OnStartSpecifiedFailed(int32_t requestId) override; - -private: - bool WriteInterfaceToken(MessageParcel &data); - static inline BrokerDelegator delegator_; - int32_t SendTransactCmd(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_START_SPECIFIED_ABILITY_RESPONSE_PROXY_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_stub.h b/interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_stub.h deleted file mode 100644 index 041320de260806846208a8dc0f70d8a861c507a9..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_stub.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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_START_SPECIFIED_ABILITY_RESPONSE_STUB_H -#define OHOS_ABILITY_RUNTIME_START_SPECIFIED_ABILITY_RESPONSE_STUB_H - -#include "iremote_stub.h" -#include "nocopyable.h" -#include "string_ex.h" -#include "istart_specified_ability_response.h" - -namespace OHOS { -namespace AppExecFwk { -class StartSpecifiedAbilityResponseStub : public IRemoteStub { -public: - StartSpecifiedAbilityResponseStub() = default; - virtual ~StartSpecifiedAbilityResponseStub() = default; - - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleOnAcceptWantResponse(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnTimeoutResponse(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnNewProcessRequestResponse(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnNewProcessRequestTimeoutResponse(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnStartSpecifiedFailed(MessageParcel &data, MessageParcel &reply); - - DISALLOW_COPY_AND_MOVE(StartSpecifiedAbilityResponseStub); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_START_SPECIFIED_ABILITY_RESPONSE_STUB_H diff --git a/interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_proxy.cpp deleted file mode 100644 index 5736f1b596cc9b3cbfa92b607edb3e2fb3c07592..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_proxy.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "ability_debug_response_proxy.h" - -#include "hilog_tag_wrapper.h" -#include "ipc_types.h" - -namespace OHOS { -namespace AppExecFwk { -namespace { -constexpr int32_t CYCLE_LIMIT_MIN = 0; -constexpr int32_t CYCLE_LIMIT_MAX = 1000; -} -AbilityDebugResponseProxy::AbilityDebugResponseProxy( - const sptr &impl) : IRemoteProxy(impl) -{} - -bool AbilityDebugResponseProxy::WriteInterfaceToken(MessageParcel &data) -{ - if (!data.WriteInterfaceToken(AbilityDebugResponseProxy::GetDescriptor())) { - TAG_LOGE(AAFwkTag::APPMGR, "Write token failed"); - return false; - } - return true; -} - -void AbilityDebugResponseProxy::OnAbilitysDebugStarted(const std::vector> &tokens) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - SendRequest(IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STARTED, tokens); -} - -void AbilityDebugResponseProxy::OnAbilitysDebugStoped(const std::vector> &tokens) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - SendRequest(IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STOPED, tokens); -} - -void AbilityDebugResponseProxy::OnAbilitysAssertDebugChange( - const std::vector> &tokens, bool isAssertDebug) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - MessageParcel data; - if (!WriteInterfaceToken(data)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write token failed"); - return; - } - - if (tokens.size() <= CYCLE_LIMIT_MIN || tokens.size() > CYCLE_LIMIT_MAX || - !data.WriteInt32(tokens.size())) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data size failed"); - return; - } - - for (const auto &item : tokens) { - if (!data.WriteRemoteObject(item)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write token failed"); - return; - } - } - - if (!data.WriteBool(isAssertDebug)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write flag failed"); - return; - } - - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "null remote"); - return; - } - - MessageParcel reply; - MessageOption option; - auto ret = remote->SendRequest(static_cast(Message::ON_ABILITYS_ASSERT_DEBUG), data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::APPMGR, "SendRequest err: %{public}d", ret); - } -} - -void AbilityDebugResponseProxy::SendRequest( - const IAbilityDebugResponse::Message &message, const std::vector> &tokens) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - MessageParcel data; - if (!WriteInterfaceToken(data)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write token failed"); - return; - } - - if (tokens.size() <= CYCLE_LIMIT_MIN || tokens.size() > CYCLE_LIMIT_MAX || - !data.WriteInt32(tokens.size())) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data size failed"); - return; - } - - for (auto iter = tokens.begin(); iter != tokens.end(); iter++) { - if (!data.WriteRemoteObject(iter->GetRefPtr())) { - TAG_LOGE(AAFwkTag::APPMGR, "Write token failed"); - return; - } - } - - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "null remote"); - return; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - auto ret = remote->SendRequest(static_cast(message), data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::APPMGR, "SendRequest err: %{public}d", ret); - } -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_stub.cpp b/interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_stub.cpp deleted file mode 100644 index daf6a577ae851b01f3b24c02a06933c7521836d2..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_stub.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "ability_debug_response_stub.h" - -#include "appexecfwk_errors.h" -#include "hilog_tag_wrapper.h" -#include "ipc_types.h" -#include "iremote_object.h" - -namespace OHOS { -namespace AppExecFwk { -namespace { -constexpr int32_t CYCLE_LIMIT_MIN = 0; -constexpr int32_t CYCLE_LIMIT_MAX = 1000; -} -AbilityDebugResponseStub::AbilityDebugResponseStub() {} - -AbilityDebugResponseStub::~AbilityDebugResponseStub() {} - -int32_t AbilityDebugResponseStub::HandleOnAbilitysDebugStarted(MessageParcel &data, MessageParcel &reply) -{ - auto tokenSize = data.ReadInt32(); - if (tokenSize <= CYCLE_LIMIT_MIN || tokenSize > CYCLE_LIMIT_MAX) { - TAG_LOGE(AAFwkTag::APPMGR, "Token size exceeds limit"); - return ERR_INVALID_DATA; - } - - std::vector> tokens; - for (int32_t index = 0; index < tokenSize; index++) { - auto token = data.ReadRemoteObject(); - if (token == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "null token"); - return ERR_INVALID_DATA; - } - tokens.push_back(token); - } - OnAbilitysDebugStarted(tokens); - return NO_ERROR; -} - -int32_t AbilityDebugResponseStub::HandleOnAbilitysDebugStoped(MessageParcel &data, MessageParcel &reply) -{ - auto tokenSize = data.ReadInt32(); - if (tokenSize <= CYCLE_LIMIT_MIN || tokenSize > CYCLE_LIMIT_MAX) { - TAG_LOGE(AAFwkTag::APPMGR, "Token size exceeds limit"); - return ERR_INVALID_DATA; - } - - std::vector> tokens; - for (int32_t index = 0; index < tokenSize; index++) { - auto token = data.ReadRemoteObject(); - if (token == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "null token"); - return ERR_INVALID_DATA; - } - tokens.push_back(token); - } - OnAbilitysDebugStoped(tokens); - return NO_ERROR; -} - -int32_t AbilityDebugResponseStub::HandleOnAbilitysAssertDebugChange(MessageParcel &data, MessageParcel &reply) -{ - auto tokenSize = data.ReadInt32(); - if (tokenSize <= CYCLE_LIMIT_MIN || tokenSize > CYCLE_LIMIT_MAX) { - TAG_LOGE(AAFwkTag::APPMGR, "Token size exceeds limit"); - return ERR_INVALID_DATA; - } - - std::vector> tokens; - for (int32_t index = 0; index < tokenSize; index++) { - auto token = data.ReadRemoteObject(); - if (token == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "null token"); - return ERR_INVALID_DATA; - } - tokens.push_back(token); - } - auto isAssertDebug = data.ReadBool(); - OnAbilitysAssertDebugChange(tokens, isAssertDebug); - return NO_ERROR; -} - -int AbilityDebugResponseStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - TAG_LOGD(AAFwkTag::APPMGR, "code: %{public}u, flags: %{public}d", code, option.GetFlags()); - std::u16string descriptor = AbilityDebugResponseStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGE(AAFwkTag::APPMGR, "invalid descriptor"); - return ERR_INVALID_STATE; - } - - switch (code) { - case static_cast(IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STARTED): - return HandleOnAbilitysDebugStarted(data, reply); - case static_cast(IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STOPED): - return HandleOnAbilitysDebugStoped(data, reply); - } - - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/ams_mgr_stub.cpp b/interfaces/inner_api/app_manager/src/appmgr/ams_mgr_stub.cpp index 4fc28df4288dfd2ad409575516cb1f9f0ff11b56..3368465487741d6b6f719fbeea601e4e696dffed 100644 --- a/interfaces/inner_api/app_manager/src/appmgr/ams_mgr_stub.cpp +++ b/interfaces/inner_api/app_manager/src/appmgr/ams_mgr_stub.cpp @@ -16,12 +16,12 @@ #include "ams_mgr_stub.h" #include "ability_manager_errors.h" #include "ability_info.h" -#include "app_debug_listener_interface.h" #include "app_mgr_proxy.h" #include "app_scheduler_interface.h" #include "appexecfwk_errors.h" #include "hilog_tag_wrapper.h" #include "hitrace_meter.h" +#include "iapp_debug_listener.h" #include "iapp_state_callback.h" #include "ipc_skeleton.h" #include "ipc_types.h" diff --git a/interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_proxy.cpp deleted file mode 100644 index fc271be274a5c62723bbfb0fc75579120b1abfb4..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_proxy.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "app_debug_listener_proxy.h" - -#include "hilog_tag_wrapper.h" -#include "ipc_types.h" - -namespace OHOS { -namespace AppExecFwk { -namespace { -constexpr int32_t CYCLE_LIMIT_MIN = 0; -constexpr int32_t CYCLE_LIMIT_MAX = 1000; -} -AppDebugListenerProxy::AppDebugListenerProxy( - const sptr &impl) : IRemoteProxy(impl) -{} - -bool AppDebugListenerProxy::WriteInterfaceToken(MessageParcel &data) -{ - if (!data.WriteInterfaceToken(AppDebugListenerProxy::GetDescriptor())) { - TAG_LOGE(AAFwkTag::APPMGR, "Write interface token failed."); - return false; - } - return true; -} - -void AppDebugListenerProxy::OnAppDebugStarted(const std::vector &debugInfos) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - SendRequest(IAppDebugListener::Message::ON_APP_DEBUG_STARTED, debugInfos); -} - -void AppDebugListenerProxy::OnAppDebugStoped(const std::vector &debugInfos) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - SendRequest(IAppDebugListener::Message::ON_APP_DEBUG_STOPED, debugInfos); -} - -void AppDebugListenerProxy::SendRequest( - const IAppDebugListener::Message &message, const std::vector &debugInfos) -{ - MessageParcel data; - if (!WriteInterfaceToken(data)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write interface token failed."); - return; - } - - if (debugInfos.size() <= CYCLE_LIMIT_MIN || debugInfos.size() > CYCLE_LIMIT_MAX || - !data.WriteInt32(debugInfos.size())) { - TAG_LOGE(AAFwkTag::APPMGR, "Write debug info size failed."); - return; - } - for (auto &debugInfo : debugInfos) { - if (!data.WriteParcelable(&debugInfo)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write debug info failed."); - return; - } - }; - - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Remote is nullptr."); - return; - } - - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - int32_t ret = remote->SendRequest(static_cast(message), data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d", ret); - } -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_stub.cpp b/interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_stub.cpp deleted file mode 100644 index ae20e2535b890b8947c0d4fdc3785ef359f8503c..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_stub.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "app_debug_listener_stub.h" - -#include "hilog_tag_wrapper.h" -#include "ipc_types.h" -#include "iremote_object.h" - -namespace OHOS { -namespace AppExecFwk { -namespace { -constexpr int32_t CYCLE_LIMIT_MIN = 0; -constexpr int32_t CYCLE_LIMIT_MAX = 1000; -} -AppDebugListenerStub::AppDebugListenerStub() {} - -AppDebugListenerStub::~AppDebugListenerStub() {} - -int AppDebugListenerStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - TAG_LOGD(AAFwkTag::APPMGR, "code = %{public}u, flags= %{public}d", code, option.GetFlags()); - std::u16string descriptor = AppDebugListenerStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGE(AAFwkTag::APPMGR, "Local descriptor is not equal to remote."); - return ERR_INVALID_STATE; - } - - switch (code) { - case static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STARTED): - return HandleOnAppDebugStarted(data, reply); - case static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STOPED): - return HandleOnAppDebugStoped(data, reply); - } - - TAG_LOGD(AAFwkTag::APPMGR, "AppDebugListenerStub::OnRemoteRequest end"); - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int32_t AppDebugListenerStub::HandleOnAppDebugStarted(MessageParcel &data, MessageParcel &reply) -{ - auto infoSize = data.ReadInt32(); - if (infoSize <= CYCLE_LIMIT_MIN || infoSize > CYCLE_LIMIT_MAX) { - TAG_LOGE(AAFwkTag::APPMGR, "Token size exceeds limit."); - return ERR_INVALID_DATA; - } - - std::vector appDebugInfos; - for (int32_t index = 0; index < infoSize; index++) { - std::unique_ptr appDebugInfo(data.ReadParcelable()); - if (appDebugInfo == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Read app debug infos failed."); - return ERR_INVALID_DATA; - } - appDebugInfos.emplace_back(*appDebugInfo); - } - - OnAppDebugStarted(appDebugInfos); - return NO_ERROR; -} - -int32_t AppDebugListenerStub::HandleOnAppDebugStoped(MessageParcel &data, MessageParcel &reply) -{ - auto infoSize = data.ReadInt32(); - if (infoSize <= CYCLE_LIMIT_MIN || infoSize > CYCLE_LIMIT_MAX) { - TAG_LOGE(AAFwkTag::APPMGR, "Token size exceeds limit."); - return ERR_INVALID_DATA; - } - - std::vector appDebugInfos; - for (int32_t index = 0; index < infoSize; index++) { - std::unique_ptr appDebugInfo(data.ReadParcelable()); - if (appDebugInfo == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Read app debug infos failed."); - return ERR_INVALID_DATA; - } - appDebugInfos.emplace_back(*appDebugInfo); - } - - OnAppDebugStoped(appDebugInfos); - return NO_ERROR; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp deleted file mode 100644 index 024dfee1d07babb5c5b652b4b228d7d9c987b7e7..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "start_specified_ability_response_proxy.h" -#include "ipc_types.h" -#include "hilog_tag_wrapper.h" - -namespace OHOS { -namespace AppExecFwk { -StartSpecifiedAbilityResponseProxy::StartSpecifiedAbilityResponseProxy(const sptr &impl) - : IRemoteProxy(impl) -{} - -bool StartSpecifiedAbilityResponseProxy::WriteInterfaceToken(MessageParcel &data) -{ - if (!data.WriteInterfaceToken(StartSpecifiedAbilityResponseProxy::GetDescriptor())) { - TAG_LOGE(AAFwkTag::APPMGR, "write interface token failed"); - return false; - } - return true; -} - -void StartSpecifiedAbilityResponseProxy::OnAcceptWantResponse( - const AAFwk::Want &want, const std::string &flag, int32_t requestId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "On accept want by proxy."); - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - if (!WriteInterfaceToken(data)) { - return; - } - if (!data.WriteParcelable(&want) || !data.WriteString(flag) || - !data.WriteInt32(requestId)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data failed."); - return; - } - - int32_t ret = SendTransactCmd( - static_cast(IStartSpecifiedAbilityResponse::Message::ON_ACCEPT_WANT_RESPONSE), data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGW(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d", ret); - } -} - -void StartSpecifiedAbilityResponseProxy::OnTimeoutResponse(int32_t requestId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "On timeout response by proxy."); - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - if (!WriteInterfaceToken(data)) { - return; - } - if (!data.WriteInt32(requestId)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data failed."); - return; - } - - int32_t ret = SendTransactCmd(static_cast( - IStartSpecifiedAbilityResponse::Message::ON_TIMEOUT_RESPONSE), data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGW(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d", ret); - } -} - -int32_t StartSpecifiedAbilityResponseProxy::SendTransactCmd(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option) -{ - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Remote is nullptr."); - return ERR_NULL_OBJECT; - } - - return remote->SendRequest(code, data, reply, option); -} - -void StartSpecifiedAbilityResponseProxy::OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "On satrt specified process response by proxy."); - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - if (!WriteInterfaceToken(data)) { - return; - } - if (!data.WriteString(flag) || !data.WriteInt32(requestId)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data failed."); - return; - } - - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Remote is nullptr."); - return; - } - int32_t ret = remote->SendRequest( - static_cast(IStartSpecifiedAbilityResponse::Message::ON_NEW_PROCESS_REQUEST_RESPONSE), - data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGW(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d", ret); - } -} - -void StartSpecifiedAbilityResponseProxy::OnNewProcessRequestTimeoutResponse(int32_t requestId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "On start specified process timeout response by proxy."); - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - if (!WriteInterfaceToken(data)) { - return; - } - if (data.WriteInt32(requestId)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data failed."); - return; - } - - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Remote is nullptr."); - return; - } - int32_t ret = remote->SendRequest(static_cast( - IStartSpecifiedAbilityResponse::Message::ON_NEW_PROCESS_REQUEST_TIMEOUT_RESPONSE), - data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGW(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d", ret); - } -} - -void StartSpecifiedAbilityResponseProxy::OnStartSpecifiedFailed(int32_t requestId) -{ - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - if (!WriteInterfaceToken(data)) { - return; - } - if (!data.WriteInt32(requestId)) { - TAG_LOGE(AAFwkTag::APPMGR, "Write data failed."); - return; - } - - int32_t ret = SendTransactCmd( - static_cast(IStartSpecifiedAbilityResponse::Message::ON_START_SPECIFIED_FAILED), data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGW(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d", ret); - } -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_stub.cpp b/interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_stub.cpp deleted file mode 100644 index 690da42b84a00652426d3e4dbc81d7c3663598d9..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_stub.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "start_specified_ability_response_stub.h" -#include "appexecfwk_errors.h" -#include "hilog_tag_wrapper.h" -#include "ipc_types.h" -#include "iremote_object.h" - -namespace OHOS { -namespace AppExecFwk { -int32_t StartSpecifiedAbilityResponseStub::HandleOnAcceptWantResponse(MessageParcel &data, MessageParcel &reply) -{ - AAFwk::Want *want = data.ReadParcelable(); - if (want == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "want is nullptr"); - return ERR_INVALID_VALUE; - } - - auto flag = Str16ToStr8(data.ReadString16()); - OnAcceptWantResponse(*want, flag, data.ReadInt32()); - delete want; - return NO_ERROR; -} - -int32_t StartSpecifiedAbilityResponseStub::HandleOnTimeoutResponse(MessageParcel &data, MessageParcel &reply) -{ - OnTimeoutResponse(data.ReadInt32()); - return NO_ERROR; -} - -int32_t StartSpecifiedAbilityResponseStub::HandleOnNewProcessRequestResponse(MessageParcel &data, MessageParcel &reply) -{ - auto flag = Str16ToStr8(data.ReadString16()); - OnNewProcessRequestResponse(flag, data.ReadInt32()); - return NO_ERROR; -} - -int32_t StartSpecifiedAbilityResponseStub::HandleOnNewProcessRequestTimeoutResponse(MessageParcel &data, - MessageParcel &reply) -{ - OnNewProcessRequestTimeoutResponse(data.ReadInt32()); - return NO_ERROR; -} - -int32_t StartSpecifiedAbilityResponseStub::HandleOnStartSpecifiedFailed(MessageParcel &data, - MessageParcel &reply) -{ - OnStartSpecifiedFailed(data.ReadInt32()); - return NO_ERROR; -} - -int StartSpecifiedAbilityResponseStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - TAG_LOGI(AAFwkTag::APPMGR, "StartSpecifiedAbilityResponseStub::OnReceived, code = %{public}u, flags= %{public}d.", - code, option.GetFlags()); - std::u16string descriptor = StartSpecifiedAbilityResponseStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGE(AAFwkTag::APPMGR, "local descriptor is not equal to remote"); - return ERR_INVALID_STATE; - } - - switch (code) { - case Message::ON_ACCEPT_WANT_RESPONSE: return HandleOnAcceptWantResponse(data, reply); - case Message::ON_TIMEOUT_RESPONSE: return HandleOnTimeoutResponse(data, reply); - case Message::ON_NEW_PROCESS_REQUEST_RESPONSE: return HandleOnNewProcessRequestResponse(data, reply); - case Message::ON_NEW_PROCESS_REQUEST_TIMEOUT_RESPONSE: - return HandleOnNewProcessRequestTimeoutResponse(data, reply); - case Message::ON_START_SPECIFIED_FAILED: return HandleOnStartSpecifiedFailed(data, reply); - default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); - } -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/wantagent/BUILD.gn b/interfaces/inner_api/wantagent/BUILD.gn index 046af7228298ab38503126390560b88c7532344b..c9656d1558f1cc65f05cad2fa6eaa79f94a0ea12 100644 --- a/interfaces/inner_api/wantagent/BUILD.gn +++ b/interfaces/inner_api/wantagent/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -43,6 +43,10 @@ config("wantagent_innerkits_public_config") { "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", ] + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", + "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", + ] } ohos_shared_library("wantagent_innerkits") { diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index 110c085036249b7f34afd8b36f7d22f4869ec22c..c87128b77fb2a461bea1f62d75f177b8d6e37dab 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -64,7 +64,7 @@ config("abilityms_config") { "${ability_runtime_path}/utils/global/time/include", "${ability_runtime_utils_path}/server/constant", ] - + configs = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config" ] defines = [] if (ability_command_for_test) { diff --git a/services/abilitymgr/abilitymgr.gni b/services/abilitymgr/abilitymgr.gni index 3f646c121f6c11eb390b711b87e6bcc8b1721f33..398c8a9c2163f66452754ec345149e8b114dffda 100644 --- a/services/abilitymgr/abilitymgr.gni +++ b/services/abilitymgr/abilitymgr.gni @@ -80,7 +80,6 @@ abilityms_files = [ "src/ui_extension_record/ui_extension_record_factory.cpp", "src/screen_lock/unlock_screen_manager.cpp", "src/start_options.cpp", - "src/user_callback_proxy.cpp", "src/call_container.cpp", "src/call_record.cpp", "src/inner_mission_info.cpp", diff --git a/services/abilitymgr/include/ability_debug_deal.h b/services/abilitymgr/include/ability_debug_deal.h index 13e446b090bedede16749721e33add5ae3b4ca30..64dc7d6063795c451c05ae63575426123765d2c6 100644 --- a/services/abilitymgr/include/ability_debug_deal.h +++ b/services/abilitymgr/include/ability_debug_deal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * 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 @@ -16,8 +16,8 @@ #ifndef OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_DEAL_H #define OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_DEAL_H -#include "ability_debug_response_interface.h" #include "ability_debug_response_stub.h" +#include "iability_debug_response.h" namespace OHOS { namespace AAFwk { @@ -60,9 +60,9 @@ public: virtual ~AbilityDebugResponse() = default; private: - void OnAbilitysDebugStarted(const std::vector> &tokens) override; - void OnAbilitysDebugStoped(const std::vector> &tokens) override; - void OnAbilitysAssertDebugChange(const std::vector> &tokens, bool isAssertDebug) override; + ErrCode OnAbilitysDebugStarted(const std::vector> &tokens) override; + ErrCode OnAbilitysDebugStoped(const std::vector> &tokens) override; + ErrCode OnAbilitysAssertDebugChange(const std::vector> &tokens, bool isAssertDebug) override; std::weak_ptr abilityDebugDeal_; }; diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 2f3e802639024bec4033705a26c479e464bfeeb5..ded500257978b835a7b47165c24413540b804cea 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -37,7 +37,6 @@ #include "ability_keep_alive_service.h" #include "ability_start_with_wait_observer_utils.h" #include "ams_configuration_parameter.h" -#include "app_debug_listener_interface.h" #include "app_exit_reason_helper.h" #include "app_mgr_interface.h" #include "app_scheduler.h" @@ -52,6 +51,7 @@ #include "event_report.h" #include "free_install_manager.h" #include "iacquire_share_data_callback_interface.h" +#include "iapp_debug_listener.h" #include "interceptor/ability_interceptor_executer.h" #include "iremote_object.h" #include "mission_list_manager_interface.h" @@ -2172,7 +2172,7 @@ protected: int32_t GetCollaboratorType(const std::string &codePath) const; int32_t KillProcessForCollaborator(int32_t collaboratorType, const std::string &bundleName, int32_t userId); - + /** * Check if Caller is allowed to start AppServiceExtension(Stage). * @@ -2784,9 +2784,9 @@ private: ErrCode IntentOpenLinkInner(const std::shared_ptr ¶m, AbilityRuntime::ExtractInsightIntentGenericInfo &linkInfo, const int32_t userId); - + AbilityRuntime::ExtractInsightIntentGenericInfo GetInsightIntentGenericInfo(const InsightIntentExecuteParam ¶m); - + void CombinLinkInfo( const std::vector ¶mMappings, std::string &uri, AAFwk::Want &want); diff --git a/services/abilitymgr/include/app_scheduler.h b/services/abilitymgr/include/app_scheduler.h index b2de5a3951123671c45bf65a83bfed95c0db35da..e1eb97bf0ded9e95a27de140ec60a6ec0d309b66 100644 --- a/services/abilitymgr/include/app_scheduler.h +++ b/services/abilitymgr/include/app_scheduler.h @@ -19,20 +19,20 @@ #include #include -#include "ability_debug_response_interface.h" +#include "iability_debug_response.h" #include "ability_info.h" #include "ability_manager_client.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "application_info.h" #include "appmgr/app_mgr_client.h" #include "appmgr/app_state_callback_host.h" -#include "appmgr/start_specified_ability_response_stub.h" #include "bundle_info.h" #include "fault_data.h" #include "iremote_object.h" #include "refbase.h" #include "running_process_info.h" #include "singleton.h" +#include "start_specified_ability_response_stub.h" #include "system_memory_attr.h" #include "want.h" @@ -114,7 +114,7 @@ public: * @param abilityTokens abilities in died process. */ virtual void OnAppRemoteDied(const std::vector> &abilityTokens) {} - + virtual void OnStartProcessFailed(sptr token) {} virtual void OnCacheExitInfo(uint32_t accessTokenId, const AppExecFwk::RunningProcessInfo &exitInfo, @@ -127,14 +127,14 @@ public: StartSpecifiedAbilityResponse() = default; virtual ~StartSpecifiedAbilityResponse() = default; - virtual void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, + virtual ErrCode OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override; - virtual void OnTimeoutResponse(int32_t requestId) override; + virtual ErrCode OnTimeoutResponse(int32_t requestId) override; - virtual void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override; - virtual void OnNewProcessRequestTimeoutResponse(int32_t requestId) override; + virtual ErrCode OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override; + virtual ErrCode OnNewProcessRequestTimeoutResponse(int32_t requestId) override; - virtual void OnStartSpecifiedFailed(int32_t requestId) override; + virtual ErrCode OnStartSpecifiedFailed(int32_t requestId) override; }; /** diff --git a/services/abilitymgr/src/ability_debug_deal.cpp b/services/abilitymgr/src/ability_debug_deal.cpp index 9493ef44d477c819b6405c76b41d33482b9b331e..236b88d2721e55c8c9fa343b8a3380d8163a6219 100644 --- a/services/abilitymgr/src/ability_debug_deal.cpp +++ b/services/abilitymgr/src/ability_debug_deal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * 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 @@ -74,50 +74,53 @@ void AbilityDebugDeal::OnAbilitysAssertDebugChange(const std::vector> &tokens) +ErrCode AbilityDebugResponse::OnAbilitysDebugStarted(const std::vector> &tokens) { if (tokens.empty()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "tokens empty"); - return; + return ERR_ABILITY_DEBUG_EMPTY_TOKENS; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGE(AAFwkTag::ABILITYMGR, "deal null"); - return; + return INNER_ERR; } deal->OnAbilitysDebugStarted(tokens); + return ERR_OK; } -void AbilityDebugResponse::OnAbilitysDebugStoped(const std::vector> &tokens) +ErrCode AbilityDebugResponse::OnAbilitysDebugStoped(const std::vector> &tokens) { if (tokens.empty()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "tokens empty"); - return; + return ERR_ABILITY_DEBUG_EMPTY_TOKENS; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGE(AAFwkTag::ABILITYMGR, "deal null"); - return; + return INNER_ERR; } deal->OnAbilitysDebugStoped(tokens); + return ERR_OK; } -void AbilityDebugResponse::OnAbilitysAssertDebugChange( +ErrCode AbilityDebugResponse::OnAbilitysAssertDebugChange( const std::vector> &tokens, bool isAssertDebug) { if (tokens.empty()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "tokens empty"); - return; + return ERR_ABILITY_DEBUG_EMPTY_TOKENS; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGW(AAFwkTag::ABILITYMGR, "deal null"); - return; + return INNER_ERR; } deal->OnAbilitysAssertDebugChange(tokens, isAssertDebug); + return ERR_OK; } } // namespace AAFwk } // namespace OHOS diff --git a/services/abilitymgr/src/app_scheduler.cpp b/services/abilitymgr/src/app_scheduler.cpp index d6385c53b441b67a4d3d654c749e136024d108af..d26e6d7ffe6a89c043b20f133a6c7b59a58d70e2 100644 --- a/services/abilitymgr/src/app_scheduler.cpp +++ b/services/abilitymgr/src/app_scheduler.cpp @@ -386,10 +386,11 @@ void AppScheduler::StartSpecifiedAbility(const AAFwk::Want &want, const AppExecF IN_PROCESS_CALL_WITHOUT_RET(appMgrClient_->StartSpecifiedAbility(want, abilityInfo, requestId)); } -void StartSpecifiedAbilityResponse::OnAcceptWantResponse( +ErrCode StartSpecifiedAbilityResponse::OnAcceptWantResponse( const AAFwk::Want &want, const std::string &flag, int32_t requestId) { DelayedSingleton::GetInstance()->OnAcceptWantResponse(want, flag, requestId); + return ERR_OK; } void AppScheduler::PrepareTerminateApp(const pid_t pid, const std::string &moduleName) @@ -398,9 +399,10 @@ void AppScheduler::PrepareTerminateApp(const pid_t pid, const std::string &modul IN_PROCESS_CALL_WITHOUT_RET(appMgrClient_->PrepareTerminateApp(pid, moduleName)); } -void StartSpecifiedAbilityResponse::OnTimeoutResponse(int32_t requestId) +ErrCode StartSpecifiedAbilityResponse::OnTimeoutResponse(int32_t requestId) { DelayedSingleton::GetInstance()->OnStartSpecifiedAbilityTimeoutResponse(requestId); + return ERR_OK; } void AppScheduler::StartSpecifiedProcess( @@ -410,19 +412,22 @@ void AppScheduler::StartSpecifiedProcess( IN_PROCESS_CALL_WITHOUT_RET(appMgrClient_->StartSpecifiedProcess(want, abilityInfo, requestId)); } -void StartSpecifiedAbilityResponse::OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) +ErrCode StartSpecifiedAbilityResponse::OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) { DelayedSingleton::GetInstance()->OnStartSpecifiedProcessResponse(flag, requestId); + return ERR_OK; } -void StartSpecifiedAbilityResponse::OnNewProcessRequestTimeoutResponse(int32_t requestId) +ErrCode StartSpecifiedAbilityResponse::OnNewProcessRequestTimeoutResponse(int32_t requestId) { DelayedSingleton::GetInstance()->OnStartSpecifiedProcessTimeoutResponse(requestId); + return ERR_OK; } -void StartSpecifiedAbilityResponse::OnStartSpecifiedFailed(int32_t requestId) +ErrCode StartSpecifiedAbilityResponse::OnStartSpecifiedFailed(int32_t requestId) { DelayedSingleton::GetInstance()->OnStartSpecifiedFailed(requestId); + return ERR_OK; } int AppScheduler::GetProcessRunningInfos(std::vector &info) diff --git a/services/abilitymgr/src/user_callback_proxy.cpp b/services/abilitymgr/src/user_callback_proxy.cpp deleted file mode 100644 index a94521710d7886f3a2db28e4e9966335044b8fee..0000000000000000000000000000000000000000 --- a/services/abilitymgr/src/user_callback_proxy.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -#include "user_callback_proxy.h" - -#include "hilog_tag_wrapper.h" - -namespace OHOS { -namespace AAFwk { -void UserCallbackProxy::OnStopUserDone(int userId, int errcode) -{ - SendRequestCommon(userId, errcode, IUserCallback::UserCallbackCmd::ON_STOP_USER_DONE); -} - -void UserCallbackProxy::OnStartUserDone(int userId, int errcode) -{ - SendRequestCommon(userId, errcode, IUserCallback::UserCallbackCmd::ON_START_USER_DONE); -} - -void UserCallbackProxy::OnLogoutUserDone(int userId, int errcode) -{ - SendRequestCommon(userId, errcode, IUserCallback::UserCallbackCmd::ON_LOGOUT_USER_DONE); -} - -void UserCallbackProxy::SendRequestCommon(int userId, int errcode, IUserCallback::UserCallbackCmd cmd) -{ - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - - TAG_LOGI(AAFwkTag::ABILITYMGR, - "UserCallbackProxy, sendrequest, cmd:%{public}d, userId:%{public}d, errcode:%{public}d", cmd, userId, errcode); - if (!data.WriteInterfaceToken(IUserCallback::GetDescriptor())) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write interface token failed"); - return; - } - - if (!data.WriteInt32(userId)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write userId error"); - return; - } - - if (!data.WriteInt32(errcode)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write errcode error"); - return; - } - - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "null remote object"); - return; - } - - int error = remote->SendRequest(cmd, data, reply, option); - if (error != NO_ERROR) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "SendRequest fail, error: %{public}d", error); - return; - } -} -} // namespace AAFwk -} // namespace OHOS diff --git a/services/abilitymgr/src/user_callback_stub.cpp b/services/abilitymgr/src/user_callback_stub.cpp deleted file mode 100644 index fe078586ffd957f68134f805f47a643769dd7f93..0000000000000000000000000000000000000000 --- a/services/abilitymgr/src/user_callback_stub.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -#include "user_callback_stub.h" - -#include "hilog_tag_wrapper.h" - -namespace OHOS { -namespace AAFwk { -UserCallbackStub::UserCallbackStub() {} - -int UserCallbackStub::OnStopUserDoneInner(MessageParcel &data, MessageParcel &reply) -{ - auto accountId = data.ReadInt32(); - auto errCode = data.ReadInt32(); - OnStopUserDone(accountId, errCode); - return NO_ERROR; -} - -int UserCallbackStub::OnStartUserDoneInner(MessageParcel &data, MessageParcel &reply) -{ - auto accountId = data.ReadInt32(); - auto errCode = data.ReadInt32(); - OnStartUserDone(accountId, errCode); - return NO_ERROR; -} - -int UserCallbackStub::OnLogoutUserDoneInner(MessageParcel &data, MessageParcel &reply) -{ - auto accountId = data.ReadInt32(); - auto errCode = data.ReadInt32(); - OnLogoutUserDone(accountId, errCode); - return NO_ERROR; -} - -int UserCallbackStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - std::u16string descriptor = UserCallbackStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGI(AAFwkTag::ABILITYMGR, "local descriptor invalid"); - return ERR_INVALID_STATE; - } - - if (code < UserCallbackCmd::CMD_MAX && code >= 0) { - switch (code) { - case UserCallbackCmd::ON_STOP_USER_DONE: - return OnStopUserDoneInner(data, reply); - break; - case UserCallbackCmd::ON_START_USER_DONE: - return OnStartUserDoneInner(data, reply); - break; - case UserCallbackCmd::ON_LOGOUT_USER_DONE: - return OnLogoutUserDoneInner(data, reply); - break; - } - } - - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} -} // namespace AAFwk -} // namespace OHOS diff --git a/services/appmgr/include/ams_mgr_scheduler.h b/services/appmgr/include/ams_mgr_scheduler.h index 69af744e93aa70926dfb03e69bfec5cd5d5aa538..28f6b3e78ff72f9b812a0ebfcce75e3da31b00cf 100644 --- a/services/appmgr/include/ams_mgr_scheduler.h +++ b/services/appmgr/include/ams_mgr_scheduler.h @@ -19,7 +19,6 @@ #include "ability_info.h" #include "ability_running_record.h" #include "ams_mgr_stub.h" -#include "app_debug_listener_interface.h" #include "app_mgr_constants.h" #include "app_mgr_service_inner.h" #include "app_record_id.h" @@ -27,6 +26,7 @@ #include "app_scheduler_proxy.h" #include "appexecfwk_errors.h" #include "application_info.h" +#include "iapp_debug_listener.h" #include "if_system_ability_manager.h" #include "nocopyable.h" #include "system_ability.h" diff --git a/services/appmgr/include/app_debug_manager.h b/services/appmgr/include/app_debug_manager.h index 8da182c9428beb521781100b6930ca21e0aba8b9..aae9db220dbcdaea243750c33db3b27fd2e844cb 100644 --- a/services/appmgr/include/app_debug_manager.h +++ b/services/appmgr/include/app_debug_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -19,7 +19,7 @@ #include #include -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" namespace OHOS { namespace AppExecFwk { diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index 9bc66b07c2fc058a1746443ac4414a907518663c..4f4588802e2f10fd120223cd4dad8da384b76e64 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -24,12 +24,11 @@ #include #include -#include "ability_debug_response_interface.h" #include "ability_foreground_state_observer_interface.h" #include "ability_info.h" #include "advanced_security_mode_manager.h" #include "app_death_recipient.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "app_debug_manager.h" #include "app_foreground_state_observer_interface.h" #include "app_malloc_info.h" @@ -58,6 +57,7 @@ #include "fault_data.h" #include "fd_guard.h" #include "hisysevent.h" +#include "iability_debug_response.h" #include "iapp_state_callback.h" #include "iapplication_state_observer.h" #include "iconfiguration_observer.h" @@ -81,7 +81,7 @@ #include "app_cjheap_mem_info.h" #include "running_multi_info.h" #include "multi_user_config_mgr.h" -#include "user_callback.h" +#include "iuser_callback.h" #include "native_child_notify_interface.h" namespace OHOS { diff --git a/services/appmgr/include/app_running_manager.h b/services/appmgr/include/app_running_manager.h index d92f1b5228b0dde430519a19ab1c77b73428ed99..061d13f2cd6334daba455ed0dae64e34dbc25188 100644 --- a/services/appmgr/include/app_running_manager.h +++ b/services/appmgr/include/app_running_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -22,7 +22,7 @@ #include #include "ability_info.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "app_jsheap_mem_info.h" #include "app_cjheap_mem_info.h" #include "app_malloc_info.h" @@ -420,7 +420,7 @@ public: int32_t RemoveUIExtensionBindItemById(int32_t uiExtensionBindAbilityId); std::shared_ptr GetAppRunningRecordByChildRecordPid(const pid_t pid); - + int32_t AssignRunningProcessInfoByAppRecord( std::shared_ptr appRecord, AppExecFwk::RunningProcessInfo &info) const; diff --git a/test/fuzztest/abilityattachtimeout_fuzzer/BUILD.gn b/test/fuzztest/abilityattachtimeout_fuzzer/BUILD.gn index d3733d99fceb89933a8ec114c9d378d9994c18e3..d5454e2fe82224e4a0dc5ab290dbb366ae3c9361 100755 --- a/test/fuzztest/abilityattachtimeout_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityattachtimeout_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("AbilityAttachTimeOutFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/abilityconnectionstub_fuzzer/BUILD.gn b/test/fuzztest/abilityconnectionstub_fuzzer/BUILD.gn index 0bb04b5efbd467820b6c0ba3c5c5ba0cba000725..31fe1ca2adab630f3ff8dad59f682b498e843139 100755 --- a/test/fuzztest/abilityconnectionstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityconnectionstub_fuzzer/BUILD.gn @@ -48,6 +48,7 @@ ohos_fuzztest("AbilityConnectionStubFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/abilityconnectmanager_fuzzer/BUILD.gn b/test/fuzztest/abilityconnectmanager_fuzzer/BUILD.gn index e9cd00deae4f81a226836a43b738b368bd7dc071..86ac302f01c5e65a3463c83e9e6ee32978b1a88d 100755 --- a/test/fuzztest/abilityconnectmanager_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityconnectmanager_fuzzer/BUILD.gn @@ -53,6 +53,7 @@ ohos_fuzztest("AbilityConnectManagerFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "relational_store:native_dataability", diff --git a/test/fuzztest/abilitycontext_fuzzer/BUILD.gn b/test/fuzztest/abilitycontext_fuzzer/BUILD.gn index 47dd309f7132782302ffb3ef5d06be65aeea41fe..dc066f3e8ab755cc630dfdd8153386d69ad08ab1 100644 --- a/test/fuzztest/abilitycontext_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitycontext_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("AbilityContextFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn b/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn index f9c6a7be98b0b10f651f3016cf7977479bf9ecb7..8ddfb770b05721fd179ffa73388efc59c75f5598 100644 --- a/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. +# 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 @@ -37,7 +37,6 @@ ohos_fuzztest("AbilityDebugDealFuzzTest") { "-fno-omit-frame-pointer", ] sources = [ - "${ability_runtime_innerkits_path}/app_manager/src/appmgr/ability_debug_response_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_debug_deal.cpp", "abilitydebugdeal_fuzzer.cpp", ] @@ -50,6 +49,7 @@ ohos_fuzztest("AbilityDebugDealFuzzTest") { deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", ] diff --git a/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn b/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn index 768834e2a31030ea533bc6a0c01692839bec5300..363a825f1b549469c7ade39958b0585c3fee8c5c 100755 --- a/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-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 @@ -36,7 +36,6 @@ ohos_fuzztest("AbilityDebugResponseProxyFuzzTest") { ] sources = [ - "${ability_runtime_innerkits_path}/app_manager/src/appmgr/ability_debug_response_proxy.cpp", "abilitydebugresponseproxy_fuzzer.cpp", ] @@ -48,6 +47,7 @@ ohos_fuzztest("AbilityDebugResponseProxyFuzzTest") { deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_native_path}/ability/native:auto_startup_callback", diff --git a/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp b/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp index 7840d93e675deb7294dfad471df051e006418558..04bd6c2cf48871d6a2a4d99d391ee085221e3b90 100755 --- a/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp +++ b/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -68,16 +68,10 @@ void AbilityDebugResponseProxyFuzztest1(bool boolParam, std::string &stringParam std::shared_ptr proxy = std::make_shared(nullptr); // branch constructor MessageParcel data; - proxy->WriteInterfaceToken(data); // branch std::vector> tokens; proxy->OnAbilitysDebugStarted(tokens); // branch proxy->OnAbilitysDebugStoped(tokens); // branch proxy->OnAbilitysAssertDebugChange(tokens, boolParam); // branch - sptr token = GetFuzzAbilityToken(); - tokens.emplace_back(token); - proxy->SendRequest(static_cast(int32Param), tokens); // branch tokens no empty. - tokens.clear(); - proxy->SendRequest(static_cast(int32Param), tokens); // branch tokens empty. } bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) diff --git a/test/fuzztest/abilityforegroundstateobserverproxy_fuzzer/BUILD.gn b/test/fuzztest/abilityforegroundstateobserverproxy_fuzzer/BUILD.gn index 662b5107957ca96e6d433025fdf0bf23b77a7b9d..c1d8ac19dcd7b9a7051ed94fb817de5260ef04e2 100644 --- a/test/fuzztest/abilityforegroundstateobserverproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityforegroundstateobserverproxy_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("AbilityForegroundStateObserverProxyFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmanageramsmgrstub_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmanageramsmgrstub_fuzzer/BUILD.gn index 9e97afa101dc34a73de592fdf1a595da0954437f..f3e967b5b47235d1f6e8eb61f2d6b18729c187d6 100644 --- a/test/fuzztest/abilityinterfacesappmanageramsmgrstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmanageramsmgrstub_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppManagerAmsMgrStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_core", diff --git a/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/BUILD.gn index 006c7c5a79dc89cf1a8a002b903e1c3e893c5ca8..416dc589919f2db46a5559f6615b84423375f4f5 100644 --- a/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrAbilityDebugResponseProxyFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp index b09f529b4c3586f49641d25dbe92f48b6119de46..25969b4b201044158a59c96dfae628e25be3a7bd 100644 --- a/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp +++ b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -20,7 +20,6 @@ #define private public #include "ability_debug_response_proxy.h" -#include "ability_debug_response_interface.h" #undef private #include "securec.h" @@ -73,17 +72,6 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) infosProxy->OnAbilitysDebugStoped(tokens); bool isAssertDebug = *data % ENABLE; infosProxy->OnAbilitysAssertDebugChange(tokens, isAssertDebug); - MessageParcel parcels; - parcels.WriteInterfaceToken(AMSMGR_INTERFACE_TOKEN); - parcels.WriteBuffer(data, size); - parcels.RewindRead(0); - infosProxy->WriteInterfaceToken(parcels); - IAbilityDebugResponse::Message message = IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STARTED; - infosProxy->SendRequest(message, tokens); - message = IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STOPED; - infosProxy->SendRequest(message, tokens); - message = IAbilityDebugResponse::Message::ON_ABILITYS_ASSERT_DEBUG; - infosProxy->SendRequest(message, tokens); return true; } } diff --git a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/BUILD.gn index 4f3df9a1d7802b7e85598d7203eadd7bf010b387..6a808a56d4d748e996da524e17469c413e5e8e4e 100644 --- a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrAppDebugListenerProxyFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp index bb28bb48cd9aa3f2e8154417ac0dd3238e539a4b..cf99b6d40aff686c8cd0490501336cdc9dd98fdc 100644 --- a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp +++ b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -20,7 +20,6 @@ #define private public #include "app_debug_listener_proxy.h" -#include "app_debug_listener_interface.h" #undef private #include "securec.h" @@ -71,15 +70,6 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) std::vector debugInfos; infosProxy->OnAppDebugStarted(debugInfos); infosProxy->OnAppDebugStoped(debugInfos); - MessageParcel parcels; - parcels.WriteInterfaceToken(AMSMGR_INTERFACE_TOKEN); - parcels.WriteBuffer(data, size); - parcels.RewindRead(0); - infosProxy->WriteInterfaceToken(parcels); - IAppDebugListener::Message message = IAppDebugListener::Message::ON_APP_DEBUG_STARTED; - infosProxy->SendRequest(message, debugInfos); - message = IAppDebugListener::Message::ON_APP_DEBUG_STOPED; - infosProxy->SendRequest(message, debugInfos); return true; } } diff --git a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/BUILD.gn index de7aac55e455ebc944ab3bf915ad2402db20dae5..4d78f577650623cdd59de6f52dcaf477a1ca28a2 100644 --- a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrAppDebugListenerStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp index 2b94e21e8d6fd6bd6bfcae798775df4bc7835bb0..79118353ee2c7b56a2bce6540b738d9449790949 100644 --- a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp +++ b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -20,7 +20,6 @@ #define private public #include "app_debug_listener_stub.h" -#include "app_debug_listener_interface.h" #undef private #include "securec.h" @@ -55,8 +54,8 @@ public: virtual ~ AppDebugListenerStubFUZZ() {}; int OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override{ return 0; }; - void OnAppDebugStarted(const std::vector &debugInfos) override{}; - void OnAppDebugStoped(const std::vector &debugInfos) override{}; + ErrCode OnAppDebugStarted(const std::vector &debugInfos) override { return ERR_OK; }; + ErrCode OnAppDebugStoped(const std::vector &debugInfos) override { return ERR_OK; }; }; sptr GetFuzzAbilityToken() @@ -75,7 +74,7 @@ sptr GetFuzzAbilityToken() bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) { - uint32_t codeOne = static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STARTED); + uint32_t codeOne = static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED); MessageParcel parcel; parcel.WriteInterfaceToken(AMSMGR_INTERFACE_TOKEN); parcel.WriteBuffer(data, size); @@ -84,7 +83,7 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) MessageOption option; std::shared_ptr abmsOne = std::make_shared(); abmsOne->OnRemoteRequest(codeOne, parcel, reply, option); - uint32_t codeTwo = static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STOPED); + uint32_t codeTwo = static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STOPED); abmsOne->OnRemoteRequest(codeTwo, parcel, reply, option); return true; } diff --git a/test/fuzztest/abilityinterfacesappmgrappforegroundstateobserverstub_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrappforegroundstateobserverstub_fuzzer/BUILD.gn index 8d18a4661204a47823eef7fe767cdbfbdf93c065..b7ebfdbae9624175868b5fb5ab6b0f750006d372 100644 --- a/test/fuzztest/abilityinterfacesappmgrappforegroundstateobserverstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrappforegroundstateobserverstub_fuzzer/BUILD.gn @@ -59,6 +59,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrAppForegroundStateObserverStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrchildschedulerproxy_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrchildschedulerproxy_fuzzer/BUILD.gn index 280a47a4d1bda34583f9a43cb8405900b1768882..8a6e0ef66e692c5cff69687e7559ca9652bcc6d3 100644 --- a/test/fuzztest/abilityinterfacesappmgrchildschedulerproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrchildschedulerproxy_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrChildSchedulerProxyFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrchildschedulerstub_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrchildschedulerstub_fuzzer/BUILD.gn index ec60c224bb10f8bd88f48bdc37aa94e7ea04f27e..72fa9da34e2e0465bd4183931fa5ec49a4494cf8 100644 --- a/test/fuzztest/abilityinterfacesappmgrchildschedulerstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrchildschedulerstub_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrChildSchedulerStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrnativechildnotifyproxy_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrnativechildnotifyproxy_fuzzer/BUILD.gn index d5b569f2e9785d9619143c19c1edeeeadb14701b..5a759d531ee177bbd2a48b859feb4e2110b4792a 100644 --- a/test/fuzztest/abilityinterfacesappmgrnativechildnotifyproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrnativechildnotifyproxy_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrNativeChildNotifyProxyFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrnativechildnotifystub_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrnativechildnotifystub_fuzzer/BUILD.gn index f74f096babc56db823e3a05cec7cfb3458dea7d1..b2a18bd92b107ad140e6baeaced2f19950a03335 100644 --- a/test/fuzztest/abilityinterfacesappmgrnativechildnotifystub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrnativechildnotifystub_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrNativeChildNotifyStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilityinterfacesappmgrrenderstateobserverstub_fuzzer/BUILD.gn b/test/fuzztest/abilityinterfacesappmgrrenderstateobserverstub_fuzzer/BUILD.gn index 4f0d0d3d084ae11b09dbc69350b88cac310b5d50..dad3bbd138ea2fe83cb6992454cf1a0419c8ec95 100644 --- a/test/fuzztest/abilityinterfacesappmgrrenderstateobserverstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityinterfacesappmgrrenderstateobserverstub_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("AbilityInterfacesAppMgrRenderStateObserverStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/abilitymanagerserviceb_fuzzer/BUILD.gn b/test/fuzztest/abilitymanagerserviceb_fuzzer/BUILD.gn index 74dcfad3be96313b18d74594a769bf153463e13c..45143446d5dbc1616424f0696ba8ddae950ec07e 100755 --- a/test/fuzztest/abilitymanagerserviceb_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitymanagerserviceb_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("AbilityManagerServiceBFuzzTest") { "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "input:libmmi-client", "ipc:ipc_core", diff --git a/test/fuzztest/abilitymanagerservicesecond_fuzzer/BUILD.gn b/test/fuzztest/abilitymanagerservicesecond_fuzzer/BUILD.gn index ab54cfd4845a8cbdcd2f457a1473383ed6e2dfd4..0867a81601660f09632211d0c6e6d3de6c2afdb6 100755 --- a/test/fuzztest/abilitymanagerservicesecond_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitymanagerservicesecond_fuzzer/BUILD.gn @@ -60,6 +60,7 @@ ohos_fuzztest("AbilityManagerServiceSecondFuzzTest") { "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "input:libmmi-client", "ipc:ipc_core", diff --git a/test/fuzztest/abilityrunningrecord_fuzzer/BUILD.gn b/test/fuzztest/abilityrunningrecord_fuzzer/BUILD.gn index db164a19cb5d0f107502524e8106671f79e69719..c3acec05c485986e1fd3a5d4d4eda537e4dab643 100644 --- a/test/fuzztest/abilityrunningrecord_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityrunningrecord_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("AbilityRunningRecordFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/abilityschedulerstub_fuzzer/BUILD.gn b/test/fuzztest/abilityschedulerstub_fuzzer/BUILD.gn index fc78fff8b2af42c01bb35634654cd830f13e4c0f..ae1bdbc8287fbcedbe7432320e7ed9eb6e328d8c 100755 --- a/test/fuzztest/abilityschedulerstub_fuzzer/BUILD.gn +++ b/test/fuzztest/abilityschedulerstub_fuzzer/BUILD.gn @@ -49,6 +49,7 @@ ohos_fuzztest("AbilitySchedulerStubFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/abilitytransitiondone_fuzzer/BUILD.gn b/test/fuzztest/abilitytransitiondone_fuzzer/BUILD.gn index b3f82b3ab9f66b711e6b7630962946dfe65eb05a..90cb6fd7a22d02fb32d35ebf716f35dc41cffa68 100644 --- a/test/fuzztest/abilitytransitiondone_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitytransitiondone_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("AbilityTransitionDoneFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/acquiredataability_fuzzer/BUILD.gn b/test/fuzztest/acquiredataability_fuzzer/BUILD.gn index 8b91f92eca584876a7f1f07b394995130b4ba3cb..fa18ac88608b6dafebadc46df5a0252806825b96 100644 --- a/test/fuzztest/acquiredataability_fuzzer/BUILD.gn +++ b/test/fuzztest/acquiredataability_fuzzer/BUILD.gn @@ -54,6 +54,7 @@ ohos_fuzztest("AcquireDataAbilityFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "ffrt:libffrt", + "hilog:libhilog", "napi:ace_napi", ] } diff --git a/test/fuzztest/addabilitystagedone_fuzzer/BUILD.gn b/test/fuzztest/addabilitystagedone_fuzzer/BUILD.gn index 5c50025d8a20b0c4092f7e1cdb011476c0b9ab74..32ebdf7cf1b5c10f578f5b6d78b79a49047b7d46 100755 --- a/test/fuzztest/addabilitystagedone_fuzzer/BUILD.gn +++ b/test/fuzztest/addabilitystagedone_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("AddAbilityStageDoneFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/amsmgrscheduler_fuzzer/BUILD.gn b/test/fuzztest/amsmgrscheduler_fuzzer/BUILD.gn index f05fca05ddd53742ad7279d03810837ce9e684e3..c8672cd4b7f36d65a150399dac88f01cdbc295e4 100755 --- a/test/fuzztest/amsmgrscheduler_fuzzer/BUILD.gn +++ b/test/fuzztest/amsmgrscheduler_fuzzer/BUILD.gn @@ -54,6 +54,7 @@ ohos_fuzztest("AmsMgrSchedulerFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_core", diff --git a/test/fuzztest/appforegroundstateobserverproxy_fuzzer/BUILD.gn b/test/fuzztest/appforegroundstateobserverproxy_fuzzer/BUILD.gn index b6578c00c9553d2d8370e368b9857c3185bb6c19..e875c2e537608bca949d3f9f3374d690059552e2 100644 --- a/test/fuzztest/appforegroundstateobserverproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/appforegroundstateobserverproxy_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("AppForegroundStateObserverProxyTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/applifecycledeal_fuzzer/BUILD.gn b/test/fuzztest/applifecycledeal_fuzzer/BUILD.gn index 834d1f65d96f1069b3a3d962007ba527ee06ab9f..a12366d3ca275b35867190b45ed9b2e67bce0f2e 100644 --- a/test/fuzztest/applifecycledeal_fuzzer/BUILD.gn +++ b/test/fuzztest/applifecycledeal_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("AppLifecycleDealFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/appmgrclientrest_fuzzer/BUILD.gn b/test/fuzztest/appmgrclientrest_fuzzer/BUILD.gn index fb8eb7434b21a822764651d741f11398d3798848..3801acd7528b13e9f6980a93bbc00eaa4835cb40 100755 --- a/test/fuzztest/appmgrclientrest_fuzzer/BUILD.gn +++ b/test/fuzztest/appmgrclientrest_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("AppMgrClientRestFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/appmgrrest_fuzzer/BUILD.gn b/test/fuzztest/appmgrrest_fuzzer/BUILD.gn index b239b0ab2e222be3b0ede1be98c82e306cb72568..2428849f07051b6478f027fe18bb1d5ab9f33335 100755 --- a/test/fuzztest/appmgrrest_fuzzer/BUILD.gn +++ b/test/fuzztest/appmgrrest_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("AppMgrRestFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/appmgrservicefirst_fuzzer/BUILD.gn b/test/fuzztest/appmgrservicefirst_fuzzer/BUILD.gn index 28adb930cbfb5f1bf2ab4c31826891228de1421d..78c9bf2b190b9feea96e30beb02fda6395f27d70 100755 --- a/test/fuzztest/appmgrservicefirst_fuzzer/BUILD.gn +++ b/test/fuzztest/appmgrservicefirst_fuzzer/BUILD.gn @@ -53,6 +53,7 @@ ohos_fuzztest("AppMgrServiceFirstFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/appmgrstub_fuzzer/BUILD.gn b/test/fuzztest/appmgrstub_fuzzer/BUILD.gn index 254e3e3985060eb19357794404d7ceaabb57f48a..988cfeb83cae1c37ebe130d1da568eb614025f36 100644 --- a/test/fuzztest/appmgrstub_fuzzer/BUILD.gn +++ b/test/fuzztest/appmgrstub_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("AppmgrStubFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_core", diff --git a/test/fuzztest/apprunningstatusproxy_fuzzer/BUILD.gn b/test/fuzztest/apprunningstatusproxy_fuzzer/BUILD.gn index 0ddd71d7e2450c1e2d87f2df50f41f2ed1813295..71a6d6c11a87194db464dae5da5889c020f1f68e 100644 --- a/test/fuzztest/apprunningstatusproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/apprunningstatusproxy_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("AppRunningStatusProxyFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", diff --git a/test/fuzztest/appstateobservermanager_fuzzer/BUILD.gn b/test/fuzztest/appstateobservermanager_fuzzer/BUILD.gn index 5cd1169ac7ed08dd69acf12eb5d51dc54883072b..002eaa09e1424c928f19fad1ca401aaa3e0bed8e 100755 --- a/test/fuzztest/appstateobservermanager_fuzzer/BUILD.gn +++ b/test/fuzztest/appstateobservermanager_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("AppStateObserverManagerFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/attachabilitythread_fuzzer/BUILD.gn b/test/fuzztest/attachabilitythread_fuzzer/BUILD.gn index 88d9be20d06445c040b2bd69a2c3c5e7a2114b02..015fcedfd34acbc5650d33d2afe06169e59752a4 100755 --- a/test/fuzztest/attachabilitythread_fuzzer/BUILD.gn +++ b/test/fuzztest/attachabilitythread_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("AttachAbilityThreadFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/attachrenderprocess_fuzzer/BUILD.gn b/test/fuzztest/attachrenderprocess_fuzzer/BUILD.gn index fb1dde263a2a056ef82d0089748fec52cd00da87..6ef35248dbb1de070394f4ba6af462fcae383ed0 100755 --- a/test/fuzztest/attachrenderprocess_fuzzer/BUILD.gn +++ b/test/fuzztest/attachrenderprocess_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("AttachRenderProcessFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/cleanallmissions_fuzzer/BUILD.gn b/test/fuzztest/cleanallmissions_fuzzer/BUILD.gn index 0f2a26569e1841ef0f3031c5524b8b1898a83948..281819d519ab7b66ed6c15884f8c3e622edb1692 100755 --- a/test/fuzztest/cleanallmissions_fuzzer/BUILD.gn +++ b/test/fuzztest/cleanallmissions_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("CleanAllMissionsFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/cleanmission_fuzzer/BUILD.gn b/test/fuzztest/cleanmission_fuzzer/BUILD.gn index 3fc4859c601762ffc570df1eecfd8b6c310ac712..d4d855ea27837ae8ea888e9ab0f640cc6eb8639d 100755 --- a/test/fuzztest/cleanmission_fuzzer/BUILD.gn +++ b/test/fuzztest/cleanmission_fuzzer/BUILD.gn @@ -45,6 +45,7 @@ ohos_fuzztest("CleanMissionFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/closeability_fuzzer/BUILD.gn b/test/fuzztest/closeability_fuzzer/BUILD.gn index 67bc14d610b6dacc72a7879d3a9d5dcf14989cf6..2f4dbc66678665e505cb9d015208909ddeacb3fa 100755 --- a/test/fuzztest/closeability_fuzzer/BUILD.gn +++ b/test/fuzztest/closeability_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("CloseAbilityFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn b/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn index b2e904cc7771b0579524b6cecb870eb6f3541f68..12a234f4e8b60f35fd695c4d1fddfc0746b5b5ef 100755 --- a/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn +++ b/test/fuzztest/completefirstframedrawing_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("CompleteFirstFrameDrawingFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/connectability_fuzzer/BUILD.gn b/test/fuzztest/connectability_fuzzer/BUILD.gn index a228c3559dcc4d2f00dcdd3e122bb74a1bb46348..7a5e0952854b7a686c06e9192431a4e79b08d8c0 100755 --- a/test/fuzztest/connectability_fuzzer/BUILD.gn +++ b/test/fuzztest/connectability_fuzzer/BUILD.gn @@ -58,6 +58,7 @@ ohos_fuzztest("ConnectAbilityFuzzTest") { "appspawn:appspawn_client", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "samgr:samgr_proxy", diff --git a/test/fuzztest/connectionobserverclient_fuzzer/BUILD.gn b/test/fuzztest/connectionobserverclient_fuzzer/BUILD.gn index b5419a5c7fbeb2780b9e6314b55092c4c31f2af8..8949ad7a412a3ad5acf6076cd2c23a3b0e496ffe 100755 --- a/test/fuzztest/connectionobserverclient_fuzzer/BUILD.gn +++ b/test/fuzztest/connectionobserverclient_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("ConnectionObserverClientFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/connectionobserverclientimpl_fuzzer/BUILD.gn b/test/fuzztest/connectionobserverclientimpl_fuzzer/BUILD.gn index e15dd2c7b5641fb5e7306284aca05694981326a2..86b1c6547af642afa5160669618ce793e265e833 100755 --- a/test/fuzztest/connectionobserverclientimpl_fuzzer/BUILD.gn +++ b/test/fuzztest/connectionobserverclientimpl_fuzzer/BUILD.gn @@ -56,6 +56,7 @@ ohos_fuzztest("ConnectionObserverClientImplFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/connectionstatemanager_fuzzer/BUILD.gn b/test/fuzztest/connectionstatemanager_fuzzer/BUILD.gn index 8bed75cfcc508cc9b98898adaaade6405feeedce..1a950e8b0b3b408d34e9f34e911356f214c2fe24 100755 --- a/test/fuzztest/connectionstatemanager_fuzzer/BUILD.gn +++ b/test/fuzztest/connectionstatemanager_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("ConnectionStateManagerFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/continueability_fuzzer/BUILD.gn b/test/fuzztest/continueability_fuzzer/BUILD.gn index e68ca2fc30365531f23a958aaed8db9901560638..39cdcff51e2f2a17fea86b7b2ee4df0b6d00887b 100755 --- a/test/fuzztest/continueability_fuzzer/BUILD.gn +++ b/test/fuzztest/continueability_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("ContinueAbilityFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/continuemission_fuzzer/BUILD.gn b/test/fuzztest/continuemission_fuzzer/BUILD.gn index 7088e9bd47f2e41896366bb82441d9d286ccef76..d249b9e33d242784deee63f959839604326142c8 100755 --- a/test/fuzztest/continuemission_fuzzer/BUILD.gn +++ b/test/fuzztest/continuemission_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("ContinueMissionFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/dataabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/dataabilitymanager_fuzzer/BUILD.gn index e31492b8699e4af40d9313785ed8c61b13ba88c7..64e062a08a13371956d40ab1cc55192f63579c9e 100755 --- a/test/fuzztest/dataabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/dataabilitymanager_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("DataAbilityManagerFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn b/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn index 5a0cfdcb4c7cbdedb35d6fd448f68278004f3b4c..9a5ef39aba377e6773b9b2569224506806444d3e 100755 --- a/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn +++ b/test/fuzztest/delegatordoabilityforeground_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("DelegatorDoAbilityForegroundFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn b/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn index bcab4448e694c196799c9ab962d797cea86a43f2..a3690cb2bd4c8bf1917eaf899dcd9c8920a610aa 100644 --- a/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn +++ b/test/fuzztest/doabilitybackground_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("DoAbilityBackgroundFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "relational_store:native_dataability", diff --git a/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn b/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn index 9bc48ecac0c4c9d12560207540c9d65f021968de..4ab22c9580321d4e953bcd0b16f06bf04f9acfd9 100644 --- a/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn +++ b/test/fuzztest/doabilityforeground_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("DoAbilityForegroundFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "relational_store:native_dataability", diff --git a/test/fuzztest/dumpabilityinfodone_fuzzer/BUILD.gn b/test/fuzztest/dumpabilityinfodone_fuzzer/BUILD.gn index 6025e78c762348e217540886133f98f6d76eb4db..57faa7f73b07ac2f1b75deb40f52bad656217cc2 100644 --- a/test/fuzztest/dumpabilityinfodone_fuzzer/BUILD.gn +++ b/test/fuzztest/dumpabilityinfodone_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("DumpAbilityInfoDoneFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/dumpstate_fuzzer/BUILD.gn b/test/fuzztest/dumpstate_fuzzer/BUILD.gn index cbfd32fc9d4f225ebcff78ff3f69d99be46ea5f3..d7537aaa678145433c231511aab698637abf9279 100644 --- a/test/fuzztest/dumpstate_fuzzer/BUILD.gn +++ b/test/fuzztest/dumpstate_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("DumpStateFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/dumpsysstate_fuzzer/BUILD.gn b/test/fuzztest/dumpsysstate_fuzzer/BUILD.gn index ef7506eb461c81a7e722e944315fa5db84facbb5..279fa2acb999634befa52158de52fb74de5e9a41 100644 --- a/test/fuzztest/dumpsysstate_fuzzer/BUILD.gn +++ b/test/fuzztest/dumpsysstate_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("DumpSysStateFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/forcetimeoutfortest_fuzzer/BUILD.gn b/test/fuzztest/forcetimeoutfortest_fuzzer/BUILD.gn index 200b83fe9e99d8e51c5169913d9200b0199796b2..5e060a48c4e61080c45ea3a53b496879c06a28f9 100644 --- a/test/fuzztest/forcetimeoutfortest_fuzzer/BUILD.gn +++ b/test/fuzztest/forcetimeoutfortest_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("ForceTimeoutForTestFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/freeinstallabilityfromremote_fuzzer/BUILD.gn b/test/fuzztest/freeinstallabilityfromremote_fuzzer/BUILD.gn index 8a29b222efba02ccd6e60de107214348c13e8fed..f8858beb695d0e95be8d665c451eb696faf2ecaf 100644 --- a/test/fuzztest/freeinstallabilityfromremote_fuzzer/BUILD.gn +++ b/test/fuzztest/freeinstallabilityfromremote_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("FreeInstallAbilityFromRemoteFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/getabilityrunninginfos_fuzzer/BUILD.gn b/test/fuzztest/getabilityrunninginfos_fuzzer/BUILD.gn index 5e1ffec54e93ea1ab62917f66ac668b63fa21752..ae68ff6bcc30d233dda3f9582a2e633fd6bade6b 100755 --- a/test/fuzztest/getabilityrunninginfos_fuzzer/BUILD.gn +++ b/test/fuzztest/getabilityrunninginfos_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("GetAbilityRunningInfosFuzzTest") { "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", + "hilog:libhilog", "napi:ace_napi", ] if (ability_runtime_upms) { diff --git a/test/fuzztest/getapplicationinfobyprocessid_fuzzer/BUILD.gn b/test/fuzztest/getapplicationinfobyprocessid_fuzzer/BUILD.gn index 164e96fca171f0cdea479c7617fb5b8b759ef582..ac40276bf06ff0d2950a2bb0c7ecddb446f07028 100755 --- a/test/fuzztest/getapplicationinfobyprocessid_fuzzer/BUILD.gn +++ b/test/fuzztest/getapplicationinfobyprocessid_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("GetApplicationInfoByProcessIDFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/getappmemorysize_fuzzer/BUILD.gn b/test/fuzztest/getappmemorysize_fuzzer/BUILD.gn index 9110a3e932b913f3a98f6df2dca8b7fa36dd4fa5..edd3fb1efd425047e62f50dc3d2454466864ba1e 100755 --- a/test/fuzztest/getappmemorysize_fuzzer/BUILD.gn +++ b/test/fuzztest/getappmemorysize_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("GetAppMemorySizeFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/getconfiguration_fuzzer/BUILD.gn b/test/fuzztest/getconfiguration_fuzzer/BUILD.gn index 9645a9a671caa63c90823c3834c1436607762598..deb1df8c27bb388681fc47478e7ea5cd08d5b70d 100755 --- a/test/fuzztest/getconfiguration_fuzzer/BUILD.gn +++ b/test/fuzztest/getconfiguration_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("GetConfigurationFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/getmissionidbytoken_fuzzer/BUILD.gn b/test/fuzztest/getmissionidbytoken_fuzzer/BUILD.gn index a42f4972c97a5c2919261b7a10c8c94a94465c8e..5becd9ef7bd903b3b1b428cb0eeb36ec3cdbf473 100755 --- a/test/fuzztest/getmissionidbytoken_fuzzer/BUILD.gn +++ b/test/fuzztest/getmissionidbytoken_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("GetMissionIdByTokenFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "relational_store:native_dataability", diff --git a/test/fuzztest/getmissioninfos_fuzzer/BUILD.gn b/test/fuzztest/getmissioninfos_fuzzer/BUILD.gn index 92ad123ed3b540f84d3eff2d1914762f0cc771f6..112b104115a17ee777e07940ec53bf6c77c8ee1f 100755 --- a/test/fuzztest/getmissioninfos_fuzzer/BUILD.gn +++ b/test/fuzztest/getmissioninfos_fuzzer/BUILD.gn @@ -49,6 +49,7 @@ ohos_fuzztest("GetMissionInfosFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/getprocessrunninginfos_fuzzer/BUILD.gn b/test/fuzztest/getprocessrunninginfos_fuzzer/BUILD.gn index b638868e623b539681302c33a519d2511ada1463..d8376bfe638c8177c744b8b52c271f45493a70fd 100755 --- a/test/fuzztest/getprocessrunninginfos_fuzzer/BUILD.gn +++ b/test/fuzztest/getprocessrunninginfos_fuzzer/BUILD.gn @@ -53,6 +53,7 @@ ohos_fuzztest("GetProcessRunningInfosFuzzTest") { "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", + "hilog:libhilog", "napi:ace_napi", ] if (ability_runtime_upms) { diff --git a/test/fuzztest/getprocessrunninginfosbyuserid_fuzzer/BUILD.gn b/test/fuzztest/getprocessrunninginfosbyuserid_fuzzer/BUILD.gn index b31603692c2879bb16d3e5951c4f198ce8b89d40..63a1599c4a92332f233b9a61175974d8835ed037 100755 --- a/test/fuzztest/getprocessrunninginfosbyuserid_fuzzer/BUILD.gn +++ b/test/fuzztest/getprocessrunninginfosbyuserid_fuzzer/BUILD.gn @@ -49,6 +49,7 @@ ohos_fuzztest("GetProcessRunningInfosByUserIdFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/getrunningprocessinfobytoken_fuzzer/BUILD.gn b/test/fuzztest/getrunningprocessinfobytoken_fuzzer/BUILD.gn index 1cf939e1d4ae3a5c63ba9fbb605d23bc83f012b3..8e4ef6dfff51c97c1dcf58f64796420d4bda2caa 100755 --- a/test/fuzztest/getrunningprocessinfobytoken_fuzzer/BUILD.gn +++ b/test/fuzztest/getrunningprocessinfobytoken_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("GetRunningProcessInfoByTokenFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/getwantsender_fuzzer/BUILD.gn b/test/fuzztest/getwantsender_fuzzer/BUILD.gn index d29950afc585e0c19a3e158afd70c611cba51a10..14fcac4e2369dfb9bf2a630ff134b8cc7df5014e 100755 --- a/test/fuzztest/getwantsender_fuzzer/BUILD.gn +++ b/test/fuzztest/getwantsender_fuzzer/BUILD.gn @@ -55,6 +55,7 @@ ohos_fuzztest("GetWantSenderFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "ffrt:libffrt", + "hilog:libhilog", "napi:ace_napi", ] } diff --git a/test/fuzztest/handledlpapp_fuzzer/BUILD.gn b/test/fuzztest/handledlpapp_fuzzer/BUILD.gn index cf0d88b72062c3bc29068bcee73f24a11187df68..fbcbfd0e12c4c045848d34cbaa47bd2ad4ad8ee9 100755 --- a/test/fuzztest/handledlpapp_fuzzer/BUILD.gn +++ b/test/fuzztest/handledlpapp_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("HandleDlpAppFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/isramconstraineddevice_fuzzer/BUILD.gn b/test/fuzztest/isramconstraineddevice_fuzzer/BUILD.gn index e5dcab2ac4e1c94b96b6d4eb687678105ac38e9c..5ea479b13416c352d867d64ab5da8e3f5f2753a7 100755 --- a/test/fuzztest/isramconstraineddevice_fuzzer/BUILD.gn +++ b/test/fuzztest/isramconstraineddevice_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("IsRamConstrainedDeviceFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/killapplication_fuzzer/BUILD.gn b/test/fuzztest/killapplication_fuzzer/BUILD.gn index 7f54e0f203e16985235f225032ebe73822924ed9..04bb873f9d49ad1c97ec9521ceff599649162562 100755 --- a/test/fuzztest/killapplication_fuzzer/BUILD.gn +++ b/test/fuzztest/killapplication_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("KillApplicationFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/killapplicationself_fuzzer/BUILD.gn b/test/fuzztest/killapplicationself_fuzzer/BUILD.gn index 7a763f5d452e40c16ba3e5749a4d3d06e45c8ed4..bf03d4fd6129a4709e7b7ffc3e0835af0097abb3 100755 --- a/test/fuzztest/killapplicationself_fuzzer/BUILD.gn +++ b/test/fuzztest/killapplicationself_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("KillApplicationSelfFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/killprocessbyabilitytoken_fuzzer/BUILD.gn b/test/fuzztest/killprocessbyabilitytoken_fuzzer/BUILD.gn index db209bd84ce8d59df11c52b37f804a67b39593f4..ada261c13b43336df30ebeeca441ee7a6befa39b 100755 --- a/test/fuzztest/killprocessbyabilitytoken_fuzzer/BUILD.gn +++ b/test/fuzztest/killprocessbyabilitytoken_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("KillProcessByAbilityTokenFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/killprocessesbyuserid_fuzzer/BUILD.gn b/test/fuzztest/killprocessesbyuserid_fuzzer/BUILD.gn index b667e038f115ac29d90aaa212eac817633534637..d422056b0601e2bdff996e8a95f0cecf578a64e6 100755 --- a/test/fuzztest/killprocessesbyuserid_fuzzer/BUILD.gn +++ b/test/fuzztest/killprocessesbyuserid_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("KillProcessesByUserIdFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/loadability_fuzzer/BUILD.gn b/test/fuzztest/loadability_fuzzer/BUILD.gn index 1ee52962e8647c2a77ffa4ae44c4e502d7248015..9e5e3b6a1f9f42921ccaca2c0e7bce7c2d4b9797 100755 --- a/test/fuzztest/loadability_fuzzer/BUILD.gn +++ b/test/fuzztest/loadability_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("LoadAbilityFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/lockmissionforcleanup_fuzzer/BUILD.gn b/test/fuzztest/lockmissionforcleanup_fuzzer/BUILD.gn index 1b738e58ec92cde1f19a6493b636c30f1765f37c..30666fb284fb774c202bc0b90b8e4176306eb9fc 100644 --- a/test/fuzztest/lockmissionforcleanup_fuzzer/BUILD.gn +++ b/test/fuzztest/lockmissionforcleanup_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("LockMissionForCleanupFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/minimizeability_fuzzer/BUILD.gn b/test/fuzztest/minimizeability_fuzzer/BUILD.gn index 72273eaadbdefb4a85b596ad773c09d665b6886d..5faea7072fc70b7b6f92469a1e3fc0919761d055 100644 --- a/test/fuzztest/minimizeability_fuzzer/BUILD.gn +++ b/test/fuzztest/minimizeability_fuzzer/BUILD.gn @@ -52,6 +52,7 @@ ohos_fuzztest("MinimizeAbilityFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", diff --git a/test/fuzztest/missiondatastorage_fuzzer/BUILD.gn b/test/fuzztest/missiondatastorage_fuzzer/BUILD.gn index 2062bdafe5b2532e158efa7523d6d59dec7b0ba1..a440391b1495d5e10c5cbaf50010ccd2d068af32 100644 --- a/test/fuzztest/missiondatastorage_fuzzer/BUILD.gn +++ b/test/fuzztest/missiondatastorage_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("MissionDataStorageFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "image_framework:image_native", "input:libmmi-client", "ipc:ipc_core", diff --git a/test/fuzztest/missioninfomgra_fuzzer/BUILD.gn b/test/fuzztest/missioninfomgra_fuzzer/BUILD.gn index 07ff69687724346f1d00bc61a93b15d973c4ec24..b7aea279a336c026dd4e4430e27339e7652a7e5e 100644 --- a/test/fuzztest/missioninfomgra_fuzzer/BUILD.gn +++ b/test/fuzztest/missioninfomgra_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("MissionInfoMgrAFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/missioninfomgrb_fuzzer/BUILD.gn b/test/fuzztest/missioninfomgrb_fuzzer/BUILD.gn index a1f09b7378b3bbb7ae90cb185cd98a840762c445..611bc66551514f3b1daecba6ae7f7edc2b562600 100644 --- a/test/fuzztest/missioninfomgrb_fuzzer/BUILD.gn +++ b/test/fuzztest/missioninfomgrb_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("MissionInfoMgrBFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/missioninfomgrc_fuzzer/BUILD.gn b/test/fuzztest/missioninfomgrc_fuzzer/BUILD.gn index 0c360ac4e2c9204f26ebd761d07192d4a286a4cb..6e02cc45ec2729b5807f8125d5481dfea7a88d61 100644 --- a/test/fuzztest/missioninfomgrc_fuzzer/BUILD.gn +++ b/test/fuzztest/missioninfomgrc_fuzzer/BUILD.gn @@ -57,6 +57,7 @@ ohos_fuzztest("MissionInfoMgrCFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/missionlistenercontroller_fuzzer/BUILD.gn b/test/fuzztest/missionlistenercontroller_fuzzer/BUILD.gn index 9d620602d9fc0dc8e94d8553c6f1930f5e76ad47..27a699db2cb5a5f3d67ce2e298d0a6b5e1530404 100644 --- a/test/fuzztest/missionlistenercontroller_fuzzer/BUILD.gn +++ b/test/fuzztest/missionlistenercontroller_fuzzer/BUILD.gn @@ -59,6 +59,7 @@ ohos_fuzztest("MissionListenerControllerFuzzTest") { "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "input:libmmi-client", "ipc:ipc_core", "jsoncpp:jsoncpp", diff --git a/test/fuzztest/missionlistenerstub_fuzzer/BUILD.gn b/test/fuzztest/missionlistenerstub_fuzzer/BUILD.gn index d295929dc90e1fc0b65d4c1fcdf913b1e5b547fa..446295eee7fa7d8b7113fad7e9fbb04c15835a76 100644 --- a/test/fuzztest/missionlistenerstub_fuzzer/BUILD.gn +++ b/test/fuzztest/missionlistenerstub_fuzzer/BUILD.gn @@ -48,6 +48,7 @@ ohos_fuzztest("MissionListenerStubFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/notifycompletecontinuation_fuzzer/BUILD.gn b/test/fuzztest/notifycompletecontinuation_fuzzer/BUILD.gn index c5b82ad2f1939d608276eef06b20f040586c0f78..dc9d299bb9824ac0dd2f63444d82ed996e6a49b2 100644 --- a/test/fuzztest/notifycompletecontinuation_fuzzer/BUILD.gn +++ b/test/fuzztest/notifycompletecontinuation_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("NotifyCompleteContinuationFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/notifycontinuationresult_fuzzer/BUILD.gn b/test/fuzztest/notifycontinuationresult_fuzzer/BUILD.gn index 4232165ee64f62995e5f70d68aa32f332082f96c..f97febdb64c81a4807514b761a7e5868d4146356 100644 --- a/test/fuzztest/notifycontinuationresult_fuzzer/BUILD.gn +++ b/test/fuzztest/notifycontinuationresult_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("NotifyContinuationResultFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/registermissionlistener_fuzzer/BUILD.gn b/test/fuzztest/registermissionlistener_fuzzer/BUILD.gn index 9eb888dc3ff3bd5e78ead04018d60e04366dca07..8bbbfe22fdc154e5ef1a9ce6e9fb5a1fb54b63a8 100755 --- a/test/fuzztest/registermissionlistener_fuzzer/BUILD.gn +++ b/test/fuzztest/registermissionlistener_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("RegisterMissionListenerFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/startabilitybycall_fuzzer/BUILD.gn b/test/fuzztest/startabilitybycall_fuzzer/BUILD.gn index 01bfa29404dbba1b83d905890df0ec30bdfac4d9..202aab8e90b13f06683576982fa5907946d13a7d 100755 --- a/test/fuzztest/startabilitybycall_fuzzer/BUILD.gn +++ b/test/fuzztest/startabilitybycall_fuzzer/BUILD.gn @@ -51,6 +51,7 @@ ohos_fuzztest("StartAbilityByCallFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "relational_store:native_dataability", "relational_store:native_rdb", diff --git a/test/fuzztest/startsyncremotemissions_fuzzer/BUILD.gn b/test/fuzztest/startsyncremotemissions_fuzzer/BUILD.gn index b6b7d5615339cde7df0f7c50ea1d8c5c2aa9d191..370d33ed319e780c3c47e5738d72a79ec982cbd3 100755 --- a/test/fuzztest/startsyncremotemissions_fuzzer/BUILD.gn +++ b/test/fuzztest/startsyncremotemissions_fuzzer/BUILD.gn @@ -47,6 +47,7 @@ ohos_fuzztest("StartSyncRemoteMissionsFuzzTest") { "bundle_framework:appexecfwk_base", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/startuser_fuzzer/BUILD.gn b/test/fuzztest/startuser_fuzzer/BUILD.gn index 2de3f8144dd1b142f6004c58a1d6d928e8ba5015..760c122a1449421db811ee49c873b611c64017b1 100644 --- a/test/fuzztest/startuser_fuzzer/BUILD.gn +++ b/test/fuzztest/startuser_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("StartUserFuzzTest") { "bundle_framework:appexecfwk_base", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/stopsyncremotemissions_fuzzer/BUILD.gn b/test/fuzztest/stopsyncremotemissions_fuzzer/BUILD.gn index 057378f9b30b16f33db6de92498d51a5595e1a9c..9a953061d1ce3a31395469c4fa220e3dc4567f70 100644 --- a/test/fuzztest/stopsyncremotemissions_fuzzer/BUILD.gn +++ b/test/fuzztest/stopsyncremotemissions_fuzzer/BUILD.gn @@ -47,6 +47,7 @@ ohos_fuzztest("StopSyncRemoteMissionsFuzzTest") { "bundle_framework:appexecfwk_base", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/stopuser_fuzzer/BUILD.gn b/test/fuzztest/stopuser_fuzzer/BUILD.gn index 60be3c169ea9331610b6a821e6c51ff5be49e396..29d419d673c68e1642d785e9034f9c186180ecda 100644 --- a/test/fuzztest/stopuser_fuzzer/BUILD.gn +++ b/test/fuzztest/stopuser_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("StopUserFuzzTest") { "bundle_framework:appexecfwk_base", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/unlockmissionforcleanup_fuzzer/BUILD.gn b/test/fuzztest/unlockmissionforcleanup_fuzzer/BUILD.gn index 0b1414dc9a7756e8ce67feda2e5eb2e51a5c3091..ae70633461fbc0d0040222b776656c7a042aa0b6 100644 --- a/test/fuzztest/unlockmissionforcleanup_fuzzer/BUILD.gn +++ b/test/fuzztest/unlockmissionforcleanup_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("UnlockMissionForCleanupFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/unregistermissionlistener_fuzzer/BUILD.gn b/test/fuzztest/unregistermissionlistener_fuzzer/BUILD.gn index 8c5a8b699cc573adc8f484048ead4ee5d2dc0a4a..ca21a4fbfd6ae9d6305aa84a8cb63840099b7c4c 100644 --- a/test/fuzztest/unregistermissionlistener_fuzzer/BUILD.gn +++ b/test/fuzztest/unregistermissionlistener_fuzzer/BUILD.gn @@ -46,6 +46,7 @@ ohos_fuzztest("UnRegisterMissionListenerFuzzTest") { "ability_runtime:app_manager", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "jsoncpp:jsoncpp", "relational_store:native_dataability", diff --git a/test/fuzztest/updateconfiguration_fuzzer/BUILD.gn b/test/fuzztest/updateconfiguration_fuzzer/BUILD.gn index cc7fae31e93a3d5adbe8eceece9413dedfab8e11..439ac5c6542d9878195c93f7da91a41c467acea1 100644 --- a/test/fuzztest/updateconfiguration_fuzzer/BUILD.gn +++ b/test/fuzztest/updateconfiguration_fuzzer/BUILD.gn @@ -53,6 +53,7 @@ ohos_fuzztest("UpdateConfigurationFuzzTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "eventhandler:libeventhandler", + "hilog:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/test/fuzztest/updateextensionstate_fuzzer/BUILD.gn b/test/fuzztest/updateextensionstate_fuzzer/BUILD.gn index dc3ae4b6e343f7b66ad817527d58044d4d089eea..041c70a3d64c433015035fd52347cea50cb62034 100644 --- a/test/fuzztest/updateextensionstate_fuzzer/BUILD.gn +++ b/test/fuzztest/updateextensionstate_fuzzer/BUILD.gn @@ -50,6 +50,7 @@ ohos_fuzztest("UpdateExtensionStateFuzzTest") { "c_utils:utils", "common_event_service:cesfwk_innerkits", "ffrt:libffrt", + "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "safwk:system_ability_fwk", diff --git a/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp b/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp index 11c5ff0e3f9f1ba60cb3c33d24cf90090cca5674..59a75929c1ef4d1fe53dd72ed363b2f627466395 100644 --- a/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp +++ b/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -45,11 +45,9 @@ public: UserCallbackStubFuzzTest() = default; virtual ~UserCallbackStubFuzzTest() {} - void OnStopUserDone(int userId, int errcode) override - {} - void OnStartUserDone(int userId, int errcode) override {} - - void OnLogoutUserDone(int userId, int errcode) override {} + ErrCode OnStopUserDone(int userId, int errcode) override { return ERR_OK; } + ErrCode OnStartUserDone(int userId, int errcode) override { return ERR_OK; } + ErrCode OnLogoutUserDone(int userId, int errcode) override { return ERR_OK; } }; const std::u16string APPMGR_INTERFACE_TOKEN = u"ohos.aafwk.AppManager"; uint32_t GetU32Data(const char* ptr) @@ -70,8 +68,6 @@ bool DoSomethingInterestingWithMyAPI(const char *data, size_t size) MessageParcel reply; MessageOption option; backStub->OnRemoteRequest(code, dataParcel, reply, option); - backStub->OnStopUserDoneInner(dataParcel, reply); - backStub->OnStartUserDoneInner(dataParcel, reply); return true; } diff --git a/test/fuzztest/wantagenthelperstring_fuzzer/BUILD.gn b/test/fuzztest/wantagenthelperstring_fuzzer/BUILD.gn index 22f0a5578c6c4c909461edabeb31f87f195e89c6..849275f208c036bff2edcb58c2d94e6ea0f11e1e 100644 --- a/test/fuzztest/wantagenthelperstring_fuzzer/BUILD.gn +++ b/test/fuzztest/wantagenthelperstring_fuzzer/BUILD.gn @@ -42,6 +42,7 @@ ohos_fuzztest("WantAgentHelperStringFuzzTest") { "ability_runtime:wantagent_innerkits", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", ] } diff --git a/test/fuzztest/wantagenthelpertrigger_fuzzer/BUILD.gn b/test/fuzztest/wantagenthelpertrigger_fuzzer/BUILD.gn index a3aa4b5fcbabf69674efce74e9040c1f8f23cc4b..496d37f94121d9133cfc9f20e158b88fce1a636a 100644 --- a/test/fuzztest/wantagenthelpertrigger_fuzzer/BUILD.gn +++ b/test/fuzztest/wantagenthelpertrigger_fuzzer/BUILD.gn @@ -42,6 +42,7 @@ ohos_fuzztest("WantAgentHelperTriggerFuzzTest") { "ability_runtime:wantagent_innerkits", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "hilog:libhilog", "ipc:ipc_core", ] } diff --git a/test/moduletest/app_mgr_client_test/BUILD.gn b/test/moduletest/app_mgr_client_test/BUILD.gn index 9a3c1e9e3ed30f6138aa90577216a64a8df50dff..409c2699258dacca81207a4e7d495782c9c73b22 100644 --- a/test/moduletest/app_mgr_client_test/BUILD.gn +++ b/test/moduletest/app_mgr_client_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/mstabilitymgrservice" ohos_moduletest("app_mgr_client_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/common/include", "${ability_runtime_test_path}/mock/mock_sa_call", diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 07923eb62203a54fd29bed44465239ad2cb653a3..88c49ffabd1c02478f8f28cef43f7d8a446f3d25 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -14,8 +14,7 @@ import("//build/ohos.gni") import("//build/test.gni") import("//foundation/ability/ability_runtime/ability_runtime.gni") -import( - "//foundation/ability/ability_runtime/services/abilitymgr/abilitymgr.gni") +import("//foundation/ability/ability_runtime/services/abilitymgr/abilitymgr.gni") config("appmgr_test_config") { configs = [ @@ -43,8 +42,6 @@ ohos_source_set("appmgr_test_source") { "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_record_id.cpp", "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_scheduler_host.cpp", "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_scheduler_proxy.cpp", - "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_state_callback_host.cpp", - "${ability_runtime_innerkits_path}/app_manager/src/appmgr/app_state_callback_proxy.cpp", "${ability_runtime_innerkits_path}/app_manager/src/appmgr/fault_data.cpp", "${ability_runtime_innerkits_path}/app_manager/src/appmgr/native_child_notify_proxy.cpp", "${ability_runtime_innerkits_path}/app_manager/src/appmgr/native_child_notify_stub.cpp", diff --git a/test/unittest/ability_debug_response_stub_test/ability_debug_response_stub_test.cpp b/test/unittest/ability_debug_response_stub_test/ability_debug_response_stub_test.cpp index 3167b3fa20fe2766f05ca22d936b6eda0e5ff3bf..ad8f8f90b749d10e4ea16bc49169a9e44b446409 100644 --- a/test/unittest/ability_debug_response_stub_test/ability_debug_response_stub_test.cpp +++ b/test/unittest/ability_debug_response_stub_test/ability_debug_response_stub_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -74,7 +74,7 @@ HWTEST_F(AbilityDebugResponseStubTest, HandleOnAbilitysDebugStarted_0100, TestSi data.WriteRemoteObject(token); auto result = stub->OnRemoteRequest( - static_cast(IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STARTED), data, reply, option); + static_cast(IAbilityDebugResponseIpcCode::COMMAND_ON_ABILITYS_DEBUG_STARTED), data, reply, option); EXPECT_EQ(result, NO_ERROR); testing::Mock::AllowLeak(stub); GTEST_LOG_(INFO) << "AbilityDebugResponseProxyTest_HandleOnAbilitysDebugStarted_0100 end"; @@ -103,7 +103,7 @@ HWTEST_F(AbilityDebugResponseStubTest, HandleOnAbilitysDebugStoped_0100, TestSiz data.WriteRemoteObject(token); auto result = stub->OnRemoteRequest( - static_cast(IAbilityDebugResponse::Message::ON_ABILITYS_DEBUG_STOPED), data, reply, option); + static_cast(IAbilityDebugResponseIpcCode::COMMAND_ON_ABILITYS_DEBUG_STOPED), data, reply, option); EXPECT_EQ(result, NO_ERROR); testing::Mock::AllowLeak(stub); GTEST_LOG_(INFO) << "AbilityDebugResponseProxyTest_HandleOnAbilitysDebugStoped_0100 end"; diff --git a/test/unittest/ability_debug_response_stub_test/mock_ability_debug_response_stub.h b/test/unittest/ability_debug_response_stub_test/mock_ability_debug_response_stub.h index e4a257354df5e7ed0ecc1049011ab0f543bde68d..79f4777899911cd03d6a64d2e641bf41d59bcece 100644 --- a/test/unittest/ability_debug_response_stub_test/mock_ability_debug_response_stub.h +++ b/test/unittest/ability_debug_response_stub_test/mock_ability_debug_response_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * 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 @@ -27,9 +27,9 @@ class MockAbilityDebugResponseStub : public AbilityDebugResponseStub { public: MockAbilityDebugResponseStub() {} virtual ~ MockAbilityDebugResponseStub() {} - MOCK_METHOD1(OnAbilitysDebugStarted, void(const std::vector> &tokens)); - MOCK_METHOD1(OnAbilitysDebugStoped, void(const std::vector> &tokens)); - MOCK_METHOD2(OnAbilitysAssertDebugChange, void(const std::vector> &, bool)); + MOCK_METHOD1(OnAbilitysDebugStarted, ErrCode(const std::vector> &tokens)); + MOCK_METHOD1(OnAbilitysDebugStoped, ErrCode(const std::vector> &tokens)); + MOCK_METHOD2(OnAbilitysAssertDebugChange, ErrCode(const std::vector> &, bool)); }; } // namespace AppExecFwk } // namespace OHOS diff --git a/test/unittest/ability_manager_client_branch_second_test/BUILD.gn b/test/unittest/ability_manager_client_branch_second_test/BUILD.gn index ccd62f0691ec73b9d716c77f4a8720aa606e5068..100862c1c25611aac09a320994176597783f26ef 100644 --- a/test/unittest/ability_manager_client_branch_second_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_second_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -16,7 +16,12 @@ import("//foundation/ability/ability_runtime/ability_runtime.gni") ohos_unittest("ability_manager_client_branch_second_test") { module_out_path = "ability_runtime/ability_runtime/ability_call_test" - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/ability_manager_collaborator", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", diff --git a/test/unittest/ability_manager_client_branch_test/BUILD.gn b/test/unittest/ability_manager_client_branch_test/BUILD.gn index 44a1bc89fc60cad5d7c71fc5c16ed03da054f984..74881e2c3b91c4abeff29b0e948c02fdc413e2a0 100644 --- a/test/unittest/ability_manager_client_branch_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -16,7 +16,12 @@ import("//foundation/ability/ability_runtime/ability_runtime.gni") ohos_unittest("ability_manager_client_branch_test") { module_out_path = "ability_runtime/ability_runtime/ability_call_test" - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/ability_manager_collaborator", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", diff --git a/test/unittest/ability_manager_client_branch_third_test/BUILD.gn b/test/unittest/ability_manager_client_branch_third_test/BUILD.gn index 4d464465ef5874bdd52dee0de2279be4f08a208d..6fcb973b301cda7c1cebbe23e2c1735e4c96fcd7 100644 --- a/test/unittest/ability_manager_client_branch_third_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_third_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -16,7 +16,12 @@ import("//foundation/ability/ability_runtime/ability_runtime.gni") ohos_unittest("ability_manager_client_branch_third_test") { module_out_path = "ability_runtime/ability_runtime/ability_call_test" - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "mock/include", "${ability_runtime_test_path}/mock/common/include", diff --git a/test/unittest/ability_manager_proxy_fourth_test/BUILD.gn b/test/unittest/ability_manager_proxy_fourth_test/BUILD.gn index 087ff4d219c4f120bd9c9236da379cbd42df7e0b..5990cc7fd56cc8025464f7d80c7b0a55adff9cdf 100644 --- a/test/unittest/ability_manager_proxy_fourth_test/BUILD.gn +++ b/test/unittest/ability_manager_proxy_fourth_test/BUILD.gn @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ability_manager_proxy_fourth_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_test_path}/unittest/ability_manager_proxy_fourth_test/", diff --git a/test/unittest/ability_manager_proxy_second_test/BUILD.gn b/test/unittest/ability_manager_proxy_second_test/BUILD.gn index 75dbc33eb9bc1bae842af8aa20ce170cd950cebe..f464df7f2c31283cf7d481a44546d61129b609aa 100644 --- a/test/unittest/ability_manager_proxy_second_test/BUILD.gn +++ b/test/unittest/ability_manager_proxy_second_test/BUILD.gn @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ability_manager_proxy_second_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_test_path}/unittest/ability_manager_proxy_second_test/", diff --git a/test/unittest/ability_manager_proxy_test/BUILD.gn b/test/unittest/ability_manager_proxy_test/BUILD.gn index a6bd65ae25820a7040d76c91e8a4269c5cbce206..bfed377053d9a7888a415de4d0c8463b12434a2c 100644 --- a/test/unittest/ability_manager_proxy_test/BUILD.gn +++ b/test/unittest/ability_manager_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ability_manager_proxy_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_test_path}/unittest/ability_manager_proxy_test/", diff --git a/test/unittest/ability_manager_proxy_third_test/BUILD.gn b/test/unittest/ability_manager_proxy_third_test/BUILD.gn index 0d9b9756c8a623a17c37adea9681274d066ca367..aa05a6e862b1426d2f0c58ec5f0a46f7205ccdf6 100644 --- a/test/unittest/ability_manager_proxy_third_test/BUILD.gn +++ b/test/unittest/ability_manager_proxy_third_test/BUILD.gn @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ability_manager_proxy_third_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_test_path}/unittest/ability_manager_proxy_third_test/", diff --git a/test/unittest/ability_manager_proxy_third_test/ability_manager_proxy_third_test.cpp b/test/unittest/ability_manager_proxy_third_test/ability_manager_proxy_third_test.cpp index 1a48b715b980fb73a1db49f66451261b340bb302..79ef873b77d7385f6e0ac38e54d98e6b9a1c5c13 100644 --- a/test/unittest/ability_manager_proxy_third_test/ability_manager_proxy_third_test.cpp +++ b/test/unittest/ability_manager_proxy_third_test/ability_manager_proxy_third_test.cpp @@ -75,10 +75,10 @@ public: MockIUserCallback() = default; virtual ~MockIUserCallback() = default; - void OnStopUserDone(int userId, int errcode) override {} - void OnStartUserDone(int userId, int errcode) override {} + ErrCode OnStopUserDone(int userId, int errcode) override { return ERR_OK; } + ErrCode OnStartUserDone(int userId, int errcode) override { return ERR_OK; } - void OnLogoutUserDone(int userId, int errcode) override {} + ErrCode OnLogoutUserDone(int userId, int errcode) override { return ERR_OK; } sptr AsObject() override { diff --git a/test/unittest/ability_manager_service_eighth_test/ability_manager_service_eighth_test.cpp b/test/unittest/ability_manager_service_eighth_test/ability_manager_service_eighth_test.cpp index 3984f0a987a4fd3de186279ae941bc021e2db083..dc7301c4e64e9b82d53e9ccaa49feb89547085fd 100644 --- a/test/unittest/ability_manager_service_eighth_test/ability_manager_service_eighth_test.cpp +++ b/test/unittest/ability_manager_service_eighth_test/ability_manager_service_eighth_test.cpp @@ -59,13 +59,10 @@ public: MockIUserCallback() = default; virtual ~MockIUserCallback() = default; - void OnStopUserDone(int userId, int errcode) override - {} - void OnStartUserDone(int userId, int errcode) override - {} + ErrCode OnStopUserDone(int userId, int errcode) override { return ERR_OK; } + ErrCode OnStartUserDone(int userId, int errcode) override { return ERR_OK; } - void OnLogoutUserDone(int userId, int errcode) override - {} + ErrCode OnLogoutUserDone(int userId, int errcode) override { return ERR_OK; } sptr AsObject() override { diff --git a/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn b/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn index 5728c0916d6161c32ec2cfef76beeb7fef631f5e..5f76a978e6254d61f242ecf45fd1ece10159eea5 100644 --- a/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_fourteenth_test/BUILD.gn @@ -176,7 +176,6 @@ ohos_unittest("ability_manager_service_fourteenth_test") { "${ability_runtime_services_path}/abilitymgr/src/ui_extension/preload_uiext_state_observer.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record_factory.cpp", - "${ability_runtime_services_path}/abilitymgr/src/user_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_controller.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_event_handler.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/ability_event_util.cpp", diff --git a/test/unittest/ability_manager_service_second_test/BUILD.gn b/test/unittest/ability_manager_service_second_test/BUILD.gn index 66bf430e809f922e4ab733ed8e6ac92944330dc4..7f465d889adbcddb1b1bcea97f4de986888088db 100644 --- a/test/unittest/ability_manager_service_second_test/BUILD.gn +++ b/test/unittest/ability_manager_service_second_test/BUILD.gn @@ -181,7 +181,6 @@ ohos_unittest("ability_manager_service_second_test") { "${ability_runtime_services_path}/abilitymgr/src/ui_extension/preload_uiext_state_observer.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record_factory.cpp", - "${ability_runtime_services_path}/abilitymgr/src/user_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_controller.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_event_handler.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/ability_event_util.cpp", diff --git a/test/unittest/ability_manager_service_third_test/abilitymgr.gni b/test/unittest/ability_manager_service_third_test/abilitymgr.gni index 571d2a9352732abf5118f50bf0b2fc8d0cac0483..af9117bf388ed6e30e8677cb107103d8ef80de1b 100644 --- a/test/unittest/ability_manager_service_third_test/abilitymgr.gni +++ b/test/unittest/ability_manager_service_third_test/abilitymgr.gni @@ -79,7 +79,6 @@ abilityms_files = [ "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record_factory.cpp", "${ability_runtime_services_path}/abilitymgr/src/screen_lock/unlock_screen_manager.cpp", "${ability_runtime_services_path}/abilitymgr/src/start_options.cpp", - "${ability_runtime_services_path}/abilitymgr/src/user_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/call_container.cpp", "${ability_runtime_services_path}/abilitymgr/src/call_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/inner_mission_info.cpp", diff --git a/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn b/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn index 0637a9d6e95f58fbb92e4f8954eaf4e7a83c69b8..9274be657f0e370c60d9643fe99136e7af7a2f01 100644 --- a/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn +++ b/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn @@ -177,7 +177,6 @@ ohos_unittest("ability_manager_service_thirteenth_test") { "${ability_runtime_services_path}/abilitymgr/src/ui_extension/preload_uiext_state_observer.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record.cpp", "${ability_runtime_services_path}/abilitymgr/src/ui_extension_record/ui_extension_record_factory.cpp", - "${ability_runtime_services_path}/abilitymgr/src/user_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_controller.cpp", "${ability_runtime_services_path}/abilitymgr/src/user_event_handler.cpp", "${ability_runtime_services_path}/abilitymgr/src/utils/ability_event_util.cpp", diff --git a/test/unittest/ability_manager_service_twelfth_test/mock/include/mock_test_object.h b/test/unittest/ability_manager_service_twelfth_test/mock/include/mock_test_object.h index 215b46aa8e2b86ee3c13fcaf6b99958958f925b7..bb13da5d1da3f2f0cc90d9b96c76d1c885b341ed 100644 --- a/test/unittest/ability_manager_service_twelfth_test/mock/include/mock_test_object.h +++ b/test/unittest/ability_manager_service_twelfth_test/mock/include/mock_test_object.h @@ -16,16 +16,17 @@ #ifndef ABILITY_MANAGER_SERVICE_TWELFTH_TEST_MOCK_TEST_OBJECT_H #define ABILITY_MANAGER_SERVICE_TWELFTH_TEST_MOCK_TEST_OBJECT_H -#include "user_callback.h" +#include "iuser_callback.h" #include "ability_connect_callback_interface.h" +namespace OHOS { class MockIUserCallback : public OHOS::AAFwk::IUserCallback { public: MockIUserCallback() = default; virtual ~MockIUserCallback() = default; - virtual void OnStopUserDone(int userId, int errcode) override {} - virtual void OnStartUserDone(int userId, int errcode) override {} - virtual void OnLogoutUserDone(int userId, int errcode) override {} + virtual ErrCode OnStopUserDone(int userId, int errcode) override { return ERR_OK; } + virtual ErrCode OnStartUserDone(int userId, int errcode) override { return ERR_OK; } + virtual ErrCode OnLogoutUserDone(int userId, int errcode) override { return ERR_OK; } virtual OHOS::sptr AsObject() { return nullptr; @@ -44,4 +45,5 @@ public: return nullptr; } }; +} #endif // ABILITY_MANAGER_SERVICE_TWELFTH_TEST_MOCK_TEST_OBJECT_H diff --git a/test/unittest/ability_scheduler_stub_second_test/BUILD.gn b/test/unittest/ability_scheduler_stub_second_test/BUILD.gn index e37c4200bd6937fda59898d4987d420f4e8beffc..fd9a1095e61ca8cc9ea3314fdbbde29fb7b99e1b 100644 --- a/test/unittest/ability_scheduler_stub_second_test/BUILD.gn +++ b/test/unittest/ability_scheduler_stub_second_test/BUILD.gn @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ability_scheduler_stub_second_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock" ] sources = [ diff --git a/test/unittest/ability_scheduler_stub_test/BUILD.gn b/test/unittest/ability_scheduler_stub_test/BUILD.gn index 3d1f5b6668bdf85447f1a61e10cda921d23fabd6..95d0cf127622080b59a79ca8488868955d75a1b5 100644 --- a/test/unittest/ability_scheduler_stub_test/BUILD.gn +++ b/test/unittest/ability_scheduler_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ability_scheduler_stub_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock" ] sources = [ diff --git a/test/unittest/ams_ability_running_record_test/BUILD.gn b/test/unittest/ams_ability_running_record_test/BUILD.gn index 5403becfe77332bd63a4d6105eacac1b3b3ec763..ca8ea03f12c06d037a64c5527fa6c0467bb8dc16 100644 --- a/test/unittest/ams_ability_running_record_test/BUILD.gn +++ b/test/unittest/ams_ability_running_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,6 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/appmgrservice" ohos_unittest("AmsAbilityRunningRecordTest") { module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } cflags_cc = [] include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", diff --git a/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn b/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn index 82fe5a49b19c89b0f279092f606323647e645404..91055070844c31efe8da1c72971223ecf577b256 100644 --- a/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn +++ b/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("ams_mgr_scheduler_dump_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } sources = [ "ams_mgr_scheduler_dump_test.cpp" ] configs = [ "${ability_runtime_services_path}/appmgr:appmgr_config" ] diff --git a/test/unittest/ams_service_load_ability_process_test/BUILD.gn b/test/unittest/ams_service_load_ability_process_test/BUILD.gn index 6e21ffaa9de439eb1642d9d677d4a8ca5a62aca1..3c3939cae59c3a3e943047b81f22eef5850d5fab 100644 --- a/test/unittest/ams_service_load_ability_process_test/BUILD.gn +++ b/test/unittest/ams_service_load_ability_process_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -19,6 +19,12 @@ module_output_path = "ability_runtime/ability_runtime/appmgrservice" ohos_unittest("AmsServiceLoadAbilityProcessTest") { use_exceptions = true module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } cflags_cc = [] include_dirs = [ "${ability_runtime_services_path}/appmgr/test/unittest/mocks", diff --git a/test/unittest/app_debug_listener_proxy_test/BUILD.gn b/test/unittest/app_debug_listener_proxy_test/BUILD.gn index 185afb3de5f50aa24312374712db22c6fb769878..1b24dfb7799385c687ae02944023b3f1abecd15a 100644 --- a/test/unittest/app_debug_listener_proxy_test/BUILD.gn +++ b/test/unittest/app_debug_listener_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/appmgrservice" ohos_unittest("AppDebugListenerProxyTest") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_services_path}/appmgr/include", "${ability_runtime_test_path}/mock/services_appmgr_test/include", diff --git a/test/unittest/app_debug_listener_proxy_test/app_debug_listener_proxy_test.cpp b/test/unittest/app_debug_listener_proxy_test/app_debug_listener_proxy_test.cpp index 18060b908299613d0ae2c6502830158dbcef8d8c..7bcc341e9b7c0ddcb77ad19322cf4a4d2d9553d0 100644 --- a/test/unittest/app_debug_listener_proxy_test/app_debug_listener_proxy_test.cpp +++ b/test/unittest/app_debug_listener_proxy_test/app_debug_listener_proxy_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -54,17 +54,6 @@ void AppDebugListenerProxyTest::SetUp() void AppDebugListenerProxyTest::TearDown() {} -/** - * @tc.name: WriteInterfaceToken_0100 - * @tc.desc: write token into parcel data - * @tc.type: FUNC - */ -HWTEST_F(AppDebugListenerProxyTest, WriteInterfaceToken_0100, TestSize.Level1) -{ - MessageParcel data; - EXPECT_TRUE(proxy_->WriteInterfaceToken(data)); -} - /** * @tc.name: OnAppDebugStarted_0100 * @tc.desc: Callback of app debug started, verify that AppDebugListener interface calls normally. @@ -83,7 +72,7 @@ HWTEST_F(AppDebugListenerProxyTest, OnAppDebugStarted_0100, TestSize.Level1) .Times(1) .WillOnce(Invoke(mock_.GetRefPtr(), &AppDebugListenerStubMock::InvokeSendRequest)); proxy_->OnAppDebugStarted(appDebugInfos); - auto code = static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STARTED); + auto code = static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED); EXPECT_EQ(code, static_cast(mock_->code_)); } @@ -105,7 +94,7 @@ HWTEST_F(AppDebugListenerProxyTest, OnAppDebugStoped_0100, TestSize.Level1) .Times(1) .WillOnce(Invoke(mock_.GetRefPtr(), &AppDebugListenerStubMock::InvokeSendRequest)); proxy_->OnAppDebugStoped(appDebugInfos); - auto code = static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STOPED); + auto code = static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STOPED); EXPECT_EQ(code, static_cast(mock_->code_)); } } // namespace AppExecFwk diff --git a/test/unittest/app_debug_listener_proxy_test/app_debug_listener_stub_mock.h b/test/unittest/app_debug_listener_proxy_test/app_debug_listener_stub_mock.h index b3c81fc0dcb9c3855ed1500b02af403af1589a08..f96411fe7ae4a7efacba017283ebec17b4e97cfe 100644 --- a/test/unittest/app_debug_listener_proxy_test/app_debug_listener_stub_mock.h +++ b/test/unittest/app_debug_listener_proxy_test/app_debug_listener_stub_mock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -19,7 +19,7 @@ #include #include #define private public -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #undef private namespace OHOS { @@ -45,8 +45,8 @@ public: uint32_t code_ = 0; MOCK_METHOD4(SendRequest, int(uint32_t, MessageParcel &, MessageParcel &, MessageOption &)); - MOCK_METHOD1(OnAppDebugStarted, void(const std::vector &)); - MOCK_METHOD1(OnAppDebugStoped, void(const std::vector &)); + MOCK_METHOD1(OnAppDebugStarted, ErrCode(const std::vector &)); + MOCK_METHOD1(OnAppDebugStoped, ErrCode(const std::vector &)); }; } // namespace AppExecFwk } // namespace OHOS diff --git a/test/unittest/app_debug_listener_stub_test/app_debug_listener_stub_test.cpp b/test/unittest/app_debug_listener_stub_test/app_debug_listener_stub_test.cpp index 87754032c0240af3de2b7d04b46398e1bed62db0..0101270c41055514797a39d7120007c1c121bde9 100644 --- a/test/unittest/app_debug_listener_stub_test/app_debug_listener_stub_test.cpp +++ b/test/unittest/app_debug_listener_stub_test/app_debug_listener_stub_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -22,9 +22,9 @@ using namespace testing::ext; namespace OHOS { namespace AppExecFwk { namespace { - constexpr int32_t DEBUG_INFO_SIZE_ONE = 1; - constexpr int32_t DEBUG_INFO_SIZE_ZERO = 0; - constexpr uint32_t UNKNOWN_CODE = 2; +constexpr int32_t DEBUG_INFO_SIZE_ONE = 1; +constexpr int32_t DEBUG_INFO_SIZE_ZERO = 0; +constexpr uint32_t UNKNOWN_CODE = -1; } class AppDebugListenerStubTest : public testing::Test { public: @@ -73,7 +73,7 @@ HWTEST_F(AppDebugListenerStubTest, OnRemoteRequest_0100, TestSize.Level1) data.WriteParcelable(&debugInfo); auto result = mockStub_->OnRemoteRequest( - static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STARTED), data, reply, option); + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); EXPECT_EQ(result, NO_ERROR); } @@ -91,8 +91,8 @@ HWTEST_F(AppDebugListenerStubTest, OnRemoteRequest_0200, TestSize.Level1) data.WriteInt32(DEBUG_INFO_SIZE_ZERO); auto result = mockStub_->OnRemoteRequest( - static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STARTED), data, reply, option); - EXPECT_EQ(result, ERR_INVALID_STATE); + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); + EXPECT_EQ(result, ERR_TRANSACTION_FAILED); // ERR_TRANSACTION_FAILED for no interfaceToken data } /** @@ -128,8 +128,8 @@ HWTEST_F(AppDebugListenerStubTest, OnRemoteRequest_0400, TestSize.Level1) data.WriteInt32(DEBUG_INFO_SIZE_ZERO); auto result = mockStub_->OnRemoteRequest( - static_cast(IAppDebugListener::Message::ON_APP_DEBUG_STARTED), data, reply, option); - EXPECT_EQ(result, ERR_INVALID_DATA); + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); + EXPECT_EQ(result, ERR_NONE); } /** @@ -142,12 +142,14 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStarted_0100, TestSize.Level1 EXPECT_NE(mockStub_, nullptr); MessageParcel data; MessageParcel reply; + MessageOption option(MessageOption::TF_ASYNC); AppDebugInfo debugInfo; data.WriteInt32(DEBUG_INFO_SIZE_ONE); data.WriteParcelable(&debugInfo); - EXPECT_CALL(*mockStub_, OnAppDebugStarted(_)).Times(1); - EXPECT_EQ(mockStub_->HandleOnAppDebugStarted(data, reply), NO_ERROR); + EXPECT_CALL(*mockStub_, OnAppDebugStarted(_)).Times(0); + mockStub_->OnRemoteRequest( + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); } /** @@ -160,13 +162,15 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStarted_0200, TestSize.Level1 EXPECT_NE(mockStub_, nullptr); MessageParcel data; MessageParcel reply; + MessageOption option(MessageOption::TF_ASYNC); AppDebugInfo *debugInfo = nullptr; WriteInterfaceToken(data); data.WriteInt32(DEBUG_INFO_SIZE_ONE); data.WriteParcelable(debugInfo); EXPECT_CALL(*mockStub_, OnAppDebugStarted(_)).Times(0); - EXPECT_EQ(mockStub_->HandleOnAppDebugStarted(data, reply), ERR_INVALID_DATA); + mockStub_->OnRemoteRequest( + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); } /** @@ -179,12 +183,16 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStoped_0100, TestSize.Level1) EXPECT_NE(mockStub_, nullptr); MessageParcel data; MessageParcel reply; + MessageOption option(MessageOption::TF_ASYNC); + WriteInterfaceToken(data); AppDebugInfo debugInfo; data.WriteInt32(DEBUG_INFO_SIZE_ONE); data.WriteParcelable(&debugInfo); EXPECT_CALL(*mockStub_, OnAppDebugStoped(_)).Times(1); - EXPECT_EQ(mockStub_->HandleOnAppDebugStoped(data, reply), NO_ERROR); + auto ret = mockStub_->OnRemoteRequest( + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STOPED), data, reply, option); + EXPECT_EQ(ret, NO_ERROR); } /** @@ -197,13 +205,16 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStoped_0200, TestSize.Level1) EXPECT_NE(mockStub_, nullptr); MessageParcel data; MessageParcel reply; + MessageOption option(MessageOption::TF_ASYNC); AppDebugInfo *debugInfo = nullptr; WriteInterfaceToken(data); data.WriteInt32(DEBUG_INFO_SIZE_ONE); data.WriteParcelable(debugInfo); EXPECT_CALL(*mockStub_, OnAppDebugStoped(_)).Times(0); - EXPECT_EQ(mockStub_->HandleOnAppDebugStoped(data, reply), ERR_INVALID_DATA); + auto ret = mockStub_->OnRemoteRequest( + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STOPED), data, reply, option); + EXPECT_EQ(ret, ERR_INVALID_DATA); } } // namespace AppExecFwk } // namespace OHOS diff --git a/test/unittest/app_debug_listener_stub_test/mock_app_debug_listener_stub.h b/test/unittest/app_debug_listener_stub_test/mock_app_debug_listener_stub.h index 09418d059210b827316deaf5645456aad2a17457..010015b826c851f3faa901619367c2c726dfe137 100644 --- a/test/unittest/app_debug_listener_stub_test/mock_app_debug_listener_stub.h +++ b/test/unittest/app_debug_listener_stub_test/mock_app_debug_listener_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -26,8 +26,8 @@ class MockAppDebugListenerStub : public AppDebugListenerStub { public: MockAppDebugListenerStub() {} virtual ~ MockAppDebugListenerStub() {} - MOCK_METHOD1(OnAppDebugStarted, void(const std::vector &debugInfos)); - MOCK_METHOD1(OnAppDebugStoped, void(const std::vector &debugInfos)); + MOCK_METHOD1(OnAppDebugStarted, ErrCode(const std::vector &debugInfos)); + MOCK_METHOD1(OnAppDebugStoped, ErrCode(const std::vector &debugInfos)); }; } // namespace AAFwk } // namespace OHOS diff --git a/test/unittest/app_mgr_client_test/BUILD.gn b/test/unittest/app_mgr_client_test/BUILD.gn index 580be23be0891508790ce10ebf65e7050a619822..dce07e6590ec0709f8e7866407f635ed08fd8310 100644 --- a/test/unittest/app_mgr_client_test/BUILD.gn +++ b/test/unittest/app_mgr_client_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/appmgrservice" ohos_unittest("AppMgrClientTest") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } configs = [ "${ability_runtime_services_path}/common:common_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", diff --git a/test/unittest/app_mgr_service_inner_eighth_test/app_mgr_service_inner_eighth_test.cpp b/test/unittest/app_mgr_service_inner_eighth_test/app_mgr_service_inner_eighth_test.cpp index a76ce33ce28c21a19d21319feeb2f433c99a6332..d6b2b7fe7bf553b35e2420ea3da08e4cca671452 100644 --- a/test/unittest/app_mgr_service_inner_eighth_test/app_mgr_service_inner_eighth_test.cpp +++ b/test/unittest/app_mgr_service_inner_eighth_test/app_mgr_service_inner_eighth_test.cpp @@ -104,14 +104,21 @@ public: class MyAbilityDebugResponse : public IAbilityDebugResponse { public: - void OnAbilitysDebugStarted(const std::vector> &tokens) override - {} + ErrCode OnAbilitysDebugStarted(const std::vector> &tokens) override + { + return ERR_OK; + } - void OnAbilitysDebugStoped(const std::vector> &tokens) override - {} + ErrCode OnAbilitysDebugStoped(const std::vector> &tokens) override + { + return ERR_OK; + } - void OnAbilitysAssertDebugChange(const std::vector> &tokens, - bool isAssertDebug) override {} + ErrCode OnAbilitysAssertDebugChange(const std::vector> &tokens, + bool isAssertDebug) override + { + return ERR_OK; + } sptr AsObject() override { @@ -121,16 +128,26 @@ public: class MyStartSpecifiedAbilityResponse : public IStartSpecifiedAbilityResponse { public: - void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override - {} - void OnTimeoutResponse(int32_t requestId) override - {} - void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override - {} - void OnNewProcessRequestTimeoutResponse(int32_t requestId) override - {} - void OnStartSpecifiedFailed(int32_t requestId) override - {} + ErrCode OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnTimeoutResponse(int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnNewProcessRequestTimeoutResponse(int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnStartSpecifiedFailed(int32_t requestId) override + { + return ERR_OK; + } sptr AsObject() override { return nullptr; diff --git a/test/unittest/app_mgr_service_inner_ninth_test/app_mgr_service_inner_ninth_test.cpp b/test/unittest/app_mgr_service_inner_ninth_test/app_mgr_service_inner_ninth_test.cpp index ebbdfb05c5285f435261fe900cd2a8f17acbce13..32cfc10535a21b9080e94460c928ded0bf09f3b4 100644 --- a/test/unittest/app_mgr_service_inner_ninth_test/app_mgr_service_inner_ninth_test.cpp +++ b/test/unittest/app_mgr_service_inner_ninth_test/app_mgr_service_inner_ninth_test.cpp @@ -67,14 +67,12 @@ public: class MyAbilityDebugResponse : public IAbilityDebugResponse { public: - void OnAbilitysDebugStarted(const std::vector> &tokens) override - {} + ErrCode OnAbilitysDebugStarted(const std::vector> &tokens) override { return ERR_OK; } - void OnAbilitysDebugStoped(const std::vector> &tokens) override - {} + ErrCode OnAbilitysDebugStoped(const std::vector> &tokens) override { return ERR_OK; } - void OnAbilitysAssertDebugChange(const std::vector> &tokens, - bool isAssertDebug) override {} + ErrCode OnAbilitysAssertDebugChange(const std::vector> &tokens, + bool isAssertDebug) override { return ERR_OK; } sptr AsObject() override { @@ -84,16 +82,12 @@ public: class MyStartSpecifiedAbilityResponse : public IStartSpecifiedAbilityResponse { public: - void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override - {} - void OnTimeoutResponse(int32_t requestId) override - {} - void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override - {} - void OnNewProcessRequestTimeoutResponse(int32_t requestId) override - {} - void OnStartSpecifiedFailed(int32_t requestId) override - {} + ErrCode OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override + { return ERR_OK; } + ErrCode OnTimeoutResponse(int32_t requestId) override { return ERR_OK; } + ErrCode OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override { return ERR_OK; } + ErrCode OnNewProcessRequestTimeoutResponse(int32_t requestId) override { return ERR_OK; } + ErrCode OnStartSpecifiedFailed(int32_t requestId) override { return ERR_OK; } sptr AsObject() override { return nullptr; diff --git a/test/unittest/app_mgr_service_inner_second_test/mock/include/mock_ability_debug_response_stub.h b/test/unittest/app_mgr_service_inner_second_test/mock/include/mock_ability_debug_response_stub.h index b3cd1f2cae52126ecfbb22c72faaba35c075d3d4..1c2349bb8738fde1c59522bfab76e82aded34e5c 100644 --- a/test/unittest/app_mgr_service_inner_second_test/mock/include/mock_ability_debug_response_stub.h +++ b/test/unittest/app_mgr_service_inner_second_test/mock/include/mock_ability_debug_response_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2024-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 @@ -27,9 +27,9 @@ class MockAbilityDebugResponseStub : public AbilityDebugResponseStub { public: MockAbilityDebugResponseStub() {} virtual ~ MockAbilityDebugResponseStub() {} - MOCK_METHOD1(OnAbilitysDebugStarted, void(const std::vector> &tokens)); - MOCK_METHOD1(OnAbilitysDebugStoped, void(const std::vector> &tokens)); - MOCK_METHOD2(OnAbilitysAssertDebugChange, void(const std::vector> &, bool)); + MOCK_METHOD1(OnAbilitysDebugStarted, ErrCode(const std::vector> &tokens)); + MOCK_METHOD1(OnAbilitysDebugStoped, ErrCode(const std::vector> &tokens)); + MOCK_METHOD2(OnAbilitysAssertDebugChange, ErrCode(const std::vector> &, bool)); }; } // namespace AppExecFwk } // namespace OHOS diff --git a/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp b/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp index 65aa161005ff1c310678c365d9806260c3a0c296..3275de233108d943906df90bc90255a9965ee3c2 100644 --- a/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp +++ b/test/unittest/app_mgr_service_inner_seventh_test/app_mgr_service_inner_seventh_test.cpp @@ -55,16 +55,26 @@ public: class MyStartSpecifiedAbilityResponse : public IStartSpecifiedAbilityResponse { public: - void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override - {} - void OnTimeoutResponse(int32_t requestId) override - {} - void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override - {} - void OnNewProcessRequestTimeoutResponse(int32_t requestId) override - {} - void OnStartSpecifiedFailed(int32_t requestId) override - {} + ErrCode OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnTimeoutResponse(int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnNewProcessRequestTimeoutResponse(int32_t requestId) override + { + return ERR_OK; + } + ErrCode OnStartSpecifiedFailed(int32_t requestId) override + { + return ERR_OK; + } sptr AsObject() override { return nullptr; diff --git a/test/unittest/app_mgr_service_inner_tenth_test/app_mgr_service_inner_tenth_test.cpp b/test/unittest/app_mgr_service_inner_tenth_test/app_mgr_service_inner_tenth_test.cpp index 74b33289f770d997880bf8b57bdc8d566f64bc89..9a2572f60e3d9691d15bf175c6d06b31cf35fd8c 100644 --- a/test/unittest/app_mgr_service_inner_tenth_test/app_mgr_service_inner_tenth_test.cpp +++ b/test/unittest/app_mgr_service_inner_tenth_test/app_mgr_service_inner_tenth_test.cpp @@ -67,14 +67,14 @@ public: class MyAbilityDebugResponse : public IAbilityDebugResponse { public: - void OnAbilitysDebugStarted(const std::vector> &tokens) override - {} + ErrCode OnAbilitysDebugStarted(const std::vector> &tokens) override + { return ERR_OK; } - void OnAbilitysDebugStoped(const std::vector> &tokens) override - {} + ErrCode OnAbilitysDebugStoped(const std::vector> &tokens) override + { return ERR_OK; } - void OnAbilitysAssertDebugChange(const std::vector> &tokens, - bool isAssertDebug) override {} + ErrCode OnAbilitysAssertDebugChange(const std::vector> &tokens, + bool isAssertDebug) override { return ERR_OK; } sptr AsObject() override { return nullptr; @@ -83,16 +83,16 @@ public: class MyStartSpecifiedAbilityResponse : public IStartSpecifiedAbilityResponse { public: - void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override - {} - void OnTimeoutResponse(int32_t requestId) override - {} - void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override - {} - void OnNewProcessRequestTimeoutResponse(int32_t requestId) override - {} - void OnStartSpecifiedFailed(int32_t requestId) override - {} + ErrCode OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag, int32_t requestId) override + { return ERR_OK; } + ErrCode OnTimeoutResponse(int32_t requestId) override + { return ERR_OK; } + ErrCode OnNewProcessRequestResponse(const std::string &flag, int32_t requestId) override + { return ERR_OK; } + ErrCode OnNewProcessRequestTimeoutResponse(int32_t requestId) override + { return ERR_OK; } + ErrCode OnStartSpecifiedFailed(int32_t requestId) override + { return ERR_OK; } sptr AsObject() override { return nullptr; diff --git a/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp b/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp index 789b3287a5bbd0d01a02e498a0c7e317497cf635..8c790ffe6e49386b9efa72bd0c0a85317972f96a 100644 --- a/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp +++ b/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp @@ -117,13 +117,9 @@ public: MockIUserCallback() = default; virtual ~MockIUserCallback() = default; - void OnStopUserDone(int userId, int errcode) override - {} - void OnStartUserDone(int userId, int errcode) override - {} - - void OnLogoutUserDone(int userId, int errcode) override - {} + ErrCode OnStopUserDone(int userId, int errcode) override { return ERR_OK; } + ErrCode OnStartUserDone(int userId, int errcode) override { return ERR_OK; } + ErrCode OnLogoutUserDone(int userId, int errcode) override { return ERR_OK; } sptr AsObject() override { diff --git a/test/unittest/app_preloader_test/BUILD.gn b/test/unittest/app_preloader_test/BUILD.gn index e271f94abcbddec64cbed76f09af70efe866f520..d7ef4044942c44764e5c6729b37f297d498836a6 100755 --- a/test/unittest/app_preloader_test/BUILD.gn +++ b/test/unittest/app_preloader_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-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 @@ -33,6 +33,7 @@ ohos_unittest("app_preloader_test") { ] deps = [ + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_path}/utils/server/startup:startup_util", "${ability_runtime_services_path}/appmgr:libappms", ] diff --git a/test/unittest/app_service_extension_context_test/BUILD.gn b/test/unittest/app_service_extension_context_test/BUILD.gn index a136e62284914f2985822d098e537b740a09afc7..960fc7c9db591275d5af678aacfe71b0812b64a9 100644 --- a/test/unittest/app_service_extension_context_test/BUILD.gn +++ b/test/unittest/app_service_extension_context_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/app_service_extension" ohos_unittest("app_service_extension_context_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_native_path}/ability/native", diff --git a/test/unittest/app_state_observer_manager_test/BUILD.gn b/test/unittest/app_state_observer_manager_test/BUILD.gn index 44be34d331acf67b4cf788744e5ff9448b00bdff..7213a5762d0c862d0a1e112cb1f0074d4125d131 100755 --- a/test/unittest/app_state_observer_manager_test/BUILD.gn +++ b/test/unittest/app_state_observer_manager_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,6 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/appmgr" ohos_unittest("app_state_observer_manager_test") { module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } cflags_cc = [] include_dirs = [ "${ability_runtime_services_path}/appmgr/include", diff --git a/test/unittest/app_state_observer_manager_test_second/BUILD.gn b/test/unittest/app_state_observer_manager_test_second/BUILD.gn index 3d4392147642abcfbf3d67062482596c617f5fcf..fd05483526897e96b91c11ad017219e67597227c 100755 --- a/test/unittest/app_state_observer_manager_test_second/BUILD.gn +++ b/test/unittest/app_state_observer_manager_test_second/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,6 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/appmgr" ohos_unittest("app_state_observer_manager_test_second") { module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } cflags_cc = [] include_dirs = [ "${ability_runtime_services_path}/appmgr/include", diff --git a/test/unittest/call_record_test/BUILD.gn b/test/unittest/call_record_test/BUILD.gn index 09a97657e7fc30af888446f52563e125747f6cc0..7900a374962e89a0beeb6b628461888ea3990011 100644 --- a/test/unittest/call_record_test/BUILD.gn +++ b/test/unittest/call_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("call_record_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_ability_runtime_test/AMS", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/ability_scheduler_mock", diff --git a/test/unittest/data_ability_manager_test/BUILD.gn b/test/unittest/data_ability_manager_test/BUILD.gn index 2596754c4780c6b1778a2eab8691c50836d7eedd..2d1908956a8e87c960fad0518b846f02f37798ae 100644 --- a/test/unittest/data_ability_manager_test/BUILD.gn +++ b/test/unittest/data_ability_manager_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -24,9 +24,11 @@ ohos_unittest("data_ability_manager_test") { "${ability_runtime_test_path}/mock/services_abilitymgr_test/include", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/ability_scheduler_mock", + "${ability_runtime_innerkits_path}/app_manager/include", "${ability_runtime_innerkits_path}/ability_manager/include", "${ability_runtime_path}/interfaces/kits/native/ability/native", "${ability_runtime_services_path}/common/include", + "${ability_runtime_services_path}/include", ] sources = [ diff --git a/test/unittest/dfr_test/watchdog_test/BUILD.gn b/test/unittest/dfr_test/watchdog_test/BUILD.gn index 7d977ca14785d8bdd9e5f2bf001f48a3bcf0deb2..1b119fb9764edff6b9c94cb57ad5c1fa02b8a499 100644 --- a/test/unittest/dfr_test/watchdog_test/BUILD.gn +++ b/test/unittest/dfr_test/watchdog_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023-2024 Huawei Device Co., Ltd. +# 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 @@ -64,6 +64,7 @@ ohos_unittest("watchdog_test") { ] deps = [ + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_innerkits_path}/runtime:runtime", "${ability_runtime_native_path}/appkit:appkit_native", ] diff --git a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn index c21bc2876fe6eed321bcda28162ac63ece009300..1a44fa0f0f616e03fe2082edb9ad1207b80a13e6 100644 --- a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn @@ -37,6 +37,10 @@ config("module_private_config") { config("module_context_config") { visibility = [ ":*" ] + configs = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", + "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", + ] include_dirs = [ "${ability_runtime_innerkits_path}/app_manager/include/appmgr", "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include", @@ -1019,7 +1023,10 @@ ohos_unittest("idle_time_test") { configs = [ ":module_context_config" ] - deps = [ "${ability_runtime_native_path}/appkit:appkit_native" ] + deps = [ + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_native_path}/appkit:appkit_native", + ] external_deps = [ "ability_runtime:runtime", diff --git a/test/unittest/mission_list_test/BUILD.gn b/test/unittest/mission_list_test/BUILD.gn index 7c72f9189e3b826658f4aeeeb9dd027abb339f45..daf733a7299f85a07b0fe42ec907eafb5d998f94 100644 --- a/test/unittest/mission_list_test/BUILD.gn +++ b/test/unittest/mission_list_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -83,6 +83,7 @@ ohos_unittest("mission_list_test_call") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/abilitymgr:mission_list", diff --git a/test/unittest/pending_want_test/BUILD.gn b/test/unittest/pending_want_test/BUILD.gn index b9a780e467e0e8f143b459de15eff686dcc02a30..db803aab578e76e3dd82866531377a4196277fa3 100644 --- a/test/unittest/pending_want_test/BUILD.gn +++ b/test/unittest/pending_want_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -19,6 +19,12 @@ module_output_path = "ability_runtime/ability_runtime/wantagent" ohos_unittest("pending_want_test") { module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context/", "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", diff --git a/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn b/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn index e35e6e9b2e2805d76a2f31464c1bbdc23962e566..02947579ff597b620da9a11306934adefee6dda0 100644 --- a/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn +++ b/test/unittest/quick_fix/quick_fix_manager_service_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -68,7 +68,12 @@ ohos_unittest("quick_fix_manager_service_test") { ohos_unittest("quick_fix_manager_apply_task_test") { module_out_path = "ability_runtime/ability_runtime/quick_fix" - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", "${ability_runtime_test_path}/unittest/quick_fix/mock/include", diff --git a/test/unittest/service_extension_context_test/BUILD.gn b/test/unittest/service_extension_context_test/BUILD.gn index 6c412aa70ccaf41bd40ca608af22c4cfaaace40c..149e6ba615deb17c707ea8ca7f68c78fea970b7a 100644 --- a/test/unittest/service_extension_context_test/BUILD.gn +++ b/test/unittest/service_extension_context_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("service_extension_context_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_native_path}/ability/native", diff --git a/test/unittest/state_utils_test/BUILD.gn b/test/unittest/state_utils_test/BUILD.gn index 99bec30e48bed5b3e973f08c13a6f2c614b38265..bbde094090acc3d16101d55c8209bd29f6ac7580 100644 --- a/test/unittest/state_utils_test/BUILD.gn +++ b/test/unittest/state_utils_test/BUILD.gn @@ -31,7 +31,7 @@ ohos_unittest("state_utils_test") { ] include_dirs = [] - deps = [] + deps = [ "${ability_runtime_path}/utils/server/startup:startup_util" ] external_deps = [ "ability_runtime:abilitykit_native", diff --git a/test/unittest/stop_user_callback_proxy_test/BUILD.gn b/test/unittest/stop_user_callback_proxy_test/BUILD.gn index bb2e7a4a561f3b3e4add1f3d41e7a57d26f9c618..7d504a0ddd24e65bdc17c77cd0f04308a6e4cca0 100755 --- a/test/unittest/stop_user_callback_proxy_test/BUILD.gn +++ b/test/unittest/stop_user_callback_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("stop_user_callback_proxy_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock" ] sources = [ diff --git a/test/unittest/stop_user_callback_proxy_test/stop_user_callback_proxy_test.cpp b/test/unittest/stop_user_callback_proxy_test/stop_user_callback_proxy_test.cpp index bea826a0aa508985527c648c197ee242ae7aaf38..2318c78e8f56993bc69aaa03ab2997dc04c3e4be 100755 --- a/test/unittest/stop_user_callback_proxy_test/stop_user_callback_proxy_test.cpp +++ b/test/unittest/stop_user_callback_proxy_test/stop_user_callback_proxy_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 @@ -64,7 +64,7 @@ HWTEST_F(StopUserCallbackProxyTest, OnStopUserDone_001, TestSize.Level1) int userId = 0; int errcode = 0; proxy_->OnStopUserDone(userId, errcode); - EXPECT_EQ(IUserCallback::UserCallbackCmd::ON_STOP_USER_DONE, mock_->code_); + EXPECT_EQ(static_cast(IUserCallbackIpcCode::COMMAND_ON_STOP_USER_DONE), mock_->code_); } /* @@ -83,7 +83,7 @@ HWTEST_F(StopUserCallbackProxyTest, OnStopUserDone_002, TestSize.Level1) int userId = 0; int errcode = 0; proxy_->OnStopUserDone(userId, errcode); - EXPECT_EQ(IUserCallback::UserCallbackCmd::ON_STOP_USER_DONE, mock_->code_); + EXPECT_EQ(static_cast(IUserCallbackIpcCode::COMMAND_ON_STOP_USER_DONE), mock_->code_); } } // namespace AAFwk } // namespace OHOS diff --git a/test/unittest/stop_user_callback_proxy_test/stop_user_callback_stub_mock.h b/test/unittest/stop_user_callback_proxy_test/stop_user_callback_stub_mock.h index 59a6b0595612f5fab2961051b1f3ef512e5896ed..4c7456b77577340b9c1b9ef2a7161994adda8f60 100755 --- a/test/unittest/stop_user_callback_proxy_test/stop_user_callback_stub_mock.h +++ b/test/unittest/stop_user_callback_proxy_test/stop_user_callback_stub_mock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -18,7 +18,7 @@ #include #include #include -#include "user_callback.h" +#include "iuser_callback.h" namespace OHOS { namespace AAFwk { @@ -45,9 +45,9 @@ public: int code_ = 0; - virtual void OnStopUserDone(int userId, int errcode) {}; - virtual void OnStartUserDone(int userId, int errcode) {} - virtual void OnLogoutUserDone(int userId, int errcode) {} + virtual ErrCode OnStopUserDone(int userId, int errcode) { return ERR_OK; }; + virtual ErrCode OnStartUserDone(int userId, int errcode) { return ERR_OK; } + virtual ErrCode OnLogoutUserDone(int userId, int errcode) { return ERR_OK; } }; } // namespace AAFwk } // namespace OHOS diff --git a/test/unittest/stop_user_callback_stub_test/BUILD.gn b/test/unittest/stop_user_callback_stub_test/BUILD.gn index 1e77ad3d5a468f8888a10d02b2bb6b457f243d2f..792f2c6aacd3d768ab451330859a0d4b049c361a 100644 --- a/test/unittest/stop_user_callback_stub_test/BUILD.gn +++ b/test/unittest/stop_user_callback_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("stop_user_callback_stub_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", "${ability_runtime_innerkits_path}/test/fuzztest/stopusercallbackstub_fuzzer", diff --git a/test/unittest/stop_user_callback_stub_test/stop_user_callback_stub_test.cpp b/test/unittest/stop_user_callback_stub_test/stop_user_callback_stub_test.cpp index 7e6b49e383dcb0f8207e54e2c1e292eb8dc90c5a..c7a64817d19bc1bc7653430a2becf58b4863f1f7 100644 --- a/test/unittest/stop_user_callback_stub_test/stop_user_callback_stub_test.cpp +++ b/test/unittest/stop_user_callback_stub_test/stop_user_callback_stub_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -27,11 +27,13 @@ public: MockStopUserCallbackStub() = default; virtual ~MockStopUserCallbackStub() {} - void OnStopUserDone(int userId, int errcode) override - {} - void OnStartUserDone(int userId, int errcode) override {} + ErrCode OnStopUserDone(int userId, int errcode) override + { + return ERR_OK; + } + ErrCode OnStartUserDone(int userId, int errcode) override { return ERR_OK; } - void OnLogoutUserDone(int userId, int errcode) override {} + ErrCode OnLogoutUserDone(int userId, int errcode) override { return ERR_OK; } }; class StopUserCallbackStubTest : public testing::Test { @@ -68,7 +70,7 @@ HWTEST_F(StopUserCallbackStubTest, StopUserCallbackStubTest_001, TestSize.Level1 data.WriteString16(value); auto result = backStub->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(result, ERR_INVALID_STATE); + EXPECT_EQ(result, ERR_TRANSACTION_FAILED); GTEST_LOG_(INFO) << "StopUserCallbackStubTest_001 end"; } @@ -85,11 +87,11 @@ HWTEST_F(StopUserCallbackStubTest, StopUserCallbackStubTest_002, TestSize.Level1 MessageParcel data; MessageParcel reply; MessageOption option; - std::u16string metaDescriptor_ = u"ohos.aafwk.UserCallback"; + std::u16string metaDescriptor_ = u"OHOS.AAFwk.IUserCallback"; data.WriteInterfaceToken(metaDescriptor_); auto result = backStub->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(result, IPC_STUB_UNKNOW_TRANS_ERR); + EXPECT_EQ(result, ERR_NONE); GTEST_LOG_(INFO) << "StopUserCallbackStubTest_002 end"; } @@ -106,10 +108,10 @@ HWTEST_F(StopUserCallbackStubTest, StopUserCallbackStubTest_003, TestSize.Level1 MessageParcel data; MessageParcel reply; MessageOption option; - std::u16string metaDescriptor_ = u"ohos.aafwk.UserCallback"; + std::u16string metaDescriptor_ = u"OHOS.AAFwk.IUserCallback"; data.WriteInterfaceToken(metaDescriptor_); auto result = backStub->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(result, ERR_NONE); + EXPECT_EQ(result, IPC_STUB_UNKNOW_TRANS_ERR); GTEST_LOG_(INFO) << "StopUserCallbackStubTest_003 end"; } diff --git a/test/unittest/timeout_state_utils_test/BUILD.gn b/test/unittest/timeout_state_utils_test/BUILD.gn index 4b9f11b64778d59b5b1583ca04b2bf3e85d4b35b..1e9e6a196ffddc6af10a83235b5cba6b9e246549 100644 --- a/test/unittest/timeout_state_utils_test/BUILD.gn +++ b/test/unittest/timeout_state_utils_test/BUILD.gn @@ -19,7 +19,10 @@ module_output_path = "ability_runtime/ability_runtime/state_utils_test" ohos_unittest("timeout_state_utils_test") { module_out_path = module_output_path - configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] + configs = [ + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + "${ability_runtime_path}/utils/server/startup:startup_util_config", + ] if (target_cpu == "arm") { cflags = [ "-DBINDER_IPC_32BIT" ] diff --git a/test/unittest/unlock_screen_test/BUILD.gn b/test/unittest/unlock_screen_test/BUILD.gn index 5032698033c2dc9b684091ac3ef7788db0f71a4b..7e6f119e2463d7fc33999fb46cca878b35d586e7 100644 --- a/test/unittest/unlock_screen_test/BUILD.gn +++ b/test/unittest/unlock_screen_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-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 @@ -38,6 +38,7 @@ ohos_unittest("unlock_screen_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", ] diff --git a/test/unittest/user_controller_test/BUILD.gn b/test/unittest/user_controller_test/BUILD.gn index 0fbe66cd0d182a729c556b18cfd7cbfd1a33a755..120a32b4bfa7e225dae36acb5e691a51779559cc 100644 --- a/test/unittest/user_controller_test/BUILD.gn +++ b/test/unittest/user_controller_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# 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 @@ -18,6 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("user_controller_test") { module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } sources = [ "user_controller_test.cpp" ] diff --git a/test/unittest/user_controller_test/user_controller_test.cpp b/test/unittest/user_controller_test/user_controller_test.cpp index 83088ea5f10fdfdfc3c842f210dd0f100dd4a3ef..9b4710642f875c047a863a47a550afb7e99e612c 100644 --- a/test/unittest/user_controller_test/user_controller_test.cpp +++ b/test/unittest/user_controller_test/user_controller_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 @@ -51,21 +51,22 @@ void UserControllerTest::TearDown() class TestUserCallback : public UserCallbackStub { public: - void OnStopUserDone(int userId, int errcode) override; - void OnStartUserDone(int userId, int errcode) override; - void OnLogoutUserDone(int userId, int errcode) override; + ErrCode OnStopUserDone(int userId, int errcode) override; + ErrCode OnStartUserDone(int userId, int errcode) override; + ErrCode OnLogoutUserDone(int userId, int errcode) override; int errCode_ = -1; }; -void TestUserCallback::OnStartUserDone(int userId, int errcode) +ErrCode TestUserCallback::OnStartUserDone(int userId, int errcode) { errCode_ = errcode; + return ERR_OK; } -void TestUserCallback::OnStopUserDone(int userId, int errcode) {} +ErrCode TestUserCallback::OnStopUserDone(int userId, int errcode) { return ERR_OK; } -void TestUserCallback::OnLogoutUserDone(int userId, int errcode) {} +ErrCode TestUserCallback::OnLogoutUserDone(int userId, int errcode) { return ERR_OK; } /** * @tc.name: UserItemSetState_0100 diff --git a/test/unittest/want_sender_info_test/BUILD.gn b/test/unittest/want_sender_info_test/BUILD.gn index dad9d5e68cb116c8bee2abb852bae42574d5f4a3..f541d77f1612901e9f172f7b187586ce05510094 100644 --- a/test/unittest/want_sender_info_test/BUILD.gn +++ b/test/unittest/want_sender_info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -18,7 +18,12 @@ module_output_path = "ability_runtime/ability_runtime/abilitymgr" ohos_unittest("want_sender_info_test") { module_out_path = module_output_path - + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "../../cfi_blocklist.txt" + } include_dirs = [ "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock" ] sources = [ diff --git a/tools/aa/BUILD.gn b/tools/aa/BUILD.gn index d6ec4e440c24ab088a7c976c62ade9d8402e6b8c..f04905ae2222e4bd1c6e61eb51b4a3a6600f1190 100644 --- a/tools/aa/BUILD.gn +++ b/tools/aa/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-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 @@ -21,6 +21,7 @@ config("ability_command_config") { "${ability_runtime_services_path}/abilitymgr/include/utils", "${ability_runtime_services_path}/abilitymgr/include", ] + configs = [ "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] } config("ability_command_exception_config") {