From d3cc5d599c8288f69f48963d623ea4344f77205b Mon Sep 17 00:00:00 2001 From: wangzhen Date: Thu, 23 May 2024 09:33:09 +0800 Subject: [PATCH] Rearrange deps and compiling modules Signed-off-by: wangzhen Change-Id: I9b6b2d0cf1fa83c752d257c5a82b1089a3405bbd --- bundle.json | 8 + .../napi_common_ability.cpp | 2 +- frameworks/native/ability/native/BUILD.gn | 1 - frameworks/native/appkit/app/main_thread.cpp | 4 +- interfaces/inner_api/ability_manager/BUILD.gn | 112 ++++++++++- .../include/ability_first_frame_state_data.h | 1 - services/abilitymgr/BUILD.gn | 12 +- services/abilitymgr/abilitymgr.gni | 12 +- .../abilitymgr/include/ability_service_util.h | 50 +++++ services/abilitymgr/include/ability_util.h | 24 +-- services/abilitymgr/include/app_scheduler.h | 1 - .../abilitymgr/include}/distributed_client.h | 0 .../include}/distributed_parcel_helper.h | 0 .../ui_ability_lifecycle_manager.h | 3 + ...ity_first_frame_state_observer_manager.cpp | 1 + services/abilitymgr/src/ability_record.cpp | 5 +- .../abilitymgr/src/assert_fault_proxy.cpp | 23 ++- services/abilitymgr/src/disposed_observer.cpp | 5 +- .../abilitymgr/src}/distributed_client.cpp | 0 .../interceptor/ability_jump_interceptor.cpp | 4 +- .../src/interceptor/control_interceptor.cpp | 6 +- .../interceptor/crowd_test_interceptor.cpp | 2 +- .../interceptor/disposed_rule_interceptor.cpp | 6 +- .../abilitymgr/src/pending_want_manager.cpp | 3 +- .../src/system_dialog_scheduler.cpp | 184 +++++++++--------- services/appmgr/BUILD.gn | 2 +- .../include/window_focus_changed_listener.h | 2 +- .../window_visibility_changed_listener.h | 2 +- services/appmgr/src/app_mgr_service_inner.cpp | 10 +- services/uripermmgr/BUILD.gn | 2 - test/fuzztest/startability_fuzzer/BUILD.gn | 1 + test/moduletest/ability_test/BUILD.gn | 1 + .../start_option_display_id_test/BUILD.gn | 1 + ...irst_frame_state_observer_manager_test.cpp | 1 + .../ability_interceptor_test.cpp | 2 +- .../BUILD.gn | 1 + .../ability_manager_proxy_test/BUILD.gn | 1 + .../BUILD.gn | 2 + .../BUILD.gn | 1 + .../ability_manager_stub_test.cpp | 1 + test/unittest/ability_record_test/BUILD.gn | 1 + .../ability_record_test.cpp | 2 +- .../ams_ability_running_record_test/BUILD.gn | 2 +- test/unittest/ams_app_workflow_test/BUILD.gn | 2 +- .../ams_recent_app_list_test/BUILD.gn | 2 +- .../BUILD.gn | 2 +- .../ams_service_event_drive_test/BUILD.gn | 2 +- .../BUILD.gn | 2 +- .../ams_service_startup_test/BUILD.gn | 2 +- .../BUILD.gn | 2 +- .../app_mgr_service_inner_test.cpp | 2 +- .../BUILD.gn | 1 + .../BUILD.gn | 2 +- .../pending_want_record_test/BUILD.gn | 1 + test/unittest/sender_info_test/BUILD.gn | 1 + .../service_extension_context_test/BUILD.gn | 1 + .../start_option_display_id_test/BUILD.gn | 1 + test/unittest/start_options_test/BUILD.gn | 1 + test/unittest/trigger_Info_test/BUILD.gn | 1 + .../BUILD.gn | 1 + .../unittest/want_receiver_stub_test/BUILD.gn | 1 + test/unittest/want_sender_proxy_test/BUILD.gn | 1 + test/unittest/want_sender_stub_test/BUILD.gn | 1 + 63 files changed, 335 insertions(+), 198 deletions(-) create mode 100644 services/abilitymgr/include/ability_service_util.h rename {interfaces/kits/native/ability/native/distributed_ability_runtime => services/abilitymgr/include}/distributed_client.h (100%) rename {interfaces/kits/native/ability/native/distributed_ability_runtime => services/abilitymgr/include}/distributed_parcel_helper.h (100%) rename {frameworks/native/ability/native/distributed_ability_runtime => services/abilitymgr/src}/distributed_client.cpp (100%) diff --git a/bundle.json b/bundle.json index 8127c7d4bc..7c8e2fce1b 100644 --- a/bundle.json +++ b/bundle.json @@ -458,6 +458,14 @@ ] }, "name": "//foundation/ability/ability_runtime/frameworks/native/ability/native:dialog_request_callback" + }, + { + "header": { + "header_base": "//foundation/ability/ability_runtime/interfaces/inner_api/ability_manager/include", + "header_files": [ + ] + }, + "name": "//foundation/ability/ability_runtime/interfaces/inner_api/ability_manager:ability_manager_base" } ], "test": [ diff --git a/frameworks/js/napi/inner/napi_ability_common/napi_common_ability.cpp b/frameworks/js/napi/inner/napi_ability_common/napi_common_ability.cpp index b8e2136764..4bbaab8ce6 100644 --- a/frameworks/js/napi/inner/napi_ability_common/napi_common_ability.cpp +++ b/frameworks/js/napi/inner/napi_ability_common/napi_common_ability.cpp @@ -21,8 +21,8 @@ #include #include "ability_util.h" +#include "ability_manager_client.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "js_napi_common_ability.h" #include "js_runtime_utils.h" #include "napi_common_util.h" diff --git a/frameworks/native/ability/native/BUILD.gn b/frameworks/native/ability/native/BUILD.gn index 78d9423604..47393d6aa0 100644 --- a/frameworks/native/ability/native/BUILD.gn +++ b/frameworks/native/ability/native/BUILD.gn @@ -206,7 +206,6 @@ ohos_shared_library("abilitykit_native") { "${ability_runtime_native_path}/ability/native/data_ability_helper_impl.cpp", "${ability_runtime_native_path}/ability/native/data_ability_impl.cpp", "${ability_runtime_native_path}/ability/native/data_uri_utils.cpp", - "${ability_runtime_native_path}/ability/native/distributed_ability_runtime/distributed_client.cpp", "${ability_runtime_native_path}/ability/native/free_install_observer_proxy.cpp", "${ability_runtime_native_path}/ability/native/free_install_observer_stub.cpp", "${ability_runtime_native_path}/ability/native/insight_intent_host_client.cpp", diff --git a/frameworks/native/appkit/app/main_thread.cpp b/frameworks/native/appkit/app/main_thread.cpp index 061749855c..2825984342 100644 --- a/frameworks/native/appkit/app/main_thread.cpp +++ b/frameworks/native/appkit/app/main_thread.cpp @@ -30,6 +30,7 @@ #include "ability_thread.h" #include "ability_util.h" #include "app_loader.h" +#include "ability_manager_client.h" #include "app_recovery.h" #include "app_utils.h" #include "appfreeze_inner.h" @@ -56,7 +57,6 @@ #include "file_path_utils.h" #include "freeze_util.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "resource_config_helper.h" #ifdef SUPPORT_SCREEN #include "locale_config.h" @@ -1573,7 +1573,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con TAG_LOGI(AAFwkTag::APPKIT, "hisysevent write result=%{public}d, send event [FRAMEWORK,PROCESS_KILL]," " pid=%{public}d, processName=%{public}s, msg=%{public}s", result, pid, processName.c_str(), KILL_REASON); - + if (ApplicationDataManager::GetInstance().NotifyUnhandledException(summary) && ApplicationDataManager::GetInstance().NotifyExceptionObject(appExecErrorObj)) { return; diff --git a/interfaces/inner_api/ability_manager/BUILD.gn b/interfaces/inner_api/ability_manager/BUILD.gn index 47473b48de..961e510ded 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -29,7 +29,6 @@ config("ability_manager_public_config") { "${ability_runtime_path}/interfaces/kits/native/ability/native", "${ability_runtime_path}/interfaces/kits/native/ability/native/continuation/kits", "${ability_runtime_path}/interfaces/kits/native/ability/native/continuation/distributed", - "${bundlefwk_inner_api_path}/appexecfwk_base/include", "${ability_runtime_innerkits_path}/ability_manager/include", "${ability_runtime_innerkits_path}/app_manager/include/appmgr", "${ability_runtime_path}/interfaces/kits/native/appkit/app", @@ -62,6 +61,112 @@ config("ability_manager_public_config") { } } +ohos_shared_library("ability_manager_base") { + 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_innerkits_path}/ability_manager/include", + "${ability_runtime_innerkits_path}/ability_manager/include/status_bar_delegate", + "${ability_runtime_path}/interfaces/kits/native/ability/native", + "${ability_runtime_services_path}/abilitymgr/include", + "${ability_runtime_services_path}/common/include", + ] + + defines = [] + + if (ability_command_for_test) { + defines += [ "ABILITY_COMMAND_FOR_TEST" ] + } + + if (ability_runtime_graphics) { + defines += [ + "SUPPORT_GRAPHICS", + "SUPPORT_SCREEN", + ] + } + + cflags = [] + if (target_cpu == "arm") { + cflags += [ "-DBINDER_IPC_32BIT" ] + } + + sources = [ + "${ability_runtime_native_path}/ability/native/data_ability_operation.cpp", + "${ability_runtime_native_path}/ability/native/data_ability_operation_builder.cpp", + "${ability_runtime_native_path}/ability/native/data_ability_result.cpp", + "${ability_runtime_services_path}/abilitymgr/src/ability_running_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/acquire_share_data_callback_proxy.cpp", + "${ability_runtime_services_path}/abilitymgr/src/auto_startup_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/caller_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/dialog_session_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/exit_reason.cpp", + "${ability_runtime_services_path}/abilitymgr/src/extension_running_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_callback_proxy.cpp", + "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_param.cpp", + "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_result.cpp", + "${ability_runtime_services_path}/abilitymgr/src/launch_param.cpp", + "${ability_runtime_services_path}/abilitymgr/src/lifecycle_state_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/mission_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/open_link/open_link_options.cpp", + "${ability_runtime_services_path}/abilitymgr/src/prepare_terminate_callback_proxy.cpp", + "${ability_runtime_services_path}/abilitymgr/src/remote_on_listener_proxy.cpp", + "${ability_runtime_services_path}/abilitymgr/src/sender_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/ui_extension_ability_connect_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/ui_extension_host_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/user_callback_proxy.cpp", + "${ability_runtime_services_path}/abilitymgr/src/want_sender_info.cpp", + "${ability_runtime_services_path}/abilitymgr/src/wants_info.cpp", + "src/status_bar_delegate/status_bar_delegate_proxy.cpp", + ] + + if (ability_runtime_graphics) { + sources += [ + "src/ability_first_frame_state_data.cpp", + "src/ability_first_frame_state_observer_proxy.cpp", + ] + } + + deps = [ + ":ability_start_options", + ":ability_start_setting", + ] + + external_deps = [ + "ability_base:base", + "bundle_framework:appexecfwk_base", + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "hilog:libhilog", + "hitrace:hitrace_meter", + "ipc:ipc_core", + ] + + public_external_deps = [ + "ability_base:configuration", + "ability_base:want", + "ability_base:zuri", + "bundle_framework:appexecfwk_core", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + innerapi_tags = [ + "platformsdk", + "sasdk", + ] + subsystem_name = "ability" + part_name = "ability_runtime" +} + ohos_shared_library("ability_manager") { sources = [ "${ability_runtime_native_path}/ability/native/data_ability_operation.cpp", @@ -74,14 +179,12 @@ ohos_shared_library("ability_manager") { "${ability_runtime_services_path}/abilitymgr/src/ability_manager_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_running_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/ability_scheduler_stub.cpp", - "${ability_runtime_services_path}/abilitymgr/src/acquire_share_data_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/acquire_share_data_callback_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/auto_startup_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/caller_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/dialog_session_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/exit_reason.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_info.cpp", - "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_callback_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_param.cpp", "${ability_runtime_services_path}/abilitymgr/src/insight_intent_execute_result.cpp", @@ -89,7 +192,6 @@ ohos_shared_library("ability_manager") { "${ability_runtime_services_path}/abilitymgr/src/lifecycle_state_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/mission_listener_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/open_link/open_link_options.cpp", - "${ability_runtime_services_path}/abilitymgr/src/prepare_terminate_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/prepare_terminate_callback_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/remote_mission_listener_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/remote_on_listener_proxy.cpp", @@ -105,7 +207,6 @@ ohos_shared_library("ability_manager") { "${ability_runtime_services_path}/abilitymgr/src/want_sender_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/want_sender_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/wants_info.cpp", - "src/status_bar_delegate/status_bar_delegate_proxy.cpp", "src/status_bar_delegate/status_bar_delegate_stub.cpp", "src/window_manager_service_handler_proxy.cpp", "src/window_manager_service_handler_stub.cpp", @@ -114,7 +215,6 @@ ohos_shared_library("ability_manager") { if (ability_runtime_graphics) { sources += [ "src/ability_first_frame_state_data.cpp", - "src/ability_first_frame_state_observer_proxy.cpp", "src/ability_first_frame_state_observer_stub.cpp", ] } diff --git a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h b/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h index f1b32351c6..59f86d7d68 100644 --- a/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h +++ b/interfaces/inner_api/ability_manager/include/ability_first_frame_state_data.h @@ -20,7 +20,6 @@ #include #include "parcel.h" -#include "app_mgr_constants.h" #include "iremote_object.h" namespace OHOS { diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index 5151d9fe11..bec858be4a 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -118,7 +118,7 @@ ohos_shared_library("abilityms") { ] include_dirs = [ "${ability_runtime_services_path}/appdfr/include" ] deps = [ - "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_base", "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/ability_manager:mission_info", @@ -128,7 +128,6 @@ ohos_shared_library("abilityms") { "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", "${ability_runtime_innerkits_path}/session_handler:session_handler", "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", - "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_native_path}/ability/native:auto_startup_callback", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_path}/utils/global/freeze:freeze_util", @@ -142,7 +141,6 @@ ohos_shared_library("abilityms") { external_deps = [ "ability_base:base", "ability_base:configuration", - "ability_base:extractortool", "ability_base:session_info", "ability_base:view_data", "ability_base:want", @@ -153,7 +151,6 @@ ohos_shared_library("abilityms") { "bundle_framework:appexecfwk_core", "bundle_framework:libappexecfwk_common", "c_utils:utils", - "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "dsoftbus:softbus_client", @@ -175,11 +172,7 @@ ohos_shared_library("abilityms") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", - "window_manager:libmodal_system_ui_extension_client", - "window_manager:libwsutils", - "window_manager:scene_session", "window_manager:session_manager_lite", - "window_manager:sms", ] public_external_deps = [ "background_task_mgr:bgtaskmgr_innerkits" ] @@ -207,10 +200,7 @@ ohos_shared_library("abilityms") { external_deps += [ "ability_base:session_info", "i18n:intl_util", - "icu:shared_icuuc", "image_framework:image_native", - "input:libmmi-client", - "resource_management:global_resmgr", "screenlock_mgr:screenlock_client", "window_manager:libdm", "window_manager:libmodal_system_ui_extension_client", diff --git a/services/abilitymgr/abilitymgr.gni b/services/abilitymgr/abilitymgr.gni index 1f788a4c8c..4096fe86b6 100644 --- a/services/abilitymgr/abilitymgr.gni +++ b/services/abilitymgr/abilitymgr.gni @@ -36,19 +36,12 @@ abilityms_files = [ "src/data_ability_record.cpp", "src/dialog_session_record.cpp", "src/lifecycle_deal.cpp", - "src/ability_running_info.cpp", "src/ecological_rule/ability_ecological_rule_mgr_service_param.cpp", "src/ecological_rule/ability_ecological_rule_mgr_service.cpp", "src/extension_config.cpp", - "src/extension_running_info.cpp", - "src/caller_info.cpp", - "src/sender_info.cpp", "src/sub_managers_helper.cpp", - "src/wants_info.cpp", - "src/want_sender_info.cpp", "src/pending_want_record.cpp", "src/want_receiver_proxy.cpp", - "src/want_sender_proxy.cpp", "src/want_sender_stub.cpp", "src/pending_want_key.cpp", "src/pending_want_manager.cpp", @@ -85,8 +78,6 @@ abilityms_files = [ "src/ui_extension_record.cpp", "src/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", @@ -121,6 +112,7 @@ abilityms_files = [ "src/atomic_service_status_callback.cpp", "src/free_install_manager.cpp", "src/free_install_observer_manager.cpp", + "src/distributed_client.cpp", "src/background_task_observer.cpp", "src/resident_process_manager.cpp", @@ -132,9 +124,7 @@ abilityms_files = [ "src/ability_auto_startup_data_manager.cpp", "src/ability_auto_startup_service.cpp", - "src/auto_startup_info.cpp", "src/insight_intent_execute_manager.cpp", - "src/insight_intent_execute_result.cpp", "src/ability_manager_event_subscriber.cpp", ] diff --git a/services/abilitymgr/include/ability_service_util.h b/services/abilitymgr/include/ability_service_util.h new file mode 100644 index 0000000000..9e946a4e50 --- /dev/null +++ b/services/abilitymgr/include/ability_service_util.h @@ -0,0 +1,50 @@ +/* + * 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_ABILITY_SERVICE_UTIL_H +#define OHOS_ABILITY_RUNTIME_ABILITY_SERVICE_UTIL_H + +#include "ability_manager_service.h" +#include "bundle_mgr_helper.h" +#include "hilog_tag_wrapper.h" + +namespace OHOS { +namespace AAFwk { +namespace AbilityUtil { +constexpr const char* MARKET_BUNDLE_NAME = "com.huawei.hmsapp.appgallery"; +constexpr const char* MARKET_CROWD_TEST_BUNDLE_PARAM = "crowd_test_bundle_name"; + +[[maybe_unused]] static int StartAppgallery(const std::string &bundleName, const int requestCode, const int32_t userId, + const std::string &action) +{ + std::string appGalleryBundleName; + auto bundleMgrHelper = AbilityUtil::GetBundleManagerHelper(); + if (bundleMgrHelper == nullptr || !bundleMgrHelper->QueryAppGalleryBundleName(appGalleryBundleName)) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "Get bundle manager helper failed or QueryAppGalleryBundleName failed."); + appGalleryBundleName = MARKET_BUNDLE_NAME; + } + + TAG_LOGD(AAFwkTag::ABILITYMGR, "appGalleryBundleName:%{public}s", appGalleryBundleName.c_str()); + + Want want; + want.SetElementName(appGalleryBundleName, ""); + want.SetAction(action); + want.SetParam(MARKET_CROWD_TEST_BUNDLE_PARAM, bundleName); + return DelayedSingleton::GetInstance()->StartAbility(want, requestCode, userId); +} +} // namespace AbilityUtil +} // namespace AAFwk +} // namespace OHOS +#endif \ No newline at end of file diff --git a/services/abilitymgr/include/ability_util.h b/services/abilitymgr/include/ability_util.h index b8abf0a737..5097d4770f 100644 --- a/services/abilitymgr/include/ability_util.h +++ b/services/abilitymgr/include/ability_util.h @@ -20,12 +20,11 @@ #include #include "ability_config.h" -#include "ability_manager_client.h" #include "ability_manager_errors.h" +#include "ability_window_configuration.h" #include "app_jump_control_rule.h" #include "bundle_mgr_helper.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "in_process_call_wrapper.h" #include "ipc_skeleton.h" #include "permission_verification.h" @@ -45,8 +44,6 @@ constexpr const char* DLP_PARAMS_SANDBOX = "ohos.dlp.params.sandbox"; constexpr const char* DLP_PARAMS_BUNDLE_NAME = "ohos.dlp.params.bundleName"; constexpr const char* DLP_PARAMS_MODULE_NAME = "ohos.dlp.params.moduleName"; constexpr const char* DLP_PARAMS_ABILITY_NAME = "ohos.dlp.params.abilityName"; -constexpr const char* MARKET_BUNDLE_NAME = "com.huawei.hmsapp.appgallery"; -constexpr const char* MARKET_CROWD_TEST_BUNDLE_PARAM = "crowd_test_bundle_name"; constexpr const char* BUNDLE_NAME_SELECTOR_DIALOG = "com.ohos.amsdialog"; constexpr const char* JUMP_INTERCEPTOR_DIALOG_CALLER_PKG = "interceptor_callerPkg"; @@ -323,25 +320,6 @@ static constexpr int64_t MICROSECONDS = 1000000; // MICROSECONDS mean 10^6 mi } } -[[maybe_unused]] static int StartAppgallery(const std::string &bundleName, const int requestCode, const int32_t userId, - const std::string &action) -{ - std::string appGalleryBundleName; - auto bundleMgrHelper = AbilityUtil::GetBundleManagerHelper(); - if (bundleMgrHelper == nullptr || !bundleMgrHelper->QueryAppGalleryBundleName(appGalleryBundleName)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "Get bundle manager helper failed or QueryAppGalleryBundleName failed."); - appGalleryBundleName = MARKET_BUNDLE_NAME; - } - - TAG_LOGD(AAFwkTag::ABILITYMGR, "appGalleryBundleName:%{public}s", appGalleryBundleName.c_str()); - - Want want; - want.SetElementName(appGalleryBundleName, ""); - want.SetAction(action); - want.SetParam(MARKET_CROWD_TEST_BUNDLE_PARAM, bundleName); - return AbilityManagerClient::GetInstance()->StartAbility(want, requestCode, userId); -} - inline ErrCode EdmErrorType(bool isEdm) { if (isEdm) { diff --git a/services/abilitymgr/include/app_scheduler.h b/services/abilitymgr/include/app_scheduler.h index db716ce3a9..56a8fa17af 100644 --- a/services/abilitymgr/include/app_scheduler.h +++ b/services/abilitymgr/include/app_scheduler.h @@ -21,7 +21,6 @@ #include "ability_debug_response_interface.h" #include "ability_info.h" -#include "ability_manager_client.h" #include "app_debug_listener_interface.h" #include "application_info.h" #include "appmgr/app_mgr_client.h" diff --git a/interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_client.h b/services/abilitymgr/include/distributed_client.h similarity index 100% rename from interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_client.h rename to services/abilitymgr/include/distributed_client.h diff --git a/interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_parcel_helper.h b/services/abilitymgr/include/distributed_parcel_helper.h similarity index 100% rename from interfaces/kits/native/ability/native/distributed_ability_runtime/distributed_parcel_helper.h rename to services/abilitymgr/include/distributed_parcel_helper.h diff --git a/services/abilitymgr/include/scene_board/ui_ability_lifecycle_manager.h b/services/abilitymgr/include/scene_board/ui_ability_lifecycle_manager.h index 02e5e81cd1..03bf8a1b75 100644 --- a/services/abilitymgr/include/scene_board/ui_ability_lifecycle_manager.h +++ b/services/abilitymgr/include/scene_board/ui_ability_lifecycle_manager.h @@ -28,6 +28,9 @@ #include "isession_handler_interface.h" namespace OHOS { +namespace AbilityRuntime { +class IStatusBarDelegate; +} namespace AAFwk { class SessionInfo; class StatusBarDelegateManager; diff --git a/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp b/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp index 953d7f9afe..82efe418ba 100644 --- a/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp +++ b/services/abilitymgr/src/ability_first_frame_state_observer_manager.cpp @@ -18,6 +18,7 @@ #include "ability_first_frame_state_data.h" #include "ability_first_frame_state_observer_stub.h" +#include "ability_manager_errors.h" #include "application_info.h" #include "hilog_tag_wrapper.h" #include "permission_verification.h" diff --git a/services/abilitymgr/src/ability_record.cpp b/services/abilitymgr/src/ability_record.cpp index 6340cc1c97..4f10849432 100644 --- a/services/abilitymgr/src/ability_record.cpp +++ b/services/abilitymgr/src/ability_record.cpp @@ -20,7 +20,6 @@ #include #include -#include "constants.h" #include "ability_event_handler.h" #include "ability_manager_service.h" #include "ability_resident_process_rdb.h" @@ -46,7 +45,6 @@ #include "errors.h" #include "event_report.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "os_account_manager_wrapper.h" #include "parameters.h" #include "ui_extension_host_info.h" @@ -2199,7 +2197,8 @@ void AbilityRecord::DumpUIExtensionRootHostInfo(std::vector &info) } UIExtensionHostInfo hostInfo; - auto ret = IN_PROCESS_CALL(AAFwk::AbilityManagerClient::GetInstance()->GetUIExtensionRootHostInfo(token, hostInfo)); + auto ret = IN_PROCESS_CALL(DelayedSingleton::GetInstance()->GetUIExtensionRootHostInfo( + token, hostInfo)); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "Get ui extension host info failed with %{public}d.", ret); return; diff --git a/services/abilitymgr/src/assert_fault_proxy.cpp b/services/abilitymgr/src/assert_fault_proxy.cpp index eddf9389bd..c1a817d712 100644 --- a/services/abilitymgr/src/assert_fault_proxy.cpp +++ b/services/abilitymgr/src/assert_fault_proxy.cpp @@ -12,18 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "ability_manager_client.h" +#include "ability_manager_service.h" #include "assert_fault_proxy.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "scene_board_judgement.h" #include "task_handler_wrap.h" namespace OHOS { namespace AbilityRuntime { namespace { -constexpr char ASSERT_FAULT_DETAIL[] = "assertFaultDialogDetail"; -constexpr char UIEXTENSION_TYPE_KEY[] = "ability.want.params.uiExtensionType"; +constexpr const char* ASSERT_FAULT_DETAIL = "assertFaultDialogDetail"; +constexpr const char* UIEXTENSION_TYPE_KEY = "ability.want.params.uiExtensionType"; constexpr int32_t DEFAULT_VAL = 0; constexpr int32_t INVALID_USERID = -1; constexpr int32_t MESSAGE_PARCEL_KEY_SIZE = 3; @@ -111,9 +110,9 @@ bool ModalSystemAssertUIExtension::CreateModalUIExtension(const AAFwk::Want &wan return false; } callback->SetReqeustAssertDialogWant(want); - auto abilityManagerClient = AAFwk::AbilityManagerClient::GetInstance(); - if (abilityManagerClient == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "ConnectSystemUi AbilityManagerClient is nullptr"); + auto abilityMs = DelayedSingleton::GetInstance(); + if (abilityMs == nullptr) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "ConnectSystemUi abilityMs is nullptr"); TryNotifyOneWaitingThread(); return false; } @@ -123,7 +122,7 @@ bool ModalSystemAssertUIExtension::CreateModalUIExtension(const AAFwk::Want &wan } else { systemUIWant.SetElementName("com.ohos.systemui", "com.ohos.systemui.dialog"); } - auto result = abilityManagerClient->ConnectAbility(systemUIWant, callback, INVALID_USERID); + auto result = abilityMs->ConnectAbility(systemUIWant, callback, nullptr, INVALID_USERID); if (result != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "ConnectSystemUi ConnectAbility dialog failed, result = %{public}d", result); TryNotifyOneWaitingThread(); @@ -137,9 +136,9 @@ bool ModalSystemAssertUIExtension::DisconnectSystemUI() TAG_LOGD(AAFwkTag::ABILITYMGR, "Called."); bool retVal = true; do { - auto abilityManagerClient = AAFwk::AbilityManagerClient::GetInstance(); - if (abilityManagerClient == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "AbilityManagerClient is nullptr"); + auto abilityMs = DelayedSingleton::GetInstance(); + if (abilityMs == nullptr) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "abilityMs is nullptr"); retVal = false; break; } @@ -149,7 +148,7 @@ bool ModalSystemAssertUIExtension::DisconnectSystemUI() retVal = false; break; } - auto result = abilityManagerClient->DisconnectAbility(callback); + auto result = abilityMs->DisconnectAbility(callback); if (result != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "DisconnectAbility dialog failed, result = %{public}d", result); retVal = false; diff --git a/services/abilitymgr/src/disposed_observer.cpp b/services/abilitymgr/src/disposed_observer.cpp index 4294e40e0e..96b3616dca 100644 --- a/services/abilitymgr/src/disposed_observer.cpp +++ b/services/abilitymgr/src/disposed_observer.cpp @@ -15,10 +15,10 @@ #include "disposed_observer.h" +#include "ability_manager_service.h" #include "interceptor/disposed_rule_interceptor.h" #include "ability_record.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "modal_system_ui_extension.h" #include "want.h" namespace OHOS { @@ -56,7 +56,8 @@ void DisposedObserver::OnPageShow(const AppExecFwk::PageStateData &pageStateData { TAG_LOGD(AAFwkTag::ABILITYMGR, "Call"); if (disposedRule_.componentType == AppExecFwk::ComponentType::UI_ABILITY) { - int ret = IN_PROCESS_CALL(AbilityManagerClient::GetInstance()->StartAbility(*disposedRule_.want)); + int ret = IN_PROCESS_CALL(DelayedSingleton::GetInstance()->StartAbility( + *disposedRule_.want)); if (ret != ERR_OK) { interceptor_->UnregisterObserver(pageStateData.bundleName); TAG_LOGE(AAFwkTag::ABILITYMGR, "failed to start disposed ability"); diff --git a/frameworks/native/ability/native/distributed_ability_runtime/distributed_client.cpp b/services/abilitymgr/src/distributed_client.cpp similarity index 100% rename from frameworks/native/ability/native/distributed_ability_runtime/distributed_client.cpp rename to services/abilitymgr/src/distributed_client.cpp diff --git a/services/abilitymgr/src/interceptor/ability_jump_interceptor.cpp b/services/abilitymgr/src/interceptor/ability_jump_interceptor.cpp index d6479d3fe8..927cd54f84 100644 --- a/services/abilitymgr/src/interceptor/ability_jump_interceptor.cpp +++ b/services/abilitymgr/src/interceptor/ability_jump_interceptor.cpp @@ -15,11 +15,11 @@ #include "interceptor/ability_jump_interceptor.h" +#include "ability_manager_service.h" #include "ability_util.h" #include "accesstoken_kit.h" #include "app_jump_control_rule.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "hitrace_meter.h" #include "in_process_call_wrapper.h" #include "permission_constants.h" @@ -75,7 +75,7 @@ ErrCode AbilityJumpInterceptor::DoProcess(AbilityInterceptorParam param) Want dialogWant = sysDialogScheduler->GetJumpInterceptorDialogWant(targetWant); AbilityUtil::ParseJumpInterceptorWant(dialogWant, controlRule.callerPkg); LoadAppLabelInfo(dialogWant, controlRule, param.userId); - int ret = IN_PROCESS_CALL(AbilityManagerClient::GetInstance()->StartAbility(dialogWant, + int ret = IN_PROCESS_CALL(DelayedSingleton::GetInstance()->StartAbility(dialogWant, param.requestCode, param.userId)); if (ret != ERR_OK) { TAG_LOGI(AAFwkTag::ABILITYMGR, "appInterceptor Dialog StartAbility error, ret:%{public}d", ret); diff --git a/services/abilitymgr/src/interceptor/control_interceptor.cpp b/services/abilitymgr/src/interceptor/control_interceptor.cpp index a25da3855e..8b84b46345 100644 --- a/services/abilitymgr/src/interceptor/control_interceptor.cpp +++ b/services/abilitymgr/src/interceptor/control_interceptor.cpp @@ -15,10 +15,10 @@ #include "interceptor/control_interceptor.h" +#include "ability_manager_service.h" #include "ability_util.h" #include "app_running_control_rule_result.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "hitrace_meter.h" #include "in_process_call_wrapper.h" #include "want_params_wrapper.h" @@ -57,8 +57,8 @@ ErrCode ControlInterceptor::DoProcess(AbilityInterceptorParam param) controlWant->SetParam(INTERCEPT_MODULE_NAME, param.want.GetElement().GetModuleName()); controlRule.controlWant = controlWant; } - int ret = IN_PROCESS_CALL(AbilityManagerClient::GetInstance()->StartAbility(*controlRule.controlWant, - param.requestCode, param.userId)); + int ret = IN_PROCESS_CALL(DelayedSingleton::GetInstance()->StartAbility( + *controlRule.controlWant, param.requestCode, param.userId)); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "Control implicit start appgallery failed."); return ret; diff --git a/services/abilitymgr/src/interceptor/crowd_test_interceptor.cpp b/services/abilitymgr/src/interceptor/crowd_test_interceptor.cpp index e78cd48ae7..b5446ffe89 100644 --- a/services/abilitymgr/src/interceptor/crowd_test_interceptor.cpp +++ b/services/abilitymgr/src/interceptor/crowd_test_interceptor.cpp @@ -16,8 +16,8 @@ #include "interceptor/crowd_test_interceptor.h" #include "ability_util.h" +#include "ability_service_util.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "in_process_call_wrapper.h" #include "start_ability_utils.h" diff --git a/services/abilitymgr/src/interceptor/disposed_rule_interceptor.cpp b/services/abilitymgr/src/interceptor/disposed_rule_interceptor.cpp index 4366dfe785..301220e01f 100644 --- a/services/abilitymgr/src/interceptor/disposed_rule_interceptor.cpp +++ b/services/abilitymgr/src/interceptor/disposed_rule_interceptor.cpp @@ -15,10 +15,10 @@ #include "interceptor/disposed_rule_interceptor.h" +#include "ability_manager_service.h" #include "ability_record.h" #include "ability_util.h" #include "hilog_tag_wrapper.h" -#include "hilog_wrapper.h" #include "hitrace_meter.h" #include "in_process_call_wrapper.h" #include "iservice_registry.h" @@ -54,8 +54,8 @@ ErrCode DisposedRuleInterceptor::DoProcess(AbilityInterceptorParam param) return AbilityUtil::EdmErrorType(disposedRule.isEdm); } if (disposedRule.componentType == AppExecFwk::ComponentType::UI_ABILITY) { - int ret = IN_PROCESS_CALL(AbilityManagerClient::GetInstance()->StartAbility(*disposedRule.want, - param.requestCode, param.userId)); + int ret = IN_PROCESS_CALL(DelayedSingleton::GetInstance()->StartAbility( + *disposedRule.want, param.requestCode, param.userId)); if (ret != ERR_OK) { TAG_LOGE(AAFwkTag::ABILITYMGR, "DisposedRuleInterceptor start ability failed."); return ret; diff --git a/services/abilitymgr/src/pending_want_manager.cpp b/services/abilitymgr/src/pending_want_manager.cpp index 26205cbfec..96a7379462 100644 --- a/services/abilitymgr/src/pending_want_manager.cpp +++ b/services/abilitymgr/src/pending_want_manager.cpp @@ -21,6 +21,7 @@ #include "ability_manager_service.h" #include "ability_util.h" +#include "common_event_manager.h" #include "distributed_client.h" #include "hilog_tag_wrapper.h" #include "hilog_wrapper.h" @@ -341,7 +342,7 @@ int32_t PendingWantManager::PendingWantPublishCommonEvent( pendingWantCommonEvent->SetFinishedReceiver(senderInfo.finishedReceiver); pendingWantCommonEvent->SetWantParams(senderInfo.want.GetParams()); } - bool result = IN_PROCESS_CALL(DelayedSingleton::GetInstance()->PublishCommonEvent( + bool result = IN_PROCESS_CALL(CommonEventManager::PublishCommonEvent( eventData, eventPublishData, pendingWantCommonEvent, callerUid, callerTokenId)); return ((result == true) ? ERR_OK : (-1)); } diff --git a/services/abilitymgr/src/system_dialog_scheduler.cpp b/services/abilitymgr/src/system_dialog_scheduler.cpp index 8dd0ddb949..c3e792fd3b 100644 --- a/services/abilitymgr/src/system_dialog_scheduler.cpp +++ b/services/abilitymgr/src/system_dialog_scheduler.cpp @@ -19,7 +19,6 @@ #include "app_utils.h" #include "display_info.h" -#include "constants.h" #include "ability_record.h" #include "ability_util.h" #include "app_gallery_enable_util.h" @@ -39,98 +38,99 @@ namespace OHOS { namespace AAFwk { -const int32_t UI_SELECTOR_DIALOG_WIDTH = 328 * 2; -const int32_t UI_SELECTOR_DIALOG_HEIGHT = 350 * 2; -const int32_t UI_SELECTOR_DIALOG_HEIGHT_NARROW = 350 * 2; -const int32_t UI_SELECTOR_DIALOG_WIDTH_NARROW = 328 * 2; -const int32_t UI_SELECTOR_DIALOG_PHONE_H1 = 240 * 2; -const int32_t UI_SELECTOR_DIALOG_PHONE_H2 = 340 * 2; -const int32_t UI_SELECTOR_DIALOG_PHONE_H3 = 350 * 2; -const int32_t UI_SELECTOR_DIALOG_PC_H0 = 1; -const int32_t UI_SELECTOR_DIALOG_PC_H2 = (64 * 2 + 56 + 48 + 54 + 64 + 48 + 2) * 2; -const int32_t UI_SELECTOR_DIALOG_PC_H3 = (64 * 3 + 56 + 48 + 54 + 64 + 48 + 2) * 2; -const int32_t UI_SELECTOR_DIALOG_PC_H4 = (64 * 4 + 56 + 48 + 54 + 64 + 48 + 2) * 2; -const int32_t UI_SELECTOR_DIALOG_PC_H5 = (64 * 4 + 56 + 48 + 54 + 64 + 48 + 58 + 2) * 2; +constexpr int32_t UI_SELECTOR_DIALOG_WIDTH = 328 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_HEIGHT = 350 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_HEIGHT_NARROW = 350 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_WIDTH_NARROW = 328 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PHONE_H1 = 240 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PHONE_H2 = 340 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PHONE_H3 = 350 * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PC_H0 = 1; +constexpr int32_t UI_SELECTOR_DIALOG_PC_H2 = (64 * 2 + 56 + 48 + 54 + 64 + 48 + 2) * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PC_H3 = (64 * 3 + 56 + 48 + 54 + 64 + 48 + 2) * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PC_H4 = (64 * 4 + 56 + 48 + 54 + 64 + 48 + 2) * 2; +constexpr int32_t UI_SELECTOR_DIALOG_PC_H5 = (64 * 4 + 56 + 48 + 54 + 64 + 48 + 58 + 2) * 2; -const int32_t UI_SELECTOR_PORTRAIT_PHONE_H1 = 280; -const int32_t UI_SELECTOR_PORTRAIT_PHONE_H2 = 400; -const int32_t UI_SELECTOR_PORTRAIT_PHONE_H3 = 410; -const int32_t UI_SELECTOR_LANDSCAPE_SIGNAL_BAR = 24; -const int32_t UI_SELECTOR_LANDSCAPE_HEIGHT = 350; -const int32_t UI_SELECTOR_LANDSCAPE_HEIGHT_NARROW = 350; -const int32_t UI_SELECTOR_LANDSCAPE_PHONE_H1 = 280; -const int32_t UI_SELECTOR_LANDSCAPE_PHONE_H2 = 400; -const int32_t UI_SELECTOR_LANDSCAPE_PHONE_H3 = 410; -const int32_t UI_SELECTOR_LANDSCAPE_COUNT_THREE = 3; -const int32_t UI_SELECTOR_LANDSCAPE_COUNT_FOUR = 4; -const float UI_SELECTOR_LANDSCAPE_GRILLE_LARGE = 0.107692; -const float UI_SELECTOR_LANDSCAPE_GRILLE_SAMLL = 0.015385; -const float UI_SELECTOR_LANDSCAPE_MAX_RATIO = 0.9; -const float UI_SELECTOR_PORTRAIT_WIDTH_RATIO = 0.8; -const float UI_SELECTOR_PORTRAIT_WIDTH_EDGE_RATIO = 0.1; -const float UI_SELECTOR_PORTRAIT_HEIGHT_RATIO = 0.98; +constexpr int32_t UI_SELECTOR_PORTRAIT_PHONE_H1 = 280; +constexpr int32_t UI_SELECTOR_PORTRAIT_PHONE_H2 = 400; +constexpr int32_t UI_SELECTOR_PORTRAIT_PHONE_H3 = 410; +constexpr int32_t UI_SELECTOR_LANDSCAPE_SIGNAL_BAR = 24; +constexpr int32_t UI_SELECTOR_LANDSCAPE_HEIGHT = 350; +constexpr int32_t UI_SELECTOR_LANDSCAPE_HEIGHT_NARROW = 350; +constexpr int32_t UI_SELECTOR_LANDSCAPE_PHONE_H1 = 280; +constexpr int32_t UI_SELECTOR_LANDSCAPE_PHONE_H2 = 400; +constexpr int32_t UI_SELECTOR_LANDSCAPE_PHONE_H3 = 410; +constexpr int32_t UI_SELECTOR_LANDSCAPE_COUNT_THREE = 3; +constexpr int32_t UI_SELECTOR_LANDSCAPE_COUNT_FOUR = 4; +constexpr float UI_SELECTOR_LANDSCAPE_GRILLE_LARGE = 0.107692; +constexpr float UI_SELECTOR_LANDSCAPE_GRILLE_SAMLL = 0.015385; +constexpr float UI_SELECTOR_LANDSCAPE_MAX_RATIO = 0.9; +constexpr float UI_SELECTOR_PORTRAIT_WIDTH_RATIO = 0.8; +constexpr float UI_SELECTOR_PORTRAIT_WIDTH_EDGE_RATIO = 0.1; +constexpr float UI_SELECTOR_PORTRAIT_HEIGHT_RATIO = 0.98; -const int32_t UI_TIPS_DIALOG_WIDTH = 328 * 2; -const int32_t UI_TIPS_DIALOG_HEIGHT = 135 * 2; -const int32_t UI_TIPS_DIALOG_HEIGHT_NARROW = 135 * 2; -const int32_t UI_TIPS_DIALOG_WIDTH_NARROW = 328 * 2; +constexpr int32_t UI_TIPS_DIALOG_WIDTH = 328 * 2; +constexpr int32_t UI_TIPS_DIALOG_HEIGHT = 135 * 2; +constexpr int32_t UI_TIPS_DIALOG_HEIGHT_NARROW = 135 * 2; +constexpr int32_t UI_TIPS_DIALOG_WIDTH_NARROW = 328 * 2; -const int32_t UI_JUMP_INTERCEPTOR_DIALOG_WIDTH = 328 * 2; -const int32_t UI_JUMP_INTERCEPTOR_DIALOG_HEIGHT = 135 * 2; -const int32_t UI_JUMP_INTERCEPTOR_DIALOG_HEIGHT_NARROW = 135 * 2; -const int32_t UI_JUMP_INTERCEPTOR_DIALOG_WIDTH_NARROW = 328 * 2; +constexpr int32_t UI_JUMP_INTERCEPTOR_DIALOG_WIDTH = 328 * 2; +constexpr int32_t UI_JUMP_INTERCEPTOR_DIALOG_HEIGHT = 135 * 2; +constexpr int32_t UI_JUMP_INTERCEPTOR_DIALOG_HEIGHT_NARROW = 135 * 2; +constexpr int32_t UI_JUMP_INTERCEPTOR_DIALOG_WIDTH_NARROW = 328 * 2; -const int32_t UI_ANR_DIALOG_WIDTH = 328 * 2; -const int32_t UI_ANR_DIALOG_HEIGHT = 192 * 2; -const std::string APP_NAME = "appName"; -const std::string IS_DEFAULT_SELECTOR = "isDefaultSelector"; -const std::string OFF_SET_X = "offsetX"; -const std::string OFF_SET_Y = "offsetY"; -const std::string WIDTH = "width"; -const std::string HEIGHT = "height"; -const std::string MODEL_FLAG = "modelFlag"; -const std::string ACTION = "action"; -const std::string OVERSIZE_HEIGHT = "oversizeHeight"; +constexpr int32_t UI_DIALOG_WIDTH = 328 * 2; +constexpr int32_t UI_DIALOG_HEIGHT = 192 * 2; +constexpr const char* APP_NAME = "appName"; +constexpr const char* IS_DEFAULT_SELECTOR = "isDefaultSelector"; +constexpr const char* OFF_SET_X = "offsetX"; +constexpr const char* OFF_SET_Y = "offsetY"; +constexpr const char* WIDTH = "width"; +constexpr const char* HEIGHT = "height"; +constexpr const char* MODEL_FLAG = "modelFlag"; +constexpr const char* ACTION = "action"; +constexpr const char* OVERSIZE_HEIGHT = "oversizeHeight"; -const int32_t UI_HALF = 2; -const int32_t UI_DEFAULT_BUTTOM_CLIP = 100; -const int32_t UI_WIDTH_780DP = 1560; -const int32_t UI_DEFAULT_WIDTH = 2560; -const int32_t UI_DEFAULT_HEIGHT = 1600; +constexpr int32_t UI_HALF = 2; +constexpr int32_t UI_DEFAULT_BUTTOM_CLIP = 100; +constexpr int32_t UI_WIDTH_780DP = 1560; +constexpr int32_t UI_DEFAULT_WIDTH = 2560; +constexpr int32_t UI_DEFAULT_HEIGHT = 1600; -const std::string STR_PHONE = "phone"; -const std::string STR_DEFAULT = "default"; -const std::string DIALOG_NAME_ANR = "dialog_anr_service"; -const std::string DIALOG_NAME_TIPS = "dialog_tips_service"; -const std::string DIALOG_SELECTOR_NAME = "dialog_selector_service"; -const std::string DIALOG_JUMP_INTERCEPTOR_NAME = "dialog_jump_interceptor_service"; +constexpr const char* STR_PHONE = "phone"; +constexpr const char* STR_DEFAULT = "default"; +constexpr const char* DIALOG_NAME_TIPS = "dialog_tips_service"; +constexpr const char* DIALOG_SELECTOR_NAME = "dialog_selector_service"; +constexpr const char* DIALOG_JUMP_INTERCEPTOR_NAME = "dialog_jump_interceptor_service"; -const std::string BUNDLE_NAME = "bundleName"; -const std::string BUNDLE_NAME_DIALOG = "com.ohos.amsdialog"; -const std::string DIALOG_PARAMS = "params"; -const std::string DIALOG_POSITION = "position"; -const std::string VERTICAL_SCREEN_DIALOG_POSITION = "landscapeScreen"; -const std::string ABILITY_NAME_FREEZE_DIALOG = "SwitchUserDialog"; -const std::string ABILITY_NAME_ASSERT_FAULT_DIALOG = "AssertFaultDialog"; -const std::string ABILITY_NAME_TIPS_DIALOG = "TipsDialog"; -const std::string ABILITY_NAME_SELECTOR_DIALOG = "SelectorDialog"; -const std::string ABILITY_NAME_APPGALLERY_SELECTOR_DIALOG = "AppSelectorExtensionAbility"; -const std::string UIEXTENSION_TYPE_KEY = "ability.want.params.uiExtensionType"; -const std::string UIEXTENSION_SYS_COMMON_UI = "sys/commonUI"; -const std::string CALLER_TOKEN = "callerToken"; -const std::string ABILITY_NAME_JUMP_INTERCEPTOR_DIALOG = "JumpInterceptorDialog"; -const std::string TYPE_ONLY_MATCH_WILDCARD = "reserved/wildcard"; -const std::string ORIENTATION = "orientation"; +constexpr const char* BUNDLE_NAME = "bundleName"; +constexpr const char* BUNDLE_NAME_DIALOG = "com.ohos.amsdialog"; +constexpr const char* DIALOG_PARAMS = "params"; +constexpr const char* DIALOG_POSITION = "position"; +constexpr const char* VERTICAL_SCREEN_DIALOG_POSITION = "landscapeScreen"; +constexpr const char* ABILITY_NAME_FREEZE_DIALOG = "SwitchUserDialog"; +constexpr const char* ABILITY_NAME_ASSERT_FAULT_DIALOG = "AssertFaultDialog"; +constexpr const char* ABILITY_NAME_TIPS_DIALOG = "TipsDialog"; +constexpr const char* ABILITY_NAME_SELECTOR_DIALOG = "SelectorDialog"; +constexpr const char* ABILITY_NAME_APPGALLERY_SELECTOR_DIALOG = "AppSelectorExtensionAbility"; +constexpr const char* UIEXTENSION_TYPE_KEY = "ability.want.params.uiExtensionType"; +constexpr const char* UIEXTENSION_SYS_COMMON_UI = "sys/commonUI"; +constexpr const char* CALLER_TOKEN = "callerToken"; +constexpr const char* ABILITY_NAME_JUMP_INTERCEPTOR_DIALOG = "JumpInterceptorDialog"; +constexpr const char* TYPE_ONLY_MATCH_WILDCARD = "reserved/wildcard"; +constexpr const char* ORIENTATION = "orientation"; +constexpr const char* ABS_CODE_PATH = "/data/app/el1/bundle/public"; +constexpr const char* FILE_SEPARATOR = "/"; -const int32_t LINE_NUMS_ZERO = 0; -const int32_t LINE_NUMS_TWO = 2; -const int32_t LINE_NUMS_THREE = 3; -const int32_t LINE_NUMS_FOUR = 4; -const int32_t LINE_NUMS_EIGHT = 8; +constexpr int32_t LINE_NUMS_ZERO = 0; +constexpr int32_t LINE_NUMS_TWO = 2; +constexpr int32_t LINE_NUMS_THREE = 3; +constexpr int32_t LINE_NUMS_FOUR = 4; +constexpr int32_t LINE_NUMS_EIGHT = 8; -const float WIDTH_MULTIPLE = 0.8; -const float HEIGHT_MULTIPLE = 0.3; -const float SETX_WIDTH_MULTIPLE = 0.1; +constexpr float WIDTH_MULTIPLE = 0.8; +constexpr float HEIGHT_MULTIPLE = 0.3; +constexpr float SETX_WIDTH_MULTIPLE = 0.1; Want SystemDialogScheduler::GetTipsDialogWant(const sptr &callerToken) { @@ -468,18 +468,18 @@ void SystemDialogScheduler::InitDialogPosition(DialogType type, DialogPosition & switch (type) { case DialogType::DIALOG_ANR: if (position.wideScreen) { - position.width = UI_ANR_DIALOG_WIDTH; - position.height = UI_ANR_DIALOG_HEIGHT; - position.width_narrow = UI_ANR_DIALOG_WIDTH; - position.height_narrow = UI_ANR_DIALOG_HEIGHT; + position.width = UI_DIALOG_WIDTH; + position.height = UI_DIALOG_HEIGHT; + position.width_narrow = UI_DIALOG_WIDTH; + position.height_narrow = UI_DIALOG_HEIGHT; position.align = DialogAlign::CENTER; } else { position.width = display->GetWidth(); position.height = display->GetHeight(); position.width_narrow = display->GetWidth(); position.height_narrow = display->GetHeight(); - position.window_width = UI_ANR_DIALOG_WIDTH; - position.window_height = UI_ANR_DIALOG_HEIGHT; + position.window_width = UI_DIALOG_WIDTH; + position.window_height = UI_DIALOG_HEIGHT; position.align = DialogAlign::CENTER; } break; @@ -609,8 +609,8 @@ void SystemDialogScheduler::GetAppNameFromResource(int32_t labelId, resConfig->SetLocaleInfo(locale); resourceManager->UpdateResConfig(*resConfig); - std::regex pattern(std::string(AbilityBase::Constants::ABS_CODE_PATH) + - std::string(AbilityBase::Constants::FILE_SEPARATOR) + bundleInfo.name); + std::regex pattern(std::string(ABS_CODE_PATH) + + std::string(FILE_SEPARATOR) + bundleInfo.name); for (auto hapModuleInfo : bundleInfo.hapModuleInfos) { std::string loadPath; TAG_LOGD(AAFwkTag::DIALOG, "make a judgment."); diff --git a/services/appmgr/BUILD.gn b/services/appmgr/BUILD.gn index 425e07ffba..8c2b6c2986 100644 --- a/services/appmgr/BUILD.gn +++ b/services/appmgr/BUILD.gn @@ -145,7 +145,7 @@ ohos_shared_library("libappms") { deps += [] external_deps += [ "i18n:intl_util", - "window_manager:libwm", + "window_manager:libwm_lite", "window_manager:libwsutils", ] } diff --git a/services/appmgr/include/window_focus_changed_listener.h b/services/appmgr/include/window_focus_changed_listener.h index 003e596b24..42ed5fa7c9 100644 --- a/services/appmgr/include/window_focus_changed_listener.h +++ b/services/appmgr/include/window_focus_changed_listener.h @@ -17,7 +17,7 @@ #define OHOS_ABILITY_RUNTIME_WINDOW_FOCUS_CHANGE_LISTENER_H #ifdef SUPPORT_SCREEN -#include "window_manager.h" +#include "window_manager_lite.h" #endif // SUPPORT_SCREEN #include "task_handler_wrap.h" diff --git a/services/appmgr/include/window_visibility_changed_listener.h b/services/appmgr/include/window_visibility_changed_listener.h index 765b30b554..c4f6b53d8a 100644 --- a/services/appmgr/include/window_visibility_changed_listener.h +++ b/services/appmgr/include/window_visibility_changed_listener.h @@ -18,7 +18,7 @@ #include "task_handler_wrap.h" #ifdef SUPPORT_SCREEN -#include "window_manager.h" +#include "window_manager_lite.h" #endif // SUPPORT_SCREEN namespace OHOS { namespace AppExecFwk { diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 0e56fb0961..633b641179 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -637,7 +637,7 @@ void AppMgrServiceInner::MakeProcessName(const std::shared_ptr &abi if (appIndex != 0) { processName += std::to_string(appIndex); } - + if (!specifiedProcessFlag.empty()) { processName = (processName + ":" + specifiedProcessFlag).substr(0, MAX_SPECIFIED_PROCESS_NAME_LENGTH); TAG_LOGI(AAFwkTag::APPMGR, "specifiedProcessFlag = %{public}s, processName = %{public}s", @@ -4806,7 +4806,7 @@ void AppMgrServiceInner::RegisterFocusListener() TAG_LOGE(AAFwkTag::APPMGR, "no focusListener_"); return; } - WindowManager::GetInstance().RegisterFocusChangedListener(focusListener_); + WindowManagerLite::GetInstance().RegisterFocusChangedListener(focusListener_); #endif // SUPPORT_SCREEN TAG_LOGI(AAFwkTag::APPMGR, "RegisterFocusListener end"); } @@ -4819,7 +4819,7 @@ void AppMgrServiceInner::FreeFocusListener() TAG_LOGE(AAFwkTag::APPMGR, "no focusListener_"); return; } - WindowManager::GetInstance().UnregisterFocusChangedListener(focusListener_); + WindowManagerLite::GetInstance().UnregisterFocusChangedListener(focusListener_); focusListener_ = nullptr; #endif // SUPPORT_SCREEN TAG_LOGI(AAFwkTag::APPMGR, "FreeFocusListener end"); @@ -4908,7 +4908,7 @@ void AppMgrServiceInner::InitWindowVisibilityChangedListener() TAG_LOGE(AAFwkTag::APPMGR, "Window visibility changed listener is nullptr."); return; } - WindowManager::GetInstance().RegisterVisibilityChangedListener(inner->windowVisibilityChangedListener_); + WindowManagerLite::GetInstance().RegisterVisibilityChangedListener(inner->windowVisibilityChangedListener_); }; if (taskHandler_ == nullptr) { @@ -4926,7 +4926,7 @@ void AppMgrServiceInner::FreeWindowVisibilityChangedListener() TAG_LOGW(AAFwkTag::APPMGR, "Visibility listener has been freed."); return; } - WindowManager::GetInstance().UnregisterVisibilityChangedListener(windowVisibilityChangedListener_); + WindowManagerLite::GetInstance().UnregisterVisibilityChangedListener(windowVisibilityChangedListener_); } void AppMgrServiceInner::HandleWindowVisibilityChanged( diff --git a/services/uripermmgr/BUILD.gn b/services/uripermmgr/BUILD.gn index dcfaf17241..6791ce2e36 100644 --- a/services/uripermmgr/BUILD.gn +++ b/services/uripermmgr/BUILD.gn @@ -67,7 +67,6 @@ ohos_shared_library("libupms") { "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", - "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "graphic_2d:color_manager", @@ -115,7 +114,6 @@ ohos_static_library("libupms_static") { "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", - "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "init:libbeget_proxy", diff --git a/test/fuzztest/startability_fuzzer/BUILD.gn b/test/fuzztest/startability_fuzzer/BUILD.gn index 6cdc816bd9..de661e3377 100755 --- a/test/fuzztest/startability_fuzzer/BUILD.gn +++ b/test/fuzztest/startability_fuzzer/BUILD.gn @@ -42,6 +42,7 @@ ohos_fuzztest("StartAbilityFuzzTest") { deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", "${ability_runtime_native_path}/ability/native:abilitykit_native", diff --git a/test/moduletest/ability_test/BUILD.gn b/test/moduletest/ability_test/BUILD.gn index 304b07d7ac..2b1cb7c2a5 100644 --- a/test/moduletest/ability_test/BUILD.gn +++ b/test/moduletest/ability_test/BUILD.gn @@ -58,6 +58,7 @@ ohos_moduletest("ability_moduletest") { 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:ability_thread", "${ability_runtime_native_path}/ability/native:abilitykit_native", diff --git a/test/moduletest/start_option_display_id_test/BUILD.gn b/test/moduletest/start_option_display_id_test/BUILD.gn index 8200567b7d..f3f6dfa979 100644 --- a/test/moduletest/start_option_display_id_test/BUILD.gn +++ b/test/moduletest/start_option_display_id_test/BUILD.gn @@ -26,6 +26,7 @@ ohos_moduletest("start_option_module_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${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_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/ability_first_frame_state_observer_manager_test/ability_first_frame_state_observer_manager_test.cpp b/test/unittest/ability_first_frame_state_observer_manager_test/ability_first_frame_state_observer_manager_test.cpp index 0f095ed994..9ad61c6942 100644 --- a/test/unittest/ability_first_frame_state_observer_manager_test/ability_first_frame_state_observer_manager_test.cpp +++ b/test/unittest/ability_first_frame_state_observer_manager_test/ability_first_frame_state_observer_manager_test.cpp @@ -20,6 +20,7 @@ #undef protected #include #include "ability_first_frame_state_observer_stub.h" +#include "ability_manager_errors.h" #include "iremote_broker.h" #include "mock/include/mock_permission_verification.h" #include "mock/include/mock_my_flag.h" diff --git a/test/unittest/ability_interceptor_test/ability_interceptor_test.cpp b/test/unittest/ability_interceptor_test/ability_interceptor_test.cpp index 46259dd348..7bbb4e6490 100644 --- a/test/unittest/ability_interceptor_test/ability_interceptor_test.cpp +++ b/test/unittest/ability_interceptor_test/ability_interceptor_test.cpp @@ -57,7 +57,7 @@ public: void AbilityInterceptorTest::SetUpTestCase() { GTEST_LOG_(INFO) << "AbilityInterceptorTest SetUpTestCase called"; - AbilityManagerClient::GetInstance()->CleanAllMissions(); + DelayedSingleton::GetInstance()->CleanAllMissions(); OHOS::DelayedSingleton::DestroyInstance(); OHOS::DelayedSingleton::GetInstance()->RegisterSystemAbility( diff --git a/test/unittest/ability_manager_client_branch_test/BUILD.gn b/test/unittest/ability_manager_client_branch_test/BUILD.gn index aed05b337b..313201ab54 100644 --- a/test/unittest/ability_manager_client_branch_test/BUILD.gn +++ b/test/unittest/ability_manager_client_branch_test/BUILD.gn @@ -42,6 +42,7 @@ ohos_unittest("ability_manager_client_branch_test") { } deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_innerkits_path}/app_manager:app_manager", "${ability_runtime_native_path}/ability/native:abilitykit_native", diff --git a/test/unittest/ability_manager_proxy_test/BUILD.gn b/test/unittest/ability_manager_proxy_test/BUILD.gn index 5402ce7ce4..65efd7546f 100644 --- a/test/unittest/ability_manager_proxy_test/BUILD.gn +++ b/test/unittest/ability_manager_proxy_test/BUILD.gn @@ -43,6 +43,7 @@ ohos_unittest("ability_manager_proxy_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/ability_manager_service_second_test/BUILD.gn b/test/unittest/ability_manager_service_second_test/BUILD.gn index 07b1f0c246..395f4ba9a8 100644 --- a/test/unittest/ability_manager_service_second_test/BUILD.gn +++ b/test/unittest/ability_manager_service_second_test/BUILD.gn @@ -33,6 +33,8 @@ ohos_unittest("ability_manager_service_second_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_base", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_innerkits_path}/app_manager:app_manager", diff --git a/test/unittest/ability_manager_service_third_test/BUILD.gn b/test/unittest/ability_manager_service_third_test/BUILD.gn index 5365429409..a22415897a 100644 --- a/test/unittest/ability_manager_service_third_test/BUILD.gn +++ b/test/unittest/ability_manager_service_third_test/BUILD.gn @@ -55,6 +55,7 @@ ohos_unittest("ability_manager_service_third_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_innerkits_path}/app_manager:app_manager", diff --git a/test/unittest/ability_manager_stub_test/ability_manager_stub_test.cpp b/test/unittest/ability_manager_stub_test/ability_manager_stub_test.cpp index 0e8689ec66..a5e839e335 100644 --- a/test/unittest/ability_manager_stub_test/ability_manager_stub_test.cpp +++ b/test/unittest/ability_manager_stub_test/ability_manager_stub_test.cpp @@ -14,6 +14,7 @@ */ #include +#include "ability_manager_errors.h" #include "ability_manager_stub_impl_mock.h" #include "ability_scheduler.h" #include "app_debug_listener_stub_mock.h" diff --git a/test/unittest/ability_record_test/BUILD.gn b/test/unittest/ability_record_test/BUILD.gn index 00629fe296..140617f86f 100644 --- a/test/unittest/ability_record_test/BUILD.gn +++ b/test/unittest/ability_record_test/BUILD.gn @@ -47,6 +47,7 @@ ohos_unittest("ability_record_test") { } deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", diff --git a/test/unittest/ability_record_test/ability_record_test.cpp b/test/unittest/ability_record_test/ability_record_test.cpp index fe0559f9ee..c65541e6b2 100644 --- a/test/unittest/ability_record_test/ability_record_test.cpp +++ b/test/unittest/ability_record_test/ability_record_test.cpp @@ -46,7 +46,6 @@ using namespace testing::ext; using namespace OHOS::AppExecFwk; -using namespace OHOS::AbilityBase::Constants; namespace OHOS { namespace AAFwk { @@ -56,6 +55,7 @@ const std::string DLP_BUNDLE_NAME = "com.ohos.dlpmanager"; const std::string SHELL_ASSISTANT_BUNDLENAME = "com.huawei.shell_assistant"; const std::string SHOW_ON_LOCK_SCREEN = "ShowOnLockScreen"; const std::string URI_PERMISSION_TABLE_NAME = "uri_permission"; +constexpr const char* COMPRESS_PROPERTY = "compress"; } class AbilityRecordTest : public testing::TestWithParam { public: diff --git a/test/unittest/ams_ability_running_record_test/BUILD.gn b/test/unittest/ams_ability_running_record_test/BUILD.gn index c49de4f335..0b063d09e0 100644 --- a/test/unittest/ams_ability_running_record_test/BUILD.gn +++ b/test/unittest/ams_ability_running_record_test/BUILD.gn @@ -87,7 +87,7 @@ ohos_unittest("AmsAbilityRunningRecordTest") { ] if (ability_runtime_graphics) { - external_deps += [ "window_manager:libwm" ] + external_deps += [ "window_manager:libwm_lite" ] } if (ability_runtime_use_memmgr_plugin) { diff --git a/test/unittest/ams_app_workflow_test/BUILD.gn b/test/unittest/ams_app_workflow_test/BUILD.gn index fd9bb92029..25944d1736 100644 --- a/test/unittest/ams_app_workflow_test/BUILD.gn +++ b/test/unittest/ams_app_workflow_test/BUILD.gn @@ -81,7 +81,7 @@ ohos_unittest("AmsWorkFlowTest") { if (ability_runtime_graphics) { external_deps += [ - "window_manager:libwm", + "window_manager:libwm_lite", "window_manager:libwsutils", ] } diff --git a/test/unittest/ams_recent_app_list_test/BUILD.gn b/test/unittest/ams_recent_app_list_test/BUILD.gn index be62d1996a..0ff6a27649 100644 --- a/test/unittest/ams_recent_app_list_test/BUILD.gn +++ b/test/unittest/ams_recent_app_list_test/BUILD.gn @@ -98,7 +98,7 @@ ohos_unittest("AmsRecentAppListTest") { if (ability_runtime_graphics) { external_deps += [ - "window_manager:libwm", + "window_manager:libwm_lite", "window_manager:libwsutils", ] } diff --git a/test/unittest/ams_service_app_spawn_client_test/BUILD.gn b/test/unittest/ams_service_app_spawn_client_test/BUILD.gn index 1233cc33b4..f58c66b7ba 100644 --- a/test/unittest/ams_service_app_spawn_client_test/BUILD.gn +++ b/test/unittest/ams_service_app_spawn_client_test/BUILD.gn @@ -93,7 +93,7 @@ ohos_unittest("AmsServiceAppSpawnClientTest") { ] if (ability_runtime_graphics) { - external_deps += [ "window_manager:libwm" ] + external_deps += [ "window_manager:libwm_lite" ] } if (ability_runtime_use_memmgr_plugin) { diff --git a/test/unittest/ams_service_event_drive_test/BUILD.gn b/test/unittest/ams_service_event_drive_test/BUILD.gn index 211b288475..0ddbc8612f 100644 --- a/test/unittest/ams_service_event_drive_test/BUILD.gn +++ b/test/unittest/ams_service_event_drive_test/BUILD.gn @@ -103,7 +103,7 @@ ohos_unittest("AmsServiceEventDriveTest") { } if (ability_runtime_graphics) { - external_deps += [ "window_manager:libwm" ] + external_deps += [ "window_manager:libwm_lite" ] } } 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 6fa7edb9c8..bfa9cecd26 100644 --- a/test/unittest/ams_service_load_ability_process_test/BUILD.gn +++ b/test/unittest/ams_service_load_ability_process_test/BUILD.gn @@ -101,7 +101,7 @@ ohos_unittest("AmsServiceLoadAbilityProcessTest") { if (ability_runtime_graphics) { external_deps += [ - "window_manager:libwm", + "window_manager:libwm_lite", "window_manager:libwsutils", ] } diff --git a/test/unittest/ams_service_startup_test/BUILD.gn b/test/unittest/ams_service_startup_test/BUILD.gn index db16992991..9ba0446569 100644 --- a/test/unittest/ams_service_startup_test/BUILD.gn +++ b/test/unittest/ams_service_startup_test/BUILD.gn @@ -92,7 +92,7 @@ ohos_unittest("AmsServiceStartupTest") { ] if (ability_runtime_graphics) { - external_deps += [ "window_manager:libwm" ] + external_deps += [ "window_manager:libwm_lite" ] } if (ability_runtime_use_memmgr_plugin) { diff --git a/test/unittest/app_mgr_service_event_handler_test/BUILD.gn b/test/unittest/app_mgr_service_event_handler_test/BUILD.gn index 74682c90ca..abf6e79cef 100644 --- a/test/unittest/app_mgr_service_event_handler_test/BUILD.gn +++ b/test/unittest/app_mgr_service_event_handler_test/BUILD.gn @@ -96,7 +96,7 @@ ohos_unittest("AMSEventHandlerTest") { if (ability_runtime_graphics) { external_deps += [ - "window_manager:libwm", + "window_manager:libwm_lite", "window_manager:libwsutils", ] } 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 20ddd169dc..cd2eace171 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 @@ -4303,7 +4303,7 @@ HWTEST_F(AppMgrServiceInnerTest, SetSupportedProcessCacheSelf_001, TestSize.Leve EXPECT_NE(appMgrServiceInner, nullptr); bool isSupported = false; - EXPECT_EQ(appMgrServiceInner->SetSupportedProcessCacheSelf(isSupported), CHECK_PERMISSION_FAILED); + EXPECT_EQ(appMgrServiceInner->SetSupportedProcessCacheSelf(isSupported), AAFwk::CHECK_PERMISSION_FAILED); appMgrServiceInner->appRunningManager_ = nullptr; EXPECT_EQ(appMgrServiceInner->SetSupportedProcessCacheSelf(isSupported), ERR_NO_INIT); diff --git a/test/unittest/frameworks_kits_ability_ability_runtime_test/BUILD.gn b/test/unittest/frameworks_kits_ability_ability_runtime_test/BUILD.gn index 3a95c5a187..6f0f8660ca 100644 --- a/test/unittest/frameworks_kits_ability_ability_runtime_test/BUILD.gn +++ b/test/unittest/frameworks_kits_ability_ability_runtime_test/BUILD.gn @@ -41,6 +41,7 @@ ohos_unittest("ability_context_impl_test") { deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:mission_info", "${ability_runtime_native_path}/ability:ability_context_native", "${ability_runtime_native_path}/ability/native:abilitykit_native", diff --git a/test/unittest/frameworks_kits_ability_native_test/BUILD.gn b/test/unittest/frameworks_kits_ability_native_test/BUILD.gn index e42312dc85..c24593b512 100644 --- a/test/unittest/frameworks_kits_ability_native_test/BUILD.gn +++ b/test/unittest/frameworks_kits_ability_native_test/BUILD.gn @@ -2014,7 +2014,7 @@ ohos_unittest("reserse_continuation_scheduler_primary_proxy_test") { ohos_unittest("distributed_client_test") { module_out_path = module_output_path sources = [ - "${ability_runtime_native_path}/ability/native/distributed_ability_runtime/distributed_client.cpp", + "${ability_runtime_services_path}/abilitymgr/src/distributed_client.cpp", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit/src/mock_ability_connect_callback.cpp", "distributed_client_test.cpp", ] diff --git a/test/unittest/pending_want_record_test/BUILD.gn b/test/unittest/pending_want_record_test/BUILD.gn index 2e1bc80c51..81def2a390 100644 --- a/test/unittest/pending_want_record_test/BUILD.gn +++ b/test/unittest/pending_want_record_test/BUILD.gn @@ -39,6 +39,7 @@ ohos_unittest("pending_want_record_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", diff --git a/test/unittest/sender_info_test/BUILD.gn b/test/unittest/sender_info_test/BUILD.gn index 42338c58b6..bb3d4217b1 100644 --- a/test/unittest/sender_info_test/BUILD.gn +++ b/test/unittest/sender_info_test/BUILD.gn @@ -37,6 +37,7 @@ ohos_unittest("sender_info_test") { } deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", diff --git a/test/unittest/service_extension_context_test/BUILD.gn b/test/unittest/service_extension_context_test/BUILD.gn index 613a45a60a..ffed8bfbaa 100644 --- a/test/unittest/service_extension_context_test/BUILD.gn +++ b/test/unittest/service_extension_context_test/BUILD.gn @@ -40,6 +40,7 @@ ohos_unittest("service_extension_context_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_napi_path}/inner/napi_common:napi_common", "${ability_runtime_native_path}/ability/native:ability_business_error", "${ability_runtime_native_path}/ability/native:abilitykit_native", diff --git a/test/unittest/start_option_display_id_test/BUILD.gn b/test/unittest/start_option_display_id_test/BUILD.gn index 7d21032355..498b299d6a 100644 --- a/test/unittest/start_option_display_id_test/BUILD.gn +++ b/test/unittest/start_option_display_id_test/BUILD.gn @@ -26,6 +26,7 @@ ohos_unittest("start_option_display_id_test") { configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] deps = [ + "${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_services_path}/abilitymgr:abilityms", diff --git a/test/unittest/start_options_test/BUILD.gn b/test/unittest/start_options_test/BUILD.gn index eb8b0f8469..842bfdcec1 100755 --- a/test/unittest/start_options_test/BUILD.gn +++ b/test/unittest/start_options_test/BUILD.gn @@ -30,6 +30,7 @@ ohos_unittest("start_options_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", diff --git a/test/unittest/trigger_Info_test/BUILD.gn b/test/unittest/trigger_Info_test/BUILD.gn index 7c883d7e15..4dfb289f4e 100644 --- a/test/unittest/trigger_Info_test/BUILD.gn +++ b/test/unittest/trigger_Info_test/BUILD.gn @@ -29,6 +29,7 @@ ohos_unittest("trigger_Info_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_services_path}/abilitymgr:abilityms", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", diff --git a/test/unittest/ui_ability_lifecycle_manager_test/BUILD.gn b/test/unittest/ui_ability_lifecycle_manager_test/BUILD.gn index b3e31e0715..e85f589d8f 100644 --- a/test/unittest/ui_ability_lifecycle_manager_test/BUILD.gn +++ b/test/unittest/ui_ability_lifecycle_manager_test/BUILD.gn @@ -45,6 +45,7 @@ ohos_unittest("ui_ability_lifecycle_manager_test") { deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", "${ability_runtime_innerkits_path}/ability_manager:process_options", "${ability_runtime_innerkits_path}/app_manager:app_manager", diff --git a/test/unittest/want_receiver_stub_test/BUILD.gn b/test/unittest/want_receiver_stub_test/BUILD.gn index 3cd0a69ab2..4cb687cb2b 100644 --- a/test/unittest/want_receiver_stub_test/BUILD.gn +++ b/test/unittest/want_receiver_stub_test/BUILD.gn @@ -40,6 +40,7 @@ ohos_unittest("want_receiver_stub_test") { } deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", diff --git a/test/unittest/want_sender_proxy_test/BUILD.gn b/test/unittest/want_sender_proxy_test/BUILD.gn index 1453f6a085..a9c48baba8 100644 --- a/test/unittest/want_sender_proxy_test/BUILD.gn +++ b/test/unittest/want_sender_proxy_test/BUILD.gn @@ -38,6 +38,7 @@ ohos_unittest("want_sender_proxy_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification", diff --git a/test/unittest/want_sender_stub_test/BUILD.gn b/test/unittest/want_sender_stub_test/BUILD.gn index e45eb9aa98..96fdb67b2d 100644 --- a/test/unittest/want_sender_stub_test/BUILD.gn +++ b/test/unittest/want_sender_stub_test/BUILD.gn @@ -39,6 +39,7 @@ ohos_unittest("want_sender_stub_test") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ + "${ability_runtime_innerkits_path}/wantagent:wantagent_innerkits", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_services_path}/abilitymgr:abilityms", "${ability_runtime_services_path}/common:perm_verification",