From 39edf47a1447494d87f48ca3041b1a832d1c31e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Mon, 9 Jun 2025 14:09:09 +0800 Subject: [PATCH 01/15] =?UTF-8?q?description:=E5=85=83=E8=83=BD=E5=8A=9BID?= =?UTF-8?q?L=E5=8C=96=E6=95=B4=E6=94=B9-001?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- frameworks/cj/ffi/want_agent/BUILD.gn | 1 + frameworks/native/ability/native/BUILD.gn | 10 +- interfaces/inner_api/ability_manager/BUILD.gn | 103 ++++++++++- .../idl/IUserCallback.idl} | 42 +---- .../include/ability_manager_interface.h | 4 +- .../ability_manager/include/user_callback.h | 65 ------- .../include/user_callback_proxy.h | 65 ------- interfaces/inner_api/app_manager/BUILD.gn | 120 ++++++++++++- .../IAbilityDebugResponse.idl} | 34 +--- .../IAppDebugListener.idl} | 34 +--- .../idl/IStartSpecifiedAbilityResponse.idl} | 43 ++--- .../appmgr/ability_debug_response_interface.h | 54 ------ .../appmgr/ability_debug_response_proxy.h | 56 ------ .../include/appmgr/ams_mgr_interface.h | 6 +- .../include/appmgr/ams_mgr_proxy.h | 2 +- .../include/appmgr/app_debug_listener_proxy.h | 49 ------ .../include/appmgr/app_mgr_client.h | 4 +- .../include/appmgr/app_mgr_interface.h | 2 +- .../istart_specified_ability_response.h | 59 ------- .../start_specified_ability_response_proxy.h | 56 ------ .../start_specified_ability_response_stub.h | 45 ----- .../appmgr/ability_debug_response_proxy.cpp | 131 -------------- .../appmgr/ability_debug_response_stub.cpp | 118 ------------- .../app_manager/src/appmgr/ams_mgr_stub.cpp | 2 +- .../src/appmgr/app_debug_listener_proxy.cpp | 87 --------- .../src/appmgr/app_debug_listener_stub.cpp | 98 ----------- ...start_specified_ability_response_proxy.cpp | 165 ------------------ .../start_specified_ability_response_stub.cpp | 88 ---------- interfaces/inner_api/wantagent/BUILD.gn | 6 +- services/abilitymgr/abilitymgr.gni | 1 - .../abilitymgr/include/ability_debug_deal.h | 8 +- .../include/ability_manager_service.h | 8 +- services/abilitymgr/include/app_scheduler.h | 18 +- .../abilitymgr/src/ability_debug_deal.cpp | 21 ++- services/abilitymgr/src/app_scheduler.cpp | 15 +- .../abilitymgr/src/user_callback_proxy.cpp | 73 -------- .../abilitymgr/src/user_callback_stub.cpp | 75 -------- services/appmgr/include/ams_mgr_scheduler.h | 2 +- services/appmgr/include/app_debug_manager.h | 2 +- .../appmgr/include/app_mgr_service_inner.h | 6 +- services/appmgr/include/app_running_manager.h | 4 +- .../fuzztest/abilitydebugdeal_fuzzer/BUILD.gn | 2 +- .../abilitydebugresponseproxy_fuzzer/BUILD.gn | 2 +- .../abilitydebugresponseproxy_fuzzer.cpp | 6 - ...appmgrabilitydebugresponseproxy_fuzzer.cpp | 12 -- ...acesappmgrappdebuglistenerproxy_fuzzer.cpp | 10 -- ...facesappmgrappdebuglistenerstub_fuzzer.cpp | 9 +- .../usercallbackstub_fuzzer.cpp | 10 +- test/moduletest/app_mgr_client_test/BUILD.gn | 7 +- test/unittest/BUILD.gn | 5 +- .../ability_debug_response_stub_test.cpp | 4 +- .../mock_ability_debug_response_stub.h | 6 +- .../BUILD.gn | 7 +- .../BUILD.gn | 7 +- .../BUILD.gn | 7 +- .../BUILD.gn | 7 +- .../BUILD.gn | 7 +- .../ability_manager_proxy_test/BUILD.gn | 7 +- .../ability_manager_proxy_third_test/BUILD.gn | 7 +- .../ability_manager_proxy_third_test.cpp | 6 +- .../ability_manager_service_eighth_test.cpp | 9 +- .../BUILD.gn | 1 - .../BUILD.gn | 1 - .../mock/include/mock_test_object.h | 10 +- .../BUILD.gn | 7 +- .../ability_scheduler_stub_test/BUILD.gn | 7 +- .../ams_ability_running_record_test/BUILD.gn | 6 + .../ams_mgr_scheduler_dump_test/BUILD.gn | 7 +- .../BUILD.gn | 6 + .../app_debug_listener_proxy_test/BUILD.gn | 7 +- .../app_debug_listener_proxy_test.cpp | 15 +- .../app_debug_listener_stub_mock.h | 6 +- .../app_debug_listener_stub_test.cpp | 24 ++- .../mock_app_debug_listener_stub.h | 4 +- test/unittest/app_mgr_client_test/BUILD.gn | 7 +- .../app_mgr_service_inner_eighth_test.cpp | 49 ++++-- .../mock_ability_debug_response_stub.h | 6 +- .../app_mgr_service_inner_seventh_test.cpp | 30 ++-- .../app_mgr_service_inner_test.cpp | 10 +- test/unittest/app_preloader_test/BUILD.gn | 1 + .../BUILD.gn | 7 +- .../app_state_observer_manager_test/BUILD.gn | 6 + .../BUILD.gn | 6 + test/unittest/call_record_test/BUILD.gn | 7 +- .../data_ability_manager_test/BUILD.gn | 2 + test/unittest/dfr_test/watchdog_test/BUILD.gn | 1 + .../BUILD.gn | 9 +- test/unittest/mission_list_test/BUILD.gn | 1 + test/unittest/pending_want_test/BUILD.gn | 6 + .../quick_fix_manager_service_test/BUILD.gn | 6 +- .../service_extension_context_test/BUILD.gn | 7 +- test/unittest/state_utils_test/BUILD.gn | 2 +- .../stop_user_callback_proxy_test/BUILD.gn | 7 +- .../stop_user_callback_proxy_test.cpp | 4 +- .../stop_user_callback_stub_mock.h | 8 +- .../stop_user_callback_stub_test/BUILD.gn | 7 +- .../stop_user_callback_stub_test.cpp | 10 +- .../timeout_state_utils_test/BUILD.gn | 5 +- test/unittest/unlock_screen_test/BUILD.gn | 1 + test/unittest/user_controller_test/BUILD.gn | 6 + .../user_controller_test.cpp | 13 +- test/unittest/want_sender_info_test/BUILD.gn | 7 +- tools/aa/BUILD.gn | 3 + 103 files changed, 616 insertions(+), 1638 deletions(-) rename interfaces/inner_api/{app_manager/include/appmgr/app_debug_listener_interface.h => ability_manager/idl/IUserCallback.idl} (32%) delete mode 100644 interfaces/inner_api/ability_manager/include/user_callback.h delete mode 100644 interfaces/inner_api/ability_manager/include/user_callback_proxy.h rename interfaces/inner_api/app_manager/{include/appmgr/app_debug_listener_stub.h => idl/IAbilityDebugResponse.idl} (39%) rename interfaces/inner_api/app_manager/{include/appmgr/ability_debug_response_stub.h => idl/IAppDebugListener.idl} (35%) rename interfaces/inner_api/{ability_manager/include/user_callback_stub.h => app_manager/idl/IStartSpecifiedAbilityResponse.idl} (35%) delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_interface.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/ability_debug_response_proxy.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/app_debug_listener_proxy.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/istart_specified_ability_response.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_proxy.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/start_specified_ability_response_stub.h delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_proxy.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/ability_debug_response_stub.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_proxy.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/app_debug_listener_stub.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/start_specified_ability_response_stub.cpp delete mode 100644 services/abilitymgr/src/user_callback_proxy.cpp delete mode 100644 services/abilitymgr/src/user_callback_stub.cpp diff --git a/frameworks/cj/ffi/want_agent/BUILD.gn b/frameworks/cj/ffi/want_agent/BUILD.gn index b6e9447be76..7f9e9ea2ba6 100644 --- a/frameworks/cj/ffi/want_agent/BUILD.gn +++ b/frameworks/cj/ffi/want_agent/BUILD.gn @@ -35,6 +35,7 @@ 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}/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 0b8fcb13732..8002abf9b5a 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_idl_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 55d58d3ea7a..c8061b802a6 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -11,9 +11,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build/config/components/idl_tool/idl.gni") import("//build/ohos.gni") import("//foundation/ability/ability_runtime/ability_runtime.gni") +idl_gen_interface("ability_manager_interface") { + sources = [ + "idl/IUserCallback.idl", + ] + sources_callback = [ + ] + sources_common =[ + ] + log_domainid = "0xD001336" + log_tag = "AbilityMgr" + subsystem_name = "ability" + part_name = "ability_runtime" +} + +config("ability_manager_idl_config") { + include_dirs = [ "${target_gen_dir}" ] +} + config("ability_manager_public_config") { visibility = [ ":*" ] visibility += [ @@ -40,8 +59,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 +82,84 @@ config("ability_manager_public_config") { } } +ohos_source_set("ability_manager_idl_proxy") { + 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_interface") + source_values = [ + "*user_callback_proxy.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ ":ability_manager_interface" ] + + 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_idl_stub") { + 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_interface") + source_values = [ + "*user_callback_stub.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + deps = [ ":ability_manager_interface" ] + + 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 +205,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", @@ -139,6 +234,8 @@ ohos_shared_library("ability_manager") { public_deps = [ ":ability_connect_callback_stub" ] deps = [ + ":ability_manager_idl_stub", + ":ability_manager_idl_proxy", ":ability_start_options", ":ability_start_setting", ":mission_info", 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 113002837ee..4651d4c37b8 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_interface.h b/interfaces/inner_api/ability_manager/include/ability_manager_interface.h index 1785a9b14f7..5c19edc42c9 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,7 @@ #include "ability_start_setting.h" #include "ability_state.h" #include "ability_state_data.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "auto_startup_info.h" #include "dms_continueInfo.h" #include "exit_reason.h" @@ -51,7 +51,7 @@ #include "sa_interceptor_interface.h" #include "sender_info.h" #include "start_options.h" -#include "user_callback.h" +#include "iuser_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 f2fd6373927..00000000000 --- 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 e469b70b04d..00000000000 --- 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 c9658b81753..0b96bd17685 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_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,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_idl_config", + "${ability_runtime_path}/utils/server/startup:startup_util_config", + ] + + deps = [ + ":appmgr_innerkits", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_interface", + "${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_idl_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_interface", + "${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,8 +224,6 @@ 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", ] @@ -129,6 +231,9 @@ ohos_shared_library("app_manager") { public_configs = [ ":appmgr_core_config", ":appmgr_sdk_config", + ":appmgr_innerkits_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_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 3aab199f486..8f71029a117 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 9753d7051b3..2020004d5fc 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 bed99d5a402..652fa7c75ba 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 87ec00b7b17..00000000000 --- 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 1bdac574de5..00000000000 --- 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 d919a230212..11a7d6d41af 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" @@ -27,7 +27,7 @@ #include "iremote_object.h" #include "istart_specified_ability_response.h" #include "running_process_info.h" -#include "user_callback.h" +#include "iuser_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 fec486a478f..411dd010e6b 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 a309079a938..00000000000 --- 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 3a5e83250bc..38852cc47ee 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,9 @@ #ifndef OHOS_ABILITY_RUNTIME_APP_MGR_CLIENT_H #define OHOS_ABILITY_RUNTIME_APP_MGR_CLIENT_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_malloc_info.h" #include "app_mem_info.h" #include "app_mgr_constants.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 78c33ca8ff1..e92f6bcac89 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 @@ -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 0777f67ee1d..00000000000 --- 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 bf2037afc01..00000000000 --- 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 041320de260..00000000000 --- 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 5736f1b596c..00000000000 --- 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 daf6a577ae8..00000000000 --- 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 4fc28df4288..25d21352b47 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,7 +16,7 @@ #include "ams_mgr_stub.h" #include "ability_manager_errors.h" #include "ability_info.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "app_mgr_proxy.h" #include "app_scheduler_interface.h" #include "appexecfwk_errors.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 fc271be274a..00000000000 --- 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 ae20e2535b8..00000000000 --- 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 024dfee1d07..00000000000 --- 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 690da42b84a..00000000000 --- 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 e047578302f..f1907debb77 100644 --- a/interfaces/inner_api/wantagent/BUILD.gn +++ b/interfaces/inner_api/wantagent/BUILD.gn @@ -43,6 +43,7 @@ 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}/app_manager:appmgr_innerkits_config", ] } ohos_shared_library("wantagent_innerkits") { @@ -66,7 +67,10 @@ ohos_shared_library("wantagent_innerkits") { "src/want_agent_info.cpp", ] - public_configs = [ ":wantagent_innerkits_public_config" ] + public_configs = [ + ":wantagent_innerkits_public_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + ] deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", diff --git a/services/abilitymgr/abilitymgr.gni b/services/abilitymgr/abilitymgr.gni index 3f646c121f6..398c8a9c216 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 13e446b090b..53f04555e7d 100644 --- a/services/abilitymgr/include/ability_debug_deal.h +++ b/services/abilitymgr/include/ability_debug_deal.h @@ -16,7 +16,7 @@ #ifndef OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_DEAL_H #define OHOS_ABILITY_RUNTIME_ABILITY_DEBUG_DEAL_H -#include "ability_debug_response_interface.h" +#include "iability_debug_response.h" #include "ability_debug_response_stub.h" namespace OHOS { @@ -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 2f3e8026390..9acf52ec468 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -37,7 +37,7 @@ #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 "iapp_debug_listener.h" #include "app_exit_reason_helper.h" #include "app_mgr_interface.h" #include "app_scheduler.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 b2de5a39511..9c0fc64fdc3 100644 --- a/services/abilitymgr/include/app_scheduler.h +++ b/services/abilitymgr/include/app_scheduler.h @@ -19,14 +19,14 @@ #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 "start_specified_ability_response_stub.h" #include "bundle_info.h" #include "fault_data.h" #include "iremote_object.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 9493ef44d47..6a41c648b3a 100644 --- a/services/abilitymgr/src/ability_debug_deal.cpp +++ b/services/abilitymgr/src/ability_debug_deal.cpp @@ -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_INVALID_DATA; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGE(AAFwkTag::ABILITYMGR, "deal null"); - return; + return ERR_INVALID_DATA; } 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_INVALID_DATA; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGE(AAFwkTag::ABILITYMGR, "deal null"); - return; + return ERR_INVALID_DATA; } 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_INVALID_DATA; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGW(AAFwkTag::ABILITYMGR, "deal null"); - return; + return ERR_INVALID_DATA; } 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 d6385c53b44..d26e6d7ffe6 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 a94521710d7..00000000000 --- 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 fe078586ffd..00000000000 --- 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 69af744e93a..a2ae1a72f0b 100644 --- a/services/appmgr/include/ams_mgr_scheduler.h +++ b/services/appmgr/include/ams_mgr_scheduler.h @@ -19,7 +19,7 @@ #include "ability_info.h" #include "ability_running_record.h" #include "ams_mgr_stub.h" -#include "app_debug_listener_interface.h" +#include "iapp_debug_listener.h" #include "app_mgr_constants.h" #include "app_mgr_service_inner.h" #include "app_record_id.h" diff --git a/services/appmgr/include/app_debug_manager.h b/services/appmgr/include/app_debug_manager.h index 8da182c9428..d5203399e10 100644 --- a/services/appmgr/include/app_debug_manager.h +++ b/services/appmgr/include/app_debug_manager.h @@ -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 9bc66b07c2f..fa27cf1a6f7 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -24,12 +24,12 @@ #include #include -#include "ability_debug_response_interface.h" +#include "iability_debug_response.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" @@ -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 d92f1b5228b..5fe6b246d30 100644 --- a/services/appmgr/include/app_running_manager.h +++ b/services/appmgr/include/app_running_manager.h @@ -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/abilitydebugdeal_fuzzer/BUILD.gn b/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn index f9c6a7be98b..a620c1cc4e3 100644 --- a/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn @@ -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 768834e2a31..5a84060ab11 100755 --- a/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn @@ -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 7840d93e675..a81ad49bebd 100755 --- a/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp +++ b/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp @@ -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/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp index b09f529b4c3..34c22d5fc05 100644 --- a/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp +++ b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp @@ -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/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp index bb28bb48cd9..a9d69ca2549 100644 --- a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp +++ b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp @@ -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/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp index 2b94e21e8d6..7b60eaa63f8 100644 --- a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp +++ b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp @@ -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/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp b/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp index 11c5ff0e3f9..affdd4884f4 100644 --- a/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp +++ b/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp @@ -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/moduletest/app_mgr_client_test/BUILD.gn b/test/moduletest/app_mgr_client_test/BUILD.gn index 9a3c1e9e3ed..a05d6c24a70 100644 --- a/test/moduletest/app_mgr_client_test/BUILD.gn +++ b/test/moduletest/app_mgr_client_test/BUILD.gn @@ -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 07923eb6220..88c49ffabd1 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 3167b3fa20f..fe5d6e1e3a7 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 @@ -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 e4a257354df..caa01322dd8 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 @@ -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 ccd62f0691e..89a81bac741 100644 --- a/test/unittest/ability_manager_client_branch_second_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_second_test/BUILD.gn @@ -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 44a1bc89fc6..837d4e5d287 100644 --- a/test/unittest/ability_manager_client_branch_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_test/BUILD.gn @@ -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 4d464465ef5..9863597d244 100644 --- a/test/unittest/ability_manager_client_branch_third_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_third_test/BUILD.gn @@ -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 660c33c3f51..3763375bdcb 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 f7442776ac3..d13e1cdb39f 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 697e6e567ea..e4261ca6b4e 100644 --- a/test/unittest/ability_manager_proxy_test/BUILD.gn +++ b/test/unittest/ability_manager_proxy_test/BUILD.gn @@ -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 62f6e2dac84..09ae8600db6 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 1a48b715b98..79ef873b77d 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 3984f0a987a..dc7301c4e64 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 5728c0916d6..5f76a978e62 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_thirteenth_test/BUILD.gn b/test/unittest/ability_manager_service_thirteenth_test/BUILD.gn index 0637a9d6e95..9274be657f0 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 215b46aa8e2..bb13da5d1da 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 537ffd064a3..70a91787602 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 f8ce56fce58..429d1f6f444 100644 --- a/test/unittest/ability_scheduler_stub_test/BUILD.gn +++ b/test/unittest/ability_scheduler_stub_test/BUILD.gn @@ -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 5403becfe77..b6beb42fe21 100644 --- a/test/unittest/ams_ability_running_record_test/BUILD.gn +++ b/test/unittest/ams_ability_running_record_test/BUILD.gn @@ -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 82fe5a49b19..ee17c6bc88a 100644 --- a/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn +++ b/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn @@ -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 6e21ffaa9de..a206e7c8154 100644 --- a/test/unittest/ams_service_load_ability_process_test/BUILD.gn +++ b/test/unittest/ams_service_load_ability_process_test/BUILD.gn @@ -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 185afb3de5f..4fb5f653846 100644 --- a/test/unittest/app_debug_listener_proxy_test/BUILD.gn +++ b/test/unittest/app_debug_listener_proxy_test/BUILD.gn @@ -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 18060b90829..242dcdef445 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 @@ -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 b3c81fc0dcb..f2e6ac5eedd 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 @@ -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 87754032c02..f8942295d42 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 @@ -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,7 +91,7 @@ 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); + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); EXPECT_EQ(result, ERR_INVALID_STATE); } @@ -128,7 +128,7 @@ 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); + static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); EXPECT_EQ(result, ERR_INVALID_DATA); } @@ -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); + 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,15 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStoped_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_, 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 +204,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 09418d05921..436837abf2d 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 @@ -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 580be23be08..841e02899d2 100644 --- a/test/unittest/app_mgr_client_test/BUILD.gn +++ b/test/unittest/app_mgr_client_test/BUILD.gn @@ -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 a76ce33ce28..d6b2b7fe7bf 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_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 b3cd1f2cae5..482178787c9 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 @@ -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 65aa161005f..3275de23310 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_test/app_mgr_service_inner_test.cpp b/test/unittest/app_mgr_service_inner_test/app_mgr_service_inner_test.cpp index 789b3287a5b..8c790ffe6e4 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 e271f94abcb..5621e4646a7 100755 --- a/test/unittest/app_preloader_test/BUILD.gn +++ b/test/unittest/app_preloader_test/BUILD.gn @@ -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 d39c7285832..cdd7169e193 100644 --- a/test/unittest/app_service_extension_context_test/BUILD.gn +++ b/test/unittest/app_service_extension_context_test/BUILD.gn @@ -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 44be34d331a..39dea9ed1a6 100755 --- a/test/unittest/app_state_observer_manager_test/BUILD.gn +++ b/test/unittest/app_state_observer_manager_test/BUILD.gn @@ -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 3d439214764..ade8f768119 100755 --- a/test/unittest/app_state_observer_manager_test_second/BUILD.gn +++ b/test/unittest/app_state_observer_manager_test_second/BUILD.gn @@ -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 a9bfa99149f..e4daaef3a3f 100644 --- a/test/unittest/call_record_test/BUILD.gn +++ b/test/unittest/call_record_test/BUILD.gn @@ -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 2596754c478..f2937e420c5 100644 --- a/test/unittest/data_ability_manager_test/BUILD.gn +++ b/test/unittest/data_ability_manager_test/BUILD.gn @@ -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 7d977ca1478..101dfcdd974 100644 --- a/test/unittest/dfr_test/watchdog_test/BUILD.gn +++ b/test/unittest/dfr_test/watchdog_test/BUILD.gn @@ -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 c21bc2876fe..c1603c57850 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_idl_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 00cbd596216..0bb8ffad82a 100644 --- a/test/unittest/mission_list_test/BUILD.gn +++ b/test/unittest/mission_list_test/BUILD.gn @@ -84,6 +84,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 b9a780e467e..2484d92cfff 100644 --- a/test/unittest/pending_want_test/BUILD.gn +++ b/test/unittest/pending_want_test/BUILD.gn @@ -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 e35e6e9b2e2..f8d3d42a711 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 @@ -68,7 +68,11 @@ 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 + } 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 b6a7c73efc1..19ddf2b1f00 100644 --- a/test/unittest/service_extension_context_test/BUILD.gn +++ b/test/unittest/service_extension_context_test/BUILD.gn @@ -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 99bec30e48b..bbde094090a 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 bf90b09291f..3196f493de2 100755 --- a/test/unittest/stop_user_callback_proxy_test/BUILD.gn +++ b/test/unittest/stop_user_callback_proxy_test/BUILD.gn @@ -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 bea826a0aa5..6ac8b3fcddd 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 @@ -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 59a6b059561..d212a591345 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 @@ -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 3f8036ff4f2..45eeb3c27e8 100644 --- a/test/unittest/stop_user_callback_stub_test/BUILD.gn +++ b/test/unittest/stop_user_callback_stub_test/BUILD.gn @@ -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 7e6b49e383d..bc333ec6168 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 @@ -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 { diff --git a/test/unittest/timeout_state_utils_test/BUILD.gn b/test/unittest/timeout_state_utils_test/BUILD.gn index 4b9f11b6477..1e9e6a196ff 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 5032698033c..84a3f1dd9b0 100644 --- a/test/unittest/unlock_screen_test/BUILD.gn +++ b/test/unittest/unlock_screen_test/BUILD.gn @@ -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 0fbe66cd0d1..945794b6c8a 100644 --- a/test/unittest/user_controller_test/BUILD.gn +++ b/test/unittest/user_controller_test/BUILD.gn @@ -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 83088ea5f10..f2abcf77474 100644 --- a/test/unittest/user_controller_test/user_controller_test.cpp +++ b/test/unittest/user_controller_test/user_controller_test.cpp @@ -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 2ae36e4a825..d2dc36e2be3 100644 --- a/test/unittest/want_sender_info_test/BUILD.gn +++ b/test/unittest/want_sender_info_test/BUILD.gn @@ -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 d6ec4e440c2..86f7594b22d 100644 --- a/tools/aa/BUILD.gn +++ b/tools/aa/BUILD.gn @@ -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") { @@ -45,6 +46,8 @@ ohos_static_library("tools_aa_source_set") { public_configs = [ ":ability_command_config", ":ability_command_exception_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", "${ability_runtime_services_path}/common:common_config", ] -- Gitee From 9eded76bf6d922507d6144a0432931509a6aac0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Mon, 9 Jun 2025 21:34:47 +0800 Subject: [PATCH 02/15] =?UTF-8?q?description:=E4=BF=AE=E5=A4=8Dtdd=20appde?= =?UTF-8?q?buglistener=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../app_debug_listener_stub_test.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 f8942295d42..919aacfa959 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 @@ -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: @@ -92,7 +92,7 @@ HWTEST_F(AppDebugListenerStubTest, OnRemoteRequest_0200, TestSize.Level1) auto result = mockStub_->OnRemoteRequest( static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); - EXPECT_EQ(result, ERR_INVALID_STATE); + EXPECT_EQ(result, ERR_TRANSACTION_FAILED); // ERR_TRANSACTION_FAILED for no interfaceToken data } /** @@ -129,7 +129,7 @@ HWTEST_F(AppDebugListenerStubTest, OnRemoteRequest_0400, TestSize.Level1) auto result = mockStub_->OnRemoteRequest( static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); - EXPECT_EQ(result, ERR_INVALID_DATA); + EXPECT_EQ(result, ERR_NONE); } /** @@ -147,7 +147,7 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStarted_0100, TestSize.Level1 data.WriteInt32(DEBUG_INFO_SIZE_ONE); data.WriteParcelable(&debugInfo); - EXPECT_CALL(*mockStub_, OnAppDebugStarted(_)).Times(1); + EXPECT_CALL(*mockStub_, OnAppDebugStarted(_)).Times(0); mockStub_->OnRemoteRequest( static_cast(IAppDebugListenerIpcCode::COMMAND_ON_APP_DEBUG_STARTED), data, reply, option); } @@ -184,6 +184,7 @@ HWTEST_F(AppDebugListenerStubTest, HandleOnAppDebugStoped_0100, TestSize.Level1) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); + WriteInterfaceToken(data); AppDebugInfo debugInfo; data.WriteInt32(DEBUG_INFO_SIZE_ONE); data.WriteParcelable(&debugInfo); -- Gitee From 4fc40cb25e4ba4344125b9bc0f6cf13ed9a94250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Tue, 10 Jun 2025 14:02:24 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- frameworks/cj/ffi/want_agent/BUILD.gn | 5 +- frameworks/native/ability/native/BUILD.gn | 2 +- interfaces/inner_api/ability_manager/BUILD.gn | 64 ++++++++----------- interfaces/inner_api/app_manager/BUILD.gn | 10 +-- interfaces/inner_api/wantagent/BUILD.gn | 10 +-- services/abilitymgr/BUILD.gn | 2 +- .../BUILD.gn | 2 +- tools/aa/BUILD.gn | 2 - 8 files changed, 45 insertions(+), 52 deletions(-) diff --git a/frameworks/cj/ffi/want_agent/BUILD.gn b/frameworks/cj/ffi/want_agent/BUILD.gn index 7f9e9ea2ba6..5b673fbc53d 100644 --- a/frameworks/cj/ffi/want_agent/BUILD.gn +++ b/frameworks/cj/ffi/want_agent/BUILD.gn @@ -35,7 +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}/app_manager:appmgr_innerkits_config", ] + 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 8002abf9b5a..b725ff79c14 100644 --- a/frameworks/native/ability/native/BUILD.gn +++ b/frameworks/native/ability/native/BUILD.gn @@ -334,7 +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_idl_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits_public_config", ] diff --git a/interfaces/inner_api/ability_manager/BUILD.gn b/interfaces/inner_api/ability_manager/BUILD.gn index c8061b802a6..0480803a9b5 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -15,24 +15,6 @@ import("//build/config/components/idl_tool/idl.gni") import("//build/ohos.gni") import("//foundation/ability/ability_runtime/ability_runtime.gni") -idl_gen_interface("ability_manager_interface") { - sources = [ - "idl/IUserCallback.idl", - ] - sources_callback = [ - ] - sources_common =[ - ] - log_domainid = "0xD001336" - log_tag = "AbilityMgr" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -config("ability_manager_idl_config") { - include_dirs = [ "${target_gen_dir}" ] -} - config("ability_manager_public_config") { visibility = [ ":*" ] visibility += [ @@ -82,7 +64,25 @@ config("ability_manager_public_config") { } } -ohos_source_set("ability_manager_idl_proxy") { +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 @@ -92,19 +92,13 @@ ohos_source_set("ability_manager_idl_proxy") { cfi_vcall_icall_only = true debug = false } - output_values = get_target_outputs(":ability_manager_interface") - source_values = [ - "*user_callback_proxy.cpp", - ] - sources = filter_include(output_values, source_values) public_configs = [ - ":ability_manager_idl_config", + ":ability_manager_innerkits_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", ] - deps = [ ":ability_manager_interface" ] - + deps = [ ":ability_manager_innerkits" ] external_deps = [ "c_utils:utils", "hilog:libhilog", @@ -116,7 +110,7 @@ ohos_source_set("ability_manager_idl_proxy") { part_name = "ability_runtime" } -ohos_source_set("ability_manager_idl_stub") { +ohos_source_set("ability_manager_innerkits_source") { sanitize = { integer_overflow = true ubsan = true @@ -126,18 +120,16 @@ ohos_source_set("ability_manager_idl_stub") { cfi_vcall_icall_only = true debug = false } - output_values = get_target_outputs(":ability_manager_interface") - source_values = [ - "*user_callback_stub.cpp", - ] + output_values = get_target_outputs(":ability_manager_innerkits") + source_values = [ "*.cpp", ] sources = filter_include(output_values, source_values) public_configs = [ - ":ability_manager_idl_config", + ":ability_manager_innerkits_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", ] - deps = [ ":ability_manager_interface" ] + deps = [ ":ability_manager_innerkits" ] external_deps = [ "c_utils:utils", @@ -234,8 +226,8 @@ ohos_shared_library("ability_manager") { public_deps = [ ":ability_connect_callback_stub" ] deps = [ - ":ability_manager_idl_stub", - ":ability_manager_idl_proxy", + ":ability_manager_innerkits_include", + ":ability_manager_innerkits_source", ":ability_start_options", ":ability_start_setting", ":mission_info", diff --git a/interfaces/inner_api/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index 0b96bd17685..f67ee7e0655 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_manager/BUILD.gn @@ -70,13 +70,13 @@ ohos_source_set("appmgr_innerkits_include") { public_configs = [ ":appmgr_innerkits_config", - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_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_interface", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits", "${ability_runtime_path}/utils/server/startup:startup_util", ] external_deps = [ @@ -109,7 +109,7 @@ ohos_source_set("appmgr_innerkits_source") { public_configs = [ ":appmgr_innerkits_config", - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", "${ability_runtime_path}/utils/server/startup:startup_util_config", ] @@ -118,7 +118,7 @@ ohos_source_set("appmgr_innerkits_source") { deps = [ ":appmgr_innerkits", - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_interface", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits", "${ability_runtime_path}/utils/server/startup:startup_util", ] external_deps = [ @@ -232,7 +232,7 @@ ohos_shared_library("app_manager") { ":appmgr_core_config", ":appmgr_sdk_config", ":appmgr_innerkits_config", - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", "${ability_runtime_path}/utils/server/startup:startup_util_config", ] diff --git a/interfaces/inner_api/wantagent/BUILD.gn b/interfaces/inner_api/wantagent/BUILD.gn index f1907debb77..e369cd6062c 100644 --- a/interfaces/inner_api/wantagent/BUILD.gn +++ b/interfaces/inner_api/wantagent/BUILD.gn @@ -43,7 +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}/app_manager:appmgr_innerkits_config", ] + 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") { @@ -67,10 +70,7 @@ ohos_shared_library("wantagent_innerkits") { "src/want_agent_info.cpp", ] - public_configs = [ - ":wantagent_innerkits_public_config", - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", - ] + public_configs = [ ":wantagent_innerkits_public_config" ] deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index 110c0850362..002e0463840 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -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/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn index c1603c57850..1a44fa0f0f6 100644 --- a/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_appkit_native_test/BUILD.gn @@ -38,7 +38,7 @@ config("module_private_config") { config("module_context_config") { visibility = [ ":*" ] configs = [ - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", ] include_dirs = [ diff --git a/tools/aa/BUILD.gn b/tools/aa/BUILD.gn index 86f7594b22d..52b9f65b2ea 100644 --- a/tools/aa/BUILD.gn +++ b/tools/aa/BUILD.gn @@ -46,8 +46,6 @@ ohos_static_library("tools_aa_source_set") { public_configs = [ ":ability_command_config", ":ability_command_exception_config", - "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", - "${ability_runtime_innerkits_path}/app_manager:appmgr_innerkits_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", "${ability_runtime_services_path}/common:common_config", ] -- Gitee From 2de14e32b7e002c83ae5899a83100c4a56251e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Tue, 10 Jun 2025 22:32:49 +0800 Subject: [PATCH 04/15] =?UTF-8?q?description:=E6=A3=80=E8=A7=86=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- frameworks/cj/ffi/want_agent/BUILD.gn | 2 +- .../include/ability_manager_interface.h | 4 ++-- interfaces/inner_api/app_manager/BUILD.gn | 3 +-- .../app_manager/include/appmgr/ams_mgr_interface.h | 2 +- .../app_manager/include/appmgr/app_mgr_client.h | 4 ++-- .../app_manager/include/appmgr/app_mgr_interface.h | 2 +- .../app_manager/src/appmgr/ams_mgr_stub.cpp | 2 +- interfaces/inner_api/wantagent/BUILD.gn | 2 +- services/abilitymgr/BUILD.gn | 2 +- services/abilitymgr/include/ability_debug_deal.h | 4 ++-- .../abilitymgr/include/ability_manager_service.h | 2 +- services/abilitymgr/include/app_scheduler.h | 2 +- services/appmgr/include/ams_mgr_scheduler.h | 2 +- services/appmgr/include/app_mgr_service_inner.h | 2 +- test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn | 2 +- .../abilitydebugresponseproxy_fuzzer/BUILD.gn | 2 +- ...erfacesappmgrabilitydebugresponseproxy_fuzzer.cpp | 2 +- ...yinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp | 2 +- ...tyinterfacesappmgrappdebuglistenerstub_fuzzer.cpp | 2 +- .../usercallbackstub_fuzzer.cpp | 2 +- test/moduletest/app_mgr_client_test/BUILD.gn | 2 +- .../ability_debug_response_stub_test.cpp | 2 +- .../mock_ability_debug_response_stub.h | 2 +- .../BUILD.gn | 2 +- .../ability_manager_client_branch_test/BUILD.gn | 2 +- .../BUILD.gn | 2 +- test/unittest/ability_manager_proxy_test/BUILD.gn | 2 +- test/unittest/ability_scheduler_stub_test/BUILD.gn | 2 +- .../ams_ability_running_record_test/BUILD.gn | 2 +- test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn | 2 +- .../ams_service_load_ability_process_test/BUILD.gn | 2 +- test/unittest/app_debug_listener_proxy_test/BUILD.gn | 2 +- .../app_debug_listener_proxy_test.cpp | 2 +- .../app_debug_listener_stub_mock.h | 2 +- .../app_debug_listener_stub_test.cpp | 2 +- .../mock_app_debug_listener_stub.h | 2 +- test/unittest/app_mgr_client_test/BUILD.gn | 2 +- .../mock/include/mock_ability_debug_response_stub.h | 2 +- test/unittest/app_preloader_test/BUILD.gn | 2 +- .../app_service_extension_context_test/BUILD.gn | 2 +- .../app_state_observer_manager_test/BUILD.gn | 2 +- .../app_state_observer_manager_test_second/BUILD.gn | 2 +- test/unittest/call_record_test/BUILD.gn | 2 +- test/unittest/data_ability_manager_test/BUILD.gn | 2 +- test/unittest/dfr_test/watchdog_test/BUILD.gn | 2 +- test/unittest/mission_list_test/BUILD.gn | 2 +- test/unittest/pending_want_test/BUILD.gn | 2 +- .../quick_fix_manager_service_test/BUILD.gn | 2 +- .../unittest/service_extension_context_test/BUILD.gn | 2 +- test/unittest/stop_user_callback_proxy_test/BUILD.gn | 2 +- .../stop_user_callback_proxy_test.cpp | 2 +- .../stop_user_callback_stub_mock.h | 2 +- test/unittest/stop_user_callback_stub_test/BUILD.gn | 2 +- .../stop_user_callback_stub_test.cpp | 12 ++++++------ test/unittest/unlock_screen_test/BUILD.gn | 2 +- test/unittest/user_controller_test/BUILD.gn | 2 +- .../user_controller_test/user_controller_test.cpp | 2 +- test/unittest/want_sender_info_test/BUILD.gn | 2 +- tools/aa/BUILD.gn | 2 +- 59 files changed, 67 insertions(+), 68 deletions(-) diff --git a/frameworks/cj/ffi/want_agent/BUILD.gn b/frameworks/cj/ffi/want_agent/BUILD.gn index 5b673fbc53d..12d69329e06 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 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 5c19edc42c9..20529bbc02c 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 "iapp_debug_listener.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 "iuser_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/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index f67ee7e0655..003157d3e04 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 @@ -231,7 +231,6 @@ ohos_shared_library("app_manager") { public_configs = [ ":appmgr_core_config", ":appmgr_sdk_config", - ":appmgr_innerkits_config", "${ability_runtime_innerkits_path}/ability_manager:ability_manager_innerkits_config", "${ability_runtime_path}/utils/server/startup:startup_util_config", ] 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 11a7d6d41af..2df1661f0b0 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 @@ -26,8 +26,8 @@ #include "iremote_broker.h" #include "iremote_object.h" #include "istart_specified_ability_response.h" -#include "running_process_info.h" #include "iuser_callback.h" +#include "running_process_info.h" namespace OHOS { namespace AbilityRuntime { 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 38852cc47ee..5eec5d778fb 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 "iability_debug_response.h" #include "ability_info.h" -#include "iapp_debug_listener.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 e92f6bcac89..f0d1dbfabbf 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 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 25d21352b47..33684654877 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 "iapp_debug_listener.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/wantagent/BUILD.gn b/interfaces/inner_api/wantagent/BUILD.gn index e369cd6062c..9772c9a5230 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 diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index 002e0463840..c87128b77fb 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 diff --git a/services/abilitymgr/include/ability_debug_deal.h b/services/abilitymgr/include/ability_debug_deal.h index 53f04555e7d..64dc7d60637 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 "iability_debug_response.h" #include "ability_debug_response_stub.h" +#include "iability_debug_response.h" namespace OHOS { namespace AAFwk { diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 9acf52ec468..ded50025797 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 "iapp_debug_listener.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" diff --git a/services/abilitymgr/include/app_scheduler.h b/services/abilitymgr/include/app_scheduler.h index 9c0fc64fdc3..e1eb97bf0de 100644 --- a/services/abilitymgr/include/app_scheduler.h +++ b/services/abilitymgr/include/app_scheduler.h @@ -26,13 +26,13 @@ #include "application_info.h" #include "appmgr/app_mgr_client.h" #include "appmgr/app_state_callback_host.h" -#include "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" diff --git a/services/appmgr/include/ams_mgr_scheduler.h b/services/appmgr/include/ams_mgr_scheduler.h index a2ae1a72f0b..28f6b3e78ff 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 "iapp_debug_listener.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_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index fa27cf1a6f7..4f4588802e2 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -24,7 +24,6 @@ #include #include -#include "iability_debug_response.h" #include "ability_foreground_state_observer_interface.h" #include "ability_info.h" #include "advanced_security_mode_manager.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" diff --git a/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn b/test/fuzztest/abilitydebugdeal_fuzzer/BUILD.gn index a620c1cc4e3..8ddfb770b05 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 diff --git a/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn b/test/fuzztest/abilitydebugresponseproxy_fuzzer/BUILD.gn index 5a84060ab11..363a825f1b5 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 diff --git a/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer/abilityinterfacesappmgrabilitydebugresponseproxy_fuzzer.cpp index 34c22d5fc05..25969b4b201 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 diff --git a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer/abilityinterfacesappmgrappdebuglistenerproxy_fuzzer.cpp index a9d69ca2549..cf99b6d40af 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 diff --git a/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp b/test/fuzztest/abilityinterfacesappmgrappdebuglistenerstub_fuzzer/abilityinterfacesappmgrappdebuglistenerstub_fuzzer.cpp index 7b60eaa63f8..79118353ee2 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 diff --git a/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp b/test/fuzztest/usercallbackstub_fuzzer/usercallbackstub_fuzzer.cpp index affdd4884f4..59a75929c1e 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 diff --git a/test/moduletest/app_mgr_client_test/BUILD.gn b/test/moduletest/app_mgr_client_test/BUILD.gn index a05d6c24a70..409c2699258 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 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 fe5d6e1e3a7..ad8f8f90b74 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 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 caa01322dd8..79f47778999 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 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 89a81bac741..100862c1c25 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 diff --git a/test/unittest/ability_manager_client_branch_test/BUILD.gn b/test/unittest/ability_manager_client_branch_test/BUILD.gn index 837d4e5d287..74881e2c3b9 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 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 9863597d244..6fcb973b301 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 diff --git a/test/unittest/ability_manager_proxy_test/BUILD.gn b/test/unittest/ability_manager_proxy_test/BUILD.gn index e4261ca6b4e..232da0cd55a 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 diff --git a/test/unittest/ability_scheduler_stub_test/BUILD.gn b/test/unittest/ability_scheduler_stub_test/BUILD.gn index 429d1f6f444..6538b2d48dc 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 diff --git a/test/unittest/ams_ability_running_record_test/BUILD.gn b/test/unittest/ams_ability_running_record_test/BUILD.gn index b6beb42fe21..ca8ea03f12c 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 diff --git a/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn b/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn index ee17c6bc88a..91055070844 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 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 a206e7c8154..3c3939cae59 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 diff --git a/test/unittest/app_debug_listener_proxy_test/BUILD.gn b/test/unittest/app_debug_listener_proxy_test/BUILD.gn index 4fb5f653846..1b24dfb7799 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 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 242dcdef445..7bcc341e9b7 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 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 f2e6ac5eedd..f96411fe7ae 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 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 919aacfa959..0101270c410 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 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 436837abf2d..010015b826c 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 diff --git a/test/unittest/app_mgr_client_test/BUILD.gn b/test/unittest/app_mgr_client_test/BUILD.gn index 841e02899d2..dce07e6590e 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 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 482178787c9..1c2349bb873 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 diff --git a/test/unittest/app_preloader_test/BUILD.gn b/test/unittest/app_preloader_test/BUILD.gn index 5621e4646a7..d7ef4044942 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 diff --git a/test/unittest/app_service_extension_context_test/BUILD.gn b/test/unittest/app_service_extension_context_test/BUILD.gn index cdd7169e193..8affea4ae64 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 diff --git a/test/unittest/app_state_observer_manager_test/BUILD.gn b/test/unittest/app_state_observer_manager_test/BUILD.gn index 39dea9ed1a6..7213a5762d0 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 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 ade8f768119..fd054835268 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 diff --git a/test/unittest/call_record_test/BUILD.gn b/test/unittest/call_record_test/BUILD.gn index e4daaef3a3f..e0a4790d7ca 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 diff --git a/test/unittest/data_ability_manager_test/BUILD.gn b/test/unittest/data_ability_manager_test/BUILD.gn index f2937e420c5..2d1908956a8 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 diff --git a/test/unittest/dfr_test/watchdog_test/BUILD.gn b/test/unittest/dfr_test/watchdog_test/BUILD.gn index 101dfcdd974..1b119fb9764 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 diff --git a/test/unittest/mission_list_test/BUILD.gn b/test/unittest/mission_list_test/BUILD.gn index 0bb8ffad82a..65a64913010 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 diff --git a/test/unittest/pending_want_test/BUILD.gn b/test/unittest/pending_want_test/BUILD.gn index 2484d92cfff..db803aab578 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 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 f8d3d42a711..f9bf19ec8ee 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 diff --git a/test/unittest/service_extension_context_test/BUILD.gn b/test/unittest/service_extension_context_test/BUILD.gn index 19ddf2b1f00..23dbc979e4d 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 diff --git a/test/unittest/stop_user_callback_proxy_test/BUILD.gn b/test/unittest/stop_user_callback_proxy_test/BUILD.gn index 3196f493de2..20c03e2ac26 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 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 6ac8b3fcddd..2318c78e8f5 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 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 d212a591345..4c7456b7757 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 diff --git a/test/unittest/stop_user_callback_stub_test/BUILD.gn b/test/unittest/stop_user_callback_stub_test/BUILD.gn index 45eeb3c27e8..dab1f292a8f 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 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 bc333ec6168..c7a64817d19 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 @@ -70,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"; } @@ -87,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"; } @@ -108,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/unlock_screen_test/BUILD.gn b/test/unittest/unlock_screen_test/BUILD.gn index 84a3f1dd9b0..7e6f119e246 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 diff --git a/test/unittest/user_controller_test/BUILD.gn b/test/unittest/user_controller_test/BUILD.gn index 945794b6c8a..120a32b4bfa 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 diff --git a/test/unittest/user_controller_test/user_controller_test.cpp b/test/unittest/user_controller_test/user_controller_test.cpp index f2abcf77474..9b4710642f8 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 diff --git a/test/unittest/want_sender_info_test/BUILD.gn b/test/unittest/want_sender_info_test/BUILD.gn index d2dc36e2be3..fed944b2617 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 diff --git a/tools/aa/BUILD.gn b/tools/aa/BUILD.gn index 52b9f65b2ea..f04905ae222 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 -- Gitee From 9cae50fa2fb53e1cfc038e0324ea22c83ed75520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Tue, 10 Jun 2025 16:10:31 +0000 Subject: [PATCH 05/15] update interfaces/inner_api/app_manager/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- interfaces/inner_api/app_manager/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/interfaces/inner_api/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index 003157d3e04..59318b86d69 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_manager/BUILD.gn @@ -230,6 +230,7 @@ ohos_shared_library("app_manager") { 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", -- Gitee From 1e666e31b3e0f5b7c5ad3bd75cae236b05dc84af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Wed, 11 Jun 2025 09:42:02 +0000 Subject: [PATCH 06/15] update services/abilitymgr/src/ability_debug_deal.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- services/abilitymgr/src/ability_debug_deal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/abilitymgr/src/ability_debug_deal.cpp b/services/abilitymgr/src/ability_debug_deal.cpp index 6a41c648b3a..7065cb9492e 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 -- Gitee From 5223b31b6fdb3fe751b815ff70e304993c55d259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Wed, 11 Jun 2025 09:42:56 +0000 Subject: [PATCH 07/15] update services/appmgr/include/app_debug_manager.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- services/appmgr/include/app_debug_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/appmgr/include/app_debug_manager.h b/services/appmgr/include/app_debug_manager.h index d5203399e10..aae9db220db 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 -- Gitee From bd8b82538e192d3b6a321eb1797371e0ac23ceae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Wed, 11 Jun 2025 09:47:12 +0000 Subject: [PATCH 08/15] update services/appmgr/include/app_running_manager.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- services/appmgr/include/app_running_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/appmgr/include/app_running_manager.h b/services/appmgr/include/app_running_manager.h index 5fe6b246d30..061d13f2cd6 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 -- Gitee From c0953fab0caf282a4ccca0b85d2e802cd785afe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Wed, 11 Jun 2025 09:58:12 +0000 Subject: [PATCH 09/15] update test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../abilitydebugresponseproxy_fuzzer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp b/test/fuzztest/abilitydebugresponseproxy_fuzzer/abilitydebugresponseproxy_fuzzer.cpp index a81ad49bebd..04bd6c2cf48 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 -- Gitee From 911d1c1d8c9093f6bd75c7a91f4a35cd237fedd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Wed, 11 Jun 2025 19:51:32 +0800 Subject: [PATCH 10/15] =?UTF-8?q?description:idl=E5=8C=96=E9=80=82?= =?UTF-8?q?=E9=85=8Dtdd=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../app_mgr_service_inner_ninth_test.cpp | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) 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 ebbdfb05c52..32cfc10535a 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; -- Gitee From 6ae2edfdd43d5b3bc9e5948e3fc84970a45263ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Thu, 12 Jun 2025 12:22:25 +0800 Subject: [PATCH 11/15] =?UTF-8?q?codecheck=E4=BF=AE=E6=94=B9=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../ability_manager/include/ability_manager_errors.h | 5 +++++ services/abilitymgr/src/ability_debug_deal.cpp | 12 ++++++------ .../quick_fix_manager_service_test/BUILD.gn | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) 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 87c485af117..08b2c5c6ace 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/services/abilitymgr/src/ability_debug_deal.cpp b/services/abilitymgr/src/ability_debug_deal.cpp index 7065cb9492e..236b88d2721 100644 --- a/services/abilitymgr/src/ability_debug_deal.cpp +++ b/services/abilitymgr/src/ability_debug_deal.cpp @@ -78,13 +78,13 @@ ErrCode AbilityDebugResponse::OnAbilitysDebugStarted(const std::vectorOnAbilitysDebugStarted(tokens); return ERR_OK; @@ -94,13 +94,13 @@ ErrCode AbilityDebugResponse::OnAbilitysDebugStoped(const std::vectorOnAbilitysDebugStoped(tokens); return ERR_OK; @@ -111,13 +111,13 @@ ErrCode AbilityDebugResponse::OnAbilitysAssertDebugChange( { if (tokens.empty()) { TAG_LOGW(AAFwkTag::ABILITYMGR, "tokens empty"); - return ERR_INVALID_DATA; + return ERR_ABILITY_DEBUG_EMPTY_TOKENS; } auto deal = abilityDebugDeal_.lock(); if (deal == nullptr) { TAG_LOGW(AAFwkTag::ABILITYMGR, "deal null"); - return ERR_INVALID_DATA; + return INNER_ERR; } deal->OnAbilitysAssertDebugChange(tokens, isAssertDebug); return ERR_OK; 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 f9bf19ec8ee..02947579ff5 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 @@ -72,6 +72,7 @@ ohos_unittest("quick_fix_manager_apply_task_test") { 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", -- Gitee From 8ce1484227f99b9178a828ae25dc38cbf95c090b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=BB=B4?= Date: Sat, 14 Jun 2025 18:05:05 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9tdd=E9=80=82=E9=85=8Did?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 查维 --- .../app_mgr_service_inner_tenth_test.cpp | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 74b33289f77..9a2572f60e3 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; -- Gitee From 4280cdcd9ed24c83e94844abc830bc0f2e99cb53 Mon Sep 17 00:00:00 2001 From: 18795846185 Date: Mon, 16 Jun 2025 14:15:54 +0800 Subject: [PATCH 13/15] del user_callback_proxy Signed-off-by: 18795846185 --- test/unittest/ability_manager_service_second_test/BUILD.gn | 1 - test/unittest/ability_manager_service_third_test/abilitymgr.gni | 1 - 2 files changed, 2 deletions(-) diff --git a/test/unittest/ability_manager_service_second_test/BUILD.gn b/test/unittest/ability_manager_service_second_test/BUILD.gn index 66bf430e809..7f465d889ad 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 571d2a93527..af9117bf388 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", -- Gitee From 469c29aa2933cda31120ff5c95699b933f53126e Mon Sep 17 00:00:00 2001 From: 18795846185 Date: Mon, 16 Jun 2025 14:24:46 +0800 Subject: [PATCH 14/15] IKiaInterceptor.idl Signed-off-by: 18795846185 --- interfaces/inner_api/app_manager/BUILD.gn | 6 +- .../IKiaInterceptor.idl} | 39 +------- .../IQuickFixCallback.idl} | 31 ++----- .../include/appmgr/app_mgr_interface.h | 2 +- .../include/appmgr/kia_interceptor_proxy.h | 66 ------------- .../include/appmgr/kia_interceptor_stub.h | 68 -------------- .../include/appmgr/quick_fix_callback_proxy.h | 40 -------- .../include/appmgr/quick_fix_callback_stub.h | 44 --------- .../src/appmgr/kia_interceptor_proxy.cpp | 67 ------------- .../src/appmgr/kia_interceptor_stub.cpp | 59 ------------ .../src/appmgr/quick_fix_callback_proxy.cpp | 93 ------------------- .../src/appmgr/quick_fix_callback_stub.cpp | 71 -------------- .../appmgr/include/app_mgr_service_inner.h | 2 +- .../include/quick_fix_callback_with_record.h | 8 +- .../src/quick_fix_callback_with_record.cpp | 11 ++- .../src/quick_fix_manager_apply_task.cpp | 33 ++++--- .../include/mock_kia_interceptor.h | 6 +- .../include/mock_kia_interceptor.h | 6 +- .../ui_extension_stability_test/BUILD.gn | 8 +- test/unittest/ams_ipc_interface_test/BUILD.gn | 6 +- .../mock/include/mock_iapp_mgr.h | 2 +- .../app_mgr_proxy_test/app_mgr_proxy_test.cpp | 11 ++- .../app_mgr_service_inner_eighth_test.cpp | 4 +- .../app_mgr_service_inner_mock_test/BUILD.gn | 6 +- .../include/mock_app_mgr_service_inner.h | 4 +- .../include/mock_kia_interceptor_impl.h | 4 +- .../src/mock_kia_interceptor_impl.cpp | 4 +- .../app_mgr_service_inner_second_test.cpp | 4 +- .../app_running_manager_second_test.cpp | 20 ++-- .../main_fourth_test/main_fourth_test.cpp | 11 ++- .../main_thread_test/main_thread_test.cpp | 11 ++- .../include/mock_quick_fix_callback_stub.h | 8 +- .../quick_fix_callback_proxy_test.cpp | 8 +- .../quick_fix_callback_stub_test.cpp | 12 +-- .../quick_fix_callback_with_record_test.cpp | 11 ++- 35 files changed, 132 insertions(+), 654 deletions(-) rename interfaces/inner_api/app_manager/{include/appmgr/kia_interceptor_interface.h => idl/IKiaInterceptor.idl} (39%) rename interfaces/inner_api/app_manager/{include/appmgr/iquick_fix_callback.h => idl/IQuickFixCallback.idl} (37%) delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_proxy.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_stub.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_proxy.h delete mode 100644 interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_stub.h delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_proxy.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_stub.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_proxy.cpp delete mode 100644 interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_stub.cpp diff --git a/interfaces/inner_api/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index 59318b86d69..e31cb7a8462 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_manager/BUILD.gn @@ -45,6 +45,8 @@ idl_gen_interface("appmgr_innerkits") { sources = [ "idl/IAbilityDebugResponse.idl", "idl/IAppDebugListener.idl", + "idl/IKiaInterceptor.idl", + "idl/IQuickFixCallback.idl", "idl/IStartSpecifiedAbilityResponse.idl", ] log_domainid = "0xD001311" @@ -202,8 +204,6 @@ ohos_shared_library("app_manager") { "src/appmgr/configuration_observer_stub.cpp", "src/appmgr/configuration_policy.cpp", "src/appmgr/fault_data.cpp", - "src/appmgr/kia_interceptor_proxy.cpp", - "src/appmgr/kia_interceptor_stub.cpp", "src/appmgr/killed_process_info.cpp", "src/appmgr/memory_level_info.cpp", "src/appmgr/native_child_notify_proxy.cpp", @@ -214,8 +214,6 @@ ohos_shared_library("app_manager") { "src/appmgr/process_info.cpp", "src/appmgr/process_memory_state.cpp", "src/appmgr/profile.cpp", - "src/appmgr/quick_fix_callback_proxy.cpp", - "src/appmgr/quick_fix_callback_stub.cpp", "src/appmgr/render_process_info.cpp", "src/appmgr/render_scheduler_host.cpp", "src/appmgr/render_scheduler_proxy.cpp", diff --git a/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_interface.h b/interfaces/inner_api/app_manager/idl/IKiaInterceptor.idl similarity index 39% rename from interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_interface.h rename to interfaces/inner_api/app_manager/idl/IKiaInterceptor.idl index 52dc49e2bbd..80564f2c441 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_interface.h +++ b/interfaces/inner_api/app_manager/idl/IKiaInterceptor.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 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,37 +13,8 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_INTERFACE_H -#define OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_INTERFACE_H +sequenceable want..OHOS.AAFwk.Want; -#include - -#include "want.h" - -namespace OHOS { -namespace AppExecFwk { -/** - * @class IKiaInterceptor - * IPC interface for KIA. - */ -class IKiaInterceptor : public OHOS::IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.IKiaInterceptor"); - - /** - * OnIntercept, processing method from KIA. - * - * @param want The param of openning the app. - * @return Error code of calling the function. - */ - virtual int OnIntercept(AAFwk::Want &want) = 0; - - enum { - // ipc code for calling OnIntercept - KIA_INTERCEPTOR_ON_INTERCEPT = 0, - }; -}; -} // namespace AppExecFwk -} // namespace OHOS - -#endif // OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_INTERFACE_H +interface OHOS.AppExecFwk.IKiaInterceptor { + void OnIntercept([inout] Want want); +} \ No newline at end of file diff --git a/interfaces/inner_api/app_manager/include/appmgr/iquick_fix_callback.h b/interfaces/inner_api/app_manager/idl/IQuickFixCallback.idl similarity index 37% rename from interfaces/inner_api/app_manager/include/appmgr/iquick_fix_callback.h rename to interfaces/inner_api/app_manager/idl/IQuickFixCallback.idl index f2e45b845d6..63a31421cdb 100644 --- a/interfaces/inner_api/app_manager/include/appmgr/iquick_fix_callback.h +++ b/interfaces/inner_api/app_manager/idl/IQuickFixCallback.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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,27 +13,8 @@ * limitations under the License. */ -#ifndef OHOS_ABILITY_RUNTIME_IQUICK_FIX_CALLBACK_H -#define OHOS_ABILITY_RUNTIME_IQUICK_FIX_CALLBACK_H - -#include "iremote_broker.h" - -namespace OHOS { -namespace AppExecFwk { -class IQuickFixCallback : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.QuickFixCallback"); - - virtual void OnLoadPatchDone(int32_t resultCode, int32_t recordId) = 0; - virtual void OnUnloadPatchDone(int32_t resultCode, int32_t recordId) = 0; - virtual void OnReloadPageDone(int32_t resultCode, int32_t recordId) = 0; - - enum QuickFixCallbackCmd { - ON_NOTIFY_LOAD_PATCH = 0, // ipc id for OnLoadPatchDone - ON_NOTIFY_UNLOAD_PATCH = 1, // ipc id for OnUnloadPatchDone - ON_NOTIFY_RELOAD_PAGE = 2, // ipc id for OnReloadPageDone - }; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_IQUICK_FIX_CALLBACK_H +interface OHOS.AppExecFwk.IQuickFixCallback { + void OnLoadPatchDone([in] int resultCode, [in] int recordId); + void OnUnloadPatchDone([in] int resultCode, [in] int recordId); + void OnReloadPageDone([in] int resultCode, [in] int recordId); +} \ No newline at end of file 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 f0d1dbfabbf..99a765c85a6 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 @@ -32,10 +32,10 @@ #include "child_process_request.h" #endif // SUPPORT_CHILD_PROCESS #include "fault_data.h" -#include "kia_interceptor_interface.h" #include "iapp_state_callback.h" #include "iapplication_state_observer.h" #include "iconfiguration_observer.h" +#include "ikia_interceptor.h" #include "iquick_fix_callback.h" #include "iremote_broker.h" #include "iremote_object.h" diff --git a/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_proxy.h deleted file mode 100644 index 328ac436beb..00000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_proxy.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_PROXY_H -#define OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_PROXY_H - -#include "kia_interceptor_interface.h" - -#include - -namespace OHOS { -namespace AppExecFwk { -/** - * @class KiaInterceptorProxy - * IPC proxy of IKiaInterceptor. - */ -class KiaInterceptorProxy : public IRemoteProxy { -public: - /** - * KiaInterceptorProxy, constructor. - * - * @param impl The implementation of IKiaInterceptor. - */ - explicit KiaInterceptorProxy(const sptr &impl) : IRemoteProxy(impl) - {} - - /** - * KiaInterceptorProxy, destructor. - * - */ - virtual ~KiaInterceptorProxy() - {} - - /** - * OnIntercept, processing method from KIA. - * - * @param want The param of openning the app. - */ - virtual int OnIntercept(AAFwk::Want &want) override; - -private: - /** - * WriteInterfaceToken. - * - * @param data The message parcel data. - * @return Flag whether write is successful. - */ - bool WriteInterfaceToken(MessageParcel &data); - - static inline BrokerDelegator delegator_; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_PROXY_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_stub.h b/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_stub.h deleted file mode 100644 index 784a3d80ebd..00000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/kia_interceptor_stub.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_STUB_H -#define OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_STUB_H - -#include "kia_interceptor_interface.h" - -#include -#include - -namespace OHOS { -namespace AppExecFwk { -/** - * @class KiaInterceptorStub - * IPC stub of IKiaInterceptor. - */ -class KiaInterceptorStub : public IRemoteStub { -public: - /** - * KiaInterceptorStub, constructor. - * - */ - KiaInterceptorStub(); - - /** - * KiaInterceptorStub, destructor. - * - */ - virtual ~KiaInterceptorStub(); - - /** - * OnRemoteRequest, IPC method. - * - * @param code The IPC code. - * @param data The message parcel data. - * @param reply The message parcel reply. - * @param option The message parcel option. - * @return Error code of calling the function. - */ - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - /** - * OnInterceptInner, inner processing method from KIA. - * - * @param data The message parcel data. - * @param reply The message parcel reply. - * @return Error code of calling the function. - */ - int OnInterceptInner(MessageParcel &data, MessageParcel &reply); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_KIA_INTERCEPTOR_STUB_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_proxy.h b/interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_proxy.h deleted file mode 100644 index d2daba0fea1..00000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_proxy.h +++ /dev/null @@ -1,40 +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_QUICK_FIX_CALLBACK_PROXY_H -#define OHOS_ABILITY_RUNTIME_QUICK_FIX_CALLBACK_PROXY_H - -#include "iquick_fix_callback.h" -#include "iremote_proxy.h" - -namespace OHOS { -namespace AppExecFwk { -class QuickFixCallbackProxy : public IRemoteProxy { -public: - explicit QuickFixCallbackProxy(const sptr &impl) : IRemoteProxy(impl) {}; - virtual ~QuickFixCallbackProxy() = default; - - void OnLoadPatchDone(int32_t resultCode, int32_t recordId) override; - void OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override; - void OnReloadPageDone(int32_t resultCode, int32_t recordId) override; - -private: - bool SendRequestWithCmd(uint32_t code, MessageParcel &data, MessageParcel &reply); - - static inline BrokerDelegator delegator_; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_QUICK_FIX_CALLBACK_PROXY_H diff --git a/interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_stub.h b/interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_stub.h deleted file mode 100644 index 9dcf43da589..00000000000 --- a/interfaces/inner_api/app_manager/include/appmgr/quick_fix_callback_stub.h +++ /dev/null @@ -1,44 +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_QUICK_FIX_CALLBACK_STUB_H -#define OHOS_ABILITY_RUNTIME_QUICK_FIX_CALLBACK_STUB_H - -#include - -#include "iquick_fix_callback.h" -#include "iremote_stub.h" -#include "message_parcel.h" -#include "nocopyable.h" - -namespace OHOS { -namespace AppExecFwk { -class QuickFixCallbackStub : public IRemoteStub { -public: - QuickFixCallbackStub(); - virtual ~QuickFixCallbackStub(); - - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleOnLoadPatchDoneInner(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnUnloadPatchDoneInner(MessageParcel &data, MessageParcel &reply); - int32_t HandleOnReloadPageDoneInner(MessageParcel &data, MessageParcel &reply); - - DISALLOW_COPY_AND_MOVE(QuickFixCallbackStub); -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_QUICK_FIX_CALLBACK_STUB_H diff --git a/interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_proxy.cpp deleted file mode 100644 index 15f2e759cd4..00000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_proxy.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "kia_interceptor_proxy.h" - -#include "hilog_tag_wrapper.h" -#include "ipc_capacity_wrap.h" - -namespace OHOS { -namespace AppExecFwk { -bool KiaInterceptorProxy::WriteInterfaceToken(MessageParcel &data) -{ - if (!data.WriteInterfaceToken(KiaInterceptorProxy::GetDescriptor())) { - TAG_LOGE(AAFwkTag::APPMGR, "write interface token failed"); - return false; - } - return true; -} - -int KiaInterceptorProxy::OnIntercept(AAFwk::Want &want) -{ - MessageParcel data; - MessageParcel reply; - AAFwk::ExtendMaxIpcCapacityForInnerWant(data); - MessageOption option(MessageOption::TF_SYNC); - if (!WriteInterfaceToken(data)) { - return ERR_INVALID_VALUE; - } - data.WriteParcelable(&want); - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Remote() is NULL"); - return ERR_INVALID_VALUE; - } - int32_t ret = remote->SendRequest(static_cast(IKiaInterceptor::KIA_INTERCEPTOR_ON_INTERCEPT), - data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::APPMGR, "SendRequest is failed, error code: %{public}d.", ret); - return ret; - } - int resultCode = reply.ReadInt32(); - if (resultCode != ERR_OK) { - TAG_LOGE(AAFwkTag::APPMGR, "OnIntercept failed, resultCode=%{public}d.", resultCode); - return resultCode; - } - sptr resultWant = reply.ReadParcelable(); - if (resultWant == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "resultWant is nullptr."); - return ERR_INVALID_VALUE; - } - want = *resultWant; - return resultCode; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_stub.cpp b/interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_stub.cpp deleted file mode 100644 index 96eb5f75048..00000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/kia_interceptor_stub.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "kia_interceptor_stub.h" - -#include "hilog_tag_wrapper.h" - -namespace OHOS { -namespace AppExecFwk { -KiaInterceptorStub::KiaInterceptorStub() {} - -KiaInterceptorStub::~KiaInterceptorStub() {} - -int KiaInterceptorStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - TAG_LOGD(AAFwkTag::APPMGR, "cmd=%d,flags=%d", code, option.GetFlags()); - std::u16string descriptor = KiaInterceptorStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGI(AAFwkTag::APPMGR, "local descriptor is not equal to remote"); - return ERR_INVALID_STATE; - } - - if (code == KIA_INTERCEPTOR_ON_INTERCEPT) { - return OnInterceptInner(data, reply); - } - TAG_LOGW(AAFwkTag::APPMGR, "KiaInterceptorStub::OnRemoteRequest, default case, need check."); - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int KiaInterceptorStub::OnInterceptInner(MessageParcel &data, MessageParcel &reply) -{ - sptr want = data.ReadParcelable(); - int resultCode = OnIntercept(*want); - if (!reply.WriteInt32(resultCode)) { - TAG_LOGE(AAFwkTag::APPMGR, "write resultCode failed."); - return ERR_INVALID_VALUE; - } - if (!reply.WriteParcelable(want)) { - TAG_LOGE(AAFwkTag::APPMGR, "write want failed."); - return ERR_INVALID_VALUE; - } - - return NO_ERROR; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_proxy.cpp deleted file mode 100644 index ed1c8310efa..00000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_proxy.cpp +++ /dev/null @@ -1,93 +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 "quick_fix_callback_proxy.h" - -#include "hilog_tag_wrapper.h" -#include "message_parcel.h" -#include "parcel_macro_base.h" - -namespace OHOS { -namespace AppExecFwk { -void QuickFixCallbackProxy::OnLoadPatchDone(int32_t resultCode, int32_t recordId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - - MessageParcel data; - MessageParcel reply; - WRITE_PARCEL_AND_RETURN(InterfaceToken, data, QuickFixCallbackProxy::GetDescriptor()); - WRITE_PARCEL_AND_RETURN(Int32, data, resultCode); - WRITE_PARCEL_AND_RETURN(Int32, data, recordId); - if (!SendRequestWithCmd(IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_LOAD_PATCH, data, reply)) { - return; - } - - TAG_LOGD(AAFwkTag::APPMGR, "function finished."); - return; -} - -void QuickFixCallbackProxy::OnUnloadPatchDone(int32_t resultCode, int32_t recordId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - - MessageParcel data; - MessageParcel reply; - WRITE_PARCEL_AND_RETURN(InterfaceToken, data, QuickFixCallbackProxy::GetDescriptor()); - WRITE_PARCEL_AND_RETURN(Int32, data, resultCode); - WRITE_PARCEL_AND_RETURN(Int32, data, recordId); - if (!SendRequestWithCmd(IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_UNLOAD_PATCH, data, reply)) { - return; - } - - TAG_LOGD(AAFwkTag::APPMGR, "function finished."); - return; -} - -void QuickFixCallbackProxy::OnReloadPageDone(int32_t resultCode, int32_t recordId) -{ - TAG_LOGD(AAFwkTag::APPMGR, "called"); - - MessageParcel data; - MessageParcel reply; - WRITE_PARCEL_AND_RETURN(InterfaceToken, data, QuickFixCallbackProxy::GetDescriptor()); - WRITE_PARCEL_AND_RETURN(Int32, data, resultCode); - WRITE_PARCEL_AND_RETURN(Int32, data, recordId); - if (!SendRequestWithCmd(IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_RELOAD_PAGE, data, reply)) { - return; - } - - TAG_LOGD(AAFwkTag::APPMGR, "function finished."); - return; -} - -bool QuickFixCallbackProxy::SendRequestWithCmd(uint32_t code, MessageParcel &data, MessageParcel &reply) -{ - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::APPMGR, "Remote is nullptr."); - return false; - } - - MessageOption option(MessageOption::TF_SYNC); - auto ret = remote->SendRequest(code, data, reply, option); - if (ret != 0) { - TAG_LOGE(AAFwkTag::APPMGR, "Send request failed with error %{public}d.", ret); - return false; - } - - return true; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_stub.cpp b/interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_stub.cpp deleted file mode 100644 index e557f4802a5..00000000000 --- a/interfaces/inner_api/app_manager/src/appmgr/quick_fix_callback_stub.cpp +++ /dev/null @@ -1,71 +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 "quick_fix_callback_stub.h" - -#include "hilog_tag_wrapper.h" - -namespace OHOS { -namespace AppExecFwk { -QuickFixCallbackStub::QuickFixCallbackStub() {} - -QuickFixCallbackStub::~QuickFixCallbackStub() {} - -int QuickFixCallbackStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - if (data.ReadInterfaceToken() != IQuickFixCallback::GetDescriptor()) { - TAG_LOGE(AAFwkTag::APPMGR, "local descriptor is not equal to remote."); - return ERR_INVALID_STATE; - } - - switch (code) { - case ON_NOTIFY_LOAD_PATCH: - return HandleOnLoadPatchDoneInner(data, reply); - case ON_NOTIFY_UNLOAD_PATCH: - return HandleOnUnloadPatchDoneInner(data, reply); - case ON_NOTIFY_RELOAD_PAGE: - return HandleOnReloadPageDoneInner(data, reply); - } - - TAG_LOGW(AAFwkTag::APPMGR, "default case, need check value of code!"); - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int32_t QuickFixCallbackStub::HandleOnLoadPatchDoneInner(MessageParcel &data, MessageParcel &reply) -{ - int32_t resultCode = data.ReadInt32(); - int32_t recordId = data.ReadInt32(); - OnLoadPatchDone(resultCode, recordId); - return ERR_OK; -} - -int32_t QuickFixCallbackStub::HandleOnUnloadPatchDoneInner(MessageParcel &data, MessageParcel &reply) -{ - int32_t resultCode = data.ReadInt32(); - int32_t recordId = data.ReadInt32(); - OnUnloadPatchDone(resultCode, recordId); - return ERR_OK; -} - -int32_t QuickFixCallbackStub::HandleOnReloadPageDoneInner(MessageParcel &data, MessageParcel &reply) -{ - int32_t resultCode = data.ReadInt32(); - int32_t recordId = data.ReadInt32(); - OnReloadPageDone(resultCode, recordId); - return ERR_OK; -} -} // namespace AAFwk -} // namespace OHOS diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index 4f4588802e2..dbe861e5cd0 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -61,10 +61,10 @@ #include "iapp_state_callback.h" #include "iapplication_state_observer.h" #include "iconfiguration_observer.h" +#include "ikia_interceptor.h" #include "iremote_object.h" #include "irender_state_observer.h" #include "istart_specified_ability_response.h" -#include "kia_interceptor_interface.h" #include "kill_process_config.h" #include "killed_process_info.h" #include "process_memory_state.h" diff --git a/services/appmgr/include/quick_fix_callback_with_record.h b/services/appmgr/include/quick_fix_callback_with_record.h index cd64bb9f98a..2a8b6665882 100644 --- a/services/appmgr/include/quick_fix_callback_with_record.h +++ b/services/appmgr/include/quick_fix_callback_with_record.h @@ -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 @@ -32,9 +32,9 @@ public: ~QuickFixCallbackWithRecord() override; - void OnLoadPatchDone(int32_t resultCode, int32_t recordId) override; - void OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override; - void OnReloadPageDone(int32_t resultCode, int32_t recordId) override; + ErrCode OnLoadPatchDone(int32_t resultCode, int32_t recordId) override; + ErrCode OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override; + ErrCode OnReloadPageDone(int32_t resultCode, int32_t recordId) override; void AddRecordId(int32_t recordId); void RemoveRecordId(int32_t recordId); diff --git a/services/appmgr/src/quick_fix_callback_with_record.cpp b/services/appmgr/src/quick_fix_callback_with_record.cpp index 877e2148924..f9e18dbf904 100644 --- a/services/appmgr/src/quick_fix_callback_with_record.cpp +++ b/services/appmgr/src/quick_fix_callback_with_record.cpp @@ -1,5 +1,5 @@ /* - * 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 @@ -24,31 +24,34 @@ QuickFixCallbackWithRecord::~QuickFixCallbackWithRecord() TAG_LOGD(AAFwkTag::APPMGR, "destroyed."); } -void QuickFixCallbackWithRecord::OnLoadPatchDone(int32_t resultCode, int32_t recordId) +ErrCode QuickFixCallbackWithRecord::OnLoadPatchDone(int32_t resultCode, int32_t recordId) { TAG_LOGD(AAFwkTag::APPMGR, "called"); ProcessCallback(resultCode, recordId); if (IsRecordListEmpty() && callback_ != nullptr) { callback_->OnLoadPatchDone(finalResult.load(), recordId); } + return ERR_OK; } -void QuickFixCallbackWithRecord::OnUnloadPatchDone(int32_t resultCode, int32_t recordId) +ErrCode QuickFixCallbackWithRecord::OnUnloadPatchDone(int32_t resultCode, int32_t recordId) { TAG_LOGD(AAFwkTag::APPMGR, "called"); ProcessCallback(resultCode, recordId); if (IsRecordListEmpty() && callback_ != nullptr) { callback_->OnUnloadPatchDone(finalResult.load(), recordId); } + return ERR_OK; } -void QuickFixCallbackWithRecord::OnReloadPageDone(int32_t resultCode, int32_t recordId) +ErrCode QuickFixCallbackWithRecord::OnReloadPageDone(int32_t resultCode, int32_t recordId) { TAG_LOGD(AAFwkTag::APPMGR, "called"); ProcessCallback(resultCode, recordId); if (IsRecordListEmpty() && callback_ != nullptr) { callback_->OnReloadPageDone(finalResult.load(), recordId); } + return ERR_OK; } void QuickFixCallbackWithRecord::ProcessCallback(int32_t resultCode, int32_t recordId) diff --git a/services/quickfixmgr/src/quick_fix_manager_apply_task.cpp b/services/quickfixmgr/src/quick_fix_manager_apply_task.cpp index 86d3df61ded..7235fc4bf38 100644 --- a/services/quickfixmgr/src/quick_fix_manager_apply_task.cpp +++ b/services/quickfixmgr/src/quick_fix_manager_apply_task.cpp @@ -1,5 +1,5 @@ /* - * 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 @@ -235,52 +235,55 @@ public: TAG_LOGD(AAFwkTag::QUICKFIX, "destroyed"); } - void OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + ErrCode OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override { TAG_LOGD(AAFwkTag::QUICKFIX, "called"); if (resultCode != 0) { TAG_LOGE(AAFwkTag::QUICKFIX, "notify patch failed: %{public}d", resultCode); applyTask_->NotifyApplyStatus(QUICK_FIX_NOTIFY_LOAD_PATCH_FAILED); applyTask_->RemoveSelf(); - return; + return ERR_INVALID_VALUE; } applyTask_->PostDeleteQuickFixTask(); + return ERR_OK; } - void OnUnloadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + ErrCode OnUnloadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override { TAG_LOGD(AAFwkTag::QUICKFIX, "called"); if (resultCode != 0) { TAG_LOGE(AAFwkTag::QUICKFIX, "notify patch failed: %{public}d", resultCode); applyTask_->NotifyApplyStatus(QUICK_FIX_NOTIFY_UNLOAD_PATCH_FAILED); applyTask_->RemoveSelf(); - return; + return ERR_INVALID_VALUE; } if (applyTask_->GetTaskType() == QuickFixManagerApplyTask::TaskType::QUICK_FIX_APPLY) { applyTask_->PostSwitchQuickFixTask(); - return; + return ERR_OK; } else if (applyTask_->GetTaskType() == QuickFixManagerApplyTask::TaskType::QUICK_FIX_REVOKE) { applyTask_->PostRevokeQuickFixDeleteTask(); - return; + return ERR_OK; } TAG_LOGW(AAFwkTag::QUICKFIX, "Invalid task type"); + return ERR_OK; } - void OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + ErrCode OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override { TAG_LOGD(AAFwkTag::QUICKFIX, "called"); if (resultCode != 0) { TAG_LOGE(AAFwkTag::QUICKFIX, "notify app load patch failed: %{public}d", resultCode); applyTask_->NotifyApplyStatus(QUICK_FIX_NOTIFY_RELOAD_PAGE_FAILED); applyTask_->RemoveSelf(); - return; + return ERR_INVALID_VALUE; } applyTask_->NotifyApplyStatus(QUICK_FIX_OK); applyTask_->RemoveSelf(); + return ERR_OK; } private: @@ -295,11 +298,15 @@ public: virtual ~RevokeQuickFixNotifyCallback() = default; - void OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override - {} + ErrCode OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + { + return ERR_OK; + } - void OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override - {} + ErrCode OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + { + return ERR_OK; + } }; QuickFixManagerApplyTask::~QuickFixManagerApplyTask() diff --git a/test/mock/mock_appmgr_service/include/mock_kia_interceptor.h b/test/mock/mock_appmgr_service/include/mock_kia_interceptor.h index 99dd0a835c0..294e9dfc6fa 100644 --- a/test/mock/mock_appmgr_service/include/mock_kia_interceptor.h +++ b/test/mock/mock_appmgr_service/include/mock_kia_interceptor.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 @@ -28,9 +28,9 @@ public: MockKiaInterceptor() {} virtual ~MockKiaInterceptor() = default; - int OnIntercept(AAFwk::Want &want) override + ErrCode OnIntercept(AAFwk::Want &want) override { - return 0; + return ERR_OK; } }; } // namespace AppExecFwk diff --git a/test/mock/services_appmgr_test/include/mock_kia_interceptor.h b/test/mock/services_appmgr_test/include/mock_kia_interceptor.h index 99dd0a835c0..092f5af6c20 100644 --- a/test/mock/services_appmgr_test/include/mock_kia_interceptor.h +++ b/test/mock/services_appmgr_test/include/mock_kia_interceptor.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 @@ -28,9 +28,9 @@ public: MockKiaInterceptor() {} virtual ~MockKiaInterceptor() = default; - int OnIntercept(AAFwk::Want &want) override + ErrCode OnIntercept(AAFwk::Want &want) override { - return 0; + return ERR_OK; } }; } // namespace AppExecFwk diff --git a/test/moduletest/ui_extension_ability_test/ui_extension_stability_test/BUILD.gn b/test/moduletest/ui_extension_ability_test/ui_extension_stability_test/BUILD.gn index 77a731074b6..678239368c0 100644 --- a/test/moduletest/ui_extension_ability_test/ui_extension_stability_test/BUILD.gn +++ b/test/moduletest/ui_extension_ability_test/ui_extension_stability_test/BUILD.gn @@ -18,6 +18,12 @@ import("//foundation/ability/ability_runtime/ability_runtime.gni") ohos_moduletest("ui_extension_stability_test") { module_out_path = "ability_runtime/ability_runtime/ui_extension" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + include_dirs = [ "../include", "${ability_runtime_test_path}/mock/mock_sa_call", @@ -49,8 +55,8 @@ ohos_moduletest("ui_extension_stability_test") { "access_token:libtoken_setproc", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", - "c_utils:utils", "cJSON:cjson_static", + "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "googletest:gmock_main", diff --git a/test/unittest/ams_ipc_interface_test/BUILD.gn b/test/unittest/ams_ipc_interface_test/BUILD.gn index 4265e2f8404..7de5dadff38 100644 --- a/test/unittest/ams_ipc_interface_test/BUILD.gn +++ b/test/unittest/ams_ipc_interface_test/BUILD.gn @@ -28,7 +28,11 @@ ohos_unittest("AmsIpcAppSchedulerInterfaceTest") { if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ "${ability_runtime_test_path}/unittest:appmgr_test_source" ] + deps = [ + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_native_path}/appkit:appkit_native", + "${ability_runtime_test_path}/unittest:appmgr_test_source", + ] external_deps = [ "ability_base:base", diff --git a/test/unittest/app_exit_reason_helper_fourth_test/mock/include/mock_iapp_mgr.h b/test/unittest/app_exit_reason_helper_fourth_test/mock/include/mock_iapp_mgr.h index 027540709f7..98065698790 100644 --- a/test/unittest/app_exit_reason_helper_fourth_test/mock/include/mock_iapp_mgr.h +++ b/test/unittest/app_exit_reason_helper_fourth_test/mock/include/mock_iapp_mgr.h @@ -34,11 +34,11 @@ #include "iapp_state_callback.h" #include "iapplication_state_observer.h" #include "iconfiguration_observer.h" +#include "ikia_interceptor.h" #include "iquick_fix_callback.h" #include "iremote_broker.h" #include "iremote_object.h" #include "irender_state_observer.h" -#include "kia_interceptor_interface.h" #include "killed_process_info.h" #include "memory_level_info.h" #include "page_state_data.h" diff --git a/test/unittest/app_mgr_proxy_test/app_mgr_proxy_test.cpp b/test/unittest/app_mgr_proxy_test/app_mgr_proxy_test.cpp index dcc5295348f..355a0d846fc 100644 --- a/test/unittest/app_mgr_proxy_test/app_mgr_proxy_test.cpp +++ b/test/unittest/app_mgr_proxy_test/app_mgr_proxy_test.cpp @@ -1,5 +1,5 @@ /* - * 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 @@ -56,19 +56,22 @@ public: QuickFixCallbackImpl() = default; virtual ~QuickFixCallbackImpl() = default; - void OnLoadPatchDone(int32_t resultCode, int32_t recordId) override + ErrCode OnLoadPatchDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } - void OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override + ErrCode OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } - void OnReloadPageDone(int32_t resultCode, int32_t recordId) override + ErrCode OnReloadPageDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } }; 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 d6b2b7fe7bf..a683251b8bc 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 @@ -54,9 +54,9 @@ public: }; class MyKiaInterceptor : public IKiaInterceptor { public: - int OnIntercept(AAFwk::Want &want) override + ErrCode OnIntercept(AAFwk::Want &want) override { - return 0; + return ERR_OK; } sptr AsObject() override diff --git a/test/unittest/app_mgr_service_inner_mock_test/BUILD.gn b/test/unittest/app_mgr_service_inner_mock_test/BUILD.gn index 2ac11e3423a..ad8b946b92e 100644 --- a/test/unittest/app_mgr_service_inner_mock_test/BUILD.gn +++ b/test/unittest/app_mgr_service_inner_mock_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,8 +33,6 @@ ohos_unittest("app_mgr_service_inner_mock_test") { ] sources = [ - "${ability_runtime_innerkits_path}/app_manager/src/appmgr/kia_interceptor_proxy.cpp", - "${ability_runtime_innerkits_path}/app_manager/src/appmgr/kia_interceptor_stub.cpp", "app_mgr_service_inner_mock_test.cpp", "src/app_utils.cpp", "src/mock_app_mgr_service_inner.cpp", @@ -43,7 +41,7 @@ ohos_unittest("app_mgr_service_inner_mock_test") { "src/window_manager.cpp", ] - deps = [] + deps = [ "${ability_runtime_innerkits_path}/app_manager:app_manager" ] external_deps = [ "ability_base:want", diff --git a/test/unittest/app_mgr_service_inner_mock_test/include/mock_app_mgr_service_inner.h b/test/unittest/app_mgr_service_inner_mock_test/include/mock_app_mgr_service_inner.h index 4643203e841..9346c35a917 100644 --- a/test/unittest/app_mgr_service_inner_mock_test/include/mock_app_mgr_service_inner.h +++ b/test/unittest/app_mgr_service_inner_mock_test/include/mock_app_mgr_service_inner.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 @@ -18,7 +18,7 @@ #include "app_running_manager.h" #include "app_running_record.h" -#include "kia_interceptor_interface.h" +#include "ikia_interceptor.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/unittest/app_mgr_service_inner_mock_test/include/mock_kia_interceptor_impl.h b/test/unittest/app_mgr_service_inner_mock_test/include/mock_kia_interceptor_impl.h index 7cc6e045531..d6a23ffc789 100644 --- a/test/unittest/app_mgr_service_inner_mock_test/include/mock_kia_interceptor_impl.h +++ b/test/unittest/app_mgr_service_inner_mock_test/include/mock_kia_interceptor_impl.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 @@ -31,7 +31,7 @@ public: static int onInterceptRetCode; static std::string kiaWatermarkBusinessName; static bool isWatermarkEnabled; - virtual int OnIntercept(AAFwk::Want &want) override; + virtual ErrCode OnIntercept(AAFwk::Want &want) override; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/test/unittest/app_mgr_service_inner_mock_test/src/mock_kia_interceptor_impl.cpp b/test/unittest/app_mgr_service_inner_mock_test/src/mock_kia_interceptor_impl.cpp index 0ccd59da340..1a7bf5872b2 100644 --- a/test/unittest/app_mgr_service_inner_mock_test/src/mock_kia_interceptor_impl.cpp +++ b/test/unittest/app_mgr_service_inner_mock_test/src/mock_kia_interceptor_impl.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 @@ -23,7 +23,7 @@ int MockKiaInterceptorImpl::onInterceptRetCode = 0; std::string MockKiaInterceptorImpl::kiaWatermarkBusinessName; bool MockKiaInterceptorImpl::isWatermarkEnabled = false; -int MockKiaInterceptorImpl::OnIntercept(AAFwk::Want &want) +ErrCode MockKiaInterceptorImpl::OnIntercept(AAFwk::Want &want) { if (onInterceptRetCode != 0) { return onInterceptRetCode; diff --git a/test/unittest/app_mgr_service_inner_second_test/app_mgr_service_inner_second_test.cpp b/test/unittest/app_mgr_service_inner_second_test/app_mgr_service_inner_second_test.cpp index b65ae0f706e..3b749f1c9c0 100644 --- a/test/unittest/app_mgr_service_inner_second_test/app_mgr_service_inner_second_test.cpp +++ b/test/unittest/app_mgr_service_inner_second_test/app_mgr_service_inner_second_test.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 @@ -133,7 +133,7 @@ class IKiaInterceptorTest : public IKiaInterceptor { public: IKiaInterceptorTest() = default; virtual ~IKiaInterceptorTest() = default; - int OnIntercept(AAFwk::Want &want) override { return 0; } + ErrCode OnIntercept(AAFwk::Want &want) override { return ERR_OK; } }; /** diff --git a/test/unittest/app_running_manager_second_test/app_running_manager_second_test.cpp b/test/unittest/app_running_manager_second_test/app_running_manager_second_test.cpp index c253b23dbea..630de599030 100644 --- a/test/unittest/app_running_manager_second_test/app_running_manager_second_test.cpp +++ b/test/unittest/app_running_manager_second_test/app_running_manager_second_test.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 @@ -48,14 +48,20 @@ public: QuickFixCallbackImpl() = default; virtual ~QuickFixCallbackImpl() = default; - void OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override - {} + ErrCode OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + { + return ERR_OK; + } - void OnUnloadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override - {} + ErrCode OnUnloadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + { + return ERR_OK; + } - void OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override - {} + ErrCode OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + { + return ERR_OK; + } }; } diff --git a/test/unittest/appkit/main_fourth_test/main_fourth_test.cpp b/test/unittest/appkit/main_fourth_test/main_fourth_test.cpp index afeaf72e9b7..bfbdecfedb3 100644 --- a/test/unittest/appkit/main_fourth_test/main_fourth_test.cpp +++ b/test/unittest/appkit/main_fourth_test/main_fourth_test.cpp @@ -1,5 +1,5 @@ /* - * 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 @@ -43,19 +43,22 @@ public: QuickFixCallbackImpl() = default; virtual ~QuickFixCallbackImpl() = default; - void OnLoadPatchDone(int32_t resultCode, int32_t recordId) override + ErrCode OnLoadPatchDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } - void OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override + ErrCode OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } - void OnReloadPageDone(int32_t resultCode, int32_t recordId) override + ErrCode OnReloadPageDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } }; diff --git a/test/unittest/appkit/main_thread_test/main_thread_test.cpp b/test/unittest/appkit/main_thread_test/main_thread_test.cpp index ac1a95f76c5..4541ef62154 100644 --- a/test/unittest/appkit/main_thread_test/main_thread_test.cpp +++ b/test/unittest/appkit/main_thread_test/main_thread_test.cpp @@ -1,5 +1,5 @@ /* - * 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 @@ -42,19 +42,22 @@ public: QuickFixCallbackImpl() = default; virtual ~QuickFixCallbackImpl() = default; - void OnLoadPatchDone(int32_t resultCode, int32_t recordId) override + ErrCode OnLoadPatchDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } - void OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override + ErrCode OnUnloadPatchDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } - void OnReloadPageDone(int32_t resultCode, int32_t recordId) override + ErrCode OnReloadPageDone(int32_t resultCode, int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); + return ERR_OK; } }; diff --git a/test/unittest/quick_fix/mock/include/mock_quick_fix_callback_stub.h b/test/unittest/quick_fix/mock/include/mock_quick_fix_callback_stub.h index 17b49464e13..835c4a1801e 100644 --- a/test/unittest/quick_fix/mock/include/mock_quick_fix_callback_stub.h +++ b/test/unittest/quick_fix/mock/include/mock_quick_fix_callback_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 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,9 @@ namespace AppExecFwk { class MockQuickFixCallbackStub : public QuickFixCallbackStub { public: MOCK_METHOD4(SendRequest, int(uint32_t, MessageParcel&, MessageParcel&, MessageOption&)); - MOCK_METHOD2(OnLoadPatchDone, void(int32_t resultCode, int32_t recordId)); - MOCK_METHOD2(OnUnloadPatchDone, void(int32_t resultCode, int32_t recordId)); - MOCK_METHOD2(OnReloadPageDone, void(int32_t resultCode, int32_t recordId)); + MOCK_METHOD2(OnLoadPatchDone, ErrCode(int32_t resultCode, int32_t recordId)); + MOCK_METHOD2(OnUnloadPatchDone, ErrCode(int32_t resultCode, int32_t recordId)); + MOCK_METHOD2(OnReloadPageDone, ErrCode(int32_t resultCode, int32_t recordId)); int InvokeSendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { diff --git a/test/unittest/quick_fix/quick_fix_callback_proxy_test/quick_fix_callback_proxy_test.cpp b/test/unittest/quick_fix/quick_fix_callback_proxy_test/quick_fix_callback_proxy_test.cpp index 6c96b8d56c0..c142cbd5b57 100644 --- a/test/unittest/quick_fix/quick_fix_callback_proxy_test/quick_fix_callback_proxy_test.cpp +++ b/test/unittest/quick_fix/quick_fix_callback_proxy_test/quick_fix_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 @@ -74,7 +74,7 @@ HWTEST_F(QuickFixCallbackProxyTest, OnLoadPatchDone_0100, TestSize.Level1) quickFixMgrProxy_->OnLoadPatchDone(resultCode, recordId); EXPECT_EQ(mockCallbackService_->code_, - static_cast(IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_LOAD_PATCH)); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_LOAD_PATCH_DONE)); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); } @@ -98,7 +98,7 @@ HWTEST_F(QuickFixCallbackProxyTest, OnUnloadPatchDone_0100, TestSize.Level1) quickFixMgrProxy_->OnUnloadPatchDone(resultCode, recordId); EXPECT_EQ(mockCallbackService_->code_, - static_cast(IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_UNLOAD_PATCH)); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_UNLOAD_PATCH_DONE)); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); } @@ -122,7 +122,7 @@ HWTEST_F(QuickFixCallbackProxyTest, OnReloadPageDone_0100, TestSize.Level1) quickFixMgrProxy_->OnReloadPageDone(resultCode, recordId); EXPECT_EQ(mockCallbackService_->code_, - static_cast(IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_RELOAD_PAGE)); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_RELOAD_PAGE_DONE)); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); } diff --git a/test/unittest/quick_fix/quick_fix_callback_stub_test/quick_fix_callback_stub_test.cpp b/test/unittest/quick_fix/quick_fix_callback_stub_test/quick_fix_callback_stub_test.cpp index 85ffb70f707..aa558e2e9b5 100644 --- a/test/unittest/quick_fix/quick_fix_callback_stub_test/quick_fix_callback_stub_test.cpp +++ b/test/unittest/quick_fix/quick_fix_callback_stub_test/quick_fix_callback_stub_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 @@ -74,7 +74,7 @@ HWTEST_F(QuickFixCallbackStubTest, OnLoadPatchDone_0100, TestSize.Level1) EXPECT_CALL(*mockQuickFixCallback_, OnLoadPatchDone(_, _)).Times(1); auto result = mockQuickFixCallback_->OnRemoteRequest( - IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_LOAD_PATCH, data, reply, option); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_LOAD_PATCH_DONE), data, reply, option); EXPECT_EQ(result, NO_ERROR); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); @@ -103,7 +103,7 @@ HWTEST_F(QuickFixCallbackStubTest, OnUnloadPatchDone_0100, TestSize.Level1) EXPECT_CALL(*mockQuickFixCallback_, OnUnloadPatchDone(_, _)).Times(1); auto result = mockQuickFixCallback_->OnRemoteRequest( - IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_UNLOAD_PATCH, data, reply, option); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_UNLOAD_PATCH_DONE), data, reply, option); EXPECT_EQ(result, NO_ERROR); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); @@ -132,7 +132,7 @@ HWTEST_F(QuickFixCallbackStubTest, OnReloadPageDone_0100, TestSize.Level1) EXPECT_CALL(*mockQuickFixCallback_, OnReloadPageDone(_, _)).Times(1); auto result = mockQuickFixCallback_->OnRemoteRequest( - IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_RELOAD_PAGE, data, reply, option); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_RELOAD_PAGE_DONE), data, reply, option); EXPECT_EQ(result, NO_ERROR); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); @@ -157,8 +157,8 @@ HWTEST_F(QuickFixCallbackStubTest, OnRemoteRequest_0100, TestSize.Level1) data.WriteInt32(resultCode); auto result = mockQuickFixCallback_->OnRemoteRequest( - IQuickFixCallback::QuickFixCallbackCmd::ON_NOTIFY_LOAD_PATCH, data, reply, option); - EXPECT_EQ(result, ERR_INVALID_STATE); + static_cast(IQuickFixCallbackIpcCode::COMMAND_ON_LOAD_PATCH_DONE), data, reply, option); + EXPECT_EQ(result, ERR_TRANSACTION_FAILED); TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__); } diff --git a/test/unittest/quick_fix/quick_fix_callback_with_record_test/quick_fix_callback_with_record_test.cpp b/test/unittest/quick_fix/quick_fix_callback_with_record_test/quick_fix_callback_with_record_test.cpp index 54aba74a686..5d7a6739dc0 100644 --- a/test/unittest/quick_fix/quick_fix_callback_with_record_test/quick_fix_callback_with_record_test.cpp +++ b/test/unittest/quick_fix/quick_fix_callback_with_record_test/quick_fix_callback_with_record_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 @@ -28,28 +28,31 @@ public: QuickFixCallbackImpl() = default; virtual ~QuickFixCallbackImpl() = default; - void OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + ErrCode OnLoadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); loadPatchDone_ = true; loadPatchResult_ = resultCode; loadPatchTimes_++; + return ERR_OK; } - void OnUnloadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + ErrCode OnUnloadPatchDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); unloadPatchDone_ = true; unloadPatchResult_ = resultCode; unloadPatchTimes_++; + return ERR_OK; } - void OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override + ErrCode OnReloadPageDone(int32_t resultCode, [[maybe_unused]] int32_t recordId) override { TAG_LOGD(AAFwkTag::TEST, "function called."); reloadPageDone_ = true; reloadPageResult_ = resultCode; reloadPageTimes_++; + return ERR_OK; } bool loadPatchDone_ = false; -- Gitee From 6acd3ebb1ae9ff4172dc8c568e671e9f0c465331 Mon Sep 17 00:00:00 2001 From: chenliming Date: Tue, 17 Jun 2025 07:03:01 +0000 Subject: [PATCH 15/15] update test/unittest/ams_ipc_interface_test/BUILD.gn. Signed-off-by: chenliming --- test/unittest/ams_ipc_interface_test/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittest/ams_ipc_interface_test/BUILD.gn b/test/unittest/ams_ipc_interface_test/BUILD.gn index 7de5dadff38..f794cca64cc 100644 --- a/test/unittest/ams_ipc_interface_test/BUILD.gn +++ b/test/unittest/ams_ipc_interface_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 -- Gitee